utils

package
v0.0.0-...-cbf5b65 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STUDY           = "Học"
	STUDY_ONLINE    = "Học trực tuyến"
	REST            = "Nghỉ"
	EXAM            = "Thi"
	EXTRACURRICULAR = "Ngoại khoá"
)

Variables

View Source
var Command = CommandType{
	Login:       "/login",
	Remove:      "/remove",
	Help:        "/help",
	Examday:     "/examday",
	UnExamday:   "/un_examday",
	ForceLogout: "/force_logout",
}

Functions

func DailyScheduleMessage

func DailyScheduleMessage(message string, dailySchedule *types.DailySchedule) string

func ExamScheduleMessage

func ExamScheduleMessage(message string, examSchedule types.ExamSchedule) string

func FormatDateTimeToGetDailySchedule

func FormatDateTimeToGetDailySchedule() string

func GetClassStatus

func GetClassStatus(status string, session string) string

func HelpScript

func HelpScript() string

func IsExamScheduleExisted

func IsExamScheduleExisted(oldExamSchedule, newExamSchedule types.ExamSchedule) bool

func IsExamScheduleRoomChanged

func IsExamScheduleRoomChanged(oldExamSchedule, newExamSchedule types.ExamSchedule) bool

func IsExamScheduleTimeChanged

func IsExamScheduleTimeChanged(oldExamSchedule, newExamSchedule types.ExamSchedule) bool

func IsTomorrow

func IsTomorrow(dateString string) bool

func TodayFormatted

func TodayFormatted() string

func ValidateStruct

func ValidateStruct(ctx context.Context, s interface{}) error

Validate struct fields

Types

type CommandType

type CommandType struct {
	Login       string
	Remove      string
	Help        string
	Examday     string
	UnExamday   string
	ForceLogout string
}

type ErrorResponse

type ErrorResponse struct {
	Message string                 `json:"message"`
	Errors  map[string]interface{} `json:"errors"`
}

func ShowErrors

func ShowErrors(err error) ErrorResponse

type PaginationQuery

type PaginationQuery struct {
	Size    int    `json:"size,omitempty"`
	Page    int    `json:"page,omitempty"`
	OrderBy string `json:"orderBy,omitempty"`
}

Jump to

Keyboard shortcuts

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