publish: 发布2.7.4版本Beta (#1880)
* 媒体库增加批量导入URL * fix 描述错误 * feature: 自动化代码方法支持增加方法描述 * update: 更新依赖,升级为最新版本 * feature: 自动化代码预览部分支持黑夜模式 * fixed: 修复keepalive上线后失效的bug * feature: 增加自动化基础模板功能 * feature: 增加自动化基础模板功能 * 将用户配置保存到数据库,刷新或者异地登录配置不丢失 * update: 清除无用的userinfo配置信息 * fixed: 清理开发阶段页面无端进入404的bug * feature: 前端主题配置跟随用户,不再单独设置json编译生效。 * feature: 增加个人中心配置兼容性 * fix(package): 包名设置为中文会导致无法自动生成代码,禁止包名设置为中文 * feature: 格式化代码 * feature: 对严格模式新建根角色进行调整。 * feature: 版本变更为2.7.4 --------- Co-authored-by: sliboy <34034053+sliboy@users.noreply.github.com> Co-authored-by: ba0ch3ng <ba0ch3ng@foxmail.com> Co-authored-by: task <121913992@qq.com> Co-authored-by: task <ms.yangdan@gmail.com> Co-authored-by: 爱丽-黑子 <62006632+ailiheizi@users.noreply.github.com> Co-authored-by: sliboy <sliboy@hotmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{{if .IsPlugin}}
|
||||
// {{.FuncName}} 等待开发的的{{.Description}}接口
|
||||
// {{.FuncName}} {{.FuncDesc}}
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 等待开发的的{{.Description}}接口
|
||||
// @Summary {{.FuncDesc}}
|
||||
// @accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data query request.{{.StructName}}Search true "分页获取{{.Description}}列表"
|
||||
@@ -20,9 +20,9 @@ func (a *{{.Abbreviation}}) {{.FuncName}}(c *gin.Context) {
|
||||
|
||||
{{- else -}}
|
||||
|
||||
// {{.FuncName}} 等待开发的的{{.Description}}接口
|
||||
// {{.FuncName}} {{.FuncDesc}}
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 等待开发的的{{.Description}}接口
|
||||
// @Summary {{.FuncDesc}}
|
||||
// @accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data query {{.Package}}Req.{{.StructName}}Search true "成功"
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{{if .IsPlugin}}
|
||||
// {{.FuncName}} 等待开发的的{{.Description}}接口
|
||||
// {{.FuncName}} {{.FuncDesc}}
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 等待开发的的{{.Description}}接口
|
||||
// @Summary {{.FuncDesc}}
|
||||
// @accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data query request.{{.StructName}}Search true "分页获取{{.Description}}列表"
|
||||
@@ -16,9 +16,9 @@ export const {{.Router}} = () => {
|
||||
|
||||
{{- else -}}
|
||||
|
||||
// {{.FuncName}} 等待开发的的{{.Description}}接口
|
||||
// {{.FuncName}} {{.FuncDesc}}
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 等待开发的的{{.Description}}接口
|
||||
// @Summary {{.FuncDesc}}
|
||||
// @accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data query {{.Package}}Req.{{.StructName}}Search true "成功"
|
||||
|
@@ -6,7 +6,7 @@
|
||||
{{- end}}
|
||||
{{if .IsPlugin}}
|
||||
|
||||
// {{.FuncName}} 请实现方法
|
||||
// {{.FuncName}} {{.FuncDesc}}
|
||||
// Author [yourname](https://github.com/yourname)
|
||||
func (s *{{.Abbreviation}}) {{.FuncName}}() (err error) {
|
||||
db := {{$db}}.Model(&model.{{.StructName}}{})
|
||||
@@ -15,7 +15,7 @@ func (s *{{.Abbreviation}}) {{.FuncName}}() (err error) {
|
||||
|
||||
{{- else -}}
|
||||
|
||||
// {{.FuncName}} 请实现方法
|
||||
// {{.FuncName}} {{.FuncDesc}}
|
||||
// Author [yourname](https://github.com/yourname)
|
||||
func ({{.Abbreviation}}Service *{{.StructName}}Service){{.FuncName}}() (err error) {
|
||||
// 请在这里实现自己的业务逻辑
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package {{.Package}}
|
||||
|
||||
import (
|
||||
{{if not .OnlyTemplate}}
|
||||
"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/model/{{.Package}}"
|
||||
@@ -10,10 +11,16 @@ import (
|
||||
{{- if .AutoCreateResource}}
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/utils"
|
||||
{{- end }}
|
||||
{{- else}}
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
|
||||
"github.com/gin-gonic/gin"
|
||||
{{- end}}
|
||||
)
|
||||
|
||||
type {{.StructName}}Api struct {}
|
||||
|
||||
{{if not .OnlyTemplate}}
|
||||
|
||||
// Create{{.StructName}} 创建{{.Description}}
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 创建{{.Description}}
|
||||
@@ -185,6 +192,8 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}DataSource(c *
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
|
||||
// Get{{.StructName}}Public 不需要鉴权的{{.Description}}接口
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 不需要鉴权的{{.Description}}接口
|
||||
@@ -196,6 +205,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}DataSource(c *
|
||||
func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}Public(c *gin.Context) {
|
||||
// 此接口不需要鉴权
|
||||
// 示例为返回了一个固定的消息接口,一般本接口用于C端服务,需要自己实现业务逻辑
|
||||
{{.Abbreviation}}Service.Get{{.StructName}}Public()
|
||||
response.OkWithDetailed(gin.H{
|
||||
"info": "不需要鉴权的{{.Description}}接口信息",
|
||||
}, "获取成功", c)
|
||||
|
@@ -1,6 +1,7 @@
|
||||
// 自动生成模板{{.StructName}}
|
||||
package {{.Package}}
|
||||
|
||||
{{- if not .OnlyTemplate}}
|
||||
import (
|
||||
{{- if .GvaModel }}
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/global"
|
||||
@@ -12,9 +13,11 @@ import (
|
||||
"gorm.io/datatypes"
|
||||
{{- end }}
|
||||
)
|
||||
{{- end }}
|
||||
|
||||
// {{.Description}} 结构体 {{.StructName}}
|
||||
type {{.StructName}} struct {
|
||||
{{- if not .OnlyTemplate}}
|
||||
{{- if .GvaModel }}
|
||||
global.GVA_MODEL
|
||||
{{- end }}
|
||||
@@ -46,6 +49,7 @@ type {{.StructName}} struct {
|
||||
UpdatedBy uint `gorm:"column:updated_by;comment:更新者"`
|
||||
DeletedBy uint `gorm:"column:deleted_by;comment:删除者"`
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
{{ if .TableName }}
|
||||
|
@@ -1,11 +1,14 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
{{- if not .OnlyTemplate }}
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
|
||||
{{ if or .HasSearchTimer .GvaModel}}"time"{{ end }}
|
||||
{{- end }}
|
||||
)
|
||||
|
||||
type {{.StructName}}Search struct{
|
||||
{{- if not .OnlyTemplate}}
|
||||
{{- if .GvaModel }}
|
||||
StartCreatedAt *time.Time `json:"startCreatedAt" form:"startCreatedAt"`
|
||||
EndCreatedAt *time.Time `json:"endCreatedAt" form:"endCreatedAt"`
|
||||
@@ -31,4 +34,5 @@ type {{.StructName}}Search struct{
|
||||
Sort string `json:"sort" form:"sort"`
|
||||
Order string `json:"order" form:"order"`
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package {{.Package}}
|
||||
|
||||
import (
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
{{if .OnlyTemplate}}// {{ end}}"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -9,9 +9,15 @@ type {{.StructName}}Router struct {}
|
||||
|
||||
// Init{{.StructName}}Router 初始化 {{.Description}} 路由信息
|
||||
func (s *{{.StructName}}Router) Init{{.StructName}}Router(Router *gin.RouterGroup,PublicRouter *gin.RouterGroup) {
|
||||
{{- if not .OnlyTemplate}}
|
||||
{{.Abbreviation}}Router := Router.Group("{{.Abbreviation}}").Use(middleware.OperationRecord())
|
||||
{{.Abbreviation}}RouterWithoutRecord := Router.Group("{{.Abbreviation}}")
|
||||
{{- else }}
|
||||
// {{.Abbreviation}}Router := Router.Group("{{.Abbreviation}}").Use(middleware.OperationRecord())
|
||||
// {{.Abbreviation}}RouterWithoutRecord := Router.Group("{{.Abbreviation}}")
|
||||
{{- end}}
|
||||
{{.Abbreviation}}RouterWithoutAuth := PublicRouter.Group("{{.Abbreviation}}")
|
||||
{{- if not .OnlyTemplate}}
|
||||
{
|
||||
{{.Abbreviation}}Router.POST("create{{.StructName}}", {{.Abbreviation}}Api.Create{{.StructName}}) // 新建{{.Description}}
|
||||
{{.Abbreviation}}Router.DELETE("delete{{.StructName}}", {{.Abbreviation}}Api.Delete{{.StructName}}) // 删除{{.Description}}
|
||||
@@ -26,6 +32,11 @@ func (s *{{.StructName}}Router) Init{{.StructName}}Router(Router *gin.RouterGrou
|
||||
{{- if .HasDataSource}}
|
||||
{{.Abbreviation}}RouterWithoutAuth.GET("get{{.StructName}}DataSource", {{.Abbreviation}}Api.Get{{.StructName}}DataSource) // 获取{{.Description}}数据源
|
||||
{{- end}}
|
||||
{{.Abbreviation}}RouterWithoutAuth.GET("get{{.StructName}}Public", {{.Abbreviation}}Api.Get{{.StructName}}Public) // 获取{{.Description}}列表
|
||||
{{.Abbreviation}}RouterWithoutAuth.GET("get{{.StructName}}Public", {{.Abbreviation}}Api.Get{{.StructName}}Public) // {{.Description}}开放接口
|
||||
}
|
||||
{{- else}}
|
||||
{
|
||||
{{.Abbreviation}}RouterWithoutAuth.GET("get{{.StructName}}Public", {{.Abbreviation}}Api.Get{{.StructName}}Public) // {{.Description}}开放接口
|
||||
}
|
||||
{{ end }}
|
||||
}
|
||||
|
@@ -1,12 +1,14 @@
|
||||
package {{.Package}}
|
||||
|
||||
import (
|
||||
{{- if not .OnlyTemplate }}
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/global"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/{{.Package}}"
|
||||
{{.Package}}Req "github.com/flipped-aurora/gin-vue-admin/server/model/{{.Package}}/request"
|
||||
{{- if .AutoCreateResource }}
|
||||
"gorm.io/gorm"
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
)
|
||||
|
||||
type {{.StructName}}Service struct {}
|
||||
@@ -18,6 +20,7 @@ type {{.StructName}}Service struct {}
|
||||
{{- $db = printf "global.MustGetGlobalDBByDBName(\"%s\")" .BusinessDB }}
|
||||
{{- end}}
|
||||
|
||||
{{- if not .OnlyTemplate }}
|
||||
// Create{{.StructName}} 创建{{.Description}}记录
|
||||
// Author [piexlmax](https://github.com/piexlmax)
|
||||
func ({{.Abbreviation}}Service *{{.StructName}}Service) Create{{.StructName}}({{.Abbreviation}} *{{.Package}}.{{.StructName}}) (err error) {
|
||||
@@ -151,4 +154,9 @@ func ({{.Abbreviation}}Service *{{.StructName}}Service)Get{{.StructName}}DataSou
|
||||
{{- end }}
|
||||
return
|
||||
}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
func ({{.Abbreviation}}Service *{{.StructName}}Service)Get{{.StructName}}Public() {
|
||||
// 此方法为获取数据源定义的数据
|
||||
// 请自行实现
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import service from '@/utils/request'
|
||||
|
||||
{{- if .OnlyTemplate}}
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 创建{{.Description}}
|
||||
// @Security ApiKeyAuth
|
||||
@@ -111,3 +112,19 @@ export const get{{.StructName}}DataSource = () => {
|
||||
})
|
||||
}
|
||||
{{- end}}
|
||||
|
||||
{{- end}}
|
||||
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 不需要鉴权的{{.Description}}接口
|
||||
// @accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data query {{.Package}}Req.{{.StructName}}Search true "分页获取{{.Description}}列表"
|
||||
// @Success 200 {object} response.Response{data=object,msg=string} "获取成功"
|
||||
// @Router /{{.Abbreviation}}/get{{.StructName}}Public [get]
|
||||
export const get{{.StructName}}Public = () => {
|
||||
return service({
|
||||
url: '/{{.Abbreviation}}/get{{.StructName}}Public',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
@@ -1,3 +1,4 @@
|
||||
{{- if not .OnlyTemplate }}
|
||||
<template>
|
||||
<div>
|
||||
<div class="gva-form-box">
|
||||
@@ -238,3 +239,12 @@ const back = () => {
|
||||
|
||||
<style>
|
||||
</style>
|
||||
{{- else }}
|
||||
<template>
|
||||
<div>form</div>
|
||||
</template>
|
||||
<script setup>
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
{{- end }}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{{- $global := . }}
|
||||
{{- $templateID := printf "%s_%s" .Package .StructName }}
|
||||
{{- if not .OnlyTemplate}}
|
||||
<template>
|
||||
<div>
|
||||
<div class="gva-search-box">
|
||||
@@ -894,3 +895,15 @@ const closeDetailShow = () => {
|
||||
}
|
||||
{{end}}
|
||||
</style>
|
||||
{{- else}}
|
||||
<template>
|
||||
<div>form</div>
|
||||
</template>
|
||||
<script setup>
|
||||
defineOptions({
|
||||
name: '{{.StructName}}'
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
{{- end}}
|
@@ -1,6 +1,7 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
{{if not .OnlyTemplate}}
|
||||
"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/plugin/{{.Package}}/model"
|
||||
@@ -10,12 +11,16 @@ import (
|
||||
{{- if .AutoCreateResource}}
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/utils"
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
|
||||
"github.com/gin-gonic/gin"
|
||||
{{- end }}
|
||||
)
|
||||
|
||||
var {{.StructName}} = new({{.Abbreviation}})
|
||||
|
||||
type {{.Abbreviation}} struct {}
|
||||
|
||||
{{if not .OnlyTemplate}}
|
||||
// Create{{.StructName}} 创建{{.Description}}
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 创建{{.Description}}
|
||||
@@ -186,7 +191,7 @@ func (a *{{.Abbreviation}}) Get{{.StructName}}DataSource(c *gin.Context) {
|
||||
response.OkWithData(dataSource, c)
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
// Get{{.StructName}}Public 不需要鉴权的{{.Description}}接口
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 不需要鉴权的{{.Description}}接口
|
||||
@@ -197,5 +202,6 @@ func (a *{{.Abbreviation}}) Get{{.StructName}}DataSource(c *gin.Context) {
|
||||
// @Router /{{.Abbreviation}}/get{{.StructName}}Public [get]
|
||||
func (a *{{.Abbreviation}}) Get{{.StructName}}Public(c *gin.Context) {
|
||||
// 此接口不需要鉴权 示例为返回了一个固定的消息接口,一般本接口用于C端服务,需要自己实现业务逻辑
|
||||
service{{ .StructName }}.Get{{.StructName}}Public()
|
||||
response.OkWithDetailed(gin.H{"info": "不需要鉴权的{{.Description}}接口信息"}, "获取成功", c)
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package model
|
||||
|
||||
{{- if not .OnlyTemplate}}
|
||||
import (
|
||||
{{- if .GvaModel }}
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/global"
|
||||
@@ -11,9 +12,11 @@ import (
|
||||
"gorm.io/datatypes"
|
||||
{{- end }}
|
||||
)
|
||||
{{- end }}
|
||||
|
||||
// {{.StructName}} {{.Description}} 结构体
|
||||
type {{.StructName}} struct {
|
||||
{{- if not .OnlyTemplate}}
|
||||
{{- if .GvaModel }}
|
||||
global.GVA_MODEL
|
||||
{{- end }}
|
||||
@@ -45,6 +48,7 @@ type {{.StructName}} struct {
|
||||
UpdatedBy uint `gorm:"column:updated_by;comment:更新者"`
|
||||
DeletedBy uint `gorm:"column:deleted_by;comment:删除者"`
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
{{ if .TableName }}
|
||||
|
@@ -1,11 +1,13 @@
|
||||
package request
|
||||
|
||||
{{- if not .OnlyTemplate}}
|
||||
import (
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
|
||||
{{ if or .HasSearchTimer .GvaModel}}"time"{{ end }}
|
||||
)
|
||||
|
||||
{{- end}}
|
||||
type {{.StructName}}Search struct{
|
||||
{{- if not .OnlyTemplate}}
|
||||
|
||||
{{- if .GvaModel }}
|
||||
StartCreatedAt *time.Time `json:"startCreatedAt" form:"startCreatedAt"`
|
||||
EndCreatedAt *time.Time `json:"endCreatedAt" form:"endCreatedAt"`
|
||||
@@ -31,4 +33,5 @@ type {{.StructName}}Search struct{
|
||||
Sort string `json:"sort" form:"sort"`
|
||||
Order string `json:"order" form:"order"`
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
{{if .OnlyTemplate }} // {{end}}"github.com/flipped-aurora/gin-vue-admin/server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -11,6 +11,7 @@ type {{.Abbreviation}} struct {}
|
||||
|
||||
// Init 初始化 {{.Description}} 路由信息
|
||||
func (r *{{.Abbreviation}}) Init(public *gin.RouterGroup, private *gin.RouterGroup) {
|
||||
{{- if not .OnlyTemplate }}
|
||||
{
|
||||
group := private.Group("{{.Abbreviation}}").Use(middleware.OperationRecord())
|
||||
group.POST("create{{.StructName}}", api{{.StructName}}.Create{{.StructName}}) // 新建{{.Description}}
|
||||
@@ -23,11 +24,23 @@ func (r *{{.Abbreviation}}) Init(public *gin.RouterGroup, private *gin.RouterGro
|
||||
group.GET("find{{.StructName}}", api{{.StructName}}.Find{{.StructName}}) // 根据ID获取{{.Description}}
|
||||
group.GET("get{{.StructName}}List", api{{.StructName}}.Get{{.StructName}}List) // 获取{{.Description}}列表
|
||||
}
|
||||
{{- if .HasDataSource}}
|
||||
{
|
||||
group := public.Group("{{.Abbreviation}}")
|
||||
{{- if .HasDataSource}}
|
||||
group.GET("get{{.StructName}}DataSource", api{{.StructName}}.Get{{.StructName}}DataSource) // 获取{{.Description}}数据源
|
||||
group.GET("get{{.StructName}}Public", api{{.StructName}}.Get{{.StructName}}Public) // 获取{{.Description}}列表
|
||||
{{- end}}
|
||||
group.GET("get{{.StructName}}Public", api{{.StructName}}.Get{{.StructName}}Public) // {{.Description}}开放接口
|
||||
}
|
||||
{{- end}}
|
||||
{{- else}}
|
||||
// {
|
||||
// group := private.Group("{{.Abbreviation}}").Use(middleware.OperationRecord())
|
||||
// }
|
||||
// {
|
||||
// group := private.Group("{{.Abbreviation}}")
|
||||
// }
|
||||
{
|
||||
group := public.Group("{{.Abbreviation}}")
|
||||
group.GET("get{{.StructName}}Public", api{{.StructName}}.Get{{.StructName}}Public) // {{.Description}}开放接口
|
||||
}
|
||||
{{- end}}
|
||||
}
|
||||
|
@@ -1,12 +1,14 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
{{- if not .OnlyTemplate }}
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/global"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/plugin/{{.Package}}/model"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/plugin/{{.Package}}/model/request"
|
||||
{{- if .AutoCreateResource }}
|
||||
"gorm.io/gorm"
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
)
|
||||
|
||||
var {{.StructName}} = new({{.Abbreviation}})
|
||||
@@ -19,7 +21,7 @@ type {{.Abbreviation}} struct {}
|
||||
{{- else}}
|
||||
{{- $db = printf "global.MustGetGlobalDBByDBName(\"%s\")" .BusinessDB }}
|
||||
{{- end}}
|
||||
|
||||
{{- if not .OnlyTemplate }}
|
||||
// Create{{.StructName}} 创建{{.Description}}记录
|
||||
// Author [piexlmax](https://github.com/piexlmax)
|
||||
func (s *{{.Abbreviation}}) Create{{.StructName}}({{.Abbreviation}} *model.{{.StructName}}) (err error) {
|
||||
@@ -153,3 +155,8 @@ func (s *{{.Abbreviation}})Get{{.StructName}}DataSource() (res map[string][]map[
|
||||
return
|
||||
}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
func (s *{{.Abbreviation}})Get{{.StructName}}Public() {
|
||||
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
import service from '@/utils/request'
|
||||
|
||||
{{- if not .OnlyTemplate}}
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 创建{{.Description}}
|
||||
// @Security ApiKeyAuth
|
||||
@@ -111,3 +111,17 @@ export const get{{.StructName}}DataSource = () => {
|
||||
})
|
||||
}
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
// @Tags {{.StructName}}
|
||||
// @Summary 不需要鉴权的{{.Description}}接口
|
||||
// @accept application/json
|
||||
// @Produce application/json
|
||||
// @Param data query request.{{.StructName}}Search true "分页获取{{.Description}}列表"
|
||||
// @Success 200 {object} response.Response{data=object,msg=string} "获取成功"
|
||||
// @Router /{{.Abbreviation}}/get{{.StructName}}Public [get]
|
||||
export const get{{.StructName}}Public = () => {
|
||||
return service({
|
||||
url: '/{{.Abbreviation}}/get{{.StructName}}Public',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
@@ -1,3 +1,4 @@
|
||||
{{- if not .OnlyTemplate}}
|
||||
<template>
|
||||
<div>
|
||||
<div class="gva-form-box">
|
||||
@@ -239,3 +240,12 @@ const back = () => {
|
||||
|
||||
<style>
|
||||
</style>
|
||||
{{- else }}
|
||||
<template>
|
||||
<div>form</div>
|
||||
</template>
|
||||
<script setup>
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
{{- end }}
|
@@ -1,5 +1,6 @@
|
||||
{{- $global := . }}
|
||||
{{- $templateID := printf "%s_%s" .Package .StructName }}
|
||||
{{- if not .OnlyTemplate}}
|
||||
<template>
|
||||
<div>
|
||||
<div class="gva-search-box">
|
||||
@@ -900,3 +901,15 @@ const closeDetailShow = () => {
|
||||
}
|
||||
{{end}}
|
||||
</style>
|
||||
{{- else}}
|
||||
<template>
|
||||
<div>form</div>
|
||||
</template>
|
||||
<script setup>
|
||||
defineOptions({
|
||||
name: '{{.StructName}}'
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
{{- end}}
|
Reference in New Issue
Block a user