Parcourir la source

feat: 初始化系统管理相关model和dao

程健 il y a 3 ans
Parent
commit
5dd04fed2f

+ 52 - 49
app/dao/internal/sys_dept.go

@@ -26,22 +26,23 @@ type SysDeptDao struct {
 
 // SysDeptColumns defines and stores column names for table sys_dept.
 type sysDeptColumns struct {
-	Id           string // 部门id                            
-    ParentId     string // 父部门id                          
-    Ancestors    string // 祖级列表                          
-    DeptName     string // 部门名称                          
-    OrderNum     string // 显示顺序                          
-    Leader       string // 负责人                            
-    Phone        string // 联系电话                          
-    Email        string // 邮箱                              
-    Status       string // 部门状态(10正常20停用);1停用)  
-    CreatedBy    string // 创建者                            
-    CreatedName  string // 创建人                            
-    CreatedTime  string // 创建时间                          
-    UpdatedBy    string // 更新者                            
-    UpdatedName  string // 更新人                            
-    UpdatedTime  string // 更新时间                          
-    DeletedTime  string // 删除时间
+	Id          string // 部门id
+	ParentId    string // 父部门id
+	Ancestors   string // 祖级列表
+	DeptName    string // 部门名称
+	Leader      string // 负责人
+	Phone       string // 联系电话
+	Email       string // 邮箱
+	Status      string // 部门状态(10正常20停用);1停用)
+	Sort        string // 显示顺序
+	Remark      string // 备注
+	CreatedBy   string // 创建者
+	CreatedName string // 创建人
+	CreatedTime string // 创建时间
+	UpdatedBy   string // 更新者
+	UpdatedName string // 更新人
+	UpdatedTime string // 更新时间
+	DeletedTime string // 删除时间
 }
 
 var (
@@ -51,22 +52,23 @@ var (
 		DB:    g.DB("default"),
 		Table: "sys_dept",
 		Columns: sysDeptColumns{
-			Id:          "id",            
-            ParentId:    "parent_id",     
-            Ancestors:   "ancestors",     
-            DeptName:    "dept_name",     
-            OrderNum:    "order_num",     
-            Leader:      "leader",        
-            Phone:       "phone",         
-            Email:       "email",         
-            Status:      "status",        
-            CreatedBy:   "created_by",    
-            CreatedName: "created_name",  
-            CreatedTime: "created_time",  
-            UpdatedBy:   "updated_by",    
-            UpdatedName: "updated_name",  
-            UpdatedTime: "updated_time",  
-            DeletedTime: "deleted_time",
+			Id:          "id",
+			ParentId:    "parent_id",
+			Ancestors:   "ancestors",
+			DeptName:    "dept_name",
+			Leader:      "leader",
+			Phone:       "phone",
+			Email:       "email",
+			Status:      "status",
+			Sort:        "sort",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
 		},
 	}
 )
@@ -78,22 +80,23 @@ func NewSysDeptDao(tenant string) SysDeptDao {
 		DB:    g.DB(tenant),
 		Table: "sys_dept",
 		Columns: sysDeptColumns{
-			Id:          "id",            
-            ParentId:    "parent_id",     
-            Ancestors:   "ancestors",     
-            DeptName:    "dept_name",     
-            OrderNum:    "order_num",     
-            Leader:      "leader",        
-            Phone:       "phone",         
-            Email:       "email",         
-            Status:      "status",        
-            CreatedBy:   "created_by",    
-            CreatedName: "created_name",  
-            CreatedTime: "created_time",  
-            UpdatedBy:   "updated_by",    
-            UpdatedName: "updated_name",  
-            UpdatedTime: "updated_time",  
-            DeletedTime: "deleted_time",
+			Id:          "id",
+			ParentId:    "parent_id",
+			Ancestors:   "ancestors",
+			DeptName:    "dept_name",
+			Leader:      "leader",
+			Phone:       "phone",
+			Email:       "email",
+			Status:      "status",
+			Sort:        "sort",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
 		},
 	}
 	return dao
@@ -438,4 +441,4 @@ func (d *SysDeptDao) LockShared() *SysDeptDao {
 // Unscoped enables/disables the soft deleting feature.
 func (d *SysDeptDao) Unscoped() *SysDeptDao {
 	return &SysDeptDao{M: d.M.Unscoped()}
-}
+}

+ 55 - 52
app/dao/internal/sys_dict_data.go

@@ -26,23 +26,24 @@ type SysDictDataDao struct {
 
 // SysDictDataColumns defines and stores column names for table sys_dict_data.
 type sysDictDataColumns struct {
-	DictCode     string // 字典编码                  
-    DictSort     string // 字典排序                  
-    DictLabel    string // 字典标签                  
-    DictValue    string // 字典键值                  
-    DictType     string // 字典类型                  
-    CssClass     string // 样式属性(其他样式扩展)  
-    ListClass    string // 表格回显样式              
-    IsDefault    string // 是否默认(10是20否)      
-    Status       string // 状态(10正常20停用)      
-    Remark       string // 备注                      
-    CreatedBy    string // 创建者                    
-    CreatedName  string // 创建人                    
-    CreatedTime  string // 创建时间                  
-    UpdatedBy    string // 更新者                    
-    UpdatedName  string // 更新人                    
-    UpdatedTime  string // 更新时间                  
-    DeletedTime  string // 删除时间
+	DictCode    string // 字典编码
+	DictSort    string // 字典排序
+	DictLabel   string // 字典标签
+	DictValue   string // 字典键值
+	DictType    string // 字典类型
+	CssClass    string // 样式属性(其他样式扩展)
+	ListClass   string // 表格回显样式
+	IsDefault   string // 是否默认(10是20否)
+	Status      string // 状态(10正常20停用)
+	Sort        string // 显示顺序
+	Remark      string // 备注
+	CreatedBy   string // 创建者
+	CreatedName string // 创建人
+	CreatedTime string // 创建时间
+	UpdatedBy   string // 更新者
+	UpdatedName string // 更新人
+	UpdatedTime string // 更新时间
+	DeletedTime string // 删除时间
 }
 
 var (
@@ -52,23 +53,24 @@ var (
 		DB:    g.DB("default"),
 		Table: "sys_dict_data",
 		Columns: sysDictDataColumns{
-			DictCode:    "dict_code",     
-            DictSort:    "dict_sort",     
-            DictLabel:   "dict_label",    
-            DictValue:   "dict_value",    
-            DictType:    "dict_type",     
-            CssClass:    "css_class",     
-            ListClass:   "list_class",    
-            IsDefault:   "is_default",    
-            Status:      "status",        
-            Remark:      "remark",        
-            CreatedBy:   "created_by",    
-            CreatedName: "created_name",  
-            CreatedTime: "created_time",  
-            UpdatedBy:   "updated_by",    
-            UpdatedName: "updated_name",  
-            UpdatedTime: "updated_time",  
-            DeletedTime: "deleted_time",
+			DictCode:    "dict_code",
+			DictSort:    "dict_sort",
+			DictLabel:   "dict_label",
+			DictValue:   "dict_value",
+			DictType:    "dict_type",
+			CssClass:    "css_class",
+			ListClass:   "list_class",
+			IsDefault:   "is_default",
+			Status:      "status",
+			Sort:        "sort",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
 		},
 	}
 )
@@ -80,23 +82,24 @@ func NewSysDictDataDao(tenant string) SysDictDataDao {
 		DB:    g.DB(tenant),
 		Table: "sys_dict_data",
 		Columns: sysDictDataColumns{
-			DictCode:    "dict_code",     
-            DictSort:    "dict_sort",     
-            DictLabel:   "dict_label",    
-            DictValue:   "dict_value",    
-            DictType:    "dict_type",     
-            CssClass:    "css_class",     
-            ListClass:   "list_class",    
-            IsDefault:   "is_default",    
-            Status:      "status",        
-            Remark:      "remark",        
-            CreatedBy:   "created_by",    
-            CreatedName: "created_name",  
-            CreatedTime: "created_time",  
-            UpdatedBy:   "updated_by",    
-            UpdatedName: "updated_name",  
-            UpdatedTime: "updated_time",  
-            DeletedTime: "deleted_time",
+			DictCode:    "dict_code",
+			DictSort:    "dict_sort",
+			DictLabel:   "dict_label",
+			DictValue:   "dict_value",
+			DictType:    "dict_type",
+			CssClass:    "css_class",
+			ListClass:   "list_class",
+			IsDefault:   "is_default",
+			Status:      "status",
+			Sort:        "sort",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
 		},
 	}
 	return dao
@@ -441,4 +444,4 @@ func (d *SysDictDataDao) LockShared() *SysDictDataDao {
 // Unscoped enables/disables the soft deleting feature.
 func (d *SysDictDataDao) Unscoped() *SysDictDataDao {
 	return &SysDictDataDao{M: d.M.Unscoped()}
-}
+}

+ 432 - 0
app/dao/internal/sys_group.go

@@ -0,0 +1,432 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"time"
+
+	"dashoo.cn/micro/app/model"
+)
+
+// SysGroupDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type SysGroupDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns sysGroupColumns
+}
+
+// SysGroupColumns defines and stores column names for table sys_group.
+type sysGroupColumns struct {
+	Id          string // 主键
+	GroupCode   string // 用户组编码
+	GroupName   string // 用户组名称
+	Status      string // 状态(10正常20停用)
+	Sort        string // 显示顺序
+	Remark      string // 备注
+	CreatedBy   string // 创建人ID
+	CreatedName string // 创建人
+	CreatedTime string // 创建时间
+	UpdatedBy   string // 更新人ID
+	UpdatedName string // 更新人
+	UpdatedTime string // 更新时间
+	DeletedTime string // 删除时间
+}
+
+var (
+	// SysGroup is globally public accessible object for table sys_group operations.
+	SysGroup = SysGroupDao{
+		M:     g.DB("default").Model("sys_group").Safe(),
+		DB:    g.DB("default"),
+		Table: "sys_group",
+		Columns: sysGroupColumns{
+			Id:          "id",
+			GroupCode:   "group_code",
+			GroupName:   "group_name",
+			Status:      "status",
+			Sort:        "sort",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
+		},
+	}
+)
+
+func NewSysGroupDao(tenant string) SysGroupDao {
+	var dao SysGroupDao
+	dao = SysGroupDao{
+		M:     g.DB(tenant).Model("sys_group").Safe(),
+		DB:    g.DB(tenant),
+		Table: "sys_group",
+		Columns: sysGroupColumns{
+			Id:          "id",
+			GroupCode:   "group_code",
+			GroupName:   "group_name",
+			Status:      "status",
+			Sort:        "sort",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
+		},
+	}
+	return dao
+}
+
+// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
+// of current DB object and with given context in it.
+// Note that this returned DB object can be used only once, so do not assign it to
+// a global or package variable for long using.
+func (d *SysGroupDao) Ctx(ctx context.Context) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *SysGroupDao) As(as string) *SysGroupDao {
+	return &SysGroupDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *SysGroupDao) TX(tx *gdb.TX) *SysGroupDao {
+	return &SysGroupDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *SysGroupDao) Master() *SysGroupDao {
+	return &SysGroupDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *SysGroupDao) Slave() *SysGroupDao {
+	return &SysGroupDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *SysGroupDao) Args(args ...interface{}) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Args(args...)}
+}
+
+// LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *SysGroupDao) LeftJoin(table ...string) *SysGroupDao {
+	return &SysGroupDao{M: d.M.LeftJoin(table...)}
+}
+
+// RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *SysGroupDao) RightJoin(table ...string) *SysGroupDao {
+	return &SysGroupDao{M: d.M.RightJoin(table...)}
+}
+
+// InnerJoin does "INNER JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *SysGroupDao) InnerJoin(table ...string) *SysGroupDao {
+	return &SysGroupDao{M: d.M.InnerJoin(table...)}
+}
+
+// Fields sets the operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *SysGroupDao) Fields(fieldNamesOrMapStruct ...interface{}) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *SysGroupDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *SysGroupDao {
+	return &SysGroupDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *SysGroupDao) Option(option int) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *SysGroupDao) OmitEmpty() *SysGroupDao {
+	return &SysGroupDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *SysGroupDao) Filter() *SysGroupDao {
+	return &SysGroupDao{M: d.M.Filter()}
+}
+
+// Where sets the condition statement for the model. The parameter <where> can be type of
+// string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
+// multiple conditions will be joined into where statement using "AND".
+// Eg:
+// Where("uid=10000")
+// Where("uid", 10000)
+// Where("money>? AND name like ?", 99999, "vip_%")
+// Where("uid", 1).Where("name", "john")
+// Where("status IN (?)", g.Slice{1,2,3})
+// Where("age IN(?,?)", 18, 50)
+// Where(User{ Id : 1, UserName : "john"})
+func (d *SysGroupDao) Where(where interface{}, args ...interface{}) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Where(where, args...)}
+}
+
+// WherePri does the same logic as M.Where except that if the parameter <where>
+// is a single condition like int/string/float/slice, it treats the condition as the primary
+// key value. That is, if primary key is "id" and given <where> parameter as "123", the
+// WherePri function treats the condition as "id=123", but M.Where treats the condition
+// as string "123".
+func (d *SysGroupDao) WherePri(where interface{}, args ...interface{}) *SysGroupDao {
+	return &SysGroupDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *SysGroupDao) And(where interface{}, args ...interface{}) *SysGroupDao {
+	return &SysGroupDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *SysGroupDao) Or(where interface{}, args ...interface{}) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *SysGroupDao) Group(groupBy string) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *SysGroupDao) Order(orderBy ...string) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Order(orderBy...)}
+}
+
+// Limit sets the "LIMIT" statement for the model.
+// The parameter <limit> can be either one or two number, if passed two number is passed,
+// it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
+// statement.
+func (d *SysGroupDao) Limit(limit ...int) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *SysGroupDao) Offset(offset int) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Offset(offset)}
+}
+
+// Page sets the paging number for the model.
+// The parameter <page> is started from 1 for paging.
+// Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
+func (d *SysGroupDao) Page(page, limit int) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *SysGroupDao) Batch(batch int) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Batch(batch)}
+}
+
+// Cache sets the cache feature for the model. It caches the result of the sql, which means
+// if there's another same sql request, it just reads and returns the result from cache, it
+// but not committed and executed into the database.
+//
+// If the parameter <duration> < 0, which means it clear the cache with given <name>.
+// If the parameter <duration> = 0, which means it never expires.
+// If the parameter <duration> > 0, which means it expires after <duration>.
+//
+// The optional parameter <name> is used to bind a name to the cache, which means you can later
+// control the cache like changing the <duration> or clearing the cache with specified <name>.
+//
+// Note that, the cache feature is disabled if the model is operating on a transaction.
+func (d *SysGroupDao) Cache(duration time.Duration, name ...string) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Cache(duration, name...)}
+}
+
+// Data sets the operation data for the model.
+// The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
+// Eg:
+// Data("uid=10000")
+// Data("uid", 10000)
+// Data(g.Map{"uid": 10000, "name":"john"})
+// Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
+func (d *SysGroupDao) Data(data ...interface{}) *SysGroupDao {
+	return &SysGroupDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.SysGroup.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *SysGroupDao) All(where ...interface{}) ([]*model.SysGroup, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.SysGroup
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// One retrieves one record from table and returns the result as *model.SysGroup.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *SysGroupDao) One(where ...interface{}) (*model.SysGroup, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.SysGroup
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindOne retrieves and returns a single Record by M.WherePri and M.One.
+// Also see M.WherePri and M.One.
+func (d *SysGroupDao) FindOne(where ...interface{}) (*model.SysGroup, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.SysGroup
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindAll retrieves and returns Result by by M.WherePri and M.All.
+// Also see M.WherePri and M.All.
+func (d *SysGroupDao) FindAll(where ...interface{}) ([]*model.SysGroup, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.SysGroup
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// Struct retrieves one record from table and converts it into given struct.
+// The parameter <pointer> should be type of *struct/**struct. If type **struct is given,
+// it can create the struct internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not nil.
+//
+// Eg:
+// user := new(User)
+// err  := dao.User.Where("id", 1).Struct(user)
+//
+// user := (*User)(nil)
+// err  := dao.User.Where("id", 1).Struct(&user)
+func (d *SysGroupDao) Struct(pointer interface{}, where ...interface{}) error {
+	return d.M.Struct(pointer, where...)
+}
+
+// Structs retrieves records from table and converts them into given struct slice.
+// The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct
+// slice internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not empty.
+//
+// Eg:
+// users := ([]User)(nil)
+// err   := dao.User.Structs(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Structs(&users)
+func (d *SysGroupDao) Structs(pointer interface{}, where ...interface{}) error {
+	return d.M.Structs(pointer, where...)
+}
+
+// Scan automatically calls Struct or Structs function according to the type of parameter <pointer>.
+// It calls function Struct if <pointer> is type of *struct/**struct.
+// It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
+//
+// Eg:
+// user  := new(User)
+// err   := dao.User.Where("id", 1).Scan(user)
+//
+// user  := (*User)(nil)
+// err   := dao.User.Where("id", 1).Scan(&user)
+//
+// users := ([]User)(nil)
+// err   := dao.User.Scan(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Scan(&users)
+func (d *SysGroupDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *SysGroupDao) Chunk(limit int, callback func(entities []*model.SysGroup, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.SysGroup
+		err = result.Structs(&entities)
+		if err == sql.ErrNoRows {
+			return false
+		}
+		return callback(entities, err)
+	})
+}
+
+// LockUpdate sets the lock for update for current operation.
+func (d *SysGroupDao) LockUpdate() *SysGroupDao {
+	return &SysGroupDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *SysGroupDao) LockShared() *SysGroupDao {
+	return &SysGroupDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *SysGroupDao) Unscoped() *SysGroupDao {
+	return &SysGroupDao{M: d.M.Unscoped()}
+}

+ 399 - 0
app/dao/internal/sys_group_role.go

@@ -0,0 +1,399 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"time"
+
+	"dashoo.cn/micro/app/model"
+)
+
+// SysGroupRoleDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type SysGroupRoleDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns sysGroupRoleColumns
+}
+
+// SysGroupRoleColumns defines and stores column names for table sys_group_role.
+type sysGroupRoleColumns struct {
+	GroupId string // 用户组ID
+	RoleId  string // 角色ID
+}
+
+var (
+	// SysGroupRole is globally public accessible object for table sys_group_role operations.
+	SysGroupRole = SysGroupRoleDao{
+		M:     g.DB("default").Model("sys_group_role").Safe(),
+		DB:    g.DB("default"),
+		Table: "sys_group_role",
+		Columns: sysGroupRoleColumns{
+			GroupId: "group_id",
+			RoleId:  "role_id",
+		},
+	}
+)
+
+func NewSysGroupRoleDao(tenant string) SysGroupRoleDao {
+	var dao SysGroupRoleDao
+	dao = SysGroupRoleDao{
+		M:     g.DB(tenant).Model("sys_group_role").Safe(),
+		DB:    g.DB(tenant),
+		Table: "sys_group_role",
+		Columns: sysGroupRoleColumns{
+			GroupId: "group_id",
+			RoleId:  "role_id",
+		},
+	}
+	return dao
+}
+
+// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
+// of current DB object and with given context in it.
+// Note that this returned DB object can be used only once, so do not assign it to
+// a global or package variable for long using.
+func (d *SysGroupRoleDao) Ctx(ctx context.Context) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *SysGroupRoleDao) As(as string) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *SysGroupRoleDao) TX(tx *gdb.TX) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *SysGroupRoleDao) Master() *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *SysGroupRoleDao) Slave() *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *SysGroupRoleDao) Args(args ...interface{}) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Args(args...)}
+}
+
+// LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *SysGroupRoleDao) LeftJoin(table ...string) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.LeftJoin(table...)}
+}
+
+// RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *SysGroupRoleDao) RightJoin(table ...string) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.RightJoin(table...)}
+}
+
+// InnerJoin does "INNER JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *SysGroupRoleDao) InnerJoin(table ...string) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.InnerJoin(table...)}
+}
+
+// Fields sets the operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *SysGroupRoleDao) Fields(fieldNamesOrMapStruct ...interface{}) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *SysGroupRoleDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *SysGroupRoleDao) Option(option int) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *SysGroupRoleDao) OmitEmpty() *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *SysGroupRoleDao) Filter() *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Filter()}
+}
+
+// Where sets the condition statement for the model. The parameter <where> can be type of
+// string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
+// multiple conditions will be joined into where statement using "AND".
+// Eg:
+// Where("uid=10000")
+// Where("uid", 10000)
+// Where("money>? AND name like ?", 99999, "vip_%")
+// Where("uid", 1).Where("name", "john")
+// Where("status IN (?)", g.Slice{1,2,3})
+// Where("age IN(?,?)", 18, 50)
+// Where(User{ Id : 1, UserName : "john"})
+func (d *SysGroupRoleDao) Where(where interface{}, args ...interface{}) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Where(where, args...)}
+}
+
+// WherePri does the same logic as M.Where except that if the parameter <where>
+// is a single condition like int/string/float/slice, it treats the condition as the primary
+// key value. That is, if primary key is "id" and given <where> parameter as "123", the
+// WherePri function treats the condition as "id=123", but M.Where treats the condition
+// as string "123".
+func (d *SysGroupRoleDao) WherePri(where interface{}, args ...interface{}) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *SysGroupRoleDao) And(where interface{}, args ...interface{}) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *SysGroupRoleDao) Or(where interface{}, args ...interface{}) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *SysGroupRoleDao) Group(groupBy string) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *SysGroupRoleDao) Order(orderBy ...string) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Order(orderBy...)}
+}
+
+// Limit sets the "LIMIT" statement for the model.
+// The parameter <limit> can be either one or two number, if passed two number is passed,
+// it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
+// statement.
+func (d *SysGroupRoleDao) Limit(limit ...int) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *SysGroupRoleDao) Offset(offset int) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Offset(offset)}
+}
+
+// Page sets the paging number for the model.
+// The parameter <page> is started from 1 for paging.
+// Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
+func (d *SysGroupRoleDao) Page(page, limit int) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *SysGroupRoleDao) Batch(batch int) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Batch(batch)}
+}
+
+// Cache sets the cache feature for the model. It caches the result of the sql, which means
+// if there's another same sql request, it just reads and returns the result from cache, it
+// but not committed and executed into the database.
+//
+// If the parameter <duration> < 0, which means it clear the cache with given <name>.
+// If the parameter <duration> = 0, which means it never expires.
+// If the parameter <duration> > 0, which means it expires after <duration>.
+//
+// The optional parameter <name> is used to bind a name to the cache, which means you can later
+// control the cache like changing the <duration> or clearing the cache with specified <name>.
+//
+// Note that, the cache feature is disabled if the model is operating on a transaction.
+func (d *SysGroupRoleDao) Cache(duration time.Duration, name ...string) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Cache(duration, name...)}
+}
+
+// Data sets the operation data for the model.
+// The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
+// Eg:
+// Data("uid=10000")
+// Data("uid", 10000)
+// Data(g.Map{"uid": 10000, "name":"john"})
+// Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
+func (d *SysGroupRoleDao) Data(data ...interface{}) *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.SysGroupRole.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *SysGroupRoleDao) All(where ...interface{}) ([]*model.SysGroupRole, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.SysGroupRole
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// One retrieves one record from table and returns the result as *model.SysGroupRole.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *SysGroupRoleDao) One(where ...interface{}) (*model.SysGroupRole, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.SysGroupRole
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindOne retrieves and returns a single Record by M.WherePri and M.One.
+// Also see M.WherePri and M.One.
+func (d *SysGroupRoleDao) FindOne(where ...interface{}) (*model.SysGroupRole, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.SysGroupRole
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindAll retrieves and returns Result by by M.WherePri and M.All.
+// Also see M.WherePri and M.All.
+func (d *SysGroupRoleDao) FindAll(where ...interface{}) ([]*model.SysGroupRole, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.SysGroupRole
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// Struct retrieves one record from table and converts it into given struct.
+// The parameter <pointer> should be type of *struct/**struct. If type **struct is given,
+// it can create the struct internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not nil.
+//
+// Eg:
+// user := new(User)
+// err  := dao.User.Where("id", 1).Struct(user)
+//
+// user := (*User)(nil)
+// err  := dao.User.Where("id", 1).Struct(&user)
+func (d *SysGroupRoleDao) Struct(pointer interface{}, where ...interface{}) error {
+	return d.M.Struct(pointer, where...)
+}
+
+// Structs retrieves records from table and converts them into given struct slice.
+// The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct
+// slice internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not empty.
+//
+// Eg:
+// users := ([]User)(nil)
+// err   := dao.User.Structs(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Structs(&users)
+func (d *SysGroupRoleDao) Structs(pointer interface{}, where ...interface{}) error {
+	return d.M.Structs(pointer, where...)
+}
+
+// Scan automatically calls Struct or Structs function according to the type of parameter <pointer>.
+// It calls function Struct if <pointer> is type of *struct/**struct.
+// It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
+//
+// Eg:
+// user  := new(User)
+// err   := dao.User.Where("id", 1).Scan(user)
+//
+// user  := (*User)(nil)
+// err   := dao.User.Where("id", 1).Scan(&user)
+//
+// users := ([]User)(nil)
+// err   := dao.User.Scan(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Scan(&users)
+func (d *SysGroupRoleDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *SysGroupRoleDao) Chunk(limit int, callback func(entities []*model.SysGroupRole, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.SysGroupRole
+		err = result.Structs(&entities)
+		if err == sql.ErrNoRows {
+			return false
+		}
+		return callback(entities, err)
+	})
+}
+
+// LockUpdate sets the lock for update for current operation.
+func (d *SysGroupRoleDao) LockUpdate() *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *SysGroupRoleDao) LockShared() *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *SysGroupRoleDao) Unscoped() *SysGroupRoleDao {
+	return &SysGroupRoleDao{M: d.M.Unscoped()}
+}

