Merge branch 'master-特殊用户控制' into uat_code

# Conflicts:
#	deployment-uat.yaml
#	src/main/java/com/chinaunicom/mall/ebtp/extend/funcswitch/dao/BizFuncSwitchConfigMapper.java
#	src/main/java/com/chinaunicom/mall/ebtp/extend/funcswitch/dao/mapper/BizFuncSwitchConfigMapper.xml
This commit is contained in:
yss
2023-04-23 14:28:53 +08:00
5 changed files with 88 additions and 0 deletions

View File

@ -12,4 +12,12 @@ public interface BizFuncSwitchConfigMapper extends BaseMapper<BizFuncSwitchConfi
Integer selectByType(String type); Integer selectByType(String type);
String getValueByKey(@Param("key")String key); String getValueByKey(@Param("key")String key);
/**
* 监督角色功能根据是否有次账号控制
* @param role
* @param account
* @return
*/
String selectByUser(String role,String account);
} }

View File

@ -13,6 +13,10 @@
resultType="java.lang.Integer"> resultType="java.lang.Integer">
SELECT active FROM biz_func_switch_config WHERE `type` = #{type} SELECT active FROM biz_func_switch_config WHERE `type` = #{type}
</select> </select>
<select id="selectByUser"
resultType="java.lang.String ">
SELECT account FROM maint_base_user WHERE `role` = #{role} and account=#{account}
</select>
<select id="getValueByKey" resultType="java.lang.String" > <select id="getValueByKey" resultType="java.lang.String" >
select select
value value

View File

@ -0,0 +1,28 @@
package com.chinaunicom.mall.ebtp.extend.userswitch;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.extend.userswitch.service.UserSwitchService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@Api(tags = "用户控制")
@RequestMapping("/v1/userswitch")
public class UserSwitchController {
@Resource
private UserSwitchService userSwitchService;
/**
* 监督角色功能控制
* @param key
* @param role
* @return
*/
@PostMapping({"/findUser/{key}/{role}"})
public BaseResponse<Boolean> findUser(@PathVariable String key,@PathVariable String role){
return BaseResponse.success(userSwitchService.findUser(key,role));
}
}

View File

@ -0,0 +1,17 @@
package com.chinaunicom.mall.ebtp.extend.userswitch.service;
/**
* 监督角色控制
* @author yanss
* @date 2023/04/23
*/
public interface UserSwitchService {
/**
*
* @param key
* @param role
* @return
*/
Boolean findUser(String key, String role);
}

View File

@ -0,0 +1,31 @@
package com.chinaunicom.mall.ebtp.extend.userswitch.service.impl;
import com.chinaunicom.mall.ebtp.extend.funcswitch.dao.BizFuncSwitchConfigMapper;
import com.chinaunicom.mall.ebtp.extend.userswitch.service.UserSwitchService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* 风险管控接口实现
* @author daixc
* @date 2021/08/19
*/
@Slf4j
@Service
public class UserSwitchServiceImpl implements UserSwitchService {
@Resource
private BizFuncSwitchConfigMapper funcSwitchConfigMapper;
@Override
public Boolean findUser(String key, String role) {
String accout=funcSwitchConfigMapper.selectByUser(role,key);
if(accout!=null && StringUtils.isNotBlank(accout)){
return Boolean.TRUE;
}
return Boolean.FALSE;
}
}