mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-13 04:33:44 +08:00
更新2.1.2版本,优化部门、角色权限,增加上下级关系;增加登录、系统、短信日志;优化省市区编码
This commit is contained in:
@@ -28,6 +28,8 @@ type AdminDeptColumns struct {
|
||||
Leader string // 负责人
|
||||
Phone string // 联系电话
|
||||
Email string // 邮箱
|
||||
Level string // 关系树等级
|
||||
Tree string // 关系树
|
||||
Sort string // 排序
|
||||
Status string // 部门状态
|
||||
CreatedAt string // 创建时间
|
||||
@@ -44,6 +46,8 @@ var adminDeptColumns = AdminDeptColumns{
|
||||
Leader: "leader",
|
||||
Phone: "phone",
|
||||
Email: "email",
|
||||
Level: "level",
|
||||
Tree: "tree",
|
||||
Sort: "sort",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
// ==========================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// DemoDao is the data access object for table hg_demo.
|
||||
type DemoDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns DemoColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// DemoColumns defines and stores column names for table hg_demo.
|
||||
type DemoColumns struct {
|
||||
Id string // ID
|
||||
CategoryId string // 分类ID
|
||||
Flag string // 标签
|
||||
Title string // 标题
|
||||
Description string // 描述
|
||||
Content string // 内容
|
||||
Image string // 单图
|
||||
Images string // 多图
|
||||
Attachfile string // 附件
|
||||
Attachfiles string // 多附件
|
||||
Map string // 动态键值对
|
||||
Star string // 推荐星
|
||||
Price string // 价格
|
||||
Views string // 浏览次数
|
||||
ActivityAt string // 活动时间
|
||||
StartAt string // 开启时间
|
||||
EndAt string // 结束时间
|
||||
Switch string // 开关
|
||||
Sort string // 排序
|
||||
Avatar string // 头像
|
||||
Sex string // 性别
|
||||
Qq string // qq
|
||||
Email string // 邮箱
|
||||
Mobile string // 手机号码
|
||||
Hobby string // 爱好
|
||||
Channel string // 渠道
|
||||
Pid string // 上级ID
|
||||
Level string // 树等级
|
||||
Tree string // 关系树
|
||||
Remark string // 备注
|
||||
Status string // 状态
|
||||
CreatedBy string // 创建者
|
||||
UpdatedBy string // 更新者
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 修改时间
|
||||
DeletedAt string // 删除时间
|
||||
}
|
||||
|
||||
// demoColumns holds the columns for table hg_demo.
|
||||
var demoColumns = DemoColumns{
|
||||
Id: "id",
|
||||
CategoryId: "category_id",
|
||||
Flag: "flag",
|
||||
Title: "title",
|
||||
Description: "description",
|
||||
Content: "content",
|
||||
Image: "image",
|
||||
Images: "images",
|
||||
Attachfile: "attachfile",
|
||||
Attachfiles: "attachfiles",
|
||||
Map: "map",
|
||||
Star: "star",
|
||||
Price: "price",
|
||||
Views: "views",
|
||||
ActivityAt: "activity_at",
|
||||
StartAt: "start_at",
|
||||
EndAt: "end_at",
|
||||
Switch: "switch",
|
||||
Sort: "sort",
|
||||
Avatar: "avatar",
|
||||
Sex: "sex",
|
||||
Qq: "qq",
|
||||
Email: "email",
|
||||
Mobile: "mobile",
|
||||
Hobby: "hobby",
|
||||
Channel: "channel",
|
||||
Pid: "pid",
|
||||
Level: "level",
|
||||
Tree: "tree",
|
||||
Remark: "remark",
|
||||
Status: "status",
|
||||
CreatedBy: "created_by",
|
||||
UpdatedBy: "updated_by",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewDemoDao creates and returns a new DAO object for table data access.
|
||||
func NewDemoDao() *DemoDao {
|
||||
return &DemoDao{
|
||||
group: "default",
|
||||
table: "hg_demo",
|
||||
columns: demoColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *DemoDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *DemoDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *DemoDao) Columns() DemoColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *DemoDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *DemoDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *DemoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -21,6 +21,7 @@ type SysLogDao struct {
|
||||
// SysLogColumns defines and stores column names for table hg_sys_log.
|
||||
type SysLogColumns struct {
|
||||
Id string // 日志ID
|
||||
ReqId string // 对外ID
|
||||
AppId string // 应用ID
|
||||
MerchantId string // 商户ID
|
||||
MemberId string // 用户ID
|
||||
@@ -36,10 +37,9 @@ type SysLogColumns struct {
|
||||
ErrorCode string // 报错code
|
||||
ErrorMsg string // 报错信息
|
||||
ErrorData string // 报错日志
|
||||
ReqId string // 对外ID
|
||||
Timestamp string // 响应时间
|
||||
UserAgent string // UA信息
|
||||
TakeUpTime string // 请求耗时
|
||||
Timestamp string // 响应时间
|
||||
Status string // 状态
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 修改时间
|
||||
@@ -48,6 +48,7 @@ type SysLogColumns struct {
|
||||
// sysLogColumns holds the columns for table hg_sys_log.
|
||||
var sysLogColumns = SysLogColumns{
|
||||
Id: "id",
|
||||
ReqId: "req_id",
|
||||
AppId: "app_id",
|
||||
MerchantId: "merchant_id",
|
||||
MemberId: "member_id",
|
||||
@@ -63,10 +64,9 @@ var sysLogColumns = SysLogColumns{
|
||||
ErrorCode: "error_code",
|
||||
ErrorMsg: "error_msg",
|
||||
ErrorData: "error_data",
|
||||
ReqId: "req_id",
|
||||
Timestamp: "timestamp",
|
||||
UserAgent: "user_agent",
|
||||
TakeUpTime: "take_up_time",
|
||||
Timestamp: "timestamp",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
|
||||
91
server/internal/dao/internal/sys_login_log.go
Normal file
91
server/internal/dao/internal/sys_login_log.go
Normal file
@@ -0,0 +1,91 @@
|
||||
// ==========================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysLoginLogDao is the data access object for table hg_sys_login_log.
|
||||
type SysLoginLogDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns SysLoginLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// SysLoginLogColumns defines and stores column names for table hg_sys_login_log.
|
||||
type SysLoginLogColumns struct {
|
||||
Id string // 日志ID
|
||||
ReqId string // 请求ID
|
||||
MemberId string // 用户ID
|
||||
Username string // 用户名
|
||||
Response string // 响应数据
|
||||
LoginAt string // 登录时间
|
||||
ErrMsg string // 错误提示
|
||||
Status string // 状态
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 修改时间
|
||||
}
|
||||
|
||||
// sysLoginLogColumns holds the columns for table hg_sys_login_log.
|
||||
var sysLoginLogColumns = SysLoginLogColumns{
|
||||
Id: "id",
|
||||
ReqId: "req_id",
|
||||
MemberId: "member_id",
|
||||
Username: "username",
|
||||
Response: "response",
|
||||
LoginAt: "login_at",
|
||||
ErrMsg: "err_msg",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
}
|
||||
|
||||
// NewSysLoginLogDao creates and returns a new DAO object for table data access.
|
||||
func NewSysLoginLogDao() *SysLoginLogDao {
|
||||
return &SysLoginLogDao{
|
||||
group: "default",
|
||||
table: "hg_sys_login_log",
|
||||
columns: sysLoginLogColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *SysLoginLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *SysLoginLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *SysLoginLogDao) Columns() SysLoginLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *SysLoginLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *SysLoginLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *SysLoginLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -20,40 +20,34 @@ type SysProvincesDao struct {
|
||||
|
||||
// SysProvincesColumns defines and stores column names for table hg_sys_provinces.
|
||||
type SysProvincesColumns struct {
|
||||
Id string // 省市区ID
|
||||
Title string // 栏目名称
|
||||
ShortTitle string // 缩写
|
||||
Areacode string // 区域编码
|
||||
Zipcode string // 邮政编码
|
||||
Pinyin string // 拼音
|
||||
Lng string // 经度
|
||||
Lat string // 纬度
|
||||
Pid string // 父栏目
|
||||
Level string // 关系树等级
|
||||
Tree string // 关系
|
||||
Sort string // 排序
|
||||
Status string // 状态
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
Id string // 省市区ID
|
||||
Title string // 栏目名称
|
||||
Pinyin string // 拼音
|
||||
Lng string // 经度
|
||||
Lat string // 纬度
|
||||
Pid string // 父栏目
|
||||
Level string // 关系树等级
|
||||
Tree string // 关系
|
||||
Sort string // 排序
|
||||
Status string // 状态
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// sysProvincesColumns holds the columns for table hg_sys_provinces.
|
||||
var sysProvincesColumns = SysProvincesColumns{
|
||||
Id: "id",
|
||||
Title: "title",
|
||||
ShortTitle: "short_title",
|
||||
Areacode: "areacode",
|
||||
Zipcode: "zipcode",
|
||||
Pinyin: "pinyin",
|
||||
Lng: "lng",
|
||||
Lat: "lat",
|
||||
Pid: "pid",
|
||||
Level: "level",
|
||||
Tree: "tree",
|
||||
Sort: "sort",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
Id: "id",
|
||||
Title: "title",
|
||||
Pinyin: "pinyin",
|
||||
Lng: "lng",
|
||||
Lat: "lat",
|
||||
Pid: "pid",
|
||||
Level: "level",
|
||||
Tree: "tree",
|
||||
Sort: "sort",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
}
|
||||
|
||||
// NewSysProvincesDao creates and returns a new DAO object for table data access.
|
||||
|
||||
91
server/internal/dao/internal/sys_serve_log.go
Normal file
91
server/internal/dao/internal/sys_serve_log.go
Normal file
@@ -0,0 +1,91 @@
|
||||
// ==========================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysServeLogDao is the data access object for table hg_sys_serve_log.
|
||||
type SysServeLogDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns SysServeLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// SysServeLogColumns defines and stores column names for table hg_sys_serve_log.
|
||||
type SysServeLogColumns struct {
|
||||
Id string // 日志ID
|
||||
TraceId string // 链路ID
|
||||
LevelFormat string // 日志级别
|
||||
Content string // 日志内容
|
||||
Stack string // 打印堆栈
|
||||
Line string // 调用行
|
||||
TriggerNs string // 触发时间(ns)
|
||||
Status string // 状态
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 修改时间
|
||||
}
|
||||
|
||||
// sysServeLogColumns holds the columns for table hg_sys_serve_log.
|
||||
var sysServeLogColumns = SysServeLogColumns{
|
||||
Id: "id",
|
||||
TraceId: "trace_id",
|
||||
LevelFormat: "level_format",
|
||||
Content: "content",
|
||||
Stack: "stack",
|
||||
Line: "line",
|
||||
TriggerNs: "trigger_ns",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
}
|
||||
|
||||
// NewSysServeLogDao creates and returns a new DAO object for table data access.
|
||||
func NewSysServeLogDao() *SysServeLogDao {
|
||||
return &SysServeLogDao{
|
||||
group: "default",
|
||||
table: "hg_sys_serve_log",
|
||||
columns: sysServeLogColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *SysServeLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *SysServeLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *SysServeLogDao) Columns() SysServeLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *SysServeLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *SysServeLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *SysServeLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
89
server/internal/dao/internal/sys_sms_log.go
Normal file
89
server/internal/dao/internal/sys_sms_log.go
Normal file
@@ -0,0 +1,89 @@
|
||||
// ==========================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysSmsLogDao is the data access object for table hg_sys_sms_log.
|
||||
type SysSmsLogDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns SysSmsLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// SysSmsLogColumns defines and stores column names for table hg_sys_sms_log.
|
||||
type SysSmsLogColumns struct {
|
||||
Id string // 主键
|
||||
Event string // 事件
|
||||
Mobile string // 手机号
|
||||
Code string // 验证码或短信内容
|
||||
Times string // 验证次数
|
||||
Ip string // ip地址
|
||||
Status string // 状态(1未验证,2已验证)
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// sysSmsLogColumns holds the columns for table hg_sys_sms_log.
|
||||
var sysSmsLogColumns = SysSmsLogColumns{
|
||||
Id: "id",
|
||||
Event: "event",
|
||||
Mobile: "mobile",
|
||||
Code: "code",
|
||||
Times: "times",
|
||||
Ip: "ip",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
}
|
||||
|
||||
// NewSysSmsLogDao creates and returns a new DAO object for table data access.
|
||||
func NewSysSmsLogDao() *SysSmsLogDao {
|
||||
return &SysSmsLogDao{
|
||||
group: "default",
|
||||
table: "hg_sys_sms_log",
|
||||
columns: sysSmsLogColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *SysSmsLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *SysSmsLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *SysSmsLogDao) Columns() SysSmsLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *SysSmsLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *SysSmsLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *SysSmsLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
Reference in New Issue
Block a user