| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.api.R; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.service.UserService; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.RSAUtil; |
| | | import io.swagger.annotations.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加") |
| | | public Response add(@RequestBody UserInf user){ |
| | | return userService.add(user); |
| | | } |
| | | //@PostMapping |
| | | //@ApiOperation(value = "添加") |
| | | //public Response add(@RequestBody UserInf user){ |
| | | // return userService.add(user); |
| | | //} |
| | | |
| | | @PostMapping("/addByRSA") |
| | | @PostMapping |
| | | @ApiOperation(value = "添加-RSA加密") |
| | | public Response addByRSA(@RequestBody UserInf user){ |
| | | return userService.addByRSA(user); |
| | | } |
| | | |
| | | @PostMapping("register") |
| | | @ApiOperation(value = "注册用户") |
| | | public Response register(@RequestBody UserInf user){ |
| | | return userService.registerUser(user); |
| | | } |
| | | @GetMapping |
| | | @ApiOperation(value = "查询byId") |
| | | public Response<UserInf> getById(@RequestParam int id){ |
| | |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation(value = "查询分页") |
| | | public Response<IPage<UserInf>> getPage(@RequestParam int pageNum,int pageSize){ |
| | | Page<Object> page = new Page<>(pageNum, pageSize); |
| | | return new Response<IPage<UserInf>>().set(1,userService.getAllWithPage(page)); |
| | | public Response getPage(@RequestParam int pageNum,int pageSize){ |
| | | return new Response().set(1,userService.getAllWithPage(pageNum,pageSize)); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "编辑") |
| | | public Response update(@RequestBody UserInf user){ |
| | | userService.update(user); |
| | | return new Response().setII(1,"更新成功"); |
| | | return userService.update(user); |
| | | } |
| | | |
| | | @DeleteMapping |
| | |
| | | return new Response().set(1,userInf); |
| | | } |
| | | |
| | | /** |
| | | * 账号解锁 |
| | | */ |
| | | @ApiOperation(value = "账号解锁",notes = "unLockType=1为失败锁定解锁,2为上个月未登录锁定解锁") |
| | | @PutMapping("unLock") |
| | | public Response unLock(@RequestParam int uId,@RequestParam int unLockType){ |
| | | userService.unLock(uId,unLockType); |
| | | return new Response().setII(1,"解锁成功"); |
| | | } |
| | | |
| | | /** |
| | | * 包机组重做(穿梭框)查询所有的用户-更新为查询未被添加到权限组的所有用户 |
| | | */ |
| | | @ApiOperation(value = "包机组重做(穿梭框)查询所有的用户") |
| | | @GetMapping("searchCS_All2") |
| | | public Response searchCS_All2(){ |
| | | List<UserInf> list = userService.searchCS_All2(); |
| | | return new Response().set(1,list); |
| | | } |
| | | |
| | | /** |
| | | * 告警派单中,查询站点人员信息 |
| | | * @param stationId |
| | | * @return |
| | | */ |
| | | @ApiOperation(tags = "告警派单", value = "根据站点查询相关人员", notes = "User_infAction!getUserInfoByStationId") |
| | | @GetMapping("getUserInfoByStationId") |
| | | public Response getUserInfoByStationId(@RequestParam String stationId){ |
| | | List<UserInf> list = userService.getUserInfoByStationId(stationId); |
| | | return new Response().set(1,list); |
| | | } |
| | | |
| | | @ApiOperation(value = "伪单点登录",notes = "返回的data为布尔值,是否登录成功;data2:用户所在的权限组id;data3为用户对象,内含属性uid,uname,urole") |
| | | @GetMapping("loginByUId") |
| | | public Response searchSnIdByUId(@RequestParam int uId){ |
| | | return userService.loginByUId(uId); |
| | | } |
| | | |
| | | } |