lib

package
v0.0.0-...-ffefc0f Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 邮件服务器地址
	SMTP_MAIL_HOST = "smtp.126.com"
	// 端口
	SMTP_MAIL_PORT = "25"
)
View Source
const LiuPaiCommand = 1

Variables

View Source
var (
	// 发送邮件用户账号 126邮箱
	SMTP_MAIL_USER = ""
	// 授权密码
	SMTP_MAIL_PWD = ""
)

Functions

func DownloadConfigFile

func DownloadConfigFile(fname string) (err error)

下载配置文件

func InArrayStr

func InArrayStr(s string, arr []string) bool

判断arr是否包含 s

func LoadJSONConfig

func LoadJSONConfig(filename string, v interface{}) error

LoadJSONConfig 读取配置文件 json格式

func SendSMTPMail

func SendSMTPMail(mailAddress string, subject string, body string) error

发送邮件

func UnescapeUnicode

func UnescapeUnicode(raw []byte) ([]byte, error)

unicode转中文

Types

type Config

type Config struct {
	Year                      string `json:"year" validate:"required"`
	Name                      string `json:"name" validate:"required"`
	IdCard                    string `json:"id_card" validate:"required"`
	Appsecret                 string `json:"appsecret" validate:"required"`
	SendUser163MailAddress    string `json:"send_user_163_mail_address" validate:"required"`
	SendUser163MailAuthCode   string `json:"send_user_163_mail_auth_code" validate:"required"`
	ReceiveUser163MailAddress string `json:"receive_user_163_mail_address" validate:"required"`
	TimeInterval              int    `json:"time_interval"`
}

配置

type Liupai

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

六派

func NewLiuPai

func NewLiuPai(config map[string]interface{}) *Liupai

func (*Liupai) GetCaptchaRes

func (this *Liupai) GetCaptchaRes(captchaBase64 string) (captchaRes string, err error)

type ParseCaptchaInterface

type ParseCaptchaInterface interface {
	//通过验证码图片的base64得到验证码code
	GetCaptchaRes(captchaBase64 string) (captchaRes string, err error)
}

解析验证码接口

func ParseCaptchaCommand

func ParseCaptchaCommand(command int, config map[string]interface{}) (ParseCaptchaInterface, error)

根据命令释放对应的对象

type RuanKao

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

软考结构体

func (*RuanKao) GetCaptchaCode

func (this *RuanKao) GetCaptchaCode(parseCaptchaInterface ParseCaptchaInterface) (captchaCode string, err error)

获取验证码

func (*RuanKao) GetExaminationTimeList

func (this *RuanKao) GetExaminationTimeList() (list []string, err error)

获取所有考试时间

func (*RuanKao) GetScore

func (this *RuanKao) GetScore(ruanKaoUser RuanKaoUser) (scoreRes *ScoreRes, err error)

获取分数

func (*RuanKao) SetWelComeCookie

func (this *RuanKao) SetWelComeCookie() (err error)

设置cookie

func (*RuanKao) VerifyCaptchaUri

func (this *RuanKao) VerifyCaptchaUri(captcha string) (err error)

验证验证码

type RuanKaoUser

type RuanKaoUser struct {
	Name            string `json:"name"`
	Idcard          string `json:"idcard"`
	ExaminationTime string `json:"examination_time"`
	CaptchaCode     string `json:"captcha_code"`
}

软考考生信息结构体

type ScoreRes

type ScoreRes struct {
	KSSJ string
	ZGMC string
	XM   string
	ZJH  string
	ZKZH string
	XWCJ string
	SWCJ string
}

分数信息结构体

Jump to

Keyboard shortcuts

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