5

package com.example.demo11.Controller;
import com.example.demo11.Service.AttendanceService;
import com.example.demo11.entity.Attendance;
import com.example.demo11.entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
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;
//质量检测

@RestController
@RequestMapping("/attendance")
public class AttendanceController {
@Autowired
private AttendanceService attendanceService;

@PostMapping("/startTime")
public Result<String> startTime(@RequestBody Attendance attendance) {
Boolean flag = attendanceService.insertAttendance(attendance);
if (flag) {
return Result.success("上班打卡成功");
}
return Result.error("上班打卡异常");

}

@PostMapping("/endTime")
public Result<String> endTime(@RequestBody String userId) {
Boolean flag = attendanceService.updateAttendance(userId);
if (flag) {
return Result.success("下班打卡成功");
}
return Result.error("下班打卡异常");
}

}
posted @   liuxuechao  阅读(1)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示