+ 70 - 70
app/dao/internal/sys_menu.go

@@ -26,29 +26,29 @@ type SysMenuDao struct {
 
 // SysMenuColumns defines and stores column names for table sys_menu.
 type sysMenuColumns struct {
-	Id           string // 菜单ID                        
-    MenuName     string // 菜单名称                      
-    ParentId     string // 父菜单ID                      
-    OrderNum     string // 显示顺序                      
-    Path         string // 路由地址                      
-    Component    string // 组件路径                      
-    Query        string // 路由参数                      
-    IsFrame      string // 是否为外链(10是20否)        
-    IsCache      string // 是否缓存(10缓存20不缓存)    
-    MenuType     string // 菜单类型(M目录C菜单 F按钮)  
-    Visible      string // 菜单状态(10显示20隐藏)      
-    Status       string // 菜单状态(10正常20停用)      
-    Perms        string // 权限标识                      
-    Icon         string // 菜单图标                      
-    PlatformId   string // 所属平台                      
-    Remark       string // 备注                          
-    CreatedBy    string // 创建者                        
-    CreatedName  string // 创建人                        
-    CreatedTime  string // 创建时间                      
-    UpdatedBy    string // 更新者                        
-    UpdatedName  string // 更新人                        
-    UpdatedTime  string // 更新时间                      
-    DeletedTime  string // 删除时间
+	Id          string // 菜单ID
+	MenuName    string // 菜单名称
+	ParentId    string // 父菜单ID
+	Path        string // 路由地址
+	Component   string // 组件路径
+	Query       string // 路由参数
+	IsFrame     string // 是否为外链(10是20否)
+	IsCache     string // 是否缓存(10缓存20不缓存)
+	MenuType    string // 菜单类型(M目录C菜单 F按钮)
+	Visible     string // 菜单状态(10显示20隐藏)
+	Status      string // 菜单状态(10正常20停用)
+	Perms       string // 权限标识
+	Icon        string // 菜单图标
+	PlatformId  string // 所属平台
+	Sort        string // 显示顺序
+	Remark      string // 备注
+	CreatedBy   string // 创建者
+	CreatedName string // 创建人
+	CreatedTime string // 创建时间
+	UpdatedBy   string // 更新者
+	UpdatedName string // 更新人
+	UpdatedTime string // 更新时间
+	DeletedTime string // 删除时间
 }
 
 var (
@@ -58,29 +58,29 @@ var (
 		DB:    g.DB("default"),
 		Table: "sys_menu",
 		Columns: sysMenuColumns{
-			Id:          "id",            
-            MenuName:    "menu_name",     
-            ParentId:    "parent_id",     
-            OrderNum:    "order_num",     
-            Path:        "path",          
-            Component:   "component",     
-            Query:       "query",         
-            IsFrame:     "is_frame",      
-            IsCache:     "is_cache",      
-            MenuType:    "menu_type",     
-            Visible:     "visible",       
-            Status:      "status",        
-            Perms:       "perms",         
-            Icon:        "icon",          
-            PlatformId:  "platform_id",   
-            Remark:      "remark",        
-            CreatedBy:   "created_by",    
-            CreatedName: "created_name",  
-            CreatedTime: "created_time",  
-            UpdatedBy:   "updated_by",    
-            UpdatedName: "updated_name",  
-            UpdatedTime: "updated_time",  
-            DeletedTime: "deleted_time",
+			Id:          "id",
+			MenuName:    "menu_name",
+			ParentId:    "parent_id",
+			Path:        "path",
+			Component:   "component",
+			Query:       "query",
+			IsFrame:     "is_frame",
+			IsCache:     "is_cache",
+			MenuType:    "menu_type",
+			Visible:     "visible",
+			Status:      "status",
+			Perms:       "perms",
+			Icon:        "icon",
+			PlatformId:  "platform_id",
+			Sort:        "sort",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
 		},
 	}
 )
@@ -92,29 +92,29 @@ func NewSysMenuDao(tenant string) SysMenuDao {
 		DB:    g.DB(tenant),
 		Table: "sys_menu",
 		Columns: sysMenuColumns{
-			Id:          "id",            
-            MenuName:    "menu_name",     
-            ParentId:    "parent_id",     
-            OrderNum:    "order_num",     
-            Path:        "path",          
-            Component:   "component",     
-            Query:       "query",         
-            IsFrame:     "is_frame",      
-            IsCache:     "is_cache",      
-            MenuType:    "menu_type",     
-            Visible:     "visible",       
-            Status:      "status",        
-            Perms:       "perms",         
-            Icon:        "icon",          
-            PlatformId:  "platform_id",   
-            Remark:      "remark",        
-            CreatedBy:   "created_by",    
-            CreatedName: "created_name",  
-            CreatedTime: "created_time",  
-            UpdatedBy:   "updated_by",    
-            UpdatedName: "updated_name",  
-            UpdatedTime: "updated_time",  
-            DeletedTime: "deleted_time",
+			Id:          "id",
+			MenuName:    "menu_name",
+			ParentId:    "parent_id",
+			Path:        "path",
+			Component:   "component",
+			Query:       "query",
+			IsFrame:     "is_frame",
+			IsCache:     "is_cache",
+			MenuType:    "menu_type",
+			Visible:     "visible",
+			Status:      "status",
+			Perms:       "perms",
+			Icon:        "icon",
+			PlatformId:  "platform_id",
+			Sort:        "sort",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
 		},
 	}
 	return dao
@@ -459,4 +459,4 @@ func (d *SysMenuDao) LockShared() *SysMenuDao {
 // Unscoped enables/disables the soft deleting feature.
 func (d *SysMenuDao) Unscoped() *SysMenuDao {
 	return &SysMenuDao{M: d.M.Unscoped()}
-}
+}

+ 46 - 43
app/dao/internal/sys_platform.go

@@ -26,20 +26,21 @@ type SysPlatformDao struct {
 
 // SysPlatformColumns defines and stores column names for table sys_platform.
 type sysPlatformColumns struct {
-	Id              string // 主键                  
-    PlatformCode    string // 平台编码              
-    PlatformName    string // 平台名称              
-    PlatformEnable  string // 是否开通(10是20否)  
-    PlatformPath    string // 路径                  
-    PlatformIcon    string // 图标                  
-    Remark          string // 备注                  
-    CreatedBy       string // 创建人ID              
-    CreatedName     string // 创建人                
-    CreatedTime     string // 创建时间              
-    UpdatedBy       string // 更新人ID              
-    UpdatedName     string // 更新人                
-    UpdatedTime     string // 更新时间              
-    DeletedTime     string // 删除时间
+	Id             string // 主键
+	PlatformCode   string // 平台编码
+	PlatformName   string // 平台名称
+	PlatformEnable string // 是否开通(10是20否)
+	PlatformPath   string // 路径
+	PlatformIcon   string // 图标
+	Status         string // 帐号状态(10正常20停用)
+	Remark         string // 备注
+	CreatedBy      string // 创建人ID
+	CreatedName    string // 创建人
+	CreatedTime    string // 创建时间
+	UpdatedBy      string // 更新人ID
+	UpdatedName    string // 更新人
+	UpdatedTime    string // 更新时间
+	DeletedTime    string // 删除时间
 }
 
 var (
@@ -49,20 +50,21 @@ var (
 		DB:    g.DB("default"),
 		Table: "sys_platform",
 		Columns: sysPlatformColumns{
-			Id:             "id",               
-            PlatformCode:   "platform_code",    
-            PlatformName:   "platform_name",    
-            PlatformEnable: "platform_enable",  
-            PlatformPath:   "platform_path",    
-            PlatformIcon:   "platform_icon",    
-            Remark:         "remark",           
-            CreatedBy:      "created_by",       
-            CreatedName:    "created_name",     
-            CreatedTime:    "created_time",     
-            UpdatedBy:      "updated_by",       
-            UpdatedName:    "updated_name",     
-            UpdatedTime:    "updated_time",     
-            DeletedTime:    "deleted_time",
+			Id:             "id",
+			PlatformCode:   "platform_code",
+			PlatformName:   "platform_name",
+			PlatformEnable: "platform_enable",
+			PlatformPath:   "platform_path",
+			PlatformIcon:   "platform_icon",
+			Status:         "status",
+			Remark:         "remark",
+			CreatedBy:      "created_by",
+			CreatedName:    "created_name",
+			CreatedTime:    "created_time",
+			UpdatedBy:      "updated_by",
+			UpdatedName:    "updated_name",
+			UpdatedTime:    "updated_time",
+			DeletedTime:    "deleted_time",
 		},
 	}
 )
@@ -74,20 +76,21 @@ func NewSysPlatformDao(tenant string) SysPlatformDao {
 		DB:    g.DB(tenant),
 		Table: "sys_platform",
 		Columns: sysPlatformColumns{
-			Id:             "id",               
-            PlatformCode:   "platform_code",    
-            PlatformName:   "platform_name",    
-            PlatformEnable: "platform_enable",  
-            PlatformPath:   "platform_path",    
-            PlatformIcon:   "platform_icon",    
-            Remark:         "remark",           
-            CreatedBy:      "created_by",       
-            CreatedName:    "created_name",     
-            CreatedTime:    "created_time",     
-            UpdatedBy:      "updated_by",       
-            UpdatedName:    "updated_name",     
-            UpdatedTime:    "updated_time",     
-            DeletedTime:    "deleted_time",
+			Id:             "id",
+			PlatformCode:   "platform_code",
+			PlatformName:   "platform_name",
+			PlatformEnable: "platform_enable",
+			PlatformPath:   "platform_path",
+			PlatformIcon:   "platform_icon",
+			Status:         "status",
+			Remark:         "remark",
+			CreatedBy:      "created_by",
+			CreatedName:    "created_name",
+			CreatedTime:    "created_time",
+			UpdatedBy:      "updated_by",
+			UpdatedName:    "updated_name",
+			UpdatedTime:    "updated_time",
+			DeletedTime:    "deleted_time",
 		},
 	}
 	return dao
@@ -432,4 +435,4 @@ func (d *SysPlatformDao) LockShared() *SysPlatformDao {
 // Unscoped enables/disables the soft deleting feature.
 func (d *SysPlatformDao) Unscoped() *SysPlatformDao {
 	return &SysPlatformDao{M: d.M.Unscoped()}
-}
+}

+ 40 - 40
app/dao/internal/sys_post.go

@@ -26,19 +26,19 @@ type SysPostDao struct {
 
 // SysPostColumns defines and stores column names for table sys_post.
 type sysPostColumns struct {
-	Id           string // 岗位ID                
-    PostCode     string // 岗位编码              
-    PostName     string // 岗位名称              
-    PostSort     string // 显示顺序              
-    Status       string // 状态(10正常20停用)  
-    Remark       string // 备注                  
-    CreatedBy    string // 创建者                
-    CreatedName  string // 创建人                
-    CreatedTime  string // 创建时间              
-    UpdatedBy    string // 更新者                
-    UpdatedName  string // 更新人                
-    UpdatedTime  string // 更新时间              
-    DeletedTime  string // 删除时间
+	Id          string // 岗位ID
+	PostCode    string // 岗位编码
+	PostName    string // 岗位名称
+	Status      string // 状态(10正常20停用)
+	Sort        string // 显示顺序
+	Remark      string // 备注
+	CreatedBy   string // 创建者
+	CreatedName string // 创建人
+	CreatedTime string // 创建时间
+	UpdatedBy   string // 更新者
+	UpdatedName string // 更新人
+	UpdatedTime string // 更新时间
+	DeletedTime string // 删除时间
 }
 
 var (
@@ -48,19 +48,19 @@ var (
 		DB:    g.DB("default"),
 		Table: "sys_post",
 		Columns: sysPostColumns{
-			Id:          "id",            
-            PostCode:    "post_code",     
-            PostName:    "post_name",     
-            PostSort:    "post_sort",     
-            Status:      "status",        
-            Remark:      "remark",        
-            CreatedBy:   "created_by",    
-            CreatedName: "created_name",  
-            CreatedTime: "created_time",  
-            UpdatedBy:   "updated_by",    
-            UpdatedName: "updated_name",  
-            UpdatedTime: "updated_time",  
-            DeletedTime: "deleted_time",
+			Id:          "id",
+			PostCode:    "post_code",
+			PostName:    "post_name",
+			Status:      "status",
+			Sort:        "sort",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
 		},
 	}
 )
@@ -72,19 +72,19 @@ func NewSysPostDao(tenant string) SysPostDao {
 		DB:    g.DB(tenant),
 		Table: "sys_post",
 		Columns: sysPostColumns{
-			Id:          "id",            
-            PostCode:    "post_code",     
-            PostName:    "post_name",     
-            PostSort:    "post_sort",     
-            Status:      "status",        
-            Remark:      "remark",        
-            CreatedBy:   "created_by",    
-            CreatedName: "created_name",  
-            CreatedTime: "created_time",  
-            UpdatedBy:   "updated_by",    
-            UpdatedName: "updated_name",  
-            UpdatedTime: "updated_time",  
-            DeletedTime: "deleted_time",
+			Id:          "id",
+			PostCode:    "post_code",
+			PostName:    "post_name",
+			Status:      "status",
+			Sort:        "sort",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
 		},
 	}
 	return dao
@@ -429,4 +429,4 @@ func (d *SysPostDao) LockShared() *SysPostDao {
 // Unscoped enables/disables the soft deleting feature.
 func (d *SysPostDao) Unscoped() *SysPostDao {
 	return &SysPostDao{M: d.M.Unscoped()}
-}
+}

+ 399 - 0
app/dao/internal/sys_post_role.go

@@ -0,0 +1,399 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"time"
+
+	"dashoo.cn/micro/app/model"
+)
+
+// SysPostRoleDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type SysPostRoleDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns sysPostRoleColumns
+}
+
+// SysPostRoleColumns defines and stores column names for table sys_post_role.
+type sysPostRoleColumns struct {
+	PostId string // 岗位ID
+	RoleId string // 角色ID
+}
+
+var (
+	// SysPostRole is globally public accessible object for table sys_post_role operations.
+	SysPostRole = SysPostRoleDao{
+		M:     g.DB("default").Model("sys_post_role").Safe(),
+		DB:    g.DB("default"),
+		Table: "sys_post_role",
+		Columns: sysPostRoleColumns{
+			PostId: "post_id",
+			RoleId: "role_id",
+		},
+	}
+)
+
+func NewSysPostRoleDao(tenant string) SysPostRoleDao {
+	var dao SysPostRoleDao
+	dao = SysPostRoleDao{
+		M:     g.DB(tenant).Model("sys_post_role").Safe(),
+		DB:    g.DB(tenant),
+		Table: "sys_post_role",
+		Columns: sysPostRoleColumns{
+			PostId: "post_id",
+			RoleId: "role_id",
+		},
+	}
+	return dao
+}
+
+// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
+// of current DB object and with given context in it.
+// Note that this returned DB object can be used only once, so do not assign it to
+// a global or package variable for long using.
+func (d *SysPostRoleDao) Ctx(ctx context.Context) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *SysPostRoleDao) As(as string) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *SysPostRoleDao) TX(tx *gdb.TX) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *SysPostRoleDao) Master() *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *SysPostRoleDao) Slave() *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *SysPostRoleDao) Args(args ...interface{}) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Args(args...)}
+}
+
+// LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *SysPostRoleDao) LeftJoin(table ...string) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.LeftJoin(table...)}
+}
+
+// RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *SysPostRoleDao) RightJoin(table ...string) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.RightJoin(table...)}
+}
+
+// InnerJoin does "INNER JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *SysPostRoleDao) InnerJoin(table ...string) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.InnerJoin(table...)}
+}
+
+// Fields sets the operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *SysPostRoleDao) Fields(fieldNamesOrMapStruct ...interface{}) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *SysPostRoleDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *SysPostRoleDao) Option(option int) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *SysPostRoleDao) OmitEmpty() *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *SysPostRoleDao) Filter() *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Filter()}
+}
+
+// Where sets the condition statement for the model. The parameter <where> can be type of
+// string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
+// multiple conditions will be joined into where statement using "AND".
+// Eg:
+// Where("uid=10000")
+// Where("uid", 10000)
+// Where("money>? AND name like ?", 99999, "vip_%")
+// Where("uid", 1).Where("name", "john")
+// Where("status IN (?)", g.Slice{1,2,3})
+// Where("age IN(?,?)", 18, 50)
+// Where(User{ Id : 1, UserName : "john"})
+func (d *SysPostRoleDao) Where(where interface{}, args ...interface{}) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Where(where, args...)}
+}
+
+// WherePri does the same logic as M.Where except that if the parameter <where>
+// is a single condition like int/string/float/slice, it treats the condition as the primary
+// key value. That is, if primary key is "id" and given <where> parameter as "123", the
+// WherePri function treats the condition as "id=123", but M.Where treats the condition
+// as string "123".
+func (d *SysPostRoleDao) WherePri(where interface{}, args ...interface{}) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *SysPostRoleDao) And(where interface{}, args ...interface{}) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *SysPostRoleDao) Or(where interface{}, args ...interface{}) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *SysPostRoleDao) Group(groupBy string) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *SysPostRoleDao) Order(orderBy ...string) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Order(orderBy...)}
+}
+
+// Limit sets the "LIMIT" statement for the model.
+// The parameter <limit> can be either one or two number, if passed two number is passed,
+// it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
+// statement.
+func (d *SysPostRoleDao) Limit(limit ...int) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *SysPostRoleDao) Offset(offset int) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Offset(offset)}
+}
+
+// Page sets the paging number for the model.
+// The parameter <page> is started from 1 for paging.
+// Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
+func (d *SysPostRoleDao) Page(page, limit int) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *SysPostRoleDao) Batch(batch int) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Batch(batch)}
+}
+
+// Cache sets the cache feature for the model. It caches the result of the sql, which means
+// if there's another same sql request, it just reads and returns the result from cache, it
+// but not committed and executed into the database.
+//
+// If the parameter <duration> < 0, which means it clear the cache with given <name>.
+// If the parameter <duration> = 0, which means it never expires.
+// If the parameter <duration> > 0, which means it expires after <duration>.
+//
+// The optional parameter <name> is used to bind a name to the cache, which means you can later
+// control the cache like changing the <duration> or clearing the cache with specified <name>.
+//
+// Note that, the cache feature is disabled if the model is operating on a transaction.
+func (d *SysPostRoleDao) Cache(duration time.Duration, name ...string) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Cache(duration, name...)}
+}
+
+// Data sets the operation data for the model.
+// The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
+// Eg:
+// Data("uid=10000")
+// Data("uid", 10000)
+// Data(g.Map{"uid": 10000, "name":"john"})
+// Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
+func (d *SysPostRoleDao) Data(data ...interface{}) *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.SysPostRole.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *SysPostRoleDao) All(where ...interface{}) ([]*model.SysPostRole, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.SysPostRole
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// One retrieves one record from table and returns the result as *model.SysPostRole.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *SysPostRoleDao) One(where ...interface{}) (*model.SysPostRole, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.SysPostRole
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindOne retrieves and returns a single Record by M.WherePri and M.One.
+// Also see M.WherePri and M.One.
+func (d *SysPostRoleDao) FindOne(where ...interface{}) (*model.SysPostRole, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.SysPostRole
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindAll retrieves and returns Result by by M.WherePri and M.All.
+// Also see M.WherePri and M.All.
+func (d *SysPostRoleDao) FindAll(where ...interface{}) ([]*model.SysPostRole, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.SysPostRole
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// Struct retrieves one record from table and converts it into given struct.
+// The parameter <pointer> should be type of *struct/**struct. If type **struct is given,
+// it can create the struct internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not nil.
+//
+// Eg:
+// user := new(User)
+// err  := dao.User.Where("id", 1).Struct(user)
+//
+// user := (*User)(nil)
+// err  := dao.User.Where("id", 1).Struct(&user)
+func (d *SysPostRoleDao) Struct(pointer interface{}, where ...interface{}) error {
+	return d.M.Struct(pointer, where...)
+}
+
+// Structs retrieves records from table and converts them into given struct slice.
+// The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct
+// slice internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not empty.
+//
+// Eg:
+// users := ([]User)(nil)
+// err   := dao.User.Structs(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Structs(&users)
+func (d *SysPostRoleDao) Structs(pointer interface{}, where ...interface{}) error {
+	return d.M.Structs(pointer, where...)
+}
+
+// Scan automatically calls Struct or Structs function according to the type of parameter <pointer>.
+// It calls function Struct if <pointer> is type of *struct/**struct.
+// It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
+//
+// Eg:
+// user  := new(User)
+// err   := dao.User.Where("id", 1).Scan(user)
+//
+// user  := (*User)(nil)
+// err   := dao.User.Where("id", 1).Scan(&user)
+//
+// users := ([]User)(nil)
+// err   := dao.User.Scan(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Scan(&users)
+func (d *SysPostRoleDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *SysPostRoleDao) Chunk(limit int, callback func(entities []*model.SysPostRole, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.SysPostRole
+		err = result.Structs(&entities)
+		if err == sql.ErrNoRows {
+			return false
+		}
+		return callback(entities, err)
+	})
+}
+
+// LockUpdate sets the lock for update for current operation.
+func (d *SysPostRoleDao) LockUpdate() *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *SysPostRoleDao) LockShared() *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *SysPostRoleDao) Unscoped() *SysPostRoleDao {
+	return &SysPostRoleDao{M: d.M.Unscoped()}
+}

