Documentation
¶
Index ¶
- func GetHospitals(form Form, limitStr string, pageStr string) ([]map[string]string, int, error)
- func GetIdFromOwnerAndName(owner string, name string, separator string) string
- func GetOwnerAndNameFromId(id string, separator string) (string, string, error)
- func GetPatients(form Form, limitStr string, pageStr string) ([]map[string]string, int, error)
- type ChainConfig
- type ChainmakerInfo
- type ChainmakerTxInfo
- type Form
- type FormItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHospitals ¶
GetHospitals returns 24 hardcoded hospital records based on the expected form structure. Supports pagination via limitStr and pageStr.
func GetIdFromOwnerAndName ¶
func GetOwnerAndNameFromId ¶
func GetPatients ¶
GetPatients generates mock patient data based on the provided form definition. It returns paginated data according to limitStr and pageStr.
Parameters: - form: The form definition containing form items used to generate data fields. - limitStr: A string representing the number of records per page. - pageStr: A string representing the current page number.
Returns: - A slice of map[string]string representing the patient records. - The total number of records (always 100 for now). - An error if limitStr or pageStr cannot be parsed as integers.
Types ¶
type ChainConfig ¶
type ChainConfig struct {
ChainId string `json:"chain_id"`
OrgId string `json:"org_id"`
UserKey string `json:"user_key"`
UserCert string `json:"user_cert"`
SignKey string `json:"sign_key"`
SignCert string `json:"sign_cert"`
NodeAddr string `json:"node_addr"`
TLSHostName string `json:"tls_host_name"`
AuthType string `json:"auth_type"`
EnableTLS bool `json:"enable_tls"`
CACert string `json:"ca_cert"`
}
type ChainmakerInfo ¶
type ChainmakerInfo struct {
ChainConfig ChainConfig `json:"chain_config"`
ContractName string `json:"contract_name"`
ContractMethod string `json:"contract_method"`
Data string `json:"data"`
TxId string `json:"txId"`
}
type ChainmakerTxInfo ¶
type ChainmakerTxInfo struct {
TxId string `json:"tx_id"`
Block string `json:"block"`
BlockHash string `json:"block_hash"`
Result string `json:"result"`
}
func InvokeContract ¶
func InvokeContract(chainmakerInfo ChainmakerInfo) (ChainmakerTxInfo, error)
func QueryContract ¶
func QueryContract(chainmakerInfo ChainmakerInfo) (ChainmakerTxInfo, error)
type Form ¶
type Form struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Position string `xorm:"varchar(100)" json:"position"`
FormItems []*FormItem `xorm:"varchar(5000)" json:"formItems"`
}