base

package
v1.0.35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AssetApiCreate           = "/xasset/horae/v1/create"
	AssetApiAlter            = "/xasset/horae/v1/alter"
	AssetApiPublish          = "/xasset/horae/v1/publish"
	AssetApiQueryAsset       = "/xasset/horae/v1/query"
	AssetApiGrant            = "/xasset/horae/v1/grant"
	AssetApiFreeze           = "/xasset/horae/v1/freeze"
	AssetApiConsume          = "/xasset/horae/v1/consume"
	AssetApiTransfer         = "/xasset/damocles/v1/transfer"
	AssetApiQueryShard       = "/xasset/horae/v1/querysds"
	AssetApiListShardsByAddr = "/xasset/horae/v1/listsdsbyaddr"
	AssetApiListAssetByAddr  = "/xasset/horae/v1/listastbyaddr"
	AssetListShardsByAsset   = "/xasset/horae/v1/listsdsbyast"
	AssetApiGetEvidenceInfo  = "/xasset/horae/v1/getevidenceinfo"
	AssetApiListDiffByAddr   = "/xasset/horae/v1/listdiffbyaddr"
	AssetApiSelectBoxAst     = "/xasset/horae/v1/selboxast"
	AssetApiGrantBox         = "/xasset/horae/v1/grantbox"
	AssetApiSelectMaterial   = "/xasset/horae/v1/selmaterial"
	AssetApiComposeShard     = "/xasset/horae/v1/compose"
	AssetApiUpgradeAst       = "/xasset/horae/v1/upgradeast"
	AssetApiUpgradeSds       = "/xasset/horae/v1/upgradesds"
	AssetApiLockShard        = "/xasset/horae/v1/locksds"
	AssetApiFreezeShard      = "/xasset/horae/v1/freezesds"
	AssetApiUnfreezeShard    = "/xasset/horae/v1/unfreezesds"

	FileApiGetStoken = "/xasset/file/v1/getstoken"
	ListAssetHistory = "/xasset/horae/v1/history"

	SceneListShardByAddr = "/xasset/scene/v1/listsdsbyaddr"
	SceneQueryShard      = "/xasset/scene/v1/qrysdsinfo"
	SceneListDiffByAddr  = "/xasset/scene/v1/listdiffbyaddr"
	SceneListAddr        = "/xasset/scene/v1/listaddr"
	SceneHasAstByAddr    = "/xasset/scene/v1/hasastbyaddr"

	DidApiRegister     = "/xasset/did/v1/bdboxregister"
	DidApiBind         = "/xasset/did/v1/bdboxbind"
	DidApiBindByUid    = "/xasset/did/v1/bindbyunionid"
	DidApiGetAddrByUid = "/xasset/did/v1/getaddrbyunionid"

	VilgApiText2Img = "/xasset/vilg/v1/text2img"
	VilgApiGetImg   = "/xasset/vilg/v1/getimg"
	VilgApiBalance  = "/xasset/vilg/v1/balance"
)
View Source
const (
	ViLGTaskStatusInit   = 0
	ViLGTaskStatusDone   = 1
	ViLGTaskStatusFailed = 9
)
View Source
const (

	// 1.艺术品
	AssetCateArt AssetType
	// 2.收藏品
	AssetCateCollect
	// 3.门票
	AssetCateTicket
	// 4.酒店
	AssetCateHotel
	// 22.盲盒
	AssetCateBlindBox = 22
	// 23.合成
	AssetCateCompose = 23
	// 24.大礼包
	AssetCateGiftPack = 24
)
View Source
const (
	// 微信支付
	PayByWechat = 1
	// 阿里支付
	PayByAli = 2
	// 特殊支付
	PayBySpecial = 9
)

支付渠道类型

View Source
const (
	// 需要修改为正确的配置
	TestAppId    = 0
	TestAK       = "xxx"
	TestSK       = "xxx"
	TestEndpoint = "http://120.48.16.137:8360"
	OpenId       = "xxx"
	AppKey       = "xxx"
	UnionId      = "xxx"
)
View Source
const (
	StoreApiCreate           = "/xasset/store/v1/create"
	StoreApiAlter            = "/xasset/store/v1/alter"
	StoreApiQuery            = "/xasset/store/v1/query"
	StoreApiList             = "/xasset/store/v1/liststorebyapp"
	StoreApiCreateAct        = "/xasset/store/v1/createact"
	StoreApiAlterAct         = "/xasset/store/v1/alteract"
	StoreApiRemoveAct        = "/xasset/store/v1/removeact"
	StoreApiQueryAct         = "/xasset/store/v1/queryact"
	StoreApiListAct          = "/xasset/store/v1/listact"
	StoreApiPubAct           = "/xasset/store/v1/pubact"
	StoreApiBindAst          = "/xasset/store/v1/bindast"
	StoreApiAlterAst         = "/xasset/store/v1/alterast"
	StoreApiCancelAst        = "/xasset/store/v1/cancelast"
	StoreApiCancelAstByActId = "/xasset/store/v1/cancelastbyact"
	StoreApiQueryAst         = "/xasset/store/v1/queryast"
	StoreApiListAst          = "/xasset/store/v1/listast"

	HubCreateOrder   = "/xasset/trade/v1/create_order"
	HubConfirmOrder  = "/xasset/trade/v1/confirm_order"
	HubDetailOrder   = "/xasset/trade/v1/order_detail"
	HubEditOrder     = "/xasset/trade/v1/edit_order"
	HubListOrder     = "/xasset/trade/v1/order_list"
	HubListOrderPage = "/xasset/trade/v1/order_page"
	CountOrder       = "/xasset/trade/v1/count_order"
	SumOrderPrice    = "/xasset/trade/v1/sum_order_price"

	CheckRefund     = "/xasset/trade/v1/checkrefund"
	CreateRefund    = "/xasset/trade/v1/refund"
	CancelRefund    = "/xasset/trade/v1/cancelrefund"
	ConfirmRefund   = "/xasset/trade/v1/confirmrefund"
	RefuseRefund    = "/xasset/trade/v1/refuserefund"
	QueryRefund     = "/xasset/trade/v1/qryrefund"
	QueryRefundPage = "/xasset/trade/v1/listrefundbystore"
	SumRefundPrice  = "/xasset/trade/v1/sum_refund_price"
)
View Source
const (
	// ---------- Code Enum -----------
	CodeBaiduSmartApp = 1001 // 百度收银台安卓端
	CodeBaiduIOS      = 1002 // 百度收银台IOS端
	CodeBaiduH5       = 1003 // 百度收银台H5
	CodeBillingH5     = 1004 // 百度billing H5支付
)

//////////// Trade Orders API /////////////

View Source
const (
	// 最大范围
	MaxLimit = 50
)

列表分页范围限制

View Source
const (
	XassetErrNoSucc = 0
)

服务端相应错误码

Variables

View Source
var (
	ComErrParamInvalid        = errors.New("param invalid")
	ComErrAccountSignFailed   = errors.New("account sign failed")
	ComErrJsonMarFailed       = errors.New("json marhsal failed")
	ComErrRequsetFailed       = errors.New("send request failed")
	ComErrRespCodeErr         = errors.New("request resp code error")
	ComErrUnmarshalBodyFailed = errors.New("json unmarhsal body failed")
	ComErrServRespErrnoErr    = errors.New("server resp errno error")
	ComErrGenRequestFailed    = errors.New("generate http request failed")
	ComErrXassetSignFailed    = errors.New("xasser access sign failed")
	ComErrConfigErr           = errors.New("client config error")
)

