models.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872
  1. // Copyright 2021 Tencent Inc. All rights reserved.
  2. //
  3. // 爱心餐对外API
  4. //
  5. // 微信支付爱心餐公益计划旨在面向深圳市的市政一线环卫工人提供每周一餐的1分钱用餐公益服务。在受助端,微信支付联动上千家餐饮门店关爱特殊人群,通过微信支付数字化能力将人群身份认证与公益福利领用全流程线上化,实现公益福利精准到人。在捐赠端,微信支付发挥连接优势与平台能力,结合用户就餐场景通过爱心餐一块捐插件让用户可在点餐时顺手捐1元,带动更多社会力量致谢城市美容师。
  6. //
  7. // API version: 0.0.4
  8. // Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
  9. package lovefeast
  10. import (
  11. "encoding/json"
  12. "fmt"
  13. )
  14. // Amount
  15. type Amount struct {
  16. // 订单总金额,单位为分。
  17. Total *int64 `json:"total"`
  18. // 用户支付金额,单位为分。
  19. PayerTotal *int64 `json:"payer_total"`
  20. // CNY:人民币,境内商户号仅支持人民币。
  21. Currency *string `json:"currency"`
  22. // 用户支付币种
  23. PayerCurrency *string `json:"payer_currency"`
  24. }
  25. func (o Amount) MarshalJSON() ([]byte, error) {
  26. toSerialize := map[string]interface{}{}
  27. if o.Total == nil {
  28. return nil, fmt.Errorf("field `Total` is required and must be specified in Amount")
  29. }
  30. toSerialize["total"] = o.Total
  31. if o.PayerTotal == nil {
  32. return nil, fmt.Errorf("field `PayerTotal` is required and must be specified in Amount")
  33. }
  34. toSerialize["payer_total"] = o.PayerTotal
  35. if o.Currency == nil {
  36. return nil, fmt.Errorf("field `Currency` is required and must be specified in Amount")
  37. }
  38. toSerialize["currency"] = o.Currency
  39. if o.PayerCurrency == nil {
  40. return nil, fmt.Errorf("field `PayerCurrency` is required and must be specified in Amount")
  41. }
  42. toSerialize["payer_currency"] = o.PayerCurrency
  43. return json.Marshal(toSerialize)
  44. }
  45. func (o Amount) String() string {
  46. var ret string
  47. if o.Total == nil {
  48. ret += "Total:<nil>, "
  49. } else {
  50. ret += fmt.Sprintf("Total:%v, ", *o.Total)
  51. }
  52. if o.PayerTotal == nil {
  53. ret += "PayerTotal:<nil>, "
  54. } else {
  55. ret += fmt.Sprintf("PayerTotal:%v, ", *o.PayerTotal)
  56. }
  57. if o.Currency == nil {
  58. ret += "Currency:<nil>, "
  59. } else {
  60. ret += fmt.Sprintf("Currency:%v, ", *o.Currency)
  61. }
  62. if o.PayerCurrency == nil {
  63. ret += "PayerCurrency:<nil>"
  64. } else {
  65. ret += fmt.Sprintf("PayerCurrency:%v", *o.PayerCurrency)
  66. }
  67. return fmt.Sprintf("Amount{%s}", ret)
  68. }
  69. func (o Amount) Clone() *Amount {
  70. ret := Amount{}
  71. if o.Total != nil {
  72. ret.Total = new(int64)
  73. *ret.Total = *o.Total
  74. }
  75. if o.PayerTotal != nil {
  76. ret.PayerTotal = new(int64)
  77. *ret.PayerTotal = *o.PayerTotal
  78. }
  79. if o.Currency != nil {
  80. ret.Currency = new(string)
  81. *ret.Currency = *o.Currency
  82. }
  83. if o.PayerCurrency != nil {
  84. ret.PayerCurrency = new(string)
  85. *ret.PayerCurrency = *o.PayerCurrency
  86. }
  87. return &ret
  88. }
  89. // BrandEntity
  90. type BrandEntity struct {
  91. // 用户在该品牌下捐赠的总次数
  92. DonateCount *int64 `json:"donate_count"`
  93. // 仅供参品牌返回,该品牌为环卫工人供餐总量
  94. ConsumeCount *int64 `json:"consume_count,omitempty"`
  95. }
  96. func (o BrandEntity) MarshalJSON() ([]byte, error) {
  97. toSerialize := map[string]interface{}{}
  98. if o.DonateCount == nil {
  99. return nil, fmt.Errorf("field `DonateCount` is required and must be specified in BrandEntity")
  100. }
  101. toSerialize["donate_count"] = o.DonateCount
  102. if o.ConsumeCount != nil {
  103. toSerialize["consume_count"] = o.ConsumeCount
  104. }
  105. return json.Marshal(toSerialize)
  106. }
  107. func (o BrandEntity) String() string {
  108. var ret string
  109. if o.DonateCount == nil {
  110. ret += "DonateCount:<nil>, "
  111. } else {
  112. ret += fmt.Sprintf("DonateCount:%v, ", *o.DonateCount)
  113. }
  114. if o.ConsumeCount == nil {
  115. ret += "ConsumeCount:<nil>"
  116. } else {
  117. ret += fmt.Sprintf("ConsumeCount:%v", *o.ConsumeCount)
  118. }
  119. return fmt.Sprintf("BrandEntity{%s}", ret)
  120. }
  121. func (o BrandEntity) Clone() *BrandEntity {
  122. ret := BrandEntity{}
  123. if o.DonateCount != nil {
  124. ret.DonateCount = new(int64)
  125. *ret.DonateCount = *o.DonateCount
  126. }
  127. if o.ConsumeCount != nil {
  128. ret.ConsumeCount = new(int64)
  129. *ret.ConsumeCount = *o.ConsumeCount
  130. }
  131. return &ret
  132. }
  133. // GetBrandRequest
  134. type GetBrandRequest struct {
  135. // 品牌的品牌ID,商家进驻微信支付品牌商家后获得的品牌ID
  136. BrandId *int64 `json:"brand_id"`
  137. }
  138. func (o GetBrandRequest) MarshalJSON() ([]byte, error) {
  139. toSerialize := map[string]interface{}{}
  140. if o.BrandId == nil {
  141. return nil, fmt.Errorf("field `BrandId` is required and must be specified in GetBrandRequest")
  142. }
  143. toSerialize["brand_id"] = o.BrandId
  144. return json.Marshal(toSerialize)
  145. }
  146. func (o GetBrandRequest) String() string {
  147. var ret string
  148. if o.BrandId == nil {
  149. ret += "BrandId:<nil>"
  150. } else {
  151. ret += fmt.Sprintf("BrandId:%v", *o.BrandId)
  152. }
  153. return fmt.Sprintf("GetBrandRequest{%s}", ret)
  154. }
  155. func (o GetBrandRequest) Clone() *GetBrandRequest {
  156. ret := GetBrandRequest{}
  157. if o.BrandId != nil {
  158. ret.BrandId = new(int64)
  159. *ret.BrandId = *o.BrandId
  160. }
  161. return &ret
  162. }
  163. // GetByUserRequest
  164. type GetByUserRequest struct {
  165. // 用户在商户AppID下的唯一标识
  166. Openid *string `json:"openid"`
  167. // 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一
  168. OutTradeNo *string `json:"out_trade_no"`
  169. }
  170. func (o GetByUserRequest) MarshalJSON() ([]byte, error) {
  171. toSerialize := map[string]interface{}{}
  172. if o.Openid == nil {
  173. return nil, fmt.Errorf("field `Openid` is required and must be specified in GetByUserRequest")
  174. }
  175. toSerialize["openid"] = o.Openid
  176. if o.OutTradeNo == nil {
  177. return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in GetByUserRequest")
  178. }
  179. toSerialize["out_trade_no"] = o.OutTradeNo
  180. return json.Marshal(toSerialize)
  181. }
  182. func (o GetByUserRequest) String() string {
  183. var ret string
  184. if o.Openid == nil {
  185. ret += "Openid:<nil>, "
  186. } else {
  187. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  188. }
  189. if o.OutTradeNo == nil {
  190. ret += "OutTradeNo:<nil>"
  191. } else {
  192. ret += fmt.Sprintf("OutTradeNo:%v", *o.OutTradeNo)
  193. }
  194. return fmt.Sprintf("GetByUserRequest{%s}", ret)
  195. }
  196. func (o GetByUserRequest) Clone() *GetByUserRequest {
  197. ret := GetByUserRequest{}
  198. if o.Openid != nil {
  199. ret.Openid = new(string)
  200. *ret.Openid = *o.Openid
  201. }
  202. if o.OutTradeNo != nil {
  203. ret.OutTradeNo = new(string)
  204. *ret.OutTradeNo = *o.OutTradeNo
  205. }
  206. return &ret
  207. }
  208. // ListByUserRequest
  209. type ListByUserRequest struct {
  210. // 用户在商户AppID下的唯一标识
  211. Openid *string `json:"openid"`
  212. // 品牌的品牌ID,商家进驻微信支付品牌商家后获得的品牌ID
  213. BrandId *int64 `json:"brand_id"`
  214. // 返回的最大记录条数,默认值为10
  215. Limit *int64 `json:"limit"`
  216. // 查询起始位置,默认值为0
  217. Offset *int64 `json:"offset,omitempty"`
  218. }
  219. func (o ListByUserRequest) MarshalJSON() ([]byte, error) {
  220. toSerialize := map[string]interface{}{}
  221. if o.Openid == nil {
  222. return nil, fmt.Errorf("field `Openid` is required and must be specified in ListByUserRequest")
  223. }
  224. toSerialize["openid"] = o.Openid
  225. if o.BrandId == nil {
  226. return nil, fmt.Errorf("field `BrandId` is required and must be specified in ListByUserRequest")
  227. }
  228. toSerialize["brand_id"] = o.BrandId
  229. if o.Limit == nil {
  230. return nil, fmt.Errorf("field `Limit` is required and must be specified in ListByUserRequest")
  231. }
  232. toSerialize["limit"] = o.Limit
  233. if o.Offset != nil {
  234. toSerialize["offset"] = o.Offset
  235. }
  236. return json.Marshal(toSerialize)
  237. }
  238. func (o ListByUserRequest) String() string {
  239. var ret string
  240. if o.Openid == nil {
  241. ret += "Openid:<nil>, "
  242. } else {
  243. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  244. }
  245. if o.BrandId == nil {
  246. ret += "BrandId:<nil>, "
  247. } else {
  248. ret += fmt.Sprintf("BrandId:%v, ", *o.BrandId)
  249. }
  250. if o.Limit == nil {
  251. ret += "Limit:<nil>, "
  252. } else {
  253. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  254. }
  255. if o.Offset == nil {
  256. ret += "Offset:<nil>"
  257. } else {
  258. ret += fmt.Sprintf("Offset:%v", *o.Offset)
  259. }
  260. return fmt.Sprintf("ListByUserRequest{%s}", ret)
  261. }
  262. func (o ListByUserRequest) Clone() *ListByUserRequest {
  263. ret := ListByUserRequest{}
  264. if o.Openid != nil {
  265. ret.Openid = new(string)
  266. *ret.Openid = *o.Openid
  267. }
  268. if o.BrandId != nil {
  269. ret.BrandId = new(int64)
  270. *ret.BrandId = *o.BrandId
  271. }
  272. if o.Limit != nil {
  273. ret.Limit = new(int64)
  274. *ret.Limit = *o.Limit
  275. }
  276. if o.Offset != nil {
  277. ret.Offset = new(int64)
  278. *ret.Offset = *o.Offset
  279. }
  280. return &ret
  281. }
  282. // MerchantOrder
  283. type MerchantOrder struct {
  284. // 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一。 特殊规则:最小字符长度为6
  285. OutTradeNo *string `json:"out_trade_no"`
  286. // 直连商户的商户号或服务商的商户号,由微信支付生成并下发。
  287. Mchid *string `json:"mchid"`
  288. // 子商户的商户号,由微信支付生成并下发。
  289. SubMchid *string `json:"sub_mchid,omitempty"`
  290. // 一块捐用户所在门店的商家编号。
  291. StoreId *string `json:"store_id"`
  292. }
  293. func (o MerchantOrder) MarshalJSON() ([]byte, error) {
  294. toSerialize := map[string]interface{}{}
  295. if o.OutTradeNo == nil {
  296. return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in MerchantOrder")
  297. }
  298. toSerialize["out_trade_no"] = o.OutTradeNo
  299. if o.Mchid == nil {
  300. return nil, fmt.Errorf("field `Mchid` is required and must be specified in MerchantOrder")
  301. }
  302. toSerialize["mchid"] = o.Mchid
  303. if o.SubMchid != nil {
  304. toSerialize["sub_mchid"] = o.SubMchid
  305. }
  306. if o.StoreId == nil {
  307. return nil, fmt.Errorf("field `StoreId` is required and must be specified in MerchantOrder")
  308. }
  309. toSerialize["store_id"] = o.StoreId
  310. return json.Marshal(toSerialize)
  311. }
  312. func (o MerchantOrder) String() string {
  313. var ret string
  314. if o.OutTradeNo == nil {
  315. ret += "OutTradeNo:<nil>, "
  316. } else {
  317. ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
  318. }
  319. if o.Mchid == nil {
  320. ret += "Mchid:<nil>, "
  321. } else {
  322. ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
  323. }
  324. if o.SubMchid == nil {
  325. ret += "SubMchid:<nil>, "
  326. } else {
  327. ret += fmt.Sprintf("SubMchid:%v, ", *o.SubMchid)
  328. }
  329. if o.StoreId == nil {
  330. ret += "StoreId:<nil>"
  331. } else {
  332. ret += fmt.Sprintf("StoreId:%v", *o.StoreId)
  333. }
  334. return fmt.Sprintf("MerchantOrder{%s}", ret)
  335. }
  336. func (o MerchantOrder) Clone() *MerchantOrder {
  337. ret := MerchantOrder{}
  338. if o.OutTradeNo != nil {
  339. ret.OutTradeNo = new(string)
  340. *ret.OutTradeNo = *o.OutTradeNo
  341. }
  342. if o.Mchid != nil {
  343. ret.Mchid = new(string)
  344. *ret.Mchid = *o.Mchid
  345. }
  346. if o.SubMchid != nil {
  347. ret.SubMchid = new(string)
  348. *ret.SubMchid = *o.SubMchid
  349. }
  350. if o.StoreId != nil {
  351. ret.StoreId = new(string)
  352. *ret.StoreId = *o.StoreId
  353. }
  354. return &ret
  355. }
  356. // OrdersEntity
  357. type OrdersEntity struct {
  358. // 捐赠订单号
  359. WelfareTradeId *string `json:"welfare_trade_id"`
  360. // 直连商户或服务商申请的公众号或移动应用AppID
  361. Appid *string `json:"appid"`
  362. // 子商户申请的公众号或移动应用AppID
  363. SubAppid *string `json:"sub_appid,omitempty"`
  364. // 品牌的品牌ID,商家进驻微信支付品牌商家后获得的品牌ID
  365. BrandId *int64 `json:"brand_id"`
  366. // 捐赠来源 枚举值 MINIPROGRAM_PAY:一起捐小程序 ENTRUST_PAY:一块捐插件
  367. DonateSource *string `json:"donate_source"`
  368. // 商户订单,仅在一块捐来源回调中出现
  369. MerchantOrder *MerchantOrder `json:"merchant_order,omitempty"`
  370. // 捐赠公益机构名称。
  371. InstitutionName *string `json:"institution_name"`
  372. // 本次捐赠项目编号。
  373. BusinessId *string `json:"business_id"`
  374. // 本次捐赠活动名称。
  375. BusinessName *string `json:"business_name"`
  376. // 支付完成时间,遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
  377. SuccessTime *string `json:"success_time"`
  378. // 支付者信息
  379. Payer *Payer `json:"payer"`
  380. // 订单金额信息
  381. Amount *Amount `json:"amount"`
  382. // 设备编号,通过物料码进入爱心餐一起捐小程序捐赠时携带的设备编号参数
  383. DeviceId *string `json:"device_id,omitempty"`
  384. }
  385. func (o OrdersEntity) MarshalJSON() ([]byte, error) {
  386. toSerialize := map[string]interface{}{}
  387. if o.WelfareTradeId == nil {
  388. return nil, fmt.Errorf("field `WelfareTradeId` is required and must be specified in OrdersEntity")
  389. }
  390. toSerialize["welfare_trade_id"] = o.WelfareTradeId
  391. if o.Appid == nil {
  392. return nil, fmt.Errorf("field `Appid` is required and must be specified in OrdersEntity")
  393. }
  394. toSerialize["appid"] = o.Appid
  395. if o.SubAppid != nil {
  396. toSerialize["sub_appid"] = o.SubAppid
  397. }
  398. if o.BrandId == nil {
  399. return nil, fmt.Errorf("field `BrandId` is required and must be specified in OrdersEntity")
  400. }
  401. toSerialize["brand_id"] = o.BrandId
  402. if o.DonateSource == nil {
  403. return nil, fmt.Errorf("field `DonateSource` is required and must be specified in OrdersEntity")
  404. }
  405. toSerialize["donate_source"] = o.DonateSource
  406. if o.MerchantOrder != nil {
  407. toSerialize["merchant_order"] = o.MerchantOrder
  408. }
  409. if o.InstitutionName == nil {
  410. return nil, fmt.Errorf("field `InstitutionName` is required and must be specified in OrdersEntity")
  411. }
  412. toSerialize["institution_name"] = o.InstitutionName
  413. if o.BusinessId == nil {
  414. return nil, fmt.Errorf("field `BusinessId` is required and must be specified in OrdersEntity")
  415. }
  416. toSerialize["business_id"] = o.BusinessId
  417. if o.BusinessName == nil {
  418. return nil, fmt.Errorf("field `BusinessName` is required and must be specified in OrdersEntity")
  419. }
  420. toSerialize["business_name"] = o.BusinessName
  421. if o.SuccessTime == nil {
  422. return nil, fmt.Errorf("field `SuccessTime` is required and must be specified in OrdersEntity")
  423. }
  424. toSerialize["success_time"] = o.SuccessTime
  425. if o.Payer == nil {
  426. return nil, fmt.Errorf("field `Payer` is required and must be specified in OrdersEntity")
  427. }
  428. toSerialize["payer"] = o.Payer
  429. if o.Amount == nil {
  430. return nil, fmt.Errorf("field `Amount` is required and must be specified in OrdersEntity")
  431. }
  432. toSerialize["amount"] = o.Amount
  433. if o.DeviceId != nil {
  434. toSerialize["device_id"] = o.DeviceId
  435. }
  436. return json.Marshal(toSerialize)
  437. }
  438. func (o OrdersEntity) String() string {
  439. var ret string
  440. if o.WelfareTradeId == nil {
  441. ret += "WelfareTradeId:<nil>, "
  442. } else {
  443. ret += fmt.Sprintf("WelfareTradeId:%v, ", *o.WelfareTradeId)
  444. }
  445. if o.Appid == nil {
  446. ret += "Appid:<nil>, "
  447. } else {
  448. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  449. }
  450. if o.SubAppid == nil {
  451. ret += "SubAppid:<nil>, "
  452. } else {
  453. ret += fmt.Sprintf("SubAppid:%v, ", *o.SubAppid)
  454. }
  455. if o.BrandId == nil {
  456. ret += "BrandId:<nil>, "
  457. } else {
  458. ret += fmt.Sprintf("BrandId:%v, ", *o.BrandId)
  459. }
  460. if o.DonateSource == nil {
  461. ret += "DonateSource:<nil>, "
  462. } else {
  463. ret += fmt.Sprintf("DonateSource:%v, ", *o.DonateSource)
  464. }
  465. ret += fmt.Sprintf("MerchantOrder:%v, ", o.MerchantOrder)
  466. if o.InstitutionName == nil {
  467. ret += "InstitutionName:<nil>, "
  468. } else {
  469. ret += fmt.Sprintf("InstitutionName:%v, ", *o.InstitutionName)
  470. }
  471. if o.BusinessId == nil {
  472. ret += "BusinessId:<nil>, "
  473. } else {
  474. ret += fmt.Sprintf("BusinessId:%v, ", *o.BusinessId)
  475. }
  476. if o.BusinessName == nil {
  477. ret += "BusinessName:<nil>, "
  478. } else {
  479. ret += fmt.Sprintf("BusinessName:%v, ", *o.BusinessName)
  480. }
  481. if o.SuccessTime == nil {
  482. ret += "SuccessTime:<nil>, "
  483. } else {
  484. ret += fmt.Sprintf("SuccessTime:%v, ", *o.SuccessTime)
  485. }
  486. ret += fmt.Sprintf("Payer:%v, ", o.Payer)
  487. ret += fmt.Sprintf("Amount:%v, ", o.Amount)
  488. if o.DeviceId == nil {
  489. ret += "DeviceId:<nil>"
  490. } else {
  491. ret += fmt.Sprintf("DeviceId:%v", *o.DeviceId)
  492. }
  493. return fmt.Sprintf("OrdersEntity{%s}", ret)
  494. }
  495. func (o OrdersEntity) Clone() *OrdersEntity {
  496. ret := OrdersEntity{}
  497. if o.WelfareTradeId != nil {
  498. ret.WelfareTradeId = new(string)
  499. *ret.WelfareTradeId = *o.WelfareTradeId
  500. }
  501. if o.Appid != nil {
  502. ret.Appid = new(string)
  503. *ret.Appid = *o.Appid
  504. }
  505. if o.SubAppid != nil {
  506. ret.SubAppid = new(string)
  507. *ret.SubAppid = *o.SubAppid
  508. }
  509. if o.BrandId != nil {
  510. ret.BrandId = new(int64)
  511. *ret.BrandId = *o.BrandId
  512. }
  513. if o.DonateSource != nil {
  514. ret.DonateSource = new(string)
  515. *ret.DonateSource = *o.DonateSource
  516. }
  517. if o.MerchantOrder != nil {
  518. ret.MerchantOrder = o.MerchantOrder.Clone()
  519. }
  520. if o.InstitutionName != nil {
  521. ret.InstitutionName = new(string)
  522. *ret.InstitutionName = *o.InstitutionName
  523. }
  524. if o.BusinessId != nil {
  525. ret.BusinessId = new(string)
  526. *ret.BusinessId = *o.BusinessId
  527. }
  528. if o.BusinessName != nil {
  529. ret.BusinessName = new(string)
  530. *ret.BusinessName = *o.BusinessName
  531. }
  532. if o.SuccessTime != nil {
  533. ret.SuccessTime = new(string)
  534. *ret.SuccessTime = *o.SuccessTime
  535. }
  536. if o.Payer != nil {
  537. ret.Payer = o.Payer.Clone()
  538. }
  539. if o.Amount != nil {
  540. ret.Amount = o.Amount.Clone()
  541. }
  542. if o.DeviceId != nil {
  543. ret.DeviceId = new(string)
  544. *ret.DeviceId = *o.DeviceId
  545. }
  546. return &ret
  547. }
  548. // OrdersListByUserResponse
  549. type OrdersListByUserResponse struct {
  550. // 捐赠单详情
  551. Data []OrdersEntity `json:"data"`
  552. // 该次请求返回的记录条数
  553. Count *int64 `json:"count"`
  554. // 返回的最大记录条数,默认值为10
  555. Limit *int64 `json:"limit"`
  556. // 查询起始位置。
  557. Offset *int64 `json:"offset"`
  558. // 全部记录数量
  559. TotalCount *int64 `json:"total_count"`
  560. }
  561. func (o OrdersListByUserResponse) MarshalJSON() ([]byte, error) {
  562. toSerialize := map[string]interface{}{}
  563. if o.Data == nil {
  564. return nil, fmt.Errorf("field `Data` is required and must be specified in OrdersListByUserResponse")
  565. }
  566. toSerialize["data"] = o.Data
  567. if o.Count == nil {
  568. return nil, fmt.Errorf("field `Count` is required and must be specified in OrdersListByUserResponse")
  569. }
  570. toSerialize["count"] = o.Count
  571. if o.Limit == nil {
  572. return nil, fmt.Errorf("field `Limit` is required and must be specified in OrdersListByUserResponse")
  573. }
  574. toSerialize["limit"] = o.Limit
  575. if o.Offset == nil {
  576. return nil, fmt.Errorf("field `Offset` is required and must be specified in OrdersListByUserResponse")
  577. }
  578. toSerialize["offset"] = o.Offset
  579. if o.TotalCount == nil {
  580. return nil, fmt.Errorf("field `TotalCount` is required and must be specified in OrdersListByUserResponse")
  581. }
  582. toSerialize["total_count"] = o.TotalCount
  583. return json.Marshal(toSerialize)
  584. }
  585. func (o OrdersListByUserResponse) String() string {
  586. var ret string
  587. ret += fmt.Sprintf("Data:%v, ", o.Data)
  588. if o.Count == nil {
  589. ret += "Count:<nil>, "
  590. } else {
  591. ret += fmt.Sprintf("Count:%v, ", *o.Count)
  592. }
  593. if o.Limit == nil {
  594. ret += "Limit:<nil>, "
  595. } else {
  596. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  597. }
  598. if o.Offset == nil {
  599. ret += "Offset:<nil>, "
  600. } else {
  601. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  602. }
  603. if o.TotalCount == nil {
  604. ret += "TotalCount:<nil>"
  605. } else {
  606. ret += fmt.Sprintf("TotalCount:%v", *o.TotalCount)
  607. }
  608. return fmt.Sprintf("OrdersListByUserResponse{%s}", ret)
  609. }
  610. func (o OrdersListByUserResponse) Clone() *OrdersListByUserResponse {
  611. ret := OrdersListByUserResponse{}
  612. if o.Data != nil {
  613. ret.Data = make([]OrdersEntity, len(o.Data))
  614. for i, item := range o.Data {
  615. ret.Data[i] = *item.Clone()
  616. }
  617. }
  618. if o.Count != nil {
  619. ret.Count = new(int64)
  620. *ret.Count = *o.Count
  621. }
  622. if o.Limit != nil {
  623. ret.Limit = new(int64)
  624. *ret.Limit = *o.Limit
  625. }
  626. if o.Offset != nil {
  627. ret.Offset = new(int64)
  628. *ret.Offset = *o.Offset
  629. }
  630. if o.TotalCount != nil {
  631. ret.TotalCount = new(int64)
  632. *ret.TotalCount = *o.TotalCount
  633. }
  634. return &ret
  635. }
  636. // Payer
  637. type Payer struct {
  638. // 用户在AppID下的唯一标识。在【一块捐】场景下按照商家下单时AppID生成;在【一起捐】场景下按照商户登记AppID生成。
  639. Openid *string `json:"openid"`
  640. // 用户在子AppID下的唯一标识。在【一块捐】场景下按照商家下单时子AppID生成;在【一起捐】场景下按照商户登记子AppID生成。
  641. SubOpenid *string `json:"sub_openid,omitempty"`
  642. // 用户在爱心餐小程序授权头像的URL
  643. Avatar *string `json:"avatar,omitempty"`
  644. // 用户在爱心餐小程序授权昵称
  645. Nickname *string `json:"nickname,omitempty"`
  646. }
  647. func (o Payer) MarshalJSON() ([]byte, error) {
  648. toSerialize := map[string]interface{}{}
  649. if o.Openid == nil {
  650. return nil, fmt.Errorf("field `Openid` is required and must be specified in Payer")
  651. }
  652. toSerialize["openid"] = o.Openid
  653. if o.SubOpenid != nil {
  654. toSerialize["sub_openid"] = o.SubOpenid
  655. }
  656. if o.Avatar != nil {
  657. toSerialize["avatar"] = o.Avatar
  658. }
  659. if o.Nickname != nil {
  660. toSerialize["nickname"] = o.Nickname
  661. }
  662. return json.Marshal(toSerialize)
  663. }
  664. func (o Payer) String() string {
  665. var ret string
  666. if o.Openid == nil {
  667. ret += "Openid:<nil>, "
  668. } else {
  669. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  670. }
  671. if o.SubOpenid == nil {
  672. ret += "SubOpenid:<nil>, "
  673. } else {
  674. ret += fmt.Sprintf("SubOpenid:%v, ", *o.SubOpenid)
  675. }
  676. if o.Avatar == nil {
  677. ret += "Avatar:<nil>, "
  678. } else {
  679. ret += fmt.Sprintf("Avatar:%v, ", *o.Avatar)
  680. }
  681. if o.Nickname == nil {
  682. ret += "Nickname:<nil>"
  683. } else {
  684. ret += fmt.Sprintf("Nickname:%v", *o.Nickname)
  685. }
  686. return fmt.Sprintf("Payer{%s}", ret)
  687. }
  688. func (o Payer) Clone() *Payer {
  689. ret := Payer{}
  690. if o.Openid != nil {
  691. ret.Openid = new(string)
  692. *ret.Openid = *o.Openid
  693. }
  694. if o.SubOpenid != nil {
  695. ret.SubOpenid = new(string)
  696. *ret.SubOpenid = *o.SubOpenid
  697. }
  698. if o.Avatar != nil {
  699. ret.Avatar = new(string)
  700. *ret.Avatar = *o.Avatar
  701. }
  702. if o.Nickname != nil {
  703. ret.Nickname = new(string)
  704. *ret.Nickname = *o.Nickname
  705. }
  706. return &ret
  707. }