mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-26 16:46:14 +08:00
发布代码生成、更新20+表单组件,优化数据字典,gf版本更新到2.3.1
This commit is contained in:
@@ -20,6 +20,51 @@ type CashConfig struct {
|
||||
Tips string `json:"cashTips"`
|
||||
}
|
||||
|
||||
// UploadConfig 上传配置
|
||||
type UploadConfig struct {
|
||||
Drive string `json:"uploadDrive"`
|
||||
// 基本配置
|
||||
FileSize int64 `json:"uploadFileSize"`
|
||||
FileType string `json:"uploadFileType"`
|
||||
ImageSize int64 `json:"uploadImageSize"`
|
||||
ImageType string `json:"uploadImageType"`
|
||||
// 本地存储配置
|
||||
LocalPath string `json:"uploadLocalPath"`
|
||||
// UCloud对象存储配置
|
||||
UCloudBucketHost string `json:"uploadUCloudBucketHost"`
|
||||
UCloudBucketName string `json:"uploadUCloudBucketName"`
|
||||
UCloudEndpoint string `json:"uploadUCloudEndpoint"`
|
||||
UCloudFileHost string `json:"uploadUCloudFileHost"`
|
||||
UCloudPath string `json:"uploadUCloudPath"`
|
||||
UCloudPrivateKey string `json:"uploadUCloudPrivateKey"`
|
||||
UCloudPublicKey string `json:"uploadUCloudPublicKey"`
|
||||
}
|
||||
|
||||
// GeoConfig 地理配置
|
||||
type GeoConfig struct {
|
||||
GeoAmapWebKey string `json:"geoAmapWebKey"`
|
||||
}
|
||||
|
||||
// SmsTemplate 短信模板
|
||||
type SmsTemplate struct {
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
// SmsConfig 短信配置
|
||||
type SmsConfig struct {
|
||||
// 基础
|
||||
SmsDrive string `json:"smsDrive"`
|
||||
SmsMinInterval int `json:"smsMinInterval"`
|
||||
SmsMaxIpLimit int `json:"smsMaxIpLimit"`
|
||||
SmsCodeExpire int `json:"smsCodeExpire"`
|
||||
// 阿里云
|
||||
SmsAliyunAccessKeyID string `json:"smsAliyunAccessKeyID"`
|
||||
SmsAliyunAccessKeySecret string `json:"smsAliyunAccessKeySecret"`
|
||||
SmsAliyunSign string `json:"smsAliyunSign"`
|
||||
SmsAliyunTemplate []*SmsTemplate `json:"smsAliyunTemplate"`
|
||||
}
|
||||
|
||||
///////////// 以下是本地配置
|
||||
|
||||
// SSLConfig https配置
|
||||
@@ -28,3 +73,57 @@ type SSLConfig struct {
|
||||
CrtPath string `json:"crtPath"`
|
||||
KeyPath string `json:"keyPath"`
|
||||
}
|
||||
|
||||
// LogConfig 日志配置
|
||||
type LogConfig struct {
|
||||
Switch bool `json:"switch"`
|
||||
Queue bool `json:"queue"`
|
||||
Module []string `json:"module"`
|
||||
SkipCode []string `json:"skipCode"`
|
||||
}
|
||||
|
||||
// GenerateAppCrudTemplate curd模板
|
||||
type GenerateAppCrudTemplate struct {
|
||||
Group string `json:"group"`
|
||||
TemplatePath string `json:"templatePath"`
|
||||
ApiPath string `json:"apiPath"`
|
||||
InputPath string `json:"inputPath"`
|
||||
ControllerPath string `json:"controllerPath"`
|
||||
LogicPath string `json:"logicPath"`
|
||||
RouterPath string `json:"routerPath"`
|
||||
SqlPath string `json:"sqlPath"`
|
||||
WebApiPath string `json:"webApiPath"`
|
||||
WebViewsPath string `json:"webViewsPath"`
|
||||
}
|
||||
|
||||
// GenerateAppQueueTemplate 消息队列模板
|
||||
type GenerateAppQueueTemplate struct {
|
||||
Group string `json:"group"`
|
||||
TemplatePath string `json:"templatePath"`
|
||||
}
|
||||
|
||||
// GenerateAppTreeTemplate 关系树列表模板
|
||||
type GenerateAppTreeTemplate struct {
|
||||
Group string `json:"group"`
|
||||
TemplatePath string `json:"templatePath"`
|
||||
}
|
||||
|
||||
// GenerateConfig 生成代码配置
|
||||
type GenerateConfig struct {
|
||||
AllowedIPs []string `json:"allowedIPs"`
|
||||
Application struct {
|
||||
Crud struct {
|
||||
Templates []*GenerateAppCrudTemplate `json:"templates"`
|
||||
} `json:"crud"`
|
||||
Queue struct {
|
||||
Templates []*GenerateAppQueueTemplate `json:"templates"`
|
||||
} `json:"queue"`
|
||||
Tree 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"`
|
||||
}
|
||||
|
@@ -16,23 +16,25 @@ type Context struct {
|
||||
TakeUpTime int64 // 请求耗时 ms
|
||||
User *Identity // 上下文用户信息
|
||||
Response *Response // 请求响应
|
||||
Data g.Map // 自定KV变量,业务模块根据需要设置,不固定
|
||||
Data g.Map // 自定kv变量,业务模块根据需要设置,不固定
|
||||
}
|
||||
|
||||
// Identity 通用身份模型
|
||||
type Identity struct {
|
||||
Id int64 `json:"id" description:"会员ID"`
|
||||
Username string `json:"username" description:"用户名"`
|
||||
RealName string `json:"realname" description:"昵称"`
|
||||
Avatar string `json:"avatar" description:"头像"`
|
||||
Email string `json:"email" description:"邮箱"`
|
||||
Mobile string `json:"mobile" description:"手机号码"`
|
||||
VisitCount uint `json:"visit_count" description:"访问次数"`
|
||||
LastTime int `json:"last_time" description:"最后一次登录时间"`
|
||||
LastIp string `json:"last_ip" description:"最后一次登录ip"`
|
||||
Role int64 `json:"role" description:"角色ID"`
|
||||
RoleKey string `json:"role_key" description:"角色唯一标识符"`
|
||||
Exp int64 `json:"exp" description:"登录有效期截止时间戳"`
|
||||
Expires int64 `json:"expires" description:"登录有效期"`
|
||||
App string `json:"app" description:"登录应用"`
|
||||
Id int64 `json:"id" description:"会员ID"`
|
||||
Pid int64 `json:"pid" description:"上级ID"`
|
||||
DeptId int64 `json:"deptId" description:"部门ID"`
|
||||
RoleId int64 `json:"roleId" description:"角色ID"`
|
||||
RoleKey string `json:"roleKey" description:"角色唯一标识符"`
|
||||
Username string `json:"username" description:"用户名"`
|
||||
RealName string `json:"realName" description:"昵称"`
|
||||
Avatar string `json:"avatar" description:"头像"`
|
||||
Email string `json:"email" description:"邮箱"`
|
||||
Mobile string `json:"mobile" description:"手机号码"`
|
||||
VisitCount uint `json:"visitCount" description:"访问次数"`
|
||||
LastTime int `json:"lastTime" description:"最后一次登录时间"`
|
||||
LastIp string `json:"lastIp" description:"最后一次登录ip"`
|
||||
Exp int64 `json:"exp" description:"登录有效期截止时间戳"`
|
||||
Expires int64 `json:"expires" description:"登录有效期"`
|
||||
App string `json:"app" description:"登录应用"`
|
||||
}
|
||||
|
@@ -12,8 +12,8 @@ import (
|
||||
// AdminDept is the golang structure of table hg_admin_dept for DAO operations like Where/Data.
|
||||
type AdminDept struct {
|
||||
g.Meta `orm:"table:hg_admin_dept, do:true"`
|
||||
Id interface{} // 部门id
|
||||
Pid interface{} // 父部门id
|
||||
Id interface{} // 部门ID
|
||||
Pid interface{} // 父部门ID
|
||||
Name interface{} // 部门名称
|
||||
Code interface{} // 部门编码
|
||||
Type interface{} // 部门类型
|
||||
|
@@ -12,31 +12,31 @@ import (
|
||||
// AdminMember is the golang structure of table hg_admin_member for DAO operations like Where/Data.
|
||||
type AdminMember struct {
|
||||
g.Meta `orm:"table:hg_admin_member, do:true"`
|
||||
Id interface{} //
|
||||
Id interface{} // 管理员ID
|
||||
DeptId interface{} // 部门ID
|
||||
RoleId interface{} // 角色ID
|
||||
RealName interface{} // 真实姓名
|
||||
Username interface{} // 帐号
|
||||
PasswordHash interface{} // 密码
|
||||
Salt interface{} // 密码盐
|
||||
AuthKey interface{} // 授权令牌
|
||||
PasswordResetToken interface{} // 密码重置令牌
|
||||
Type interface{} // 1:普通管理员;10超级管理员
|
||||
Realname interface{} // 真实姓名
|
||||
Avatar interface{} // 头像
|
||||
Sex interface{} // 性别[1:男;2:女;3:未知]
|
||||
Sex interface{} // 性别
|
||||
Qq interface{} // qq
|
||||
Email interface{} // 邮箱
|
||||
Birthday *gtime.Time // 生日
|
||||
ProvinceId interface{} // 省
|
||||
CityId interface{} // 城市
|
||||
AreaId interface{} // 地区
|
||||
Address interface{} // 默认地址
|
||||
Mobile interface{} // 手机号码
|
||||
HomePhone interface{} // 家庭号码
|
||||
DingtalkRobotToken interface{} // 钉钉机器人token
|
||||
Birthday *gtime.Time // 生日
|
||||
ProvinceId interface{} // 省编码
|
||||
CityId interface{} // 城市编码
|
||||
CountyId interface{} // 区域编码
|
||||
Address interface{} // 联系地址
|
||||
VisitCount interface{} // 访问次数
|
||||
LastTime interface{} // 最后一次登录时间
|
||||
LastIp interface{} // 最后一次登录ip
|
||||
Role interface{} // 权限
|
||||
Pid interface{} // 上级管理员ID
|
||||
Level interface{} // 关系树等级
|
||||
Tree interface{} // 关系树
|
||||
Remark interface{} // 备注
|
||||
Status interface{} // 状态
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
|
@@ -11,6 +11,6 @@ import (
|
||||
// AdminMemberPost is the golang structure of table hg_admin_member_post for DAO operations like Where/Data.
|
||||
type AdminMemberPost struct {
|
||||
g.Meta `orm:"table:hg_admin_member_post, do:true"`
|
||||
MemberId interface{} // 用户ID
|
||||
MemberId interface{} // 管理员ID
|
||||
PostId interface{} // 岗位ID
|
||||
}
|
||||
|
@@ -11,6 +11,6 @@ import (
|
||||
// AdminMemberRole is the golang structure of table hg_admin_member_role for DAO operations like Where/Data.
|
||||
type AdminMemberRole struct {
|
||||
g.Meta `orm:"table:hg_admin_member_role, do:true"`
|
||||
MemberId interface{} // 用户ID
|
||||
MemberId interface{} // 管理员ID
|
||||
RoleId interface{} // 角色ID
|
||||
}
|
||||
|
@@ -31,8 +31,8 @@ type AdminMenu struct {
|
||||
KeepAlive interface{} // 缓存该路由
|
||||
Hidden interface{} // 是否隐藏
|
||||
Affix interface{} // 是否固定
|
||||
Level interface{} // 级别
|
||||
Tree interface{} // 树
|
||||
Level interface{} // 关系树等级
|
||||
Tree interface{} // 关系树
|
||||
Sort interface{} // 排序
|
||||
Remark interface{} // 备注
|
||||
Status interface{} // 菜单状态
|
||||
|
@@ -14,7 +14,7 @@ type AdminNotice struct {
|
||||
g.Meta `orm:"table:hg_admin_notice, do:true"`
|
||||
Id interface{} // 公告ID
|
||||
Title interface{} // 公告标题
|
||||
Type interface{} // 公告类型(1通知 2公告)
|
||||
Type interface{} // 公告类型
|
||||
Content interface{} // 公告内容
|
||||
Receiver interface{} // 接收者
|
||||
Reader interface{} // 已读人
|
||||
|
@@ -5,22 +5,25 @@
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// AdminRole is the golang structure of table hg_admin_role for DAO operations like Where/Data.
|
||||
type AdminRole struct {
|
||||
g.Meta `orm:"table:hg_admin_role, do:true"`
|
||||
Id interface{} // 角色ID
|
||||
Name interface{} // 角色名称
|
||||
Key interface{} // 角色权限字符串
|
||||
DataScope interface{} // 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)
|
||||
MenuCheckStrictly interface{} // 菜单树选择项是否关联显示
|
||||
DeptCheckStrictly interface{} // 部门树选择项是否关联显示
|
||||
Remark interface{} // 备注
|
||||
Sort interface{} // 排序
|
||||
Status interface{} // 角色状态
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
g.Meta `orm:"table:hg_admin_role, do:true"`
|
||||
Id interface{} // 角色ID
|
||||
Name interface{} // 角色名称
|
||||
Key interface{} // 角色权限字符串
|
||||
DataScope interface{} // 数据范围
|
||||
CustomDept *gjson.Json // 自定义部门权限
|
||||
Pid interface{} // 上级角色ID
|
||||
Level interface{} // 关系树等级
|
||||
Tree interface{} // 关系树
|
||||
Remark interface{} // 备注
|
||||
Sort interface{} // 排序
|
||||
Status interface{} // 角色状态
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
}
|
||||
|
@@ -12,18 +12,18 @@ import (
|
||||
// SysAttachment is the golang structure of table hg_sys_attachment for DAO operations like Where/Data.
|
||||
type SysAttachment struct {
|
||||
g.Meta `orm:"table:hg_sys_attachment, do:true"`
|
||||
Id interface{} //
|
||||
Id interface{} // 文件ID
|
||||
AppId interface{} // 应用ID
|
||||
MemberId interface{} // 用户
|
||||
CateId interface{} // 分类
|
||||
Drive interface{} // 驱动
|
||||
MemberId interface{} // 管理员ID
|
||||
CateId interface{} // 上传分类
|
||||
Drive interface{} // 上传驱动
|
||||
Name interface{} // 文件原始名
|
||||
Kind interface{} // 上传类型
|
||||
MetaType interface{} // 类别
|
||||
MetaType interface{} // 文件类型
|
||||
NaiveType interface{} // NaiveUI类型
|
||||
Path interface{} // 本地路径
|
||||
FileUrl interface{} // url
|
||||
Size interface{} // 长度
|
||||
Size interface{} // 文件大小
|
||||
Ext interface{} // 扩展名
|
||||
Md5 interface{} // md5校验码
|
||||
Status interface{} // 状态
|
||||
|
@@ -12,8 +12,8 @@ import (
|
||||
// SysBlacklist is the golang structure of table hg_sys_blacklist for DAO operations like Where/Data.
|
||||
type SysBlacklist struct {
|
||||
g.Meta `orm:"table:hg_sys_blacklist, do:true"`
|
||||
Id interface{} // 主键
|
||||
Ip interface{} // ip地址
|
||||
Id interface{} // 黑名单ID
|
||||
Ip interface{} // IP地址
|
||||
Remark interface{} // 备注
|
||||
Status interface{} // 状态
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
|
@@ -13,15 +13,15 @@ import (
|
||||
type SysConfig struct {
|
||||
g.Meta `orm:"table:hg_sys_config, do:true"`
|
||||
Id interface{} // 配置ID
|
||||
Group interface{} // 分组
|
||||
Group interface{} // 配置分组
|
||||
Name interface{} // 参数名称
|
||||
Type interface{} // 类型:string,text,int,bool,array,datetime,date,file
|
||||
Type interface{} // 键值类型:string,int,uint,bool,datetime,date
|
||||
Key interface{} // 参数键名
|
||||
Value interface{} // 参数键值
|
||||
DefaultValue interface{} // 默认值
|
||||
Sort interface{} // 排序
|
||||
Tip interface{} // 变量描述
|
||||
IsDefault interface{} // 是否默认
|
||||
IsDefault interface{} // 是否为系统默认
|
||||
Status interface{} // 状态
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
// SysCron is the golang structure of table hg_sys_cron for DAO operations like Where/Data.
|
||||
type SysCron struct {
|
||||
g.Meta `orm:"table:hg_sys_cron, do:true"`
|
||||
Id interface{} // 主键
|
||||
Id interface{} // 任务ID
|
||||
GroupId interface{} // 分组ID
|
||||
Name interface{} // 任务名称
|
||||
Params interface{} // 函数参数
|
||||
@@ -21,7 +21,7 @@ type SysCron struct {
|
||||
Count interface{} // 执行次数
|
||||
Sort interface{} // 排序
|
||||
Remark interface{} // 备注
|
||||
Status interface{} // 状态
|
||||
Status interface{} // 任务状态
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
}
|
||||
|
@@ -12,13 +12,13 @@ import (
|
||||
// SysCronGroup is the golang structure of table hg_sys_cron_group for DAO operations like Where/Data.
|
||||
type SysCronGroup struct {
|
||||
g.Meta `orm:"table:hg_sys_cron_group, do:true"`
|
||||
Id interface{} // 主键
|
||||
Pid interface{} // 父类ID
|
||||
Id interface{} // 任务分组ID
|
||||
Pid interface{} // 父类任务分组ID
|
||||
Name interface{} // 分组名称
|
||||
IsDefault interface{} // 是否默认
|
||||
Sort interface{} // 排序
|
||||
Remark interface{} // 备注
|
||||
Status interface{} // 状态
|
||||
Status interface{} // 分组状态
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
}
|
||||
|
@@ -12,12 +12,13 @@ import (
|
||||
// SysDictData is the golang structure of table hg_sys_dict_data for DAO operations like Where/Data.
|
||||
type SysDictData struct {
|
||||
g.Meta `orm:"table:hg_sys_dict_data, do:true"`
|
||||
Id interface{} // 字典编码
|
||||
Id interface{} // 字典数据ID
|
||||
Label interface{} // 字典标签
|
||||
Value interface{} // 字典键值
|
||||
ValueType interface{} // 键值数据类型:string,int,uint,bool,datetime,date
|
||||
Type interface{} // 字典类型
|
||||
ListClass interface{} // 表格回显样式
|
||||
IsDefault interface{} // 是否默认
|
||||
IsDefault interface{} // 是否为系统默认
|
||||
Sort interface{} // 字典排序
|
||||
Remark interface{} // 备注
|
||||
Status interface{} // 状态
|
||||
|
@@ -12,13 +12,13 @@ import (
|
||||
// SysDictType is the golang structure of table hg_sys_dict_type for DAO operations like Where/Data.
|
||||
type SysDictType struct {
|
||||
g.Meta `orm:"table:hg_sys_dict_type, do:true"`
|
||||
Id interface{} // 字典主键
|
||||
Pid interface{} // 父类ID
|
||||
Name interface{} // 字典名称
|
||||
Id interface{} // 字典类型ID
|
||||
Pid interface{} // 父类字典类型ID
|
||||
Name interface{} // 字典类型名称
|
||||
Type interface{} // 字典类型
|
||||
Sort interface{} // 排序
|
||||
Remark interface{} // 备注
|
||||
Status interface{} // 状态
|
||||
Status interface{} // 字典类型状态
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
}
|
||||
|
28
server/internal/model/do/sys_gen_codes.go
Normal file
28
server/internal/model/do/sys_gen_codes.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// =================================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// SysGenCodes is the golang structure of table hg_sys_gen_codes for DAO operations like Where/Data.
|
||||
type SysGenCodes struct {
|
||||
g.Meta `orm:"table:hg_sys_gen_codes, do:true"`
|
||||
Id interface{} // 生成ID
|
||||
GenType interface{} // 生成类型
|
||||
VarName interface{} // 实体命名
|
||||
Options *gjson.Json // 配置选项
|
||||
DbName interface{} // 数据库名称
|
||||
TableName interface{} // 主表名称
|
||||
TableComment interface{} // 主表注释
|
||||
DaoName interface{} // 主表dao模型
|
||||
MasterColumns *gjson.Json // 主表字段
|
||||
Status interface{} // 生成状态
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
}
|
30
server/internal/model/do/sys_gen_curd_demo.go
Normal file
30
server/internal/model/do/sys_gen_curd_demo.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// =================================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// SysGenCurdDemo is the golang structure of table hg_sys_gen_curd_demo for DAO operations like Where/Data.
|
||||
type SysGenCurdDemo struct {
|
||||
g.Meta `orm:"table:hg_sys_gen_curd_demo, do:true"`
|
||||
Id interface{} // ID
|
||||
CategoryId interface{} // 分类ID
|
||||
Title interface{} // 标题
|
||||
Description interface{} // 描述
|
||||
Content interface{} // 内容
|
||||
Image interface{} // 单图
|
||||
Attachfile interface{} // 附件
|
||||
Switch interface{} // 显示开关
|
||||
Sort interface{} // 排序
|
||||
Status interface{} // 状态
|
||||
CreatedBy interface{} // 创建者
|
||||
UpdatedBy interface{} // 更新者
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 修改时间
|
||||
DeletedAt *gtime.Time // 删除时间
|
||||
}
|
@@ -5,6 +5,7 @@
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
@@ -12,23 +13,23 @@ import (
|
||||
// SysLog is the golang structure of table hg_sys_log for DAO operations like Where/Data.
|
||||
type SysLog struct {
|
||||
g.Meta `orm:"table:hg_sys_log, do:true"`
|
||||
Id interface{} //
|
||||
AppId interface{} // 应用id
|
||||
MerchantId interface{} // 商户id
|
||||
MemberId interface{} // 用户id
|
||||
Id interface{} // 日志ID
|
||||
AppId interface{} // 应用ID
|
||||
MerchantId interface{} // 商户ID
|
||||
MemberId interface{} // 用户ID
|
||||
Method interface{} // 提交类型
|
||||
Module interface{} // 模块
|
||||
Module interface{} // 访问模块
|
||||
Url interface{} // 提交url
|
||||
GetData interface{} // get数据
|
||||
PostData interface{} // post数据
|
||||
HeaderData interface{} // header数据
|
||||
Ip interface{} // ip地址
|
||||
GetData *gjson.Json // get数据
|
||||
PostData *gjson.Json // post数据
|
||||
HeaderData *gjson.Json // header数据
|
||||
Ip interface{} // IP地址
|
||||
ProvinceId interface{} // 省编码
|
||||
CityId interface{} // 市编码
|
||||
ErrorCode interface{} // 报错code
|
||||
ErrorMsg interface{} // 报错信息
|
||||
ErrorData interface{} // 报错日志
|
||||
ReqId interface{} // 对外id
|
||||
ErrorData *gjson.Json // 报错日志
|
||||
ReqId interface{} // 对外ID
|
||||
Timestamp interface{} // 响应时间
|
||||
UserAgent interface{} // UA信息
|
||||
TakeUpTime interface{} // 请求耗时
|
||||
|
@@ -12,17 +12,17 @@ import (
|
||||
// SysProvinces is the golang structure of table hg_sys_provinces for DAO operations like Where/Data.
|
||||
type SysProvinces struct {
|
||||
g.Meta `orm:"table:hg_sys_provinces, do:true"`
|
||||
Id interface{} // ID
|
||||
Title interface{} // 栏目名
|
||||
Pid interface{} // 父栏目
|
||||
Id interface{} // 省市区ID
|
||||
Title interface{} // 栏目名称
|
||||
ShortTitle interface{} // 缩写
|
||||
Areacode interface{} // 区域编码
|
||||
Zipcode interface{} // 邮政编码
|
||||
Pinyin interface{} // 拼音
|
||||
Lng interface{} // 经度
|
||||
Lat interface{} // 纬度
|
||||
Level interface{} // 级别
|
||||
Tree interface{} //
|
||||
Pid interface{} // 父栏目
|
||||
Level interface{} // 关系树等级
|
||||
Tree interface{} // 关系
|
||||
Sort interface{} // 排序
|
||||
Status interface{} // 状态
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
|
52
server/internal/model/do/test.go
Normal file
52
server/internal/model/do/test.go
Normal file
@@ -0,0 +1,52 @@
|
||||
// =================================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"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"`
|
||||
Id interface{} // ID
|
||||
CategoryId interface{} // 分类ID
|
||||
Flag *gjson.Json // 标签
|
||||
Title interface{} // 标题
|
||||
Description interface{} // 描述
|
||||
Content interface{} // 内容
|
||||
Image interface{} // 单图
|
||||
Images *gjson.Json // 多图
|
||||
Attachfile interface{} // 附件
|
||||
Attachfiles *gjson.Json // 多附件
|
||||
Map *gjson.Json // 动态键值对
|
||||
Star interface{} // 推荐星
|
||||
Price interface{} // 价格
|
||||
Views interface{} // 浏览次数
|
||||
ActivityAt *gtime.Time // 活动时间
|
||||
StartAt *gtime.Time // 开启时间
|
||||
EndAt *gtime.Time // 结束时间
|
||||
Switch interface{} // 开关
|
||||
Sort interface{} // 排序
|
||||
Avatar interface{} // 头像
|
||||
Sex interface{} // 性别
|
||||
Qq interface{} // qq
|
||||
Email interface{} // 邮箱
|
||||
Mobile interface{} // 手机号码
|
||||
Hobby *gjson.Json // 爱好
|
||||
Channel interface{} // 渠道
|
||||
Pid interface{} // 上级ID
|
||||
Level interface{} // 树等级
|
||||
Tree interface{} // 关系树
|
||||
Remark interface{} // 备注
|
||||
Status interface{} // 状态
|
||||
CreatedBy interface{} // 创建者
|
||||
UpdatedBy interface{} // 更新者
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 修改时间
|
||||
DeletedAt *gtime.Time // 删除时间
|
||||
}
|
24
server/internal/model/do/test_category.go
Normal file
24
server/internal/model/do/test_category.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// =================================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// TestCategory is the golang structure of table hg_test_category for DAO operations like Where/Data.
|
||||
type TestCategory struct {
|
||||
g.Meta `orm:"table:hg_test_category, do:true"`
|
||||
Id interface{} // 分类ID
|
||||
Name interface{} // 分类名称
|
||||
Description interface{} // 描述
|
||||
Sort interface{} // 排序
|
||||
Remark interface{} // 备注
|
||||
Status interface{} // 状态
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 修改时间
|
||||
DeletedAt *gtime.Time // 删除时间
|
||||
}
|
@@ -10,8 +10,8 @@ import (
|
||||
|
||||
// AdminDept is the golang structure for table admin_dept.
|
||||
type AdminDept struct {
|
||||
Id int64 `json:"id" description:"部门id"`
|
||||
Pid int64 `json:"pid" description:"父部门id"`
|
||||
Id int64 `json:"id" description:"部门ID"`
|
||||
Pid int64 `json:"pid" description:"父部门ID"`
|
||||
Name string `json:"name" description:"部门名称"`
|
||||
Code string `json:"code" description:"部门编码"`
|
||||
Type string `json:"type" description:"部门类型"`
|
||||
|
@@ -10,31 +10,31 @@ import (
|
||||
|
||||
// AdminMember is the golang structure for table admin_member.
|
||||
type AdminMember struct {
|
||||
Id int64 `json:"id" description:""`
|
||||
Id int64 `json:"id" description:"管理员ID"`
|
||||
DeptId int64 `json:"deptId" description:"部门ID"`
|
||||
RoleId int64 `json:"roleId" description:"角色ID"`
|
||||
RealName string `json:"realName" description:"真实姓名"`
|
||||
Username string `json:"username" description:"帐号"`
|
||||
PasswordHash string `json:"passwordHash" description:"密码"`
|
||||
Salt string `json:"salt" description:"密码盐"`
|
||||
AuthKey string `json:"authKey" description:"授权令牌"`
|
||||
PasswordResetToken string `json:"passwordResetToken" description:"密码重置令牌"`
|
||||
Type string `json:"type" description:"1:普通管理员;10超级管理员"`
|
||||
Realname string `json:"realname" description:"真实姓名"`
|
||||
Avatar string `json:"avatar" description:"头像"`
|
||||
Sex int `json:"sex" description:"性别[1:男;2:女;3:未知]"`
|
||||
Sex int `json:"sex" description:"性别"`
|
||||
Qq string `json:"qq" description:"qq"`
|
||||
Email string `json:"email" description:"邮箱"`
|
||||
Birthday *gtime.Time `json:"birthday" description:"生日"`
|
||||
ProvinceId int `json:"provinceId" description:"省"`
|
||||
CityId int `json:"cityId" description:"城市"`
|
||||
AreaId int `json:"areaId" description:"地区"`
|
||||
Address string `json:"address" description:"默认地址"`
|
||||
Mobile string `json:"mobile" description:"手机号码"`
|
||||
HomePhone string `json:"homePhone" description:"家庭号码"`
|
||||
DingtalkRobotToken string `json:"dingtalkRobotToken" description:"钉钉机器人token"`
|
||||
Birthday *gtime.Time `json:"birthday" description:"生日"`
|
||||
ProvinceId int64 `json:"provinceId" description:"省编码"`
|
||||
CityId int64 `json:"cityId" description:"城市编码"`
|
||||
CountyId int64 `json:"countyId" description:"区域编码"`
|
||||
Address string `json:"address" description:"联系地址"`
|
||||
VisitCount uint `json:"visitCount" description:"访问次数"`
|
||||
LastTime int `json:"lastTime" description:"最后一次登录时间"`
|
||||
LastIp string `json:"lastIp" description:"最后一次登录ip"`
|
||||
Role int64 `json:"role" 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:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
|
@@ -6,6 +6,6 @@ package entity
|
||||
|
||||
// AdminMemberPost is the golang structure for table admin_member_post.
|
||||
type AdminMemberPost struct {
|
||||
MemberId int64 `json:"memberId" description:"用户ID"`
|
||||
MemberId int64 `json:"memberId" description:"管理员ID"`
|
||||
PostId int64 `json:"postId" description:"岗位ID"`
|
||||
}
|
||||
|
@@ -6,6 +6,6 @@ package entity
|
||||
|
||||
// AdminMemberRole is the golang structure for table admin_member_role.
|
||||
type AdminMemberRole struct {
|
||||
MemberId int64 `json:"memberId" description:"用户ID"`
|
||||
MemberId int64 `json:"memberId" description:"管理员ID"`
|
||||
RoleId int64 `json:"roleId" description:"角色ID"`
|
||||
}
|
||||
|
@@ -29,8 +29,8 @@ type AdminMenu struct {
|
||||
KeepAlive int `json:"keepAlive" description:"缓存该路由"`
|
||||
Hidden int `json:"hidden" description:"是否隐藏"`
|
||||
Affix int `json:"affix" description:"是否固定"`
|
||||
Level int `json:"level" description:"级别"`
|
||||
Tree string `json:"tree" description:"树"`
|
||||
Level int `json:"level" description:"关系树等级"`
|
||||
Tree string `json:"tree" description:"关系树"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"菜单状态"`
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
type AdminNotice struct {
|
||||
Id int64 `json:"id" description:"公告ID"`
|
||||
Title string `json:"title" description:"公告标题"`
|
||||
Type int64 `json:"type" description:"公告类型(1通知 2公告)"`
|
||||
Type int64 `json:"type" description:"公告类型"`
|
||||
Content string `json:"content" description:"公告内容"`
|
||||
Receiver string `json:"receiver" description:"接收者"`
|
||||
Reader string `json:"reader" description:"已读人"`
|
||||
|
@@ -5,20 +5,23 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// AdminRole is the golang structure for table admin_role.
|
||||
type AdminRole struct {
|
||||
Id int64 `json:"id" description:"角色ID"`
|
||||
Name string `json:"name" description:"角色名称"`
|
||||
Key string `json:"key" description:"角色权限字符串"`
|
||||
DataScope int `json:"dataScope" description:"数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)"`
|
||||
MenuCheckStrictly int `json:"menuCheckStrictly" description:"菜单树选择项是否关联显示"`
|
||||
DeptCheckStrictly int `json:"deptCheckStrictly" description:"部门树选择项是否关联显示"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Status int `json:"status" description:"角色状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"`
|
||||
Id int64 `json:"id" description:"角色ID"`
|
||||
Name string `json:"name" description:"角色名称"`
|
||||
Key string `json:"key" description:"角色权限字符串"`
|
||||
DataScope int `json:"dataScope" description:"数据范围"`
|
||||
CustomDept *gjson.Json `json:"customDept" description:"自定义部门权限"`
|
||||
Pid int64 `json:"pid" description:"上级角色ID"`
|
||||
Level int `json:"level" description:"关系树等级"`
|
||||
Tree string `json:"tree" description:"关系树"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Status int `json:"status" description:"角色状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"`
|
||||
}
|
||||
|
@@ -10,18 +10,18 @@ import (
|
||||
|
||||
// SysAttachment is the golang structure for table sys_attachment.
|
||||
type SysAttachment struct {
|
||||
Id int64 `json:"id" description:""`
|
||||
Id int64 `json:"id" description:"文件ID"`
|
||||
AppId string `json:"appId" description:"应用ID"`
|
||||
MemberId int64 `json:"memberId" description:"用户"`
|
||||
CateId uint64 `json:"cateId" description:"分类"`
|
||||
Drive string `json:"drive" description:"驱动"`
|
||||
MemberId int64 `json:"memberId" description:"管理员ID"`
|
||||
CateId uint64 `json:"cateId" description:"上传分类"`
|
||||
Drive string `json:"drive" description:"上传驱动"`
|
||||
Name string `json:"name" description:"文件原始名"`
|
||||
Kind string `json:"kind" description:"上传类型"`
|
||||
MetaType string `json:"metaType" description:"类别"`
|
||||
MetaType string `json:"metaType" description:"文件类型"`
|
||||
NaiveType string `json:"naiveType" description:"NaiveUI类型"`
|
||||
Path string `json:"path" description:"本地路径"`
|
||||
FileUrl string `json:"fileUrl" description:"url"`
|
||||
Size int64 `json:"size" description:"长度"`
|
||||
Size int64 `json:"size" description:"文件大小"`
|
||||
Ext string `json:"ext" description:"扩展名"`
|
||||
Md5 string `json:"md5" description:"md5校验码"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
|
@@ -10,8 +10,8 @@ import (
|
||||
|
||||
// SysBlacklist is the golang structure for table sys_blacklist.
|
||||
type SysBlacklist struct {
|
||||
Id int64 `json:"id" description:"主键"`
|
||||
Ip string `json:"ip" description:"ip地址"`
|
||||
Id int64 `json:"id" description:"黑名单ID"`
|
||||
Ip string `json:"ip" description:"IP地址"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
|
@@ -11,15 +11,15 @@ import (
|
||||
// SysConfig is the golang structure for table sys_config.
|
||||
type SysConfig struct {
|
||||
Id int64 `json:"id" description:"配置ID"`
|
||||
Group string `json:"group" description:"分组"`
|
||||
Group string `json:"group" description:"配置分组"`
|
||||
Name string `json:"name" description:"参数名称"`
|
||||
Type string `json:"type" description:"类型:string,text,int,bool,array,datetime,date,file"`
|
||||
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:"是否默认"`
|
||||
IsDefault int `json:"isDefault" description:"是否为系统默认"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"`
|
||||
|
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
// SysCron is the golang structure for table sys_cron.
|
||||
type SysCron struct {
|
||||
Id int64 `json:"id" description:"主键"`
|
||||
Id int64 `json:"id" description:"任务ID"`
|
||||
GroupId int64 `json:"groupId" description:"分组ID"`
|
||||
Name string `json:"name" description:"任务名称"`
|
||||
Params string `json:"params" description:"函数参数"`
|
||||
@@ -19,7 +19,7 @@ type SysCron struct {
|
||||
Count int64 `json:"count" description:"执行次数"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
Status int `json:"status" description:"任务状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"`
|
||||
}
|
||||
|
@@ -10,13 +10,13 @@ import (
|
||||
|
||||
// SysCronGroup is the golang structure for table sys_cron_group.
|
||||
type SysCronGroup struct {
|
||||
Id int64 `json:"id" description:"主键"`
|
||||
Pid int64 `json:"pid" description:"父类ID"`
|
||||
Id int64 `json:"id" description:"任务分组ID"`
|
||||
Pid int64 `json:"pid" description:"父类任务分组ID"`
|
||||
Name string `json:"name" description:"分组名称"`
|
||||
IsDefault int `json:"isDefault" description:"是否默认"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
Status int `json:"status" description:"分组状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"`
|
||||
}
|
||||
|
@@ -10,12 +10,13 @@ import (
|
||||
|
||||
// SysDictData is the golang structure for table sys_dict_data.
|
||||
type SysDictData struct {
|
||||
Id int64 `json:"id" description:"字典编码"`
|
||||
Id int64 `json:"id" description:"字典数据ID"`
|
||||
Label string `json:"label" description:"字典标签"`
|
||||
Value string `json:"value" description:"字典键值"`
|
||||
ValueType string `json:"valueType" description:"键值数据类型:string,int,uint,bool,datetime,date"`
|
||||
Type string `json:"type" description:"字典类型"`
|
||||
ListClass string `json:"listClass" description:"表格回显样式"`
|
||||
IsDefault int `json:"isDefault" description:"是否默认"`
|
||||
IsDefault int `json:"isDefault" description:"是否为系统默认"`
|
||||
Sort int `json:"sort" description:"字典排序"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
|
@@ -10,13 +10,13 @@ import (
|
||||
|
||||
// SysDictType is the golang structure for table sys_dict_type.
|
||||
type SysDictType struct {
|
||||
Id int64 `json:"id" description:"字典主键"`
|
||||
Pid int64 `json:"pid" description:"父类ID"`
|
||||
Name string `json:"name" description:"字典名称"`
|
||||
Id int64 `json:"id" description:"字典类型ID"`
|
||||
Pid int64 `json:"pid" description:"父类字典类型ID"`
|
||||
Name string `json:"name" description:"字典类型名称"`
|
||||
Type string `json:"type" description:"字典类型"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
Status int `json:"status" description:"字典类型状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"`
|
||||
}
|
||||
|
26
server/internal/model/entity/sys_gen_codes.go
Normal file
26
server/internal/model/entity/sys_gen_codes.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// =================================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// SysGenCodes is the golang structure for table sys_gen_codes.
|
||||
type SysGenCodes struct {
|
||||
Id int64 `json:"id" description:"生成ID"`
|
||||
GenType uint `json:"genType" description:"生成类型"`
|
||||
VarName string `json:"varName" description:"实体命名"`
|
||||
Options *gjson.Json `json:"options" description:"配置选项"`
|
||||
DbName string `json:"dbName" description:"数据库名称"`
|
||||
TableName string `json:"tableName" description:"主表名称"`
|
||||
TableComment string `json:"tableComment" description:"主表注释"`
|
||||
DaoName string `json:"daoName" description:"主表dao模型"`
|
||||
MasterColumns *gjson.Json `json:"masterColumns" description:"主表字段"`
|
||||
Status int `json:"status" description:"生成状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"`
|
||||
}
|
28
server/internal/model/entity/sys_gen_curd_demo.go
Normal file
28
server/internal/model/entity/sys_gen_curd_demo.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// =================================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// SysGenCurdDemo is the golang structure for table sys_gen_curd_demo.
|
||||
type SysGenCurdDemo struct {
|
||||
Id int64 `json:"id" description:"ID"`
|
||||
CategoryId int64 `json:"categoryId" description:"分类ID"`
|
||||
Title string `json:"title" description:"标题"`
|
||||
Description string `json:"description" description:"描述"`
|
||||
Content string `json:"content" description:"内容"`
|
||||
Image string `json:"image" description:"单图"`
|
||||
Attachfile string `json:"attachfile" description:"附件"`
|
||||
Switch int `json:"switch" description:"显示开关"`
|
||||
Sort int `json:"sort" 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:"删除时间"`
|
||||
}
|
@@ -5,28 +5,29 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// SysLog is the golang structure for table sys_log.
|
||||
type SysLog struct {
|
||||
Id int64 `json:"id" description:""`
|
||||
AppId string `json:"appId" description:"应用id"`
|
||||
MerchantId uint64 `json:"merchantId" description:"商户id"`
|
||||
MemberId int64 `json:"memberId" description:"用户id"`
|
||||
Id int64 `json:"id" description:"日志ID"`
|
||||
AppId string `json:"appId" description:"应用ID"`
|
||||
MerchantId uint64 `json:"merchantId" description:"商户ID"`
|
||||
MemberId int64 `json:"memberId" description:"用户ID"`
|
||||
Method string `json:"method" description:"提交类型"`
|
||||
Module string `json:"module" description:"模块"`
|
||||
Module string `json:"module" description:"访问模块"`
|
||||
Url string `json:"url" description:"提交url"`
|
||||
GetData string `json:"getData" description:"get数据"`
|
||||
PostData string `json:"postData" description:"post数据"`
|
||||
HeaderData string `json:"headerData" description:"header数据"`
|
||||
Ip string `json:"ip" description:"ip地址"`
|
||||
GetData *gjson.Json `json:"getData" description:"get数据"`
|
||||
PostData *gjson.Json `json:"postData" description:"post数据"`
|
||||
HeaderData *gjson.Json `json:"headerData" description:"header数据"`
|
||||
Ip string `json:"ip" description:"IP地址"`
|
||||
ProvinceId int64 `json:"provinceId" description:"省编码"`
|
||||
CityId int64 `json:"cityId" description:"市编码"`
|
||||
ErrorCode int `json:"errorCode" description:"报错code"`
|
||||
ErrorMsg string `json:"errorMsg" description:"报错信息"`
|
||||
ErrorData string `json:"errorData" description:"报错日志"`
|
||||
ReqId string `json:"reqId" description:"对外id"`
|
||||
ErrorData *gjson.Json `json:"errorData" description:"报错日志"`
|
||||
ReqId string `json:"reqId" description:"对外ID"`
|
||||
Timestamp int64 `json:"timestamp" description:"响应时间"`
|
||||
UserAgent string `json:"userAgent" description:"UA信息"`
|
||||
TakeUpTime int64 `json:"takeUpTime" description:"请求耗时"`
|
||||
|
@@ -10,17 +10,17 @@ import (
|
||||
|
||||
// SysProvinces is the golang structure for table sys_provinces.
|
||||
type SysProvinces struct {
|
||||
Id int64 `json:"id" description:"ID"`
|
||||
Title string `json:"title" description:"栏目名"`
|
||||
Pid int64 `json:"pid" description:"父栏目"`
|
||||
Id int64 `json:"id" description:"省市区ID"`
|
||||
Title string `json:"title" description:"栏目名称"`
|
||||
ShortTitle string `json:"shortTitle" description:"缩写"`
|
||||
Areacode int `json:"areacode" description:"区域编码"`
|
||||
Zipcode int `json:"zipcode" description:"邮政编码"`
|
||||
Pinyin string `json:"pinyin" description:"拼音"`
|
||||
Lng string `json:"lng" description:"经度"`
|
||||
Lat string `json:"lat" description:"纬度"`
|
||||
Level int `json:"level" description:"级别"`
|
||||
Tree string `json:"tree" description:""`
|
||||
Pid int64 `json:"pid" description:"父栏目"`
|
||||
Level int `json:"level" description:"关系树等级"`
|
||||
Tree string `json:"tree" description:"关系"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
|
50
server/internal/model/entity/test.go
Normal file
50
server/internal/model/entity/test.go
Normal file
@@ -0,0 +1,50 @@
|
||||
// =================================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// Test is the golang structure for table test.
|
||||
type Test struct {
|
||||
Id int64 `json:"id" description:"ID"`
|
||||
CategoryId int64 `json:"categoryId" description:"分类ID"`
|
||||
Flag *gjson.Json `json:"flag" description:"标签"`
|
||||
Title string `json:"title" description:"标题"`
|
||||
Description string `json:"description" description:"描述"`
|
||||
Content string `json:"content" description:"内容"`
|
||||
Image string `json:"image" description:"单图"`
|
||||
Images *gjson.Json `json:"images" description:"多图"`
|
||||
Attachfile string `json:"attachfile" description:"附件"`
|
||||
Attachfiles *gjson.Json `json:"attachfiles" description:"多附件"`
|
||||
Map *gjson.Json `json:"map" 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:"删除时间"`
|
||||
}
|
22
server/internal/model/entity/test_category.go
Normal file
22
server/internal/model/entity/test_category.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// =================================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// TestCategory is the golang structure for table test_category.
|
||||
type TestCategory struct {
|
||||
Id int64 `json:"id" description:"分类ID"`
|
||||
Name string `json:"name" description:"分类名称"`
|
||||
Description string `json:"description" description:"描述"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"修改时间"`
|
||||
DeletedAt *gtime.Time `json:"deletedAt" description:"删除时间"`
|
||||
}
|
33
server/internal/model/gen_codes.go
Normal file
33
server/internal/model/gen_codes.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package model
|
||||
|
||||
// GenCodesColumn 生成表字段属性
|
||||
type GenCodesColumn struct {
|
||||
// 表属性
|
||||
Id int64 `json:"id" dc:"序号"`
|
||||
Name string `json:"name" dc:"字段列名"`
|
||||
Dc string `json:"dc" dc:"字段描述"`
|
||||
DataType string `json:"dataType" dc:"字段类型"`
|
||||
SqlType string `json:"sqlType" dc:"物理类型"`
|
||||
Length int64 `json:"length" dc:"字段长度"`
|
||||
IsAllowNull string `json:"isAllowNull" dc:"是否允许为空"`
|
||||
DefaultValue interface{} `json:"defaultValue" dc:"默认值"`
|
||||
Index string `json:"index" dc:"索引"`
|
||||
Extra string `json:"extra" dc:"额外选项"`
|
||||
// 自定义生成属性
|
||||
//Alias string `json:"alias" dc:"字段别名"`
|
||||
GoName string `json:"goName" dc:"Go属性"`
|
||||
GoType string `json:"goType" dc:"Go类型"`
|
||||
TsName string `json:"tsName" dc:"Ts属性"`
|
||||
TsType string `json:"tsType" dc:"Ts类型"`
|
||||
IsList bool `json:"isList" dc:"列表"`
|
||||
IsExport bool `json:"isExport" dc:"导出"`
|
||||
IsSort bool `json:"isSort" dc:"排序"`
|
||||
IsQuery bool `json:"isQuery" dc:"查询"`
|
||||
QueryWhere string `json:"queryWhere" dc:"查询条件"`
|
||||
IsEdit bool `json:"isEdit" dc:"编辑"`
|
||||
Required bool `json:"required" dc:"必填"`
|
||||
Unique bool `json:"unique" dc:"唯一性"`
|
||||
FormMode string `json:"formMode" dc:"表单组件"`
|
||||
FormRole string `json:"formRole" dc:"表单验证"`
|
||||
DictType int64 `json:"dictType" dc:"字典类型ID"`
|
||||
}
|
@@ -93,37 +93,38 @@ type MemberMaxSortModel struct {
|
||||
Sort int
|
||||
}
|
||||
|
||||
// MemberEditInp 修改/新增字典数据
|
||||
// MemberEditInp 修改/新增管理员
|
||||
type MemberEditInp struct {
|
||||
Id int64 `json:"id" description:""`
|
||||
PostIds []int64 `json:"postIds" v:"required#岗位不能为空" description:"岗位ID"`
|
||||
DeptId int64 `json:"dept_id" v:"required#部门不能为空" description:"部门ID"`
|
||||
Username string `json:"username" v:"required#账号不能为空" description:"帐号"`
|
||||
Password string `json:"password" description:"密码"`
|
||||
Realname string `json:"realname" description:"真实姓名"`
|
||||
Avatar string `json:"avatar" description:"头像"`
|
||||
Sex string `json:"sex" description:"性别[0:未知;1:男;2:女]"`
|
||||
Qq string `json:"qq" description:"qq"`
|
||||
Email string `json:"email" description:"邮箱"`
|
||||
Birthday *gtime.Time `json:"birthday" description:"生日"`
|
||||
ProvinceId int `json:"province_id" description:"省"`
|
||||
CityId int `json:"city_id" description:"城市"`
|
||||
AreaId int `json:"area_id" description:"地区"`
|
||||
Address string `json:"address" description:"默认地址"`
|
||||
Mobile string `json:"mobile" description:"手机号码"`
|
||||
HomePhone string `json:"home_phone" description:"家庭号码"`
|
||||
DingtalkRobotToken string `json:"dingtalk_robot_token" description:"钉钉机器人token"`
|
||||
Role int `json:"role" v:"required#角色不能为空" description:"权限"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status string `json:"status" description:"状态"`
|
||||
CreatedAt *gtime.Time `json:"created_at" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updated_at" description:"修改时间"`
|
||||
Id int64 `json:"id" description:""`
|
||||
RoleId int `json:"roleId" v:"required#角色不能为空" description:"角色ID"`
|
||||
PostIds []int64 `json:"postIds" v:"required#岗位不能为空" description:"岗位ID"`
|
||||
DeptId int64 `json:"deptId" v:"required#部门不能为空" description:"部门ID"`
|
||||
Username string `json:"username" v:"required#账号不能为空" description:"帐号"`
|
||||
Password string `json:"password" description:"密码"`
|
||||
Realname string `json:"realName" description:"真实姓名"`
|
||||
Avatar string `json:"avatar" description:"头像"`
|
||||
Sex string `json:"sex" description:"性别"`
|
||||
Qq string `json:"qq" description:"qq"`
|
||||
Email string `json:"email" description:"邮箱"`
|
||||
Birthday *gtime.Time `json:"birthday" description:"生日"`
|
||||
ProvinceId int `json:"provinceId" description:"省"`
|
||||
CityId int `json:"cityId" description:"城市"`
|
||||
AreaId int `json:"areaId" description:"地区"`
|
||||
Address string `json:"address" description:"默认地址"`
|
||||
Mobile string `json:"mobile" description:"手机号码"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status string `json:"status" description:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"修改时间"`
|
||||
}
|
||||
|
||||
type MemberAddInp struct {
|
||||
MemberEditInp
|
||||
PasswordHash string `json:"password_hash" description:"密码hash"`
|
||||
PasswordHash string `json:"passwordHash" description:"密码hash"`
|
||||
Salt string `json:"salt" description:"密码盐"`
|
||||
Pid int64 `json:"pid" description:"上级ID"`
|
||||
Level int `json:"level" description:"等级"`
|
||||
Tree string `json:"tree" description:"关系树"`
|
||||
}
|
||||
|
||||
type MemberEditModel struct{}
|
||||
@@ -159,10 +160,10 @@ type MemberListInp struct {
|
||||
|
||||
type MemberListModel struct {
|
||||
entity.AdminMember
|
||||
DeptName string `json:"dept_name"`
|
||||
RoleName string `json:"role_name"`
|
||||
DeptName string `json:"deptName"`
|
||||
RoleName string `json:"roleName"`
|
||||
PostIds []int64 `json:"postIds"`
|
||||
DeptId int64 `json:"dept_id" description:"部门ID"`
|
||||
DeptId int64 `json:"deptId" description:"部门ID"`
|
||||
}
|
||||
|
||||
// MemberLoginInp 登录
|
||||
@@ -171,12 +172,12 @@ type MemberLoginInp struct {
|
||||
Password string
|
||||
}
|
||||
type MemberLoginModel struct {
|
||||
UserId int64 `json:"userId" description:"会员ID"`
|
||||
Username string `json:"username" description:"用户名"`
|
||||
RealName string `json:"realName" description:"昵称"`
|
||||
Avatar string `json:"avatar" description:"头像"`
|
||||
Token string `json:"token" v:"" description:"登录token"`
|
||||
Permissions []MemberLoginPermissions `json:"permissions" description:"角色信息"`
|
||||
UserId int64 `json:"userId" description:"会员ID"`
|
||||
Username string `json:"username" description:"用户名"`
|
||||
RealName string `json:"realName" description:"昵称"`
|
||||
Avatar string `json:"avatar" description:"头像"`
|
||||
Token string `json:"token" v:"" description:"登录token"`
|
||||
Permissions []*MemberLoginPermissions `json:"permissions" description:"角色信息"`
|
||||
}
|
||||
|
||||
// MemberLoginPermissions 登录用户角色信息
|
||||
|
@@ -14,8 +14,7 @@ import (
|
||||
|
||||
// RoleListInp 获取列表
|
||||
type RoleListInp struct {
|
||||
Page int64
|
||||
PerPage int64
|
||||
form.PageReq
|
||||
}
|
||||
|
||||
type RoleListModel struct {
|
||||
@@ -28,7 +27,7 @@ type RoleMemberListInp struct {
|
||||
form.RangeDateReq
|
||||
form.StatusReq
|
||||
Role int `json:"role" description:"角色ID"`
|
||||
DeptId int `json:"dept_id" description:"部门ID"`
|
||||
DeptId int `json:"deptId" description:"部门ID"`
|
||||
Mobile int `json:"mobile" description:"手机号"`
|
||||
Username string `json:"username" description:"用户名"`
|
||||
Realname string `json:"realname" description:"真实姓名"`
|
||||
@@ -48,3 +47,9 @@ type MenuRoleListModel struct {
|
||||
Menus []*model.LabelTreeMenu `json:"menus" description:"菜单列表"`
|
||||
CheckedKeys []int64 `json:"checkedKeys" description:"选择的菜单ID"`
|
||||
}
|
||||
|
||||
type DataScopeEditInp struct {
|
||||
Id int64 `json:"id" v:"required" dc:"角色ID"`
|
||||
DataScope int `json:"dataScope" v:"required" dc:"数据范围"`
|
||||
CustomDept []int64 `json:"customDept" dc:"自定义部门权限"`
|
||||
}
|
||||
|
162
server/internal/model/input/adminin/test.go
Normal file
162
server/internal/model/input/adminin/test.go
Normal file
@@ -0,0 +1,162 @@
|
||||
// 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{}
|
@@ -9,20 +9,21 @@ package form
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
)
|
||||
|
||||
var (
|
||||
page int64
|
||||
pageSize int64
|
||||
page int
|
||||
pageSize int
|
||||
)
|
||||
|
||||
// DefaultPageSize 列表分页默认加载页码
|
||||
func DefaultPageSize(ctx context.Context) int64 {
|
||||
func DefaultPageSize(ctx context.Context) int {
|
||||
if pageSize > 0 {
|
||||
return pageSize
|
||||
}
|
||||
defaultPageSize, _ := g.Cfg().Get(ctx, "hotgo.admin.defaultPageSize", 10)
|
||||
pageSize = defaultPageSize.Int64()
|
||||
defaultPageSize := g.Cfg().MustGet(ctx, "hotgo.admin.defaultPageSize", 10)
|
||||
pageSize = defaultPageSize.Int()
|
||||
if pageSize <= 0 {
|
||||
pageSize = 10
|
||||
}
|
||||
@@ -30,26 +31,26 @@ func DefaultPageSize(ctx context.Context) int64 {
|
||||
}
|
||||
|
||||
// DefaultPage 列表分页默认加载数量
|
||||
func DefaultPage(ctx context.Context) int64 {
|
||||
func DefaultPage(ctx context.Context) int {
|
||||
if page > 0 {
|
||||
return page
|
||||
}
|
||||
defaultPage, _ := g.Cfg().Get(ctx, "hotgo.admin.defaultPage", 1)
|
||||
page = defaultPage.Int64()
|
||||
defaultPage := g.Cfg().MustGet(ctx, "hotgo.admin.defaultPage", 1)
|
||||
page = defaultPage.Int()
|
||||
if page <= 0 {
|
||||
page = 10
|
||||
page = 1
|
||||
}
|
||||
return page
|
||||
}
|
||||
|
||||
// PageReq 分页
|
||||
type PageReq struct {
|
||||
Page int64 `json:"page" example:"10" d:"1" v:"min:1#页码最小值不能低于1" dc:"当前页码"`
|
||||
PerPage int64 `json:"pageSize" example:"1" d:"10" v:"min:1|max:100#|每页数量最小值不能低于1|最大值不能大于100" dc:"每页数量"`
|
||||
Page int `json:"page" example:"10" d:"1" v:"min:1#页码最小值不能低于1" dc:"当前页码"`
|
||||
PerPage int `json:"pageSize" example:"1" d:"10" v:"min:1|max:100#|每页数量最小值不能低于1|最大值不能大于100" dc:"每页数量"`
|
||||
}
|
||||
type PageRes struct {
|
||||
PageReq
|
||||
PageCount int64 `json:"pageCount" example:"0" dc:"全部数据量"`
|
||||
PageCount int `json:"pageCount" example:"0" dc:"全部数据量"`
|
||||
}
|
||||
|
||||
// RangeDateReq 时间查询
|
||||
@@ -63,8 +64,14 @@ type StatusReq struct {
|
||||
Status int `json:"status" v:"in:-1,0,1,2,3#输入的状态是无效的" dc:"状态"`
|
||||
}
|
||||
|
||||
// SwitchReq 更新开关状态
|
||||
type SwitchReq struct {
|
||||
Key string `json:"key" v:"required#测试ID不能为空" dc:"开关字段"`
|
||||
Value int `json:"value" v:"in:1,2#输入的开关值是无效的" dc:"更新值"`
|
||||
}
|
||||
|
||||
// CalPage 解析分页
|
||||
func CalPage(ctx context.Context, page, perPage int64) (newPage, newPerPage int64, offset int64) {
|
||||
func CalPage(ctx context.Context, page, perPage int) (newPage, newPerPage int, offset int) {
|
||||
if page <= 0 {
|
||||
newPage = DefaultPage(ctx)
|
||||
} else {
|
||||
@@ -80,6 +87,31 @@ func CalPage(ctx context.Context, page, perPage int64) (newPage, newPerPage int6
|
||||
return
|
||||
}
|
||||
|
||||
func CalPageCount(totalCount int64, perPage int64) int64 {
|
||||
func CalPageCount(totalCount int, perPage int) int {
|
||||
return (totalCount + perPage - 1) / perPage
|
||||
}
|
||||
|
||||
// Selects 选项
|
||||
type Selects []*Select
|
||||
type Select struct {
|
||||
Value interface{} `json:"value"`
|
||||
Label string `json:"label"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func (p Selects) Len() int {
|
||||
return len(p)
|
||||
}
|
||||
func (p Selects) Swap(i, j int) {
|
||||
p[i], p[j] = p[j], p[i]
|
||||
}
|
||||
func (p Selects) Less(i, j int) bool {
|
||||
return gconv.Int64(p[j].Value) > gconv.Int64(p[i].Value)
|
||||
}
|
||||
|
||||
type SelectInt64s []*SelectInt64
|
||||
type SelectInt64 struct {
|
||||
Value int64 `json:"value"`
|
||||
Label string `json:"label"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
@@ -96,6 +96,6 @@ type ConfigListInp struct {
|
||||
|
||||
type ConfigListModel struct {
|
||||
entity.SysConfig
|
||||
DeptName string `json:"dept_name"`
|
||||
RoleName string `json:"role_name"`
|
||||
DeptName string `json:"deptName"`
|
||||
RoleName string `json:"roleName"`
|
||||
}
|
||||
|
109
server/internal/model/input/sysin/curd_demo.go
Normal file
109
server/internal/model/input/sysin/curd_demo.go
Normal file
@@ -0,0 +1,109 @@
|
||||
// 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
|
||||
// @AutoGenerate Version 2.1.0
|
||||
// @AutoGenerate Date 2023-01-18 15:19:42
|
||||
//
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// CurdDemoEditInp 修改/新增生成演示
|
||||
type CurdDemoEditInp struct {
|
||||
entity.Test
|
||||
}
|
||||
|
||||
func (in *CurdDemoEditInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type CurdDemoEditModel struct{}
|
||||
|
||||
// CurdDemoDeleteInp 删除生成演示
|
||||
type CurdDemoDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
type CurdDemoDeleteModel struct{}
|
||||
|
||||
// CurdDemoViewInp 获取指定生成演示信息
|
||||
type CurdDemoViewInp struct {
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
type CurdDemoViewModel struct {
|
||||
entity.Test
|
||||
}
|
||||
|
||||
// CurdDemoListInp 获取生成演示列表
|
||||
type CurdDemoListInp struct {
|
||||
form.PageReq
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
TestCategoryName string `json:"testCategoryName" dc:"分类名称"`
|
||||
}
|
||||
|
||||
type CurdDemoListModel struct {
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
CategoryId int64 `json:"categoryId" dc:"分类ID"`
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Image string `json:"image" dc:"单图"`
|
||||
Attachfile string `json:"attachfile" dc:"附件"`
|
||||
Switch int `json:"switch" dc:"显示开关"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
TestCategoryName string `json:"testCategoryName" dc:"分类名称"`
|
||||
}
|
||||
|
||||
func (in *CurdDemoListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// CurdDemoExportModel 导出生成演示
|
||||
type CurdDemoExportModel struct {
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
CategoryId int64 `json:"categoryId" dc:"分类ID"`
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Image string `json:"image" dc:"单图"`
|
||||
Attachfile string `json:"attachfile" dc:"附件"`
|
||||
Switch int `json:"switch" dc:"显示开关"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
TestCategoryName string `json:"testCategoryName" dc:"分类名称"`
|
||||
}
|
||||
|
||||
// CurdDemoMaxSortInp 获取生成演示最大排序
|
||||
type CurdDemoMaxSortInp struct{}
|
||||
|
||||
type CurdDemoMaxSortModel struct {
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
}
|
||||
|
||||
// CurdDemoStatusInp 更新生成演示状态
|
||||
type CurdDemoStatusInp struct {
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
type CurdDemoStatusModel struct{}
|
||||
|
||||
// CurdDemoSwitchInp 更新生成演示开关状态
|
||||
type CurdDemoSwitchInp struct {
|
||||
form.SwitchReq
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
type CurdDemoSwitchModel struct{}
|
@@ -35,6 +35,23 @@ type DictDataListInp struct {
|
||||
}
|
||||
|
||||
type DictDataListModel struct {
|
||||
TypeID int64 `json:"typeId"`
|
||||
TypeID int64 `json:"typeId"`
|
||||
Key string `json:"key"`
|
||||
entity.SysDictData
|
||||
}
|
||||
|
||||
// DataSelectInp 获取指定字典选项
|
||||
type DataSelectInp struct {
|
||||
Type string
|
||||
}
|
||||
|
||||
type DataSelectModel []*SelectData
|
||||
|
||||
type SelectData struct {
|
||||
Key interface{} `json:"key"`
|
||||
Label string `json:"label" description:"字典标签"`
|
||||
Value interface{} `json:"value" description:"字典键值"`
|
||||
ValueType string `json:"valueType" description:"键值数据类型:string,int,uint,bool,datetime,date"`
|
||||
Type string `json:"type" description:"字典类型"`
|
||||
ListClass string `json:"listClass" description:"表格回显样式"`
|
||||
}
|
||||
|
@@ -28,3 +28,9 @@ type DictTypeSelectInp struct {
|
||||
}
|
||||
|
||||
type DictTypeSelectModel []g.Map
|
||||
|
||||
// DictTreeSelectInp 获取类型关系树选项
|
||||
type DictTreeSelectInp struct {
|
||||
}
|
||||
|
||||
type DictTreeSelectModel []g.Map
|
||||
|
139
server/internal/model/input/sysin/gen_codes.go
Normal file
139
server/internal/model/input/sysin/gen_codes.go
Normal file
@@ -0,0 +1,139 @@
|
||||
// Package sysin
|
||||
// @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 sysin
|
||||
|
||||
import (
|
||||
"hotgo/internal/model"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// GenCodesMaxSortInp 最大排序
|
||||
type GenCodesMaxSortInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type GenCodesMaxSortModel struct {
|
||||
Sort int
|
||||
}
|
||||
|
||||
// GenCodesEditInp 修改/新增数据
|
||||
type GenCodesEditInp struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
type GenCodesEditModel struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
|
||||
// GenCodesDeleteInp 删除
|
||||
type GenCodesDeleteInp struct {
|
||||
Id interface{}
|
||||
}
|
||||
type GenCodesDeleteModel struct{}
|
||||
|
||||
// GenCodesViewInp 获取信息
|
||||
type GenCodesViewInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type GenCodesViewModel struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
|
||||
// GenCodesListInp 获取列表
|
||||
type GenCodesListInp struct {
|
||||
form.PageReq
|
||||
form.StatusReq
|
||||
GenType int `json:"genType"`
|
||||
VarName string `json:"varName"`
|
||||
}
|
||||
|
||||
type GenCodesListModel struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
|
||||
// GenCodesStatusInp 更新状态
|
||||
type GenCodesStatusInp struct {
|
||||
Id int64 `json:"id" description:"生成ID"`
|
||||
Status int `json:"status" description:"生成状态"`
|
||||
}
|
||||
type GenCodesStatusModel struct{}
|
||||
|
||||
// GenCodesSelectsInp 选项
|
||||
type GenCodesSelectsInp struct {
|
||||
}
|
||||
type GenCodesSelectsModel struct {
|
||||
GenType form.Selects `json:"genType" dc:"生成类型"`
|
||||
Db form.Selects `json:"db" dc:"数据库选项"`
|
||||
Status form.Selects `json:"status" dc:"生成状态"`
|
||||
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:"字典类型"`
|
||||
WhereMode form.Selects `json:"whereMode" dc:"查询条件"`
|
||||
}
|
||||
|
||||
// GenCodesTableSelectInp 数据库表选项
|
||||
type GenCodesTableSelectInp struct {
|
||||
Name string `json:"name" dc:"数据库配置名称"`
|
||||
}
|
||||
type GenCodesTableSelectModel struct {
|
||||
Value string `json:"value"`
|
||||
Label string `json:"label"`
|
||||
Name string `json:"name"`
|
||||
DaoName string `json:"daoName" dc:"orm模型名称"`
|
||||
DefVarName string `json:"defVarName" dc:"默认实体名称"`
|
||||
DefAlias string `json:"defAlias" dc:"默认关联表别名"`
|
||||
DefTableComment string `json:"defTableComment" dc:"默认菜单名称"`
|
||||
}
|
||||
|
||||
// GenCodesColumnSelectInp 表字段选项
|
||||
type GenCodesColumnSelectInp struct {
|
||||
Name string `json:"name" dc:"数据库配置名称"`
|
||||
Table string `json:"table" dc:"表名称"`
|
||||
}
|
||||
type GenCodesColumnSelectModel struct {
|
||||
Value string `json:"value"`
|
||||
Label string `json:"label"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// GenCodesColumnListInp 表字段列表
|
||||
type GenCodesColumnListInp struct {
|
||||
Name string `json:"name" dc:"数据库配置名称"`
|
||||
Table string `json:"table" dc:"表名称"`
|
||||
IsLink int64 `json:"isLink" dc:"是否是关联表"`
|
||||
Alias string `json:"alias" dc:"关联表别名"`
|
||||
}
|
||||
type GenCodesColumnListModel struct {
|
||||
model.GenCodesColumn
|
||||
}
|
||||
|
||||
// GenCodesPreviewInp 生成预览
|
||||
type GenCodesPreviewInp struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
|
||||
// GenFile 生成文件配置
|
||||
type GenFile struct {
|
||||
Content string `json:"content" dc:"页面内容"`
|
||||
Path string `json:"path" dc:"生成路径"`
|
||||
Meth int `json:"meth" dc:"生成方式"`
|
||||
Required bool `json:"required" dc:"是否是必要构建文件"`
|
||||
}
|
||||
|
||||
type GenCodesPreviewModel struct {
|
||||
Config *model.GenerateConfig `json:"config"`
|
||||
Views map[string]*GenFile `json:"views" dc:"页面"`
|
||||
}
|
||||
|
||||
// GenCodesBuildInp 提交生成
|
||||
type GenCodesBuildInp struct {
|
||||
entity.SysGenCodes
|
||||
}
|
Reference in New Issue
Block a user