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