model

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Platform

type Platform struct {
	*database.BaseModel
	PlatformId       int    `gorm:"column:platform_id"`
	PlatformName     string `gorm:"column:name"`
	PlatformAbbr     string `gorm:"column:abbr"`
	PlatformType     string `gorm:"column:type"`
	PlatformDesc     string `gorm:"column:description"`
	PlatformDomain   string `gorm:"column:domain"`
	PlatformImgUrl   string `gorm:"column:img_url"`
	PlatformLoginUrl string `gorm:"column:login_url"`
}

func (Platform) Create

func (p Platform) Create(db *gorm.DB) (Platform, error)

func (Platform) Delete

func (p Platform) Delete(db *gorm.DB) (*Platform, error)

func (Platform) Get

func (p Platform) Get(db *gorm.DB) (Platform, error)

func (Platform) GetList

func (p Platform) GetList(db *gorm.DB, pager *page.Pager) ([]Platform, error)

func (Platform) TableName

func (p Platform) TableName() string

func (Platform) Update

func (p Platform) Update(db *gorm.DB, values interface{}) error

type User

type User struct {
	UserId        int    `json:"user_id" gorm:"column:user_id"`
	UserName      string `json:"user_name" gorm:"column:user_name"`
	Password      string `json:"password" gorm:"column:password"`
	Salt          string `json:"salt" gorm:"column:salt"`
	PhoneNumber   string `json:"phone_number" gorm:"column:phone_number"`
	Email         string `json:"email" gorm:"column:email; default:null"`
	ShareMode     int    `json:"share_mode" gorm:"column:share_mode; default:0"`
	Role          int    `json:"role" gorm:"column:role"`
	ProfileImgUrl string `json:"profile_img_url" gorm:"column:profile_img_url; default:''"`
	Description   string `json:"description" gorm:"column:description; default:''"`
	Sex           int    `json:"sex" gorm:"column:sex; default:0"`
	*database.BaseModel
}

func (User) Create

func (u User) Create(db *gorm.DB) error

func (User) Delete

func (u User) Delete(db *gorm.DB) error

func (User) Get

func (u User) Get(db *gorm.DB) (User, error)

func (User) GetUserByEmail

func (u User) GetUserByEmail(db *gorm.DB) (User, error)

func (User) GetUserByName

func (u User) GetUserByName(db *gorm.DB) (User, error)

func (User) GetUserByPhone

func (u User) GetUserByPhone(db *gorm.DB) (User, error)

func (User) GetUserList

func (u User) GetUserList(db *gorm.DB, pager *page.Pager) ([]UserRow, error)

func (User) TableName

func (u User) TableName() string

func (User) Update

func (u User) Update(db *gorm.DB, values interface{}) error

type UserAccount

type UserAccount struct {
	*database.BaseModel
	UserId     int    `json:"user_id"`
	PlatformId int    `json:"platform_id"`
	Password   string `json:"password"`
}

func (UserAccount) Create

func (ua UserAccount) Create(db *gorm.DB) (UserAccount, error)

func (UserAccount) Delete

func (ua UserAccount) Delete(db *gorm.DB) error

func (UserAccount) DeleteList

func (ua UserAccount) DeleteList(db *gorm.DB) error

func (UserAccount) Get

func (ua UserAccount) Get(db *gorm.DB) (UserAccountRow, error)

func (UserAccount) GetAccountsByUserID

func (ua UserAccount) GetAccountsByUserID(db *gorm.DB, pager *page.Pager) ([]UserAccountRow, error)

func (UserAccount) GetAll

func (ua UserAccount) GetAll(db *gorm.DB, pager *page.Pager) ([]UserAccountRow, error)

func (UserAccount) TableName

func (ua UserAccount) TableName() string

func (UserAccount) Update

func (ua UserAccount) Update(db *gorm.DB, values interface{}) (UserAccount, error)

type UserAccountRow

type UserAccountRow struct {
	UserId           int    `gorm:"column:user_id"`
	PlatformId       int    `gorm:"column:platform_id"`
	PlatformName     string `gorm:"column:name"`
	PlatformAbbr     string `gorm:"column:abbr"`
	Password         string `gorm:"column:password"`
	PlatformType     string `gorm:"column:type"`
	PlatformDesc     string `gorm:"column:description"`
	PlatformDomain   string `gorm:"column:domain"`
	PlatformImgUrl   string `gorm:"column:img_url"`
	PlatformLoginUrl string `gorm:"column:login_url"`
}

type UserRow

type UserRow struct {
	UserId      int    `json:"user_id" gorm:"column:user_id"`
	UserName    string `json:"user_name" gorm:"column:user_name"`
	PhoneNumber string `json:"phone_number" gorm:"column:phone_number"`
	Email       string `json:"email" gorm:"column:email"`
	ShareMode   int    `json:"share_mode" gorm:"column:share_mode"`
	Sex         int    `json:"sex" gorm:"column:sex"`
	Description string `json:"description" gorm:"column:description"`
	Role        int    `json:"role" gorm:"column:role"`
}

Jump to

Keyboard shortcuts

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