数据初始化完成

This commit is contained in:
SliverHorn
2020-08-25 16:34:45 +08:00
parent 6c9f8b5eba
commit cf73dbd0d9
18 changed files with 566 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ package model
import (
"github.com/satori/go.uuid"
"gorm.io/gorm"
"time"
)
type SysUser struct {
@@ -15,3 +16,10 @@ type SysUser struct {
Authority SysAuthority `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:'用户角色'"`
AuthorityId string `json:"authorityId" gorm:"default:888;comment:'用户角色ID'"`
}
func SysUserData() []SysUser {
return []SysUser{
{Model: gorm.Model{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, UUID: uuid.NewV4(), Username: "admin", Password: "e10adc3949ba59abbe56e057f20f883e", NickName: "超级管理员", HeaderImg: "http://qmplusimg.henrongyi.top/1571627762timg.jpg", AuthorityId: "888"},
{Model: gorm.Model{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, UUID: uuid.NewV4(), Username: "a303176530", Password: "3ec063004a6f31642261936a379fde3d", NickName: "QMPlusUser", HeaderImg: "http://qmplusimg.henrongyi.top/1572075907logo.png", AuthorityId: "9528"},
}
}