mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-26 16:46:14 +08:00
发布v2.2.10版本,更新内容请查看:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN/addon-version-upgrade.md
This commit is contained in:
@@ -9,6 +9,7 @@ type BasicConfig struct {
|
||||
Logo string `json:"basicLogo"`
|
||||
Name string `json:"basicName"`
|
||||
Domain string `json:"basicDomain"`
|
||||
WsAddr string `json:"basicWsAddr"`
|
||||
RegisterSwitch int `json:"basicRegisterSwitch"`
|
||||
SystemOpen bool `json:"basicSystemOpen"`
|
||||
}
|
||||
@@ -115,6 +116,7 @@ type ServeLogConfig struct {
|
||||
// GenerateAppCrudTemplate curd模板
|
||||
type GenerateAppCrudTemplate struct {
|
||||
Group string `json:"group"`
|
||||
IsAddon bool `json:"isAddon"`
|
||||
MasterPackage string `json:"masterPackage"`
|
||||
TemplatePath string `json:"templatePath"`
|
||||
ApiPath string `json:"apiPath"`
|
||||
@@ -153,8 +155,21 @@ type GenerateConfig struct {
|
||||
Templates []*GenerateAppTreeTemplate `json:"templates"`
|
||||
} `json:"tree"`
|
||||
} `json:"application"`
|
||||
Delimiters []string `json:"delimiters"`
|
||||
DevPath string `json:"devPath"`
|
||||
DisableTables []string `json:"disableTables"`
|
||||
SelectDbs []string `json:"selectDbs"`
|
||||
Delimiters []string `json:"delimiters"`
|
||||
DevPath string `json:"devPath"`
|
||||
DisableTables []string `json:"disableTables"`
|
||||
SelectDbs []string `json:"selectDbs"`
|
||||
Addon *BuildAddonConfig `json:"addon"`
|
||||
}
|
||||
|
||||
// BuildAddonConfig 构建插件模块配置
|
||||
type BuildAddonConfig struct {
|
||||
SrcPath string `json:"srcPath"`
|
||||
TemplatePath string `json:"templatePath"`
|
||||
}
|
||||
|
||||
// CacheConfig 缓存配置
|
||||
type CacheConfig struct {
|
||||
Adapter string `json:"adapter"`
|
||||
FileDir string `json:"fileDir"`
|
||||
}
|
||||
|
@@ -1,9 +1,8 @@
|
||||
// Package model
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package model
|
||||
|
||||
import (
|
||||
@@ -12,11 +11,12 @@ import (
|
||||
|
||||
// Context 请求上下文结构
|
||||
type Context struct {
|
||||
Module string // 应用模块
|
||||
Module string // 应用模块 admin|api|home|websocket
|
||||
AddonName string // 插件名称 如果不是插件模块请求,可能为空
|
||||
TakeUpTime int64 // 请求耗时 ms
|
||||
User *Identity // 上下文用户信息
|
||||
Response *Response // 请求响应
|
||||
Data g.Map // 自定kv变量,业务模块根据需要设置,不固定
|
||||
Data g.Map // 自定kv变量 业务模块根据需要设置,不固定
|
||||
}
|
||||
|
||||
// Identity 通用身份模型
|
||||
|
@@ -10,9 +10,9 @@ import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// Test is the golang structure of table hg_test for DAO operations like Where/Data.
|
||||
type Test struct {
|
||||
g.Meta `orm:"table:hg_test, do:true"`
|
||||
// AddonHgexampleTable is the golang structure of table hg_addon_hgexample_table for DAO operations like Where/Data.
|
||||
type AddonHgexampleTable struct {
|
||||
g.Meta `orm:"table:hg_addon_hgexample_table, do:true"`
|
||||
Id interface{} // ID
|
||||
CategoryId interface{} // 分类ID
|
||||
Flag *gjson.Json // 标签
|
@@ -1,16 +0,0 @@
|
||||
// =================================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminRoleDept is the golang structure of table hg_admin_role_dept for DAO operations like Where/Data.
|
||||
type AdminRoleDept struct {
|
||||
g.Meta `orm:"table:hg_admin_role_dept, do:true"`
|
||||
RoleId interface{} // 角色ID
|
||||
DeptId interface{} // 部门ID
|
||||
}
|
29
server/internal/model/do/sys_addons_config.go
Normal file
29
server/internal/model/do/sys_addons_config.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// =================================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// SysAddonsConfig is the golang structure of table hg_sys_addons_config for DAO operations like Where/Data.
|
||||
type SysAddonsConfig struct {
|
||||
g.Meta `orm:"table:hg_sys_addons_config, do:true"`
|
||||
Id interface{} // 配置ID
|
||||
AddonName interface{} // 插件名称
|
||||
Group interface{} // 分组
|
||||
Name interface{} // 参数名称
|
||||
Type interface{} // 键值类型:string,int,uint,bool,datetime,date
|
||||
Key interface{} // 参数键名
|
||||
Value interface{} // 参数键值
|
||||
DefaultValue interface{} // 默认值
|
||||
Sort interface{} // 排序
|
||||
Tip interface{} // 变量描述
|
||||
IsDefault interface{} // 是否为系统默认
|
||||
Status interface{} // 状态
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
}
|
@@ -23,6 +23,7 @@ type SysGenCodes struct {
|
||||
TableComment interface{} // 主表注释
|
||||
DaoName interface{} // 主表dao模型
|
||||
MasterColumns *gjson.Json // 主表字段
|
||||
AddonName interface{} // 插件名称
|
||||
Status interface{} // 生成状态
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
|
@@ -9,8 +9,8 @@ import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// Test is the golang structure for table test.
|
||||
type Test struct {
|
||||
// AddonHgexampleTable is the golang structure for table addon_hgexample_table.
|
||||
type AddonHgexampleTable struct {
|
||||
Id int64 `json:"id" description:"ID"`
|
||||
CategoryId int64 `json:"categoryId" description:"分类ID"`
|
||||
Flag *gjson.Json `json:"flag" description:"标签"`
|
@@ -1,11 +0,0 @@
|
||||
// =================================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
// AdminRoleDept is the golang structure for table admin_role_dept.
|
||||
type AdminRoleDept struct {
|
||||
RoleId int64 `json:"roleId" description:"角色ID"`
|
||||
DeptId int64 `json:"deptId" description:"部门ID"`
|
||||
}
|
27
server/internal/model/entity/sys_addons_config.go
Normal file
27
server/internal/model/entity/sys_addons_config.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// =================================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// SysAddonsConfig is the golang structure for table sys_addons_config.
|
||||
type SysAddonsConfig struct {
|
||||
Id int64 `json:"id" description:"配置ID"`
|
||||
AddonName string `json:"addonName" description:"插件名称"`
|
||||
Group string `json:"group" description:"分组"`
|
||||
Name string `json:"name" description:"参数名称"`
|
||||
Type string `json:"type" description:"键值类型:string,int,uint,bool,datetime,date"`
|
||||
Key string `json:"key" description:"参数键名"`
|
||||
Value string `json:"value" description:"参数键值"`
|
||||
DefaultValue string `json:"defaultValue" description:"默认值"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Tip string `json:"tip" description:"变量描述"`
|
||||
IsDefault int `json:"isDefault" description:"是否为系统默认"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"`
|
||||
}
|
@@ -21,6 +21,7 @@ type SysGenCodes struct {
|
||||
TableComment string `json:"tableComment" description:"主表注释"`
|
||||
DaoName string `json:"daoName" description:"主表dao模型"`
|
||||
MasterColumns *gjson.Json `json:"masterColumns" description:"主表字段"`
|
||||
AddonName string `json:"addonName" description:"插件名称"`
|
||||
Status int `json:"status" description:"生成状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"`
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package adminin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package adminin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package adminin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package adminin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package adminin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package adminin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,162 +0,0 @@
|
||||
// Package adminin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package adminin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
// TestEditInp 修改/新增
|
||||
type TestEditInp struct {
|
||||
entity.Test
|
||||
}
|
||||
|
||||
type TestEditModel struct{}
|
||||
|
||||
func (in *TestEditInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Map.IsNil() {
|
||||
in.Map = gjson.New(consts.NilJsonToString)
|
||||
}
|
||||
if in.Flag.IsNil() {
|
||||
in.Flag = gjson.New(consts.NilJsonToString)
|
||||
}
|
||||
if in.Images.IsNil() {
|
||||
in.Images = gjson.New(consts.NilJsonToString)
|
||||
}
|
||||
if in.Attachfiles.IsNil() {
|
||||
in.Attachfiles = gjson.New(consts.NilJsonToString)
|
||||
}
|
||||
if in.Hobby.IsNil() {
|
||||
in.Hobby = gjson.New(consts.NilJsonToString)
|
||||
}
|
||||
|
||||
if in.Title == "" {
|
||||
return errors.New("标题不能为空")
|
||||
}
|
||||
|
||||
if in.Email != "" && !validate.IsEmail(in.Email) {
|
||||
return errors.New("邮箱格式不正确")
|
||||
}
|
||||
|
||||
if err := g.Validator().Rules("float|between:0,5").Messages("请输入一个浮点数|推荐星只能是0~5星").Data(in.Star).Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// TestDeleteInp 删除类型
|
||||
type TestDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#测试ID不能为空" dc:"测试ID"`
|
||||
}
|
||||
|
||||
type TestDeleteModel struct{}
|
||||
|
||||
// TestViewInp 获取信息
|
||||
type TestViewInp struct {
|
||||
Id int64 `json:"id" v:"required#测试ID不能为空" dc:"测试ID"`
|
||||
}
|
||||
|
||||
type TestViewModel struct {
|
||||
entity.Test
|
||||
}
|
||||
|
||||
// TestListInp 获取列表
|
||||
type TestListInp struct {
|
||||
form.PageReq
|
||||
Id int64 `json:"id" description:""`
|
||||
Flag *gjson.Json `json:"flag" description:"标签"`
|
||||
Title string `json:"title" description:"标题"`
|
||||
Content string `json:"content" description:"内容"`
|
||||
Price []float64 `json:"price" description:"价格"`
|
||||
ActivityAt *gtime.Time `json:"activityAt" description:"活动时间"`
|
||||
Switch int `json:"switch" description:"开关"`
|
||||
Hobby *gjson.Json `json:"hobby" description:"爱好"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
}
|
||||
|
||||
type TestListModel struct {
|
||||
entity.Test
|
||||
TestCategoryName string `json:"testCategoryName" description:"分类名称"`
|
||||
TestCategoryDescription string `json:"testCategoryDescription" description:"分类描述"`
|
||||
TestCategoryRemark string `json:"testCategoryRemark" description:"分类备注"`
|
||||
SysProvincesTitle string `json:"sysProvincesTitle" description:""`
|
||||
}
|
||||
|
||||
func (in *TestListInp) Filter(ctx context.Context) (err error) {
|
||||
if !in.Flag.IsNil() {
|
||||
in.Flag = gjson.New(in.Flag.Var().Ints())
|
||||
}
|
||||
if !in.Hobby.IsNil() {
|
||||
in.Hobby = gjson.New(in.Hobby.Var().Ints())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type TestExportModel struct {
|
||||
Id int64 `json:"id" description:""`
|
||||
CategoryId int64 `json:"categoryId" description:"分类ID"`
|
||||
Flag *gjson.Json `json:"flag" description:"标签"`
|
||||
Title string `json:"title" description:"标题"`
|
||||
Star float64 `json:"star" description:"推荐星"`
|
||||
Price float64 `json:"price" description:"价格"`
|
||||
Views int64 `json:"views" description:"浏览次数"`
|
||||
ActivityAt *gtime.Time `json:"activityAt" description:"活动时间"`
|
||||
StartAt *gtime.Time `json:"startAt" description:"开启时间"`
|
||||
EndAt *gtime.Time `json:"endAt" description:"结束时间"`
|
||||
Switch int `json:"switch" description:"开关"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Avatar string `json:"avatar" description:"头像"`
|
||||
Sex int `json:"sex" description:"性别"`
|
||||
Qq string `json:"qq" description:"qq"`
|
||||
Email string `json:"email" description:"邮箱"`
|
||||
Mobile string `json:"mobile" description:"手机号码"`
|
||||
Hobby *gjson.Json `json:"hobby" description:"爱好"`
|
||||
Channel int `json:"channel" description:"渠道"`
|
||||
Pid int64 `json:"pid" description:"上级ID"`
|
||||
Level int `json:"level" description:"树等级"`
|
||||
Tree string `json:"tree" description:"关系树"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
CreatedBy int64 `json:"createdBy" description:"创建者"`
|
||||
UpdatedBy int64 `json:"updatedBy" description:"更新者"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"修改时间"`
|
||||
DeletedAt *gtime.Time `json:"deletedAt" description:"删除时间"`
|
||||
}
|
||||
|
||||
// TestMaxSortInp 最大排序
|
||||
type TestMaxSortInp struct{}
|
||||
|
||||
type TestMaxSortModel struct {
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
}
|
||||
|
||||
// TestStatusInp 更新状态
|
||||
type TestStatusInp struct {
|
||||
Id int64 `json:"id" v:"required#测试ID不能为空" dc:"测试ID"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
type TestStatusModel struct{}
|
||||
|
||||
// TestSwitchInp 更新开关状态
|
||||
type TestSwitchInp struct {
|
||||
form.SwitchReq
|
||||
Id int64 `json:"id" v:"required#测试ID不能为空" dc:"测试ID"`
|
||||
}
|
||||
|
||||
type TestSwitchModel struct{}
|
@@ -1,6 +1,6 @@
|
||||
// Package form
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
72
server/internal/model/input/sysin/addons.go
Normal file
72
server/internal/model/input/sysin/addons.go
Normal file
@@ -0,0 +1,72 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"hotgo/internal/library/addons"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// AddonsListInp 获取列表
|
||||
type AddonsListInp struct {
|
||||
form.PageReq
|
||||
Name string `json:"name"`
|
||||
Group int `json:"group"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
type AddonsListModel struct {
|
||||
addons.Skeleton
|
||||
GroupName string `json:"groupName" dc:"分组名称"`
|
||||
InstallVersion string `json:"installVersion" dc:"安装版本"`
|
||||
InstallStatus int `json:"installStatus" dc:"安装状态"`
|
||||
CanSave bool `json:"canSave" dc:"是否可以更新"`
|
||||
}
|
||||
|
||||
// AddonsSelectsInp 选项
|
||||
type AddonsSelectsInp struct {
|
||||
}
|
||||
type AddonsSelectsModel struct {
|
||||
GroupType form.Selects `json:"groupType" dc:"分组类型"`
|
||||
Status form.Selects `json:"status" dc:"安装状态"`
|
||||
}
|
||||
|
||||
// AddonsBuildInp 提交生成
|
||||
type AddonsBuildInp struct {
|
||||
addons.Skeleton
|
||||
}
|
||||
|
||||
func (in *AddonsBuildInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Name == "" {
|
||||
err = gerror.New("插件名称不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if !gregex.IsMatchString(`^[a-zA-Z]{1}\w{1,23}$`, in.Name) {
|
||||
err = gerror.New("插件名称格式不正确,字母开头,只能包含字母、数字和下划线,长度在2~24之间")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// AddonsInstallInp 安装模块
|
||||
type AddonsInstallInp struct {
|
||||
addons.Skeleton
|
||||
}
|
||||
|
||||
// AddonsUpgradeInp 更新模块
|
||||
type AddonsUpgradeInp struct {
|
||||
addons.Skeleton
|
||||
}
|
||||
|
||||
// AddonsUnInstallInp 卸载模块
|
||||
type AddonsUnInstallInp struct {
|
||||
addons.Skeleton
|
||||
}
|
27
server/internal/model/input/sysin/addons_config.go
Normal file
27
server/internal/model/input/sysin/addons_config.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// UpdateAddonsConfigInp 更新指定插件的配置
|
||||
type UpdateAddonsConfigInp struct {
|
||||
AddonName string `json:"addonName"`
|
||||
Group string `json:"group"`
|
||||
List g.Map `json:"list"`
|
||||
}
|
||||
|
||||
// GetAddonsConfigInp 获取指定插件的配置
|
||||
type GetAddonsConfigInp struct {
|
||||
AddonName string `json:"addonName"`
|
||||
Group string `json:"group"`
|
||||
}
|
||||
type GetAddonsConfigModel struct {
|
||||
List g.Map `json:"list"`
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -3,8 +3,8 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.1.2
|
||||
// @AutoGenerate Date 2023-02-08 17:47:32
|
||||
// @AutoGenerate Version 2.1.4
|
||||
// @AutoGenerate Date 2023-02-20 16:41:58
|
||||
//
|
||||
package sysin
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
|
||||
// CurdDemoEditInp 修改/新增生成演示
|
||||
type CurdDemoEditInp struct {
|
||||
entity.Test
|
||||
entity.SysGenCurdDemo
|
||||
}
|
||||
|
||||
func (in *CurdDemoEditInp) Filter(ctx context.Context) (err error) {
|
||||
@@ -48,7 +48,7 @@ func (in *CurdDemoViewInp) Filter(ctx context.Context) (err error) {
|
||||
}
|
||||
|
||||
type CurdDemoViewModel struct {
|
||||
entity.Test
|
||||
entity.SysGenCurdDemo
|
||||
}
|
||||
|
||||
// CurdDemoListInp 获取生成演示列表
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,13 +1,16 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
@@ -26,6 +29,11 @@ type GenCodesMaxSortModel struct {
|
||||
type GenCodesEditInp struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
|
||||
func (in *GenCodesEditInp) Filter(ctx context.Context) (err error) {
|
||||
return genFilter(ctx, in.SysGenCodes)
|
||||
}
|
||||
|
||||
type GenCodesEditModel struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
@@ -75,19 +83,38 @@ type GenCodesSelectsModel struct {
|
||||
LinkMode form.Selects `json:"linkMode" dc:"关联表方式"`
|
||||
BuildMeth form.Selects `json:"buildMeth" dc:"生成方式"`
|
||||
// 字段表格选项
|
||||
FormMode form.Selects `json:"formMode" dc:"表单组件"`
|
||||
FormRole form.Selects `json:"formRole" dc:"表单验证"`
|
||||
DictMode DictTreeSelectModel `json:"dictMode" dc:"字典类型"`
|
||||
FormMode form.Selects `json:"formMode" dc:"表单组件"`
|
||||
FormRole form.Selects `json:"formRole" dc:"表单验证"`
|
||||
DictMode DictTreeSelectModel `json:"dictMode" dc:"字典类型"`
|
||||
WhereMode form.Selects `json:"whereMode" dc:"查询条件"`
|
||||
Addons form.Selects `json:"addons" dc:"插件选项"`
|
||||
}
|
||||
|
||||
type GenTypeSelects []*GenTypeSelect
|
||||
|
||||
type GenTypeSelect struct {
|
||||
Value int `json:"value"`
|
||||
Label string `json:"label"`
|
||||
Name string `json:"name"`
|
||||
Templates form.Selects `json:"templates"`
|
||||
Value int `json:"value"`
|
||||
Label string `json:"label"`
|
||||
Name string `json:"name"`
|
||||
Templates GenTemplateSelects `json:"templates"`
|
||||
}
|
||||
|
||||
type GenTemplateSelects []*GenTemplateSelect
|
||||
type GenTemplateSelect struct {
|
||||
Value interface{} `json:"value"`
|
||||
Label string `json:"label"`
|
||||
Name string `json:"name"`
|
||||
IsAddon bool `json:"isAddon"`
|
||||
}
|
||||
|
||||
func (p GenTemplateSelects) Len() int {
|
||||
return len(p)
|
||||
}
|
||||
func (p GenTemplateSelects) Swap(i, j int) {
|
||||
p[i], p[j] = p[j], p[i]
|
||||
}
|
||||
func (p GenTemplateSelects) Less(i, j int) bool {
|
||||
return gconv.Int64(p[j].Value) > gconv.Int64(p[i].Value)
|
||||
}
|
||||
|
||||
func (p GenTypeSelects) Len() int {
|
||||
@@ -141,6 +168,10 @@ type GenCodesPreviewInp struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
|
||||
func (in *GenCodesPreviewInp) Filter(ctx context.Context) (err error) {
|
||||
return genFilter(ctx, in.SysGenCodes)
|
||||
}
|
||||
|
||||
// GenFile 生成文件配置
|
||||
type GenFile struct {
|
||||
Content string `json:"content" dc:"页面内容"`
|
||||
@@ -158,3 +189,36 @@ type GenCodesPreviewModel struct {
|
||||
type GenCodesBuildInp struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
|
||||
func (in *GenCodesBuildInp) Filter(ctx context.Context) (err error) {
|
||||
return genFilter(ctx, in.SysGenCodes)
|
||||
}
|
||||
|
||||
func genFilter(ctx context.Context, in entity.SysGenCodes) (err error) {
|
||||
if in.VarName == "" {
|
||||
err = gerror.New("实体命名不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if !gregex.IsMatchString(`^[a-zA-Z]{1}\w{1,23}$`, in.VarName) {
|
||||
err = gerror.New("实体命名格式不正确,字母开头,只能包含字母、数字和下划线,长度在2~24之间")
|
||||
return
|
||||
}
|
||||
|
||||
if in.GenType == consts.GenCodesTypeCurd || in.GenType == consts.GenCodesTypeTree {
|
||||
if in.DbName == "" {
|
||||
err = gerror.New("数据库不能为空")
|
||||
return
|
||||
}
|
||||
if in.TableName == "" {
|
||||
err = gerror.New("数据库表不能为空")
|
||||
return
|
||||
}
|
||||
if in.TableComment == "" {
|
||||
err = gerror.New("菜单名称不能为空")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -27,7 +27,7 @@ type LoginLogViewInp struct {
|
||||
}
|
||||
|
||||
type LoginLogViewModel struct {
|
||||
entity.Test
|
||||
entity.SysLoginLog
|
||||
}
|
||||
|
||||
// LoginLogListInp 获取登录日志列表
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -26,7 +26,7 @@ type ServeLogViewInp struct {
|
||||
}
|
||||
|
||||
type ServeLogViewModel struct {
|
||||
entity.Test
|
||||
entity.SysServeLog
|
||||
}
|
||||
|
||||
// ServeLogListInp 获取服务日志列表
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,22 +1,17 @@
|
||||
// Package websocketin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package websocketin
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/internal/websocket"
|
||||
)
|
||||
|
||||
// SendToTagReq 发送标签消息
|
||||
type SendToTagReq struct {
|
||||
g.Meta `path:"/send/toTag" method:"post" tags:"WebSocket" summary:"发送标签消息"`
|
||||
// SendToTagInput 发送标签消息
|
||||
type SendToTagInput struct {
|
||||
Tag string `json:"tag" v:"required#tag不能为空" description:"标签"`
|
||||
Response websocket.WResponse `json:"response" v:"required#response不能为空" description:"响应内容"`
|
||||
}
|
||||
|
||||
type SendToTagRes struct {
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package model
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package model
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package model
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Package model
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
|
Reference in New Issue
Block a user