From 6ccc4c0e5ebc639fea9b49c3aa8a2f4f1b85f61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E5=90=89=E5=85=86?= <303176530@qq.com> Date: Sun, 18 Jul 2021 19:57:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A8=A1=E6=9D=BFbug=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/api/v1/autocode/autocodeExample.go | 2 +- .../autocode/{requset => request}/autocodeExample.go | 0 server/resource/template/server/api.go.tpl | 9 ++++----- server/resource/template/server/router.go.tpl | 2 +- server/resource/template/server/service.go.tpl | 7 ++++--- server/service/autocode/autocodeExample.go | 2 +- server/service/example/exa_file_upload_download.go | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) rename server/model/autocode/{requset => request}/autocodeExample.go (100%) diff --git a/server/api/v1/autocode/autocodeExample.go b/server/api/v1/autocode/autocodeExample.go index dd6620d3..f520f475 100644 --- a/server/api/v1/autocode/autocodeExample.go +++ b/server/api/v1/autocode/autocodeExample.go @@ -3,7 +3,7 @@ package autocode import ( "gin-vue-admin/global" "gin-vue-admin/model/autocode" - autocodeReq "gin-vue-admin/model/autocode/requset" + autocodeReq "gin-vue-admin/model/autocode/request" "gin-vue-admin/model/common/response" "gin-vue-admin/service" "gin-vue-admin/utils" diff --git a/server/model/autocode/requset/autocodeExample.go b/server/model/autocode/request/autocodeExample.go similarity index 100% rename from server/model/autocode/requset/autocodeExample.go rename to server/model/autocode/request/autocodeExample.go diff --git a/server/resource/template/server/api.go.tpl b/server/resource/template/server/api.go.tpl index b4810812..1b639d63 100644 --- a/server/resource/template/server/api.go.tpl +++ b/server/resource/template/server/api.go.tpl @@ -1,13 +1,12 @@ -package v1 +package autocode import ( "gin-vue-admin/global" "gin-vue-admin/model/autocode" - "gin-vue-admin/model/common/requset" - autocodeReq "gin-vue-admin/model/autocode/requset" + "gin-vue-admin/model/common/request" + autocodeReq "gin-vue-admin/model/autocode/request" "gin-vue-admin/model/common/response" "gin-vue-admin/service" - "gin-vue-admin/utils" "github.com/gin-gonic/gin" "go.uber.org/zap" ) @@ -28,7 +27,7 @@ var {{.Abbreviation}}Service = service.ServiceGroupApp.AutoCodeServiceGroup.{{.S // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Router /{{.Abbreviation}}/create{{.StructName}} [post] func ({{.Abbreviation}}Api *{{.StructName}}Api) Create{{.StructName}}(c *gin.Context) { - var {{.Abbreviation}} model.{{.StructName}} + var {{.Abbreviation}} autocode.{{.StructName}} _ = c.ShouldBindJSON(&{{.Abbreviation}}) if err := {{.Abbreviation}}Service.Create{{.StructName}}({{.Abbreviation}}); err != nil { global.GVA_LOG.Error("创建失败!", zap.Any("err", err)) diff --git a/server/resource/template/server/router.go.tpl b/server/resource/template/server/router.go.tpl index 27be5937..0100966b 100644 --- a/server/resource/template/server/router.go.tpl +++ b/server/resource/template/server/router.go.tpl @@ -1,4 +1,4 @@ -package router +package autocode import ( "gin-vue-admin/api/v1" diff --git a/server/resource/template/server/service.go.tpl b/server/resource/template/server/service.go.tpl index 0c78d627..69a04b1c 100644 --- a/server/resource/template/server/service.go.tpl +++ b/server/resource/template/server/service.go.tpl @@ -1,9 +1,10 @@ -package service +package autocode import ( "gin-vue-admin/global" "gin-vue-admin/model/autocode" - "gin-vue-admin/model/autocode/request" + "gin-vue-admin/model/common/request" + autoCodeReq "gin-vue-admin/model/autocode/request" ) type {{.StructName}}Service struct { @@ -46,7 +47,7 @@ func ({{.Abbreviation}}Service *{{.StructName}}Service)Get{{.StructName}}(id uin // Get{{.StructName}}InfoList 分页获取{{.StructName}}记录 // Author [piexlmax](https://github.com/piexlmax) -func ({{.Abbreviation}}Service *{{.StructName}}Service)Get{{.StructName}}InfoList(info request.{{.StructName}}Search) (err error, list interface{}, total int64) { +func ({{.Abbreviation}}Service *{{.StructName}}Service)Get{{.StructName}}InfoList(info autoCodeReq.{{.StructName}}Search) (err error, list interface{}, total int64) { limit := info.PageSize offset := info.PageSize * (info.Page - 1) // 创建db diff --git a/server/service/autocode/autocodeExample.go b/server/service/autocode/autocodeExample.go index 0a67873b..4059f10d 100644 --- a/server/service/autocode/autocodeExample.go +++ b/server/service/autocode/autocodeExample.go @@ -3,7 +3,7 @@ package autocode import ( "gin-vue-admin/global" "gin-vue-admin/model/autocode" - "gin-vue-admin/model/autocode/requset" + "gin-vue-admin/model/autocode/request" ) type AutoCodeExampleService struct { diff --git a/server/service/example/exa_file_upload_download.go b/server/service/example/exa_file_upload_download.go index 58703ed6..3c9515cf 100644 --- a/server/service/example/exa_file_upload_download.go +++ b/server/service/example/exa_file_upload_download.go @@ -52,7 +52,7 @@ func (e *FileUploadAndDownloadService) DeleteFile(file example.ExaFileUploadAndD //@author: [piexlmax](https://github.com/piexlmax) //@function: GetFileRecordInfoList //@description: 分页获取数据 -//@param: info requset.PageInfo +//@param: info request.PageInfo //@return: err error, list interface{}, total int64 func (e *FileUploadAndDownloadService) GetFileRecordInfoList(info request.PageInfo) (err error, list interface{}, total int64) {