db_backend

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

* @Author: SpenserCai * @Date: 2023-08-31 00:44:10 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-18 21:43:21 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-31 00:33:12 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-08-31 00:44:44 * @Description: file content

* @Author: SpenserCai * @Date: 2023-08-31 00:08:39 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-08-31 11:50:00 * @Description: file content

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbBackend

type DbBackend struct{}

func (DbBackend) CreateDbMysqlConnect

func (backend DbBackend) CreateDbMysqlConnect(dsn string) (*gorm.DB, error)

func (DbBackend) CreateDbSqliteConnect

func (backend DbBackend) CreateDbSqliteConnect(dsn string) (*gorm.DB, error)

type History added in v0.8.4

type History struct {
	MessageID      string `gorm:"column:message_id;size:100;index:idx_message;index:idx_message_id"`
	UserID         string `gorm:"column:user_id;size:100;index:idx_message"`
	CommandName    string `gorm:"column:command_name;size:50"`
	OptionJson     string `gorm:"column:option_json;size:0"`
	Images         string `gorm:"column:images;size:0"`
	Created        string `gorm:"column:created;size:50"`
	Deleted        bool   `gorm:"column:deleted;default:false"`
	ImageBlurHashs string `gorm:"column:image_blur_hashs;size:0"`
	IsPrivate      bool   `gorm:"column:is_private;default:false"`
}

func (History) TableName added in v0.8.4

func (History) TableName() string

type UserInfo

type UserInfo struct {
	ID                 string `gorm:"column:id;primaryKey;size:100;index:idx_user,unique"`
	Name               string `gorm:"column:name;size:50"`
	Avatar             string `gorm:"column:avatar;size:0"`
	Created            string `gorm:"column:created;size:50"`
	Enable             bool   `gorm:"column:enable"`
	Roles              string `gorm:"column:roles;size:0"`
	StableConfig       string `gorm:"column:stable_config;size:0"`
	CycleCredit        int32  `gorm:"column:cycle_credit;default:0"`      // 周期credit
	CreditUpdateCycle  string `gorm:"column:credit_update_cycle;size:50"` // credit更新周期 格式 1|H 1|D 1|W 1|M
	CycleCreditUpdated string `gorm:"column:credit_updated;size:50"`      // 周期credit更新时间,用于判断是否需要更新credit
	PlusCredit         int32  `gorm:"column:plus_credit;default:0"`       // 充值的credit
	IsPrivate          bool   `gorm:"column:is_private;default:false"`
}

索引为id字段

func (UserInfo) TableName

func (UserInfo) TableName() string

Jump to

Keyboard shortcuts

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