param_block_chain.go 961 字节
package allied_creation_user

type (
	ReqListBlockChain struct {
		DisableLimit            bool     `json:"disableLimit"`
		EnableDistinctPrimaryID bool     `json:"enableDistinctPrimaryId"`
		PrimaryIDList           []string `json:"primaryIdList"`
		Source                  string   `json:"source"`
	}
	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
}