sharded-gotify/model/user.go

40 lines
1.0 KiB
Go

package model
// The User holds information about the credentials of a user and its application and client tokens.
type User struct {
ID uint `gorm:"primary_key;unique_index;AUTO_INCREMENT"`
Name string `gorm:"unique_index"`
Pass []byte
Admin bool
Applications []Application
Clients []Client
}
// UserExternal Model
//
// The User holds information about the credentials and other stuff.
//
// swagger:model User
type UserExternal struct {
// The user id.
//
// read only: true
// required: true
// example: 25
ID uint `json:"id"`
// The user name. For login.
//
// required: true
// example: unicorn
Name string `binding:"required" json:"name" query:"name" form:"name"`
// The user password. For login. (Will not be returned by any API)
//
// required: true
// example: mypassword; !will not be returned by any API!
Pass string `json:"pass,omitempty" form:"pass" query:"pass"`
// If the user is an administrator.
//
// example: true
Admin bool `json:"admin" form:"admin" query:"admin"`
}