yewuyuan
This commit is contained in:
@ -3,6 +3,7 @@ package com.coscoshipping.ebtp.project.userrole.controller;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
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.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -22,6 +23,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@RestController
|
||||
@Api(value = "用户与角色关系表")
|
||||
@RequestMapping("/v1/sysuserrole")
|
||||
@Validated
|
||||
public class SysUserRoleController{
|
||||
|
||||
@Resource
|
||||
@ -118,4 +120,10 @@ public class SysUserRoleController{
|
||||
//RespsExceptionEnum.FRAME_EXCEPTION_DEMO_NOT_FIND.customValid(list.isEmpty());
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@ -20,10 +21,10 @@ import java.io.Serializable;
|
||||
public class SysUserRole implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotEmpty
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private String userId;
|
||||
|
||||
@NotEmpty
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
private String roleId;
|
||||
|
||||
|
@ -22,4 +22,5 @@ public interface SysUserRoleService extends IBaseService<SysUserRole>{
|
||||
boolean assignsRoles(SysUserVO sysUserVO);
|
||||
|
||||
|
||||
Boolean hasRole(SysUserRole sysUserRole);
|
||||
}
|
||||
|
@ -56,4 +56,9 @@ public class SysUserRoleServiceImpl extends BaseServiceImpl<SysUserRoleMapper,Sy
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,8 @@ spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 127.0.0.1:18848
|
||||
group: EBTP_GROUP # 例如:EBTP_GROUP
|
||||
aop:
|
||||
auto: true #开启spring的aop配置
|
||||
proxy-target-class: true
|
||||
@ -136,6 +137,10 @@ mconfig:
|
||||
service-name-resps: biz-service-ebtp-resps #标段应答文件
|
||||
service-name-rsms: biz-service-ebtp-rsms #评审微服务
|
||||
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'
|
||||
wfSectionName: 标段重新评审审批单
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# 对应 apollo 配置中心的应用名
|
||||
app:
|
||||
id: sys_manager_ebtp_project
|
||||
id: sys-manager-ebtp-project
|
||||
|
||||
# Apollo 配置信息
|
||||
apollo:
|
||||
|
Reference in New Issue
Block a user