常用错误

View Source
var (
	ErrParamInvalid      = errors.New("param invalid")
	ErrAssetInvalid      = errors.New("asset invalid, must be a positive integer")
	ErrAddressInvalid    = errors.New("address invalid, empty string")
	ErrUserIdInvalid     = errors.New("user id invalid, must be a positive integer")
	ErrAmountInvalid     = errors.New("amount invalid, must be a positive integer or a zero value")
	ErrPriceInvalid      = errors.New("price invalid, must be a positive integer or a zero value")
	ErrNilPointer        = errors.New("target paramater valid, nil pointer")
	ErrDescInvalid       = errors.New("target paramater invalid, empty string")
	ErrAssetTypeInvalid  = errors.New("type invalid, must between 1 to 4")
	ErrAlterInfo         = errors.New("alter info invalid")
	ErrAlterAssetInvalid = errors.New("param for altering invalid, must contain amount or valid asset info")
	ErrShardInvalid      = errors.New("shard invalid, must be a positive integer")
	ErrImgInvalid        = errors.New("imgs invalid")
	ErrEvidenceInvalid   = errors.New("evidence type invalid, must between 0 to 1")
	ErrBytesInvalid      = errors.New("bytes invalid, nil pointer")
	ErrStatusInvalid     = errors.New("status invalid")
	ErrAssetListInvalid  = errors.New("null asset list")
	ErrUnionIdInvalid    = errors.New("union id invalid")
	ErrOpenIdInvalid     = errors.New("open id invalid")
	ErrAppKeyInvalid     = errors.New("app key invalid")
	ErrMnemInvalid       = errors.New("mnemonic invalid")
	ErrNameInvalid       = errors.New("target parameter invalid, empty string")
)
View Source
var (
	BaiduCashierCode = map[int]interface{}{
		CodeBaiduSmartApp: struct{}{},
		CodeBaiduIOS:      struct{}{},
		CodeBaiduH5:       struct{}{},
		CodeBillingH5:     struct{}{},
	}
)

Functions

func AccountValid

func AccountValid(account *auth.Account) error

func AddrValid

func AddrValid(addr string) error

func AlterAssetInfoValid

func AlterAssetInfoValid(p *AlterAssetInfo) error

func AmountInvalid

func AmountInvalid(amount int) error

func AppKeyValid added in v1.0.12

func AppKeyValid(ak string) error

func AssetIdValid

func AssetIdValid(assetId int64) error

func AssetTypeValid

func AssetTypeValid(t AssetType) error

func ByteValid

func ByteValid(b []byte) error

func CreateAssetInfoValid

func CreateAssetInfoValid(p *CreateAssetInfo) error

func DescValid

func DescValid(desc string) error

func EvidenceValid

func EvidenceValid(evidence int) error

func FileValid

func FileValid(files []string) error

func HasAssetType

func HasAssetType(t AssetType) bool

func HasDesc

func HasDesc(desc string) bool

func HasId

func HasId(id int64) bool

func HasImg

func HasImg(imgs []string) bool

func IdValid

func IdValid(id int64) error

func ImgValid

func ImgValid(imgs []string) error

func MakeBlindBoxScript added in v1.0.27

func MakeBlindBoxScript(astList []*BoxAst) string

func MakeComposeScript added in v1.0.28

func MakeComposeScript(astList []*ComposeStrg) string

func MnemonicValid added in v1.0.12

func MnemonicValid(mnem string) error

func OpenIdValid added in v1.0.12

func OpenIdValid(oid string) error

func PriceInvalid added in v1.0.3

func PriceInvalid(price int64) error

func ShardIdValid

func ShardIdValid(id int64) error

func StatusValid added in v1.0.3

func StatusValid(status int) error

func TestGetXassetConfig

func TestGetXassetConfig() *config.XassetCliConfig

func UnionIdValid added in v1.0.12

func UnionIdValid(uid string) error

Types

type AccessInfo

type AccessInfo struct {
	Bucket       string `json:"bucket"`
	EndPoint     string `json:"endpoint"`
	ObjectPath   string `json:"object_path"`
	AK           string `json:"access_key_id"`
	SK           string `json:"secret_access_key"`
	SessionToken string `json:"session_token"`
	CreateTime   string `json:"createTime"`
	Expiration   string `json:"expiration"`
}

type AddrGroupToken added in v1.0.12

type AddrGroupToken struct {
	Addr    string `json:"addr"`
	GroupId int64  `json:"group_id"`
	Token   string `json:"token"`
}

////////// Scene listaddr /////////////////////

type AlterAssetInfo

type AlterAssetInfo struct {
	AssetCate  AssetType `json:"asset_cate,omitempty"`
	Title      string    `json:"title,omitempty"`
	Thumb      []string  `json:"thumb,omitempty"`
	ShortDesc  string    `json:"short_desc,omitempty"`
	ImgDesc    []string  `json:"img_desc,omitempty"`
	AssetUrl   []string  `json:"asset_url,omitempty"`
	LongDesc   string    `json:"long_desc,omitempty"`
	AssetExt   string    `json:"asset_ext,omitempty"`
	GroupId    int64     `json:"group_id,omitempty"`
	ProcScript string    `json:"proc_script,omitempty"`
}

/////// Alter Asset //////////

type AlterAssetParam

type AlterAssetParam struct {
	AssetId   int64           `json:"asset_id"`
	Price     int64           `json:"price,omitempty"`
	Amount    int             `json:"amount,omitempty"`
	FileHash  string          `json:"file_hash"`
	AssetInfo *AlterAssetInfo `json:"asset_info"`
	Account   *auth.Account   `json:"account"`
	ViewType  int             `json:"view_type"`
}

func (*AlterAssetParam) Valid

func (t *AlterAssetParam) Valid() error

AlterAssetParam be valid where has the amount or thr asset info to be altered.

type AssetShardPair added in v1.0.26

type AssetShardPair struct {
	AssetId int64 `json:"asset_id"`
	ShardId int64 `json:"shard_id"`
}

type AssetType

type AssetType int

资产类型

type BaseActParam added in v1.0.12

type BaseActParam struct {
	ActId  int64 `json:"act_id"`
	OpType int   `json:"op_type"`
	IsBox  int   `json:"is_box"`
}

func (*BaseActParam) Valid added in v1.0.12

func (t *BaseActParam) Valid() error

type BaseAstParam added in v1.0.12

type BaseAstParam struct {
	AssetId int64 `json:"asset_id"`
	ActId   int64 `json:"act_id"`
}

func (*BaseAstParam) Valid added in v1.0.12

func (t *BaseAstParam) Valid() error

type BaseResp

type BaseResp struct {
	RequestId string `json:"request_id"`
	Errno     int    `json:"errno"`
	Errmsg    string `json:"errmsg"`
}

type BaseStoreParam added in v1.0.12

type BaseStoreParam struct {
	StoreId int `json:"store_id"`
}

//////// Query Store //////////

func (*BaseStoreParam) Valid added in v1.0.12

func (t *BaseStoreParam) Valid() error

type BdBoxBindParam added in v1.0.12

