| | |
| | | import com.fgkj.dto.User; |
| | | import com.fgkj.services.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | @RequestMapping("user") |
| | | @RestController |
| | | @Api |
| | | @Api(tags = "user接口") |
| | | public class UserController { |
| | | |
| | | @Resource |
| | | UserService service; |
| | | |
| | | @PostMapping("/") |
| | | @ApiOperation(notes = "",value="新增") |
| | | public ServiceModel add(@RequestBody User user) { |
| | | ServiceModel model= new ServiceModel(); |
| | | model=service.addUser(user); |
| | |
| | | return model; |
| | | } |
| | | @PutMapping("/") |
| | | @ApiOperation(notes = "",value="修改") |
| | | public ServiceModel update(@RequestBody User user) { |
| | | ServiceModel model= new ServiceModel(); |
| | | model=service.updateUser(user); |
| | |
| | | return model; |
| | | } |
| | | @PutMapping("pass") |
| | | @ApiOperation(notes = "",value="修改pass") |
| | | public ServiceModel updatePass(@RequestBody User user){ |
| | | ServiceModel model= new ServiceModel(); |
| | | //user.setUpass(ActionUtil.Encryption(user.getUpass()).toString()); |
| | |
| | | return model; |
| | | } |
| | | @DeleteMapping("/") |
| | | @ApiOperation(notes = "",value="删除") |
| | | public ServiceModel del(@RequestBody User user) { |
| | | ServiceModel model= new ServiceModel(); |
| | | model=service.delUser(user); |
| | |
| | | } |
| | | |
| | | @GetMapping("/") |
| | | @ApiOperation(notes = "",value="查找") |
| | | public ServiceModel find(@RequestBody User user) { |
| | | ServiceModel model= new ServiceModel(); |
| | | model=service.findUser(user); |
| | |
| | | return model; |
| | | } |
| | | @GetMapping("all") |
| | | @ApiOperation(notes = "",value="all") |
| | | public ServiceModel findAll() { |
| | | ServiceModel model= new ServiceModel(); |
| | | model=service.findUserAll(); |
| | |
| | | return model; |
| | | } |
| | | @GetMapping("byInfo") |
| | | @ApiOperation(notes = "",value="byInfo") |
| | | public ServiceModel findByInfo(@RequestBody User user){ |
| | | ServiceModel model= new ServiceModel(); |
| | | model=service.findByInfo(user); |
| | |
| | | return model; |
| | | } |
| | | @GetMapping("byPage") |
| | | @ApiOperation(notes = "",value="byPage") |
| | | public ServiceModel findByPage(@RequestParam int currentPage,@RequestParam int pageSize){ |
| | | ServiceModel model= new ServiceModel(); |
| | | model=service.findByAge(currentPage, pageSize); |