support user role attachment

This commit is contained in:
yanghao05
2023-02-05 13:30:43 +08:00
parent 285e1f1c51
commit ee631b9714
17 changed files with 518 additions and 50 deletions

View File

@@ -31,11 +31,11 @@ func newSysDictionaryDetail(db *gorm.DB, opts ...gen.DOOption) sysDictionaryDeta
_sysDictionaryDetail.CreatedAt = field.NewTime(tableName, "created_at")
_sysDictionaryDetail.UpdatedAt = field.NewTime(tableName, "updated_at")
_sysDictionaryDetail.DeletedAt = field.NewField(tableName, "deleted_at")
_sysDictionaryDetail.Label = field.NewString(tableName, "label")
_sysDictionaryDetail.Value = field.NewInt64(tableName, "value")
_sysDictionaryDetail.Status = field.NewBool(tableName, "status")
_sysDictionaryDetail.Sort = field.NewInt64(tableName, "sort")
_sysDictionaryDetail.SysDictionaryID = field.NewInt64(tableName, "sys_dictionary_id")
_sysDictionaryDetail.Label = field.NewString(tableName, "label")
_sysDictionaryDetail.Value = field.NewString(tableName, "value")
_sysDictionaryDetail.Status = field.NewBool(tableName, "status")
_sysDictionaryDetail.Weight = field.NewInt64(tableName, "weight")
_sysDictionaryDetail.fillFieldMap()
@@ -50,11 +50,11 @@ type sysDictionaryDetail struct {
CreatedAt field.Time
UpdatedAt field.Time
DeletedAt field.Field
Label field.String // 展示值
Value field.Int64 // 字典值
Status field.Bool // 启用状态
Sort field.Int64 // 排序标记
SysDictionaryID field.Int64 // 关联标记
Label field.String // 展示值
Value field.String // 字典值
Status field.Bool // 启用状态
Weight field.Int64 // 排序权重
fieldMap map[string]field.Expr
}
@@ -75,11 +75,11 @@ func (s *sysDictionaryDetail) updateTableName(table string) *sysDictionaryDetail
s.CreatedAt = field.NewTime(table, "created_at")
s.UpdatedAt = field.NewTime(table, "updated_at")
s.DeletedAt = field.NewField(table, "deleted_at")
s.Label = field.NewString(table, "label")
s.Value = field.NewInt64(table, "value")
s.Status = field.NewBool(table, "status")
s.Sort = field.NewInt64(table, "sort")
s.SysDictionaryID = field.NewInt64(table, "sys_dictionary_id")
s.Label = field.NewString(table, "label")
s.Value = field.NewString(table, "value")
s.Status = field.NewBool(table, "status")
s.Weight = field.NewInt64(table, "weight")
s.fillFieldMap()
@@ -109,11 +109,11 @@ func (s *sysDictionaryDetail) fillFieldMap() {
s.fieldMap["created_at"] = s.CreatedAt
s.fieldMap["updated_at"] = s.UpdatedAt
s.fieldMap["deleted_at"] = s.DeletedAt
s.fieldMap["sys_dictionary_id"] = s.SysDictionaryID
s.fieldMap["label"] = s.Label
s.fieldMap["value"] = s.Value
s.fieldMap["status"] = s.Status
s.fieldMap["sort"] = s.Sort
s.fieldMap["sys_dictionary_id"] = s.SysDictionaryID
s.fieldMap["weight"] = s.Weight
}
func (s sysDictionaryDetail) clone(db *gorm.DB) sysDictionaryDetail {