Преглед на файлове

Merge branch 'single_login_20240407' of http://git.ningdatech.com/poffyzhang/kq-value-added-project

 Conflicts:
	.idea/.gitignore
	.idea/compiler.xml
	.idea/encodings.xml
	.idea/jarRepositories.xml
	.idea/misc.xml
	logs/error.log
	logs/info.log
master
PoffyZhang преди 8 месеца
родител
ревизия
ff093f8503
променени са 100 файла, в които са добавени 1489 реда и са изтрити 1 реда
  1. +16
    -0
      .idea/checkstyle-idea.xml
  2. +12
    -0
      .idea/eclipseCodeFormatter.xml
  3. +36
    -0
      kqapi/src/main/java/com/ningdatech/kqapi/sso/controller/SsoController.java
  4. +88
    -0
      kqapi/src/main/java/com/ningdatech/kqapi/sso/manage/SsoManage.java
  5. +25
    -0
      kqapi/src/main/java/com/ningdatech/kqapi/sso/model/dto/ReqSsoDTO.java
  6. +29
    -0
      kqapi/src/main/java/com/ningdatech/kqapi/sso/model/vo/SsoTokenVO.java
  7. +154
    -0
      kqapi/src/main/java/com/ningdatech/kqapi/sso/model/vo/SsoUserInfoVO.java
  8. +132
    -0
      kqapi/src/main/java/com/ningdatech/kqapi/sso/utils/HmacAuthUtil.java
  9. +10
    -0
      kqapi/src/main/resources/application-dev.yml
  10. +11
    -1
      kqapi/src/main/resources/application-pre.yml
  11. +10
    -0
      kqapi/src/main/resources/application-prod.yml
  12. +141
    -0
      kqapi/target/classes/BOOT-INF/classes/application-dev.yml
  13. +138
    -0
      kqapi/target/classes/BOOT-INF/classes/application-pre.yml
  14. +141
    -0
      kqapi/target/classes/BOOT-INF/classes/application-prod.yml
  15. +3
    -0
      kqapi/target/classes/BOOT-INF/classes/application.yml
  16. +68
    -0
      kqapi/target/classes/BOOT-INF/classes/logback-spring.xml
  17. +52
    -0
      kqapi/target/classes/META-INF/spring-configuration-metadata.json
  18. +141
    -0
      kqapi/target/classes/application-dev.yml
  19. +138
    -0
      kqapi/target/classes/application-pre.yml
  20. +141
    -0
      kqapi/target/classes/application-prod.yml
  21. +3
    -0
      kqapi/target/classes/application.yml
  22. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/App.class
  23. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/compare/Compare.class
  24. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/compare/CompareNode.class
  25. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/compare/CompareUtils.class
  26. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/config/BeanConfig.class
  27. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/config/ConfigurerAdapter.class
  28. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/config/DingOrganizationProperties.class
  29. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/config/ProvincialProperties.class
  30. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/BaseFieldConst.class
  31. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/BizConst.class
  32. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/CommonConst.class
  33. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/DefValConst.class
  34. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/DingConst.class
  35. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$AnnualPaymentPlan.class
  36. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$Appendix.class
  37. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$ApplicationInformation.class
  38. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$BasicInformation.class
  39. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$CoreBusiness.class
  40. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$FundDeclareInfo.class
  41. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$Number.class
  42. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$ProjectImageProgress.class
  43. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$Remark.class
  44. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$SafetyInput.class
  45. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$TotalInvestmentAllocations.class
  46. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst.class
  47. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/RegionConst.class
  48. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/constant/StateMachineConst.class
  49. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/converter/BaseDateConverter.class
  50. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/converter/NdLocalDateTimeDeserializer.class
  51. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/converter/String2DateConverter.class
  52. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/converter/String2LocalDateConverter.class
  53. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/converter/String2LocalDateTimeConverter.class
  54. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/converter/String2LocalTimeConverter.class
  55. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/enumeration/BoolDisplayEnum.class
  56. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/enumeration/CommonEnum.class
  57. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/enumeration/ExportOptionEnum.class
  58. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/enumeration/ProjectProcessStageEnum.class
  59. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/errorcode/AppErrorCode.class
  60. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/exception/ArgumentException.class
  61. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/exception/BaseCheckedException.class
  62. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/exception/BaseException.class
  63. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/exception/BaseUncheckedException.class
  64. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/exception/BizException.class
  65. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/exception/CommonException.class
  66. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/exception/DownloadException.class
  67. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/exception/ExportException.class
  68. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/exception/ForbiddenException.class
  69. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/exception/UnauthorizedException.class
  70. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/exception/code/BaseExceptionCode.class
  71. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/exception/code/ExceptionCode.class
  72. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/handler/GlobalExceptionHandler.class
  73. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/handler/GlobalResponseHandler.class
  74. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/handler/MyBatisPlusConfig.class
  75. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/helper/MatterCacheHelper.class
  76. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/helper/basic/AbstractMatterCacheHelper.class
  77. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/helper/impl/MattersCacheHelperImpl.class
  78. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/model/ApiResponse.class
  79. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/model/ApiStatus.class
  80. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/model/PagePo.class
  81. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/model/PageVo.class
  82. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/model/Status.class
  83. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/model/entity/Item$ItemData.class
  84. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/model/entity/Item.class
  85. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/BizUtils.class
  86. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/CallBack.class
  87. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/CodeUtil.class
  88. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/CommonInputStreamResource.class
  89. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/CryptUtils.class
  90. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/HmacAuthUtil.class
  91. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/HttpUtil.class
  92. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/Md5Utils.class
  93. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/NdDateUtils.class
  94. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/NdJacksonModule.class
  95. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/RefreshKeyUtil.class
  96. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/SpringContextHolder.class
  97. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/SpringUtils$1.class
  98. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/SpringUtils$SpringUtilsHolder.class
  99. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/SpringUtils.class
  100. Двоични данни
      kqapi/target/classes/com/ningdatech/kqapi/common/util/StrPool.class

+ 16
- 0
.idea/checkstyle-idea.xml Целия файл

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA" serialisationVersion="2">
<checkstyleVersion>10.5.0</checkstyleVersion>
<scanScope>JavaOnly</scanScope>
<copyLibs>true</copyLibs>
<option name="thirdPartyClasspath" />
<option name="activeLocationIds" />
<option name="locations">
<list>
<ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
<ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
</list>
</option>
</component>
</project>

