RPC增加数据mock能力

This commit is contained in:
2022-10-14 14:54:20 +08:00
parent cc32decb80
commit b6aaa49ab6
5 changed files with 87 additions and 35 deletions

View File

@ -16,6 +16,8 @@ type Service struct {
Flag string `json:"flag" yaml:"flag" ini:"flag"` // 服务标识, 全局唯一
Description string `json:"description" yaml:"description" ini:"description"` // 服务描述
Domain string `json:"domain" yaml:"domain" ini:"domain"` // 域名服务
MockEnable bool `json:"mock_enable" yaml:"mock_enable" ini:"mock_enable"` // 是否可用mock,默认false
MockPath string `json:"mock_path" yaml:"mock_path" ini:"mock_path"` // mock数据的存储路径,不配置默认为 ./{service_flag}
CodeField string `json:"code_field" yaml:"code_field" ini:"code_field"` // 状态码字段
MessageField string `json:"message_field" yaml:"message_field" ini:"message_field"` // 消息字段
DataField string `json:"data_field" yaml:"data_field" ini:"data_field"` // 数据字段
@ -32,6 +34,7 @@ type Service struct {
// Date : 14:18 2022/6/29
type Api struct {
Flag string `json:"flag" yaml:"flag" ini:"flag"` // URI标识
MockEnable bool `json:"mock_enable" yaml:"mock_enable" ini:"mock_enable"` // 当前接口是否可用mock服务
Description string `json:"description" yaml:"description" ini:"description"` // 接口描述
URI string `json:"uri" yaml:"uri" ini:"uri"` // 接口地址
Method string `json:"method" yaml:"method" ini:"method"` // 请求方法 GET / POST / PUT 等