+ 49 - 46
app/dao/internal/sys_role.go

@@ -26,21 +26,22 @@ type SysRoleDao struct {
 
 // SysRoleColumns defines and stores column names for table sys_role.
 type sysRoleColumns struct {
-	Id                 string // 角色ID                                                                                     
-    RoleName           string // 角色名称                                                                                   
-    RoleKey            string // 角色权限字符串                                                                             
-    RoleSort           string // 显示顺序                                                                                   
-    DataScope          string // 数据范围(10:全部数据权限 20:自定数据权限 30:本部门数据权限 40:本部门及以下数据权限)  
-    MenuCheckStrictly  string // 菜单树选择项是否关联显示                                                                   
-    DeptCheckStrictly  string // 部门树选择项是否关联显示                                                                   
-    Status             string // 角色状态(10正常20停用)                                                                   
-    CreatedBy          string // 创建者                                                                                     
-    CreatedName        string // 创建人                                                                                     
-    CreatedTime        string // 创建时间                                                                                   
-    UpdatedBy          string // 更新者                                                                                     
-    UpdatedName        string // 更新人                                                                                     
-    UpdatedTime        string // 更新时间                                                                                   
-    DeletedTime        string // 删除时间
+	Id                string // 角色ID
+	RoleName          string // 角色名称
+	RoleKey           string // 角色权限字符串
+	DataScope         string // 数据范围;(10:全部数据权限 20:自定数据权限 30:本部门数据权限 40:本部门及以下数据权限)
+	MenuCheckStrictly string // 菜单树选择项是否关联显示
+	DeptCheckStrictly string // 部门树选择项是否关联显示
+	Status            string // 角色状态(10正常20停用)
+	Sort              string // 显示顺序
+	Remark            string // 备注
+	CreatedBy         string // 创建者
+	CreatedName       string // 创建人
+	CreatedTime       string // 创建时间
+	UpdatedBy         string // 更新者
+	UpdatedName       string // 更新人
+	UpdatedTime       string // 更新时间
+	DeletedTime       string // 删除时间
 }
 
 var (
@@ -50,21 +51,22 @@ var (
 		DB:    g.DB("default"),
 		Table: "sys_role",
 		Columns: sysRoleColumns{
-			Id:                "id",                   
-            RoleName:          "role_name",            
-            RoleKey:           "role_key",             
-            RoleSort:          "role_sort",            
-            DataScope:         "data_scope",           
-            MenuCheckStrictly: "menu_check_strictly",  
-            DeptCheckStrictly: "dept_check_strictly",  
-            Status:            "status",               
-            CreatedBy:         "created_by",           
-            CreatedName:       "created_name",         
-            CreatedTime:       "created_time",         
-            UpdatedBy:         "updated_by",           
-            UpdatedName:       "updated_name",         
-            UpdatedTime:       "updated_time",         
-            DeletedTime:       "deleted_time",
+			Id:                "id",
+			RoleName:          "role_name",
+			RoleKey:           "role_key",
+			DataScope:         "data_scope",
+			MenuCheckStrictly: "menu_check_strictly",
+			DeptCheckStrictly: "dept_check_strictly",
+			Status:            "status",
+			Sort:              "sort",
+			Remark:            "remark",
+			CreatedBy:         "created_by",
+			CreatedName:       "created_name",
+			CreatedTime:       "created_time",
+			UpdatedBy:         "updated_by",
+			UpdatedName:       "updated_name",
+			UpdatedTime:       "updated_time",
+			DeletedTime:       "deleted_time",
 		},
 	}
 )
@@ -76,21 +78,22 @@ func NewSysRoleDao(tenant string) SysRoleDao {
 		DB:    g.DB(tenant),
 		Table: "sys_role",
 		Columns: sysRoleColumns{
-			Id:                "id",                   
-            RoleName:          "role_name",            
-            RoleKey:           "role_key",             
-            RoleSort:          "role_sort",            
-            DataScope:         "data_scope",           
-            MenuCheckStrictly: "menu_check_strictly",  
-            DeptCheckStrictly: "dept_check_strictly",  
-            Status:            "status",               
-            CreatedBy:         "created_by",           
-            CreatedName:       "created_name",         
-            CreatedTime:       "created_time",         
-            UpdatedBy:         "updated_by",           
-            UpdatedName:       "updated_name",         
-            UpdatedTime:       "updated_time",         
-            DeletedTime:       "deleted_time",
+			Id:                "id",
+			RoleName:          "role_name",
+			RoleKey:           "role_key",
+			DataScope:         "data_scope",
+			MenuCheckStrictly: "menu_check_strictly",
+			DeptCheckStrictly: "dept_check_strictly",
+			Status:            "status",
+			Sort:              "sort",
+			Remark:            "remark",
+			CreatedBy:         "created_by",
+			CreatedName:       "created_name",
+			CreatedTime:       "created_time",
+			UpdatedBy:         "updated_by",
+			UpdatedName:       "updated_name",
+			UpdatedTime:       "updated_time",
+			DeletedTime:       "deleted_time",
 		},
 	}
 	return dao
@@ -435,4 +438,4 @@ func (d *SysRoleDao) LockShared() *SysRoleDao {
 // Unscoped enables/disables the soft deleting feature.
 func (d *SysRoleDao) Unscoped() *SysRoleDao {
 	return &SysRoleDao{M: d.M.Unscoped()}
-}
+}

+ 7 - 7
app/dao/internal/sys_role_dept.go

@@ -26,8 +26,8 @@ type SysRoleDeptDao struct {
 
 // SysRoleDeptColumns defines and stores column names for table sys_role_dept.
 type sysRoleDeptColumns struct {
-	RoleId  string // 角色ID  
-    DeptId  string // 部门ID
+	DeptId string // 部门ID
+	RoleId string // 角色ID
 }
 
 var (
@@ -37,8 +37,8 @@ var (
 		DB:    g.DB("default"),
 		Table: "sys_role_dept",
 		Columns: sysRoleDeptColumns{
-			RoleId: "role_id",  
-            DeptId: "dept_id",
+			DeptId: "dept_id",
+			RoleId: "role_id",
 		},
 	}
 )
@@ -50,8 +50,8 @@ func NewSysRoleDeptDao(tenant string) SysRoleDeptDao {
 		DB:    g.DB(tenant),
 		Table: "sys_role_dept",
 		Columns: sysRoleDeptColumns{
-			RoleId: "role_id",  
-            DeptId: "dept_id",
+			DeptId: "dept_id",
+			RoleId: "role_id",
 		},
 	}
 	return dao
@@ -396,4 +396,4 @@ func (d *SysRoleDeptDao) LockShared() *SysRoleDeptDao {
 // Unscoped enables/disables the soft deleting feature.
 func (d *SysRoleDeptDao) Unscoped() *SysRoleDeptDao {
 	return &SysRoleDeptDao{M: d.M.Unscoped()}
-}
+}

+ 64 - 64
app/dao/internal/sys_user.go

@@ -26,27 +26,27 @@ type SysUserDao struct {
 
 // SysUserColumns defines and stores column names for table sys_user.
 type sysUserColumns struct {
-	Id           string // 用户ID                      
-    DeptId       string // 部门ID                      
-    UserName     string // 用户账号                    
-    NickName     string // 用户昵称                    
-    UserType     string // 用户类型(00系统用户)      
-    Email        string // 用户邮箱                    
-    Phone        string // 手机号码                    
-    Sex          string // 用户性别(10男20女30未知)  
-    Avatar       string // 头像地址                    
-    Password     string // 密码                        
-    Status       string // 帐号状态(0正常1停用)      
-    LoginIp      string // 最后登录IP                  
-    LoginDate    string // 最后登录时间                
-    Remark       string // 备注                        
-    CreatedBy    string // 创建者                      
-    CreatedName  string // 创建人                      
-    CreatedTime  string // 创建时间                    
-    UpdatedBy    string // 更新者                      
-    UpdatedName  string // 更新人                      
-    UpdatedTime  string // 更新时间                    
-    DeletedTime  string // 删除时间
+	Id          string // 用户ID
+	DeptId      string // 部门ID
+	UserName    string // 用户账号
+	NickName    string // 用户昵称
+	UserType    string // 用户类型(00系统用户)
+	Email       string // 用户邮箱
+	Phone       string // 手机号码
+	Sex         string // 用户性别(10男20女30未知)
+	Avatar      string // 头像地址
+	Password    string // 密码
+	LoginIp     string // 最后登录IP
+	LoginDate   string // 最后登录时间
+	Remark      string // 备注
+	CreatedBy   string // 创建者
+	CreatedName string // 创建人
+	CreatedTime string // 创建时间
+	UpdatedBy   string // 更新者
+	UpdatedName string // 更新人
+	UpdatedTime string // 更新时间
+	DeletedTime string // 删除时间
+	Status      string // 帐号状态(10正常20停用)
 }
 
 var (
@@ -56,27 +56,27 @@ var (
 		DB:    g.DB("default"),
 		Table: "sys_user",
 		Columns: sysUserColumns{
-			Id:          "id",            
-            DeptId:      "dept_id",       
-            UserName:    "user_name",     
-            NickName:    "nick_name",     
-            UserType:    "user_type",     
-            Email:       "email",         
-            Phone:       "phone",         
-            Sex:         "sex",           
-            Avatar:      "avatar",        
-            Password:    "password",      
-            Status:      "status",        
-            LoginIp:     "login_ip",      
-            LoginDate:   "login_date",    
-            Remark:      "remark",        
-            CreatedBy:   "created_by",    
-            CreatedName: "created_name",  
-            CreatedTime: "created_time",  
-            UpdatedBy:   "updated_by",    
-            UpdatedName: "updated_name",  
-            UpdatedTime: "updated_time",  
-            DeletedTime: "deleted_time",
+			Id:          "id",
+			DeptId:      "dept_id",
+			UserName:    "user_name",
+			NickName:    "nick_name",
+			UserType:    "user_type",
+			Email:       "email",
+			Phone:       "phone",
+			Sex:         "sex",
+			Avatar:      "avatar",
+			Password:    "password",
+			LoginIp:     "login_ip",
+			LoginDate:   "login_date",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
+			Status:      "status",
 		},
 	}
 )
@@ -88,27 +88,27 @@ func NewSysUserDao(tenant string) SysUserDao {
 		DB:    g.DB(tenant),
 		Table: "sys_user",
 		Columns: sysUserColumns{
-			Id:          "id",            
-            DeptId:      "dept_id",       
-            UserName:    "user_name",     
-            NickName:    "nick_name",     
-            UserType:    "user_type",     
-            Email:       "email",         
-            Phone:       "phone",         
-            Sex:         "sex",           
-            Avatar:      "avatar",        
-            Password:    "password",      
-            Status:      "status",        
-            LoginIp:     "login_ip",      
-            LoginDate:   "login_date",    
-            Remark:      "remark",        
-            CreatedBy:   "created_by",    
-            CreatedName: "created_name",  
-            CreatedTime: "created_time",  
-            UpdatedBy:   "updated_by",    
-            UpdatedName: "updated_name",  
-            UpdatedTime: "updated_time",  
-            DeletedTime: "deleted_time",
+			Id:          "id",
+			DeptId:      "dept_id",
+			UserName:    "user_name",
+			NickName:    "nick_name",
+			UserType:    "user_type",
+			Email:       "email",
+			Phone:       "phone",
+			Sex:         "sex",
+			Avatar:      "avatar",
+			Password:    "password",
+			LoginIp:     "login_ip",
+			LoginDate:   "login_date",
+			Remark:      "remark",
+			CreatedBy:   "created_by",
+			CreatedName: "created_name",
+			CreatedTime: "created_time",
+			UpdatedBy:   "updated_by",
+			UpdatedName: "updated_name",
+			UpdatedTime: "updated_time",
+			DeletedTime: "deleted_time",
+			Status:      "status",
 		},
 	}
 	return dao
@@ -453,4 +453,4 @@ func (d *SysUserDao) LockShared() *SysUserDao {
 // Unscoped enables/disables the soft deleting feature.
 func (d *SysUserDao) Unscoped() *SysUserDao {
 	return &SysUserDao{M: d.M.Unscoped()}
-}
+}

+ 399 - 0
app/dao/internal/sys_user_group.go

@@ -0,0 +1,399 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"context"
+	"database/sql"
+	"github.com/gogf/gf/database/gdb"
+	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/frame/gmvc"
+	"time"
+
+	"dashoo.cn/micro/app/model"
+)
+
+// SysUserGroupDao is the manager for logic model data accessing
+// and custom defined data operations functions management.
+type SysUserGroupDao struct {
+	gmvc.M
+	DB      gdb.DB
+	Table   string
+	Columns sysUserGroupColumns
+}
+
+// SysUserGroupColumns defines and stores column names for table sys_user_group.
+type sysUserGroupColumns struct {
+	UserId  string // 用户ID
+	GroupId string // 用户组ID
+}
+
+var (
+	// SysUserGroup is globally public accessible object for table sys_user_group operations.
+	SysUserGroup = SysUserGroupDao{
+		M:     g.DB("default").Model("sys_user_group").Safe(),
+		DB:    g.DB("default"),
+		Table: "sys_user_group",
+		Columns: sysUserGroupColumns{
+			UserId:  "user_id",
+			GroupId: "group_id",
+		},
+	}
+)
+
+func NewSysUserGroupDao(tenant string) SysUserGroupDao {
+	var dao SysUserGroupDao
+	dao = SysUserGroupDao{
+		M:     g.DB(tenant).Model("sys_user_group").Safe(),
+		DB:    g.DB(tenant),
+		Table: "sys_user_group",
+		Columns: sysUserGroupColumns{
+			UserId:  "user_id",
+			GroupId: "group_id",
+		},
+	}
+	return dao
+}
+
+// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
+// of current DB object and with given context in it.
+// Note that this returned DB object can be used only once, so do not assign it to
+// a global or package variable for long using.
+func (d *SysUserGroupDao) Ctx(ctx context.Context) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Ctx(ctx)}
+}
+
+// As sets an alias name for current table.
+func (d *SysUserGroupDao) As(as string) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.As(as)}
+}
+
+// TX sets the transaction for current operation.
+func (d *SysUserGroupDao) TX(tx *gdb.TX) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.TX(tx)}
+}
+
+// Master marks the following operation on master node.
+func (d *SysUserGroupDao) Master() *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Master()}
+}
+
+// Slave marks the following operation on slave node.
+// Note that it makes sense only if there's any slave node configured.
+func (d *SysUserGroupDao) Slave() *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Slave()}
+}
+
+// Args sets custom arguments for model operation.
+func (d *SysUserGroupDao) Args(args ...interface{}) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Args(args...)}
+}
+
+// LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *SysUserGroupDao) LeftJoin(table ...string) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.LeftJoin(table...)}
+}
+
+// RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *SysUserGroupDao) RightJoin(table ...string) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.RightJoin(table...)}
+}
+
+// InnerJoin does "INNER JOIN ... ON ..." statement on the model.
+// The parameter <table> can be joined table and its joined condition,
+// and also with its alias name, like:
+// Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
+// Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
+func (d *SysUserGroupDao) InnerJoin(table ...string) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.InnerJoin(table...)}
+}
+
+// Fields sets the operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *SysUserGroupDao) Fields(fieldNamesOrMapStruct ...interface{}) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Fields(fieldNamesOrMapStruct...)}
+}
+
+// FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
+// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
+func (d *SysUserGroupDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...)}
+}
+
+// Option sets the extra operation option for the model.
+func (d *SysUserGroupDao) Option(option int) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Option(option)}
+}
+
+// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
+// the data and where attributes for empty values.
+func (d *SysUserGroupDao) OmitEmpty() *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.OmitEmpty()}
+}
+
+// Filter marks filtering the fields which does not exist in the fields of the operated table.
+func (d *SysUserGroupDao) Filter() *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Filter()}
+}
+
+// Where sets the condition statement for the model. The parameter <where> can be type of
+// string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
+// multiple conditions will be joined into where statement using "AND".
+// Eg:
+// Where("uid=10000")
+// Where("uid", 10000)
+// Where("money>? AND name like ?", 99999, "vip_%")
+// Where("uid", 1).Where("name", "john")
+// Where("status IN (?)", g.Slice{1,2,3})
+// Where("age IN(?,?)", 18, 50)
+// Where(User{ Id : 1, UserName : "john"})
+func (d *SysUserGroupDao) Where(where interface{}, args ...interface{}) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Where(where, args...)}
+}
+
+// WherePri does the same logic as M.Where except that if the parameter <where>
+// is a single condition like int/string/float/slice, it treats the condition as the primary
+// key value. That is, if primary key is "id" and given <where> parameter as "123", the
+// WherePri function treats the condition as "id=123", but M.Where treats the condition
+// as string "123".
+func (d *SysUserGroupDao) WherePri(where interface{}, args ...interface{}) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.WherePri(where, args...)}
+}
+
+// And adds "AND" condition to the where statement.
+func (d *SysUserGroupDao) And(where interface{}, args ...interface{}) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.And(where, args...)}
+}
+
+// Or adds "OR" condition to the where statement.
+func (d *SysUserGroupDao) Or(where interface{}, args ...interface{}) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Or(where, args...)}
+}
+
+// Group sets the "GROUP BY" statement for the model.
+func (d *SysUserGroupDao) Group(groupBy string) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Group(groupBy)}
+}
+
+// Order sets the "ORDER BY" statement for the model.
+func (d *SysUserGroupDao) Order(orderBy ...string) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Order(orderBy...)}
+}
+
+// Limit sets the "LIMIT" statement for the model.
+// The parameter <limit> can be either one or two number, if passed two number is passed,
+// it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
+// statement.
+func (d *SysUserGroupDao) Limit(limit ...int) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Limit(limit...)}
+}
+
+// Offset sets the "OFFSET" statement for the model.
+// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
+func (d *SysUserGroupDao) Offset(offset int) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Offset(offset)}
+}
+
+// Page sets the paging number for the model.
+// The parameter <page> is started from 1 for paging.
+// Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
+func (d *SysUserGroupDao) Page(page, limit int) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Page(page, limit)}
+}
+
+// Batch sets the batch operation number for the model.
+func (d *SysUserGroupDao) Batch(batch int) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Batch(batch)}
+}
+
+// Cache sets the cache feature for the model. It caches the result of the sql, which means
+// if there's another same sql request, it just reads and returns the result from cache, it
+// but not committed and executed into the database.
+//
+// If the parameter <duration> < 0, which means it clear the cache with given <name>.
+// If the parameter <duration> = 0, which means it never expires.
+// If the parameter <duration> > 0, which means it expires after <duration>.
+//
+// The optional parameter <name> is used to bind a name to the cache, which means you can later
+// control the cache like changing the <duration> or clearing the cache with specified <name>.
+//
+// Note that, the cache feature is disabled if the model is operating on a transaction.
+func (d *SysUserGroupDao) Cache(duration time.Duration, name ...string) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Cache(duration, name...)}
+}
+
+// Data sets the operation data for the model.
+// The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
+// Eg:
+// Data("uid=10000")
+// Data("uid", 10000)
+// Data(g.Map{"uid": 10000, "name":"john"})
+// Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
+func (d *SysUserGroupDao) Data(data ...interface{}) *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Data(data...)}
+}
+
+// All does "SELECT FROM ..." statement for the model.
+// It retrieves the records from table and returns the result as []*model.SysUserGroup.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *SysUserGroupDao) All(where ...interface{}) ([]*model.SysUserGroup, error) {
+	all, err := d.M.All(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.SysUserGroup
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// One retrieves one record from table and returns the result as *model.SysUserGroup.
+// It returns nil if there's no record retrieved with the given conditions from table.
+//
+// The optional parameter <where> is the same as the parameter of M.Where function,
+// see M.Where.
+func (d *SysUserGroupDao) One(where ...interface{}) (*model.SysUserGroup, error) {
+	one, err := d.M.One(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.SysUserGroup
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindOne retrieves and returns a single Record by M.WherePri and M.One.
+// Also see M.WherePri and M.One.
+func (d *SysUserGroupDao) FindOne(where ...interface{}) (*model.SysUserGroup, error) {
+	one, err := d.M.FindOne(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entity *model.SysUserGroup
+	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entity, nil
+}
+
+// FindAll retrieves and returns Result by by M.WherePri and M.All.
+// Also see M.WherePri and M.All.
+func (d *SysUserGroupDao) FindAll(where ...interface{}) ([]*model.SysUserGroup, error) {
+	all, err := d.M.FindAll(where...)
+	if err != nil {
+		return nil, err
+	}
+	var entities []*model.SysUserGroup
+	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
+		return nil, err
+	}
+	return entities, nil
+}
+
+// Struct retrieves one record from table and converts it into given struct.
+// The parameter <pointer> should be type of *struct/**struct. If type **struct is given,
+// it can create the struct internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not nil.
+//
+// Eg:
+// user := new(User)
+// err  := dao.User.Where("id", 1).Struct(user)
+//
+// user := (*User)(nil)
+// err  := dao.User.Where("id", 1).Struct(&user)
+func (d *SysUserGroupDao) Struct(pointer interface{}, where ...interface{}) error {
+	return d.M.Struct(pointer, where...)
+}
+
+// Structs retrieves records from table and converts them into given struct slice.
+// The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct
+// slice internally during converting.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
+// from table and <pointer> is not empty.
+//
+// Eg:
+// users := ([]User)(nil)
+// err   := dao.User.Structs(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Structs(&users)
+func (d *SysUserGroupDao) Structs(pointer interface{}, where ...interface{}) error {
+	return d.M.Structs(pointer, where...)
+}
+
+// Scan automatically calls Struct or Structs function according to the type of parameter <pointer>.
+// It calls function Struct if <pointer> is type of *struct/**struct.
+// It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
+//
+// The optional parameter <where> is the same as the parameter of Model.Where function,
+// see Model.Where.
+//
+// Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
+//
+// Eg:
+// user  := new(User)
+// err   := dao.User.Where("id", 1).Scan(user)
+//
+// user  := (*User)(nil)
+// err   := dao.User.Where("id", 1).Scan(&user)
+//
+// users := ([]User)(nil)
+// err   := dao.User.Scan(&users)
+//
+// users := ([]*User)(nil)
+// err   := dao.User.Scan(&users)
+func (d *SysUserGroupDao) Scan(pointer interface{}, where ...interface{}) error {
+	return d.M.Scan(pointer, where...)
+}
+
+// Chunk iterates the table with given size and callback function.
+func (d *SysUserGroupDao) Chunk(limit int, callback func(entities []*model.SysUserGroup, err error) bool) {
+	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
+		var entities []*model.SysUserGroup
+		err = result.Structs(&entities)
+		if err == sql.ErrNoRows {
+			return false
+		}
+		return callback(entities, err)
+	})
+}
+
+// LockUpdate sets the lock for update for current operation.
+func (d *SysUserGroupDao) LockUpdate() *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.LockUpdate()}
+}
+
+// LockShared sets the lock in share mode for current operation.
+func (d *SysUserGroupDao) LockShared() *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.LockShared()}
+}
+
+// Unscoped enables/disables the soft deleting feature.
+func (d *SysUserGroupDao) Unscoped() *SysUserGroupDao {
+	return &SysUserGroupDao{M: d.M.Unscoped()}
+}