type BdBoxBindParam struct {
	OpenId   string `json:"open_id"`
	AppKey   string `json:"app_key"`
	Mnemonic string `json:"mnemonic"`
}

/////////// Bdbox bind ////////////////////////

func (*BdBoxBindParam) Valid added in v1.0.12

func (t *BdBoxBindParam) Valid() error

type BdBoxRegisterParam added in v1.0.12

type BdBoxRegisterParam struct {
	OpenId string `json:"open_id"`
	AppKey string `json:"app_key"`
}

////////// Bdbox register ////////////////////

func (*BdBoxRegisterParam) Valid added in v1.0.12

func (t *BdBoxRegisterParam) Valid() error

type BdBoxRegisterResp added in v1.0.12

type BdBoxRegisterResp struct {
	BaseResp
	Address  string `json:"addr"`
	Mnemonic string `json:"mnemonic"`
	IsNew    int    `json:"is_new"`
}

type BindByUnionIdParam added in v1.0.12

type BindByUnionIdParam struct {
	UnionId  string `json:"union_id"`
	Mnemonic string `json:"mnemonic"`
}

/////////// Bind by union id /////////////////

func (*BindByUnionIdParam) Valid added in v1.0.12

func (t *BindByUnionIdParam) Valid() error

type BindOrAlterAstParam added in v1.0.12

type BindOrAlterAstParam struct {
	AssetId   int64  `json:"asset_id"`
	SplitId   int64  `json:"split_id"`
	Amount    int    `json:"amount"`
	ApplyForm int    `json:"apply_form"`
	AssetCate int    `json:"asset_cate"`
	Price     int64  `json:"price"`
	OriPrice  int64  `json:"ori_price"`
	ActId     int64  `json:"act_id"`
	Start     int64  `json:"start"`
	End       int64  `json:"end"`
	GrantMode int    `json:"grant_mode"`
	JumpLink  string `json:"jump_link"`
	ExtInfo   string `json:"ext_info"`
	IsBox     int    `json:"is_box"`
}

func (*BindOrAlterAstParam) AlterValid added in v1.0.12

func (t *BindOrAlterAstParam) AlterValid() error

func (*BindOrAlterAstParam) CreateValid added in v1.0.12

func (t *BindOrAlterAstParam) CreateValid() error

type BoxAst added in v1.0.27

type BoxAst struct {
	AssetId int64 `json:"asset_id"`
	Amount  int64 `json:"amount"`
}

type CancelRefundData added in v1.0.35

type CancelRefundData struct {
	Rid int64 `json:"rid"`
}

type CancelRefundParam added in v1.0.35

type CancelRefundParam struct {
	Rid     int64  `json:"oid"`
	Address string `json:"address"`
}

func (*CancelRefundParam) Valid added in v1.0.35

func (p *CancelRefundParam) Valid() error

type CancelRefundResp added in v1.0.35

type CancelRefundResp struct {
	BaseResp
	Data CancelRefundData `json:"data"`
}

type CheckRefundData added in v1.0.35

type CheckRefundData struct {
	Refundable   int `json:"refundable"`
	RefuseReason int `json:"refuse_reason"`
}

type CheckRefundParam added in v1.0.35

type CheckRefundParam struct {
	Oid int64 `json:"oid"`
}

func (*CheckRefundParam) Valid added in v1.0.35

func (p *CheckRefundParam) Valid() error

type CheckRefundResp added in v1.0.35

type CheckRefundResp struct {
	BaseResp
	Data CheckRefundData `json:"data"`
}

type ComposeParam added in v1.0.26

type ComposeParam struct {
	AssetId  int64
	StrgNo   int
	Nonce    int64
	Sign     string
	Token    string
	AstList  string
	Account  *auth.Account //composite asset creator
	UAccount *auth.Account //consume shard owner
}

func (*ComposeParam) Valid added in v1.0.26

func (t *ComposeParam) Valid() error

type ComposeResp added in v1.0.26

type ComposeResp struct {
	BaseResp
	AssetId int64 `json:"asset_id"`
	ShardId int64 `json:"shard_id"`
}

type ComposeStrg added in v1.0.28

type ComposeStrg struct {
	StrgNo int        `json:"strg_no"`
	Strg   []Material `json:"strg"`
}

type ConfirmRefundParam added in v1.0.35

type ConfirmRefundParam struct {
	Rid      int64  `json:"rid"`
	Message  string `json:"message"`
	Operator string `json:"operator"`
}

func (*ConfirmRefundParam) Valid added in v1.0.35

func (p *ConfirmRefundParam) Valid() error

type ConsumeNode added in v1.0.26

type ConsumeNode struct {
	AssetId int64  `json:"asset_id"`
	ShardId int64  `json:"shard_id"`
	Nonce   int64  `json:"nonce"`
	Sign    string `json:"sign"`
}

type ConsumeShardParam added in v1.0.4

type ConsumeShardParam struct {
	AssetId  int64         `json:"asset_id"`
	ShardId  int64         `json:"shard_id"`
	Nonce    int64         `json:"nonce"`
	UAddr    string        `json:"user_addr"`
	USign    string        `json:"user_sign"`
	UPKey    string        `json:"user_pkey"`
	CAccount *auth.Account `json:"create_account"`
}

//////// Consume Shard ////////////

func (*ConsumeShardParam) Valid added in v1.0.4

func (t *ConsumeShardParam) Valid() error

type CountOrderData added in v1.0.21

type CountOrderData struct {
	Total       int64 `json:"total"`
	BuyCountSum int64 `json:"buy_count_sum"`
}

type CountOrderParam added in v1.0.21

type CountOrderParam struct {
	AssetId int64 `json:"asset_id"`
	Status  int   `json:"status"`
}

func (*CountOrderParam) Valid added in v1.0.21

func (p *CountOrderParam) Valid() error

type CountOrderResp added in v1.0.21

type CountOrderResp struct {
	BaseResp
	Data CountOrderData `json:"data"`
}

type CreateAssetInfo

type CreateAssetInfo struct {
	AssetCate  AssetType `json:"asset_cate"`
	Title      string    `json:"title"`
	Thumb      []string  `json:"thumb"`
	ShortDesc  string    `json:"short_desc"`
	ImgDesc    []string  `json:"img_desc"`
	AssetUrl   []string  `json:"asset_url"`
	LongDesc   string    `json:"long_desc,omitempty"`
	AssetExt   string    `json:"asset_ext,omitempty"`
	GroupId    int64     `json:"group_id,omitempty"`
	ProcScript string    `json:"proc_script,omitempty"`
}

/////// Create Asset ///////////

type CreateAssetParam

type CreateAssetParam struct {
	AssetId    int64            `json:"asset_id"` // optional
	Price      int64            `json:"price,omitempty"`
	Amount     int              `json:"amount"`
	AssetInfo  *CreateAssetInfo `json:"asset_info"`
	Account    *auth.Account    `json:"account"`
	UserId     int64            `json:"user_id,omitempty"`
	FileHash   string           `json:"file_hash,omitempty"`
	ViewType   int              `json:"view_type"`
	AssetParam string           `json:"asset_param"`
}

func (*CreateAssetParam) Valid

func (t *CreateAssetParam) Valid() error

type CreateAssetResp

type CreateAssetResp struct {
	BaseResp
	AssetId int64 `json:"asset_id"`
}

type CreateOrAlterActParam added in v1.0.12

