models

package
v1.31.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Directory 目录
	Directory string = "M"
	// Menu 菜单
	Menu string = "C"
	// Button 按钮
	Button string = "F"
)

Menu 菜单中的类型枚举值

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlBy

type ControlBy struct {
	CreateBy string `json:"createBy" gorm:"size:63;index;comment:创建者"`
	UpdateBy string `json:"updateBy" gorm:"size:63;index;comment:更新者"`
}

func (*ControlBy) SetCreateBy

func (e *ControlBy) SetCreateBy(createBy string)

SetCreateBy 设置创建人id

func (*ControlBy) SetUpdateBy

func (e *ControlBy) SetUpdateBy(updateBy string)

SetUpdateBy 设置修改人id

type Migration

type Migration struct {
	Version   string    `gorm:"primaryKey"`
	ApplyTime time.Time `gorm:"autoCreateTime"`
}

func (Migration) TableName

func (Migration) TableName() string

type Model

type Model struct {
	Id int `json:"id" gorm:"primaryKey;autoIncrement;comment:主键编码"`
}

type ModelTime

type ModelTime struct {
	CreatedAt time.Time      `json:"createdAt" gorm:"index;comment:创建时间"`
	UpdatedAt time.Time      `json:"updatedAt" gorm:"index;comment:最后更新时间"`
	DeletedAt gorm.DeletedAt `json:"-" gorm:"index;comment:删除时间"`
}

type ModelTimeHardDelete

type ModelTimeHardDelete struct {
	CreatedAt time.Time `json:"createdAt" gorm:"index;comment:创建时间"`
	UpdatedAt time.Time `json:"updatedAt" gorm:"index;comment:最后更新时间"`
}

ModelTimeHardDelete We'd like to hard delete...

type Page

type Page struct {
	List      interface{} `json:"list"`
	Count     int         `json:"count"`
	PageIndex int         `json:"pageIndex"`
	PageSize  int         `json:"pageSize"`
}

type Response

type Response struct {
	// 代码
	Code int `json:"code" example:"200"`
	// 数据集
	Data interface{} `json:"data"`
	// 消息
	Msg       string `json:"msg"`
	RequestId string `json:"requestId"`
}

func (*Response) ReturnError

func (res *Response) ReturnError(code int) *Response

ReturnError 错误返回

func (*Response) ReturnOK

func (res *Response) ReturnOK() *Response

ReturnOK 正常返回

Jump to

Keyboard shortcuts

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