feater: 可对自动化代码增加空方法 (#1834)

* feature:自动化代码可从自动化代码管理中增加空方法,用户不用自行组织其中的关系。
This commit is contained in:
PiexlMax(奇淼
2024-07-25 21:29:20 +08:00
committed by GitHub
parent 0fc1edf895
commit 7f9194f475
10 changed files with 379 additions and 29 deletions

View File

@@ -81,3 +81,28 @@ func (a *AutoCodeTemplateApi) Create(c *gin.Context) {
response.OkWithMessage("创建成功", c)
}
}
// Create
// @Tags AddFunc
// @Summary 增加方法
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.AutoCode true "增加方法"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /autoCode/addFunc [post]
func (a *AutoCodeTemplateApi) AddFunc(c *gin.Context) {
var info request.AutoFunc
err := c.ShouldBindJSON(&info)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
}
err = autoCodeTemplateService.AddFunc(info)
if err != nil {
global.GVA_LOG.Error("注入失败!", zap.Error(err))
response.FailWithMessage("注入失败", c)
} else {
response.OkWithMessage("注入成功", c)
}
}

View File

@@ -8,7 +8,6 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/utils/request"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)