type CreateOrAlterActParam struct {
	StoreId   int    `json:"store_id"`
	ActId     int64  `json:"act_id"`
	JumpLink  string `json:"jump_link"`
	Issuer    string `json:"issuer"`
	ActName   string `json:"act_name"`
	ShortDesc string `json:"short_desc"`
	Thumb     string `json:"thumb"`
	ImgDesc   string `json:"img_desc"`
	Bookable  int    `json:"bookable"`
	Start     int64  `json:"start"`
	End       int64  `json:"end"`
	Weight    int    `json:"weight,omitempty"`
	ExtInfo   string `json:"ext_info,omitempty"`
}

///// Create Act /////////

func (*CreateOrAlterActParam) CreateValid added in v1.0.12

func (t *CreateOrAlterActParam) CreateValid() error

type CreateOrAlterStoreParam added in v1.0.12

type CreateOrAlterStoreParam struct {
	StoreId   int    `json:"store_id"`
	Name      string `json:"name"`
	Cover     string `json:"cover"`
	ShortDesc string `json:"short_desc"`
	Weight    int    `json:"weight,omitempty"`
	ExtInfo   string `json:"ext_info,omitempty"`
	Wechat    string `json:"wechat,omitempty"`
}

///// Create Store /////////

func (*CreateOrAlterStoreParam) CreateValid added in v1.0.12

func (t *CreateOrAlterStoreParam) CreateValid() error

type CreateRefundData added in v1.0.35

type CreateRefundData struct {
	Rid          int64 `json:"rid"`
	Refundable   int   `json:"refundable"`
	RefuseReason int   `json:"refuse_reason"`
}

type CreateRefundParam added in v1.0.35

type CreateRefundParam struct {
	Oid     int64  `json:"oid"`
	Address string `json:"address"`
	Reason  string `json:"reason"`
}

func (*CreateRefundParam) Valid added in v1.0.35

func (p *CreateRefundParam) Valid() error

type CreateRefundResp added in v1.0.35

type CreateRefundResp struct {
	BaseResp
	Data CreateRefundData `json:"data"`
}

type FreezeAssetParam added in v1.0.4

type FreezeAssetParam struct {
	AssetId int64         `json:"asset_id"`
	Account *auth.Account `json:"account"`
}

//////// Freeze Asset ////////////

func (*FreezeAssetParam) Valid added in v1.0.4

func (t *FreezeAssetParam) Valid() error

type GetAddrByUnionIdResp added in v1.0.12

type GetAddrByUnionIdResp struct {
	BaseResp
	Address string `json:"address"`
}

////////// Get addr by union id /////////////

type GetEvidenceInfoParam

type GetEvidenceInfoParam struct {
	AssetId int64 `json:"asset_id"`
}

/////////// Get Evidence Info /////////////

func (*GetEvidenceInfoParam) Valid

func (t *GetEvidenceInfoParam) Valid() error

type GetEvidenceInfoResp

type GetEvidenceInfoResp struct {
	BaseResp
	CreateAddr string            `json:"create_addr"`
	TxId       string            `json:"tx_id"`
	FileHash   string            `json:"file_hash"`
	GhCertId   string            `json:"gh_cert_id"`
	AssetInfo  *HoraeAssetObject `json:"asset_info"`
	Ctime      int64             `json:"ctime"`
}

type GetStokenParam

type GetStokenParam struct {
	Account *auth.Account `json:"account"`
}

///// Gen Token /////////

func (*GetStokenParam) Valid

func (t *GetStokenParam) Valid() error

type GetStokenResp

type GetStokenResp struct {
	BaseResp
	AccessInfo *AccessInfo `json:"accessInfo"`
}

type GrantAssetParam

type GrantAssetParam struct {
	AssetId    int64         `json:"asset_id"`
	ShardId    int64         `json:"shard_id"`
	Price      int64         `json:"price,omitempty"`
	Account    *auth.Account `json:"account"`
	Addr       string        `json:"addr"`
	ToAddr     string        `json:"to_addr"`
	ToUserId   int64         `json:"to_userid,omitempty"`
	ShardParam string        `json:"shard_param"`
}

//////// Grant Asset /////////////

func (*GrantAssetParam) Valid

func (p *GrantAssetParam) Valid() error

type GrantAssetResp

type GrantAssetResp struct {
	BaseResp
	AssetId int64 `json:"asset_id"`
	ShardId int64 `json:"shard_id"`
}

type GrantBoxParam added in v1.0.25

type GrantBoxParam struct {
	Token       string
	UAccount    *auth.Account
	CAccount    *auth.Account
	RealAssetId int64
	BoxAssetId  int64
	UserId      int64
}

func (*GrantBoxParam) Valid added in v1.0.25

func (t *GrantBoxParam) Valid() error

type GrantBoxResp added in v1.0.25

type GrantBoxResp struct {
	BaseResp
	AssetId int64 `json:"asset_id"`
	ShardId int64 `json:"shard_id"`
}

type H5OrderItem added in v1.0.16

type H5OrderItem struct {
	TpOrderId    int64  `json:"oid"`
	OrderInfoUrl string `json:"order_url"`
	H5PayInfo    string `json:"pay_info"`
	TotalAmount  string `json:"total_amount"`
	CTime        int64  `json:"ctime"`
}

type HistoryMeta added in v1.0.5

type HistoryMeta struct {
	AssetId int64  `json:"asset_id"`
	Type    int    `json:"type"`
	ShardId int64  `json:"shard_id"`
	Price   int64  `json:"price"`
	TxId    string `json:"tx_id"`
	From    string `json:"from"`
	To      string `json:"to"`
	Ctime   int64  `json:"ctime"`
}

type HoraeAssetObject

type HoraeAssetObject struct {
	AssetId   int64      `json:"asset_id"`
	AssetCate int        `json:"asset_cate"`
	Title     string     `json:"title"`
	Thumb     []ThumbMap `json:"thumb"`
	ShortDesc string     `json:"short_desc"`
}

type HubConfirmH5OrderParam added in v1.0.14

type HubConfirmH5OrderParam struct {
	Code       int   `json:"code"`
	OrderType  int   `json:"order_type"`
	Oid        int64 `json:"oid"`
	ClientType int   `json:"client_type"`
	// object,其余支付参数的序列化值,标记剩余的非通用参数
	Details string `json:"creator_details"`
}

func (*HubConfirmH5OrderParam) Valid added in v1.0.14

func (p *HubConfirmH5OrderParam) Valid() error

type HubCreateData added in v1.0.15

type HubCreateData struct {
	Code      int    `json:"code"`
	OrderType int    `json:"order_type"`
	Details   string `json:"details"`
	CTime     int64  `json:"ctime"`
}

type HubCreateOrderParam added in v1.0.14