+ 12
- 0
.idea/eclipseCodeFormatter.xml Целия файл

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EclipseCodeFormatterProjectSettings">
<option name="projectSpecificProfile">
<ProjectSpecificProfile>
<option name="formatter" value="ECLIPSE" />
<option name="pathToConfigFileJava" value="D:/soft/formatter/eclipse-codestyle.xml" />
<option name="selectedJavaProfile" value="P3C-CodeStyle" />
</ProjectSpecificProfile>
</option>
</component>
</project>

+ 36
- 0
kqapi/src/main/java/com/ningdatech/kqapi/sso/controller/SsoController.java Целия файл

@@ -0,0 +1,36 @@
package com.ningdatech.kqapi.sso.controller;

import com.ningdatech.kqapi.sso.manage.SsoManage;
import com.ningdatech.kqapi.sso.model.dto.ReqSsoDTO;
import com.ningdatech.kqapi.sso.model.vo.SsoTokenVO;
import com.ningdatech.kqapi.sso.model.vo.SsoUserInfoVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
* @author CMM
* @since 2024/04/07 11:15
*/
@Slf4j
@Validated
@RestController
@RequestMapping("/api/v1/sso/")
@RequiredArgsConstructor
public class SsoController {

private final SsoManage ssoManage;

@PostMapping ("/token")
public SsoTokenVO getToken(@Valid @RequestBody ReqSsoDTO reqSsoDTO) {
return ssoManage.getToken(reqSsoDTO);
}

@PostMapping ("/getUserInfo")
public SsoUserInfoVO getUserInfo(@Valid @RequestBody ReqSsoDTO reqSsoDTO) {
return ssoManage.getUserInfo(reqSsoDTO);
}
}

+ 88
- 0
kqapi/src/main/java/com/ningdatech/kqapi/sso/manage/SsoManage.java Целия файл

@@ -0,0 +1,88 @@
package com.ningdatech.kqapi.sso.manage;

import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.stereotype.Component;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;

import com.ningdatech.kqapi.common.exception.BizException;
import com.ningdatech.kqapi.sso.model.dto.ReqSsoDTO;
import com.ningdatech.kqapi.sso.model.vo.SsoTokenVO;
import com.ningdatech.kqapi.sso.model.vo.SsoUserInfoVO;
import com.ningdatech.kqapi.sso.utils.HmacAuthUtil;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;


/**
* @author CMM
* @since 2024/04/07 11:17
*/
@Component
@Slf4j
@RequiredArgsConstructor
public class SsoManage {

@Value("${sso.token.internet-url}")
//@Value("${sso.token.zww-url}")
private String tokenUrl;

@Value("${sso.user-info.internet-url}")
//@Value("${sso.user-info.zww-url}")
private String userInfoUrl;

@Value("${sso.access-key}")
private String accessKey;

@Value("${sso.secret-key}")
private String secretKey;

@Value("${sso.app-id}")
private String appId;

private final RestTemplate restTemplate;

/**
* 基于单点登录票据换取请求 token
*
* @param reqSsoDTO \
* @return SsoTokenVO
*/
public SsoTokenVO getToken(ReqSsoDTO reqSsoDTO) {
String ticketId = reqSsoDTO.getTicketId();
if (StringUtils.isBlank(ticketId)){
throw new BizException("登录票据不能为空!");
}
Map<String, String> header = HmacAuthUtil.generateHeader(tokenUrl, "POST", accessKey, secretKey);
MultiValueMap<String, String> multiValueMap = HmacAuthUtil.convertToMultiValueMap(header);
reqSsoDTO.setAppId(appId);
HttpEntity<Object> httpEntity = new HttpEntity<>(reqSsoDTO, multiValueMap);
SsoTokenVO res = restTemplate.postForObject(tokenUrl, httpEntity, SsoTokenVO.class);
log.info("[RestTemplateTest-基于单点登录票据换取请求token] http request :{}", res);
return res;
}

/**
* 基于 token 获取用户信息
*
* @param reqSsoDTO \
* @return SsoUserInfoVO
*/
public SsoUserInfoVO getUserInfo(ReqSsoDTO reqSsoDTO) {
String token = reqSsoDTO.getToken();
if (StringUtils.isBlank(token)){
throw new BizException("token不能为空!");
}
Map<String, String> header = HmacAuthUtil.generateHeader(userInfoUrl, "POST", accessKey, secretKey);
MultiValueMap<String, String> multiValueMap = HmacAuthUtil.convertToMultiValueMap(header);
HttpEntity<Object> httpEntity = new HttpEntity<>(reqSsoDTO,multiValueMap);
SsoUserInfoVO res = restTemplate.postForObject(userInfoUrl, httpEntity, SsoUserInfoVO.class);
log.info("[RestTemplateTest-基于token获取用户信息] http request :{}", res);
return res;
}
}

+ 25
- 0
kqapi/src/main/java/com/ningdatech/kqapi/sso/model/dto/ReqSsoDTO.java Целия файл

@@ -0,0 +1,25 @@
package com.ningdatech.kqapi.sso.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
* @author CMM
* @since 2024/04/07 11:22
*/
@Data
@ApiModel(value = "ReqTokenDTO", description = "获取Token请求实体")
public class ReqSsoDTO {

@ApiModelProperty("单点登录票据")
private String ticketId;

@ApiModelProperty("应用发布 ID")
private String appId;

@ApiModelProperty("单点登录Token")
private String token;
}

+ 29
- 0
kqapi/src/main/java/com/ningdatech/kqapi/sso/model/vo/SsoTokenVO.java Целия файл

@@ -0,0 +1,29 @@
package com.ningdatech.kqapi.sso.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* @author CMM
* @since 2024/04/07 11:19
*/
@Data
@ApiModel(value = "SsoTokenVO", description = "单点登录TokenVO")
public class SsoTokenVO {

@ApiModelProperty("错误码")
private String errorCode;

@ApiModelProperty("错误信息")
private String errorMsg;

@ApiModelProperty("是否成功")
private Boolean success;

@ApiModelProperty("响应体")
private Object data;

@ApiModelProperty("token")
private String token;
}

