This commit is contained in:
houjishuang
2025-06-09 15:27:59 +08:00
parent 0dd2ed08db
commit 68ee3d1ade
6 changed files with 24 additions and 4 deletions

View File

@ -3,6 +3,7 @@ package com.coscoshipping.ebtp.project.userrole.controller;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse; import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.coscoshipping.ebtp.project.user.entity.vo.SysUserVO; import com.coscoshipping.ebtp.project.user.entity.vo.SysUserVO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -22,6 +23,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@RestController @RestController
@Api(value = "用户与角色关系表") @Api(value = "用户与角色关系表")
@RequestMapping("/v1/sysuserrole") @RequestMapping("/v1/sysuserrole")
@Validated
public class SysUserRoleController{ public class SysUserRoleController{
@Resource @Resource
@ -118,4 +120,10 @@ public class SysUserRoleController{
//RespsExceptionEnum.FRAME_EXCEPTION_DEMO_NOT_FIND.customValid(list.isEmpty()); //RespsExceptionEnum.FRAME_EXCEPTION_DEMO_NOT_FIND.customValid(list.isEmpty());
return BaseResponse.success(list); return BaseResponse.success(list);
} }
@ApiOperation("查询列表数据")
@PostMapping("/hasRole")
public BaseResponse<Boolean> hasRole (@Valid @ApiParam(value = "对象数据", required = true) @RequestBody SysUserRole sysUserRole) {
return BaseResponse.success(iSysUserRoleService.hasRole(sysUserRole));
}
} }

View File

@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -20,10 +21,10 @@ import java.io.Serializable;
public class SysUserRole implements Serializable { public class SysUserRole implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@NotEmpty
@ApiModelProperty(value = "用户ID") @ApiModelProperty(value = "用户ID")
private String userId; private String userId;
@NotEmpty
@ApiModelProperty(value = "角色ID") @ApiModelProperty(value = "角色ID")
private String roleId; private String roleId;

View File

@ -22,4 +22,5 @@ public interface SysUserRoleService extends IBaseService<SysUserRole>{
boolean assignsRoles(SysUserVO sysUserVO); boolean assignsRoles(SysUserVO sysUserVO);
Boolean hasRole(SysUserRole sysUserRole);
} }

View File

@ -56,4 +56,9 @@ public class SysUserRoleServiceImpl extends BaseServiceImpl<SysUserRoleMapper,Sy
} }
return this.saveBatch(userRoleList); return this.saveBatch(userRoleList);
} }
@Override
public Boolean hasRole(SysUserRole sysUserRole) {
return this.count(Wrappers.<SysUserRole>lambdaQuery().eq(SysUserRole::getUserId, sysUserRole.getUserId()).eq(SysUserRole::getRoleId, sysUserRole.getRoleId()))>0;
}
} }

View File

@ -7,7 +7,8 @@ spring:
cloud: cloud:
nacos: nacos:
discovery: discovery:
server-addr: 127.0.0.1:8848 server-addr: 127.0.0.1:18848
group: EBTP_GROUP # 例如EBTP_GROUP
aop: aop:
auto: true #开启spring的aop配置 auto: true #开启spring的aop配置
proxy-target-class: true proxy-target-class: true
@ -136,6 +137,10 @@ mconfig:
service-name-resps: biz-service-ebtp-resps #标段应答文件 service-name-resps: biz-service-ebtp-resps #标段应答文件
service-name-rsms: biz-service-ebtp-rsms #评审微服务 service-name-rsms: biz-service-ebtp-rsms #评审微服务
service-name-tender: biz-service-ebtp-tender #标段投标微服务 service-name-tender: biz-service-ebtp-tender #标段投标微服务
service-name-agency: biz-service-ebtp-agency #招标代理库微服务
service-name-provider: biz-supplier-manage #供应商微服务
service-name-project: biz-service-ebtp-project #项目微服务
service-name-system: sys-manager-ebtp-project
wfSectionNo: '080' wfSectionNo: '080'
wfSectionName: 标段重新评审审批单 wfSectionName: 标段重新评审审批单

View File

@ -1,6 +1,6 @@
# 对应 apollo 配置中心的应用名 # 对应 apollo 配置中心的应用名
app: app:
id: sys_manager_ebtp_project id: sys-manager-ebtp-project
# Apollo 配置信息 # Apollo 配置信息
apollo: apollo: