package com.yida.data.attendance.controller.H5;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yida.data.attendance.dto.PageAttendanceRecordDTO;
import com.yida.data.attendance.service.AttendanceRecordService;
import com.yida.data.common.core.annotation.ControllerLog;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.attendance.attendance.AttendanceRecord;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 教职工考勤规则 Controller
 *
 * @date 2023-08-09 11:37:25
 */
@Slf4j
@RestController
@RequestMapping("H5/attendanceRecord")
@RequiredArgsConstructor
@Api(tags = "移动端-打卡记录", value = "移动端-打卡记录")
public class H5AttendanceRecordController {

    private final AttendanceRecordService attendanceRecordService;

    @ApiOperation("分页查看打卡记录")
    @PostMapping("/listRecord")
    public ResultBean<IPage<AttendanceRecord>> listRule(@RequestBody PageAttendanceRecordDTO dto) {
        return ResultBean
            .buildSuccess(attendanceRecordService.listRecordPage(dto));
    }
}
