Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agent/app/api/v2/app_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func (b *BaseApi) GetParams(c *gin.Context) {
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/params/update [post]
// @x-panel-log {"bodyKeys":["installId"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"应用参数修改 [installId]","formatEN":"Application param update [installId]"}
// @x-panel-log {"bodyKeys":["installId"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"installId","isList":false,"db":"app_installs","output_column":"name","output_value":"name"}],"formatZH":"应用参数修改 [name]","formatEN":"Application param update [name]"}
func (b *BaseApi) UpdateInstalled(c *gin.Context) {
var req request.AppInstalledUpdate
if err := helper.CheckBindAndValidate(&req, c); err != nil {
Expand Down
7 changes: 4 additions & 3 deletions core/cmd/server/docs/swagger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ func TestGenerateXlog(t *testing.T) {
logContent := ""
for _, comment := range d.Doc.List {
if strings.HasPrefix(comment.Text, "// @Router") {
routerContent = replaceStr(comment.Text, "// @Router", "[post]", "[get]", " ")
routerContent = replaceStr(comment.Text, "// @Router", "[post]", "[get]")
}
if strings.HasPrefix(comment.Text, "// @x-panel-log") {
logContent = replaceStr(comment.Text, "// @x-panel-log", " ")
logContent = replaceStr(comment.Text, "// @x-panel-log")
}
}
if len(routerContent) != 0 && len(logContent) != 0 {
var item operationJson
if err := json.Unmarshal([]byte(logContent), &item); err != nil {
panic(fmt.Sprintf("json unamrshal failed, err: %v", err))
panic(fmt.Sprintf("json unmarshal failed, err: %v", err))
}
xlogMap[routerContent] = item
}
Expand Down Expand Up @@ -186,6 +186,7 @@ func replaceStr(val string, rep ...string) string {
for _, item := range rep {
val = strings.ReplaceAll(val, item, "")
}
val = strings.TrimSpace(val)
return val
}

Expand Down
Loading
Loading