+ 154
- 0
kqapi/src/main/java/com/ningdatech/kqapi/sso/model/vo/SsoUserInfoVO.java Целия файл

@@ -0,0 +1,154 @@
package com.ningdatech.kqapi.sso.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
* @author CMM
* @since 2024/04/07 11:19
*/
@Data
@ApiModel(value = "SsoUserInfoVO", description = "单点登录UserInfoVO")
public class SsoUserInfoVO {

@ApiModelProperty("错误码")
private String errorCode;

@ApiModelProperty("错误信息")
private String errorMsg;

@ApiModelProperty("是否成功")
private Boolean success;

@ApiModelProperty("响应体")
private Object data;

@ApiModelProperty("用户类型 PERSON 个人、LEGAL_PERSON 法人")
private String userType;

@ApiModelProperty("个人用户信息 当前登录自然人的信息")
private Object personInfo;

@ApiModelProperty("主键")
private String userId;

@ApiModelProperty("个人姓名")
private String userName;

@ApiModelProperty("ID_CARD:身份证,PASSPORT:护\n" +
"照,OFFICER_CARD:军官\n" +
"证,MAINLAND_TRAVEL_PERMIT_FOR\n" +
"_HONGKONG_AND_MACAO_RESIDENTS\n" +
":港澳居民来往内地通行\n" +
"证,MAINLAND_TRAVEL_PERMIT_FOR\n" +
"_TAIWAN_RESIDENTS:台湾居民来\n" +
"往大陆通行\n" +
"证,FOREIGN_PERMANENT_RESIDENT\n" +
"_ID_CARD:外国人永久居留身份\n" +
"证,FOREIGN_PASSPORT:外籍人士\n" +
"护照,DIPLOMACY_PASSPORT:外交\n" +
"护照,OFFICIAL_PASSPORT:公务护\n" +
"照,SOLDIER_CARD:士兵\n" +
"证,OFFICER_RETIRE_CARD:军官离\n" +
"退休\n" +
"证,GANG_AO_TAI_RESIDENCE_CART\n" +
":港澳台居民居住\n" +
"证,GANG_AO_ID_CART:港澳居民身\n" +
"份证,UNIFIED_SOCIAL_ID:统一社\n" +
"会信用代码,OTHER:其他")
private String idType;

@ApiModelProperty("外部证件类型")
private String outerIdType;

@ApiModelProperty("证件编号")
private String idNo;

@ApiModelProperty("法人经办人时用户类型,评级")
private String attnUserType;

@ApiModelProperty("手机号")
private String phone;

@ApiModelProperty("邮箱")
private String email;

@ApiModelProperty("民族")
private String nation;

@ApiModelProperty("性别")
private String gender;

@ApiModelProperty("生日")
private String birthday;

@ApiModelProperty("身份散列值")
private String certKey;

@ApiModelProperty("额外属性")
private Object attributes;

@ApiModelProperty("法人用户信息,比如公司相关的信\n" +
"息")
private Object legalPersonInfo;

@ApiModelProperty("法人名称")
private String name;

@ApiModelProperty("社会统一信用代码")
private String unifiedSocialId;

@ApiModelProperty("法人类型")
private String orgType;

@ApiModelProperty("经办人姓名")
private String attnName;

@ApiModelProperty("经办人手机号")
private String attnPhone;

@ApiModelProperty("经办人证件类型")
private String attnIdType;

@ApiModelProperty("经办人证件号码")
private String attnIdNo;

@ApiModelProperty("法人代表人姓名")
private String principal;

@ApiModelProperty("法人代表唯一键")
private String principalUserId;

@ApiModelProperty("法人唯一键")
private String corpId;

@ApiModelProperty("所属组织信息")
private List<Object> organizationInfoList;

@ApiModelProperty("组织主键")
private String orgId;

@ApiModelProperty("Alias for orgId")
private String oid;

@ApiModelProperty("父组织主键")
private String parentId;

@ApiModelProperty("Alias for parentId")
private String pid;

@ApiModelProperty("组织机构全称")
private String fullName;

@ApiModelProperty("组织后缀")
private String devCoding;

@ApiModelProperty("是否叶子标志")
private Boolean leafFlag;

@ApiModelProperty("排序号,从小到大")
private Integer orderBy;
}

+ 132
- 0
kqapi/src/main/java/com/ningdatech/kqapi/sso/utils/HmacAuthUtil.java Целия файл

@@ -0,0 +1,132 @@
package com.ningdatech.kqapi.sso.utils;

import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URL;
import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.DatatypeConverter;

import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

import javafx.util.Pair;
import lombok.extern.slf4j.Slf4j;

/**
* @author CMM
* @since 2024/04/07 11:28
*/

