model

package
v0.0.0-...-2b09096 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

通用模型

附加属性

模板表

Index

Constants

View Source
const TemplateName = "template"

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonModel

type CommonModel struct {
	CreateTime time.Time `json:"-" gorm:"type:datetime;default:CURRENT_TIMESTAMP"`                                   // 创建时间
	UpdateTime time.Time `json:"-" gorm:"type:datetime;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;index"` // 更新时间
}

type Property

type Property struct {
	UserType   uint8 `json:"ut"` // 用户类型
	OnlineTime int64 `json:"ot"` // 在线时长,单位分钟
}

type Template

type Template struct {
	CommonModel
	ID     uint64 `json:"id" gorm:"auto_increment;primary_key"` // ID编号
	Name   string `json:"name" gorm:"not null;size:60"`         // 模板名称
	Amount int64  `json:"amount" gorm:"not null"`               // 金额(分)
	Custom string `json:"custom" gorm:"type:text"`              // 附加属性
}

func (Template) GetCustom

func (m Template) GetCustom() (item Property, err error)

func (Template) TableName

func (Template) TableName() string

Jump to

Keyboard shortcuts

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