type HubCreateOrderParam struct {
	// 标记支付平台, 1001: 百度收银台-小程序 1002: 百度收银台-IOS 1003: 百度收银台-H5 1004: 百度billing-H5 2001: 第三方微信支付
	Code int `json:"code"`
	// 订单类型, 1:PGC商城订单
	OrderType int `json:"order_type"`
	// 使用百度收银台,且有回调通知的业务方服务请填写回调地址,支付成功后,执行器回调接口,应用方需保证接口幂等
	ExecutorAPI string `json:"executor"`
	// object, 使用百度收银台时,支付成功后,执行器回调时携带参数
	ExecutorData string `json:"executor_data"`
	// 下单时间,建议填写now time
	Timestamp int64 `json:"timestamp"`
	// 订单失效时间,针对使用百度收银台的订单有效
	// 当TimeExpire为0时,表示永久不过期
	// TimeExpire为秒偏移量,以create_time时间为准偏移
	TimeExpire int64 `json:"time_expire"`
	// 是否需要分账,0: 不分账,1: 分账
	ProfitSharing int `json:"profit_sharing"`
	// object,其余支付参数的序列化值,标记剩余的非通用参数
	Details    string `json:"creator_details"`
	ActId      int64  `json:"act_id"`
	AssetId    int64  `json:"asset_id"`
	BuyerAddr  string `json:"buyer_addr"`
	SellerAddr string `json:"seller_addr"`
	ClientType int    `json:"client_type"`
	Chan       int64  `json:"chan"`
	Scene      int64  `json:"scene"`
	BuyCount   int    `json:"buy_count"`
}

////////// Create Orders ///////////////

func (*HubCreateOrderParam) Valid added in v1.0.14

func (p *HubCreateOrderParam) Valid() error

type HubCreateResp added in v1.0.14

type HubCreateResp struct {
	BaseResp
	Data HubCreateData `json:"data"`
}

type HubEditOrderParam added in v1.0.14

type HubEditOrderParam struct {
	Oid         int64  `json:"oid"`
	Status      int    `json:"status"`
	PayChannel  int    `json:"pay_channel"`
	ThirdOid    string `json:"third_oid"`
	PayInfo     string `json:"pay_info"`
	PayTime     int64  `json:"pay_time"`
	CloseTime   int64  `json:"close_time"`
	CloseReason string `json:"close_reason"`
}

func (*HubEditOrderParam) Valid added in v1.0.14

func (p *HubEditOrderParam) Valid() error

type HubListOrderData added in v1.0.15

type HubListOrderData struct {
	List    []HubOrderDetail `json:"list"`
	Cursor  string           `json:"cursor"`
	HasMore int              `json:"has_more"`
}

type HubListOrderParam added in v1.0.14

type HubListOrderParam struct {
	Addr      string `json:"address"`
	Status    int    `json:"status"`
	Cursor    string `json:"cursor"`
	Limit     int    `json:"limit"`
	TimeBegin int64  `json:"time_begin"`
	TimeEnd   int64  `json:"time_end"`
	Mono      int    `json:"monotonicity"` // monotonicity = 0 orders by ctime desc
}

func (*HubListOrderParam) Valid added in v1.0.14

func (p *HubListOrderParam) Valid() error

type HubListOrderResp added in v1.0.14

type HubListOrderResp struct {
	BaseResp
	Data HubListOrderData `json:"data"`
}

type HubOrderDetail added in v1.0.14

type HubOrderDetail struct {
	Code        int      `json:"code"`
	OrderType   int      `json:"order_type"`
	Oid         int64    `json:"oid"`
	ActId       int64    `json:"act_id"`
	AssetId     int64    `json:"asset_id"`
	ShardIds    []int64  `json:"shard_ids"`
	BuyerAddr   string   `json:"buyer_addr"`
	Status      int      `json:"status"`
	RefStatus   int      `json:"refund_status"`
	Rid         int64    `json:"rid"`
	Title       string   `json:"title"`
	Thumb       []string `json:"thumb"`
	StoreId     int64    `json:"store_id"`
	StoreName   string   `json:"store_name"`
	OriginPrice int      `json:"origin_price"`
	PayPrice    int      `json:"pay_price"`
	SinglePrice int      `json:"single_price"`
	TimeExpire  int64    `json:"time_expire"`
	PayTime     int64    `json:"pay_time"`
	CloseTime   int64    `json:"close_time"`
	Ctime       int64    `json:"ctime"`
	BuyCount    int      `json:"buy_count"`
}

type HubOrderDetailParam added in v1.0.14

type HubOrderDetailParam struct {
	Oid int64 `json:"oid"`
}

func (*HubOrderDetailParam) Valid added in v1.0.14

func (p *HubOrderDetailParam) Valid() error

type HubOrderDetailResp added in v1.0.14

type HubOrderDetailResp struct {
	BaseResp
	Data HubOrderDetail `json:"data"`
}

type HubOrderPageData added in v1.0.16

type HubOrderPageData struct {
	List  []HubOrderDetail `json:"list"`
	Total int64            `json:"total"`
}

type HubOrderPageParam added in v1.0.16

type HubOrderPageParam struct {
	Addr      string `json:"address"`
	Status    int    `json:"status"`
	Page      int    `json:"page"`
	Size      int    `json:"size"`
	TimeBegin int64  `json:"time_begin"`
	TimeEnd   int64  `json:"time_end"`
}

func (*HubOrderPageParam) Valid added in v1.0.16

func (p *HubOrderPageParam) Valid() error

type HubOrderPageResp added in v1.0.16

type HubOrderPageResp struct {
	BaseResp
	Data HubOrderPageData `json:"data"`
}

type ListActAstResp added in v1.0.12

type ListActAstResp struct {
	BaseResp
	List []*QueryActAstMeta `json:"list"`
}

type ListActParam added in v1.0.14

type ListActParam struct {
	StoreId int    `json:"store_id"`
	Cursor  string `json:"cursor"`
	Limit   int    `json:"limit"`
}

func (*ListActParam) Valid added in v1.0.14

func (t *ListActParam) Valid() error

type ListActResp added in v1.0.14

type ListActResp struct {
	BaseResp
	List    []*QueryActMeta `json:"list"`
	Cursor  string          `json:"cursor"`
	HasMore int             `json:"has_more"`
}

type ListAssetHisParam added in v1.0.4

type ListAssetHisParam struct {
	AssetId int64 `json:"asset_id"`
	ShardId int64 `json:"shard_id"`
	Page    int   `json:"page"`
	Limit   int   `json:"limit"`
}

//////// Get History ////////////

func (*ListAssetHisParam) Valid added in v1.0.4

func (t *ListAssetHisParam) Valid() error

type ListAssetHistoryResp added in v1.0.4

type ListAssetHistoryResp struct {
	BaseResp
	List     []*HistoryMeta `json:"list"`
	TotalCnt int            `json:"total_cnt"`
	Cursor   string         `json:"cursor"`
	HasMore  int            `json:"has_more"`
}

type ListAssetsByAddrParam added in v1.0.3

type ListAssetsByAddrParam struct {
	Addr   string `json:"addr"`
	Status int    `json:"status"`
	Page   int    `json:"page"`
	Limit  int    `json:"limit"`
}

/////// List Assets By Address //////////

func (*ListAssetsByAddrParam) Valid added in v1.0.3

func (t *ListAssetsByAddrParam) Valid() error

type ListAssetsByAddrResp added in v1.0.5

type ListAssetsByAddrResp struct {
	BaseResp
	List     []*QueryAssetMeta `json:"list"`
	TotalCnt int               `json:"total_cnt"`
}

type ListDiffByAddrNode added in v1.0.10

type ListDiffByAddrNode struct {
	AssetId int64      `json:"asset_id"`
	ShardId int64      `json:"shard_id"`
	Operate int        `json:"operate"`
	Title   string     `json:"title"`
	Thumb   []ThumbMap `json:"thumb"`
	Ctime   int64      `json:"ctime"`
}

