Skip to content

Commit

Permalink
Merge pull request #4 from Hyq0719/feature/hyq/2022/01/init
Browse files Browse the repository at this point in the history
Feature/hyq/2022/01/init
  • Loading branch information
黄悦麒 authored Feb 8, 2022
2 parents 2cabb00 + ae2991f commit eab885f
Show file tree
Hide file tree
Showing 43 changed files with 535 additions and 527 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public class CodeGenerator {
public static final GeneratorConfigEntity GENERATOR_ENTITY = getConfig();
public static final Map<String, String> TYPE_MAP = getTypeMap();
public static final Set<String> OJBECT_TYPE_SET = getObjectTypeSet();
public static final Set<String> OBJECT_TYPE_SET = getObjectTypeSet();
public static final Set<String> LIST_TYPE_SET = getListTypeSet();

/**
Expand Down Expand Up @@ -144,7 +144,7 @@ public static void parseBaseEntity(Map<String, List<BaseEntity>> map, BaseEntity
baseEntity.setType(TYPE_MAP.get(type));
return;
}
if (OJBECT_TYPE_SET.contains(type)) {
if (OBJECT_TYPE_SET.contains(type)) {
String className = GeneratorUtils.toUpperCaseFirstOne(baseEntity.getCamelProperty() + "Struct");

baseEntity.setType(className);
Expand All @@ -170,7 +170,7 @@ public static void parseBaseEntity(Map<String, List<BaseEntity>> map, BaseEntity
baseEntity.setType(TYPE_MAP.get(type));
return;
}
if (OJBECT_TYPE_SET.contains(type)) {
if (OBJECT_TYPE_SET.contains(type)) {
String camelProperty = baseEntity.getCamelProperty();
String className;
if ("list".equals(camelProperty)) {
Expand Down Expand Up @@ -305,22 +305,25 @@ private static Set<String> getObjectTypeSet() {
set.add("json");
set.add("json[]");
set.add("list");
set.add("List");
set.add("array");
set.add("Array");
return set;
}

private static Set<String> getListTypeSet() {
Set<String> set = new HashSet<>();
set.add("[]");
set.add("list");
set.add("List");
set.add("array");
set.add("Array");
return set;
}

private static void setArrayBaseEntity(String type, BaseEntity baseEntity, String className) {
if (isListType(type)) {
baseEntity.setType("List<" + className + ">");
return;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,18 @@ public CreativeCustomCreativeUpdate creativeCustomCreativeUpdate() {
}

@ApiRequestMapping(value = "/campaign/get", method = RequestConstants.GET, usePostBody = false,
contentTypes = {
RequestConstants.CONTENT_TYPE_TEXT_PLAIN})
public class CampaignGet extends OceanApiRequest<ConfigRequest<CampaignsGetFilteringStruct>,
OceanResponse<PageResponseData<CampaignsGetListStruct>>> {
contentTypes = {RequestConstants.CONTENT_TYPE_TEXT_PLAIN})
public class CampaignGet extends OceanApiRequest<ConfigRequest<CampaignGetFilteringStruct>,
OceanResponse<PageResponseData<CampaignGetListStruct>>> {

@Override
public void setRequestParam(List<Pair> localVarQueryParams, List<Pair> localVarCollectionQueryParams,
ConfigRequest<CampaignsGetFilteringStruct> configRequest) {
ConfigRequest<CampaignGetFilteringStruct> configRequest) {
Long advertiserId = configRequest.getAdvertiserId();
if (advertiserId != null) {
localVarQueryParams.addAll(parameterToPair(ADVERTISER_ID, advertiserId));
}
CampaignsGetFilteringStruct filtering = configRequest.getFiltering();
CampaignGetFilteringStruct filtering = configRequest.getFiltering();
if (filtering != null) {
localVarQueryParams.addAll(parameterToPair(FILTERING, JsonUtil.toJsonString(filtering)));
}
Expand All @@ -248,30 +247,30 @@ public void setRequestParam(List<Pair> localVarQueryParams, List<Pair> localVarC
}

@ApiRequestMapping(value = "/campaign/create/", method = RequestConstants.POST)
public class CampaignCreate extends OceanApiRequest<CampaignsAddRequest, OceanResponse<CampaignsAddResponseData>> {
public class CampaignCreate extends OceanApiRequest<CampaignCreateRequest, OceanResponse<CampaignCreateResponseData>> {
}

@ApiRequestMapping(value = "/campaign/update/", method = RequestConstants.POST)
public class CampaignUpdate extends OceanApiRequest<CampaignsUpdateRequest, OceanResponse<CampaignsUpdateResponseData>> {
public class CampaignUpdate extends OceanApiRequest<CampaignUpdateRequest, OceanResponse<CampaignUpdateResponseData>> {
}

@ApiRequestMapping(value = "/campaign/update/status/ ", method = RequestConstants.POST)
public class CampaignUpdateStatus
extends OceanApiRequest<CampaignsUpdateStatusRequest, OceanResponse<CampaignsUpdateStatusResponseData>> {
extends OceanApiRequest<CampaignUpdateStatusRequest, OceanResponse<CampaignUpdateStatusResponseData>> {
}

@ApiRequestMapping(value = "/ad/get/", method = RequestConstants.GET, usePostBody = false, contentTypes = {
RequestConstants.CONTENT_TYPE_TEXT_PLAIN})
public class AdGet extends OceanApiRequest<ConfigRequest<AdsGetFilteringStruct>,
OceanResponse<PageResponseData<AdsGetResponseListStruct>>> {
public class AdGet extends OceanApiRequest<ConfigRequest<AdGetFilteringStruct>,
OceanResponse<PageResponseData<AdGetResponseListStruct>>> {
@Override
public void setRequestParam(List<Pair> localVarQueryParams, List<Pair> localVarCollectionQueryParams,
ConfigRequest<AdsGetFilteringStruct> configRequest) {
ConfigRequest<AdGetFilteringStruct> configRequest) {
Long advertiserId = configRequest.getAdvertiserId();
if (advertiserId != null) {
localVarQueryParams.addAll(parameterToPair(ADVERTISER_ID, advertiserId));
}
AdsGetFilteringStruct filtering = configRequest.getFiltering();
AdGetFilteringStruct filtering = configRequest.getFiltering();
if (filtering != null) {
localVarQueryParams.addAll(parameterToPair(FILTERING, JsonUtil.toJsonString(filtering)));
}
Expand All @@ -292,16 +291,16 @@ public void setRequestParam(List<Pair> localVarQueryParams, List<Pair> localVarC

@ApiRequestMapping(value = "/ad/cost_protect_status/get/", method = RequestConstants.GET, usePostBody =
false, contentTypes = {RequestConstants.CONTENT_TYPE_TEXT_PLAIN})
public class AdCostProtectStatusGet extends OceanApiRequest<AdsGetCostProtectStatusRequest,
OceanResponse<AdsGetCostProtectStatusResponseData>> {
public class AdCostProtectStatusGet extends OceanApiRequest<AdCostProtectStatusGetRequest,
OceanResponse<AdCostProtectStatusGetResponseData>> {
@Override
public void setRequestParam(List<Pair> localVarQueryParams, List<Pair> localVarCollectionQueryParams,
AdsGetCostProtectStatusRequest adsGetCostProtectStatusRequest) {
Long advertiserId = adsGetCostProtectStatusRequest.getAdvertiserId();
AdCostProtectStatusGetRequest request) {
Long advertiserId = request.getAdvertiserId();
if (advertiserId != null) {
localVarQueryParams.addAll(parameterToPair(ADVERTISER_ID, advertiserId));
}
List<Long> adIds = adsGetCostProtectStatusRequest.getAdIds();
List<Long> adIds = request.getAdIds();
if (adIds != null) {
localVarQueryParams.addAll(parameterToPair("ad_ids", JsonUtil.toJsonString(adIds)));
}
Expand All @@ -311,56 +310,55 @@ public void setRequestParam(List<Pair> localVarQueryParams, List<Pair> localVarC
@ApiRequestMapping(value = "/ad/reject_reason/", method = RequestConstants.GET, usePostBody = false,
contentTypes = {RequestConstants.CONTENT_TYPE_TEXT_PLAIN})
public class AdRejectReason
extends OceanApiRequest<AdsGetRejectReasonRequest, OceanResponse<AdsGetRejectReasonResponseData>> {
extends OceanApiRequest<AdRejectReasonRequest, OceanResponse<AdRejectReasonResponseData>> {
@Override
public void setRequestParam(List<Pair> localVarQueryParams, List<Pair> localVarCollectionQueryParams,
AdsGetRejectReasonRequest adsGetRejectReasonRequest) {
Long advertiserId = adsGetRejectReasonRequest.getAdvertiserId();
AdRejectReasonRequest request) {
Long advertiserId = request.getAdvertiserId();
if (advertiserId != null) {
localVarQueryParams.addAll(parameterToPair(ADVERTISER_ID, advertiserId));
}
List<Long> adIds = adsGetRejectReasonRequest.getAdIds();
List<Long> adIds = request.getAdIds();
if (adIds != null) {
localVarQueryParams.addAll(parameterToPair("ad_ids", JsonUtil.toJsonString(adIds)));
}
}
}

@ApiRequestMapping(value = "/ad/create/", method = RequestConstants.POST)
public class AdCreate extends OceanApiRequest<AdsAddRequest, OceanResponse<AdsAddResponseData>> {
public class AdCreate extends OceanApiRequest<AdCreateRequest, OceanResponse<AdCreateResponseData>> {
}

@ApiRequestMapping(value = "/ad/update/", method = RequestConstants.POST)
public class AdUpdateApi extends OceanApiRequest<AdsUpdateRequest, OceanResponse<AdsUpdateResponseData>> {
public class AdUpdateApi extends OceanApiRequest<AdUpdateRequest, OceanResponse<AdUpdateResponseData>> {
}

@ApiRequestMapping(value = "/ad/update/status/", method = RequestConstants.POST)
public class AdUpdateStatus
extends OceanApiRequest<AdsUpdateStatusRequest, OceanResponse<AdsUpdateStatusResponseData>> {
extends OceanApiRequest<AdUpdateStatusRequest, OceanResponse<AdUpdateStatusResponseData>> {
}

@ApiRequestMapping(value = "/ad/update/budget/", method = RequestConstants.POST)
public class AdUpdateBudget
extends OceanApiRequest<AdsUpdateBudgetRequest, OceanResponse<AdsUpdateBudgetResponseData>> {
extends OceanApiRequest<AdUpdateBudgetRequest, OceanResponse<AdUpdateBudgetResponseData>> {
}

@ApiRequestMapping(value = "/ad/update/bid/", method = RequestConstants.POST)
public class AdUpdateBid extends OceanApiRequest<AdsUpdateBidRequest, OceanResponse<AdsUpdateBidResponseData>> {
public class AdUpdateBid extends OceanApiRequest<AdUpdateBidRequest, OceanResponse<AdUpdateBidResponseData>> {
}

@ApiRequestMapping(value = "/creative/get/", method = RequestConstants.GET, usePostBody = false,
contentTypes = {RequestConstants.CONTENT_TYPE_TEXT_PLAIN})
public class CreativeGet
extends OceanApiRequest<ConfigRequest<AdcreativesGetFilteringStruct>,
OceanResponse<PageResponseData<AdcreativesGetListStruct>>> {
public class CreativeGet extends OceanApiRequest<ConfigRequest<CreativeGetFilteringStruct>,
OceanResponse<PageResponseData<CreativeGetListStruct>>> {
@Override
public void setRequestParam(List<Pair> localVarQueryParams, List<Pair> localVarCollectionQueryParams,
ConfigRequest<AdcreativesGetFilteringStruct> configRequest) {
ConfigRequest<CreativeGetFilteringStruct> configRequest) {
Long advertiserId = configRequest.getAdvertiserId();
if (advertiserId != null) {
localVarQueryParams.addAll(parameterToPair(ADVERTISER_ID, advertiserId));
}
AdcreativesGetFilteringStruct filtering = configRequest.getFiltering();
CreativeGetFilteringStruct filtering = configRequest.getFiltering();
if (filtering != null) {
localVarQueryParams.addAll(parameterToPair(FILTERING, JsonUtil.toJsonString(filtering)));
}
Expand All @@ -382,12 +380,14 @@ public void setRequestParam(List<Pair> localVarQueryParams, List<Pair> localVarC

@ApiRequestMapping(value = "/creative/custom_creative/create/", method = RequestConstants.POST)
public class CreativeCustomCreativeCreate
extends OceanApiRequest<AdcreativesCustomAddRequest, OceanResponse<AdcreativesCustomAddResponseData>> {
extends OceanApiRequest<CreativeCustomCreativeCreateRequest,
OceanResponse<CreativeCustomCreativeCreateResponseData>> {
}

@ApiRequestMapping(value = "/creative/custom_creative/update/", method = RequestConstants.POST)
public class CreativeCustomCreativeUpdate
extends OceanApiRequest<AdcreativesCustomUpdateRequest, OceanResponse<AdcreativesCustomUpdateResponseData>> {
extends OceanApiRequest<CreativeCustomCreativeUpdateRequest,
OceanResponse<CreativeCustomCreativeUpdateResponseData>> {
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ public ReportCreativeGet reportCreativeGet() {

@ApiRequestMapping(value = "/report/agent/get_v2/", method = RequestConstants.GET, usePostBody = false,
contentTypes = {RequestConstants.CONTENT_TYPE_TEXT_PLAIN})
public class ReportAgentGetV2 extends OceanApiRequest<ReportAgentGetRequest,
OceanResponse<PageResponseData<ReportAgentGetResponseStruct>>> {
public class ReportAgentGetV2 extends OceanApiRequest<ReportAgentGetV2Request,
OceanResponse<PageResponseData<ReportAgentGetV2ResponseStruct>>> {
@Override
public void setRequestParam(List<Pair> localVarQueryParams, List<Pair> localVarCollectionQueryParams,
ReportAgentGetRequest reportRequest) {
ReportAgentGetV2Request reportRequest) {
Long agentId = reportRequest.getAgentId();
if (agentId != null) {
localVarQueryParams.addAll(parameterToPair("agent_id", agentId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
import java.util.List;

@Data
public class AdsGetCostProtectStatusRequest implements TokenKey {
public class AdCostProtectStatusGetRequest implements TokenKey {
@SerializedName("advertiser_id")
private Long advertiserId = null;

@SerializedName("ad_ids")
private List<Long> adIds = null;

public AdsGetCostProtectStatusRequest advertiserId(Long advertiserId) {
public AdCostProtectStatusGetRequest advertiserId(Long advertiserId) {
this.advertiserId = advertiserId;
return this;
}

public AdsGetCostProtectStatusRequest adIds(List<Long> adIds) {
public AdCostProtectStatusGetRequest adIds(List<Long> adIds) {
this.adIds = adIds;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import java.util.List;

@Data
public class AdsGetCostProtectStatusResponseData {
public class AdCostProtectStatusGetResponseData {
@SerializedName("list")
private List<AdsGetCostProtectStatusResponseListStruct> list = null;

public AdsGetCostProtectStatusResponseData list(List<AdsGetCostProtectStatusResponseListStruct> list) {
public AdCostProtectStatusGetResponseData list(List<AdsGetCostProtectStatusResponseListStruct> list) {
this.list = list;
return this;
}
Expand Down
Loading

0 comments on commit eab885f

Please sign in to comment.