dnevnik76

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package dnevnik76 doc

Package dnevnik76 parser

Package dnevnik76 model

Index

Constants

This section is empty.

Variables

View Source
var (

	// DEBUG output
	DEBUG bool
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Username string `json:"login"`
	Password string `json:"password"`
	RegionID int64  `json:"region_id"`
	SchoolID int64  `json:"schoolId" xorm:"'school_id'"`
	Token    string `json:"token"`

	CurrentInfo CurrentInfo `xorm:"-"`
	// contains filtered or unexported fields
}

Client struct

func NewClient

func NewClient(login string, password string, regionID int64, schoolID int64, httpClient *http.Client) *Client

NewClient create new client

func (*Client) GetCourses

func (cli *Client) GetCourses() (courses []Course, err error)

GetCourses to get subjects

func (*Client) GetCurrentQuarter added in v0.1.3

func (cli *Client) GetCurrentQuarter() (result string)

func (*Client) GetHomework

func (cli *Client) GetHomework() (hws []Homework, err error)

GetHomework to get user homework

func (*Client) GetMarksCurrent

func (cli *Client) GetMarksCurrent() (marks []Mark, err error)

GetMarksCurrent to get marks for current month

func (*Client) GetMarksFinal

func (cli *Client) GetMarksFinal() (marks []Mark, err error)

GetMarksFinal to get final marks

func (*Client) GetMarksFor added in v0.1.1

func (cli *Client) GetMarksFor(p string) (marks []Mark, err error)

GetMarksFor to get marks for specific month

func (*Client) GetMarksForWithType added in v0.1.1

func (cli *Client) GetMarksForWithType(p string, t MarksListType) (marks []Mark, err error)

GetMarksForWithType to get user marks

func (*Client) GetMarksPeriods

func (cli *Client) GetMarksPeriods() (periods []Lperiod, err error)

GetMarksPeriods to get marks periods

func (*Client) GetMessage

func (cli *Client) GetMessage(msgID int64) (m Message, err error)

GetMessage by id

func (*Client) GetMessages

func (cli *Client) GetMessages() (messages []Message, err error)

GetMessages list for current user

func (*Client) GetMessagesCount

func (cli *Client) GetMessagesCount() (unread int, total int, err error)

GetMessagesCount get current user messages count

func (*Client) GetTeachers

func (cli *Client) GetTeachers() (teachers []Teacher, err error)

GetTeachers to get class teachers

func (*Client) Login

func (cli *Client) Login() (err error)

Login to dnevnik76.ru

func (*Client) PrintCookies

func (cli *Client) PrintCookies()

PrintCookies to print client cookies

func (*Client) SetCookie

func (cli *Client) SetCookie(name, value string)

SetCookie to set client cookie

func (*Client) ToJSON

func (cli *Client) ToJSON(o interface{}) (result string)

ToJSON convert object to json notation

type Course

type Course struct {
	ID   int64  `json:"id" xorm:"pk 'id'"`
	Name string `json:"name"`
}

Course struct

type CurrentInfo

type CurrentInfo struct {
	//PersonID     int64  `json:"personId" xorm:"'person_id'"`
	RegionID     int64  `json:"regionId" xorm:"'region_id'"`
	SchoolID     int64  `json:"schoolId" xorm:"'school_id'"`
	SchoolName   string `json:"schoolName"`
	ClassID      int64  `json:"clsId" xorm:"'class_id'"`
	Class        string `json:"cls"`
	EduYearStart int    `json:"eduYearStart"`
	EduYearEnd   int    `json:"eduYearEnd"`
}

CurrentInfo struct

type Homework

type Homework struct {
	ID         int64     `json:"id" xorm:"pk autoincr 'id'"`
	SchoolID   int64     `json:"schoolId" xorm:"'school_id'"`
	ClassID    int64     `json:"classId" xorm:"'class_id'"`
	Date       time.Time `json:"date"`
	DayOfWeek  string    `json:"dow"`
	CourseID   int64     `json:"courseId" xorm:"'course_id'"`
	CourseName string    `json:"courseName"`
	Homework   string    `json:"homework"`
	Subject    string    `json:"subject"`
}

Homework struct

type Lperiod

type Lperiod struct {
	SchoolID int64     `json:"schoolId" xorm:"'school_id'"`
	SYear    int       `json:"start_year"`
	EYear    int       `json:"end_year"`
	Name     string    `json:"name"`
	Period   string    `json:"period"`
	Start    time.Time `json:"start"`
	End      time.Time `json:"end"`
}

