data

package
v0.0.0-...-942a274 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRepeat = errors.New("重复打卡")
View Source
var TermBegin = time.Date(2021, 9, 13, 0, 0, 0, 0, time.Now().Location())

Functions

func AddCheckinByID

func AddCheckinByID(id int32) error

func AddLongLeaveByQQ

func AddLongLeaveByQQ(qq int64, reason string, weekday int, single int) error

func AddTempLeaveByQQ

func AddTempLeaveByQQ(qq int64, reason string, leaveDay time.Time) error

func CheckQQ

func CheckQQ(qq int64) bool

func InitDB

func InitDB(source string) error

func IsTodayLongLeaveByID

func IsTodayLongLeaveByID(id int32) (uint, error)

func IsTodayTempLeaveByID

func IsTodayTempLeaveByID(id int32) (uint, error)

Types

type Checkin

type Checkin struct {
	Student   Student `gorm:"foreignKey:StudentId"`
	StudentId int32
	CheckinAt time.Time
}

type Leave

type Leave interface {
	GetStu() (*Student, error)
	GetReason() string
}

func QueryLeaveByID

func QueryLeaveByID(id int32) ([]Leave, error)

func QueryTodayLeaves

func QueryTodayLeaves() ([]Leave, error)

type LongLeave

type LongLeave struct {
	Student   Student `gorm:"foreignKey:StudentId"`
	StudentId int32   `gorm:"uniqueIndex:one_leave_one_day"`
	Reason    string
	WeekDay   int32 `gorm:"uniqueIndex:one_leave_one_day"`
	Single    int32 `gorm:"uniqueIndex:one_leave_one_day"`
	gorm.Model
}

func (LongLeave) GetReason

func (l LongLeave) GetReason() string

func (LongLeave) GetStu

func (l LongLeave) GetStu() (*Student, error)

type Student

type Student struct {
	Name       string
	StudentId  int32 `gorm:"primaryKey"`
	QQ         int64
	Permission int32
}

func QueryShouldArrive

func QueryShouldArrive() ([]Student, error)

type TempLeave

type TempLeave struct {
	Student   Student `gorm:"foreignKey:StudentId"`
	StudentId int32   `gorm:"unique_index:one_leave_one_day"`
	Reason    string
	LeaveDay  time.Time `gorm:"unique_index:one_leave_one_day"`
	gorm.Model
}

func (TempLeave) GetReason

func (l TempLeave) GetReason() string

func (TempLeave) GetStu

func (l TempLeave) GetStu() (*Student, error)

Jump to

Keyboard shortcuts

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