| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Page; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.DocUser; |
| | | import com.whyc.service.DocUserService; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Api(tags = "用户管理") |
| | |
| | | |
| | | @ApiOperation(value = "查询所有用户信息",notes = "默认排除指定用户:sys_admin") |
| | | @GetMapping("getAllUser") |
| | | private Response getAllUser(){ |
| | | return service.getAllUser(); |
| | | private Response getAllUser(@RequestParam int pageCurr,@RequestParam int pageSize){ |
| | | return service.getAllUser(pageCurr,pageSize); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑所有用户信息") |
| | | @PostMapping("updateAllUser") |
| | | private Response updateAllUser(@RequestBody DocUser docUser){ |
| | | return service.updateAllUser(docUser); |
| | | @PostMapping("updateUser") |
| | | @ApiImplicitParam(name = "file", value = "上传的文件", dataTypeClass = MultipartFile.class, required = false,paramType = "form") |
| | | private Response updateUser(@RequestPart(value = "file",required = false) MultipartFile file, @RequestParam String json){ |
| | | DocUser docUser= ActionUtil.getGson().fromJson(json,DocUser.class); |
| | | return service.updateUser(file,docUser); |
| | | } |
| | | @ApiOperation(value = "新添加用户信息") |
| | | @PostMapping("addUser") |
| | | private Response addUser(@RequestBody DocUser docUser){ |
| | | return service.addUser(docUser); |
| | | @ApiImplicitParam(name = "file", value = "上传的文件", dataTypeClass = MultipartFile.class, required = false,paramType = "form") |
| | | private Response addUser(@RequestPart(value = "file",required = false) MultipartFile file,@RequestParam String json){ |
| | | DocUser docUser= ActionUtil.getGson().fromJson(json,DocUser.class); |
| | | return service.addUser(file,docUser); |
| | | } |
| | | @ApiOperation(value = "删除用户信息") |
| | | @PostMapping("deleteUser") |
| | | private Response delUser(@RequestParam int Id){ |
| | | return service.delUser(Id); |
| | | } |
| | | } |