HitGeneralServices 0.5.3

dotnet add package HitGeneralServices --version 0.5.3
NuGet\Install-Package HitGeneralServices -Version 0.5.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HitGeneralServices" Version="0.5.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HitGeneralServices --version 0.5.3
#r "nuget: HitGeneralServices, 0.5.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install HitGeneralServices as a Cake Addin
#addin nuget:?package=HitGeneralServices&version=0.5.3

// Install HitGeneralServices as a Cake Tool
#tool nuget:?package=HitGeneralServices&version=0.5.3

<div align=center> <img src="https://github.com/HIT-ReFreSH/HitGeneralServices/raw/master/images/Full_2048.png" width = 30% height = 30% /> </div>

HitGeneralServices-HIT通用服务集

nuget Nuget GitHub GitHub last commit GitHub Workflow Status GitHub repo size GitHub code size

View at Nuget.org

HIT通用服务集包含了以下常用的组件:

  • HitInfoProviderFactory: 用于获取乐学网认证登录后,用户信息的工厂类
  • WeChatServices:微信服务大厅中的服务
  • CasLogin.LoginHttpClient:用于使用统一身份认证登录的HttpClient
  • Jwts.JwtsService:用于Jwts的各种服务

HitInfoProviderFactory 使用方法

将需要使用的服务,加入依赖注入的服务集合即可

CasLogin.LoginHttpClient 使用方法

既可以使用依赖注入初始化,也可以直接使用new来创建LoginHttpClient的实例。LoginHttpClient直接继承自HttpClient,可以像HttpClient一样使用。除此外,还提供了以下成员:

名称 类型 说明 参数 返回值 异常
LoginAsync 异步方法 进行统一认证登录 string username用户名<br> string password密码<br> Func<Stream, Task<string>>? captchaGenerator可选。 验证码填写适配器,用于在必须时填写验证码。 - CaptchaRequiredException: 需要填写二维码,但是未提供对应的适配器<br>LoginFailedException: 登陆认证失败,原因见Message
TryLoginFor 异步方法 持续尝试进行统一认证登录,直至满足最大尝试次数,或者抛出不能处理的异常 string username用户名<br> string password密码<br> uint maxTrail最大尝试次数<br> Func<Stream, Task<string>>? captchaGenerator可选。 验证码填写适配器,用于在必须时填写验证码。 - CaptchaRequiredException: 需要填写二维码,但是未提供对应的适配器<br>LoginFailedException: 登陆认证失败,原因见Message
IsAuthorized 异步方法 检查是否已经完成统一认证登录 - bool,是/否 -
Win32CaptchaInput 静态函数(验证码填写适配器) 适用于控制台程序。 使用Windows默认图片查看器查看验证码图片 - - -
CaptchaInputFactory 静态函数(验证码填写适配器工厂) 适用于控制台程序。 使用指定查看器生成验证码填写适配器 string pathToJpegViewerJpeg查看器的路径 验证码填写适配器 -
GetTwoPhaseLoginInfoAsync 异步方法 获取进行两段CAS登录的登录信息(第一阶段) string username用户名 Dictionary<string, string?>用于两段异步登录的登录信息字典;其中键password对应值是加密的salt(Aes.Key);键captcha如果存在,则对应值是用于获取验证码的url -
ApplyTwoPhaseLoginInfoAsync 异步方法 应用两段CAS登录的登录信息进行登录(第二阶段) Dictionary<string, string?> loginInfo登录信息,原始产生自GetTwoPhaseLoginInfoAsync(string);但是此处的键password对应值已经加密(Aes);键captcha如果存在,则对应值已经完成人工填写。 - LoginFailedException: 登陆认证失败,原因见Message

Jwts.JwtsService 使用方法

既可以使用依赖注入初始化,也可以直接使用new来创建JwtsService的实例。JwtsService提供了以下成员:

名称 类型 说明 参数 返回值 异常
LoginAsync 异步方法 进行统一认证登录 string username用户名<br> string password密码<br> Func<Stream, Task<string>>? captchaGenerator可选。 验证码填写适配器,用于在必须时填写验证码。 - CaptchaRequiredException: 需要填写二维码,但是未提供对应的适配器<br>LoginFailedException: 登陆认证失败,原因见Message
LoginAsync 异步方法 使用已经登录完毕LoginHttpClient登录Jwts LoginHttpClient,已经完成登录 - -
GetSemesterStartAsync 异步方法 获取学期开始日期 uint year学年<br> JwtsSemester semester学期 学期开始日期 -
GetScheduleAsync 异步方法 获取课表信息 uint year学年<br> JwtsSemester semester学期 大小为[7,6]的字符串列表矩阵,7为周一至周日,6为节次;数组的每个元素是该位置的课程(课程可能会占用1-3行) -
GetExamDetailsAsync 异步方法 获取考试详细(默认学期全部类别) - 一组考试详细记录 -
GetExamDetailsAsync 异步方法 获取考试详细(指定学期类别) uint year学年<br> JwtsSemester semester学期<br> JwtsExamType type类别 一组考试详细记录 -

WeChatServices微信服务大厅使用方法

这是一个静态类,直接调用对应方法即可。 目前提供以下服务:

  • 匿名查询课表服务
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on HitGeneralServices:

Package Downloads
HitRefresh.Schedule

Helps to convert schedule of HIT.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.5.3 583 8/23/2022
0.5.2 541 4/14/2022
0.5.1 1,132 2/16/2022
0.5.0 393 2/16/2022
0.4.4 422 1/15/2022
0.4.3.2 421 1/14/2022
0.4.3.1 429 1/13/2022
0.4.3 253 1/9/2022
0.4.2 266 12/20/2021
0.4.1.2 313 10/15/2021
0.4.1.1 308 10/15/2021
0.4.1 341 10/15/2021
0.4.0 300 10/14/2021
0.3.0 300 3/29/2021
0.2.0 307 3/29/2021
0.1.0 316 3/28/2021

版本0.5.3:增加了匿名课表查询服务支持研究生课表.