+ 36 - 0
app/dao/sys_group.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"dashoo.cn/micro/app/dao/internal"
+)
+
+// sysGroupDao is the manager for logic model data accessing
+// and custom defined data operations functions management. You can define
+// methods on it to extend its functionality as you wish.
+type sysGroupDao struct {
+	internal.SysGroupDao
+}
+
+var (
+	// SysGroup is globally public accessible object for table sys_group operations.
+	SysGroup = sysGroupDao{
+		internal.SysGroup,
+	}
+)
+
+type SysGroupDao struct {
+	internal.SysGroupDao
+}
+
+func NewSysGroupDao(tenant string) *SysGroupDao {
+	dao := internal.NewSysGroupDao(tenant)
+	return &SysGroupDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
app/dao/sys_group_role.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"dashoo.cn/micro/app/dao/internal"
+)
+
+// sysGroupRoleDao is the manager for logic model data accessing
+// and custom defined data operations functions management. You can define
+// methods on it to extend its functionality as you wish.
+type sysGroupRoleDao struct {
+	internal.SysGroupRoleDao
+}
+
+var (
+	// SysGroupRole is globally public accessible object for table sys_group_role operations.
+	SysGroupRole = sysGroupRoleDao{
+		internal.SysGroupRole,
+	}
+)
+
+type SysGroupRoleDao struct {
+	internal.SysGroupRoleDao
+}
+
+func NewSysGroupRoleDao(tenant string) *SysGroupRoleDao {
+	dao := internal.NewSysGroupRoleDao(tenant)
+	return &SysGroupRoleDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
app/dao/sys_post_role.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"dashoo.cn/micro/app/dao/internal"
+)
+
+// sysPostRoleDao is the manager for logic model data accessing
+// and custom defined data operations functions management. You can define
+// methods on it to extend its functionality as you wish.
+type sysPostRoleDao struct {
+	internal.SysPostRoleDao
+}
+
+var (
+	// SysPostRole is globally public accessible object for table sys_post_role operations.
+	SysPostRole = sysPostRoleDao{
+		internal.SysPostRole,
+	}
+)
+
+type SysPostRoleDao struct {
+	internal.SysPostRoleDao
+}
+
+func NewSysPostRoleDao(tenant string) *SysPostRoleDao {
+	dao := internal.NewSysPostRoleDao(tenant)
+	return &SysPostRoleDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 36 - 0
app/dao/sys_user_group.go

@@ -0,0 +1,36 @@
+// ============================================================================
+// This is auto-generated by gf cli tool only once. Fill this file as you wish.
+// ============================================================================
+
+package dao
+
+import (
+	"dashoo.cn/micro/app/dao/internal"
+)
+
+// sysUserGroupDao is the manager for logic model data accessing
+// and custom defined data operations functions management. You can define
+// methods on it to extend its functionality as you wish.
+type sysUserGroupDao struct {
+	internal.SysUserGroupDao
+}
+
+var (
+	// SysUserGroup is globally public accessible object for table sys_user_group operations.
+	SysUserGroup = sysUserGroupDao{
+		internal.SysUserGroup,
+	}
+)
+
+type SysUserGroupDao struct {
+	internal.SysUserGroupDao
+}
+
+func NewSysUserGroupDao(tenant string) *SysUserGroupDao {
+	dao := internal.NewSysUserGroupDao(tenant)
+	return &SysUserGroupDao{
+		dao,
+	}
+}
+
+// Fill with you ideas below.

+ 19 - 18
app/model/internal/sys_dept.go

@@ -5,25 +5,26 @@
 package internal
 
 import (
-    "github.com/gogf/gf/os/gtime"
+	"github.com/gogf/gf/os/gtime"
 )
 
 // SysDept is the golang structure for table sys_dept.
 type SysDept struct {
-    Id          int         `orm:"id,primary"   json:"id"`          // 部门id                            
-    ParentId    int         `orm:"parent_id"    json:"parentId"`    // 父部门id                          
-    Ancestors   string      `orm:"ancestors"    json:"ancestors"`   // 祖级列表                          
-    DeptName    string      `orm:"dept_name"    json:"deptName"`    // 部门名称                          
-    OrderNum    int         `orm:"order_num"    json:"orderNum"`    // 显示顺序                          
-    Leader      string      `orm:"leader"       json:"leader"`      // 负责人                            
-    Phone       string      `orm:"phone"        json:"phone"`       // 联系电话                          
-    Email       string      `orm:"email"        json:"email"`       // 邮箱                              
-    Status      string      `orm:"status"       json:"status"`      // 部门状态(10正常20停用);1停用)  
-    CreatedBy   int         `orm:"created_by"   json:"createdBy"`   // 创建者                            
-    CreatedName string      `orm:"created_name" json:"createdName"` // 创建人                            
-    CreatedTime *gtime.Time `orm:"created_time" json:"createdTime"` // 创建时间                          
-    UpdatedBy   int         `orm:"updated_by"   json:"updatedBy"`   // 更新者                            
-    UpdatedName string      `orm:"updated_name" json:"updatedName"` // 更新人                            
-    UpdatedTime *gtime.Time `orm:"updated_time" json:"updatedTime"` // 更新时间                          
-    DeletedTime *gtime.Time `orm:"deleted_time" json:"deletedTime"` // 删除时间                          
-}
+	Id          int         `orm:"id,primary"   json:"id"`          // 部门id
+	ParentId    int         `orm:"parent_id"    json:"parentId"`    // 父部门id
+	Ancestors   string      `orm:"ancestors"    json:"ancestors"`   // 祖级列表
+	DeptName    string      `orm:"dept_name"    json:"deptName"`    // 部门名称
+	Leader      string      `orm:"leader"       json:"leader"`      // 负责人
+	Phone       string      `orm:"phone"        json:"phone"`       // 联系电话
+	Email       string      `orm:"email"        json:"email"`       // 邮箱
+	Status      string      `orm:"status"       json:"status"`      // 部门状态(10正常20停用);1停用)
+	Sort        int         `orm:"sort"         json:"sort"`        // 显示顺序
+	Remark      string      `orm:"remark"       json:"remark"`      // 备注
+	CreatedBy   int         `orm:"created_by"   json:"createdBy"`   // 创建者
+	CreatedName string      `orm:"created_name" json:"createdName"` // 创建人
+	CreatedTime *gtime.Time `orm:"created_time" json:"createdTime"` // 创建时间
+	UpdatedBy   int         `orm:"updated_by"   json:"updatedBy"`   // 更新者
+	UpdatedName string      `orm:"updated_name" json:"updatedName"` // 更新人
+	UpdatedTime *gtime.Time `orm:"updated_time" json:"updatedTime"` // 更新时间
+	DeletedTime *gtime.Time `orm:"deleted_time" json:"deletedTime"` // 删除时间
+}

+ 20 - 19
app/model/internal/sys_dict_data.go

@@ -5,26 +5,27 @@
 package internal
 
 import (
-    "github.com/gogf/gf/os/gtime"
+	"github.com/gogf/gf/os/gtime"
 )
 
 // SysDictData is the golang structure for table sys_dict_data.
 type SysDictData struct {
-    DictCode    int         `orm:"dict_code,primary" json:"dictCode"`    // 字典编码                  
-    DictSort    int         `orm:"dict_sort"         json:"dictSort"`    // 字典排序                  
-    DictLabel   string      `orm:"dict_label"        json:"dictLabel"`   // 字典标签                  
-    DictValue   string      `orm:"dict_value"        json:"dictValue"`   // 字典键值                  
-    DictType    string      `orm:"dict_type"         json:"dictType"`    // 字典类型                  
-    CssClass    string      `orm:"css_class"         json:"cssClass"`    // 样式属性(其他样式扩展)  
-    ListClass   string      `orm:"list_class"        json:"listClass"`   // 表格回显样式              
-    IsDefault   string      `orm:"is_default"        json:"isDefault"`   // 是否默认(10是20否)      
-    Status      string      `orm:"status"            json:"status"`      // 状态(10正常20停用)      
-    Remark      string      `orm:"remark"            json:"remark"`      // 备注                      
-    CreatedBy   int         `orm:"created_by"        json:"createdBy"`   // 创建者                    
-    CreatedName string      `orm:"created_name"      json:"createdName"` // 创建人                    
-    CreatedTime *gtime.Time `orm:"created_time"      json:"createdTime"` // 创建时间                  
-    UpdatedBy   int         `orm:"updated_by"        json:"updatedBy"`   // 更新者                    
-    UpdatedName string      `orm:"updated_name"      json:"updatedName"` // 更新人                    
-    UpdatedTime *gtime.Time `orm:"updated_time"      json:"updatedTime"` // 更新时间                  
-    DeletedTime *gtime.Time `orm:"deleted_time"      json:"deletedTime"` // 删除时间                  
-}
+	DictCode    int         `orm:"dict_code,primary" json:"dictCode"`    // 字典编码
+	DictSort    int         `orm:"dict_sort"         json:"dictSort"`    // 字典排序
+	DictLabel   string      `orm:"dict_label"        json:"dictLabel"`   // 字典标签
+	DictValue   string      `orm:"dict_value"        json:"dictValue"`   // 字典键值
+	DictType    string      `orm:"dict_type"         json:"dictType"`    // 字典类型
+	CssClass    string      `orm:"css_class"         json:"cssClass"`    // 样式属性(其他样式扩展)
+	ListClass   string      `orm:"list_class"        json:"listClass"`   // 表格回显样式
+	IsDefault   string      `orm:"is_default"        json:"isDefault"`   // 是否默认(10是20否)
+	Status      string      `orm:"status"            json:"status"`      // 状态(10正常20停用)
+	Sort        int         `orm:"sort"              json:"sort"`        // 显示顺序
+	Remark      string      `orm:"remark"            json:"remark"`      // 备注
+	CreatedBy   int         `orm:"created_by"        json:"createdBy"`   // 创建者
+	CreatedName string      `orm:"created_name"      json:"createdName"` // 创建人
+	CreatedTime *gtime.Time `orm:"created_time"      json:"createdTime"` // 创建时间
+	UpdatedBy   int         `orm:"updated_by"        json:"updatedBy"`   // 更新者
+	UpdatedName string      `orm:"updated_name"      json:"updatedName"` // 更新人
+	UpdatedTime *gtime.Time `orm:"updated_time"      json:"updatedTime"` // 更新时间
+	DeletedTime *gtime.Time `orm:"deleted_time"      json:"deletedTime"` // 删除时间
+}