@Slf4j
public class HmacAuthUtil {

/**
* 构造请求 header
*
* @param urlStr 请求url,全路径格式,比如:https://bcdsg.zj.gov.cn/api/p/v1/user.get
* @param requestMethod 请求方法,大写格式,如:GET, POST
* @param accessKey 应用的 AK
* @param secretKey 应用的 SK
* @return
*/
public static Map<String, String> generateHeader(String urlStr, String requestMethod, String accessKey, String secretKey) {
log.info("params,urlStr={},requestMethod={},accessKey={},secretKey={}",urlStr,requestMethod,accessKey,secretKey);
Map<String, String> header = new HashMap<>();
try {
DateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
String date = dateFormat.format(new Date());
URL url = new URL(urlStr);
URI uri = new URI(url.getProtocol(), url.getHost(), url.getPath(), url.getQuery(), null);

String canonicalQueryString = getCanonicalQueryString(uri.getQuery());

String message = requestMethod.toUpperCase() + "\n" + uri.getPath() + "\n" + canonicalQueryString + "\n" + accessKey + "\n" + date + "\n";

Mac hasher = Mac.getInstance("HmacSHA256");
hasher.init(new SecretKeySpec(secretKey.getBytes(), "HmacSHA256"));

byte[] hash = hasher.doFinal(message.getBytes());

// to lowercase hexits
DatatypeConverter.printHexBinary(hash);

// to base64
String sign = DatatypeConverter.printBase64Binary(hash);
header.put("X-BG-HMAC-SIGNATURE", sign);
header.put("X-BG-HMAC-ALGORITHM", "hmac-sha256");
header.put("X-BG-HMAC-ACCESS-KEY", accessKey);
header.put("X-BG-DATE-TIME", date);
} catch (Exception e) {
log.error("generate error",e);
throw new RuntimeException("generate header error");
}
log.info("header info,{}",header);
return header;
}

private static String getCanonicalQueryString(String query) {
if (query == null || query.trim().length() == 0) {
return "";
}
List<javafx.util.Pair<String, String>> queryParamList = new ArrayList<>();
String[] params = query.split("&");
for (String param : params) {
int eqIndex = param.indexOf("=");
String key = param;
String value = "";
if(eqIndex!=-1){
key = param.substring(0, eqIndex);
value = param.substring(eqIndex+1);
}
javafx.util.Pair<String, String> pair = new javafx.util.Pair<String, String>(key,value);
queryParamList.add(pair);
}

List<javafx.util.Pair<String, String>> sortedParamList = queryParamList.stream().sorted(Comparator.comparing(param -> param.getKey() + "=" + Optional.ofNullable(param.getValue()).orElse(""))).collect(Collectors.toList());
List<javafx.util.Pair<String, String>> encodeParamList = new ArrayList<>();
sortedParamList.stream().forEach(param -> {
try {
String key = URLEncoder.encode(param.getKey(), "utf-8");
String value = URLEncoder.encode(Optional.ofNullable(param.getValue()).orElse(""), "utf-8")
.replaceAll("\\%2B","%20")
.replaceAll("\\+","%20")
.replaceAll("\\%21","!")
.replaceAll("\\%27","'")
.replaceAll("\\%28","(")
.replaceAll("\\%29",")")
.replaceAll("\\%7E","~")
.replaceAll("\\%25","%")
;
encodeParamList.add(new javafx.util.Pair<>(key, value));
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("encoding error");
}
});
StringBuilder queryParamString = new StringBuilder(64);
for (Pair<String, String> encodeParam : encodeParamList) {
queryParamString.append(encodeParam.getKey()).append("=").append(Optional.ofNullable(encodeParam.getValue()).orElse(""));
queryParamString.append("&");
}

return queryParamString.substring(0, queryParamString.length() - 1);
}


public static MultiValueMap<String, String> convertToMultiValueMap(Map<String, String> sourceMap) {
LinkedMultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>();

for (Map.Entry<String, String> entry : sourceMap.entrySet()) {
multiValueMap.add(entry.getKey(), entry.getValue());
}

return multiValueMap;
}
}

+ 10
- 0
kqapi/src/main/resources/application-dev.yml Целия файл

@@ -127,5 +127,15 @@ jasypt:
algorithm: PBEWithMD5AndDES
# 指定initialization vector类型
iv-generator-classname: org.jasypt.iv.NoIvGenerator
sso:
access-key: BCDSGA_c2494577610c90bdc33b95514601da2c
secret-key: BCDSGS_80bf0a606c0d2fd3201bd06a4f008250
app-id: 2002399646
token:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
user-info:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo



+ 11
- 1
kqapi/src/main/resources/application-pre.yml Целия файл

@@ -125,4 +125,14 @@ jasypt:
password: CodeSheep
algorithm: PBEWithMD5AndDES
# 指定initialization vector类型
iv-generator-classname: org.jasypt.iv.NoIvGenerator
iv-generator-classname: org.jasypt.iv.NoIvGenerator
sso:
access-key: BCDSGA_c2494577610c90bdc33b95514601da2c
secret-key: BCDSGS_80bf0a606c0d2fd3201bd06a4f008250
app-id: 2002399646
token:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
user-info:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo

+ 10
- 0
kqapi/src/main/resources/application-prod.yml Целия файл

@@ -127,5 +127,15 @@ jasypt:
algorithm: PBEWithMD5AndDES
# 指定initialization vector类型
iv-generator-classname: org.jasypt.iv.NoIvGenerator
sso:
access-key: BCDSGA_c2494577610c90bdc33b95514601da2c
secret-key: BCDSGS_80bf0a606c0d2fd3201bd06a4f008250
app-id: 2002399646
token:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
user-info:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo



+ 141
- 0
kqapi/target/classes/BOOT-INF/classes/application-dev.yml Целия файл

@@ -0,0 +1,141 @@
server:
port: 33060
servlet:
context-path: /kq

spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
session:
store-type: redis
redis:
namespace: "spring:session"
timeout: 864000
redis:
timeout: 5000
host: 47.98.125.47
port: 26379
database: 7
password: Ndkj1234
jedis:
pool:
max-active: 200
max-idle: 500
min-idle: 8
max-wait: 10000
application:
name: kq
jackson:
default-property-inclusion: non_null
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
jpa:
properties:
hibernate:
default_schema: PUBLIC
hbm2ddl:
auto: update
show_sql: true
show-sql: true
hibernate:
ddl-auto: update
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: ENC(aMGW3+FFqxyutRz9liYjAg+A72b6IQ7/ygtxO0DmQJ/LLFZkx8r4MhN8quv9L62nQ4sH55qFg+LnQoor/t8IqBACrbfNg462YNKnRyMsBmdHHxJm7i57flIQfePLDW93Omz4LZ2PbRZTvPcLLYtnQyxXSDPwDnjexHNVXTdxwuTJPBqthsVpvyA2mnn5Szef)
username: root
password: ENC(NHFdgnNk7opRJpNnZOJs51OTXb72zU//)
# 数据源
hikari:
# 是客户端等待连接池连接的最大毫秒数
connection-timeout: 30000
# 是允许连接在连接池中空闲的最长时间
minimum-idle: 5
# 配置最大池大小
maximum-pool-size: 300
# 是允许连接在连接池中空闲的最长时间(以毫秒为单位)
idle-timeout: 60000
# 池中连接关闭后的最长生命周期(以毫秒为单位)
max-lifetime: 600000
# 配置从池返回的连接的默认自动提交行为。默认值为true。
auto-commit: true
# 开启连接监测泄露
leak-detection-threshold: 500000
# 测试连接数据库
connection-test-query: SELECT 1
#设置上传 单个文件的大小
servlet:
multipart:
max-file-size: 100MB
max-request-size: 150MB
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
logic-delete-value: true
logic-not-delete-value: false
logging:
config: classpath:logback-spring.xml
#日志配置
level:
root: info
file:
path: logs
nd:
cache:
type: REDIS
serializerType: ProtoStuff
cacheNullVal: true
def:
keyPrefix: kq
log:
enabled: true
type: DB
# 文件存储
file:
storage-type: ALI_OSS
ali:
protocol: https://
bucket: devplat
urlPrefix: oss-cn-hangzhou.aliyuncs.com
endpoint: oss-cn-hangzhou.aliyuncs.com
accessKeyId: LTAI4GL7uypycnBjiRn55rMG
accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98
# 日志文件配置
log:
path: ./logs
info:
file-size: 50MB
max-size: 5
total-size: 200MB
error:
file-size: 10MB
max-size: 5
total-size: 50MB

swagger:
enabled: true

hostname: iZbp13nwyvib53j4j1p2xoZ

jasypt:
encryptor:
password: CodeSheep
# 指定解密算法,需要和加密时使用的算法一致
algorithm: PBEWithMD5AndDES
# 指定initialization vector类型
iv-generator-classname: org.jasypt.iv.NoIvGenerator
sso:
access-key: BCDSGA_c2494577610c90bdc33b95514601da2c
secret-key: BCDSGS_80bf0a606c0d2fd3201bd06a4f008250
app-id: 2002399646
token:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
user-info:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo



+ 138
- 0
kqapi/target/classes/BOOT-INF/classes/application-pre.yml Целия файл

@@ -0,0 +1,138 @@
server:
port: 33060
servlet:
context-path: /kq

spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
session:
store-type: redis
redis:
namespace: "spring:session"
timeout: 864000
redis:
timeout: 5000
host: 47.98.125.47
port: 26379
database: 7
password: Ndkj1234
jedis:
pool:
max-active: 200
max-idle: 500
min-idle: 8
max-wait: 10000
application:
name: kq
jackson:
default-property-inclusion: non_null
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
jpa:
properties:
hibernate:
default_schema: PUBLIC
hbm2ddl:
auto: update
show_sql: true
show-sql: true
hibernate:
ddl-auto: update
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: ENC(aMGW3+FFqxyutRz9liYjAg+A72b6IQ7/ygtxO0DmQJ/LLFZkx8r4MhN8quv9L62nQ4sH55qFg+LnQoor/t8IqBACrbfNg462YNKnRyMsBmdHHxJm7i57flIQfePLDW93Omz4LZ2PbRZTvPcLLYtnQyxXSDPwDnjexHNVXTdxwuTJPBqthsVpvyA2mnn5Szef)
username: root
password: NingdaKeji123!
# 数据源
hikari:
# 是客户端等待连接池连接的最大毫秒数
connection-timeout: 30000
# 是允许连接在连接池中空闲的最长时间
minimum-idle: 5
# 配置最大池大小
maximum-pool-size: 300
# 是允许连接在连接池中空闲的最长时间(以毫秒为单位)
idle-timeout: 60000
# 池中连接关闭后的最长生命周期(以毫秒为单位)
max-lifetime: 600000
# 配置从池返回的连接的默认自动提交行为。默认值为true。
auto-commit: true
# 开启连接监测泄露
leak-detection-threshold: 500000
# 测试连接数据库
connection-test-query: SELECT 1
#设置上传 单个文件的大小
servlet:
multipart:
max-file-size: 100MB
max-request-size: 150MB
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
logic-delete-value: true
logic-not-delete-value: false
logging:
config: classpath:logback-spring.xml
#日志配置
level:
root: info
file:
path: logs
nd:
cache:
type: REDIS
serializerType: ProtoStuff
cacheNullVal: true
def:
keyPrefix: kq
log:
enabled: true
type: DB
# 文件存储
file:
storage-type: ALI_OSS
ali:
protocol: https://
bucket: devplat
urlPrefix: oss-cn-hangzhou.aliyuncs.com
endpoint: oss-cn-hangzhou.aliyuncs.com
accessKeyId: LTAI4GL7uypycnBjiRn55rMG
accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98
# 日志文件配置
log:
path: ./logs
info:
file-size: 50MB
max-size: 5
total-size: 200MB
error:
file-size: 10MB
max-size: 5
total-size: 50MB

swagger:
enabled: true

hostname: iZbp13nwyvib53j4j1p2xoZ

jasypt:
encryptor:
password: CodeSheep
algorithm: PBEWithMD5AndDES
# 指定initialization vector类型
iv-generator-classname: org.jasypt.iv.NoIvGenerator
sso:
access-key: BCDSGA_c2494577610c90bdc33b95514601da2c
secret-key: BCDSGS_80bf0a606c0d2fd3201bd06a4f008250
app-id: 2002399646
token:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
user-info:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo

+ 141
- 0
kqapi/target/classes/BOOT-INF/classes/application-prod.yml Целия файл

@@ -0,0 +1,141 @@
server:
port: 33061
servlet:
context-path: /kq

spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
session:
store-type: redis
redis:
namespace: "spring:session"
timeout: 864000
redis:
timeout: 5000
host: 47.98.125.47
port: 26379
database: 7
password: Ndkj1234
jedis:
pool:
max-active: 200
max-idle: 500
min-idle: 8
max-wait: 10000
application:
name: kq
jackson:
default-property-inclusion: non_null
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
jpa:
properties:
hibernate:
default_schema: PUBLIC
hbm2ddl:
auto: update
show_sql: true
show-sql: true
hibernate:
ddl-auto: update
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: ENC(gtE4OUrpgtFsh6B3aLiSp2sVSX1BYDET9Uii/wRP2RboRK0NDaYu1S7Vx30cHXFE7vecQzY1UbrSFW/BaWJvQ3XJxfDiaUxdrIDND5e+DMTjx1pUkfS8/RbXHQDE+QoOVZV1UKEtdq+khr32tlQXqkTnzmZGuZjctVmjdQxUnmI2YNpoeNlIAkDXiaCvcVYc)
username: root
password: Nd@20231116

# 数据源
hikari:
# 是客户端等待连接池连接的最大毫秒数
connection-timeout: 30000
# 是允许连接在连接池中空闲的最长时间
minimum-idle: 5
# 配置最大池大小
maximum-pool-size: 300
# 是允许连接在连接池中空闲的最长时间(以毫秒为单位)
idle-timeout: 60000
# 池中连接关闭后的最长生命周期(以毫秒为单位)
max-lifetime: 600000
# 配置从池返回的连接的默认自动提交行为。默认值为true。
auto-commit: true
# 开启连接监测泄露
leak-detection-threshold: 500000
# 测试连接数据库
connection-test-query: SELECT 1
#设置上传 单个文件的大小
servlet:
multipart:
max-file-size: 100MB
max-request-size: 150MB
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
logic-delete-value: true
logic-not-delete-value: false
logging:
config: classpath:logback-spring.xml
#日志配置
level:
root: info
file:
path: logs
nd:
cache:
type: REDIS
serializerType: ProtoStuff
cacheNullVal: true
def:
keyPrefix: kq
log:
enabled: true
type: DB
# 文件存储
file:
storage-type: ALI_OSS
ali:
protocol: https://
bucket: devplat
urlPrefix: oss-cn-hangzhou.aliyuncs.com
endpoint: oss-cn-hangzhou.aliyuncs.com
accessKeyId: LTAI4GL7uypycnBjiRn55rMG
accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98
# 日志文件配置
log:
path: ./logs
info:
file-size: 50MB
max-size: 5
total-size: 200MB
error:
file-size: 10MB
max-size: 5
total-size: 50MB

swagger:
enabled: true

hostname: iZut201mqskxt0mwme4tjfZ

jasypt:
encryptor:
password: CodeSheep
algorithm: PBEWithMD5AndDES
# 指定initialization vector类型
iv-generator-classname: org.jasypt.iv.NoIvGenerator
sso:
access-key: BCDSGA_c2494577610c90bdc33b95514601da2c
secret-key: BCDSGS_80bf0a606c0d2fd3201bd06a4f008250
app-id: 2002399646
token:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
user-info:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo



+ 3
- 0
kqapi/target/classes/BOOT-INF/classes/application.yml Целия файл

@@ -0,0 +1,3 @@
spring:
profiles:
active: dev

+ 68
- 0
kqapi/target/classes/BOOT-INF/classes/logback-spring.xml Целия файл

@@ -0,0 +1,68 @@
<configuration scan="true" scanPeriod="10 seconds">
<springProperty name="logPath" scope="context" source="log.path" defaultValue="./logs"/>
<springProperty name="infoFileSize" scope="context" source="log.info.file-size"/>
<springProperty name="infoMaxSize" scope="context" source="log.info.max-size"/>
<springProperty name="infoTotalSize" scope="context" source="log.info.total-size"/>
<springProperty name="errorFileSize" scope="context" source="log.error.file-size"/>
<springProperty name="errorMaxSize" scope="context" source="log.error.max-size"/>
<springProperty name="errorTotalSize" scope="context" source="log.error.total-size"/>

<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${logPath}/info.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${logPath}/info-%d{yyyyMMdd}-%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>${infoFileSize}</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>${infoMaxSize}</maxHistory>
<totalSizeCap>${infoTotalSize}</totalSizeCap>
</rollingPolicy>
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n
</Pattern>
</layout>
<charset>UTF-8</charset>
</encoder>
</appender>

<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<File>${logPath}/error.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${logPath}/error-%d{yyyyMMdd}-%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>${errorFileSize}</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>${errorMaxSize}</maxHistory>
<totalSizeCap>${errorTotalSize}</totalSizeCap>
</rollingPolicy>
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n
</Pattern>
</layout>
<charset>UTF-8</charset>
</encoder>
</appender>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n
</pattern>
<charset>UTF-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>DEBUG</level>
</filter>
</appender>

<root level="INFO">
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="ERROR_FILE"/>
<appender-ref ref="STDOUT"/>
</root>
</configuration>

+ 52
- 0
kqapi/target/classes/META-INF/spring-configuration-metadata.json Целия файл

@@ -0,0 +1,52 @@
{
"groups": [
{
"name": "organization",
"type": "com.ningdatech.kqapi.common.config.DingOrganizationProperties",
"sourceType": "com.ningdatech.kqapi.common.config.DingOrganizationProperties"
},
{
"name": "provincial",
"type": "com.ningdatech.kqapi.common.config.ProvincialProperties",
"sourceType": "com.ningdatech.kqapi.common.config.ProvincialProperties"
}
],
"properties": [
{
"name": "organization.dept-visible-scopes",
"type": "java.util.List<java.lang.String>",
"sourceType": "com.ningdatech.kqapi.common.config.DingOrganizationProperties"
},
{
"name": "provincial.detail-url",
"type": "java.lang.String",
"sourceType": "com.ningdatech.kqapi.common.config.ProvincialProperties"
},
{
"name": "provincial.domain-url",
"type": "java.lang.String",
"sourceType": "com.ningdatech.kqapi.common.config.ProvincialProperties"
},
{
"name": "provincial.host",
"type": "java.lang.String",
"sourceType": "com.ningdatech.kqapi.common.config.ProvincialProperties"
},
{
"name": "provincial.key",
"type": "java.lang.String",
"sourceType": "com.ningdatech.kqapi.common.config.ProvincialProperties"
},
{
"name": "provincial.push-url",
"type": "java.lang.String",
"sourceType": "com.ningdatech.kqapi.common.config.ProvincialProperties"
},
{
"name": "provincial.secret",
"type": "java.lang.String",
"sourceType": "com.ningdatech.kqapi.common.config.ProvincialProperties"
}
],
"hints": []
}

+ 141
- 0
kqapi/target/classes/application-dev.yml Целия файл

@@ -0,0 +1,141 @@
server:
port: 33060
servlet:
context-path: /kq

spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
session:
store-type: redis
redis:
namespace: "spring:session"
timeout: 864000
redis:
timeout: 5000
host: 47.98.125.47
port: 26379
database: 7
password: Ndkj1234
jedis:
pool:
max-active: 200
max-idle: 500
min-idle: 8
max-wait: 10000
application:
name: kq
jackson:
default-property-inclusion: non_null
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
jpa:
properties:
hibernate:
default_schema: PUBLIC
hbm2ddl:
auto: update
show_sql: true
show-sql: true
hibernate:
ddl-auto: update
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: ENC(aMGW3+FFqxyutRz9liYjAg+A72b6IQ7/ygtxO0DmQJ/LLFZkx8r4MhN8quv9L62nQ4sH55qFg+LnQoor/t8IqBACrbfNg462YNKnRyMsBmdHHxJm7i57flIQfePLDW93Omz4LZ2PbRZTvPcLLYtnQyxXSDPwDnjexHNVXTdxwuTJPBqthsVpvyA2mnn5Szef)
username: root
password: ENC(NHFdgnNk7opRJpNnZOJs51OTXb72zU//)
# 数据源
hikari:
# 是客户端等待连接池连接的最大毫秒数
connection-timeout: 30000
# 是允许连接在连接池中空闲的最长时间
minimum-idle: 5
# 配置最大池大小
maximum-pool-size: 300
# 是允许连接在连接池中空闲的最长时间(以毫秒为单位)
idle-timeout: 60000
# 池中连接关闭后的最长生命周期(以毫秒为单位)
max-lifetime: 600000
# 配置从池返回的连接的默认自动提交行为。默认值为true。
auto-commit: true
# 开启连接监测泄露
leak-detection-threshold: 500000
# 测试连接数据库
connection-test-query: SELECT 1
#设置上传 单个文件的大小
servlet:
multipart:
max-file-size: 100MB
max-request-size: 150MB
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
logic-delete-value: true
logic-not-delete-value: false
logging:
config: classpath:logback-spring.xml
#日志配置
level:
root: info
file:
path: logs
nd:
cache:
type: REDIS
serializerType: ProtoStuff
cacheNullVal: true
def:
keyPrefix: kq
log:
enabled: true
type: DB
# 文件存储
file:
storage-type: ALI_OSS
ali:
protocol: https://
bucket: devplat
urlPrefix: oss-cn-hangzhou.aliyuncs.com
endpoint: oss-cn-hangzhou.aliyuncs.com
accessKeyId: LTAI4GL7uypycnBjiRn55rMG
accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98
# 日志文件配置
log:
path: ./logs
info:
file-size: 50MB
max-size: 5
total-size: 200MB
error:
file-size: 10MB
max-size: 5
total-size: 50MB

swagger:
enabled: true

hostname: iZbp13nwyvib53j4j1p2xoZ

jasypt:
encryptor:
password: CodeSheep
# 指定解密算法,需要和加密时使用的算法一致
algorithm: PBEWithMD5AndDES
# 指定initialization vector类型
iv-generator-classname: org.jasypt.iv.NoIvGenerator
sso:
access-key: BCDSGA_c2494577610c90bdc33b95514601da2c
secret-key: BCDSGS_80bf0a606c0d2fd3201bd06a4f008250
app-id: 2002399646
token:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
user-info:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo



+ 138
- 0
kqapi/target/classes/application-pre.yml Целия файл

@@ -0,0 +1,138 @@
server:
port: 33060
servlet:
context-path: /kq

spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
session:
store-type: redis
redis:
namespace: "spring:session"
timeout: 864000
redis:
timeout: 5000
host: 47.98.125.47
port: 26379
database: 7
password: Ndkj1234
jedis:
pool:
max-active: 200
max-idle: 500
min-idle: 8
max-wait: 10000
application:
name: kq
jackson:
default-property-inclusion: non_null
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
jpa:
properties:
hibernate:
default_schema: PUBLIC
hbm2ddl:
auto: update
show_sql: true
show-sql: true
hibernate:
ddl-auto: update
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: ENC(aMGW3+FFqxyutRz9liYjAg+A72b6IQ7/ygtxO0DmQJ/LLFZkx8r4MhN8quv9L62nQ4sH55qFg+LnQoor/t8IqBACrbfNg462YNKnRyMsBmdHHxJm7i57flIQfePLDW93Omz4LZ2PbRZTvPcLLYtnQyxXSDPwDnjexHNVXTdxwuTJPBqthsVpvyA2mnn5Szef)
username: root
password: NingdaKeji123!
# 数据源
hikari:
# 是客户端等待连接池连接的最大毫秒数
connection-timeout: 30000
# 是允许连接在连接池中空闲的最长时间
minimum-idle: 5
# 配置最大池大小
maximum-pool-size: 300
# 是允许连接在连接池中空闲的最长时间(以毫秒为单位)
idle-timeout: 60000
# 池中连接关闭后的最长生命周期(以毫秒为单位)
max-lifetime: 600000
# 配置从池返回的连接的默认自动提交行为。默认值为true。
auto-commit: true
# 开启连接监测泄露
leak-detection-threshold: 500000
# 测试连接数据库
connection-test-query: SELECT 1
#设置上传 单个文件的大小
servlet:
multipart:
max-file-size: 100MB
max-request-size: 150MB
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
logic-delete-value: true
logic-not-delete-value: false
logging:
config: classpath:logback-spring.xml
#日志配置
level:
root: info
file:
path: logs
nd:
cache:
type: REDIS
serializerType: ProtoStuff
cacheNullVal: true
def:
keyPrefix: kq
log:
enabled: true
type: DB
# 文件存储
file:
storage-type: ALI_OSS
ali:
protocol: https://
bucket: devplat
urlPrefix: oss-cn-hangzhou.aliyuncs.com
endpoint: oss-cn-hangzhou.aliyuncs.com
accessKeyId: LTAI4GL7uypycnBjiRn55rMG
accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98
# 日志文件配置
log:
path: ./logs
info:
file-size: 50MB
max-size: 5
total-size: 200MB
error:
file-size: 10MB
max-size: 5
total-size: 50MB

swagger:
enabled: true

hostname: iZbp13nwyvib53j4j1p2xoZ

jasypt:
encryptor:
password: CodeSheep
algorithm: PBEWithMD5AndDES
# 指定initialization vector类型
iv-generator-classname: org.jasypt.iv.NoIvGenerator
sso:
access-key: BCDSGA_c2494577610c90bdc33b95514601da2c
secret-key: BCDSGS_80bf0a606c0d2fd3201bd06a4f008250
app-id: 2002399646
token:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
user-info:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo

+ 141
- 0
kqapi/target/classes/application-prod.yml Целия файл

@@ -0,0 +1,141 @@
server:
port: 33061
servlet:
context-path: /kq

spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
session:
store-type: redis
redis:
namespace: "spring:session"
timeout: 864000
redis:
timeout: 5000
host: 47.98.125.47
port: 26379
database: 7
password: Ndkj1234
jedis:
pool:
max-active: 200
max-idle: 500
min-idle: 8
max-wait: 10000
application:
name: kq
jackson:
default-property-inclusion: non_null
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
jpa:
properties:
hibernate:
default_schema: PUBLIC
hbm2ddl:
auto: update
show_sql: true
show-sql: true
hibernate:
ddl-auto: update
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: ENC(gtE4OUrpgtFsh6B3aLiSp2sVSX1BYDET9Uii/wRP2RboRK0NDaYu1S7Vx30cHXFE7vecQzY1UbrSFW/BaWJvQ3XJxfDiaUxdrIDND5e+DMTjx1pUkfS8/RbXHQDE+QoOVZV1UKEtdq+khr32tlQXqkTnzmZGuZjctVmjdQxUnmI2YNpoeNlIAkDXiaCvcVYc)
username: root
password: Nd@20231116

# 数据源
hikari:
# 是客户端等待连接池连接的最大毫秒数
connection-timeout: 30000
# 是允许连接在连接池中空闲的最长时间
minimum-idle: 5
# 配置最大池大小
maximum-pool-size: 300
# 是允许连接在连接池中空闲的最长时间(以毫秒为单位)
idle-timeout: 60000
# 池中连接关闭后的最长生命周期(以毫秒为单位)
max-lifetime: 600000
# 配置从池返回的连接的默认自动提交行为。默认值为true。
auto-commit: true
# 开启连接监测泄露
leak-detection-threshold: 500000
# 测试连接数据库
connection-test-query: SELECT 1
#设置上传 单个文件的大小
servlet:
multipart:
max-file-size: 100MB
max-request-size: 150MB
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
logic-delete-value: true
logic-not-delete-value: false
logging:
config: classpath:logback-spring.xml
#日志配置
level:
root: info
file:
path: logs
nd:
cache:
type: REDIS
serializerType: ProtoStuff
cacheNullVal: true
def:
keyPrefix: kq
log:
enabled: true
type: DB
# 文件存储
file:
storage-type: ALI_OSS
ali:
protocol: https://
bucket: devplat
urlPrefix: oss-cn-hangzhou.aliyuncs.com
endpoint: oss-cn-hangzhou.aliyuncs.com
accessKeyId: LTAI4GL7uypycnBjiRn55rMG
accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98
# 日志文件配置
log:
path: ./logs
info:
file-size: 50MB
max-size: 5
total-size: 200MB
error:
file-size: 10MB
max-size: 5
total-size: 50MB

swagger:
enabled: true

hostname: iZut201mqskxt0mwme4tjfZ

jasypt:
encryptor:
password: CodeSheep
algorithm: PBEWithMD5AndDES
# 指定initialization vector类型
iv-generator-classname: org.jasypt.iv.NoIvGenerator
sso:
access-key: BCDSGA_c2494577610c90bdc33b95514601da2c
secret-key: BCDSGS_80bf0a606c0d2fd3201bd06a4f008250
app-id: 2002399646
token:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000007/uc/sso/access_token
user-info:
internet-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo
zww-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220329000008/uc/sso/getUserInfo



+ 3
- 0
kqapi/target/classes/application.yml Целия файл

@@ -0,0 +1,3 @@
spring:
profiles:
active: dev

Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/App.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/compare/Compare.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/compare/CompareNode.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/compare/CompareUtils.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/config/BeanConfig.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/config/ConfigurerAdapter.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/config/DingOrganizationProperties.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/config/ProvincialProperties.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/BaseFieldConst.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/BizConst.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/CommonConst.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/DefValConst.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/DingConst.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$AnnualPaymentPlan.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$Appendix.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$ApplicationInformation.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$BasicInformation.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$CoreBusiness.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$FundDeclareInfo.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$Number.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$ProjectImageProgress.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$Remark.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$SafetyInput.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst$TotalInvestmentAllocations.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/ProjectDeclareConst.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/RegionConst.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/constant/StateMachineConst.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/converter/BaseDateConverter.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/converter/NdLocalDateTimeDeserializer.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/converter/String2DateConverter.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/converter/String2LocalDateConverter.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/converter/String2LocalDateTimeConverter.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/converter/String2LocalTimeConverter.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/enumeration/BoolDisplayEnum.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/enumeration/CommonEnum.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/enumeration/ExportOptionEnum.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/enumeration/ProjectProcessStageEnum.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/errorcode/AppErrorCode.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/exception/ArgumentException.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/exception/BaseCheckedException.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/exception/BaseException.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/exception/BaseUncheckedException.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/exception/BizException.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/exception/CommonException.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/exception/DownloadException.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/exception/ExportException.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/exception/ForbiddenException.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/exception/UnauthorizedException.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/exception/code/BaseExceptionCode.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/exception/code/ExceptionCode.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/handler/GlobalExceptionHandler.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/handler/GlobalResponseHandler.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/handler/MyBatisPlusConfig.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/helper/MatterCacheHelper.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/helper/basic/AbstractMatterCacheHelper.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/helper/impl/MattersCacheHelperImpl.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/model/ApiResponse.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/model/ApiStatus.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/model/PagePo.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/model/PageVo.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/model/Status.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/model/entity/Item$ItemData.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/model/entity/Item.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/BizUtils.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/CallBack.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/CodeUtil.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/CommonInputStreamResource.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/CryptUtils.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/HmacAuthUtil.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/HttpUtil.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/Md5Utils.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/NdDateUtils.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/NdJacksonModule.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/RefreshKeyUtil.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/SpringContextHolder.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/SpringUtils$1.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/SpringUtils$SpringUtilsHolder.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/SpringUtils.class Целия файл


Двоични данни
kqapi/target/classes/com/ningdatech/kqapi/common/util/StrPool.class Целия файл


Някои файлове не бяха показани, защото твърде много файлове са промени

Loading…
Отказ
Запис