增加响应状态码判断 + 配置的默认值处理
This commit is contained in:
17
define.go
17
define.go
@ -13,14 +13,15 @@ package rpc
|
||||
//
|
||||
// Date : 14:08 2022/6/29
|
||||
type Service struct {
|
||||
Flag string `json:"flag" yaml:"flag"` // 服务标识, 全局唯一
|
||||
Domain string `json:"domain" yaml:"domain"` // 域名服务
|
||||
CodeField string `json:"code_field" yaml:"code_field"` // 状态码字段
|
||||
MessageField string `json:"message_field" yaml:"message_field"` // 消息字段
|
||||
DataField string `json:"data_field" yaml:"data_field"` // 数据字段
|
||||
SuccessCodeList []string `json:"success_code_list" yaml:"success_code_list"` // 成功的值
|
||||
ApiTable map[string]*Api `json:"api_table" yaml:"api_table"` // api列表
|
||||
ApiRetry ApiRetry `json:"api_retry" yaml:"api_retry"` // 重试策略
|
||||
Flag string `json:"flag" yaml:"flag"` // 服务标识, 全局唯一
|
||||
Domain string `json:"domain" yaml:"domain"` // 域名服务
|
||||
CodeField string `json:"code_field" yaml:"code_field"` // 状态码字段
|
||||
MessageField string `json:"message_field" yaml:"message_field"` // 消息字段
|
||||
DataField string `json:"data_field" yaml:"data_field"` // 数据字段
|
||||
SuccessCodeList []string `json:"success_code_list" yaml:"success_code_list"` // 成功的值
|
||||
SuccessHttpCodeList []int `json:"success_http_code_list" yaml:"success_http_code_list"` // 任务成功的http状态码, 不配置默认只有200(优先级高, 会覆盖)
|
||||
ApiTable map[string]*Api `json:"api_table" yaml:"api_table"` // api列表
|
||||
ApiRetry ApiRetry `json:"api_retry" yaml:"api_retry"` // 重试策略
|
||||
}
|
||||
|
||||
// Api 接口的数据结构
|
||||
|
Reference in New Issue
Block a user