2024年5月13日第四十七篇
今天经过讨论我修改了后端代码,如下。
增加了审核流程和重置密码功能
*/ @RestController @RequestMapping public class EventLogController { @Autowired IEventLogService eventService; @Autowired IUserService userService; @RequestMapping("/event-log/sign-up") @CrossOrigin ResponseEntity<?> posteventlog(Authentication authentication,@RequestBody EventLog eventLog ) {//添加项目 User user=userService.findByName(authentication.getName()); eventLog.setUserId(user.getId()); return ResponseEntity.ok(eventService.save(eventLog)); } @RequestMapping("/api/event-log/audit") @CrossOrigin ResponseEntity<?> auditeventlog(@RequestBody EventLog eventLog ) {//添加项目 return ResponseEntity.ok(eventService.audituser(eventLog)); } @RequestMapping("/event-log/submit") @CrossOrigin ResponseEntity<?> updateeventlog(Authentication authentication,@RequestBody EventLog eventLog) {//修改项目 User user=userService.findByName(authentication.getName()); eventLog.setUserId(user.getId()); System.out.println(eventLog.getEventId()); return ResponseEntity.ok(eventService.updatebyuser(eventLog)); } }