type ListDiffByAddrParam added in v1.0.10

type ListDiffByAddrParam struct {
	Addr string `json:"addr"`
	// 可选参数
	Limit  int    `json:"limit"`
	Cursor string `json:"cursor"`
	OpTyps string `json:"op_types"`
}

////////// listdiffbyaddr /////////////////

func (*ListDiffByAddrParam) Valid added in v1.0.10

func (t *ListDiffByAddrParam) Valid() error

type ListDiffByAddrResp added in v1.0.10

type ListDiffByAddrResp struct {
	BaseResp
	List    []*ListDiffByAddrNode `json:"list"`
	Cursor  string                `json:"cursor"`
	HasMore int                   `json:"has_more"`
}

type ListShardsByAddrParam

type ListShardsByAddrParam struct {
	Addr  string `json:"addr"`
	Page  int    `json:"page"`
	Limit int    `json:"limit"`
	// 可选
	AssetId int64 `json:"asset_id"`
}

/////// List Shard By Address //////////

func (*ListShardsByAddrParam) Valid

func (t *ListShardsByAddrParam) Valid() error

type ListShardsByAddrResp added in v1.0.5

type ListShardsByAddrResp struct {
	BaseResp
	List     []*QueryShardMeta `json:"list"`
	TotalCnt int               `json:"total_cnt"`
}

type ListShardsByAssetParam added in v1.0.3

type ListShardsByAssetParam struct {
	AssetId int64  `json:"asset_id"`
	Cursor  string `json:"cursor"`
	Limit   int    `json:"limit"`
}

/////// List Shards By Asset //////////

func (*ListShardsByAssetParam) Valid added in v1.0.3

func (t *ListShardsByAssetParam) Valid() error

type ListShardsByAssetResp added in v1.0.5

type ListShardsByAssetResp struct {
	BaseResp
	List    []*QueryShardMeta `json:"list"`
	Cursor  string            `json:"cursor"`
	HasMore int               `json:"has_more"`
}

type ListStoreResp added in v1.0.12

type ListStoreResp struct {
	BaseResp
	List []*QueryStoreMeta `json:"list"`
}

type LockOrFreezeShardParam added in v1.0.33

type LockOrFreezeShardParam struct {
	AssetId int64
	ShardId int64
	OpType  int
	Account *auth.Account
}

//////// Lock or freeze Shard ////////////

func (*LockOrFreezeShardParam) Valid added in v1.0.33

func (t *LockOrFreezeShardParam) Valid() error

type Material added in v1.0.28

type Material struct {
	AssetId int64 `json:"id"`
	Need    int   `json:"need"`
}

type PublishAssetParam

type PublishAssetParam struct {
	AssetId    int64         `json:"asset_id"`
	Account    *auth.Account `json:"account"`
	IsEvidence int           `json:"is_evidence,omitempty"`
}

//////// Publish Asset ////////////

func (*PublishAssetParam) Valid

func (t *PublishAssetParam) Valid() error

type QueryActAstMeta added in v1.0.12

type QueryActAstMeta struct {
	AppId         int64    `json:"app_id"`
	Addr          string   `json:"addr"`
	AssetId       int64    `json:"asset_id"`
	SplitId       int64    `json:"split_id"`
	AssetCate     int      `json:"asset_cate"`
	Thumb         []string `json:"thumb"`
	Title         string   `json:"title"`
	ShortDesc     string   `json:"short_desc"`
	TxId          string   `json:"tx_id"`
	AssetUrl      []string `json:"asset_url"`
	ImgDesc       []string `json:"img_desc"`
	ActId         int64    `json:"act_id"`
	Start         int64    `json:"start"`
	End           int64    `json:"end"`
	Price         int64    `json:"price"`
	OriPrice      int64    `json:"ori_price"`
	Amount        int64    `json:"amount"`
	ApplyForm     int      `json:"apply_form"`
	GrantMode     int      `json:"grant_mode"`
	Status        int      `json:"status"`
	PublishStatus int      `json:"publish_status"`
	JumpLink      string   `json:"jump_link"`
	ExtInfo       string   `json:"ext_info"`
	Ctime         int64    `json:"ctime"`
	Mtime         int64    `json:"mtime"`
}

type QueryActAstResp added in v1.0.12

type QueryActAstResp struct {
	BaseResp
	Meta *QueryActAstMeta `json:"meta"`
}

type QueryActMeta added in v1.0.14

type QueryActMeta struct {
	AppId         int64    `json:"app_id"`
	StoreId       int      `json:"store_id"`
	StoreName     string   `json:"store_name"`
	ActId         int64    `json:"act_id"`
	JumpLink      string   `json:"jump_link"`
	Issuer        string   `json:"issuer"`
	ActName       string   `json:"act_name"`
	Thumb         []string `json:"thumb"`
	ImgDesc       []string `json:"img_desc"`
	ShortDesc     string   `json:"short_desc"`
	Status        int      `json:"status"`
	PublishStatus int      `json:"publish_status"`
	Start         int64    `json:"start"`
	End           int64    `json:"end"`
	Bookable      int      `json:"bookable"`
	Weight        int      `json:"weight"`
	ExtInfo       string   `json:"ext_info"`
	Ctime         int64    `json:"ctime"`
	Mtime         int64    `json:"mtime"`
}

type QueryActResp added in v1.0.14

type QueryActResp struct {
	BaseResp
	Meta *QueryActMeta `json:"meta"`
}

type QueryAssetMeta

type QueryAssetMeta struct {
	AssetId    int64      `json:"asset_id"`
	GroupId    int64      `json:"group_id"`
	AssetCate  int        `json:"asset_cate"`
	Title      string     `json:"title"`
	Thumb      []ThumbMap `json:"thumb"`
	ShortDesc  string     `json:"short_desc"`
	LongDesc   string     `json:"long_desc"`
	ImgDesc    []string   `json:"img_desc"`
	AssetUrl   []string   `json:"asset_url"`
	AssetExt   string     `json:"asset_ext"`
	Price      int64      `json:"price"`
	Amount     int        `json:"amount"`
	Status     int        `json:"status"`
	CreateAddr string     `json:"create_addr"`
	Ctime      int64      `json:"ctime"`
	Mtime      int64      `json:"mtime"`
	TxId       string     `json:"tx_id"`
	ProcScript string     `json:"proc_script"`
	Version    int64      `json:"version"`
	ViewType   int        `json:"view_type"`
	AssetParam string     `json:"asset_param"`
}

type QueryAssetParam

type QueryAssetParam struct {
	AssetId int64 `json:"asset_id"`
}

//////// Query Asset //////////

func (*QueryAssetParam) Valid

func (t *QueryAssetParam) Valid() error

type QueryAssetResp

type QueryAssetResp struct {
	BaseResp
	Meta *QueryAssetMeta `json:"meta"`
}

type QueryRefundPageParam added in v1.0.35

type QueryRefundPageParam struct {
	Address      string `json:"address"`
	StoreId      int64  `json:"store_id"`
	RefundStatus string `json:"refund_status"`
	Page         int    `json:"page"`
	Size         int    `json:"limit"`
}

func (*QueryRefundPageParam) Valid added in v1.0.35

func (p *QueryRefundPageParam) Valid() error

type QueryRefundPageResp added in v1.0.35

