cet

package module
v0.0.0-...-08b7429 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2017 License: MIT Imports: 10 Imported by: 1

README

cet

四六级成绩查询,通过学信网提供的查询接口

License ReportCard GoDoc

下载并使用

$ go get -u github.com/LyricTian/cet
result, err := cet.Query(nil, "370150162100108", "张三")
if err != nil {
    panic(err)
}

fmt.Println("姓名:", result.Name)
fmt.Println("学校:", result.University)
fmt.Println("考试级别:", result.Level)
fmt.Println("笔试准考证号:", result.WrittenTicket)
fmt.Println("总分:", result.Score)
fmt.Println("听力:", result.Listening)
fmt.Println("阅读:", result.Reading)
fmt.Println("写作和翻译:", result.WritingTranslation)
fmt.Println("口试准考证号:", result.OralTicket)
fmt.Println("口试等级:", result.OralLevel)

使用命令行工具

$ go get github.com/LyricTian/cet/cmd/cet
$ cet -name '张三' -ticket '370150162100108'

MIT License

Copyright (c) 2016 LyricTian

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound not found
	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type Querier

type Querier interface {
	// 根据准考证号、姓名查询
	Query(ctx context.Context, ticket, name string) (*Result, error)
}

Querier 提供四六级成绩查询的接口

func NewQuerier

func NewQuerier() Querier

NewQuerier 创建Querier接口

type Result

type Result struct {
	Name               string  // 姓名
	University         string  // 学校
	Level              string  // 考试级别
	WrittenTicket      string  // 笔试准考证号
	Score              float32 // 总分
	Listening          float32 // 听力
	Reading            float32 // 阅读
	WritingTranslation float32 // 写作和翻译
	OralTicket         string  // 口试准考证号
	OralLevel          string  // 口试等级
}

Result 查询结果

func Query

func Query(ctx context.Context, ticket, name string) (*Result, error)

Query 根据准考证号、姓名查询四六级成绩

Directories

Path Synopsis
cmd
cet

Jump to

Keyboard shortcuts

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