12345678910111213141516171819202122232425 |
- package model
- import (
- "github.com/satori/go.uuid"
- "gorm.io/gorm"
- "time"
- )
- type SysUser struct {
- gorm.Model
- UUID uuid.UUID `json:"uuid" gorm:"comment:'用户UUID'"`
- Username string `json:"userName" gorm:"comment:'用户登录名'"`
- Password string `json:"-" gorm:"comment:'用户登录密码'"`
- NickName string `json:"nickName" gorm:"default:'系统用户';comment:'用户昵称'" `
- HeaderImg string `json:"headerImg" gorm:"default:'http://qmplusimg.henrongyi.top/head.png';comment:'用户头像'"`
- 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"},
- }
- }
|