model

package
v0.0.0-...-7e4f592 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	gorm.Model
	Name       string `gorm:"type:varchar(32);not null;column:name;comment:分类名称"`
	Type       int    `gorm:"type:tinyint(1);null;default:null;column:type;comment:分类类型(0:菜品分类 1:套餐分类)"`
	Sort       int    `gorm:"type:tinyint(1);not null;default:0;column:sort;comment:分类排序(数字越小越靠前)"`
	Status     int    `gorm:"type:tinyint(1);not null;default:1;column:status;comment:分类状态(0:禁用 1:正常)"`
	CreateUser uint   `gorm:"type:bigint;not null;column:create_user;comment:创建人ID"`
	UpdateUser uint   `gorm:"type:bigint;not null;column:update_user;comment:更新人ID"`
}

func (*Category) TableName

func (c *Category) TableName() string

type CreateCategoryRequest

type CreateCategoryRequest struct {
	Name       string `json:"name" validate:"required|max_len:8" message:"required:name 必填|max_len:name 最多不能超过8个字符"`
	Sort       int    `json:"sort" validate:"required|int" message:"required:sort 必填|int:sort 必须是数字类型"`
	CreateUser string `json:"create_user" validate:"required" message:"required:create_user 必填"`
}

type Employee

type Employee struct {
	gorm.Model
	LoginName     string    `gorm:"type:varchar(50);not null;unique_index;column:login_name;comment:用户登录账号"`
	Passwd        string    `gorm:"type:varchar(60);not null;column:passwd;comment:加密后的密码"`
	Status        int       `gorm:"type:tinyint(1);default:1;column:status;comment:用户状态(0-正常 1-锁定)"`
	RegIp         string    `gorm:"type:varchar(15);default:null;column:reg_ip;comment:注册IP"`
	RegTime       time.Time `gorm:"type:datetime;null;default:null;column:reg_time;comment:注册时间"`
	LastLoginIp   string    `gorm:"type:varchar(15);null;default:null;column:last_login_ip;comment:最后一次登录的IP"`
	LastLoginTime time.Time `gorm:"type:datetime;null;default:null;column:last_login_time;comment:用户最后登录时间"`
}

func (*Employee) StringID

func (e *Employee) StringID() string

func (*Employee) TableName

func (e *Employee) TableName() string

type EmployeeLoginRequest

type EmployeeLoginRequest struct {
	LoginName string `json:"login_name" validate:"required" message:"required:login_name 必填"`
	Passwd    string `json:"passwd" validate:"required" message:"required:passwd 必填"`
}

type EmployeeLoginResponse

type EmployeeLoginResponse struct {
	UserId    string `json:"id"`
	LoginName string `json:"login_name"`
	Token     string `json:"token"`
}

type EmployeeRegisterRequest

type EmployeeRegisterRequest struct {
	LoginName string `json:"login_name" validate:"required|min_len:5|max_len:10" message:"required:login_name 必填"`
	Passwd    string `json:"passwd" validate:"required|min_len:6|max_len:20" message:"required:passwd 必填"`
	RegIp     string `json:"-"`
}

Jump to

Keyboard shortcuts

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