getUserByRoleEnumAndRegionId
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
package com.cool.store.controller.webb;
|
package com.cool.store.controller.webb;
|
||||||
|
|
||||||
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
import com.cool.store.enums.UserRoleEnum;
|
import com.cool.store.enums.UserRoleEnum;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.SysRoleService;
|
import com.cool.store.service.SysRoleService;
|
||||||
import com.google.common.collect.Lists;
|
import com.cool.store.service.UserAuthMappingService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -12,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -24,6 +27,9 @@ public class SysRoleController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleService sysRoleService;
|
private SysRoleService sysRoleService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserAuthMappingService userAuthMappingService;
|
||||||
|
|
||||||
@GetMapping(path = "/getXfsgRoles")
|
@GetMapping(path = "/getXfsgRoles")
|
||||||
public ResponseResult<Map<String, Long>> getXfsgRoles() {
|
public ResponseResult<Map<String, Long>> getXfsgRoles() {
|
||||||
return ResponseResult.success(sysRoleService.getXfsgRoles());
|
return ResponseResult.success(sysRoleService.getXfsgRoles());
|
||||||
@@ -34,4 +40,11 @@ public class SysRoleController {
|
|||||||
List<UserRoleEnum> roleList = Arrays.asList(UserRoleEnum.THEATER_MANAGER, UserRoleEnum.OPERATIONS_MANAGER, UserRoleEnum.REGION_MANAGER);
|
List<UserRoleEnum> roleList = Arrays.asList(UserRoleEnum.THEATER_MANAGER, UserRoleEnum.OPERATIONS_MANAGER, UserRoleEnum.REGION_MANAGER);
|
||||||
return ResponseResult.success(sysRoleService.getUserIdByRegionIdWithRolePriority(regionId, roleList));
|
return ResponseResult.success(sysRoleService.getUserIdByRegionIdWithRolePriority(regionId, roleList));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/getUserByRoleEnumAndRegionId")
|
||||||
|
@ApiOperation("获取有区域权限和职位")
|
||||||
|
public ResponseResult<EnterpriseUserDO> getUserByRoleEnumAndRegionId(@RequestParam("regionId") Long regionId, @RequestParam("roleName") String roleName) {
|
||||||
|
UserRoleEnum userRoleEnum = UserRoleEnum.getByDesc(roleName);
|
||||||
|
return ResponseResult.success(userAuthMappingService.getUserByRoleEnumAndRegionId(userRoleEnum, regionId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user