| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.cache.annotation.CachePut; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | */ |
| | | @GetMapping(value = "/users/name/{username}") |
| | | @ApiOperation(value = "根据用户名查询用户实体") |
| | | @Cacheable(value = "user", key = "#username") |
| | | // @Cacheable(value = "user", key = "#username") |
| | | public SysUser selectByUsername(@PathVariable String username) { |
| | | return appUserService.selectByUsername(username); |
| | | } |
| | |
| | | }) |
| | | @GetMapping("/users") |
| | | public PageResult<SysUser> findUsers(@RequestParam Map<String, Object> params) { |
| | | // log.info("租户ID:"+ TenantContextHolder.getTenant()); |
| | | // log.info("IP:"+request.getHeader(CommonConstant.USER_AGENT_IP)); |
| | | return appUserService.findUsers(params); |
| | | } |
| | | /** |
| | |
| | | * 返回给Python加密密码 |
| | | */ |
| | | @GetMapping(value = "/users/python") |
| | | public ResultBody jiaMipython(@RequestBody String password) { |
| | | public ResultBody jiaMipython(@RequestParam("password") String password) { |
| | | if (password==null||"".equals(password)) { |
| | | return ResultBody.failed().msg("请输入密码"); |
| | | } |
| | |
| | | * 根据map查询 |
| | | */ |
| | | private boolean checkAdmin(long id) { |
| | | return id == 1L; |
| | | return id == CommonConstant.ADMIN_USER_ID; |
| | | } |
| | | |
| | | @PostMapping("/users/findAll") |