至信SDK
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.8 KiB

package constant
var (
RESP_SUCC *RetBase
RESP_FAIL *RetBase
RESP_PARAM_ERROR *RetBase
RESP_HTTP_REQ_ERROR *RetBase
JSON_UNMARSHAL_ERROR *RetBase
SM3HASH_ERROR *RetBase
SIGNATURE_ERROR *RetBase
EVIDENCE_DATA_EMPTY_ERROR *RetBase
SECRET_KEY_EMPTY_ERROR *RetBase
SECRET_ID_EMPTY_ERROR *RetBase
PRIVATE_KEY_FORMAT_ERROR *RetBase
KVKEY_CANNOT_BE_EMPTY_ERROR *RetBase
KVVALUE_CANNOT_BE_EMPTY_ERROR *RetBase
OPERATE_ID_CANNOT_BE_EMPTY_ERROR *RetBase
TXID_CANNOT_BE_EMPTY_ERROR *RetBase
EVID_CANNOT_BE_EMPTY_ERROR *RetBase
QUERY_EVSAVE_ERROR *RetBase
)
func init() {
RESP_SUCC = Build(0, "请求成功")
RESP_FAIL = Build(0xFFFF, "请求失败")
RESP_PARAM_ERROR = Build(10, "参数错误")
JSON_UNMARSHAL_ERROR = Build(39, "json反序列化失败")
RESP_HTTP_REQ_ERROR = Build(102, "Http请求失败")
QUERY_EVSAVE_ERROR = Build(16008, "查询存证失败")
SM3HASH_ERROR = Build(1000001, "SM3哈希计算失败")
SIGNATURE_ERROR = Build(1000002, "私钥签名失败")
EVIDENCE_DATA_EMPTY_ERROR = Build(1000003, "存证数据为空")
SECRET_KEY_EMPTY_ERROR = Build(1000004, "SecretKey为空")
SECRET_ID_EMPTY_ERROR = Build(1000005, "SecretId为空")
PRIVATE_KEY_FORMAT_ERROR = Build(1000006, "私钥格式错误")
KVKEY_CANNOT_BE_EMPTY_ERROR = Build(1000007, "KVKey不能为空")
KVVALUE_CANNOT_BE_EMPTY_ERROR = Build(1000008, "KVValue不能为空")
OPERATE_ID_CANNOT_BE_EMPTY_ERROR = Build(1000009, "OperateId不能为空")
TXID_CANNOT_BE_EMPTY_ERROR = Build(1000010, "TxId不能为空")
EVID_CANNOT_BE_EMPTY_ERROR = Build(1000011, "EvId不能为空")
}
func Build(retCode int, retMsg string) *RetBase {
return &RetBase{
RetCode: retCode,
RetMsg: retMsg,
}
}