package com.gtiit.shr.controller;

import com.gtiit.shr.common.Result;
import com.gtiit.shr.service.AttendanceClockInService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
@Api(
        tags = {"用户接口"}
)
public class AttendanceDateController {
    @Autowired
    AttendanceClockInService attendanceClockInService;


    @RequestMapping({"/hello"})
    public String synAttendanceData() {
        return "hello  springboot";
    }

    @GetMapping({"/attendanceClockIn"})
    public Result AttendanceClockIn() {
        Result result = new Result();

        try {
            result = this.attendanceClockInService.doAttendanceClock((String)null, (String)null, (String)null);
            return result;
        } catch (Exception var3) {
            result.setData("系统异常，请联系管理员分析日志:" + var3.getMessage());
            result.setCode(0);
            return result;
        }
    }

    @GetMapping({"/attendance"})
    public Result attendance(@RequestParam String bigDat, @RequestParam String endDat, @RequestParam String attNum) {
        Result result = new Result();

        try {
            result = this.attendanceClockInService.doAttendanceClock(bigDat, endDat, attNum);
            return result;
        } catch (Exception var6) {
            result.setData("系统异常，请联系管理员分析日志:" + var6.getMessage());
            result.setCode(0);
            return result;
        }
    }
}
