-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#179] feat - attendance controller 생성
- Loading branch information
1 parent
af10410
commit a780bde
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |