模板调整完成 TODO:自动代码移动
This commit is contained in:
@@ -3,7 +3,7 @@ package autocode
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model/autocode"
|
||||
"gin-vue-admin/model/autocode/requset"
|
||||
autocodeReq "gin-vue-admin/model/autocode/requset"
|
||||
"gin-vue-admin/model/common/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
@@ -25,9 +25,9 @@ var autoCodeExampleService = service.ServiceGroupApp.AutoCodeServiceGroup.AutoCo
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
|
||||
// @Router /autoCodeExample/createAutoCodeExample [post]
|
||||
func (autoCodeExampleApi *AutoCodeExampleApi) CreateAutoCodeExample(c *gin.Context) {
|
||||
var detail autocode.AutoCodeExample
|
||||
_ = c.ShouldBindJSON(&detail)
|
||||
if err := autoCodeExampleService.CreateAutoCodeExample(detail); err != nil {
|
||||
var autoCodeExample autocode.AutoCodeExample
|
||||
_ = c.ShouldBindJSON(&autoCodeExample)
|
||||
if err := autoCodeExampleService.CreateAutoCodeExample(autoCodeExample); err != nil {
|
||||
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("创建失败", c)
|
||||
} else {
|
||||
@@ -44,9 +44,9 @@ func (autoCodeExampleApi *AutoCodeExampleApi) CreateAutoCodeExample(c *gin.Conte
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
|
||||
// @Router /autoCodeExample/deleteAutoCodeExample [delete]
|
||||
func (autoCodeExampleApi *AutoCodeExampleApi) DeleteAutoCodeExample(c *gin.Context) {
|
||||
var detail autocode.AutoCodeExample
|
||||
_ = c.ShouldBindJSON(&detail)
|
||||
if err := autoCodeExampleService.DeleteAutoCodeExample(detail); err != nil {
|
||||
var autoCodeExample autocode.AutoCodeExample
|
||||
_ = c.ShouldBindJSON(&autoCodeExample)
|
||||
if err := autoCodeExampleService.DeleteAutoCodeExample(autoCodeExample); err != nil {
|
||||
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("删除失败", c)
|
||||
} else {
|
||||
@@ -63,9 +63,9 @@ func (autoCodeExampleApi *AutoCodeExampleApi) DeleteAutoCodeExample(c *gin.Conte
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
|
||||
// @Router /autoCodeExample/updateAutoCodeExample [put]
|
||||
func (autoCodeExampleApi *AutoCodeExampleApi) UpdateAutoCodeExample(c *gin.Context) {
|
||||
var detail autocode.AutoCodeExample
|
||||
_ = c.ShouldBindJSON(&detail)
|
||||
if err := autoCodeExampleService.UpdateAutoCodeExample(&detail); err != nil {
|
||||
var autoCodeExample autocode.AutoCodeExample
|
||||
_ = c.ShouldBindJSON(&autoCodeExample)
|
||||
if err := autoCodeExampleService.UpdateAutoCodeExample(&autoCodeExample); err != nil {
|
||||
global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("更新失败", c)
|
||||
} else {
|
||||
@@ -82,13 +82,13 @@ func (autoCodeExampleApi *AutoCodeExampleApi) UpdateAutoCodeExample(c *gin.Conte
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
|
||||
// @Router /autoCodeExample/findAutoCodeExample [get]
|
||||
func (autoCodeExampleApi *AutoCodeExampleApi) FindAutoCodeExample(c *gin.Context) {
|
||||
var detail autocode.AutoCodeExample
|
||||
_ = c.ShouldBindQuery(&detail)
|
||||
if err := utils.Verify(detail, utils.IdVerify); err != nil {
|
||||
var autoCodeExample autocode.AutoCodeExample
|
||||
_ = c.ShouldBindQuery(&autoCodeExample)
|
||||
if err := utils.Verify(autoCodeExample, utils.IdVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err, reAutoCodeExample := autoCodeExampleService.GetAutoCodeExample(detail.ID); err != nil {
|
||||
if err, reAutoCodeExample := autoCodeExampleService.GetAutoCodeExample(autoCodeExample.ID); err != nil {
|
||||
global.GVA_LOG.Error("查询失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("查询失败", c)
|
||||
} else {
|
||||
@@ -101,11 +101,11 @@ func (autoCodeExampleApi *AutoCodeExampleApi) FindAutoCodeExample(c *gin.Context
|
||||
// @Security ApiKeyAuth
|
||||
// @accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data body request.AutoCodeExampleSearch true "页码, 每页大小, 搜索条件"
|
||||
// @Param data body autocodeReq.AutoCodeExampleSearch true "页码, 每页大小, 搜索条件"
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
// @Router /autoCodeExample/getAutoCodeExampleList [get]
|
||||
func (autoCodeExampleApi *AutoCodeExampleApi) GetAutoCodeExampleList(c *gin.Context) {
|
||||
var pageInfo request.AutoCodeExampleSearch
|
||||
var pageInfo autocodeReq.AutoCodeExampleSearch
|
||||
_ = c.ShouldBindQuery(&pageInfo)
|
||||
if err, list, total := autoCodeExampleService.GetAutoCodeExampleInfoList(pageInfo); err != nil {
|
||||
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
|
||||
|
Reference in New Issue
Block a user