entity

package
v0.0.0-...-bdedfc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthAccessToken

type AuthAccessToken struct {
	Model
	AuthSessionId uint `json:"auth_session_id" binding:"required"`
	AuthSession   AuthSession
	Scopes        string `json:"scopes" binding:"required" gorm:"type:text"`
	IsRevoked     bool   `json:"is_revoked" binding:"required"`
}

type AuthFailed

type AuthFailed struct {
	Model
	UserId    uint   `json:"user_id" binding:"required"`
	User      User   `json:"user"`
	Device    string `json:"device" binding:"required"`
	UserAgent string `json:"user_agent" binding:"required"`
	IpAddress string `json:"ip_address" binding:"required"`
}

type AuthSession

type AuthSession struct {
	Model
	UserId       uint   `json:"user_id" binding:"required"`
	User         User   `json:"user"`
	Location     string `json:"location" binding:"required"`
	Latitude     string `json:"latitude" binding:"required"`
	Longitude    string `json:"longitude" binding:"required"`
	Device       string `json:"device" binding:"required"`
	UserAgent    string `json:"user_agent" binding:"required"`
	IpAddress    string `json:"ip_address" binding:"required"`
	DeviceId     string `json:"device_id" gorm:"type:varchar;NULL"`
	DeviceIdUuid string `json:"device_id_uuid" gorm:"type:varchar;NULL"`
	IsActive     bool   `json:"is_active" gorm:"default:false"`
}

type Model

type Model struct {
	ID        uint       `gorm:"primary_key" json:"id"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `sql:"index" json:"-"`
}

type Track

type Track struct {
	Model
	Name   string `json:"name" binding:"required"`
	Config string `json:"config" binding:"required" gorm:"type:text;NOT NULL"`

	Users []*User `gorm:"many2many:track_user;"`
}

type User

type User struct {
	Model
	Username        string     `gorm:"type:varchar" json:"username" binding:"required"`
	Name            string     `gorm:"type:varchar" json:"name" binding:"required"`
	Avatar          string     `gorm:"type:varchar" json:"avatar" binding:"required"`
	Bio             string     `gorm:"type:varchar;NULL" json:"bio"`
	Password        string     `gorm:"type:varchar" json:"-" binding:"required"`
	PhoneNumber     string     `gorm:"type:varchar;NULL" json:"phone_number"`
	Email           string     `gorm:"type:varchar;unique_index" json:"email" binding:"required"`
	EmailVerifiedAt *time.Time `gorm:"NULL" json:"email_verified_at"`

	Tracks []*Track `gorm:"many2many:track_user;"`
}

type UserCoin

type UserCoin struct {
	Model
	UserId uint   `json:"user_id" binding:"required"`
	User   User   `json:"user"`
	Total  int    `gorm:"NOT NULL" json:"total" binding:"required"`
	From   string `gorm:"NOT NULL" json:"from" binding:"required"`
}

type UserFriend

type UserFriend struct {
	Model
	UserId   uint `json:"user_id" binding:"required"`
	User     User `json:"user"`
	FriendId uint `json:"friend_id" binding:"required"`
	Friend   User `json:"friend" gorm:"foreignKey:FriendId"`
}

type UserNotification

type UserNotification struct {
	Model
	UserId  uint   `json:"user_id" binding:"required"`
	User    User   `json:"user"`
	Payload string `json:"payload" binding:"required"`
	IsRead  bool   `json:"is_read" binding:"required" gorm:"default:false"`
}

type UserPreference

type UserPreference struct {
	Model
	UserId   uint   `json:"user_id" binding:"required"`
	User     User   `json:"user"`
	Settings string `gorm:"type:text" json:"settings" binding:"required"`
}

type UserXp

type UserXp struct {
	Model
	UserId uint   `json:"user_id" binding:"required"`
	User   User   `json:"user"`
	Total  int    `gorm:"NOT NULL" json:"total" binding:"required"`
	From   string `gorm:"NOT NULL" json:"from" binding:"required"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL