| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | import java.time.LocalDateTime; |
| | |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加") |
| | | public ResponseResult add(@RequestBody User user) { |
| | | public ResponseResult add(@Valid @RequestBody User user) { |
| | | return userService.addUser(user); |
| | | |
| | | } |
| | |
| | | */ |
| | | @PutMapping |
| | | @ApiOperation(value = "修改") |
| | | public ResponseResult edit(@RequestBody User user) { |
| | | public ResponseResult edit(@Valid @RequestBody User user) { |
| | | return userService.editUser(user); |
| | | |
| | | } |