Skip to content

Commit

Permalink
[#179] feat - attendance controller 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
hschoi1104 committed Apr 18, 2021
1 parent af10410 commit a780bde
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions backend/src/controller/attendance.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { AttendanceService } from '../service/attendance.service';
import { Response } from '../models/Response';

export class AttendanceController {
static createAttendance = async(req,res,next)=>{
try{
const result = await AttendanceService.createAttendance(req);
return res.status(201).json(new Response(201,'create Attendance success', result));
}catch(err){
console.log(err);
next(err);
}
}

static deleteAttendances = async(req,res,next)=>{
try{
const result = await AttendanceService.deleteAttendances(req);
return res.status(200).json(new Response(200,'delete Attendances success',result));
}catch(err){
console.log(err);
next(err);
}
}

static getAttendanceByDate = async(req,res,next)=>{
try{
const result = await AttendanceService.getAttendanceByDate(req);
return res.status(200).json(new Response(200,'get Attendance success',result));
}catch(err){
console.log(err);
next(err);
}
}

static getAttendanceByPeriod = async(req,res,next)=>{
try{
const result = await AttendanceService.getAttendanceByPeriod(req);
return res.status(200).json(new Response(200,'get Attendance success',result));
}catch(err){
console.log(err);
next(err);
}
}

static updateAttendance = async(req,res,next)=>{
try{
const result = await AttendanceService.updateAttendance(req);
return res.status(200).json(new Response(200,'update Attendance success',result));
}catch(err){
console.log(err);
next(err);
}
}
}

0 comments on commit a780bde

Please sign in to comment.