Documentation ¶
Index ¶
- Constants
- func GetInvestKey(article []byte, user qbasetypes.Address, investorType string) []byte
- func GetInvestUncheckedKey(article []byte, user qbasetypes.Address) []byte
- func ResultArticleNotFoundError() common.Result
- func ResultBuyadExpiredError() common.Result
- func ResultBuyadNotStartError() common.Result
- func ResultBuyadSaledError() common.Result
- func ResultInvestadExpiredError() common.Result
- type ActivityAward
- type Articles
- type ArticlesMapper
- func (mapper *ArticlesMapper) Copy() mapper.IMapper
- func (mapper *ArticlesMapper) GetArticle(articleHash string) *Articles
- func (mapper *ArticlesMapper) GetKey(key string) (v string)
- func (mapper *ArticlesMapper) SaveKV(key string, value string)
- func (mapper *ArticlesMapper) SetArticle(articleHash string, qscinfo *Articles) bool
- type BuyMapper
- func (bm *BuyMapper) Copy() mapper.IMapper
- func (bm *BuyMapper) DeleteBuyer(article []byte)
- func (bm *BuyMapper) GetBuyer(article []byte) (*Buyer, bool)
- func (bm *BuyMapper) GetKey(key string) (v string)
- func (bm *BuyMapper) SaveKV(key string, value string)
- func (bm *BuyMapper) SetBuyer(article []byte, i Buyer)
- type Buyer
- type CheckStatus
- type Coins
- type CoinsMapper
- type InvestMapper
- func (im *InvestMapper) AllInvestors(article []byte) Investors
- func (im *InvestMapper) Copy() mapper.IMapper
- func (im *InvestMapper) GetInvestor(key []byte) (Investor, bool)
- func (im *InvestMapper) GetKey(key string) (v string)
- func (im *InvestMapper) SaveKV(key string, value string)
- func (im *InvestMapper) SetInvestor(key []byte, i Investor)
- type InvestUnchecked
- type InvestUncheckedMapper
- func (ium *InvestUncheckedMapper) Copy() mapper.IMapper
- func (ium *InvestUncheckedMapper) GetInvestUncheckeds(key []byte) (InvestUncheckeds, bool)
- func (ium *InvestUncheckedMapper) GetKey(key string) (v string)
- func (ium *InvestUncheckedMapper) SaveKV(key string, value string)
- func (ium *InvestUncheckedMapper) SetInvestUncheckeds(key []byte, i InvestUncheckeds)
- type InvestUncheckeds
- type Investor
- type Investors
Constants ¶
View Source
const ( InvestorTypeAuthor = "author" InvestorTypeOriginalAuthor = "originalAuthor" InvestorTypeCommunity = "community" InvestorTypeCommonInvestor = "commonInvestor" )
View Source
const ArticlesMapperName = "article"
View Source
const (
BuyMapperName = "buyad"
)
View Source
const CoinsMapperName = "coins"
View Source
const (
InvestMapperName = "investad"
)
View Source
const (
InvestUncheckedMapperName = "investUnchecked"
)
Variables ¶
This section is empty.
Functions ¶
func GetInvestKey ¶
func GetInvestKey(article []byte, user qbasetypes.Address, investorType string) []byte
func GetInvestUncheckedKey ¶
func GetInvestUncheckedKey(article []byte, user qbasetypes.Address) []byte
func ResultArticleNotFoundError ¶
ResultArticleNotFoundError 文章不存在
func ResultBuyadExpiredError ¶
ResultBuyadExpiredError 购买过期
func ResultBuyadNotStartError ¶
ResultBuyadNotStartError 还未到购买时间
func ResultInvestadExpiredError ¶
ResultInvestadExpiredError 投资过期
Types ¶
type ActivityAward ¶
type Articles ¶
type Articles struct { Authoraddress types.Address //作者地址(必填) OriginalAuthor types.Address //原创作者地址(为空表示原创) ArticleHash string //作品唯一标识hash InvestDays int //可供投资的天数(必填) EndInvestDate time.Time //投资结束时间(必填) BuyDays int //可供购买广告位的天数(必填) EndBuyDate time.Time //广告位购买结果时间(必填) Gas types.BigInt }
func QueryArticle ¶
func QueryArticle(cdc *amino.Codec, ctx *context.CLIContext, hash string) (article *Articles, err error)
type ArticlesMapper ¶
type ArticlesMapper struct {
*mapper.BaseMapper
}
func NewArticlesMapper ¶
func NewArticlesMapper(MapperName string) *ArticlesMapper
func (*ArticlesMapper) Copy ¶
func (mapper *ArticlesMapper) Copy() mapper.IMapper
func (*ArticlesMapper) GetArticle ¶
func (mapper *ArticlesMapper) GetArticle(articleHash string) *Articles
func (*ArticlesMapper) GetKey ¶
func (mapper *ArticlesMapper) GetKey(key string) (v string)
func (*ArticlesMapper) SaveKV ¶
func (mapper *ArticlesMapper) SaveKV(key string, value string)
func (*ArticlesMapper) SetArticle ¶
func (mapper *ArticlesMapper) SetArticle(articleHash string, qscinfo *Articles) bool
type BuyMapper ¶
type BuyMapper struct {
*mapper.BaseMapper
}
func NewBuyMapper ¶
type Buyer ¶
type Buyer struct { ArticleHash []byte `json:"articleHash"` // 文章hash Address qbasetypes.Address `json:"address"` // 买家地址 Buy qbasetypes.BigInt `json:"buyad"` // 购买金额 BuyTime time.Time `json:"buyTime"` // 购买时间 CheckStatus CheckStatus `json:"isChecked"` // 验证状态 }
Buyer 买家
func QueryArticleBuyer ¶
func QueryArticleBuyer(cdc *amino.Codec, ctx *context.CLIContext, hash string) (buyer *Buyer, err error)
type CheckStatus ¶
type CheckStatus int
const ( CheckStatusInit CheckStatus = iota CheckStatusSuccess CheckStatusFail )
type Coins ¶
type Coins struct { Tx string From types.Address Data []ActivityAward Status string //记录保存跨链结果 }
func QueryCoins ¶
func QueryCoins(cdc *amino.Codec, ctx *context.CLIContext, tx string) (coins *Coins, err error)
type CoinsMapper ¶
type CoinsMapper struct {
*mapper.BaseMapper
}
func NewCoinsMapper ¶
func NewCoinsMapper(kvMapperName string) *CoinsMapper
func (*CoinsMapper) Copy ¶
func (cm *CoinsMapper) Copy() mapper.IMapper
func (*CoinsMapper) GetCoins ¶
func (cm *CoinsMapper) GetCoins(key []byte) (*Coins, bool)
Get 查询活动奖励记录
func (*CoinsMapper) UpdateCoins ¶
func (cm *CoinsMapper) UpdateCoins(key []byte, code string) bool
Set 更新跨链记录
type InvestMapper ¶
type InvestMapper struct {
*mapper.BaseMapper
}
func NewInvestMapper ¶
func NewInvestMapper(mapperName string) *InvestMapper
func (*InvestMapper) AllInvestors ¶
func (im *InvestMapper) AllInvestors(article []byte) Investors
Iterator
func (*InvestMapper) Copy ¶
func (im *InvestMapper) Copy() mapper.IMapper
func (*InvestMapper) GetInvestor ¶
func (im *InvestMapper) GetInvestor(key []byte) (Investor, bool)
Get 查询用户投资情况
func (*InvestMapper) GetKey ¶
func (im *InvestMapper) GetKey(key string) (v string)
func (*InvestMapper) SaveKV ¶
func (im *InvestMapper) SaveKV(key string, value string)
func (*InvestMapper) SetInvestor ¶
func (im *InvestMapper) SetInvestor(key []byte, i Investor)
Set 添加用户投资
type InvestUnchecked ¶
type InvestUnchecked struct { Article []byte `json:"article"` // 文章hash Address qbasetypes.Address `json:"address"` // 投资者地址 Invest qbasetypes.BigInt `json:"invest"` // 投资金额 InvestTime time.Time `json:"investTime"` // 投资时间 IsChecked bool `json:"isChecked"` // 已确认 }
InvestUnchecked 投资者待确认
type InvestUncheckedMapper ¶
type InvestUncheckedMapper struct {
*mapper.BaseMapper
}
func NewInvestUncheckedMapper ¶
func NewInvestUncheckedMapper(mapperName string) *InvestUncheckedMapper
func (*InvestUncheckedMapper) Copy ¶
func (ium *InvestUncheckedMapper) Copy() mapper.IMapper
func (*InvestUncheckedMapper) GetInvestUncheckeds ¶
func (ium *InvestUncheckedMapper) GetInvestUncheckeds(key []byte) (InvestUncheckeds, bool)
Get 查询用户投资情况
func (*InvestUncheckedMapper) GetKey ¶
func (ium *InvestUncheckedMapper) GetKey(key string) (v string)
func (*InvestUncheckedMapper) SaveKV ¶
func (ium *InvestUncheckedMapper) SaveKV(key string, value string)
func (*InvestUncheckedMapper) SetInvestUncheckeds ¶
func (ium *InvestUncheckedMapper) SetInvestUncheckeds(key []byte, i InvestUncheckeds)
Set 添加用户投资
type InvestUncheckeds ¶
type InvestUncheckeds []InvestUnchecked
type Investor ¶
type Investor struct { InvestorType string `json:"investorType"` // 投资者类型 author, originalAuthor, community, commonInvestor Address qbasetypes.Address `json:"address"` // 投资者地址 Invest qbasetypes.BigInt `json:"investad"` // 投资金额 Revenue qbasetypes.BigInt `json:"revenue"` // 投资收益 InvestTime time.Time `json:"investTime"` // 投资时间 }
Investor 投资者
type Investors ¶
type Investors []Investor
func ListInvestors ¶
func ListInvestors(ctx *context.CLIContext, cdc *amino.Codec, articleHash string) (Investors, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.