外卖项目day02-员工管理--编辑员工功能实现
This commit is contained in:
@@ -108,4 +108,21 @@ public class EmployeeController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("根据ID查询员工")
|
||||
@GetMapping("/{id}")
|
||||
public Result<Employee> getById(@PathVariable Long id){
|
||||
log.info("根据ID查询员工:{}",id);
|
||||
Employee employee = employeeService.getById(id);
|
||||
return Result.success(employee);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑员工")
|
||||
@PutMapping
|
||||
public Result update(@RequestBody EmployeeDTO employeeDTO){
|
||||
log.info("编辑员工:{}",employeeDTO);
|
||||
employeeService.update(employeeDTO);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user