+ 26 - 0
app/model/internal/sys_group.go

@@ -0,0 +1,26 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+import (
+	"github.com/gogf/gf/os/gtime"
+)
+
+// SysGroup is the golang structure for table sys_group.
+type SysGroup struct {
+	Id          int         `orm:"id,primary"   json:"id"`          // 主键
+	GroupCode   string      `orm:"group_code"   json:"groupCode"`   // 用户组编码
+	GroupName   string      `orm:"group_name"   json:"groupName"`   // 用户组名称
+	Status      string      `orm:"status"       json:"status"`      // 状态(10正常20停用)
+	Sort        int         `orm:"sort"         json:"sort"`        // 显示顺序
+	Remark      int         `orm:"remark"       json:"remark"`      // 备注
+	CreatedBy   int         `orm:"created_by"   json:"createdBy"`   // 创建人ID
+	CreatedName string      `orm:"created_name" json:"createdName"` // 创建人
+	CreatedTime *gtime.Time `orm:"created_time" json:"createdTime"` // 创建时间
+	UpdatedBy   int         `orm:"updated_by"   json:"updatedBy"`   // 更新人ID
+	UpdatedName string      `orm:"updated_name" json:"updatedName"` // 更新人
+	UpdatedTime *gtime.Time `orm:"updated_time" json:"updatedTime"` // 更新时间
+	DeletedTime *gtime.Time `orm:"deleted_time" json:"deletedTime"` // 删除时间
+}

+ 11 - 0
app/model/internal/sys_group_role.go

@@ -0,0 +1,11 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+// SysGroupRole is the golang structure for table sys_group_role.
+type SysGroupRole struct {
+	GroupId int `orm:"group_id,primary" json:"groupId"` // 用户组ID
+	RoleId  int `orm:"role_id,primary"  json:"roleId"`  // 角色ID
+}

+ 25 - 25
app/model/internal/sys_menu.go

@@ -5,32 +5,32 @@
 package internal
 
 import (
-    "github.com/gogf/gf/os/gtime"
+	"github.com/gogf/gf/os/gtime"
 )
 
 // SysMenu is the golang structure for table sys_menu.
 type SysMenu struct {
-    Id          int         `orm:"id,primary"   json:"id"`          // 菜单ID                        
-    MenuName    string      `orm:"menu_name"    json:"menuName"`    // 菜单名称                      
-    ParentId    int         `orm:"parent_id"    json:"parentId"`    // 父菜单ID                      
-    OrderNum    int         `orm:"order_num"    json:"orderNum"`    // 显示顺序                      
-    Path        string      `orm:"path"         json:"path"`        // 路由地址                      
-    Component   string      `orm:"component"    json:"component"`   // 组件路径                      
-    Query       string      `orm:"query"        json:"query"`       // 路由参数                      
-    IsFrame     int         `orm:"is_frame"     json:"isFrame"`     // 是否为外链(10是20否)        
-    IsCache     int         `orm:"is_cache"     json:"isCache"`     // 是否缓存(10缓存20不缓存)    
-    MenuType    string      `orm:"menu_type"    json:"menuType"`    // 菜单类型(M目录C菜单 F按钮)  
-    Visible     string      `orm:"visible"      json:"visible"`     // 菜单状态(10显示20隐藏)      
-    Status      string      `orm:"status"       json:"status"`      // 菜单状态(10正常20停用)      
-    Perms       string      `orm:"perms"        json:"perms"`       // 权限标识                      
-    Icon        string      `orm:"icon"         json:"icon"`        // 菜单图标                      
-    PlatformId  int         `orm:"platform_id"  json:"platformId"`  // 所属平台                      
-    Remark      string      `orm:"remark"       json:"remark"`      // 备注                          
-    CreatedBy   int         `orm:"created_by"   json:"createdBy"`   // 创建者                        
-    CreatedName string      `orm:"created_name" json:"createdName"` // 创建人                        
-    CreatedTime *gtime.Time `orm:"created_time" json:"createdTime"` // 创建时间                      
-    UpdatedBy   int         `orm:"updated_by"   json:"updatedBy"`   // 更新者                        
-    UpdatedName string      `orm:"updated_name" json:"updatedName"` // 更新人                        
-    UpdatedTime *gtime.Time `orm:"updated_time" json:"updatedTime"` // 更新时间                      
-    DeletedTime *gtime.Time `orm:"deleted_time" json:"deletedTime"` // 删除时间                      
-}
+	Id          int         `orm:"id,primary"   json:"id"`          // 菜单ID
+	MenuName    string      `orm:"menu_name"    json:"menuName"`    // 菜单名称
+	ParentId    int         `orm:"parent_id"    json:"parentId"`    // 父菜单ID
+	Path        string      `orm:"path"         json:"path"`        // 路由地址
+	Component   string      `orm:"component"    json:"component"`   // 组件路径
+	Query       string      `orm:"query"        json:"query"`       // 路由参数
+	IsFrame     int         `orm:"is_frame"     json:"isFrame"`     // 是否为外链(10是20否)
+	IsCache     int         `orm:"is_cache"     json:"isCache"`     // 是否缓存(10缓存20不缓存)
+	MenuType    string      `orm:"menu_type"    json:"menuType"`    // 菜单类型(M目录C菜单 F按钮)
+	Visible     string      `orm:"visible"      json:"visible"`     // 菜单状态(10显示20隐藏)
+	Status      string      `orm:"status"       json:"status"`      // 菜单状态(10正常20停用)
+	Perms       string      `orm:"perms"        json:"perms"`       // 权限标识
+	Icon        string      `orm:"icon"         json:"icon"`        // 菜单图标
+	PlatformId  int         `orm:"platform_id"  json:"platformId"`  // 所属平台
+	Sort        int         `orm:"sort"         json:"sort"`        // 显示顺序
+	Remark      string      `orm:"remark"       json:"remark"`      // 备注
+	CreatedBy   int         `orm:"created_by"   json:"createdBy"`   // 创建者
+	CreatedName string      `orm:"created_name" json:"createdName"` // 创建人
+	CreatedTime *gtime.Time `orm:"created_time" json:"createdTime"` // 创建时间
+	UpdatedBy   int         `orm:"updated_by"   json:"updatedBy"`   // 更新者
+	UpdatedName string      `orm:"updated_name" json:"updatedName"` // 更新人
+	UpdatedTime *gtime.Time `orm:"updated_time" json:"updatedTime"` // 更新时间
+	DeletedTime *gtime.Time `orm:"deleted_time" json:"deletedTime"` // 删除时间
+}

+ 17 - 16
app/model/internal/sys_platform.go

@@ -5,23 +5,24 @@
 package internal
 
 import (
-    "github.com/gogf/gf/os/gtime"
+	"github.com/gogf/gf/os/gtime"
 )
 
 // SysPlatform is the golang structure for table sys_platform.
 type SysPlatform struct {
-    Id             int         `orm:"id,primary"      json:"id"`             // 主键                  
-    PlatformCode   string      `orm:"platform_code"   json:"platformCode"`   // 平台编码              
-    PlatformName   string      `orm:"platform_name"   json:"platformName"`   // 平台名称              
-    PlatformEnable string      `orm:"platform_enable" json:"platformEnable"` // 是否开通(10是20否)  
-    PlatformPath   string      `orm:"platform_path"   json:"platformPath"`   // 路径                  
-    PlatformIcon   string      `orm:"platform_icon"   json:"platformIcon"`   // 图标                  
-    Remark         string      `orm:"remark"          json:"remark"`         // 备注                  
-    CreatedBy      int         `orm:"created_by"      json:"createdBy"`      // 创建人ID              
-    CreatedName    string      `orm:"created_name"    json:"createdName"`    // 创建人                
-    CreatedTime    *gtime.Time `orm:"created_time"    json:"createdTime"`    // 创建时间              
-    UpdatedBy      int         `orm:"updated_by"      json:"updatedBy"`      // 更新人ID              
-    UpdatedName    string      `orm:"updated_name"    json:"updatedName"`    // 更新人                
-    UpdatedTime    *gtime.Time `orm:"updated_time"    json:"updatedTime"`    // 更新时间              
-    DeletedTime    *gtime.Time `orm:"deleted_time"    json:"deletedTime"`    // 删除时间              
-}
+	Id             int         `orm:"id,primary"      json:"id"`             // 主键
+	PlatformCode   string      `orm:"platform_code"   json:"platformCode"`   // 平台编码
+	PlatformName   string      `orm:"platform_name"   json:"platformName"`   // 平台名称
+	PlatformEnable string      `orm:"platform_enable" json:"platformEnable"` // 是否开通(10是20否)
+	PlatformPath   string      `orm:"platform_path"   json:"platformPath"`   // 路径
+	PlatformIcon   string      `orm:"platform_icon"   json:"platformIcon"`   // 图标
+	Status         string      `orm:"status"          json:"status"`         // 帐号状态(10正常20停用)
+	Remark         string      `orm:"remark"          json:"remark"`         // 备注
+	CreatedBy      int         `orm:"created_by"      json:"createdBy"`      // 创建人ID
+	CreatedName    string      `orm:"created_name"    json:"createdName"`    // 创建人
+	CreatedTime    *gtime.Time `orm:"created_time"    json:"createdTime"`    // 创建时间
+	UpdatedBy      int         `orm:"updated_by"      json:"updatedBy"`      // 更新人ID
+	UpdatedName    string      `orm:"updated_name"    json:"updatedName"`    // 更新人
+	UpdatedTime    *gtime.Time `orm:"updated_time"    json:"updatedTime"`    // 更新时间
+	DeletedTime    *gtime.Time `orm:"deleted_time"    json:"deletedTime"`    // 删除时间
+}

+ 15 - 15
app/model/internal/sys_post.go

@@ -5,22 +5,22 @@
 package internal
 
 import (
-    "github.com/gogf/gf/os/gtime"
+	"github.com/gogf/gf/os/gtime"
 )
 
 // SysPost is the golang structure for table sys_post.
 type SysPost struct {
-    Id          int         `orm:"id,primary"   json:"id"`          // 岗位ID                
-    PostCode    string      `orm:"post_code"    json:"postCode"`    // 岗位编码              
-    PostName    string      `orm:"post_name"    json:"postName"`    // 岗位名称              
-    PostSort    int         `orm:"post_sort"    json:"postSort"`    // 显示顺序              
-    Status      string      `orm:"status"       json:"status"`      // 状态(10正常20停用)  
-    Remark      string      `orm:"remark"       json:"remark"`      // 备注                  
-    CreatedBy   int         `orm:"created_by"   json:"createdBy"`   // 创建者                
-    CreatedName string      `orm:"created_name" json:"createdName"` // 创建人                
-    CreatedTime *gtime.Time `orm:"created_time" json:"createdTime"` // 创建时间              
-    UpdatedBy   int         `orm:"updated_by"   json:"updatedBy"`   // 更新者                
-    UpdatedName string      `orm:"updated_name" json:"updatedName"` // 更新人                
-    UpdatedTime *gtime.Time `orm:"updated_time" json:"updatedTime"` // 更新时间              
-    DeletedTime *gtime.Time `orm:"deleted_time" json:"deletedTime"` // 删除时间              
-}
+	Id          int         `orm:"id,primary"   json:"id"`          // 岗位ID
+	PostCode    string      `orm:"post_code"    json:"postCode"`    // 岗位编码
+	PostName    string      `orm:"post_name"    json:"postName"`    // 岗位名称
+	Status      string      `orm:"status"       json:"status"`      // 状态(10正常20停用)
+	Sort        int         `orm:"sort"         json:"sort"`        // 显示顺序
+	Remark      string      `orm:"remark"       json:"remark"`      // 备注
+	CreatedBy   int         `orm:"created_by"   json:"createdBy"`   // 创建者
+	CreatedName string      `orm:"created_name" json:"createdName"` // 创建人
+	CreatedTime *gtime.Time `orm:"created_time" json:"createdTime"` // 创建时间
+	UpdatedBy   int         `orm:"updated_by"   json:"updatedBy"`   // 更新者
+	UpdatedName string      `orm:"updated_name" json:"updatedName"` // 更新人
+	UpdatedTime *gtime.Time `orm:"updated_time" json:"updatedTime"` // 更新时间
+	DeletedTime *gtime.Time `orm:"deleted_time" json:"deletedTime"` // 删除时间
+}

+ 11 - 0
app/model/internal/sys_post_role.go

@@ -0,0 +1,11 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+// SysPostRole is the golang structure for table sys_post_role.
+type SysPostRole struct {
+	PostId int `orm:"post_id,primary" json:"postId"` // 岗位ID
+	RoleId int `orm:"role_id,primary" json:"roleId"` // 角色ID
+}

+ 18 - 17
app/model/internal/sys_role.go

@@ -5,24 +5,25 @@
 package internal
 
 import (
-    "github.com/gogf/gf/os/gtime"
+	"github.com/gogf/gf/os/gtime"
 )
 
 // SysRole is the golang structure for table sys_role.
 type SysRole struct {
-    Id                int         `orm:"id,primary"          json:"id"`                // 角色ID                                                                                     
-    RoleName          string      `orm:"role_name"           json:"roleName"`          // 角色名称                                                                                   
-    RoleKey           string      `orm:"role_key"            json:"roleKey"`           // 角色权限字符串                                                                             
-    RoleSort          int         `orm:"role_sort"           json:"roleSort"`          // 显示顺序                                                                                   
-    DataScope         string      `orm:"data_scope"          json:"dataScope"`         // 数据范围(10:全部数据权限 20:自定数据权限 30:本部门数据权限 40:本部门及以下数据权限)  
-    MenuCheckStrictly string      `orm:"menu_check_strictly" json:"menuCheckStrictly"` // 菜单树选择项是否关联显示                                                                   
-    DeptCheckStrictly string      `orm:"dept_check_strictly" json:"deptCheckStrictly"` // 部门树选择项是否关联显示                                                                   
-    Status            string      `orm:"status"              json:"status"`            // 角色状态(10正常20停用)                                                                   
-    CreatedBy         int         `orm:"created_by"          json:"createdBy"`         // 创建者                                                                                     
-    CreatedName       string      `orm:"created_name"        json:"createdName"`       // 创建人                                                                                     
-    CreatedTime       *gtime.Time `orm:"created_time"        json:"createdTime"`       // 创建时间                                                                                   
-    UpdatedBy         int         `orm:"updated_by"          json:"updatedBy"`         // 更新者                                                                                     
-    UpdatedName       string      `orm:"updated_name"        json:"updatedName"`       // 更新人                                                                                     
-    UpdatedTime       *gtime.Time `orm:"updated_time"        json:"updatedTime"`       // 更新时间                                                                                   
-    DeletedTime       *gtime.Time `orm:"deleted_time"        json:"deletedTime"`       // 删除时间                                                                                   
-}
+	Id                int         `orm:"id,primary"          json:"id"`                // 角色ID
+	RoleName          string      `orm:"role_name"           json:"roleName"`          // 角色名称
+	RoleKey           string      `orm:"role_key"            json:"roleKey"`           // 角色权限字符串
+	DataScope         string      `orm:"data_scope"          json:"dataScope"`         // 数据范围;(10:全部数据权限 20:自定数据权限 30:本部门数据权限 40:本部门及以下数据权限)
+	MenuCheckStrictly string      `orm:"menu_check_strictly" json:"menuCheckStrictly"` // 菜单树选择项是否关联显示
+	DeptCheckStrictly string      `orm:"dept_check_strictly" json:"deptCheckStrictly"` // 部门树选择项是否关联显示
+	Status            string      `orm:"status"              json:"status"`            // 角色状态(10正常20停用)
+	Sort              int         `orm:"sort"                json:"sort"`              // 显示顺序
+	Remark            string      `orm:"remark"              json:"remark"`            // 备注
+	CreatedBy         int         `orm:"created_by"          json:"createdBy"`         // 创建者
+	CreatedName       string      `orm:"created_name"        json:"createdName"`       // 创建人
+	CreatedTime       *gtime.Time `orm:"created_time"        json:"createdTime"`       // 创建时间
+	UpdatedBy         int         `orm:"updated_by"          json:"updatedBy"`         // 更新者
+	UpdatedName       string      `orm:"updated_name"        json:"updatedName"`       // 更新人
+	UpdatedTime       *gtime.Time `orm:"updated_time"        json:"updatedTime"`       // 更新时间
+	DeletedTime       *gtime.Time `orm:"deleted_time"        json:"deletedTime"`       // 删除时间
+}

+ 3 - 5
app/model/internal/sys_role_dept.go

@@ -4,10 +4,8 @@
 
 package internal
 
-
-
 // SysRoleDept is the golang structure for table sys_role_dept.
 type SysRoleDept struct {
-    RoleId int `orm:"role_id,primary" json:"roleId"` // 角色ID  
-    DeptId int `orm:"dept_id,primary" json:"deptId"` // 部门ID  
-}
+	DeptId int `orm:"dept_id,primary" json:"deptId"` // 部门ID
+	RoleId int `orm:"role_id,primary" json:"roleId"` // 角色ID
+}

+ 23 - 23
app/model/internal/sys_user.go

@@ -5,30 +5,30 @@
 package internal
 
 import (
-    "github.com/gogf/gf/os/gtime"
+	"github.com/gogf/gf/os/gtime"
 )
 
 // SysUser is the golang structure for table sys_user.
 type SysUser struct {
-    Id          int         `orm:"id,primary"   json:"id"`          // 用户ID                      
-    DeptId      int         `orm:"dept_id"      json:"deptId"`      // 部门ID                      
-    UserName    string      `orm:"user_name"    json:"userName"`    // 用户账号                    
-    NickName    string      `orm:"nick_name"    json:"nickName"`    // 用户昵称                    
-    UserType    string      `orm:"user_type"    json:"userType"`    // 用户类型(00系统用户)      
-    Email       string      `orm:"email"        json:"email"`       // 用户邮箱                    
-    Phone       string      `orm:"phone"        json:"phone"`       // 手机号码                    
-    Sex         string      `orm:"sex"          json:"sex"`         // 用户性别(10男20女30未知)  
-    Avatar      string      `orm:"avatar"       json:"avatar"`      // 头像地址                    
-    Password    string      `orm:"password"     json:"password"`    // 密码                        
-    Status      string      `orm:"status"       json:"status"`      // 帐号状态(0正常1停用)      
-    LoginIp     string      `orm:"login_ip"     json:"loginIp"`     // 最后登录IP                  
-    LoginDate   *gtime.Time `orm:"login_date"   json:"loginDate"`   // 最后登录时间                
-    Remark      string      `orm:"remark"       json:"remark"`      // 备注                        
-    CreatedBy   int         `orm:"created_by"   json:"createdBy"`   // 创建者                      
-    CreatedName string      `orm:"created_name" json:"createdName"` // 创建人                      
-    CreatedTime *gtime.Time `orm:"created_time" json:"createdTime"` // 创建时间                    
-    UpdatedBy   int         `orm:"updated_by"   json:"updatedBy"`   // 更新者                      
-    UpdatedName string      `orm:"updated_name" json:"updatedName"` // 更新人                      
-    UpdatedTime *gtime.Time `orm:"updated_time" json:"updatedTime"` // 更新时间                    
-    DeletedTime *gtime.Time `orm:"deleted_time" json:"deletedTime"` // 删除时间                    
-}
+	Id          int         `orm:"id,primary"   json:"id"`          // 用户ID
+	DeptId      int         `orm:"dept_id"      json:"deptId"`      // 部门ID
+	UserName    string      `orm:"user_name"    json:"userName"`    // 用户账号
+	NickName    string      `orm:"nick_name"    json:"nickName"`    // 用户昵称
+	UserType    string      `orm:"user_type"    json:"userType"`    // 用户类型(00系统用户)
+	Email       string      `orm:"email"        json:"email"`       // 用户邮箱
+	Phone       string      `orm:"phone"        json:"phone"`       // 手机号码
+	Sex         string      `orm:"sex"          json:"sex"`         // 用户性别(10男20女30未知)
+	Avatar      string      `orm:"avatar"       json:"avatar"`      // 头像地址
+	Password    string      `orm:"password"     json:"password"`    // 密码
+	LoginIp     string      `orm:"login_ip"     json:"loginIp"`     // 最后登录IP
+	LoginDate   *gtime.Time `orm:"login_date"   json:"loginDate"`   // 最后登录时间
+	Remark      string      `orm:"remark"       json:"remark"`      // 备注
+	CreatedBy   int         `orm:"created_by"   json:"createdBy"`   // 创建者
+	CreatedName string      `orm:"created_name" json:"createdName"` // 创建人
+	CreatedTime *gtime.Time `orm:"created_time" json:"createdTime"` // 创建时间
+	UpdatedBy   int         `orm:"updated_by"   json:"updatedBy"`   // 更新者
+	UpdatedName string      `orm:"updated_name" json:"updatedName"` // 更新人
+	UpdatedTime *gtime.Time `orm:"updated_time" json:"updatedTime"` // 更新时间
+	DeletedTime *gtime.Time `orm:"deleted_time" json:"deletedTime"` // 删除时间
+	Status      string      `orm:"status"       json:"status"`      // 帐号状态(10正常20停用)
+}

+ 11 - 0
app/model/internal/sys_user_group.go

@@ -0,0 +1,11 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
+// ==========================================================================
+
+package internal
+
+// SysUserGroup is the golang structure for table sys_user_group.
+type SysUserGroup struct {
+	UserId  int `orm:"user_id,primary"  json:"userId"`  // 用户ID
+	GroupId int `orm:"group_id,primary" json:"groupId"` // 用户组ID
+}

+ 14 - 0
app/model/sys_group.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/internal"
+)
+
+// SysGroup is the golang structure for table sys_group.
+type SysGroup internal.SysGroup
+
+// Fill with you ideas below.

+ 14 - 0
app/model/sys_group_role.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/internal"
+)
+
+// SysGroupRole is the golang structure for table sys_group_role.
+type SysGroupRole internal.SysGroupRole
+
+// Fill with you ideas below.

+ 14 - 0
app/model/sys_post_role.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/internal"
+)
+
+// SysPostRole is the golang structure for table sys_post_role.
+type SysPostRole internal.SysPostRole
+
+// Fill with you ideas below.

+ 14 - 0
app/model/sys_user_group.go

@@ -0,0 +1,14 @@
+// ==========================================================================
+// This is auto-generated by gf cli tool. Fill this file as you wish.
+// ==========================================================================
+
+package model
+
+import (
+	"dashoo.cn/micro/app/model/internal"
+)
+
+// SysUserGroup is the golang structure for table sys_user_group.
+type SysUserGroup internal.SysUserGroup
+
+// Fill with you ideas below.