49 lines
1.9 KiB
Go
49 lines
1.9 KiB
Go
// Package consts ...
|
|
//
|
|
// Description : consts ...
|
|
//
|
|
// Author : go_developer@163.com<白茶清欢>
|
|
//
|
|
// Date : 2024-04-22 11:04
|
|
package consts
|
|
|
|
const (
|
|
RequestDataLocationHeader = "HEADER" // header
|
|
RequestDataLocationCookie = "COOKIE" // cookie
|
|
RequestDataLocationBody = "BODY" // body
|
|
RequestDataLocationQuery = "QUERY" // query
|
|
RequestDataLocationUriPath = "URI_PATH" // uri路由一部分
|
|
RequestDataLocationStatic = "STATIC" // 静态配置的参数
|
|
RequestDataLocationCustomConfig = "CUSTOM_CONFIG" // 针对接口的一些自定义配置规则
|
|
)
|
|
|
|
const (
|
|
ResponseDataLocationHeader = "HEADER" // header
|
|
ResponseDataLocationCookie = "COOKIE" // cookie
|
|
ResponseDataLocationBody = "BODY" // body
|
|
ResponseDataLocationExtension = "EXTENSION" // 扩展信息
|
|
)
|
|
|
|
type DataLocationDesc struct {
|
|
Value string `json:"value"` // 数据位置
|
|
Description string `json:"description"` // 数据位置描述
|
|
}
|
|
|
|
var (
|
|
RequestDataLocationList = []DataLocationDesc{
|
|
{Value: RequestDataLocationHeader, Description: "请求header"},
|
|
{Value: RequestDataLocationCookie, Description: "请求cookie"},
|
|
{Value: RequestDataLocationBody, Description: "请求body"},
|
|
{Value: RequestDataLocationQuery, Description: "请求query"},
|
|
{Value: RequestDataLocationUriPath, Description: "请求uri_path"},
|
|
{Value: RequestDataLocationStatic, Description: "静态参数配置"},
|
|
{Value: RequestDataLocationCustomConfig, Description: "自定义接口处理规则"},
|
|
}
|
|
ResponseDataLocationList = []DataLocationDesc{
|
|
{Value: ResponseDataLocationHeader, Description: "响应header"},
|
|
{Value: ResponseDataLocationCookie, Description: "响应cookie"},
|
|
{Value: ResponseDataLocationBody, Description: "响应body"},
|
|
{Value: ResponseDataLocationExtension, Description: "响应扩展数据"},
|
|
}
|
|
)
|