Skip to content

Commit

Permalink
update func
Browse files Browse the repository at this point in the history
  • Loading branch information
fuwx295 committed Oct 16, 2024
1 parent dd94d3b commit ecc0bb6
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ const docTemplate = `{
}
},
"/api/log/other/delete": {
"post": {
"delete": {
"description": "移除外部日志表",
"consumes": [
"application/json"
Expand Down Expand Up @@ -933,10 +933,10 @@ const docTemplate = `{
}
},
"/api/log/other/table": {
"post": {
"get": {
"description": "获取外部日志表信息",
"consumes": [
"application/json"
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
Expand Down Expand Up @@ -1053,7 +1053,7 @@ const docTemplate = `{
}
},
"/api/log/rule/delete": {
"post": {
"delete": {
"description": "删除日志表解析规则",
"consumes": [
"application/json"
Expand Down
8 changes: 4 additions & 4 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@
}
},
"/api/log/other/delete": {
"post": {
"delete": {
"description": "移除外部日志表",
"consumes": [
"application/json"
Expand Down Expand Up @@ -925,10 +925,10 @@
}
},
"/api/log/other/table": {
"post": {
"get": {
"description": "获取外部日志表信息",
"consumes": [
"application/json"
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
Expand Down Expand Up @@ -1045,7 +1045,7 @@
}
},
"/api/log/rule/delete": {
"post": {
"delete": {
"description": "删除日志表解析规则",
"consumes": [
"application/json"
Expand Down
8 changes: 4 additions & 4 deletions backend/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2663,7 +2663,7 @@ paths:
tags:
- API.log
/api/log/other/delete:
post:
delete:
consumes:
- application/json
description: 移除外部日志表
Expand All @@ -2689,9 +2689,9 @@ paths:
tags:
- API.log
/api/log/other/table:
post:
get:
consumes:
- application/json
- application/x-www-form-urlencoded
description: 获取外部日志表信息
parameters:
- description: 请求信息
Expand Down Expand Up @@ -2767,7 +2767,7 @@ paths:
tags:
- API.log
/api/log/rule/delete:
post:
delete:
consumes:
- application/json
description: 删除日志表解析规则
Expand Down
2 changes: 1 addition & 1 deletion backend/pkg/api/log/func_deleteothertable.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// @Param Request body request.DeleteOtherTableRequest true "请求信息"
// @Success 200 {object} response.DeleteOtherTableResponse
// @Failure 400 {object} code.Failure
// @Router /api/log/other/delete [post]
// @Router /api/log/other/delete [delete]
func (h *handler) DeleteOtherTable() core.HandlerFunc {
return func(c core.Context) {
req := new(request.DeleteOtherTableRequest)
Expand Down
2 changes: 1 addition & 1 deletion backend/pkg/api/log/func_deleteparserule.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// @Param Request body request.DeleteLogParseRequest true "请求信息"
// @Success 200 {object} response.LogParseResponse
// @Failure 400 {object} code.Failure
// @Router /api/log/rule/delete [post]
// @Router /api/log/rule/delete [delete]
func (h *handler) DeleteLogParseRule() core.HandlerFunc {
return func(c core.Context) {
req := new(request.DeleteLogParseRequest)
Expand Down
6 changes: 3 additions & 3 deletions backend/pkg/api/log/func_othertableinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ import (
// @Summary 获取外部日志表信息
// @Description 获取外部日志表信息
// @Tags API.log
// @Accept json
// @Accept application/x-www-form-urlencoded
// @Produce json
// @Param Request body request.OtherTableInfoRequest true "请求信息"
// @Success 200 {object} response.OtherTableInfoResponse
// @Failure 400 {object} code.Failure
// @Router /api/log/other/table [post]
// @Router /api/log/other/table [get]
func (h *handler) OtherTableInfo() core.HandlerFunc {
return func(c core.Context) {
req := new(request.OtherTableInfoRequest)
if err := c.ShouldBindJSON(req); err != nil {
if err := c.ShouldBindQuery(req); err != nil {
c.AbortWithError(core.Error(
http.StatusBadRequest,
code.ParamBindError,
Expand Down
6 changes: 3 additions & 3 deletions backend/pkg/api/log/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type Handler interface {

// DeleteLogParseRule 删除日志表解析规则
// @Tags API.log
// @Router /api/log/rule/delete [post]
// @Router /api/log/rule/delete [delete]
DeleteLogParseRule() core.HandlerFunc

// OtherTable 获取外部日志表
Expand All @@ -79,7 +79,7 @@ type Handler interface {

// OtherTableInfo 获取外部日志表信息
// @Tags API.log
// @Router /api/log/other/table [post]
// @Router /api/log/other/table [get]
OtherTableInfo() core.HandlerFunc

// AddOtherTable 添加外部日志表
Expand All @@ -89,7 +89,7 @@ type Handler interface {

// DeleteOtherTable 移除外部日志表
// @Tags API.log
// @Router /api/log/other/delete [post]
// @Router /api/log/other/delete [delete]
DeleteOtherTable() core.HandlerFunc
}

Expand Down
4 changes: 2 additions & 2 deletions backend/pkg/model/request/log_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ type OtherTableRequest struct {
}

type OtherTableInfoRequest struct {
DataBase string `json:"dataBase"`
TableName string `json:"tableName"`
DataBase string `form:"dataBase" json:"dataBase"`
TableName string `form:"tableName" json:"tableName"`
}

type AddOtherTableRequest struct {
Expand Down

0 comments on commit ecc0bb6

Please sign in to comment.