type QueryRefundPageResp struct {
	BaseResp
	Data RefundPageData `json:"data"`
}

type QueryRefundParam added in v1.0.35

type QueryRefundParam struct {
	Rid int64 `json:"rid"`
}

func (*QueryRefundParam) Valid added in v1.0.35

func (p *QueryRefundParam) Valid() error

type QueryRefundResp added in v1.0.35

type QueryRefundResp struct {
	BaseResp
	Data RefundInfo `json:"data"`
}

type QueryShardMeta

type QueryShardMeta struct {
	AssetId    int64           `json:"asset_id"`
	ShardId    int64           `json:"shard_id"`
	Price      int64           `json:"price"`
	OwnerAddr  string          `json:"owner_addr"`
	Status     int             `json:"status"`
	TxId       string          `json:"tx_id"`
	AssetInfo  *ShardAssetInfo `json:"asset_info"`
	Ctime      int64           `json:"ctime"`
	Mtime      int64           `json:"mtime"`
	Version    int64           `json:"version"`
	ShardParam string          `json:"shard_param"`
}

type QueryShardParam

type QueryShardParam struct {
	AssetId int64 `json:"asset_id"`
	ShardId int64 `json:"shard_id"`
}

//////// Query Shard ////////////

func (*QueryShardParam) Valid

func (t *QueryShardParam) Valid() error

type QueryShardResp

type QueryShardResp struct {
	BaseResp
	Meta *QueryShardMeta `json:"meta"`
}

type QueryStoreMeta added in v1.0.12

type QueryStoreMeta struct {
	AppId     int64  `json:"app_id"`
	StoreId   int    `json:"store_id"`
	Name      string `json:"name"`
	Cover     string `json:"cover"`
	ShortDesc string `json:"short_desc"`
	Status    int    `json:"status"`
	Ctime     int64  `json:"ctime"`
	Mtime     int64  `json:"mtime"`
	Weight    int    `json:"weight"`
	ExtInfo   string `json:"ext_info"`
	Wechat    string `json:"wechat"`
	Likes     int64  `json:"likes"`
}

type QueryStoreResp added in v1.0.12

type QueryStoreResp struct {
	BaseResp
	Meta *QueryStoreMeta `json:"meta"`
}

type RefundInfo added in v1.0.35

type RefundInfo struct {
	Rid          int64    `json:"rid"`
	Oid          int64    `json:"oid"`
	BuyerAddr    string   `json:"buyer_addr"`
	AssetId      int64    `json:"asset_id"`
	ShardIds     []int64  `json:"shard_ids"`
	Title        string   `json:"title"`
	Thumb        []string `json:"thumb"`
	SinglePrice  int      `json:"single_price"`
	PayPrice     int      `json:"pay_price"`
	Count        int      `json:"count"`
	Reason       string   `json:"reason"`
	Message      string   `json:"message"`
	RefundStatus int      `json:"refund_status"`
	Rtime        int64    `json:"rtime"`
	Ctime        int64    `json:"ctime"`
}

type RefundPageData added in v1.0.35

type RefundPageData struct {
	List        []*RefundInfo `json:"list"`
	TotalAmount int           `json:"total_amount"`
}

type RefuseRefundParam added in v1.0.35

type RefuseRefundParam struct {
	Rid      int64  `json:"rid"`
	Message  string `json:"message"`
	Operator string `json:"operator"`
}

func (*RefuseRefundParam) Valid added in v1.0.35

func (p *RefuseRefundParam) Valid() error

type RequestRes

type RequestRes struct {
	HttpCode int         `json:"http_code"`
	ReqUrl   string      `json:"req_url"`
	Header   http.Header `json:"header"`
	Body     string      `json:"body"`
}

///// General Client ///////

type SceneHasAssetByAddrParam added in v1.0.12

type SceneHasAssetByAddrParam struct {
	Addr     string `json:"addr"`
	Token    string `json:"token"`
	AssetIds string `json:"asset_ids"`
}

////////// Scene hasassetbyaddr ///////////////

func (*SceneHasAssetByAddrParam) Valid added in v1.0.12

func (t *SceneHasAssetByAddrParam) Valid() error

type SceneHasAssetByAddrResp added in v1.0.12

type SceneHasAssetByAddrResp struct {
	BaseResp
	Result map[string]int `json:"result"`
}

type SceneListAddrResp added in v1.0.12

type SceneListAddrResp struct {
	BaseResp
	List []*AddrGroupToken `json:"list"`
}

type SceneListDiffByAddrParam added in v1.0.10

type SceneListDiffByAddrParam struct {
	Addr  string `json:"addr"`
	Token string `json:"token"`
	// 可选参数
	Limit  int    `json:"limit"`
	Cursor string `json:"cursor"`
	OpTyps string `json:"op_types"`
}

////////// Scene listdiffbyaddr /////////////////

func (*SceneListDiffByAddrParam) Valid added in v1.0.10

func (t *SceneListDiffByAddrParam) Valid() error

type SceneListMeta added in v1.0.9

type SceneListMeta struct {
	AssetId int64      `json:"asset_id"`
	ShardId int64      `json:"shard_id"`
	Title   string     `json:"title"`
	Thumb   []ThumbMap `json:"thumb"`
}

type SceneListShardByAddrParam added in v1.0.9

type SceneListShardByAddrParam struct {
	Addr   string `json:"addr"`
	Token  string `json:"token"`
	Cursor string `json:"cursor"`
	Limit  int    `json:"limit"`
}

//////// Scene ListShardByAddr ////////////

func (*SceneListShardByAddrParam) Valid added in v1.0.9

func (t *SceneListShardByAddrParam) Valid() error

type SceneListShardByAddrResp added in v1.0.9

type SceneListShardByAddrResp struct {
	BaseResp
	List    []*SceneListMeta `json:"list"`
	Cursor  string           `json:"cursor"`
	HasMore int              `json:"has_more"`
}

type SceneQueryMeta added in v1.0.9

type SceneQueryMeta struct {
	AssetId    int64      `json:"asset_id"`
	ShardId    int64      `json:"shard_id"`
	OwnerAddr  string     `json:"owner_addr"`
	Status     int        `json:"status"`
	TxId       string     `json:"tx_id"`
	Ctime      int64      `json:"ctime"`
	JumpLink   string     `json:"jump_link"`
	Price      int64      `json:"price"`
	Title      string     `json:"title"`
	Thumb      []ThumbMap `json:"thumb"`
	AssetUrl   []string   `json:"asset_url"`
	ImgDesc    []string   `json:"img_desc"`
	ShortDesc  string     `json:"short_desc"`
	CreateAddr string     `json:"create_addr"`
}

type SceneQueryShardParam added in v1.0.9

type SceneQueryShardParam struct {
	Addr    string `json:"addr"`
	Token   string `json:"token"`
	AssetId int64  `json:"asset_id"`
	ShardId int64  `json:"shard_id"`
}

//////// Scene QueryShard ////////////

func (*SceneQueryShardParam) Valid added in v1.0.9

func (t *SceneQueryShardParam) Valid() error

type SceneQueryShardResp added in v1.0.9

type SceneQueryShardResp struct {
	BaseResp
	Meta *SceneQueryMeta `json:"meta"`
}

type SelBoxAstParam added in v1.0.25

type SelBoxAstParam struct {
	AssetId int64
	ShardId int64
}

