models

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package models 模型通用属性和方法

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	ID        uint32    `gorm:"column:id;primaryKey;autoIncrement;" json:"id,omitempty"`
	CreatedAt time.Time `gorm:"column:created_at;" json:"created_at,omitempty"`
	UpdatedAt time.Time `gorm:"column:updated_at;" json:"updated_at,omitempty"`
}

BaseModel 模型基类

func (BaseModel) GetStringID

func (a BaseModel) GetStringID() string

GetStringID 获取 ID 的字符串格式

type RoleInfo

type RoleInfo struct {
	BaseModel

	AppId         int            `gorm:"uniqueIndex:uni_uid_appId_serverId"`
	Uid           uint32         `gorm:"default:null;uniqueIndex:uni_uid_appId_serverId"`
	PlatFormId    string         `gorm:""`
	ChannelId     string         `gorm:""`
	ServerId      string         `gorm:"uniqueIndex:uni_uid_appId_serverId"`
	ServerName    string         `gorm:"type:varchar(255);default:null;"`
	RoleId        string         `gorm:"type:int;"`
	Role          string         `gorm:"type:varchar(64);default:null;"`
	FirstPayDate  time.Time      `gorm:"default:null;"`
	LastPayDate   time.Time      `gorm:"default:null;"`
	LastLoginTime time.Time      `gorm:"default:null;"`
	PayTotal      int            `gorm:"default:0"`
	PayCount      int            `gorm:"default:0"`
	DistinctId    string         `gorm:""`
	AccountId     string         `gorm:""`
	GameVipLevel  string         `gorm:""`
	GameUserLevel int            `gorm:""`
	DeletedAt     gorm.DeletedAt `gorm:"index"`
}

func (*RoleInfo) GetStringUID

func (userModel *RoleInfo) GetStringUID() string

func (*RoleInfo) GetTableName

func (*RoleInfo) GetTableName(gameId string) string

Directories

Path Synopsis
Package user 存放用户 Model 相关逻辑
Package user 存放用户 Model 相关逻辑

Jump to

Keyboard shortcuts

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