请求类型枚举值定义
This commit is contained in:
parent
1f5050978f
commit
325efde765
38
enums/data_location.go
Normal file
38
enums/data_location.go
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
// Package enums ...
|
||||||
|
//
|
||||||
|
// Description : enums ...
|
||||||
|
//
|
||||||
|
// Author : go_developer@163.com<白茶清欢>
|
||||||
|
//
|
||||||
|
// Date : 2024-11-25 14:39
|
||||||
|
package enums
|
||||||
|
|
||||||
|
// RequestDataLocation 请求数据所在位置
|
||||||
|
//
|
||||||
|
// Author : go_developer@163.com<白茶清欢>
|
||||||
|
//
|
||||||
|
// Date : 14:40 2024/11/25
|
||||||
|
type RequestDataLocation string
|
||||||
|
|
||||||
|
func (rdl RequestDataLocation) String() string {
|
||||||
|
return string(rdl)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rdl RequestDataLocation) MarshalJSON() ([]byte, error) {
|
||||||
|
return []byte(rdl.String()), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ResponseDataLocation 响应数据所在位置
|
||||||
|
//
|
||||||
|
// Author : go_developer@163.com<白茶清欢>
|
||||||
|
//
|
||||||
|
// Date : 14:41 2024/11/25
|
||||||
|
type ResponseDataLocation string
|
||||||
|
|
||||||
|
func (rdl ResponseDataLocation) String() string {
|
||||||
|
return string(rdl)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rdl ResponseDataLocation) MarshalJSON() ([]byte, error) {
|
||||||
|
return []byte(rdl.String()), nil
|
||||||
|
}
|
39
request.go
39
request.go
@ -7,30 +7,37 @@
|
|||||||
// Date : 2024-04-22 11:04
|
// Date : 2024-04-22 11:04
|
||||||
package consts
|
package consts
|
||||||
|
|
||||||
|
import "git.zhangdeman.cn/zhangdeman/consts/enums"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
RequestDataLocationHeader = "HEADER" // header
|
RequestDataLocationHeader enums.RequestDataLocation = "HEADER" // header
|
||||||
RequestDataLocationCookie = "COOKIE" // cookie
|
RequestDataLocationCookie enums.RequestDataLocation = "COOKIE" // cookie
|
||||||
RequestDataLocationBody = "BODY" // body
|
RequestDataLocationBody enums.RequestDataLocation = "BODY" // body
|
||||||
RequestDataLocationQuery = "QUERY" // query
|
RequestDataLocationQuery enums.RequestDataLocation = "QUERY" // query
|
||||||
RequestDataLocationUriPath = "URI_PATH" // uri路由一部分
|
RequestDataLocationUriPath enums.RequestDataLocation = "URI_PATH" // uri路由一部分
|
||||||
RequestDataLocationStatic = "STATIC" // 静态配置的参数
|
RequestDataLocationStatic enums.RequestDataLocation = "STATIC" // 静态配置的参数
|
||||||
RequestDataLocationCustomConfig = "CUSTOM_CONFIG" // 针对接口的一些自定义配置规则
|
RequestDataLocationCustomConfig enums.RequestDataLocation = "CUSTOM_CONFIG" // 针对接口的一些自定义配置规则
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ResponseDataLocationHeader = "HEADER" // header
|
ResponseDataLocationHeader enums.ResponseDataLocation = "HEADER" // header
|
||||||
ResponseDataLocationCookie = "COOKIE" // cookie
|
ResponseDataLocationCookie enums.ResponseDataLocation = "COOKIE" // cookie
|
||||||
ResponseDataLocationBody = "BODY" // body
|
ResponseDataLocationBody enums.ResponseDataLocation = "BODY" // body
|
||||||
ResponseDataLocationExtension = "EXTENSION" // 扩展信息
|
ResponseDataLocationExtension enums.ResponseDataLocation = "EXTENSION" // 扩展信息
|
||||||
)
|
)
|
||||||
|
|
||||||
type DataLocationDesc struct {
|
type RequestDataLocationDesc struct {
|
||||||
Value string `json:"value"` // 数据位置
|
Value enums.RequestDataLocation `json:"value"` // 数据位置
|
||||||
Description string `json:"description"` // 数据位置描述
|
Description string `json:"description"` // 数据位置描述
|
||||||
|
}
|
||||||
|
|
||||||
|
type ResponseDataLocationDesc struct {
|
||||||
|
Value enums.ResponseDataLocation `json:"value"` // 数据位置
|
||||||
|
Description string `json:"description"` // 数据位置描述
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
RequestDataLocationList = []DataLocationDesc{
|
RequestDataLocationList = []RequestDataLocationDesc{
|
||||||
{Value: RequestDataLocationHeader, Description: "请求header"},
|
{Value: RequestDataLocationHeader, Description: "请求header"},
|
||||||
{Value: RequestDataLocationCookie, Description: "请求cookie"},
|
{Value: RequestDataLocationCookie, Description: "请求cookie"},
|
||||||
{Value: RequestDataLocationBody, Description: "请求body"},
|
{Value: RequestDataLocationBody, Description: "请求body"},
|
||||||
@ -39,7 +46,7 @@ var (
|
|||||||
{Value: RequestDataLocationStatic, Description: "静态参数配置"},
|
{Value: RequestDataLocationStatic, Description: "静态参数配置"},
|
||||||
{Value: RequestDataLocationCustomConfig, Description: "自定义接口处理规则"},
|
{Value: RequestDataLocationCustomConfig, Description: "自定义接口处理规则"},
|
||||||
}
|
}
|
||||||
ResponseDataLocationList = []DataLocationDesc{
|
ResponseDataLocationList = []ResponseDataLocationDesc{
|
||||||
{Value: ResponseDataLocationHeader, Description: "响应header"},
|
{Value: ResponseDataLocationHeader, Description: "响应header"},
|
||||||
{Value: ResponseDataLocationCookie, Description: "响应cookie"},
|
{Value: ResponseDataLocationCookie, Description: "响应cookie"},
|
||||||
{Value: ResponseDataLocationBody, Description: "响应body"},
|
{Value: ResponseDataLocationBody, Description: "响应body"},
|
||||||
|
Loading…
Reference in New Issue
Block a user