func (*SelBoxAstParam) Valid added in v1.0.25

func (t *SelBoxAstParam) Valid() error

type SelBoxAstResp added in v1.0.25

type SelBoxAstResp struct {
	BaseResp
	RealAstId int64  `json:"real_asset_id"`
	Token     string `json:"token"`
}

type SelMaterialParam added in v1.0.26

type SelMaterialParam struct {
	AssetId int64
	StrgNo  int
	Addr    string
}

func (*SelMaterialParam) Valid added in v1.0.26

func (t *SelMaterialParam) Valid() error

type SelMaterialResp added in v1.0.26

type SelMaterialResp struct {
	BaseResp
	List  []*AssetShardPair `json:"list"`
	Token string            `json:"token"`
}

type ShardAssetInfo

type ShardAssetInfo struct {
	Title      string     `json:"title"`
	AssetCate  int        `json:"asset_cate"`
	Thumb      []ThumbMap `json:"thumb"`
	AssetUrl   []string   `json:"asset_url"`
	AssetExt   string     `json:"asset_ext"`
	ShortDesc  string     `json:"short_desc"`
	CreateAddr string     `json:"create_addr"`
	GroupId    int64      `json:"group_id"`
}

type SumOrderPriceData added in v1.0.29

type SumOrderPriceData struct {
	TotalCnt   int64 `json:"total_cnt"`
	TotalPrice int64 `json:"total_price"`
}

type SumOrderPriceParam added in v1.0.29

type SumOrderPriceParam struct {
	Status int   `json:"status"`
	End    int64 `json:"end"`
	Start  int64 `json:"start"`
}

func (*SumOrderPriceParam) Valid added in v1.0.29

func (p *SumOrderPriceParam) Valid() error

type SumOrderPriceResp added in v1.0.29

type SumOrderPriceResp struct {
	BaseResp
	Data SumOrderPriceData `json:"data"`
}

type SumRefundData added in v1.0.35

type SumRefundData struct {
	SumPrice    int `json:"sum_price"`
	TotalAmount int `json:"total_amount"`
}

type SumRefundPriceParam added in v1.0.35

type SumRefundPriceParam struct {
	StoreId      int64  `json:"store_id"`
	RefundStatus string `json:"refund_status"`
}

func (*SumRefundPriceParam) Valid added in v1.0.35

func (p *SumRefundPriceParam) Valid() error

type SumRefundPriceResp added in v1.0.35

type SumRefundPriceResp struct {
	BaseResp
	Data SumRefundData `json:"data"`
}

type TestLogger

type TestLogger struct {
}

mock logger

func (*TestLogger) Debug

func (t *TestLogger) Debug(msg string, ctx ...interface{})

func (*TestLogger) Error

func (t *TestLogger) Error(msg string, ctx ...interface{})

func (*TestLogger) Info

func (t *TestLogger) Info(msg string, ctx ...interface{})

func (*TestLogger) Trace

func (t *TestLogger) Trace(msg string, ctx ...interface{})

func (*TestLogger) Warn

func (t *TestLogger) Warn(msg string, ctx ...interface{})

type ThumbMap

type ThumbMap struct {
	Urls   map[string]string `json:"urls"`
	Width  string            `json:"width"`
	Height string            `json:"height"`
}

type TransferAssetParam

type TransferAssetParam struct {
	AssetId  int64         `json:"asset_id"`
	ShardId  int64         `json:"shard_id"`
	Price    int64         `json:"price,omitempty"`
	Account  *auth.Account `json:"account"`
	Addr     string        `json:"addr"`
	ToAddr   string        `json:"to_addr"`
	ToUserId int64         `json:"to_userid,omitempty"`
}

//////// Transfer Asset //////////

func (*TransferAssetParam) Valid

func (p *TransferAssetParam) Valid() error

type UpgradeAstParam added in v1.0.32

type UpgradeAstParam struct {
	AssetId    int64  `json:"asset_id"`
	AssetParam string `json:"asset_param"`
}

//////// Upgrade Asset ////////////

func (*UpgradeAstParam) Valid added in v1.0.32

func (t *UpgradeAstParam) Valid() error

type UpgradeSdsParam added in v1.0.32

type UpgradeSdsParam struct {
	AssetId    int64  `json:"asset_id"`
	ShardId    int64  `json:"shard_id"`
	ShardParam string `json:"shard_param"`
}

//////// Upgrade Shard ////////////

func (*UpgradeSdsParam) Valid added in v1.0.32

func (t *UpgradeSdsParam) Valid() error

type UploadFileParam

type UploadFileParam struct {
	Account  *auth.Account `json:"account"`
	FileName string        `json:"file_name"`
	FilePath string        `json:"file_path"`
	DataByte []byte        `json:"data_byte"`
	Property string        `json:"property"`
}

////// Upload File ///////////// Account 创建资产区块链账户 FileName 文件名称 FilePath 文件绝对路径 DataByte 文件二进制串 Property 文件属性。例如图片类型文件,则为图片宽高,格式为 width_height 注意:文件路径和二进制串为二选一

func (*UploadFileParam) Valid

func (t *UploadFileParam) Valid() error

type UploadFileResp

type UploadFileResp struct {
	Link       string      `json:"link"`
	AccessInfo *AccessInfo `json:"accessInfo"`
}

type VilgBalanceResp added in v1.0.25

type VilgBalanceResp struct {
	BaseResp
	Balance int64 `json:"balance"`
}

type VilgGetImgResp added in v1.0.25

type VilgGetImgResp struct {
	BaseResp
	Task struct {
		TaskId int64  `json:"task_id"`
		Status int64  `json:"status"` // 任务状态
		Img    string `json:"img"`    // 状态为 1 时表示图片 URL

		// 原始请求,便于回溯
		Text       string `json:"text"`
		Style      int64  `json:"style"`
		Resolution int64  `json:"resolution"`
		Extend     string `json:"extend"`
	} `json:"task"`
}

type VilgText2ImgParam added in v1.0.25

type VilgText2ImgParam struct {
	Text       string `json:"text"`       // 文本内容
	Style      int64  `json:"style"`      // 风格
	Resolution int64  `json:"resolution"` // 分辨率
	Extend     string `json:"extend"`     // 用户信息,查询时原样返回,长度100字符以内
}

func (*VilgText2ImgParam) Valid added in v1.0.25

func (t *VilgText2ImgParam) Valid() error

type VilgText2ImgResp added in v1.0.25

type VilgText2ImgResp struct {
	BaseResp
	TaskId int64 `json:"task_id"`
}

type XassetBaseClient

type XassetBaseClient struct {
	Cfg         *config.XassetCliConfig
	Logger      *logs.Logger
	ExtraHeader map[string]string
}

XassetBaseClient

func (*XassetBaseClient) GetConfig

func (t *XassetBaseClient) GetConfig() *config.XassetCliConfig

func (*XassetBaseClient) GetTarceId

func (t *XassetBaseClient) GetTarceId(header http.Header) string

func (*XassetBaseClient) InitClient

func (t *XassetBaseClient) InitClient(cfg *config.XassetCliConfig, logger logs.LogDriver) error

func (*XassetBaseClient) Post

func (t *XassetBaseClient) Post(uri, data string) (*RequestRes, error)

func (*XassetBaseClient) SetHeader added in v1.0.16

func (t *XassetBaseClient) SetHeader(k, v string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL