model

package
v0.0.0-...-5a65518 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetErrorResponse

func GetErrorResponse(code int, err error, resp *Response)

func InitDbContext

func InitDbContext()

Types

type DbContext

type DbContext struct {
	Read *database.Db
}

type MyError

type MyError struct {
	Code int
	Msg  string
}

func NewMyError

func NewMyError(code int, msg string) *MyError

func (*MyError) Error

func (e *MyError) Error() string

type Response

type Response struct {
	Code      int    `json:"code"`
	Msg       string `json:"msg"`
	Data      any    `json:"data"`
	RequestId string `json:"requestId"`
}

type User

type User struct {
	UserId   int64      `json:"userId"`
	UserName string     `json:"userName"`
	Phone    string     `json:"phone"`
	State    UserStatus `json:"state"`
	CreateAt int64      `json:"createAt"`
}

func FindUserById

func FindUserById(ctx *context.Context, id int64) (*User, error)

func FindUserByPhone

func FindUserByPhone(ctx *context.Context, phone string) (*User, error)

func (*User) TableName

func (*User) TableName() string

type UserLoginLog

type UserLoginLog struct {
	Id           int64  `json:"id"`
	UserId       int64  `json:"userId"`
	Phone        string `json:"phone"`
	LoginTime    int64  `json:"loginTime"`
	ClientType   string `json:"clientType"`
	LoginTimeout int64  `json:"loginTimeout"`
	RequestId    string `json:"requestId"`
	Msg          string `json:"msg"`
}

func (*UserLoginLog) TableName

func (u *UserLoginLog) TableName() string

type UserStatus

type UserStatus string
const (
	UserStatusNormal  UserStatus = "normal"
	UserStatusDeleted UserStatus = "deleted"
	UserStatusBanned  UserStatus = "banned"
)

Jump to

Keyboard shortcuts

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