model

package
v1.3.1-beta1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package model 睡眠管理数据库

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SleepDB

type SleepDB gorm.DB

SleepDB 睡眠数据库

func Initialize

func Initialize(dbpath string) *SleepDB

Initialize 初始化

func Open

func Open(dbpath string) (*SleepDB, error)

Open 打开

func (*SleepDB) Close

func (sdb *SleepDB) Close() error

Close 关闭

func (*SleepDB) GetUp

func (sdb *SleepDB) GetUp(gid, uid int64) (position int, sleepTime time.Duration)

GetUp 更新起床时间

func (*SleepDB) Sleep

func (sdb *SleepDB) Sleep(gid, uid int64) (position int, awakeTime time.Duration)

Sleep 更新睡眠时间

type SleepManage

type SleepManage struct {
	gorm.Model
	GroupID   int64     `gorm:"column:group_id"`
	UserID    int64     `gorm:"column:user_id"`
	SleepTime time.Time `gorm:"column:sleep_time"`
}

SleepManage 睡眠信息

func (SleepManage) TableName

func (SleepManage) TableName() string

TableName 表名

Jump to

Keyboard shortcuts

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