package jnpf.attendance.controller;

import io.swagger.v3.oas.annotations.Operation;
import jnpf.attendance.service.AttendanceClockInPicService;
import jnpf.base.ActionResult;
import jnpf.entity.attendance.AttendanceClockInPic;
import jnpf.model.attendance.vo.ClockInPicVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * 打卡图片控制器
 *
 * @author shitou
 * @create 2024-10-30
 */
@Slf4j
@RestController
@RequestMapping(value = "/attendance/clockIn/pic")
public class AttendanceClockInPicController {

    @Resource
    private AttendanceClockInPicService attendanceClockInPicService;

    @Operation(summary = "查询外勤打卡图片列表")
    @GetMapping(value = "/list/{clockInId}")
    public ActionResult<List<ClockInPicVo>> getClockInPicList(@Valid @PathVariable("clockInId") String clockInId) {
        log.info("查询外勤打卡图片列表，入参=>{}", clockInId);
        long st = System.currentTimeMillis();
        List<ClockInPicVo> clockInPicList = attendanceClockInPicService.getClockInPicList(clockInId);
        long ent = System.currentTimeMillis();
        log.info("查询外勤打卡图片列表，耗时=>{}", ent - st + " 毫秒");
        return ActionResult.success(clockInPicList);
    }
}
