| | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.api.CommonPage; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.controller.BaseController; |
| | | import com.ycl.dto.UmsAdminLoginParam; |
| | | import com.ycl.dto.UmsAdminParam; |
| | | import com.ycl.dto.UpdateAdminPasswordParam; |
| | | import com.ycl.entity.user.UmsAdmin; |
| | | import com.ycl.entity.user.UmsRole; |
| | | import com.ycl.service.user.UmsAdminService; |
| | | import com.ycl.service.user.UmsRoleService; |
| | | import com.ycl.entity.platform.user.UmsAdmin; |
| | | import com.ycl.entity.platform.user.UmsRole; |
| | | import com.ycl.service.redis.RedisService; |
| | | import com.ycl.service.platform.user.UmsAdminService; |
| | | import com.ycl.service.platform.user.UmsRoleService; |
| | | import com.ycl.utils.redis.RedisKey; |
| | | import com.ycl.vo.user.UserVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.security.Principal; |
| | | import java.util.HashMap; |
| | |
| | | @Controller |
| | | @Api(tags = "后台用户管理") |
| | | @RequestMapping("/admin") |
| | | public class UmsAdminController { |
| | | public class UmsAdminController extends BaseController { |
| | | @Value("${jwt.tokenHeader}") |
| | | private String tokenHeader; |
| | | @Value("${jwt.tokenHead}") |
| | |
| | | private UmsAdminService adminService; |
| | | @Autowired |
| | | private UmsRoleService roleService; |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | @ApiOperation(value = "用户注册") |
| | | @RequestMapping(value = "/register", method = RequestMethod.POST) |
| | |
| | | @RequestMapping(value = "/logout", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | public CommonResult logout() { |
| | | String operatorName = fetchOperator(request).getOperatorName(); |
| | | redisService.del(RedisKey.PLATFORM_TOKEN_KEY.concat(operatorName)); |
| | | return CommonResult.success(null); |
| | | } |
| | | |
| | | @ApiOperation("分页") |
| | | @RequestMapping(value = "/page", method = RequestMethod.GET) |
| | | @RequestMapping(value = "/list", method = RequestMethod.GET) |
| | | @ResponseBody |
| | | public CommonResult<IPage<UmsAdmin>> list(@Validated UserVO.PageUserVO pageUserVO) { |
| | | public CommonResult<IPage<UmsAdmin>> list(@Validated UserVO.PageUserVO pageUserVO) { |
| | | IPage<UmsAdmin> page = adminService.pageUser(pageUserVO); |
| | | return CommonResult.success(page); |
| | | } |