九州世界 v1.0版本的 MD5 值为:7e82e48b69a4c36d0bdfb2a8d382d05d
以下内容为反编译后的 GoldPlanService.java 源代码,内容仅作参考
package com.wechat.pay.java.service.goldplan;
import com.wechat.pay.java.core.Config;
import com.wechat.pay.java.core.http.Constant;
import com.wechat.pay.java.core.http.DefaultHttpClientBuilder;
import com.wechat.pay.java.core.http.HostName;
import com.wechat.pay.java.core.http.HttpClient;
import com.wechat.pay.java.core.http.HttpHeaders;
import com.wechat.pay.java.core.http.HttpMethod;
import com.wechat.pay.java.core.http.HttpRequest;
import com.wechat.pay.java.core.http.JsonRequestBody;
import com.wechat.pay.java.core.http.MediaType;
import com.wechat.pay.java.core.http.RequestBody;
import com.wechat.pay.java.core.util.GsonUtil;
import com.wechat.pay.java.service.goldplan.model.ChangeCustomPageStatusRequest;
import com.wechat.pay.java.service.goldplan.model.ChangeCustomPageStatusResponse;
import com.wechat.pay.java.service.goldplan.model.ChangeGoldPlanStatusRequest;
import com.wechat.pay.java.service.goldplan.model.ChangeGoldPlanStatusResponse;
import com.wechat.pay.java.service.goldplan.model.CloseAdvertisingShowRequest;
import com.wechat.pay.java.service.goldplan.model.OpenAdvertisingShowRequest;
import com.wechat.pay.java.service.goldplan.model.SetAdvertisingIndustryFilterRequest;
import java.util.Objects;
public class GoldPlanService {
private final HostName hostName;
private final HttpClient httpClient;
private GoldPlanService(HttpClient httpClient, HostName hostName) {
this.httpClient = (HttpClient) Objects.requireNonNull(httpClient);
this.hostName = hostName;
}
public static class Builder {
private HostName hostName;
private HttpClient httpClient;
public Builder config(Config config) {
this.httpClient = new DefaultHttpClientBuilder().config(config).build();
return this;
}
public Builder hostName(HostName hostName) {
this.hostName = hostName;
return this;
}
public Builder httpClient(HttpClient httpClient) {
this.httpClient = httpClient;
return this;
}
public GoldPlanService build() {
return new GoldPlanService(this.httpClient, this.hostName);
}
}
public void closeAdvertisingShow(CloseAdvertisingShowRequest closeAdvertisingShowRequest) {
String replaceFirst = this.hostName != null ? "https://api.mch.weixin.qq.com/v3/goldplan/merchants/close-advertising-show".replaceFirst(HostName.API.getValue(), this.hostName.getValue()) : "https://api.mch.weixin.qq.com/v3/goldplan/merchants/close-advertising-show";
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.addHeader(Constant.ACCEPT, MediaType.APPLICATION_JSON.getValue());
httpHeaders.addHeader(Constant.CONTENT_TYPE, MediaType.APPLICATION_JSON.getValue());
this.httpClient.execute(new HttpRequest.Builder().httpMethod(HttpMethod.POST).url(replaceFirst).headers(httpHeaders).body(createRequestBody(closeAdvertisingShowRequest)).build(), null);
}
public void openAdvertisingShow(OpenAdvertisingShowRequest openAdvertisingShowRequest) {
String replaceFirst = this.hostName != null ? "https://api.mch.weixin.qq.com/v3/goldplan/merchants/open-advertising-show".replaceFirst(HostName.API.getValue(), this.hostName.getValue()) : "https://api.mch.weixin.qq.com/v3/goldplan/merchants/open-advertising-show";
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.addHeader(Constant.ACCEPT, MediaType.APPLICATION_JSON.getValue());
httpHeaders.addHeader(Constant.CONTENT_TYPE, MediaType.APPLICATION_JSON.getValue());
this.httpClient.execute(new HttpRequest.Builder().httpMethod(HttpMethod.PATCH).url(replaceFirst).headers(httpHeaders).body(createRequestBody(openAdvertisingShowRequest)).build(), null);
}
public void setAdvertisingIndustryFilter(SetAdvertisingIndustryFilterRequest setAdvertisingIndustryFilterRequest) {
String replaceFirst = this.hostName != null ? "https://api.mch.weixin.qq.com/v3/goldplan/merchants/set-advertising-industry-filter".replaceFirst(HostName.API.getValue(), this.hostName.getValue()) : "https://api.mch.weixin.qq.com/v3/goldplan/merchants/set-advertising-industry-filter";
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.addHeader(Constant.ACCEPT, MediaType.APPLICATION_JSON.getValue());
httpHeaders.addHeader(Constant.CONTENT_TYPE, MediaType.APPLICATION_JSON.getValue());
this.httpClient.execute(new HttpRequest.Builder().httpMethod(HttpMethod.POST).url(replaceFirst).headers(httpHeaders).body(createRequestBody(setAdvertisingIndustryFilterRequest)).build(), null);
}
public ChangeCustomPageStatusResponse changeCustomPageStatus(ChangeCustomPageStatusRequest changeCustomPageStatusRequest) {
String replaceFirst = this.hostName != null ? "https://api.mch.weixin.qq.com/v3/goldplan/merchants/changecustompagestatus".replaceFirst(HostName.API.getValue(), this.hostName.getValue()) : "https://api.mch.weixin.qq.com/v3/goldplan/merchants/changecustompagestatus";
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.addHeader(Constant.ACCEPT, MediaType.APPLICATION_JSON.getValue());
httpHeaders.addHeader(Constant.CONTENT_TYPE, MediaType.APPLICATION_JSON.getValue());
return (ChangeCustomPageStatusResponse) this.httpClient.execute(new HttpRequest.Builder().httpMethod(HttpMethod.POST).url(replaceFirst).headers(httpHeaders).body(createRequestBody(changeCustomPageStatusRequest)).build(), ChangeCustomPageStatusResponse.class).getServiceResponse();
}
public ChangeGoldPlanStatusResponse changeGoldPlanStatus(ChangeGoldPlanStatusRequest changeGoldPlanStatusRequest) {
String replaceFirst = this.hostName != null ? "https://api.mch.weixin.qq.com/v3/goldplan/merchants/changegoldplanstatus".replaceFirst(HostName.API.getValue(), this.hostName.getValue()) : "https://api.mch.weixin.qq.com/v3/goldplan/merchants/changegoldplanstatus";
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.addHeader(Constant.ACCEPT, MediaType.APPLICATION_JSON.getValue());
httpHeaders.addHeader(Constant.CONTENT_TYPE, MediaType.APPLICATION_JSON.getValue());
return (ChangeGoldPlanStatusResponse) this.httpClient.execute(new HttpRequest.Builder().httpMethod(HttpMethod.POST).url(replaceFirst).headers(httpHeaders).body(createRequestBody(changeGoldPlanStatusRequest)).build(), ChangeGoldPlanStatusResponse.class).getServiceResponse();
}
private RequestBody createRequestBody(Object obj) {
return new JsonRequestBody.Builder().body(GsonUtil.toJson(obj)).build();
}
}