首页 > 其他分享 >EmployeeController类的新增员工save方法

EmployeeController类的新增员工save方法

时间:2023-03-20 10:00:12浏览次数:42  
标签:empId 123456 新增 员工 employee EmployeeController save

@PostMapping
public R<String> save(HttpServletRequest request, @RequestBody Employee employee) {
log.info("新增员工,员工信息:{}", employee.toString());

//初始密码123456,md5加密
employee.setPassword(DigestUtils.md5DigestAsHex("123456".getBytes()));

//employee.setCreateTime(LocalDateTime.now());
//employee.setUpdateTime(LocalDateTime.now());
//
////获取当前登录用户id
//Long empId = (Long) request.getSession().getAttribute("employee");
//
//employee.setCreateUser(empId);
//employee.setUpdateUser(empId);

employeeService.save(employee);

return R.success("新增员工成功");

}

=========================================================

 


 

 

 

 

标签:empId,123456,新增,员工,employee,EmployeeController,save
From: https://www.cnblogs.com/dahuilang21/p/17235310.html

相关文章