crawler

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetXNM

func GetXNM(s string) string

func GetXQM

func GetXQM(s string) string

func ToClassInfo1

func ToClassInfo1(reply CrawReply1, xnm, xqm string) ([]*model2.ClassInfo, []*model2.StudentCourse, error)

ToClassInfo1 处理本科生

func ToClassInfo2

func ToClassInfo2(reply CrawReply2, xnm, xqm string) ([]*model2.ClassInfo, []*model2.StudentCourse, error)

ToClassInfo2 处理研究生

Types

type CrawReply1

type CrawReply1 struct {
	DjdzList   []interface{} `json:"djdzList"`
	Jfckbkg    bool          `json:"jfckbkg"`
	JxhjkcList []interface{} `json:"jxhjkcList"`
	KbList     []struct {
		Bklxdjmc           string `json:"bklxdjmc"`
		CdID               string `json:"cd_id"`
		Cdlbmc             string `json:"cdlbmc"`
		Cdmc               string `json:"cdmc"`
		Cxbj               string `json:"cxbj"`
		Cxbjmc             string `json:"cxbjmc"`
		Date               string `json:"date"`
		DateDigit          string `json:"dateDigit"`
		DateDigitSeparator string `json:"dateDigitSeparator"`
		Day                string `json:"day"`
		Jc                 string `json:"jc"`
		Jcor               string `json:"jcor"`
		Jcs                string `json:"jcs"`
		JghID              string `json:"jgh_id"`
		Jgpxzd             string `json:"jgpxzd"`
		JxbID              string `json:"jxb_id"`
		Jxbmc              string `json:"jxbmc"`
		Jxbzc              string `json:"jxbzc"`
		Kcbj               string `json:"kcbj"`
		Kch                string `json:"kch"`
		KchID              string `json:"kch_id"`
		Kclb               string `json:"kclb"`
		Kcmc               string `json:"kcmc"`
		Kcxszc             string `json:"kcxszc"`
		Kcxz               string `json:"kcxz"`
		Kczxs              string `json:"kczxs"`
		Khfsmc             string `json:"khfsmc"`
		Kkzt               string `json:"kkzt"`
		Lh                 string `json:"lh"`
		Listnav            string `json:"listnav"`
		LocaleKey          string `json:"localeKey"`
		Month              string `json:"month"`
		Oldjc              string `json:"oldjc"`
		Oldzc              string `json:"oldzc"`
		PageTotal          int64  `json:"pageTotal"`
		Pageable           bool   `json:"pageable"`
		Pkbj               string `json:"pkbj"`
		Qqqh               string `json:"qqqh"`
		QueryModel         struct {
			CurrentPage   int64         `json:"currentPage"`
			CurrentResult int64         `json:"currentResult"`
			EntityOrField bool          `json:"entityOrField"`
			Limit         int64         `json:"limit"`
			Offset        int64         `json:"offset"`
			PageNo        int64         `json:"pageNo"`
			PageSize      int64         `json:"pageSize"`
			ShowCount     int64         `json:"showCount"`
			Sorts         []interface{} `json:"sorts"`
			TotalCount    int64         `json:"totalCount"`
			TotalPage     int64         `json:"totalPage"`
			TotalResult   int64         `json:"totalResult"`
		} `json:"queryModel"`
		Rangeable   bool   `json:"rangeable"`
		Rk          string `json:"rk"`
		Rsdzjs      int64  `json:"rsdzjs"`
		Sfjf        string `json:"sfjf"`
		Skfsmc      string `json:"skfsmc"`
		Sxbj        string `json:"sxbj"`
		TotalResult string `json:"totalResult"`
		UserModel   struct {
			Monitor    bool   `json:"monitor"`
			RoleCount  int64  `json:"roleCount"`
			RoleKeys   string `json:"roleKeys"`
			RoleValues string `json:"roleValues"`
			Status     int64  `json:"status"`
			Usable     bool   `json:"usable"`
		} `json:"userModel"`
		Xf       string `json:"xf"`
		Xkbz     string `json:"xkbz"`
		Xm       string `json:"xm"`
		Xnm      string `json:"xnm"`
		Xqdm     string `json:"xqdm"`
		Xqh1     string `json:"xqh1"`
		XqhID    string `json:"xqh_id"`
		Xqj      string `json:"xqj"` // 星期几
		Xqjmc    string `json:"xqjmc"`
		Xqm      string `json:"xqm"`
		Xqmc     string `json:"xqmc"`
		Xsdm     string `json:"xsdm"`
		Xslxbj   string `json:"xslxbj"`
		Year     string `json:"year"`
		Zcd      string `json:"zcd"`
		Zcmc     string `json:"zcmc"`
		Zfjmc    string `json:"zfjmc"`
		Zhxs     string `json:"zhxs"`
		Zxs      string `json:"zxs"`
		Zxxx     string `json:"zxxx"`
		Zyfxmc   string `json:"zyfxmc"`
		Zyhxkcbj string `json:"zyhxkcbj"`
		Zzmm     string `json:"zzmm"`
		Zzrl     string `json:"zzrl"`
	} `json:"kbList"`
	Kblx         int64         `json:"kblx"`
	Qsxqj        string        `json:"qsxqj"`
	RqazcList    []interface{} `json:"rqazcList"`
	Sfxsd        string        `json:"sfxsd"`
	SjkList      []interface{} `json:"sjkList"`
	Sxgykbbz     string        `json:"sxgykbbz"`
	Xkkg         bool          `json:"xkkg"`
	Xnxqsfkz     string        `json:"xnxqsfkz"`
	XqbzxxszList []interface{} `json:"xqbzxxszList"`
	XqjmcMap     struct {
		One   string `json:"1"`
		Two   string `json:"2"`
		Three string `json:"3"`
		Four  string `json:"4"`
		Five  string `json:"5"`
		Six   string `json:"6"`
		Seven string `json:"7"`
	} `json:"xqjmcMap"`
	XsbjList []struct {
		Xsdm   string `json:"xsdm"`
		Xslxbj string `json:"xslxbj"`
		Xsmc   string `json:"xsmc"`
	} `json:"xsbjList"`
	Xskbsfxstkzt string `json:"xskbsfxstkzt"`
	Xsxx         struct {
		Bjmc   string `json:"BJMC"`
		Jfzt   int64  `json:"JFZT"`
		Kcms   int64  `json:"KCMS"`
		Kxkxxq string `json:"KXKXXQ"`
		NjdmID string `json:"NJDM_ID"`
		Xh     string `json:"XH"`
		XhID   string `json:"XH_ID"`
		Xkkg   string `json:"XKKG"`
		Xkkgxq string `json:"XKKGXQ"`
		Xm     string `json:"XM"`
		Xnm    string `json:"XNM"`
		Xnmc   string `json:"XNMC"`
		Xqm    string `json:"XQM"`
		Xqmmc  string `json:"XQMMC"`
		ZyhID  string `json:"ZYH_ID"`
		Zymc   string `json:"ZYMC"`
	} `json:"xsxx"`
	Zckbsfxssj string `json:"zckbsfxssj"`
}

