diff --git a/marketing-api/OCEANENGINE.md b/marketing-api/OCEANENGINE.md index e4c199d..1fc8e55 100644 --- a/marketing-api/OCEANENGINE.md +++ b/marketing-api/OCEANENGINE.md @@ -40,6 +40,11 @@ - 获取纵横组织下所有主体信息 [ businessplatform.CompanyInfoGet(clt *core.SDKClient, accessToken string, req *businessplatform.CompanyInfoGetRequest) (*businessplatform.CompanyInfoGetData, error) ] - 获取主体下的账户列表 [ businessplatform.CompanyAccountGet(clt *core.SDKClient, accessToken string, req *businessplatform.CompanyAccountGetRequest) (*businessplatform.CompanyAccountGetData, error) ] - 资金和流水管理 (api) + - 工作台转账-获取可转列表 [ customercenter.CanTransferTargetList(ctx context.Context, clt *core.SDKClient, accessToken string, req *customercenter.CanTransferTargetListRequest) (*customercenter.CanTransferTargetListResult, error) ] + - 工作台转账-获取最大可转余额 [ customercenter.CanTransferBalanceGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *customercenter.CanTransferBalanceGetRequest) ([]customercenter.CanTransferDetail, error) ] + - 工作台转账-查询账户转账余额 [ customercenter.TransferBalanceGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *customercenter.TransferBalanceGetRequest) ([]customercenter.TargetAmountDetail, error) ] + - 工作台转账-发起转账 [ customercenter.TransferCreate(ctx context.Context, clt *core.SDKClient, accessToken string, req *customercenter.TransferCreateRequest) (string, error) ] + - 工作台转账-查询转账单信息 [ customercenter.TransferDetailGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *customercenter.TransferDetailGetRequest) (*customercenter.TransferDetail, error) ] - 查询账号余额 [ advertiser.FundGet(clt *core.SDKClient, accessToken string, advertiserID uint64) (*advertiser.FundGetResult, error) ] - 批量查询账户余额 [ advertiser.AccountFundGet(clt *core.SDKClient, accessToken string, req *advertiser.AccountFundGetRequest) ([]advertiser.AccountFund, error) ] - 查询账号日流水 [ advertiser.FundDailyStat(clt *core.SDKClient, accessToken string, req *advertiser.FundDailyStatRequest) (*advertiser.FundDailyStatResponseData, error) ] diff --git a/marketing-api/api/customercenter/can_transfer_balance_get.go b/marketing-api/api/customercenter/can_transfer_balance_get.go new file mode 100644 index 0000000..1aa8498 --- /dev/null +++ b/marketing-api/api/customercenter/can_transfer_balance_get.go @@ -0,0 +1,18 @@ +package customercenter + +import ( + "context" + + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/customercenter" +) + +// CanTransferBalanceGet 工作台转账-获取最大可转余额 +// 查询转出方与转入方之间最大可转金额,接口内已自动扣除需要预留的竞价消耗保证金,支持查询1:N转账的最大可转金额 +func CanTransferBalanceGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *customercenter.CanTransferBalanceGetRequest) ([]customercenter.CanTransferDetail, error) { + var resp customercenter.CanTransferBalanceGetResponse + if err := clt.GetAPI(ctx, "v3.0/cg_transfer/can_transfer_balance/get/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data.CanTransferDetailList, nil +} diff --git a/marketing-api/api/customercenter/can_transfer_target_list.go b/marketing-api/api/customercenter/can_transfer_target_list.go new file mode 100644 index 0000000..99457a5 --- /dev/null +++ b/marketing-api/api/customercenter/can_transfer_target_list.go @@ -0,0 +1,18 @@ +package customercenter + +import ( + "context" + + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/customercenter" +) + +// CanTransferTargetList 工作台转账-获取可转列表 +// 查询当前账户(锚定账户)可以互相转账的账户列表 +func CanTransferTargetList(ctx context.Context, clt *core.SDKClient, accessToken string, req *customercenter.CanTransferTargetListRequest) (*customercenter.CanTransferTargetListResult, error) { + var resp customercenter.CanTransferTargetListResponse + if err := clt.GetAPI(ctx, "v3.0/cg_transfer/can_transfer_target/list/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data, nil +} diff --git a/marketing-api/api/customercenter/transfer_balance_get.go b/marketing-api/api/customercenter/transfer_balance_get.go new file mode 100644 index 0000000..5307acf --- /dev/null +++ b/marketing-api/api/customercenter/transfer_balance_get.go @@ -0,0 +1,18 @@ +package customercenter + +import ( + "context" + + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/customercenter" +) + +// TransferBalanceGet 工作台转账-查询账户转账余额 +// 查询账户自身转账余额、作为转出方需要预留的竞价消耗保证金 +func TransferBalanceGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *customercenter.TransferBalanceGetRequest) ([]customercenter.TargetAmountDetail, error) { + var resp customercenter.TransferBalanceGetResponse + if err := clt.GetAPI(ctx, "v3.0/cg_transfer/transfer_balance/get/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data.TargetAmountDetailList, nil +} diff --git a/marketing-api/api/customercenter/transfer_create.go b/marketing-api/api/customercenter/transfer_create.go new file mode 100644 index 0000000..9ce188b --- /dev/null +++ b/marketing-api/api/customercenter/transfer_create.go @@ -0,0 +1,18 @@ +package customercenter + +import ( + "context" + + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/customercenter" +) + +// TransferCreate 工作台转账-发起转账 +// 发起转账,支持1:N转账、不停投转账 +func TransferCreate(ctx context.Context, clt *core.SDKClient, accessToken string, req *customercenter.TransferCreateRequest) (string, error) { + var resp customercenter.TransferCreateResponse + if err := clt.PostAPI(ctx, "v3.0/cg_transfer/transfer/create/", req, &resp, accessToken); err != nil { + return "", err + } + return resp.Data.TransferSerial, nil +} diff --git a/marketing-api/api/customercenter/transfer_detail_get.go b/marketing-api/api/customercenter/transfer_detail_get.go new file mode 100644 index 0000000..90dec85 --- /dev/null +++ b/marketing-api/api/customercenter/transfer_detail_get.go @@ -0,0 +1,18 @@ +package customercenter + +import ( + "context" + + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/customercenter" +) + +// TransferDetailGet 工作台转账-查询转账单信息 +// 转账单信息,包括状态、双方账户、转账金额 +func TransferDetailGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *customercenter.TransferDetailGetRequest) (*customercenter.TransferDetail, error) { + var resp customercenter.TransferDetailGetResponse + if err := clt.GetAPI(ctx, "v3.0/cg_transfer/transfer_detail/get/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data, nil +} diff --git a/marketing-api/enum/capital_type.go b/marketing-api/enum/capital_type.go index 54098f3..7c81f95 100644 --- a/marketing-api/enum/capital_type.go +++ b/marketing-api/enum/capital_type.go @@ -10,6 +10,14 @@ const ( CapitalType_CREDIT_BRAND CapitalType = "CREDIT_BRAND" // CaptialType_CREDIT_GENERAL 授信通用 CaptialType_CREDIT_GENERAL CapitalType = "CREDIT_GENERAL" + // CapitalType_GRANT_COMMON 信息流赠款 + CapitalType_GRANT_COMMON CapitalType = "GRANT_COMMON" + // CapitalType_GRANT_DEFAULT 通用赠款 + CapitalType_GRANT_DEFAULT CapitalType = "GRANT_DEFAULT" + // CapitalType_GRANT_SEARCH 搜索赠款 + CapitalType_GRANT_SEARCH CapitalType = "GRANT_SEARCH" + // CapitalType_GRANT_UNION 穿山甲赠款 + CapitalType_GRANT_UNION CapitalType = "GRANT_UNION" // CaptialType_PREPAY_BIDDING 预付竞价 CaptialType_PREPAY_BIDDING CapitalType = "PREPAY_BIDDING" // CaptialType_PREPAY_BRAND 预付品牌 diff --git a/marketing-api/model/customercenter/can_transfer_balance_get.go b/marketing-api/model/customercenter/can_transfer_balance_get.go new file mode 100644 index 0000000..b6ac8b1 --- /dev/null +++ b/marketing-api/model/customercenter/can_transfer_balance_get.go @@ -0,0 +1,88 @@ +package customercenter + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/enum" + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// CanTransferBalanceGetRequest 工作台转账-获取最大可转余额 API Request +type CanTransferBalanceGetRequest struct { + // OrganizationID 组织id + OrganizationID uint64 `json:"organization_id,omitempty"` + // BizRequestNo 请求id,推荐uuid,方便请求链路对齐 + BizRequestNo string `json:"biz_request_no,omitempty"` + // OpponentTargetID 锚定账户id,查询该账户的可转账账户列表 + OpponentTargetID uint64 `json:"opponent_target_id,omitempty"` + // TargetIDs 目标账户id列表,1:N的N,最多支持100个 + TargetIDs []uint64 `json:"target_ids,omitempty"` + // TransferDirection 转账方向,以可转列表视角确定 可选值: + // TRANSFER_IN 转入 + // TRANSFER_OUT 转出 + TransferDirection enum.TransferDirection `json:"transfer_direction,omitempty"` + // Platform 业务线 可选值: + // AD 广告 + // BENDITUI 本地推 + Platform string `json:"platform,omitempty"` +} + +// Encode implements GetRequest interface +func (r CanTransferBalanceGetRequest) Encode() string { + values := util.GetUrlValues() + values.Set("organization_id", strconv.FormatUint(r.OrganizationID, 10)) + values.Set("biz_request_no", r.BizRequestNo) + values.Set("opponent_target_id", strconv.FormatUint(r.OpponentTargetID, 10)) + values.Set("target_ids", string(util.JSONMarshal(r.TargetIDs))) + values.Set("transfer_direction", string(r.TransferDirection)) + values.Set("platform", r.Platform) + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// CanTransferBalanceGetResponse 工作台转账-获取最大可转余额 API Response +type CanTransferBalanceGetResponse struct { + model.BaseResponse + Data struct { + // CanTransferDetailList 可转余额信息列表 + CanTransferDetailList []CanTransferDetail `json:"can_transfer_detail_list,omitempty"` + } `json:"data,omitempty"` +} + +// CanTransferDetail 可转余额信息 +type CanTransferDetail struct { + // RemitterTargetID 转出方账户id + RemitterTargetID uint64 `json:"remitter_target_id,omitempty"` + // PayeeTransferAmountDetailList 转入方可转余额信息列表 + PayeeTransferAmountDetailList []PayeeTransferAmountDetail `json:"payee_transfer_amount_detail_list,omitempty"` + // CapitalDetailList 转出方可转资金列表 + CapitalDetailList []CapitalDetail `json:"capital_detail_list,omitempty"` +} + +// PayeeTransferAmountDetail 转入方可转余额信息 +type PayeeTransferAmountDetail struct { + // PayeeTargetID 转入方账户id + PayeeTargetID uint64 `json:"payee_target_id,omitempty"` + // CapitalDetailList 转入方可转资金列表 + CapitalDetailList []CapitalDetail `json:"capital_detail_list,omitempty"` +} + +// CapitalDetail 转入方可转资金 +type CapitalDetail struct { + // CapitalType 转入方可转资金类型 可选值: + // CREDIT_BIDDING 授信竞价 + // CREDIT_BRAND 授信品牌 + // CREDIT_GENERAL 授信通用 + // GRANT_COMMON 信息流赠款 + // GRANT_DEFAULT 通用赠款 + // GRANT_SEARCH 搜索赠款 + // GRANT_UNION 穿山甲赠款 + // PREPAY_BIDDING 预付竞价 + // PREPAY_BRAND 预付品牌 + // PREPAY_GENERAL 预付通用 + CapitalType enum.CapitalType `json:"capital_type,omitempty"` + // TransferBalance 转入方可转资金余额(单位:分) + TrainsferBalance int64 `json:"transfer_balance,omitempty"` +} diff --git a/marketing-api/model/customercenter/can_transfer_target_list.go b/marketing-api/model/customercenter/can_transfer_target_list.go new file mode 100644 index 0000000..759a9f0 --- /dev/null +++ b/marketing-api/model/customercenter/can_transfer_target_list.go @@ -0,0 +1,71 @@ +package customercenter + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/enum" + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// CanTransferTargetListRequest 工作台转账-获取可转列表 API Request +type CanTransferTargetListRequest struct { + // OrganizationID 组织id + OrganizationID uint64 `json:"organization_id,omitempty"` + // BizRequestNo 请求id,推荐uuid,方便请求链路对齐 + BizRequestNo string `json:"biz_request_no,omitempty"` + // OpponentTargetID 锚定账户id,查询该账户的可转账账户列表 + OpponentTargetID uint64 `json:"opponent_target_id,omitempty"` + // TransferDirection 转账方向,以可转列表视角确定 可选值: + // TRANSFER_IN 转入 + // TRANSFER_OUT 转出 + TransferDirection enum.TransferDirection `json:"transfer_direction,omitempty"` + // Platform 业务线 可选值: + // AD 广告 + // BENDITUI 本地推 + Platform string `json:"platform,omitempty"` + // Page 页码,从1开始 + Page int `json:"page,omitempty"` + // PageSize 每页最多100 + PageSize int `json:"page_size,omitempty"` +} + +// Encode implements GetRequest interface +func (r CanTransferTargetListRequest) Encode() string { + values := util.GetUrlValues() + values.Set("organization_id", strconv.FormatUint(r.OrganizationID, 10)) + values.Set("biz_request_no", r.BizRequestNo) + values.Set("opponent_target_id", strconv.FormatUint(r.OpponentTargetID, 10)) + values.Set("transfer_direction", string(r.TransferDirection)) + values.Set("platform", r.Platform) + if r.Page > 0 { + values.Set("page", strconv.Itoa(r.Page)) + } + if r.PageSize > 0 { + values.Set("page_size", strconv.Itoa(r.PageSize)) + } + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// CanTransferTargetListResponse 工作台转账-获取可转列表 API Response +type CanTransferTargetListResponse struct { + model.BaseResponse + Data *CanTransferTargetListResult `json:"data,omitempty"` +} + +type CanTransferTargetListResult struct { + // PageInfo 分页信息 + PageInfo *model.PageInfo `json:"page_info,omitempty"` + // CanTransferTargetList 可转账户列表 + CanTransferTargetList []TransferTarget `json:"can_transfer_target_list,omitempty"` +} + +// TransferTarget 可转账户 +type TransferTarget struct { + // TargetID 可转账户id + TargetID uint64 `json:"target_id,omitempty"` + // TransferCaptialDetailList 锚定账户与目标账户转账资金列表 + TransferCaptialDetailList []CapitalDetail `json:"transfer_captial_detail_list,omitempty"` +} diff --git a/marketing-api/model/customercenter/doc.go b/marketing-api/model/customercenter/doc.go index 76b5d8a..d8b2003 100644 --- a/marketing-api/model/customercenter/doc.go +++ b/marketing-api/model/customercenter/doc.go @@ -1,2 +1,2 @@ -// Package customercenter 管家账号相关API models +// Package customercenter 管家账号(工作台)相关API models package customercenter diff --git a/marketing-api/model/customercenter/transfer_balance_get.go b/marketing-api/model/customercenter/transfer_balance_get.go new file mode 100644 index 0000000..dd07177 --- /dev/null +++ b/marketing-api/model/customercenter/transfer_balance_get.go @@ -0,0 +1,55 @@ +package customercenter + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// TransferBalanceGetRequest 工作台转账-查询账户转账余额 API Request +type TransferBalanceGetRequest struct { + // OrganizationID 组织id + OrganizationID uint64 `json:"organization_id,omitempty"` + // BizRequestNo 请求id,推荐uuid,方便请求链路对齐 + BizRequestNo string `json:"biz_request_no,omitempty"` + // TargetIDList 查询账户id列表(限制长度100) + TargetIDList []uint64 `json:"target_id_list,omitempty"` + // Platform 业务线 可选值: + // AD 广告 + // BENDITUI 本地推 + Platform string `json:"platform,omitempty"` +} + +// Encode implements GetRequest interface +func (r TransferBalanceGetRequest) Encode() string { + values := util.GetUrlValues() + values.Set("organization_id", strconv.FormatUint(r.OrganizationID, 10)) + values.Set("biz_request_no", r.BizRequestNo) + values.Set("target_id_list", string(util.JSONMarshal(r.TargetIDList))) + values.Set("platform", r.Platform) + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// TransferBalanceGetResponse 工作台转账-查询账户转账余额 API Response +type TransferBalanceGetResponse struct { + model.BaseResponse + Data struct { + // TargetAmountDetailList 账户金额列表 + TargetAmountDetailList []TargetAmountDetail `json:"target_amount_detail_list,omitempty"` + } `json:"data,omitempty"` +} + +// TargetAmountDetail 账户金额 +type TargetAmountDetail struct { + // TargetID 账户id + TargetID uint64 `json:"target_id,omitempty"` + // CapitalDetailList 可转资金列表 + CapitalDetailList []CapitalDetail `json:"capital_detail_list,omitempty"` + // DepositAmount 竞价消耗保证金金额(单位:分) + DepositAmount int64 `json:"deposit_amount,omitempty"` + // TotalTransferAmount 总可转金额(单位:分) + TotalTransferAmount int64 `json:"total_transfer_amount,omitempty"` +} diff --git a/marketing-api/model/customercenter/transfer_create.go b/marketing-api/model/customercenter/transfer_create.go new file mode 100644 index 0000000..bfa1f05 --- /dev/null +++ b/marketing-api/model/customercenter/transfer_create.go @@ -0,0 +1,43 @@ +package customercenter + +import ( + "github.com/bububa/oceanengine/marketing-api/enum" + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// TransferCreateRequest 工作台转账-发起转账 API Request +type TransferCreateRequest struct { + // OrganizationID 组织id + OrganizationID uint64 `json:"organization_id,omitempty"` + // BizRequestNo 请求id,推荐uuid,方便请求链路对齐 + BizRequestNo string `json:"biz_request_no,omitempty"` + // OpponentTargetID 锚定账户id,1:N的1 + OpponentTargetID uint64 `json:"opponent_target_id,omitempty"` + // TargetDetailList 目标账户列表,1:N的N,需要列表内账户类型相同,最多支持100个 + TargetDetailList []TransferTarget `json:"target_detail_list,omitempty"` + // TransferDirection 转账方向,以目标账户视角确定 可选值: + // TRANSFER_IN 转入 + // TRANSFER_OUT 转出 + TransferDirection enum.TransferDirection `json:"transfer_direction,omitempty"` + // Remark 备注 + Remark string `json:"remark,omitempty"` + // Platform 转账业务线 可选值: + // AD 广告 + // BENDITUI 本地推 + Platform string `json:"platform,omitempty"` +} + +// Encode implements PostRequest interface +func (r TransferCreateRequest) Encode() []byte { + return util.JSONMarshal(r) +} + +// TransferCreateResponse 工作台转账-发起转账 +type TransferCreateResponse struct { + model.BaseResponse + Data struct { + // TransferSerial 转账单号 + TransferSerial string `json:"transfer_serial,omitempty"` + } `json:"data,omitempty"` +} diff --git a/marketing-api/model/customercenter/transfer_detail_get.go b/marketing-api/model/customercenter/transfer_detail_get.go new file mode 100644 index 0000000..492c439 --- /dev/null +++ b/marketing-api/model/customercenter/transfer_detail_get.go @@ -0,0 +1,115 @@ +package customercenter + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/enum" + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// TransferDetailGetRequest 工作台转账-查询转账单信息 API Request +type TransferDetailGetRequest struct { + // OrganizationID 组织id + OrganizationID uint64 `json:"organization_id,omitempty"` + // BizRequestNo 请求id,推荐uuid,方便请求链路对齐 + BizRequestNo string `json:"biz_request_no,omitempty"` + // TransferBizRequestNo 发起转账的幂等id + TransferBizRequestNo string `json:"transfer_biz_request_no,omitempty"` + // TransferSerial 转账单号,与transfer_biz_request_no两者传其一即可 + TransferSerial string `json:"transfer_serial,omitempty"` + // Platform 转账业务线 可选值: + // AD 广告 + // BENDITUI 本地推 + Platform string `json:"platform,omitempty"` +} + +// Encode implements GetRequest interface +func (r TransferDetailGetRequest) Encode() string { + values := util.GetUrlValues() + values.Set("organization_id", strconv.FormatUint(r.OrganizationID, 10)) + values.Set("biz_request_no", r.BizRequestNo) + values.Set("transfer_biz_request_no", r.TransferBizRequestNo) + values.Set("transfer_serial", r.TransferSerial) + values.Set("platform", r.Platform) + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// TransferDetailGetResponse 工作台转账-查询转账单信息 API Response +type TransferDetailGetResponse struct { + model.BaseResponse + Data *TransferDetail `json:"data,omitempty"` +} + +type TransferDetail struct { + // TransferSerial 转账单号 + TransferSerial string `json:"transfer_serial,omitempty"` + // BizRequestNo 幂等id + BizRequestNo string `json:"biz_request_no,omitempty"` + // TransferDirection 转账方向(以目标账户视角确定) 可选值: + // TRANSFER_IN 转入 + // TRANSFER_OUT 转出 + TransferDirection enum.TransferDirection `json:"transfer_direction,omitempty"` + // TransferAmount 转账总金额(单位:分) + TransferAmount int64 `json:"transfer_amount,omitempty"` + // TransferStatus 转账总状态 可选值: + // NO_TRANSFER 未转账 + // TRANSFER_FAILED 转账失败(终态) + // TRANSFER_ING 转账中 + // TRANSFER_PART 转账部分成功(终态) + // TRANSFER_SUCCESS 转账成功(终态) + TransferStatus enum.TransferStatus `json:"transfer_status,omitempty"` + // TransferFinishTime 转账完成时间(yyyy-MM-dd HH:mm:ss) + TransferFinishTime string `json:"transfer_transfer_time,omitempty"` + // TransferCreateTime 转账创建时间(yyyy-MM-dd HH:mm:ss) + TransferCreateTime string `json:"transfer_create_time,omitempty"` + // TransferTargetRecordList 账户信息列表 + TransferTargetRecordList []TransferTargetRecord `json:"transfer_target_record_list,omitempty"` +} + +// TransferTargetRecord 账户信息 +type TransferTargetRecord struct { + // OpponentTargetID 锚定账户id,1:N的1 + OpponetTargetID uint64 `json:"opponent_target_id,omitempty"` + // TargetID 目标账户id,1:N的N + TargetID uint64 `json:"target_id,omitempty"` + // TransferAmount 转账金额(单位:分) + TransferAmount int64 `json:"transfer_amount,omitempty"` + // TransferStatus 转账总状态 可选值: + // NO_TRANSFER 未转账 + // TRANSFER_FAILED 转账失败(终态) + // TRANSFER_ING 转账中 + // TRANSFER_PART 转账部分成功(终态) + // TRANSFER_SUCCESS 转账成功(终态) + TransferStatus enum.TransferStatus `json:"transfer_status,omitempty"` + // TransferCapitalRecordList 转账资金类型列表 + TransferCapitalRecordList []TransferCapitalRecord `json:"transfer_capital_record_list,omitempty"` +} + +// TransferCapitalRecord 转账资金类型 +type TransferCapitalRecord struct { + // CapitalType 转账资金类型 可选值: + // CREDIT_BIDDING 授信竞价 + // CREDIT_BRAND 授信品牌 + // CREDIT_GENERAL 授信通用 + // GRANT_COMMON 信息流赠款 + // GRANT_DEFAULT 通用赠款 + // GRANT_SEARCH 搜索赠款 + // GRANT_UNION 穿山甲赠款 + // PREPAY_BIDDING 预付竞价 + // PREPAY_BRAND 预付品牌 + // PREPAY_GENERAL 预付通用 + CapitalType enum.CapitalType `json:"capital_type,omitempty"` + // TransferAmount 转账资金金额(单位:分) + TransferAmount int64 `json:"transfer_amount,omitempty"` + // TansferStatus 转账资金状态 可选值: + // NO_TRANSFER 未转账 + // TRANSFER_FAILED 转账失败(终态) + // TRANSFER_ING 转账中 + // TRANSFER_SUCCESS 转账成功(终态) r + TransferStatus enum.TransferStatus `json:"transfer_status,omitempty"` + // FailReason 失败原因 + FailReason string `json:"fail_reason,omitempty"` +}