Skip to content

Commit

Permalink
fix(generator): some struct member may duplicate in metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Jul 1, 2021
1 parent 023d72d commit 649b8f6
Show file tree
Hide file tree
Showing 30 changed files with 378 additions and 234 deletions.
Binary file modified bin/downloader
Binary file not shown.
Binary file modified bin/generator
Binary file not shown.
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package opentaobao

const (
GitVersion = "v1.1.5"
GitCommit = "9bb69eee"
GitCommit = "ef8c4fe1"
GitDate = "<no value>"
GitBuiltBy = "unknown"
)
10 changes: 10 additions & 0 deletions metadata/apidoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,23 @@ func (d ApiDoc) ApiTpl() ApiTpl {
RequestParams: make([]TplParam, len(d.RequestParams)),
ResponseParams: make([]TplParam, len(d.ResponseParams)),
}
reqParamMp := make(map[string]struct{}, len(d.RequestParams))
for idx, p := range d.RequestParams {
if _, found := reqParamMp[p.Name]; found {
continue
}
reqParamMp[p.Name] = struct{}{}
tpl.RequestParams[idx] = p.TplParam(tpl.Name)
if !tpl.IsMultipart && tpl.RequestParams[idx].IsMultipart() {
tpl.IsMultipart = true
}
}
respParamMp := make(map[string]struct{}, len(d.ResponseParams))
for idx, p := range d.ResponseParams {
if _, found := respParamMp[p.Name]; found {
continue
}
respParamMp[p.Name] = struct{}{}
tpl.ResponseParams[idx] = p.TplParam(tpl.Name)
if tpl.ResponseParams[idx].Name == "RequestId" {
tpl.HasRequestId = true
Expand Down
4 changes: 2 additions & 2 deletions model/alsc/AlibabaAlscCrmCardBindcustomerResponse.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ type AlibabaAlscCrmCardBindcustomerResponse struct {
RequestId string `json:"request_id,omitempty" xml:"request_id,omitempty"`
// 接口结果
Result *CommonResult `json:"result,omitempty" xml:"result,omitempty"`
// 接口结果
Result *CommonResult `json:"result,omitempty" xml:"result,omitempty"`
//
`json:",omitempty" xml:",omitempty"`
}
58 changes: 52 additions & 6 deletions model/axintrade/AxinFundDTO.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,55 @@
package axintrade

// AxinFundDTO
type AxinFundDTO struct {
// 有效资金单列表
FundList []AxinFundDto `json:"fund_list,omitempty" xml:"fund_list>axin_fund_dto,omitempty"`
// 已支付总金额
TotalPayedAmount int64 `json:"total_payed_amount,omitempty" xml:"total_payed_amount,omitempty"`
// AxinFundDto
type AxinFundDto struct {
// 支付宝交易号
AlipayOrderId string `json:"alipay_order_id,omitempty" xml:"alipay_order_id,omitempty"`
// 支付宝外部商户号
AlipayOuterId string `json:"alipay_outer_id,omitempty" xml:"alipay_outer_id,omitempty"`
// 扩展属性
Attributes string `json:"attributes,omitempty" xml:"attributes,omitempty"`
// 主键
Id int64 `json:"id,omitempty" xml:"id,omitempty"`
// 订单ID
OuterOrderId string `json:"outer_order_id,omitempty" xml:"outer_order_id,omitempty"`
// 付款金额总额
PayFee int64 `json:"pay_fee,omitempty" xml:"pay_fee,omitempty"`
// 正向资金单ID,仅在逆向资金单上使用
PayFundId int64 `json:"pay_fund_id,omitempty" xml:"pay_fund_id,omitempty"`
// 支付订单号(即tp订单号或支付宝流水号)
PayOrderId string `json:"pay_order_id,omitempty" xml:"pay_order_id,omitempty"`
// 付款时间
PayTime string `json:"pay_time,omitempty" xml:"pay_time,omitempty"`
// 付款方式
PayType int64 `json:"pay_type,omitempty" xml:"pay_type,omitempty"`
// 支付方账号
PayerAccount string `json:"payer_account,omitempty" xml:"payer_account,omitempty"`
// 支付方账号类型
PayerAccountType int64 `json:"payer_account_type,omitempty" xml:"payer_account_type,omitempty"`
// 付款方账号id
PayerAlipayId string `json:"payer_alipay_id,omitempty" xml:"payer_alipay_id,omitempty"`
// 支付方昵称
PayerNick string `json:"payer_nick,omitempty" xml:"payer_nick,omitempty"`
// 支付方淘宝ID
PayerTid int64 `json:"payer_tid,omitempty" xml:"payer_tid,omitempty"`
// 收款方账号
ReceiverAccount string `json:"receiver_account,omitempty" xml:"receiver_account,omitempty"`
// 收款方账号类型
ReceiverAccountType int64 `json:"receiver_account_type,omitempty" xml:"receiver_account_type,omitempty"`
// 收款方账号id
ReceiverAlipayId string `json:"receiver_alipay_id,omitempty" xml:"receiver_alipay_id,omitempty"`
// 收款方昵称
ReceiverNick string `json:"receiver_nick,omitempty" xml:"receiver_nick,omitempty"`
// 收款方淘宝ID
ReceiverTid int64 `json:"receiver_tid,omitempty" xml:"receiver_tid,omitempty"`
// 请求版本号
ReqVersion string `json:"req_version,omitempty" xml:"req_version,omitempty"`
// 二级商户smid
Smid string `json:"smid,omitempty" xml:"smid,omitempty"`
// 资金单状态
Status int64 `json:"status,omitempty" xml:"status,omitempty"`
// 付款来源
TradeSource int64 `json:"trade_source,omitempty" xml:"trade_source,omitempty"`
// 交易方式
TradeType int64 `json:"trade_type,omitempty" xml:"trade_type,omitempty"`
}
8 changes: 4 additions & 4 deletions model/baichuan/ASODeviceInfoDO.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package baichuan

// AsoDeviceInfoDo
type AsoDeviceInfoDo struct {
// ASODeviceInfoDO
type ASODeviceInfoDO struct {
// idfa
Idfa string `json:"idfa,omitempty" xml:"idfa,omitempty"`
// imei
Imei string `json:"imei,omitempty" xml:"imei,omitempty"`
// imsi
Imsi string `json:"imsi,omitempty" xml:"imsi,omitempty"`
// idfa
Idfa string `json:"idfa,omitempty" xml:"idfa,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ type AlibabaAlihealthDrugKytUpstorebillfileResponse struct {
MsgInfo string `json:"msg_info,omitempty" xml:"msg_info,omitempty"`
// 返回接口
ResponseSuccess bool `json:"response_success,omitempty" xml:"response_success,omitempty"`
// 返回ID
Model string `json:"model,omitempty" xml:"model,omitempty"`
// 请求编码
MsgCode string `json:"msg_code,omitempty" xml:"msg_code,omitempty"`
// 请求描述
MsgInfo string `json:"msg_info,omitempty" xml:"msg_info,omitempty"`
// 返回接口
ResponseSuccess bool `json:"response_success,omitempty" xml:"response_success,omitempty"`
//
`json:",omitempty" xml:",omitempty"`
//
`json:",omitempty" xml:",omitempty"`
//
`json:",omitempty" xml:",omitempty"`
//
`json:",omitempty" xml:",omitempty"`
}
38 changes: 22 additions & 16 deletions model/drugtrace/CodeRelationDto.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
package drugtrace

// CodeRelationDTO
type CodeRelationDTO struct {
// 追溯码;查询的码
Code string `json:"code,omitempty" xml:"code,omitempty"`
// 父码
ParentCode string `json:"parent_code,omitempty" xml:"parent_code,omitempty"`
// 码级别
CodeLevel string `json:"code_level,omitempty" xml:"code_level,omitempty"`
// 包装级别
CodePackLevel string `json:"code_pack_level,omitempty" xml:"code_pack_level,omitempty"`
// 装箱数量;小盒码,返回1;中包码,返回实际小盒数量;大箱码,返回实际小盒数量
BoxAmount int64 `json:"box_amount,omitempty" xml:"box_amount,omitempty"`
// 大箱或中包状态;若扫描的是小盒码,直接返回正常; 0-正常;1-拼箱;2-零箱;3-即拼箱又零箱
BoxStatus int64 `json:"box_status,omitempty" xml:"box_status,omitempty"`
// 码状态
Status string `json:"status,omitempty" xml:"status,omitempty"`
// CodeRelationDto
type CodeRelationDto struct {
// 激活信息
CodeActiveInfoDto *CodeActiveInfoDto `json:"code_active_info_dto,omitempty" xml:"code_active_info_dto,omitempty"`
// 码关联关系
CodeRelationList []CodeInfo `json:"code_relation_list,omitempty" xml:"code_relation_list>code_info,omitempty"`
// 是否是最小包装
IsSmallest string `json:"is_smallest,omitempty" xml:"is_smallest,omitempty"`
// 药品包装信息
PkgInfoDto *PkgInfoDto `json:"pkg_info_dto,omitempty" xml:"pkg_info_dto,omitempty"`
// 药品基础信息
BaseInfosDto *BaseInfosDto `json:"base_infos_dto,omitempty" xml:"base_infos_dto,omitempty"`
// 生产信息
ProduceInfoList []ProduceInfoDto `json:"produce_info_list,omitempty" xml:"produce_info_list>produce_info_dto,omitempty"`
// 激活信息
CodeActiveInfoDTO *CodeActiveInfoDto `json:"code_active_info_d_t_o,omitempty" xml:"code_active_info_d_t_o,omitempty"`
// 药品包装信息
PkgInfoDTO *PkgInfoDto `json:"pkg_info_d_t_o,omitempty" xml:"pkg_info_d_t_o,omitempty"`
// 药品基础信息
BaseInfosDTO *BaseInfosDto `json:"base_infos_d_t_o,omitempty" xml:"base_infos_d_t_o,omitempty"`
// errorCodeContent
ErrorCodeContent string `json:"error_code_content,omitempty" xml:"error_code_content,omitempty"`
}
6 changes: 3 additions & 3 deletions model/feedflow/LaunchPeriodDto.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package feedflow

// LaunchPeriodDTO
type LaunchPeriodDTO struct {
// 时间
// LaunchPeriodDto
type LaunchPeriodDto struct {
// 列表
TimeSpanList []TimeSpanDto `json:"time_span_list,omitempty" xml:"time_span_list>time_span_dto,omitempty"`
}
12 changes: 6 additions & 6 deletions model/icbulogistics/PickupInfoDTO.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package icbulogistics

// PickupInfoDto
type PickupInfoDto struct {
// 能否上门揽收
CanPickup bool `json:"can_pickup,omitempty" xml:"can_pickup,omitempty"`
// PickupInfoDTO
type PickupInfoDTO struct {
// 备用字段(上门揽收服务商),目前为空
ServiceProvider string `json:"service_provider,omitempty" xml:"service_provider,omitempty"`
// 上门揽收类型,warehouse_free_pickup:仓库免费上门揽收,warehouse_paid_pickup:仓库收费上门揽收,provider_paid_pickup:服务商收费上门揽收
PickupType string `json:"pickup_type,omitempty" xml:"pickup_type,omitempty"`
// 能否上门揽收
CanPickup bool `json:"can_pickup,omitempty" xml:"can_pickup,omitempty"`
// 上门揽收类型名称
PickupTypeName string `json:"pickup_type_name,omitempty" xml:"pickup_type_name,omitempty"`
// 上门揽收服务商
ServiceProvider string `json:"service_provider,omitempty" xml:"service_provider,omitempty"`
}
8 changes: 3 additions & 5 deletions model/koubeimall/MallDto.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package koubeimall

// MallDTO
type MallDTO struct {
// MallDto
type MallDto struct {
// 商圈LOGO
MallLogo string `json:"mall_logo,omitempty" xml:"mall_logo,omitempty"`
// 商圈名称
Expand All @@ -12,7 +12,7 @@ type MallDTO struct {
MallCover string `json:"mall_cover,omitempty" xml:"mall_cover,omitempty"`
// 商圈ID
MallId string `json:"mall_id,omitempty" xml:"mall_id,omitempty"`
// 地理位置信息模型
// 地理位置信息
DistrictInfo *DistrictInfo `json:"district_info,omitempty" xml:"district_info,omitempty"`
// 商圈主页小程序URL,根据入参参数display_channel信息,获取对应端小程序URL,默认支付宝小程序链接
MallHomePageUrl string `json:"mall_home_page_url,omitempty" xml:"mall_home_page_url,omitempty"`
Expand All @@ -22,6 +22,4 @@ type MallDTO struct {
CategoryName string `json:"category_name,omitempty" xml:"category_name,omitempty"`
// 商圈标签,多个标签用英文","分隔符
MallLabel string `json:"mall_label,omitempty" xml:"mall_label,omitempty"`
// 距离
Distance string `json:"distance,omitempty" xml:"distance,omitempty"`
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package miniappopen

// DistributionOrderBindTargetEntityOpenResultDto
type DistributionOrderBindTargetEntityOpenResultDto struct {
// DistributionOrderBindTargetEntityOpenResultDTO
type DistributionOrderBindTargetEntityOpenResultDTO struct {
// 绑定的目标url
Url string `json:"url,omitempty" xml:"url,omitempty"`
// 绑定投放的场景
SceneName string `json:"scene_name,omitempty" xml:"scene_name,omitempty"`
// 商品列表的绑定结果
BindResultList []DistributionOrderBindBaseDto `json:"bind_result_list,omitempty" xml:"bind_result_list>distribution_order_bind_base_dto,omitempty"`
// 绑定的投放计划id
DistributeId int64 `json:"distribute_id,omitempty" xml:"distribute_id,omitempty"`
}
4 changes: 2 additions & 2 deletions model/nazca/AlibabaInfodeptLassenCasestatisticsGetResponse.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ type AlibabaInfodeptLassenCasestatisticsGetResponse struct {
RequestId string `json:"request_id,omitempty" xml:"request_id,omitempty"`
// result
Result string `json:"result,omitempty" xml:"result,omitempty"`
// result
Result string `json:"result,omitempty" xml:"result,omitempty"`
//
`json:",omitempty" xml:",omitempty"`
}
48 changes: 25 additions & 23 deletions model/nlife/RetailSkuTopDO.go
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
package nlife

// RetailSkuTopDO
type RetailSkuTopDO struct {
// outerId
OuterId string `json:"outer_id,omitempty" xml:"outer_id,omitempty"`
// skuId
SkuId int64 `json:"sku_id,omitempty" xml:"sku_id,omitempty"`
// barcode
Barcode string `json:"barcode,omitempty" xml:"barcode,omitempty"`
// price
// RetailSkuTopDo
type RetailSkuTopDo struct {
// 上次修改时间
Modified string `json:"modified,omitempty" xml:"modified,omitempty"`
// created
Created string `json:"created,omitempty" xml:"created,omitempty"`
// 淘宝上的skuId
TaobaoSkuId string `json:"taobao_sku_id,omitempty" xml:"taobao_sku_id,omitempty"`
// 淘宝上的itemId
TaobaoItemId string `json:"taobao_item_id,omitempty" xml:"taobao_item_id,omitempty"`
// sku主图URL
PicUrl string `json:"pic_url,omitempty" xml:"pic_url,omitempty"`
// sku价格
Price string `json:"price,omitempty" xml:"price,omitempty"`
// sku属性,多个属性以分号分隔
Properties string `json:"properties,omitempty" xml:"properties,omitempty"`
// sku库存
Quantity int64 `json:"quantity,omitempty" xml:"quantity,omitempty"`
// sku属性名称,多个属性以分号分隔
// sku属性名称
PropertiesName string `json:"properties_name,omitempty" xml:"properties_name,omitempty"`
// 修改时间
Modified string `json:"modified,omitempty" xml:"modified,omitempty"`
// 创建时间
Created string `json:"created,omitempty" xml:"created,omitempty"`
// sku的图片信息
PicUrl string `json:"pic_url,omitempty" xml:"pic_url,omitempty"`
// taobaoItemId
TaobaoItemId string `json:"taobao_item_id,omitempty" xml:"taobao_item_id,omitempty"`
// taobaoSkuId
TaobaoSkuId string `json:"taobao_sku_id,omitempty" xml:"taobao_sku_id,omitempty"`
// sku属性
Properties string `json:"properties,omitempty" xml:"properties,omitempty"`
// barcode
Barcode string `json:"barcode,omitempty" xml:"barcode,omitempty"`
// skuId
SkuId int64 `json:"sku_id,omitempty" xml:"sku_id,omitempty"`
// 外部商家的编码
OuterId string `json:"outer_id,omitempty" xml:"outer_id,omitempty"`
// sku的挂牌价-单位元,保留2位小数
TagPrice string `json:"tag_price,omitempty" xml:"tag_price,omitempty"`
// sku的真实商品
// skuRefId
SkuRefId int64 `json:"sku_ref_id,omitempty" xml:"sku_ref_id,omitempty"`
// 网直供库存
OnlineQuantity int64 `json:"online_quantity,omitempty" xml:"online_quantity,omitempty"`
// 自用编码
CustomCode string `json:"custom_code,omitempty" xml:"custom_code,omitempty"`
}
68 changes: 64 additions & 4 deletions model/nrt/NrtStoreDTO.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,67 @@
package nrt

// NrtStoreDto
type NrtStoreDto struct {
// 摊位Id
StallId int64 `json:"stall_id,omitempty" xml:"stall_id,omitempty"`
// NrtStoreDTO
type NrtStoreDTO struct {
// 摊位编号
StallCode string `json:"stall_code,omitempty" xml:"stall_code,omitempty"`
// 区编码
DistrictCode int64 `json:"district_code,omitempty" xml:"district_code,omitempty"`
// 市编码
CityCode int64 `json:"city_code,omitempty" xml:"city_code,omitempty"`
// 业务标识
BizCode string `json:"biz_code,omitempty" xml:"biz_code,omitempty"`
// 详细地址
ShortAddress string `json:"short_address,omitempty" xml:"short_address,omitempty"`
// 租赁结束时间
EndTime string `json:"end_time,omitempty" xml:"end_time,omitempty"`
// 操作类型
OpType string `json:"op_type,omitempty" xml:"op_type,omitempty"`
// 主图地址
Pic string `json:"pic,omitempty" xml:"pic,omitempty"`
// 经销商编码
AgencyCode string `json:"agency_code,omitempty" xml:"agency_code,omitempty"`
// 营业时间
BusinessTime string `json:"business_time,omitempty" xml:"business_time,omitempty"`
// 经营品牌编号
BusinessBrandids string `json:"business_brandids,omitempty" xml:"business_brandids,omitempty"`
// 城市名
CityName string `json:"city_name,omitempty" xml:"city_name,omitempty"`
// 摊位部门Id
StallDeptid string `json:"stall_deptid,omitempty" xml:"stall_deptid,omitempty"`
// 卖场编码
MallCode string `json:"mall_code,omitempty" xml:"mall_code,omitempty"`
// 品牌系列
BrandSeries string `json:"brand_series,omitempty" xml:"brand_series,omitempty"`
// 幂等id
OutId string `json:"out_id,omitempty" xml:"out_id,omitempty"`
// 纬度
Lat string `json:"lat,omitempty" xml:"lat,omitempty"`
// 租赁开始时间
StartTime string `json:"start_time,omitempty" xml:"start_time,omitempty"`
// 经度
Lng string `json:"lng,omitempty" xml:"lng,omitempty"`
// 区名称
DistrictName string `json:"district_name,omitempty" xml:"district_name,omitempty"`
// 省编码
ProvinceCode int64 `json:"province_code,omitempty" xml:"province_code,omitempty"`
// 联系电话
Contract string `json:"contract,omitempty" xml:"contract,omitempty"`
// 经营品牌名称
BusinessBrandnames string `json:"business_brandnames,omitempty" xml:"business_brandnames,omitempty"`
// 版本号
Version int64 `json:"version,omitempty" xml:"version,omitempty"`
// 摊位名称
StallName string `json:"stall_name,omitempty" xml:"stall_name,omitempty"`
// 主营品类
CategoryName string `json:"category_name,omitempty" xml:"category_name,omitempty"`
// 省名称
ProvinceName string `json:"province_name,omitempty" xml:"province_name,omitempty"`
// 主营品牌Id
BrandId string `json:"brand_id,omitempty" xml:"brand_id,omitempty"`
// 主营品牌名称
BrandName string `json:"brand_name,omitempty" xml:"brand_name,omitempty"`
// 摊位状态
Status int64 `json:"status,omitempty" xml:"status,omitempty"`
// 卖场部门Id
MallDepid string `json:"mall_depid,omitempty" xml:"mall_depid,omitempty"`
}
Loading

0 comments on commit 649b8f6

Please sign in to comment.