type CrawReply2

type CrawReply2 struct {
	Kblx         int   `json:"kblx"`
	XqbzxxszList []any `json:"xqbzxxszList"`
	Xsxx         struct {
		Xnmc   string `json:"XNMC"`
		Kxkxxq string `json:"KXKXXQ"`
		Xkkgxq string `json:"XKKGXQ"`
		Xkkg   string `json:"XKKG"`
		XhID   string `json:"XH_ID"`
		Xh     string `json:"XH"`
		Xqmmc  string `json:"XQMMC"`
		Xm     string `json:"XM"`
		Xqm    string `json:"XQM"`
		Xnm    string `json:"XNM"`
		Kcms   int    `json:"KCMS"`
	} `json:"xsxx"`
	SjkList  []any `json:"sjkList"`
	Xkkg     bool  `json:"xkkg"`
	XqjmcMap struct {
		Num1 string `json:"1"`
		Num2 string `json:"2"`
		Num3 string `json:"3"`
		Num4 string `json:"4"`
		Num5 string `json:"5"`
		Num6 string `json:"6"`
		Num7 string `json:"7"`
	} `json:"xqjmcMap"`
	Xskbsfxstkzt string `json:"xskbsfxstkzt"`
	KbList       []struct {
		CdID       string `json:"cd_id"`
		Cdmc       string `json:"cdmc"`
		Cxbj       string `json:"cxbj"`
		Date       string `json:"date"`
		DateDigit  string `json:"dateDigit"`
		Day        string `json:"day"`
		Jc         string `json:"jc"`
		Jcor       string `json:"jcor"`
		Jcs        string `json:"jcs"`
		JghID      string `json:"jgh_id"`
		Jgpxzd     string `json:"jgpxzd"`
		JxbID      string `json:"jxb_id"`
		Jxbmc      string `json:"jxbmc"`
		Jxbsftkbj  string `json:"jxbsftkbj"`
		Jxbzc      string `json:"jxbzc"`
		KchID      string `json:"kch_id"`
		Kcmc       string `json:"kcmc"`
		Kcxszc     string `json:"kcxszc"`
		Khfsmc     string `json:"khfsmc"`
		Listnav    string `json:"listnav"`
		LocaleKey  string `json:"localeKey"`
		Oldjc      string `json:"oldjc"`
		Oldzc      string `json:"oldzc"`
		Pageable   bool   `json:"pageable"`
		Pkbj       string `json:"pkbj"`
		QueryModel struct {
			CurrentPage   int   `json:"currentPage"`
			CurrentResult int   `json:"currentResult"`
			EntityOrField bool  `json:"entityOrField"`
			Limit         int   `json:"limit"`
			Offset        int   `json:"offset"`
			PageNo        int   `json:"pageNo"`
			PageSize      int   `json:"pageSize"`
			ShowCount     int   `json:"showCount"`
			Sorts         []any `json:"sorts"`
			TotalCount    int   `json:"totalCount"`
			TotalPage     int   `json:"totalPage"`
			TotalResult   int   `json:"totalResult"`
		} `json:"queryModel"`
		Rangeable      bool   `json:"rangeable"`
		Rsdzjs         int    `json:"rsdzjs"`
		Sfsyhzsfgn     string `json:"sfsyhzsfgn"`
		SfxsbybjExport string `json:"sfxsbybj_export"`
		SfxsbybjPage   string `json:"sfxsbybj_page"`
		Sxbj           string `json:"sxbj"`
		TotalResult    string `json:"totalResult"`
		UserModel      struct {
			Monitor    bool   `json:"monitor"`
			RoleCount  int    `json:"roleCount"`
			RoleKeys   string `json:"roleKeys"`
			RoleValues string `json:"roleValues"`
			Status     int    `json:"status"`
			Usable     bool   `json:"usable"`
		} `json:"userModel"`
		Xf     string `json:"xf"`
		Xkbz   string `json:"xkbz"`
		Xm     string `json:"xm"`
		Xnm    string `json:"xnm"`
		Xqdm   string `json:"xqdm"`
		Xqh1   string `json:"xqh1"`
		XqhID  string `json:"xqh_id"`
		Xqj    string `json:"xqj"`
		Xqjmc  string `json:"xqjmc"`
		Xqm    string `json:"xqm"`
		Xqmc   string `json:"xqmc"`
		Xxdm   string `json:"xxdm"`
		Year   string `json:"year"`
		Zcd    string `json:"zcd"`
		Zhxs   string `json:"zhxs"`
		Zxs    string `json:"zxs"`
		Zyfxmc string `json:"zyfxmc"`
	} `json:"kbList"`
	JxhjkcList []any `json:"jxhjkcList"`
	XsbjList   []any `json:"xsbjList"`
}

type Crawler

type Crawler struct {
	// contains filtered or unexported fields
}

func NewClassCrawler

func NewClassCrawler(logger classLog.Clogger) *Crawler

func (*Crawler) GetClassInfoForGraduateStudent

GetClassInfoForGraduateStudent 获取研究生课程信息

func (*Crawler) GetClassInfosForUndergraduate

GetClassInfosForUndergraduate 获取本科生课程信息

Jump to

Keyboard shortcuts

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