Skip to content

Commit 4f1a56e

Browse files
authored
feat: merge code from dev (#7750)
1 parent 3105737 commit 4f1a56e

File tree

228 files changed

+20201
-1599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+20201
-1599
lines changed

agent/app/api/v2/app.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import (
1212
// @Summary List apps
1313
// @Accept json
1414
// @Param request body request.AppSearch true "request"
15-
// @Success 200
15+
// @Success 200 {object} response.AppRes
1616
// @Security ApiKeyAuth
17+
// @Security Timestamp
1718
// @Router /apps/search [post]
1819
func (b *BaseApi) SearchApp(c *gin.Context) {
1920
var req request.AppSearch
@@ -32,6 +33,7 @@ func (b *BaseApi) SearchApp(c *gin.Context) {
3233
// @Summary Sync remote app list
3334
// @Success 200
3435
// @Security ApiKeyAuth
36+
// @Security Timestamp
3537
// @Router /apps/sync/remote [post]
3638
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"应用商店同步","formatEN":"App store synchronization"}
3739
func (b *BaseApi) SyncApp(c *gin.Context) {
@@ -56,13 +58,14 @@ func (b *BaseApi) SyncApp(c *gin.Context) {
5658
helper.InternalServer(c, err)
5759
return
5860
}
59-
helper.SuccessWithData(c, nil)
61+
helper.SuccessWithOutData(c)
6062
}
6163

6264
// @Tags App
6365
// @Summary Sync local app list
6466
// @Success 200
6567
// @Security ApiKeyAuth
68+
// @Security Timestamp
6669
// @Router /apps/sync/local [post]
6770
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"应用商店同步","formatEN":"App store synchronization"}
6871
func (b *BaseApi) SyncLocalApp(c *gin.Context) {
@@ -80,6 +83,7 @@ func (b *BaseApi) SyncLocalApp(c *gin.Context) {
8083
// @Param key path string true "app key"
8184
// @Success 200 {object} response.AppDTO
8285
// @Security ApiKeyAuth
86+
// @Security Timestamp
8387
// @Router /apps/:key [get]
8488
func (b *BaseApi) GetApp(c *gin.Context) {
8589
appKey, err := helper.GetStrParamByKey(c, "key")
@@ -103,6 +107,7 @@ func (b *BaseApi) GetApp(c *gin.Context) {
103107
// @Param version path string true "app 类型"
104108
// @Success 200 {object} response.AppDetailDTO
105109
// @Security ApiKeyAuth
110+
// @Security Timestamp
106111
// @Router /apps/detail/:appId/:version/:type [get]
107112
func (b *BaseApi) GetAppDetail(c *gin.Context) {
108113
appID, err := helper.GetIntParamByKey(c, "appId")
@@ -126,6 +131,7 @@ func (b *BaseApi) GetAppDetail(c *gin.Context) {
126131
// @Param appId path integer true "id"
127132
// @Success 200 {object} response.AppDetailDTO
128133
// @Security ApiKeyAuth
134+
// @Security Timestamp
129135
// @Router /apps/details/:id [get]
130136
func (b *BaseApi) GetAppDetailByID(c *gin.Context) {
131137
appDetailID, err := helper.GetIntParamByKey(c, "id")
@@ -144,8 +150,9 @@ func (b *BaseApi) GetAppDetailByID(c *gin.Context) {
144150
// @Tags App
145151
// @Summary Get Ignore App
146152
// @Accept json
147-
// @Success 200 {object} response.IgnoredApp
153+
// @Success 200 {array} response.IgnoredApp
148154
// @Security ApiKeyAuth
155+
// @Security Timestamp
149156
// @Router /apps/ignored [get]
150157
func (b *BaseApi) GetIgnoredApp(c *gin.Context) {
151158
res, err := appService.GetIgnoredApp()
@@ -162,6 +169,7 @@ func (b *BaseApi) GetIgnoredApp(c *gin.Context) {
162169
// @Param request body request.AppInstallCreate true "request"
163170
// @Success 200 {object} model.AppInstall
164171
// @Security ApiKeyAuth
172+
// @Security Timestamp
165173
// @Router /apps/install [post]
166174
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"安装应用 [name]","formatEN":"Install app [name]"}
167175
func (b *BaseApi) InstallApp(c *gin.Context) {
@@ -188,8 +196,9 @@ func (b *BaseApi) GetAppTags(c *gin.Context) {
188196

189197
// @Tags App
190198
// @Summary Get app list update
191-
// @Success 200
199+
// @Success 200 {object} response.AppUpdateRes
192200
// @Security ApiKeyAuth
201+
// @Security Timestamp
193202
// @Router /apps/checkupdate [get]
194203
func (b *BaseApi) GetAppListUpdate(c *gin.Context) {
195204
res, err := appService.GetAppUpdate()
@@ -206,6 +215,7 @@ func (b *BaseApi) GetAppListUpdate(c *gin.Context) {
206215
// @Param request body request.AppstoreUpdate true "request"
207216
// @Success 200
208217
// @Security ApiKeyAuth
218+
// @Security Timestamp
209219
// @Router /apps/store/update [post]
210220
func (b *BaseApi) UpdateAppstoreConfig(c *gin.Context) {
211221
var req request.AppstoreUpdate
@@ -224,6 +234,7 @@ func (b *BaseApi) UpdateAppstoreConfig(c *gin.Context) {
224234
// @Summary Get appstore config
225235
// @Success 200 {object} response.AppstoreConfig
226236
// @Security ApiKeyAuth
237+
// @Security Timestamp
227238
// @Router /apps/store/config [get]
228239
func (b *BaseApi) GetAppstoreConfig(c *gin.Context) {
229240
res, err := appService.GetAppstoreConfig()

agent/app/api/v2/app_install.go

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import (
1212
// @Summary Page app installed
1313
// @Accept json
1414
// @Param request body request.AppInstalledSearch true "request"
15-
// @Success 200
15+
// @Success 200 {object} dto.PageResult
1616
// @Security ApiKeyAuth
17+
// @Security Timestamp
1718
// @Router /apps/installed/search [post]
1819
func (b *BaseApi) SearchAppInstalled(c *gin.Context) {
1920
var req request.AppInstalledSearch
@@ -43,8 +44,9 @@ func (b *BaseApi) SearchAppInstalled(c *gin.Context) {
4344
// @Tags App
4445
// @Summary List app installed
4546
// @Accept json
46-
// @Success 200 array dto.AppInstallInfo
47+
// @Success 200 {array} dto.AppInstallInfo
4748
// @Security ApiKeyAuth
49+
// @Security Timestamp
4850
// @Router /apps/installed/list [get]
4951
func (b *BaseApi) ListAppInstalled(c *gin.Context) {
5052
list, err := appInstallService.GetInstallList()
@@ -61,6 +63,7 @@ func (b *BaseApi) ListAppInstalled(c *gin.Context) {
6163
// @Param request body request.AppInstalledInfo true "request"
6264
// @Success 200 {object} response.AppInstalledCheck
6365
// @Security ApiKeyAuth
66+
// @Security Timestamp
6467
// @Router /apps/installed/check [post]
6568
func (b *BaseApi) CheckAppInstalled(c *gin.Context) {
6669
var req request.AppInstalledInfo
@@ -81,6 +84,7 @@ func (b *BaseApi) CheckAppInstalled(c *gin.Context) {
8184
// @Param request body dto.OperationWithNameAndType true "request"
8285
// @Success 200 {integer} port
8386
// @Security ApiKeyAuth
87+
// @Security Timestamp
8488
// @Router /apps/installed/loadport [post]
8589
func (b *BaseApi) LoadPort(c *gin.Context) {
8690
var req dto.OperationWithNameAndType
@@ -99,8 +103,9 @@ func (b *BaseApi) LoadPort(c *gin.Context) {
99103
// @Summary Search app password by key
100104
// @Accept json
101105
// @Param request body dto.OperationWithNameAndType true "request"
102-
// @Success 200 {string} response.DatabaseConn
106+
// @Success 200 {object} response.DatabaseConn
103107
// @Security ApiKeyAuth
108+
// @Security Timestamp
104109
// @Router /apps/installed/conninfo/:key [get]
105110
func (b *BaseApi) LoadConnInfo(c *gin.Context) {
106111
var req dto.OperationWithNameAndType
@@ -121,6 +126,7 @@ func (b *BaseApi) LoadConnInfo(c *gin.Context) {
121126
// @Param appInstallId path integer true "App install id"
122127
// @Success 200 {array} dto.AppResource
123128
// @Security ApiKeyAuth
129+
// @Security Timestamp
124130
// @Router /apps/installed/delete/check/:appInstallId [get]
125131
func (b *BaseApi) DeleteCheck(c *gin.Context) {
126132
appInstallId, err := helper.GetIntParamByKey(c, "appInstallId")
@@ -141,14 +147,15 @@ func (b *BaseApi) DeleteCheck(c *gin.Context) {
141147
// @Summary Sync app installed
142148
// @Success 200
143149
// @Security ApiKeyAuth
150+
// @Security Timestamp
144151
// @Router /apps/installed/sync [post]
145152
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"同步已安装应用列表","formatEN":"Sync the list of installed apps"}
146153
func (b *BaseApi) SyncInstalled(c *gin.Context) {
147154
if err := appInstallService.SyncAll(false); err != nil {
148155
helper.InternalServer(c, err)
149156
return
150157
}
151-
helper.SuccessWithData(c, "")
158+
helper.SuccessWithOutData(c)
152159
}
153160

154161
// @Tags App
@@ -157,6 +164,7 @@ func (b *BaseApi) SyncInstalled(c *gin.Context) {
157164
// @Param request body request.AppInstalledOperate true "request"
158165
// @Success 200
159166
// @Security ApiKeyAuth
167+
// @Security Timestamp
160168
// @Router /apps/installed/op [post]
161169
// @x-panel-log {"bodyKeys":["installId","operate"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"installId","isList":false,"db":"app_installs","output_column":"app_id","output_value":"appId"},{"input_column":"id","input_value":"installId","isList":false,"db":"app_installs","output_column":"name","output_value":"appName"},{"input_column":"id","input_value":"appId","isList":false,"db":"apps","output_column":"key","output_value":"appKey"}],"formatZH":"[operate] 应用 [appKey][appName]","formatEN":"[operate] App [appKey][appName]"}
162170
func (b *BaseApi) OperateInstalled(c *gin.Context) {
@@ -168,7 +176,7 @@ func (b *BaseApi) OperateInstalled(c *gin.Context) {
168176
helper.InternalServer(c, err)
169177
return
170178
}
171-
helper.SuccessWithData(c, nil)
179+
helper.SuccessWithOutData(c)
172180
}
173181

174182
// @Tags App
@@ -177,6 +185,7 @@ func (b *BaseApi) OperateInstalled(c *gin.Context) {
177185
// @Param key path string true "request"
178186
// @Success 200 {array} response.AppService
179187
// @Security ApiKeyAuth
188+
// @Security Timestamp
180189
// @Router /apps/services/:key [get]
181190
func (b *BaseApi) GetServices(c *gin.Context) {
182191
key := c.Param("key")
@@ -194,6 +203,7 @@ func (b *BaseApi) GetServices(c *gin.Context) {
194203
// @Param appInstallId path integer true "request"
195204
// @Success 200 {array} dto.AppVersion
196205
// @Security ApiKeyAuth
206+
// @Security Timestamp
197207
// @Router /apps/installed/update/versions [post]
198208
func (b *BaseApi) GetUpdateVersions(c *gin.Context) {
199209
var req request.AppUpdateVersion
@@ -214,6 +224,7 @@ func (b *BaseApi) GetUpdateVersions(c *gin.Context) {
214224
// @Param request body request.PortUpdate true "request"
215225
// @Success 200
216226
// @Security ApiKeyAuth
227+
// @Security Timestamp
217228
// @Router /apps/installed/port/change [post]
218229
// @x-panel-log {"bodyKeys":["key","name","port"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"应用端口修改 [key]-[name] => [port]","formatEN":"Application port update [key]-[name] => [port]"}
219230
func (b *BaseApi) ChangeAppPort(c *gin.Context) {
@@ -225,7 +236,7 @@ func (b *BaseApi) ChangeAppPort(c *gin.Context) {
225236
helper.InternalServer(c, err)
226237
return
227238
}
228-
helper.SuccessWithData(c, nil)
239+
helper.SuccessWithOutData(c)
229240
}
230241

231242
// @Tags App
@@ -234,6 +245,7 @@ func (b *BaseApi) ChangeAppPort(c *gin.Context) {
234245
// @Param request body dto.OperationWithNameAndType true "request"
235246
// @Success 200 {string} content
236247
// @Security ApiKeyAuth
248+
// @Security Timestamp
237249
// @Router /apps/installed/conf [post]
238250
func (b *BaseApi) GetDefaultConfig(c *gin.Context) {
239251
var req dto.OperationWithNameAndType
@@ -253,8 +265,9 @@ func (b *BaseApi) GetDefaultConfig(c *gin.Context) {
253265
// @Summary Search params by appInstallId
254266
// @Accept json
255267
// @Param appInstallId path string true "request"
256-
// @Success 200 {object} response.AppParam
268+
// @Success 200 {object} response.AppConfig
257269
// @Security ApiKeyAuth
270+
// @Security Timestamp
258271
// @Router /apps/installed/params/:appInstallId [get]
259272
func (b *BaseApi) GetParams(c *gin.Context) {
260273
appInstallId, err := helper.GetIntParamByKey(c, "appInstallId")
@@ -276,6 +289,7 @@ func (b *BaseApi) GetParams(c *gin.Context) {
276289
// @Param request body request.AppInstalledUpdate true "request"
277290
// @Success 200
278291
// @Security ApiKeyAuth
292+
// @Security Timestamp
279293
// @Router /apps/installed/params/update [post]
280294
// @x-panel-log {"bodyKeys":["installId"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"应用参数修改 [installId]","formatEN":"Application param update [installId]"}
281295
func (b *BaseApi) UpdateInstalled(c *gin.Context) {
@@ -287,7 +301,7 @@ func (b *BaseApi) UpdateInstalled(c *gin.Context) {
287301
helper.InternalServer(c, err)
288302
return
289303
}
290-
helper.SuccessWithData(c, nil)
304+
helper.SuccessWithOutData(c)
291305
}
292306

293307
// @Tags App
@@ -296,6 +310,7 @@ func (b *BaseApi) UpdateInstalled(c *gin.Context) {
296310
// @Param request body request.AppInstalledIgnoreUpgrade true "request"
297311
// @Success 200
298312
// @Security ApiKeyAuth
313+
// @Security Timestamp
299314
// @Router /apps/installed/ignore [post]
300315
// @x-panel-log {"bodyKeys":["installId"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"忽略应用 [installId] 版本升级","formatEN":"Application param update [installId]"}
301316
func (b *BaseApi) IgnoreUpgrade(c *gin.Context) {
@@ -316,6 +331,7 @@ func (b *BaseApi) IgnoreUpgrade(c *gin.Context) {
316331
// @Param request body request.AppConfigUpdate true "request"
317332
// @Success 200
318333
// @Security ApiKeyAuth
334+
// @Security Timestamp
319335
// @Router /apps/installed/config/update [post]
320336
// @x-panel-log {"bodyKeys":["installID","webUI"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"应用配置更新 [installID]","formatEN":"Application config update [installID]"}
321337
func (b *BaseApi) UpdateAppConfig(c *gin.Context) {

0 commit comments

Comments
 (0)