model

package
v1.2.2-beta3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 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

func Initialize

func Initialize(dbpath string) *SleepDB

func Open

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

func (*SleepDB) Close

func (sdb *SleepDB) Close() error

func (*SleepDB) GetUp

func (sdb *SleepDB) GetUp(groupId, userId int64) (position int, sleepTime time.Duration)

更新起床时间

func (*SleepDB) Sleep

func (sdb *SleepDB) Sleep(groupId, userId int64) (position int, awakeTime time.Duration)

更新睡眠时间

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"`
}

func (SleepManage) TableName

func (SleepManage) TableName() string

Jump to

Keyboard shortcuts

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