You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.3 KiB

  1. package model
  2. import (
  3. "github.com/satori/go.uuid"
  4. "gorm.io/gorm"
  5. "time"
  6. )
  7. type SysUser struct {
  8. gorm.Model
  9. UUID uuid.UUID `json:"uuid" gorm:"comment:'用户UUID'"`
  10. Username string `json:"userName" gorm:"comment:'用户登录名'"`
  11. Password string `json:"-" gorm:"comment:'用户登录密码'"`
  12. NickName string `json:"nickName" gorm:"default:'系统用户';comment:'用户昵称'" `
  13. HeaderImg string `json:"headerImg" gorm:"default:'http://qmplusimg.henrongyi.top/head.png';comment:'用户头像'"`
  14. Authority SysAuthority `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:'用户角色'"`
  15. AuthorityId string `json:"authorityId" gorm:"default:888;comment:'用户角色ID'"`
  16. }
  17. func SysUserData() []SysUser {
  18. return []SysUser{
  19. {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"},
  20. {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"},
  21. }
  22. }