schoolTime

package
v0.0.0-...-a9153d3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_campusapis_schoolTime_defined_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type SchoolDate

type SchoolDate struct {
	SchoolYear *SchoolYear
	Semester   *Semester
	Week       int32
	// contains filtered or unexported fields
}

func (SchoolDate) Date

func (d SchoolDate) Date() *types.Date

func (SchoolDate) FromTime

func (SchoolDate) FromTime(t time.Time, handler TimeToSchoolDater) (*SchoolDate, error)

func (SchoolDate) Time

func (d SchoolDate) Time() time.Time

func (SchoolDate) Valid

func (d SchoolDate) Valid() bool

type SchoolDateToDater

type SchoolDateToDater interface {
	GetSchoolDateFrom(schoolDate *SchoolDate, weekDay int32) (*types.Date, error)
}

SchoolDateToDater 从学校日期获得日期

type SchoolYear

type SchoolYear struct {

	// 学年开始年,如:2021-2022 学年为 2021
	Year int32 `protobuf:"varint,1,opt,name=Year,proto3" json:"Year,omitempty"`
	// contains filtered or unexported fields
}

学年

func CastSchoolYear

func CastSchoolYear(in interface{}) *SchoolYear

func (*SchoolYear) Descriptor deprecated

func (*SchoolYear) Descriptor() ([]byte, []int)

Deprecated: Use SchoolYear.ProtoReflect.Descriptor instead.

func (*SchoolYear) FullName

func (x *SchoolYear) FullName() string

func (*SchoolYear) GetYear

func (x *SchoolYear) GetYear() int32

func (*SchoolYear) GormDataType

func (*SchoolYear) GormDataType() string

func (*SchoolYear) IsZero

func (x *SchoolYear) IsZero() bool

func (*SchoolYear) MarshalJSON

func (x *SchoolYear) MarshalJSON() ([]byte, error)

func (*SchoolYear) ProtoMessage

func (*SchoolYear) ProtoMessage()

func (*SchoolYear) ProtoReflect

func (x *SchoolYear) ProtoReflect() protoreflect.Message

func (*SchoolYear) Reset

func (x *SchoolYear) Reset()

func (*SchoolYear) Scan

func (x *SchoolYear) Scan(src interface{}) error

func (*SchoolYear) ShortName

func (x *SchoolYear) ShortName() string

func (*SchoolYear) String

func (x *SchoolYear) String() string

func (*SchoolYear) UnmarshalJSON

func (x *SchoolYear) UnmarshalJSON(data []byte) error

func (*SchoolYear) Value

func (x *SchoolYear) Value() (driver.Value, error)

type Section

type Section struct {

	// 第几节
	Section int32 `protobuf:"varint,1,opt,name=Section,proto3" json:"Section,omitempty"`
	// 本节开始时间
	StartTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=StartTime,proto3" json:"StartTime,omitempty"`
	// 本节结束时间
	EndTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=EndTime,proto3" json:"EndTime,omitempty"`
	// contains filtered or unexported fields
}

节次信息

func (*Section) Descriptor deprecated

func (*Section) Descriptor() ([]byte, []int)

Deprecated: Use Section.ProtoReflect.Descriptor instead.

func (*Section) GetEndTime

func (x *Section) GetEndTime() *timestamppb.Timestamp

func (*Section) GetSection

func (x *Section) GetSection() int32

func (*Section) GetStartTime

func (x *Section) GetStartTime() *timestamppb.Timestamp

func (*Section) ProtoMessage

func (*Section) ProtoMessage()

func (*Section) ProtoReflect

func (x *Section) ProtoReflect() protoreflect.Message

func (*Section) Reset

func (x *Section) Reset()

func (*Section) String

func (x *Section) String() string

type SectionReader

type SectionReader interface {
	StartTime(date *types.Date, section int32) time.Time
	EndTime(date *types.Date, section int32) time.Time
}

type Semester

type Semester struct {
	Num int32 `protobuf:"varint,1,opt,name=Num,proto3" json:"Num,omitempty"`
	// contains filtered or unexported fields
}

学期

func CastSemester

func CastSemester(in interface{}) *Semester

func (*Semester) Descriptor deprecated

func (*Semester) Descriptor() ([]byte, []int)

Deprecated: Use Semester.ProtoReflect.Descriptor instead.

func (*Semester) FullName

func (x *Semester) FullName() string

func (*Semester) GetNum

func (x *Semester) GetNum() int32

func (*Semester) GormDataType

func (*Semester) GormDataType() string

func (*Semester) IsZero

func (x *Semester) IsZero() bool

func (*Semester) MarshalJSON

func (x *Semester) MarshalJSON() ([]byte, error)

func (*Semester) ProtoMessage

func (*Semester) ProtoMessage()

func (*Semester) ProtoReflect

func (x *Semester) ProtoReflect() protoreflect.Message

func (*Semester) Reset

func (x *Semester) Reset()

func (*Semester) Scan

func (x *Semester) Scan(src interface{}) error

func (*Semester) ShortName

func (x *Semester) ShortName() string

func (*Semester) String

func (x *Semester) String() string

func (*Semester) UnmarshalJSON

func (x *Semester) UnmarshalJSON(data []byte) error

func (*Semester) Value

func (x *Semester) Value() (driver.Value, error)

type TimeToSchoolDater

type TimeToSchoolDater interface {
	GetSchoolDateFromTime(t time.Time) *SchoolDate
}

TimeToSchoolDater 学校日期接口,从时间获得学年、学期

type Timeable

type Timeable interface {
	GetSchoolDate() *SchoolDate
	GetSectionReader() SectionReader
	GetSchoolDateToDater() SchoolDateToDater
}

Directories

Path Synopsis
Package schoolTimev1 is a reverse proxy.
Package schoolTimev1 is a reverse proxy.

Jump to

Keyboard shortcuts

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