user.go 386 B

1234567891011121314151617181920
  1. package core
  2. import (
  3. "reflect"
  4. "time"
  5. )
  6. // User 用户
  7. type User struct {
  8. ID int `db:"id"`
  9. Account string `db:"account"`
  10. CreatedAt time.Time `db:"created_at"`
  11. Password string `db:"password"`
  12. Enabled bool `db:"is_enable" json:"is_enable"`
  13. }
  14. // IsEmpty 判断是否为空
  15. func (user User) IsEmpty() bool {
  16. return reflect.DeepEqual(user, User{})
  17. }