From 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4 Mon Sep 17 00:00:00 2001 From: whycrzg <ruanzhigang@whycst.com> Date: 星期二, 23 二月 2021 17:19:23 +0800 Subject: [PATCH] update --- src/main/java/com/fgkj/controller/UserController.java | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/fgkj/controller/UserController.java b/src/main/java/com/fgkj/controller/UserController.java index d6d6a67..9e871ff 100644 --- a/src/main/java/com/fgkj/controller/UserController.java +++ b/src/main/java/com/fgkj/controller/UserController.java @@ -3,20 +3,23 @@ import com.fgkj.dto.ServiceModel; import com.fgkj.dto.User; import com.fgkj.services.UserService; -import com.opensymphony.xwork2.ActionSupport; import io.swagger.annotations.Api; -import org.springframework.beans.factory.annotation.Autowired; +import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; @RequestMapping("user") @RestController -@Api +@Api(tags = "user鎺ュ彛") +//Perry TODO public class UserController { - @Autowired + @Resource UserService service; @PostMapping("/") + @ApiOperation(notes = "",value="鏂板") public ServiceModel add(@RequestBody User user) { ServiceModel model= new ServiceModel(); model=service.addUser(user); @@ -24,6 +27,7 @@ return model; } @PutMapping("/") + @ApiOperation(notes = "",value="淇敼") public ServiceModel update(@RequestBody User user) { ServiceModel model= new ServiceModel(); model=service.updateUser(user); @@ -31,6 +35,7 @@ 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()); @@ -39,6 +44,7 @@ return model; } @DeleteMapping("/") + @ApiOperation(notes = "",value="鍒犻櫎") public ServiceModel del(@RequestBody User user) { ServiceModel model= new ServiceModel(); model=service.delUser(user); @@ -47,6 +53,7 @@ } @GetMapping("/") + @ApiOperation(notes = "",value="鏌ユ壘") public ServiceModel find(@RequestBody User user) { ServiceModel model= new ServiceModel(); model=service.findUser(user); @@ -54,6 +61,7 @@ return model; } @GetMapping("all") + @ApiOperation(notes = "",value="all") public ServiceModel findAll() { ServiceModel model= new ServiceModel(); model=service.findUserAll(); @@ -61,6 +69,7 @@ return model; } @GetMapping("byInfo") + @ApiOperation(notes = "",value="byInfo") public ServiceModel findByInfo(@RequestBody User user){ ServiceModel model= new ServiceModel(); model=service.findByInfo(user); @@ -68,6 +77,7 @@ 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); -- Gitblit v1.9.1