param_block_chain.go 1005 字节
package allied_creation_user

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