github.com/sixexorg/magnetic-ring@v0.0.0-20191119090307-31705a21e419/central/entity/entity.go (about)

     1  package entity
     2  
     3  import (
     4  	"github.com/sixexorg/magnetic-ring/common"
     5  	"github.com/sixexorg/magnetic-ring/core/orgchain/types"
     6  	"math/big"
     7  	"time"
     8  )
     9  
    10  type VoteUnit struct {
    11  	Type           types.TransactionType `json:"type"`
    12  	HostAddress    string        `json:"host_address"`
    13  	EndBlockHeight uint64                `json:"end_block_height"`
    14  	VoteId         string           `json:"vote_id"`
    15  
    16  	Account string `json:"account"`
    17  	VoteReply  uint8 `json:"vote_reply"`
    18  	Quntity uint64 `json:"quntity"`
    19  }
    20  
    21  type VoteDetail struct {
    22  	Id        string `json:"id"`
    23  	MetaBox   uint64 `json:"meta_box"`
    24  	Hoster    string `json:"hoster"`
    25  	UtBefore  uint64 `json:"ut_before"`
    26  	Msg       string `json:"msg"`
    27  	EndHeight uint64 `bson:"endheight" json:"end_height"`
    28  
    29  	MyUt  uint64 `bson:"-" json:"my_ut"`
    30  	State bool   `bson:"-" json:"state"`
    31  	IfIVoted bool `json:"if_i_voted"`
    32  
    33  	AgreePer   float64 `bson:"-" json:"agree_per"`
    34  	AgainstPer float64 `bson:"-" json:"against_per"`
    35  	GiveUpPer  float64 `bson:"-" json:"give_up_per"`
    36  }
    37  
    38  func NewVoteUnit(tp types.TransactionType, hostAddr common.Address, endH uint64, voteId string,account string,reply uint8,quntity uint64) *VoteUnit {
    39  	return &VoteUnit{tp, hostAddr.ToString(), endH, voteId,account,reply,quntity}
    40  }
    41  
    42  type LeagueHeightor struct {
    43  	Id     string `json:"id"`
    44  	Height uint64 `bson:"height"`
    45  }
    46  
    47  type OrgTxDto struct {
    48  	Id              string                `json:"id"`
    49  	TxType          types.TransactionType `json:"tx_type"`
    50  	TransactionHash common.Hash           `json:"transaction_hash"`
    51  	BlockTime       uint64                `json:"block_time"`
    52  	TxData          *OrgTransferDataDto   `json:"tx_data"`
    53  }
    54  
    55  type OrgTransferDataDto struct {
    56  	From   common.Address `json:"from"`
    57  	Froms  *common.TxIns  `json:"froms"`
    58  	Tos    *common.TxOuts `json:"tos"`
    59  	Msg    common.Hash    `json:"msg"`
    60  	Amount uint64         `json:"amount"`
    61  	Fee    *big.Int       `json:"fee"`
    62  	Energy   *big.Int       `json:"b_gas"`
    63  }
    64  
    65  type OrgChatDto struct {
    66  	Id        string                `json:"id"`
    67  	Account   string                `json:"account"`
    68  	Type      types.TransactionType `json:"type"`
    69  	Msg       string                `json:"msg"`
    70  	Hash      string                `json:"hash"`
    71  	Status    bool                  `json:"status"`
    72  	Result    int                   `json:"result"`
    73  	BlockTime time.Time             `bson:"blockTime" json:"block_time"`
    74  
    75  }
    76  
    77  type Member struct {
    78  	Addr string `json:"addr"`
    79  }