Lperiod struct

func (Lperiod) String

func (p Lperiod) String() string

type Mark

type Mark struct {
	ID         int64     `json:"id" xorm:"pk autoincr 'id'"`
	UserID     string    `json:"userId" xorm:"'user_id'"`
	SchoolID   int64     `json:"school_id" xorm:"'school_id'"`
	CourseID   int64     `json:"course_id" xorm:"'course_id'"`
	CourseName string    `json:"courseName"`
	Subject    string    `json:"subject"`
	HomeWork   string    `json:"homework"`
	Grade      []int8    `json:"grades"`
	DayOfWeek  string    `json:"dow"`
	Date       time.Time `json:"date"`
	SYear      int       `json:"s_year" xorm:"SMALLINT null"`
	EYear      int       `json:"e_year" xorm:"SMALLINT null"`
	Quarter    int       `json:"quarter" xorm:"SMALLINT null"`
	Annual     bool      `json:"annual" xorm:"null"`
}

Mark struct

func (Mark) String

func (m Mark) String() string

type MarkRange

type MarkRange int

MarkRange in month

const (
	// Month9 is September
	Month9 MarkRange = iota
	// Month10 is October
	Month10
	// Month11 is November
	Month11
	// Month12 is December
	Month12
	// Month1 is January
	Month1
	// Month2 is Febrary
	Month2
	// Month3 is March
	Month3
	// Month4 is April
	Month4
	// Month5 is May
	Month5
	// Month6 is June
	Month6
	// Month7 is July
	Month7
	// Month8 is August
	Month8
)

func (MarkRange) String

func (s MarkRange) String() string

type MarksByDate added in v0.1.1

type MarksByDate []Mark

func (MarksByDate) Len added in v0.1.1

func (a MarksByDate) Len() int

func (MarksByDate) Less added in v0.1.1

func (a MarksByDate) Less(i, j int) bool

func (MarksByDate) Swap added in v0.1.1

func (a MarksByDate) Swap(i, j int)

type MarksListType

type MarksListType int

MarksListType type

const (
	// Note type
	Note MarksListType = iota
	// List type
	List
	// Date type
	Date
)

func (MarksListType) String

func (s MarksListType) String() string

type Message

type Message struct {
	ID       int64     `json:"id" xorm:"pk 'id'"`
	UserID   string    `json:"userId" xorm:"'user_id'"`
	Date     time.Time `json:"date"`
	From     string    `json:"from"`
	IsUnread bool      `json:"isUnread"`
	Subject  string    `json:"subject"`
	Body     string    `json:"body"`
}

Message struct

type Region

type Region struct {
	ID   int64  `json:"id" xorm:"pk 'id'"`
	Name string `json:"name" xorm:"'name'"`
}

Region struct

func GetRegions

func GetRegions() (regions []Region, err error)

GetRegions to get client regions

type Schedule

type Schedule struct {
	ID        int64     `json:"id" xorm:"pk autoincr 'id'"`
	SchoolID  int64     `json:"schoolId" xorm:"'school_id'"`
	StudentID int64     `json:"studentId" xorm:"'student_id'"`
	CourseID  int64     `json:"courseId" xorm:"'course_id'"`
	Subject   string    `json:"subject"`
	Homework  string    `json:"homework"`
	Marks     []int8    `json:"marks"`
	Date      time.Time `json:"date"`
}

Schedule struct

type School

type School struct {
	ID       int64  `json:"id" xorm:"pk 'id'"`
	RegionID int64  `json:"regionId" xorm:"'region_id'"`
	Name     string `json:"name"`
	Type     string `json:"type"`
}

School struct

func GetSchools

func GetSchools(region int64) (schools []School, err error)

GetSchools for selected region

type Teacher

type Teacher struct {
	ID         int64  `json:"id" xorm:"pk autoincr 'id'"`
	UserID     string `json:"userId" xorm:"'user_id'"`
	SchoolID   int64  `json:"schoolId" xorm:"'school_id'"`
	FullName   string `json:"fullName"`
	CourseID   string `json:"courseId" xorm:"'course_id'"`
	CourseName string `json:"courseName"`
}

Teacher struct

Jump to

Keyboard shortcuts

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