Commit c7b562da authored by jiaorz's avatar jiaorz

Merge branch 'master-modify-cutAmount' into dev

# Conflicts:
#	xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/OrderPageVO.java
#	xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
#	xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
#	xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
#	xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BaseOrderController.java
parent be931aa0
......@@ -232,6 +232,14 @@
<artifactId>spring-cloud-starter-openfeign</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
</dependencies>
......
......@@ -92,4 +92,20 @@ public class SystemConfig {
public static final String ALIPAY = "alipay";
public static final String WXPAY = "wxpay";
/**
* 华为相关参数
*
*/
public static final String HUAWEI_FAST_SERVICE_GRANT_TYPE_CLIENT_CREDENTIALS = "client_credentials";
public static final String HUAWEI_FAST_SERVICE_GRANT_TYPE_REFRESH_TOKEN = "refresh_token";
public static final String HUAWEI_FAST_SERVICE_GRANT_TYPE_NSP_SVC = "huawei.oauth2.user.getTokenInfo";
public static final String HUAWEI_FAST_SERVICE_GRANT_TYPE_AUTHORIZATION_CODE = "authorization_code";
public static final String HUAWEI_FAST_SERVICE_APP_ID = "101141079";
public static final String HUAWEI_FAST_SERVICE_APP_SECRET = "75a789087d1c2991e26b7a79550333dfd1011b1b26e3a8d2ca99cd6732ec1b74";
public static final String HUAWEI_FAST_SERVICE_TOKEN_URL = "https://login.cloud.huawei.com/oauth2/v2/token";
public static final String HUAWEI_FAST_SERVICE_OPEN_ID = "OPENID";
public static final String HUAWEI_FAST_SERVICE_GET_OPENID = "https://api.cloud.huawei.com/rest.php";
public static final String HUAWEI_FAST_SERVICE_EVENT_NOTIFY = "https://hag.cloud.huawei.com/open-ability/v1/service-events/notify";
}
......@@ -5,6 +5,8 @@ import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
@Data
public class RequestBodyDto {
......@@ -31,74 +33,115 @@ public class RequestBodyDto {
this.accessToken = accessToken;
}
public RequestBodyDto(String grantType, String clientId, String clientSecret, String code, String redirectUri) {
this.grantType = grantType;
this.clientId = clientId;
this.clientSecret = clientSecret;
this.code = code;
this.redirectUri = redirectUri;
}
public RequestBodyDto(String grantType, String refreshToken, String clientId, String clientSecret) {
this.grantType = grantType;
this.refreshToken = refreshToken;
this.clientId = clientId;
this.clientSecret = clientSecret;
}
public RequestBodyDto(String nspSvc, String openId, String accessToken) {
this.nspSvc = nspSvc;
this.openId = openId;
this.accessToken = accessToken;
public String getParamMap(){
StringBuilder stringBuilder = new StringBuilder();
if(StringUtils.isNotBlank(this.grantType)) {
stringBuilder.append("gran_type = ");
stringBuilder.append( URLEncoder.encode(this.grantType));
stringBuilder.append("&");
}
if(StringUtils.isNotBlank(this.refreshToken)) {
stringBuilder.append("refresh_token = ");
stringBuilder.append( URLEncoder.encode(this.refreshToken));
stringBuilder.append("&");
}
if(StringUtils.isNotBlank(this.clientId)) {
stringBuilder.append("client_id = ");
stringBuilder.append( URLEncoder.encode(this.clientId));
stringBuilder.append("&");
}
if(StringUtils.isNotBlank(this.clientSecret)) {
stringBuilder.append("client_secret = ");
stringBuilder.append( URLEncoder.encode(this.clientSecret));
stringBuilder.append("&");
}
if(StringUtils.isNotBlank(this.code)) {
stringBuilder.append("code = ");
stringBuilder.append( URLEncoder.encode(this.code));
stringBuilder.append("&");
}
if(StringUtils.isNotBlank(this.redirectUri)) {
stringBuilder.append("redirect_uri = ");
stringBuilder.append( URLEncoder.encode(this.redirectUri));
stringBuilder.append("&");
}
if(StringUtils.isNotBlank(this.nspSvc)) {
stringBuilder.append("nsp_svc = ");
stringBuilder.append( URLEncoder.encode(this.nspSvc));
stringBuilder.append("&");
}
if(StringUtils.isNotBlank(this.openId)) {
stringBuilder.append("open_id = ");
stringBuilder.append( URLEncoder.encode(this.openId));
stringBuilder.append("&");
}
if(StringUtils.isNotBlank(this.accessToken)) {
stringBuilder.append("access_token = ");
stringBuilder.append( URLEncoder.encode(this.accessToken));
stringBuilder.append("&");
}
return stringBuilder.toString();
}
public String getParamMap(){
public Map<String, String> getParamMaps(){
Map<String, String> param = new HashMap<>();
StringBuilder stringBuilder = new StringBuilder();
if(StringUtils.isNotBlank(this.grantType)) {
stringBuilder.append("granType = ");
stringBuilder.append( URLEncoder.encode(this.grantType));
stringBuilder.append("&");
param.put("grant_type", URLEncoder.encode(this.grantType));
}
if(StringUtils.isNotBlank(this.refreshToken)) {
stringBuilder.append("refresh_token = ");
stringBuilder.append( URLEncoder.encode(this.refreshToken));
stringBuilder.append("&");
param.put("refresh_token", URLEncoder.encode(this.refreshToken));
}
if(StringUtils.isNotBlank(this.clientId)) {
stringBuilder.append("client_id = ");
stringBuilder.append( URLEncoder.encode(this.clientId));
stringBuilder.append("&");
param.put("client_id", URLEncoder.encode(this.clientId));
}
if(StringUtils.isNotBlank(this.clientSecret)) {
stringBuilder.append("client_secret = ");
stringBuilder.append( URLEncoder.encode(this.clientSecret));
stringBuilder.append("&");
param.put("client_secret", URLEncoder.encode(this.clientSecret));
}
if(StringUtils.isNotBlank(this.code)) {
stringBuilder.append("code = ");
stringBuilder.append( URLEncoder.encode(this.code));
stringBuilder.append("&");
param.put("code", URLEncoder.encode(this.code));
}
if(StringUtils.isNotBlank(this.redirectUri)) {
stringBuilder.append("redirect_uri = ");
stringBuilder.append( URLEncoder.encode(this.redirectUri));
stringBuilder.append("&");
param.put("redirect_uri", URLEncoder.encode(this.redirectUri));
}
if(StringUtils.isNotBlank(this.nspSvc)) {
stringBuilder.append("nsp_svc = ");
stringBuilder.append( URLEncoder.encode(this.nspSvc));
stringBuilder.append("&");
param.put("nsp_svc", URLEncoder.encode(this.nspSvc));
}
if(StringUtils.isNotBlank(this.openId)) {
stringBuilder.append("open_id = ");
stringBuilder.append( URLEncoder.encode(this.openId));
stringBuilder.append("&");
param.put("open_id", URLEncoder.encode(this.openId));
}
if(StringUtils.isNotBlank(this.accessToken)) {
stringBuilder.append("access_token = ");
stringBuilder.append( URLEncoder.encode(this.accessToken));
stringBuilder.append("&");
param.put("access_token", URLEncoder.encode(this.accessToken));
}
return stringBuilder.toString();
return param;
}
}
package com.xxfc.platform.universal.biz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class FastServiceBiz {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment