-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestful.go
More file actions
132 lines (123 loc) · 2.43 KB
/
Copy pathrestful.go
File metadata and controls
132 lines (123 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
package plugin_go
/*
get请求对象
*/
type GetModel struct {
RestfulModel
//请求头
Header any `json:"header,omitempty"`
}
/*
post请求对象
*/
type PostModel struct {
RestfulModel
//请求头
Header any `json:"header,omitempty"`
//请求体
Body any `json:"body,omitempty"`
//请求表单
Form any `json:"form,omitempty"`
//请求post表单
PostForm any `json:"post_form,omitempty"`
//请求post文件
FileList []FormFile `json:"file_list,omitempty"`
}
/*
put请求对象
*/
type PutModel struct {
RestfulModel
//请求头
Header any `json:"header,omitempty"`
//请求体
Body any `json:"body,omitempty"`
//请求表单
Form any `json:"form,omitempty"`
//请求post表单
PostForm any `json:"post_form,omitempty"`
//请求post文件
FileList []FormFile `json:"file_list,omitempty"`
}
/*
delete请求对象
*/
type DeleteModel struct {
RestfulModel
//请求头
Header any `json:"header,omitempty"`
//请求体
Body any `json:"body,omitempty"`
}
/*
基础请求
*/
type RestfulModel struct {
//请求url
Url string `json:"url"`
//请求方式
Method string `json:"method"`
}
/*
表单文件对象
*/
type FormFile struct {
//文件名
FileName string `json:"file_name"`
//文件base64字符串
FileData string `json:"file_data"`
//文件后缀名
FileSuffix string `json:"file_suffix"`
}
/*------插件对象存储数据模型-----*/
/*
插件对象
*/
type DataPlugin struct {
//插件id
ID int `json:"id"`
//插件名称
PluginName string `json:"plugin_name"`
//插件logo
PluginLogo string `json:"plugin_logo"`
//插件路径
PluginPath string `json:"plugin_path"`
//插件描述
PluginDescribe string `json:"plugin_describe"`
//插件接口列表
APIList []DataAPIList `json:"api_list"`
//插件状态 -1卸载,0安装,1启用
PluginStatus int `json:"plugin_status"`
//插件创建日期
CreateTime string `json:"create_time"`
}
/*
插件接口对象
*/
type DataAPIList struct {
//接口id
ID int `json:"id"`
//接口名称
ApiName string `json:"api_name"`
//接口描述
ApiDescribe string `json:"api_describe"`
//函数名称
FuncName string `json:"func_name"`
//接口路由
URL string `json:"url"`
//接口请求方式
Method string `json:"method"`
//接口创建日期
CreateTime string `json:"create_time"`
}
/*
插件返回对象
*/
type RwJson struct {
//状态码
Code int `json:"code"`
//状态信息
Msg string `json:"msg"`
//返回数据对象
Data any `json:"data,omitempty"`
}