审查视图

pkg/infrastructure/service_gateway/allied_creation_user/param_block_chain.go 1005 字节
yangfu authored
1 2 3 4 5 6 7 8
package allied_creation_user

type (
	ReqListBlockChain struct {
		DisableLimit            bool     `json:"disableLimit"`
		EnableDistinctPrimaryID bool     `json:"enableDistinctPrimaryId"`
		PrimaryIDList           []string `json:"primaryIdList"`
		Source                  string   `json:"source"`
yangfu authored
9 10
		// 禁用标识
		Disable bool `json:"-"`
yangfu authored
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
	}
	DataListBlockChain     []DataListBlockChainItem
	DataListBlockChainItem struct {
		UpChainID int    `json:"upChainId"`
		PrimaryID string `json:"primaryId"`
		BlockHash string `json:"blockHash"`
	}

	ReqBlockChainToken struct {
		Type      int `json:"type"`
		UpChainID int `json:"upChainId"`
	}
	DataBlockChainToken struct {
		BrowseURL string `json:"browseUrl"`
		Token     string `json:"token"`
	}
)

func (d DataListBlockChain) ToMap() map[string]DataListBlockChainItem {
	mapItems := make(map[string]DataListBlockChainItem)
	if d == nil || len(d) == 0 {
		return mapItems
	}
	for i := range d {
		mapItems[(d[i]).PrimaryID] = d[i]
	}
	return mapItems
}