mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 21:32:07 +08:00
1、移除登录地址位置检查;2、登录登出增加地理位置入库;3、组织机构支持省市县持久化和查询;4、permission-info增加返回ip、地域、组织有效期;
This commit is contained in:
+13
@@ -22,6 +22,11 @@ public class IPQueryProperties {
|
||||
@Value("${chenfeng.encrypt.publicKey:}")
|
||||
private String publicKey;
|
||||
|
||||
/**
|
||||
* 开关
|
||||
*/
|
||||
private boolean enable;
|
||||
|
||||
/**
|
||||
* 接口地址
|
||||
*/
|
||||
@@ -32,6 +37,14 @@ public class IPQueryProperties {
|
||||
*/
|
||||
private String appCode;
|
||||
|
||||
public boolean isEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
public void setEnable(boolean enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
public String getAppCode() {
|
||||
return appCode;
|
||||
}
|
||||
|
||||
+8
@@ -9,6 +9,14 @@ import com.cf.imes.framework.ip.core.service.dto.IPQueryDataRespDTO;
|
||||
* @since 2024/10/30 10:54
|
||||
*/
|
||||
public interface IPQueryService {
|
||||
|
||||
/**
|
||||
* 服务是否开启
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean serviceEnable();
|
||||
|
||||
/**
|
||||
* 查询ip归属地
|
||||
*
|
||||
|
||||
+5
@@ -15,6 +15,11 @@ public class IPQueryDataRespDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3403763102169461000L;
|
||||
|
||||
/**
|
||||
* ip
|
||||
*/
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 国家
|
||||
*/
|
||||
|
||||
+11
-5
@@ -27,6 +27,12 @@ public class IPQueryServiceImpl implements IPQueryService {
|
||||
@Resource
|
||||
private IPQueryProperties ipQueryProperties;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean serviceEnable() {
|
||||
return ipQueryProperties.isEnable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPQueryDataRespDTO querySource(String ip) {
|
||||
ErrorCode queryError = ErrorCodeConstants.IP_QUERY_ERROR;
|
||||
@@ -48,17 +54,17 @@ public class IPQueryServiceImpl implements IPQueryService {
|
||||
String respBody = execute.body();
|
||||
IPQueryRespDTO ipQueryRespDTO = JSON.parseObject(execute.body(), IPQueryRespDTO.class);
|
||||
if (HttpStatus.HTTP_OK == ipQueryRespDTO.getRet()) {
|
||||
return ipQueryRespDTO.getData();
|
||||
IPQueryDataRespDTO data = ipQueryRespDTO.getData();
|
||||
data.setIp(ip);
|
||||
return data;
|
||||
} else {
|
||||
ServiceException serviceException = ServiceExceptionUtil.exception(queryError);
|
||||
log.error(serviceException.getMessage() + ",状态【{}】,异常:{}", ipQueryRespDTO.getRet(), respBody);
|
||||
throw serviceException;
|
||||
return null;
|
||||
}
|
||||
} catch (ServiceException se) {
|
||||
throw se;
|
||||
} catch (Exception e) {
|
||||
log.error(queryError.getMsg(), e);
|
||||
throw new ServiceException(queryError);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user