/*
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
|
*
|
* Redistribution and use in source and binary forms, with or without
|
* modification, are permitted provided that the following conditions are met:
|
*
|
* Redistributions of source code must retain the above copyright notice,
|
* this list of conditions and the following disclaimer.
|
* Redistributions in binary form must reproduce the above copyright
|
* notice, this list of conditions and the following disclaimer in the
|
* documentation and/or other materials provided with the distribution.
|
* Neither the name of the dreamlu.net developer nor the names of its
|
* contributors may be used to endorse or promote products derived from
|
* this software without specific prior written permission.
|
* Author: Chill 庄骞 (smallchill@163.com)
|
*/
|
package com.vci.ubcs.omd.feign;
|
|
import com.vci.ubcs.omd.entity.Enum;
|
import com.vci.ubcs.omd.entity.EnumItem;
|
import com.vci.ubcs.omd.vo.EnumVO;
|
import com.vci.ubcs.starter.exception.VciBaseException;
|
import com.vci.ubcs.system.user.vo.UserVO;
|
import io.swagger.models.auth.In;
|
import org.springblade.core.launch.constant.AppConstant;
|
import org.springblade.core.mp.support.BladePage;
|
import org.springblade.core.tool.api.R;
|
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import java.util.List;
|
|
/**
|
* 枚举定义 Feign接口类
|
*
|
* @author yuxc
|
* @since 2023-05-08
|
*/
|
@FeignClient(
|
value = AppConstant.APPLICATION_NAME_OMD,
|
fallback = IWebSecretFallback.class
|
)
|
public interface IWebSecretClient {
|
|
String API_PREFIX = "/client";
|
String MINUSER = API_PREFIX + "/secret/min-user";
|
String MINDATA = API_PREFIX + "/secret/min-data";
|
String MINIP = API_PREFIX + "/secret/min-ip";
|
String USER = API_PREFIX + "/secret/user";
|
String USERVO = API_PREFIX + "/secret/uservo";
|
String CHECKDATA = API_PREFIX + "/secret/check-data";
|
String CHECKUSERDATA = API_PREFIX + "/secret/chec-user-data";
|
String CHECKUSERIDDATA = API_PREFIX + "/secret/chec-userid-data";
|
String CHECKVO = API_PREFIX + "/secret/checkvo";
|
String IP = API_PREFIX + "/secret/ip";
|
String IPUSER = API_PREFIX + "/secret/ip-user";
|
String IPSECRET = API_PREFIX + "/secret/ip-secret";
|
String IPUSERID = API_PREFIX + "/secret/ip-userid";
|
String IPUSERVO = API_PREFIX + "/secret/ip-uservo";
|
|
/**
|
* 获取用户密级的最小值
|
* @return 密级的值
|
* @throws VciBaseException 查询出错会抛出异常
|
*/
|
@GetMapping(MINUSER)
|
R<Integer> getMinUserSecret() throws VciBaseException;
|
|
/**
|
* 获取数据密级的默认值
|
* @return 密级的值
|
* @throws VciBaseException 查询出错会抛出异常
|
*/
|
@GetMapping(MINDATA)
|
R<Integer> getMinDataSecret() throws VciBaseException;
|
|
/**
|
* 获取IP密级的默认值
|
* @return 密级的值
|
* @throws VciBaseException 查询出错会抛出异常
|
*/
|
@GetMapping(MINIP)
|
R<Integer> getMinIpSecret() throws VciBaseException;
|
|
/**
|
* 获取用户密级
|
* @param userId 用户主键
|
* @return 用户的密级
|
* @throws VciBaseException 参数错误,用户不存在会抛出异常
|
*/
|
@GetMapping(USER)
|
R<Integer> getUserSecret(@RequestParam("userId") String userId) throws VciBaseException ;
|
|
/**
|
* 获取用户密级
|
* @param userVO 用户的显示对象
|
* @return 用户的密级
|
* @throws VciBaseException 参数错误,用户不存在会抛出异常
|
*/
|
@GetMapping(USERVO)
|
R<Integer> getUserSecret(@RequestBody UserVO userVO) throws VciBaseException;
|
|
/**
|
* 校验当前用户是否有权限访问数据
|
* @param secret 数据的密级
|
* @return true表示允许访问
|
*/
|
@GetMapping(CHECKDATA)
|
R<Boolean> checkDataSecret(@RequestParam("secret") int secret);
|
|
/**
|
* 校验用户的密级是否是否有权限访问数据
|
* @param secret 数据的密级
|
* @param userSecret 用户密级
|
* @return true表示允许访问
|
*/
|
@GetMapping(CHECKUSERDATA)
|
R<Boolean> checkDataSecret(@RequestParam("secret") int secret, @RequestParam("userSecret") int userSecret) ;
|
|
/**
|
* 根据用户名来校验数据密级
|
* @param secret 数据的密级
|
* @param userId 用户名
|
* @return true表示允许访问
|
* @throws VciBaseException 参数错误,用户不存在会抛出异常
|
*/
|
@GetMapping(CHECKUSERIDDATA)
|
R<Boolean> checkDataSecret(@RequestParam("secret") int secret, @RequestParam("userId") String userId) throws VciBaseException;
|
|
/**
|
* 根据用户对象来校验数据密级
|
* @param secret 数据的密级
|
* @param userVO 用户的显示对象
|
* @return true表示允许访问
|
*/
|
@GetMapping(CHECKVO)
|
R<Boolean> checkDataSecret(@RequestParam("secret") int secret,@RequestBody UserVO userVO) ;
|
|
/**
|
* 获取IP地址的密级
|
* @param ip ip地址
|
* @return 密级的值
|
* @throws VciBaseException 查询出错的时候会抛出异常
|
*/
|
@GetMapping(IP)
|
R<Integer> getIpSecret(@RequestParam("ip") String ip) throws VciBaseException;
|
/**
|
* 检查机器密级
|
* @param ipSecret 机器密级
|
* @param userSecret 用户的密级
|
* @return 密级的值
|
*/
|
@GetMapping(IPUSER)
|
R<Boolean> checkIpSecret(@RequestParam("ipSecret") int ipSecret, @RequestParam("userSecret") int userSecret);
|
|
/**
|
* 检查当前用户是否符合机器密级
|
* @param ipSecret 机器密级
|
* @return true表示允许访问
|
*/
|
@GetMapping(IPSECRET)
|
R<Boolean> checkIpSecret(@RequestParam("ipSecret") int ipSecret) ;
|
|
/**
|
* 校验指定ip和用户是否符合机器密级
|
* @param ip ip地址
|
* @param userId 用户名
|
* @return true表示允许访问
|
* @throws VciBaseException 参数错误,用户不存在会抛出异常
|
*/
|
@GetMapping(IPUSERID)
|
R<Boolean> checkIpSecret(@RequestParam("ip") String ip, @RequestParam("userId") String userId) throws VciBaseException;
|
|
/**
|
* 校验指定IP和用户对象符合机器密级
|
* @param ip ip地址
|
* @param userVO 用户对象
|
* @return true表示允许访问
|
*/
|
@GetMapping(IPUSERVO)
|
R<Boolean> checkIpSecret(@RequestParam("ip") String ip,@RequestBody UserVO userVO) ;
|
}
|