|
@ -11,13 +11,11 @@ import com.epmet.commons.thirdplat.properties.JcetThirdplatProps; |
|
|
import com.epmet.commons.thirdplat.properties.ThirdplatProps; |
|
|
import com.epmet.commons.thirdplat.properties.ThirdplatProps; |
|
|
import com.epmet.commons.tools.utils.HttpClientManager; |
|
|
import com.epmet.commons.tools.utils.HttpClientManager; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
import java.io.UnsupportedEncodingException; |
|
|
import java.util.HashMap; |
|
|
import java.util.HashMap; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
@Component |
|
|
|
|
|
public class JcetApiService extends AbstractApiService { |
|
|
public class JcetApiService extends AbstractApiService { |
|
|
|
|
|
|
|
|
private JcetThirdplatProps jcetThirdplatProps; |
|
|
private JcetThirdplatProps jcetThirdplatProps; |
|
@ -85,10 +83,10 @@ public class JcetApiService extends AbstractApiService { |
|
|
|
|
|
|
|
|
Map<String, String> headers = new HashMap(); |
|
|
Map<String, String> headers = new HashMap(); |
|
|
long timestamp = System.currentTimeMillis(); |
|
|
long timestamp = System.currentTimeMillis(); |
|
|
headers.put("openTimestamp", String.valueOf(timestamp)); |
|
|
headers.put(JcetConstants.PLAT_HEADER_OPEN_TIMESTAMP, String.valueOf(timestamp)); |
|
|
headers.put("openAppId", jcetThirdplatProps.getAppkey()); |
|
|
headers.put(JcetConstants.PLAT_HEADER_OPEN_APP_ID, jcetThirdplatProps.getAppkey()); |
|
|
String encryptContent = jcetThirdplatProps.getAppkey() + timestamp + bodyLength; |
|
|
String encryptContent = jcetThirdplatProps.getAppkey() + timestamp + bodyLength; |
|
|
headers.put("openSign", SignUtils.generate(encryptContent, jcetThirdplatProps.getAppsecret())); |
|
|
headers.put(JcetConstants.PLAT_HEADER_OPEN_SIGN, SignUtils.generate(encryptContent, jcetThirdplatProps.getAppsecret())); |
|
|
return headers; |
|
|
return headers; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|