parent
e4473af4d7
commit
bf828e3418
@ -1,6 +1,5 @@ |
|||||||
package cn.linghang.mywust.captcha; |
package cn.wustlinghang.mywust.captcha; |
||||||
|
|
||||||
import lombok.Data; |
|
||||||
import lombok.Getter; |
import lombok.Getter; |
||||||
|
|
||||||
/** |
/** |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.captcha; |
package cn.wustlinghang.mywust.captcha; |
||||||
|
|
||||||
import lombok.AllArgsConstructor; |
import lombok.AllArgsConstructor; |
||||||
import lombok.Data; |
import lombok.Data; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.data.global; |
package cn.wustlinghang.mywust.data.global; |
||||||
|
|
||||||
import java.util.StringJoiner; |
import java.util.StringJoiner; |
||||||
|
|
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.data.global; |
package cn.wustlinghang.mywust.data.global; |
||||||
|
|
||||||
import java.util.StringJoiner; |
import java.util.StringJoiner; |
||||||
|
|
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.data.global; |
package cn.wustlinghang.mywust.data.global; |
||||||
|
|
||||||
import lombok.AllArgsConstructor; |
import lombok.AllArgsConstructor; |
||||||
import lombok.Builder; |
import lombok.Builder; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.data.global; |
package cn.wustlinghang.mywust.data.global; |
||||||
|
|
||||||
import java.util.StringJoiner; |
import java.util.StringJoiner; |
||||||
|
|
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.data.global; |
package cn.wustlinghang.mywust.data.global; |
||||||
|
|
||||||
import lombok.AllArgsConstructor; |
import lombok.AllArgsConstructor; |
||||||
import lombok.Builder; |
import lombok.Builder; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.data.global; |
package cn.wustlinghang.mywust.data.global; |
||||||
|
|
||||||
import lombok.AllArgsConstructor; |
import lombok.AllArgsConstructor; |
||||||
import lombok.Builder; |
import lombok.Builder; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.data.global; |
package cn.wustlinghang.mywust.data.global; |
||||||
|
|
||||||
import lombok.AllArgsConstructor; |
import lombok.AllArgsConstructor; |
||||||
import lombok.Builder; |
import lombok.Builder; |
@ -1,6 +1,6 @@ |
|||||||
package cn.linghang.mywust.data.physics; |
package cn.wustlinghang.mywust.data.physics; |
||||||
|
|
||||||
import cn.linghang.mywust.data.global.Course; |
import cn.wustlinghang.mywust.data.global.Course; |
||||||
import lombok.Getter; |
import lombok.Getter; |
||||||
import lombok.Setter; |
import lombok.Setter; |
||||||
|
|
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.data.undergrad; |
package cn.wustlinghang.mywust.data.undergrad; |
||||||
|
|
||||||
import lombok.AllArgsConstructor; |
import lombok.AllArgsConstructor; |
||||||
import lombok.Data; |
import lombok.Data; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.exception; |
package cn.wustlinghang.mywust.exception; |
||||||
|
|
||||||
public class ApiException extends BasicException { |
public class ApiException extends BasicException { |
||||||
private final Code code; |
private final Code code; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.exception; |
package cn.wustlinghang.mywust.exception; |
||||||
|
|
||||||
public class BasicException extends Exception { |
public class BasicException extends Exception { |
||||||
public BasicException() { |
public BasicException() { |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.exception; |
package cn.wustlinghang.mywust.exception; |
||||||
|
|
||||||
import java.util.StringJoiner; |
import java.util.StringJoiner; |
||||||
|
|
@ -1,7 +0,0 @@ |
|||||||
package cn.linghang.mywust.core.parser; |
|
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
|
||||||
|
|
||||||
public interface Parser<T> { |
|
||||||
public T parse(String html) throws ParseException; |
|
||||||
} |
|
@ -1,9 +0,0 @@ |
|||||||
package cn.linghang.mywust.core.request.service.captcha.solver; |
|
||||||
|
|
||||||
import cn.linghang.mywust.captcha.SolvedImageCaptcha; |
|
||||||
import cn.linghang.mywust.captcha.UnsolvedImageCaptcha; |
|
||||||
import cn.linghang.mywust.exception.ApiException; |
|
||||||
|
|
||||||
public interface CaptchaSolver { |
|
||||||
SolvedImageCaptcha solve(UnsolvedImageCaptcha unsolvedImageCaptcha) throws ApiException; |
|
||||||
} |
|
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.core.api; |
package cn.wustlinghang.mywust.core.api; |
||||||
|
|
||||||
import java.util.Collections; |
import java.util.Collections; |
||||||
import java.util.HashMap; |
import java.util.HashMap; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.core.api; |
package cn.wustlinghang.mywust.core.api; |
||||||
|
|
||||||
public class GraduateUrls { |
public class GraduateUrls { |
||||||
public static final String GRADUATE_CAPTCHA_API = "http://59.68.177.189/pyxx/PageTemplate/NsoftPage/yzm/createyzm.aspx"; |
public static final String GRADUATE_CAPTCHA_API = "http://59.68.177.189/pyxx/PageTemplate/NsoftPage/yzm/createyzm.aspx"; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.core.api; |
package cn.wustlinghang.mywust.core.api; |
||||||
|
|
||||||
public class LibraryUrls { |
public class LibraryUrls { |
||||||
public static final String LIBRARY_SESSION_COOKIE_API = "https://libsys.wust.edu.cn/meta-local/opac/cas/rosetta?ticket=%s"; |
public static final String LIBRARY_SESSION_COOKIE_API = "https://libsys.wust.edu.cn/meta-local/opac/cas/rosetta?ticket=%s"; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.core.api; |
package cn.wustlinghang.mywust.core.api; |
||||||
|
|
||||||
public class PhysicsSystemUrls { |
public class PhysicsSystemUrls { |
||||||
public static final String PHYSICS_LOGIN_INDEX = "http://wlsy.wust.edu.cn/Page/BI/BI000.aspx"; |
public static final String PHYSICS_LOGIN_INDEX = "http://wlsy.wust.edu.cn/Page/BI/BI000.aspx"; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.core.api; |
package cn.wustlinghang.mywust.core.api; |
||||||
|
|
||||||
import lombok.Getter; |
import lombok.Getter; |
||||||
|
|
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.core.api; |
package cn.wustlinghang.mywust.core.api; |
||||||
|
|
||||||
public class UnionAuthUrls { |
public class UnionAuthUrls { |
||||||
/** |
/** |
@ -1,7 +1,7 @@ |
|||||||
package cn.linghang.mywust.core.parser; |
package cn.wustlinghang.mywust.core.parser; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.data.global.Classroom; |
import cn.wustlinghang.mywust.data.global.Classroom; |
||||||
import org.slf4j.Logger; |
import org.slf4j.Logger; |
||||||
import org.slf4j.LoggerFactory; |
import org.slf4j.LoggerFactory; |
||||||
|
|
@ -0,0 +1,7 @@ |
|||||||
|
package cn.wustlinghang.mywust.core.parser; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
|
|
||||||
|
public interface Parser<T> { |
||||||
|
public T parse(String html) throws ParseException; |
||||||
|
} |
@ -1,9 +1,9 @@ |
|||||||
package cn.linghang.mywust.core.parser.graduate; |
package cn.wustlinghang.mywust.core.parser.graduate; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import cn.linghang.mywust.data.global.Classroom; |
import cn.wustlinghang.mywust.data.global.Classroom; |
||||||
import cn.linghang.mywust.data.global.Course; |
import cn.wustlinghang.mywust.data.global.Course; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Document; |
import org.jsoup.nodes.Document; |
||||||
import org.jsoup.nodes.Element; |
import org.jsoup.nodes.Element; |
@ -1,8 +1,8 @@ |
|||||||
package cn.linghang.mywust.core.parser.graduate; |
package cn.wustlinghang.mywust.core.parser.graduate; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import cn.linghang.mywust.data.global.Score; |
import cn.wustlinghang.mywust.data.global.Score; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Document; |
import org.jsoup.nodes.Document; |
||||||
import org.jsoup.nodes.Element; |
import org.jsoup.nodes.Element; |
@ -1,9 +1,9 @@ |
|||||||
package cn.linghang.mywust.core.parser.graduate; |
package cn.wustlinghang.mywust.core.parser.graduate; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import cn.linghang.mywust.core.util.JsoupUtil; |
import cn.wustlinghang.mywust.core.util.JsoupUtil; |
||||||
import cn.linghang.mywust.data.global.StudentInfo; |
import cn.wustlinghang.mywust.data.global.StudentInfo; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Element; |
import org.jsoup.nodes.Element; |
||||||
|
|
@ -1,8 +1,8 @@ |
|||||||
package cn.linghang.mywust.core.parser.graduate; |
package cn.wustlinghang.mywust.core.parser.graduate; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import cn.linghang.mywust.core.util.JsoupUtil; |
import cn.wustlinghang.mywust.core.util.JsoupUtil; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Document; |
import org.jsoup.nodes.Document; |
||||||
import org.jsoup.nodes.Element; |
import org.jsoup.nodes.Element; |
@ -1,10 +1,10 @@ |
|||||||
package cn.linghang.mywust.core.parser.physics; |
package cn.wustlinghang.mywust.core.parser.physics; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.HuangjiahuClassroomNameParser; |
import cn.wustlinghang.mywust.core.parser.HuangjiahuClassroomNameParser; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import cn.linghang.mywust.data.global.Classroom; |
import cn.wustlinghang.mywust.data.global.Classroom; |
||||||
import cn.linghang.mywust.data.physics.PhysicsCourse; |
import cn.wustlinghang.mywust.data.physics.PhysicsCourse; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.select.Elements; |
import org.jsoup.select.Elements; |
||||||
|
|
@ -1,7 +1,7 @@ |
|||||||
package cn.linghang.mywust.core.parser.physics; |
package cn.wustlinghang.mywust.core.parser.physics; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Document; |
import org.jsoup.nodes.Document; |
||||||
import org.jsoup.select.Elements; |
import org.jsoup.select.Elements; |
@ -1,8 +1,8 @@ |
|||||||
package cn.linghang.mywust.core.parser.physics; |
package cn.wustlinghang.mywust.core.parser.physics; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import cn.linghang.mywust.core.util.JsoupUtil; |
import cn.wustlinghang.mywust.core.util.JsoupUtil; |
||||||
import lombok.Data; |
import lombok.Data; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Document; |
import org.jsoup.nodes.Document; |
@ -1,9 +1,9 @@ |
|||||||
package cn.linghang.mywust.core.parser.physics; |
package cn.wustlinghang.mywust.core.parser.physics; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import cn.linghang.mywust.core.util.JsoupUtil; |
import cn.wustlinghang.mywust.core.util.JsoupUtil; |
||||||
import cn.linghang.mywust.data.global.Score; |
import cn.wustlinghang.mywust.data.global.Score; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Element; |
import org.jsoup.nodes.Element; |
||||||
import org.jsoup.select.Elements; |
import org.jsoup.select.Elements; |
@ -1,11 +1,11 @@ |
|||||||
package cn.linghang.mywust.core.parser.undergraduate; |
package cn.wustlinghang.mywust.core.parser.undergraduate; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import cn.linghang.mywust.core.util.JsoupUtil; |
import cn.wustlinghang.mywust.core.util.JsoupUtil; |
||||||
import cn.linghang.mywust.data.global.Classroom; |
import cn.wustlinghang.mywust.data.global.Classroom; |
||||||
import cn.linghang.mywust.data.global.Course; |
import cn.wustlinghang.mywust.data.global.Course; |
||||||
import cn.linghang.mywust.util.StringUtil; |
import cn.wustlinghang.mywust.util.StringUtil; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Element; |
import org.jsoup.nodes.Element; |
||||||
import org.jsoup.select.Elements; |
import org.jsoup.select.Elements; |
@ -1,7 +1,7 @@ |
|||||||
package cn.linghang.mywust.core.parser.undergraduate; |
package cn.wustlinghang.mywust.core.parser.undergraduate; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Element; |
import org.jsoup.nodes.Element; |
||||||
import org.jsoup.select.Elements; |
import org.jsoup.select.Elements; |
@ -1,7 +1,7 @@ |
|||||||
package cn.linghang.mywust.core.parser.undergraduate; |
package cn.wustlinghang.mywust.core.parser.undergraduate; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.select.Elements; |
import org.jsoup.select.Elements; |
||||||
|
|
@ -1,9 +1,9 @@ |
|||||||
package cn.linghang.mywust.core.parser.undergraduate; |
package cn.wustlinghang.mywust.core.parser.undergraduate; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import cn.linghang.mywust.core.util.JsoupUtil; |
import cn.wustlinghang.mywust.core.util.JsoupUtil; |
||||||
import cn.linghang.mywust.data.undergrad.ExamDelayApplication; |
import cn.wustlinghang.mywust.data.undergrad.ExamDelayApplication; |
||||||
import lombok.extern.slf4j.Slf4j; |
import lombok.extern.slf4j.Slf4j; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Element; |
import org.jsoup.nodes.Element; |
@ -1,9 +1,9 @@ |
|||||||
package cn.linghang.mywust.core.parser.undergraduate; |
package cn.wustlinghang.mywust.core.parser.undergraduate; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import cn.linghang.mywust.core.util.JsoupUtil; |
import cn.wustlinghang.mywust.core.util.JsoupUtil; |
||||||
import cn.linghang.mywust.data.global.Score; |
import cn.wustlinghang.mywust.data.global.Score; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Element; |
import org.jsoup.nodes.Element; |
||||||
import org.jsoup.select.Elements; |
import org.jsoup.select.Elements; |
@ -1,9 +1,9 @@ |
|||||||
package cn.linghang.mywust.core.parser.undergraduate; |
package cn.wustlinghang.mywust.core.parser.undergraduate; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import cn.linghang.mywust.core.util.JsoupUtil; |
import cn.wustlinghang.mywust.core.util.JsoupUtil; |
||||||
import cn.linghang.mywust.data.global.StudentInfo; |
import cn.wustlinghang.mywust.data.global.StudentInfo; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Document; |
import org.jsoup.nodes.Document; |
||||||
import org.jsoup.nodes.Element; |
import org.jsoup.nodes.Element; |
@ -1,7 +1,7 @@ |
|||||||
package cn.linghang.mywust.core.parser.undergraduate; |
package cn.wustlinghang.mywust.core.parser.undergraduate; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.select.Elements; |
import org.jsoup.select.Elements; |
||||||
|
|
@ -1,9 +1,9 @@ |
|||||||
package cn.linghang.mywust.core.parser.undergraduate.global; |
package cn.wustlinghang.mywust.core.parser.undergraduate.global; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.data.global.Classroom; |
import cn.wustlinghang.mywust.data.global.Classroom; |
||||||
import cn.linghang.mywust.data.global.Course; |
import cn.wustlinghang.mywust.data.global.Course; |
||||||
import cn.linghang.mywust.util.StringUtil; |
import cn.wustlinghang.mywust.util.StringUtil; |
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Element; |
import org.jsoup.nodes.Element; |
||||||
import org.jsoup.select.Elements; |
import org.jsoup.select.Elements; |
@ -1,8 +1,8 @@ |
|||||||
package cn.linghang.mywust.core.parser.undergraduate.global; |
package cn.wustlinghang.mywust.core.parser.undergraduate.global; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import cn.linghang.mywust.data.global.Course; |
import cn.wustlinghang.mywust.data.global.Course; |
||||||
|
|
||||||
import java.util.List; |
import java.util.List; |
||||||
import java.util.regex.Pattern; |
import java.util.regex.Pattern; |
@ -1,8 +1,8 @@ |
|||||||
package cn.linghang.mywust.core.parser.undergraduate.global; |
package cn.wustlinghang.mywust.core.parser.undergraduate.global; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.Parser; |
import cn.wustlinghang.mywust.core.parser.Parser; |
||||||
import cn.linghang.mywust.data.global.Course; |
import cn.wustlinghang.mywust.data.global.Course; |
||||||
|
|
||||||
import java.util.List; |
import java.util.List; |
||||||
import java.util.regex.Pattern; |
import java.util.regex.Pattern; |
@ -1,6 +1,6 @@ |
|||||||
package cn.linghang.mywust.core.request.factory; |
package cn.wustlinghang.mywust.core.request.factory; |
||||||
|
|
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
|
|
||||||
import java.net.URL; |
import java.net.URL; |
||||||
import java.nio.charset.StandardCharsets; |
import java.nio.charset.StandardCharsets; |
@ -1,9 +1,9 @@ |
|||||||
package cn.linghang.mywust.core.request.factory.auth; |
package cn.wustlinghang.mywust.core.request.factory.auth; |
||||||
|
|
||||||
import cn.linghang.mywust.core.api.UnionAuthUrls; |
import cn.wustlinghang.mywust.core.api.UnionAuthUrls; |
||||||
import cn.linghang.mywust.core.request.factory.RequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.RequestFactory; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.util.StringUtil; |
import cn.wustlinghang.mywust.util.StringUtil; |
||||||
|
|
||||||
import java.nio.charset.StandardCharsets; |
import java.nio.charset.StandardCharsets; |
||||||
import java.util.HashMap; |
import java.util.HashMap; |
@ -1,11 +1,11 @@ |
|||||||
package cn.linghang.mywust.core.request.factory.graduate; |
package cn.wustlinghang.mywust.core.request.factory.graduate; |
||||||
|
|
||||||
import cn.linghang.mywust.captcha.SolvedImageCaptcha; |
import cn.wustlinghang.mywust.captcha.SolvedImageCaptcha; |
||||||
import cn.linghang.mywust.core.api.GraduateUrls; |
import cn.wustlinghang.mywust.core.api.GraduateUrls; |
||||||
import cn.linghang.mywust.core.request.factory.RequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.RequestFactory; |
||||||
import cn.linghang.mywust.core.util.PageFormExtractor; |
import cn.wustlinghang.mywust.core.util.PageFormExtractor; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.util.StringUtil; |
import cn.wustlinghang.mywust.util.StringUtil; |
||||||
import lombok.Builder; |
import lombok.Builder; |
||||||
import lombok.Data; |
import lombok.Data; |
||||||
|
|
@ -1,10 +1,9 @@ |
|||||||
package cn.linghang.mywust.core.request.factory.library; |
package cn.wustlinghang.mywust.core.request.factory.library; |
||||||
|
|
||||||
import cn.hutool.core.util.URLUtil; |
import cn.wustlinghang.mywust.core.api.LibraryUrls; |
||||||
import cn.linghang.mywust.core.api.LibraryUrls; |
import cn.wustlinghang.mywust.core.request.factory.RequestFactory; |
||||||
import cn.linghang.mywust.core.request.factory.RequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.library.request.SearchRequest; |
||||||
import cn.linghang.mywust.core.request.factory.library.request.SearchRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException; |
import com.fasterxml.jackson.core.JsonProcessingException; |
||||||
import com.fasterxml.jackson.databind.ObjectMapper; |
import com.fasterxml.jackson.databind.ObjectMapper; |
||||||
|
|
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.core.request.factory.library.request; |
package cn.wustlinghang.mywust.core.request.factory.library.request; |
||||||
|
|
||||||
import lombok.Data; |
import lombok.Data; |
||||||
|
|
@ -1,10 +1,10 @@ |
|||||||
package cn.linghang.mywust.core.request.factory.physics; |
package cn.wustlinghang.mywust.core.request.factory.physics; |
||||||
|
|
||||||
import cn.linghang.mywust.core.api.PhysicsSystemUrls; |
import cn.wustlinghang.mywust.core.api.PhysicsSystemUrls; |
||||||
import cn.linghang.mywust.core.request.factory.RequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.RequestFactory; |
||||||
import cn.linghang.mywust.core.util.PageFormExtractor; |
import cn.wustlinghang.mywust.core.util.PageFormExtractor; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.util.StringUtil; |
import cn.wustlinghang.mywust.util.StringUtil; |
||||||
|
|
||||||
import java.util.HashMap; |
import java.util.HashMap; |
||||||
import java.util.Map; |
import java.util.Map; |
@ -1,17 +1,16 @@ |
|||||||
package cn.linghang.mywust.core.request.factory.undergrade; |
package cn.wustlinghang.mywust.core.request.factory.undergrade; |
||||||
|
|
||||||
import cn.linghang.mywust.core.api.UndergradUrls; |
import cn.wustlinghang.mywust.core.api.UndergradUrls; |
||||||
import cn.linghang.mywust.core.request.factory.RequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.RequestFactory; |
||||||
import cn.linghang.mywust.data.global.Campus; |
import cn.wustlinghang.mywust.data.global.Campus; |
||||||
import cn.linghang.mywust.network.entitys.FormBodyBuilder; |
import cn.wustlinghang.mywust.network.entitys.FormBodyBuilder; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.util.StringUtil; |
import cn.wustlinghang.mywust.util.StringUtil; |
||||||
|
|
||||||
import java.nio.charset.StandardCharsets; |
import java.nio.charset.StandardCharsets; |
||||||
import java.util.HashMap; |
import java.util.HashMap; |
||||||
import java.util.Map; |
import java.util.Map; |
||||||
import java.util.Set; |
import java.util.Set; |
||||||
import java.util.TreeMap; |
|
||||||
|
|
||||||
public class BkjxRequestFactory extends RequestFactory { |
public class BkjxRequestFactory extends RequestFactory { |
||||||
public static HttpRequest sessionCookieRequest(String serviceTicket) { |
public static HttpRequest sessionCookieRequest(String serviceTicket) { |
@ -1,13 +1,13 @@ |
|||||||
package cn.linghang.mywust.core.request.service.auth; |
package cn.wustlinghang.mywust.core.request.service.auth; |
||||||
|
|
||||||
import cn.linghang.mywust.core.api.LibraryUrls; |
import cn.wustlinghang.mywust.core.api.LibraryUrls; |
||||||
import cn.linghang.mywust.core.api.UnionAuthUrls; |
import cn.wustlinghang.mywust.core.api.UnionAuthUrls; |
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.core.request.factory.library.LibraryRequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.library.LibraryRequestFactory; |
||||||
import cn.linghang.mywust.network.RequestClientOption; |
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
|
|
||||||
import java.io.IOException; |
import java.io.IOException; |
||||||
|
|
@ -1,14 +1,14 @@ |
|||||||
package cn.linghang.mywust.core.request.service.auth; |
package cn.wustlinghang.mywust.core.request.service.auth; |
||||||
|
|
||||||
import cn.linghang.mywust.core.api.UndergradUrls; |
import cn.wustlinghang.mywust.core.api.UndergradUrls; |
||||||
import cn.linghang.mywust.core.api.UnionAuthUrls; |
import cn.wustlinghang.mywust.core.api.UnionAuthUrls; |
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.core.request.factory.undergrade.BkjxRequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.undergrade.BkjxRequestFactory; |
||||||
import cn.linghang.mywust.network.RequestClientOption; |
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
import cn.linghang.mywust.util.PasswordEncoder; |
import cn.wustlinghang.mywust.util.PasswordEncoder; |
||||||
import org.slf4j.Logger; |
import org.slf4j.Logger; |
||||||
import org.slf4j.LoggerFactory; |
import org.slf4j.LoggerFactory; |
||||||
|
|
@ -1,12 +1,12 @@ |
|||||||
package cn.linghang.mywust.core.request.service.auth; |
package cn.wustlinghang.mywust.core.request.service.auth; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.core.request.factory.auth.UnionAuthRequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.auth.UnionAuthRequestFactory; |
||||||
import cn.linghang.mywust.network.RequestClientOption; |
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
import cn.linghang.mywust.util.PasswordEncoder; |
import cn.wustlinghang.mywust.util.PasswordEncoder; |
||||||
import com.fasterxml.jackson.databind.ObjectMapper; |
import com.fasterxml.jackson.databind.ObjectMapper; |
||||||
import org.slf4j.Logger; |
import org.slf4j.Logger; |
||||||
import org.slf4j.LoggerFactory; |
import org.slf4j.LoggerFactory; |
@ -0,0 +1,9 @@ |
|||||||
|
package cn.wustlinghang.mywust.core.request.service.captcha.solver; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.captcha.SolvedImageCaptcha; |
||||||
|
import cn.wustlinghang.mywust.captcha.UnsolvedImageCaptcha; |
||||||
|
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
|
|
||||||
|
public interface CaptchaSolver { |
||||||
|
SolvedImageCaptcha solve(UnsolvedImageCaptcha unsolvedImageCaptcha) throws ApiException; |
||||||
|
} |
@ -1,12 +1,12 @@ |
|||||||
package cn.linghang.mywust.core.request.service.captcha.solver; |
package cn.wustlinghang.mywust.core.request.service.captcha.solver; |
||||||
|
|
||||||
import cn.linghang.mywust.captcha.SolvedImageCaptcha; |
import cn.wustlinghang.mywust.captcha.SolvedImageCaptcha; |
||||||
import cn.linghang.mywust.captcha.UnsolvedImageCaptcha; |
import cn.wustlinghang.mywust.captcha.UnsolvedImageCaptcha; |
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.core.request.factory.RequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.RequestFactory; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
|
|
||||||
import java.io.IOException; |
import java.io.IOException; |
||||||
import java.util.Base64; |
import java.util.Base64; |
@ -1,14 +1,14 @@ |
|||||||
package cn.linghang.mywust.core.request.service.captcha.solver; |
package cn.wustlinghang.mywust.core.request.service.captcha.solver; |
||||||
|
|
||||||
import cn.linghang.mywust.captcha.SolvedImageCaptcha; |
import cn.wustlinghang.mywust.captcha.SolvedImageCaptcha; |
||||||
import cn.linghang.mywust.captcha.UnsolvedImageCaptcha; |
import cn.wustlinghang.mywust.captcha.UnsolvedImageCaptcha; |
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.core.request.factory.RequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.RequestFactory; |
||||||
import cn.linghang.mywust.network.RequestClientOption; |
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
import cn.linghang.mywust.util.StringUtil; |
import cn.wustlinghang.mywust.util.StringUtil; |
||||||
import com.fasterxml.jackson.databind.ObjectMapper; |
import com.fasterxml.jackson.databind.ObjectMapper; |
||||||
import org.apache.commons.codec.binary.Base64; |
import org.apache.commons.codec.binary.Base64; |
||||||
|
|
@ -1,12 +1,12 @@ |
|||||||
package cn.linghang.mywust.core.request.service.graduate; |
package cn.wustlinghang.mywust.core.request.service.graduate; |
||||||
|
|
||||||
import cn.linghang.mywust.core.api.GraduateUrls; |
import cn.wustlinghang.mywust.core.api.GraduateUrls; |
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.core.request.factory.RequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.RequestFactory; |
||||||
import cn.linghang.mywust.network.RequestClientOption; |
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
|
|
||||||
import java.io.IOException; |
import java.io.IOException; |
||||||
|
|
@ -1,10 +1,10 @@ |
|||||||
package cn.linghang.mywust.core.request.service.library; |
package cn.wustlinghang.mywust.core.request.service.library; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.core.request.factory.library.LibraryRequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.library.LibraryRequestFactory; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
|
|
||||||
import java.io.IOException; |
import java.io.IOException; |
||||||
|
|
@ -1,8 +1,8 @@ |
|||||||
package cn.linghang.mywust.core.request.service.library; |
package cn.wustlinghang.mywust.core.request.service.library; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
|
|
||||||
public abstract class LibraryApiServiceBase { |
public abstract class LibraryApiServiceBase { |
||||||
protected final Requester requester; |
protected final Requester requester; |
@ -1,8 +1,8 @@ |
|||||||
package cn.linghang.mywust.core.request.service.physics; |
package cn.wustlinghang.mywust.core.request.service.physics; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
|
|
||||||
public abstract class PhysicsApiServiceBase { |
public abstract class PhysicsApiServiceBase { |
||||||
protected final Requester requester; |
protected final Requester requester; |
@ -1,14 +1,14 @@ |
|||||||
package cn.linghang.mywust.core.request.service.physics; |
package cn.wustlinghang.mywust.core.request.service.physics; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.physics.PhysicsScoreListPageParser; |
import cn.wustlinghang.mywust.core.parser.physics.PhysicsScoreListPageParser; |
||||||
import cn.linghang.mywust.core.request.factory.physics.PhysicsSystemRequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.physics.PhysicsSystemRequestFactory; |
||||||
import cn.linghang.mywust.core.util.PageFormExtractor; |
import cn.wustlinghang.mywust.core.util.PageFormExtractor; |
||||||
import cn.linghang.mywust.network.RequestClientOption; |
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
|
|
||||||
import java.io.IOException; |
import java.io.IOException; |
||||||
import java.util.ArrayList; |
import java.util.ArrayList; |
@ -1,13 +1,13 @@ |
|||||||
package cn.linghang.mywust.core.request.service.undergraduate; |
package cn.wustlinghang.mywust.core.request.service.undergraduate; |
||||||
|
|
||||||
import cn.linghang.mywust.core.api.UndergradUrls; |
import cn.wustlinghang.mywust.core.api.UndergradUrls; |
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.core.request.factory.RequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.RequestFactory; |
||||||
import cn.linghang.mywust.core.util.BkjxUtil; |
import cn.wustlinghang.mywust.core.util.BkjxUtil; |
||||||
import cn.linghang.mywust.network.RequestClientOption; |
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
|
|
||||||
import java.io.IOException; |
import java.io.IOException; |
||||||
import java.util.Map; |
import java.util.Map; |
@ -1,13 +1,13 @@ |
|||||||
package cn.linghang.mywust.core.request.service.undergraduate; |
package cn.wustlinghang.mywust.core.request.service.undergraduate; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.exception.ParseException; |
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
import cn.linghang.mywust.core.parser.undergraduate.UndergradCreditStatusIndexParser; |
import cn.wustlinghang.mywust.core.parser.undergraduate.UndergradCreditStatusIndexParser; |
||||||
import cn.linghang.mywust.core.request.factory.undergrade.BkjxRequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.undergrade.BkjxRequestFactory; |
||||||
import cn.linghang.mywust.network.RequestClientOption; |
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
|
|
||||||
import java.io.IOException; |
import java.io.IOException; |
||||||
import java.util.Map; |
import java.util.Map; |
@ -1,11 +1,11 @@ |
|||||||
package cn.linghang.mywust.core.request.service.undergraduate; |
package cn.wustlinghang.mywust.core.request.service.undergraduate; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.core.request.factory.undergrade.BkjxRequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.undergrade.BkjxRequestFactory; |
||||||
import cn.linghang.mywust.network.RequestClientOption; |
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
import com.fasterxml.jackson.annotation.JsonProperty; |
import com.fasterxml.jackson.annotation.JsonProperty; |
||||||
import com.fasterxml.jackson.databind.ObjectMapper; |
import com.fasterxml.jackson.databind.ObjectMapper; |
||||||
import lombok.AllArgsConstructor; |
import lombok.AllArgsConstructor; |
@ -1,12 +1,12 @@ |
|||||||
package cn.linghang.mywust.core.request.service.undergraduate.global; |
package cn.wustlinghang.mywust.core.request.service.undergraduate.global; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.core.request.factory.undergrade.global.BkjxAllCourseRequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.undergrade.global.BkjxAllCourseRequestFactory; |
||||||
import cn.linghang.mywust.core.request.service.undergraduate.UndergradApiServiceBase; |
import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradApiServiceBase; |
||||||
import cn.linghang.mywust.network.RequestClientOption; |
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
|
|
||||||
import java.io.IOException; |
import java.io.IOException; |
||||||
import java.util.Map; |
import java.util.Map; |
@ -1,15 +1,15 @@ |
|||||||
package cn.linghang.mywust.core.request.service.undergraduate.global; |
package cn.wustlinghang.mywust.core.request.service.undergraduate.global; |
||||||
|
|
||||||
import cn.linghang.mywust.core.api.ConstantParams; |
import cn.wustlinghang.mywust.core.api.ConstantParams; |
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.core.request.factory.undergrade.BkjxRequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.undergrade.BkjxRequestFactory; |
||||||
import cn.linghang.mywust.core.request.service.undergraduate.UndergradApiServiceBase; |
import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradApiServiceBase; |
||||||
import cn.linghang.mywust.data.global.Building; |
import cn.wustlinghang.mywust.data.global.Building; |
||||||
import cn.linghang.mywust.data.global.Campus; |
import cn.wustlinghang.mywust.data.global.Campus; |
||||||
import cn.linghang.mywust.network.RequestClientOption; |
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
import com.fasterxml.jackson.databind.JsonNode; |
import com.fasterxml.jackson.databind.JsonNode; |
||||||
import com.fasterxml.jackson.databind.ObjectMapper; |
import com.fasterxml.jackson.databind.ObjectMapper; |
||||||
|
|
@ -1,12 +1,12 @@ |
|||||||
package cn.linghang.mywust.core.request.service.undergraduate.global; |
package cn.wustlinghang.mywust.core.request.service.undergraduate.global; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.core.request.factory.undergrade.global.BkjxAllCourseRequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.undergrade.global.BkjxAllCourseRequestFactory; |
||||||
import cn.linghang.mywust.core.request.service.undergraduate.UndergradApiServiceBase; |
import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradApiServiceBase; |
||||||
import cn.linghang.mywust.network.RequestClientOption; |
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
|
|
||||||
import java.io.IOException; |
import java.io.IOException; |
||||||
import java.util.Map; |
import java.util.Map; |
@ -1,12 +1,12 @@ |
|||||||
package cn.linghang.mywust.core.request.service.undergraduate.global; |
package cn.wustlinghang.mywust.core.request.service.undergraduate.global; |
||||||
|
|
||||||
import cn.linghang.mywust.exception.ApiException; |
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
import cn.linghang.mywust.core.request.factory.undergrade.global.BkjxAllCourseRequestFactory; |
import cn.wustlinghang.mywust.core.request.factory.undergrade.global.BkjxAllCourseRequestFactory; |
||||||
import cn.linghang.mywust.core.request.service.undergraduate.UndergradApiServiceBase; |
import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradApiServiceBase; |
||||||
import cn.linghang.mywust.network.RequestClientOption; |
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
import cn.linghang.mywust.network.Requester; |
import cn.wustlinghang.mywust.network.Requester; |
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
|
|
||||||
import java.io.IOException; |
import java.io.IOException; |
||||||
import java.util.Map; |
import java.util.Map; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.core.util; |
package cn.wustlinghang.mywust.core.util; |
||||||
|
|
||||||
import java.nio.charset.StandardCharsets; |
import java.nio.charset.StandardCharsets; |
||||||
|
|
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.core.util; |
package cn.wustlinghang.mywust.core.util; |
||||||
|
|
||||||
import org.jsoup.nodes.Element; |
import org.jsoup.nodes.Element; |
||||||
import org.jsoup.select.Elements; |
import org.jsoup.select.Elements; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.core.util; |
package cn.wustlinghang.mywust.core.util; |
||||||
|
|
||||||
import org.jsoup.Jsoup; |
import org.jsoup.Jsoup; |
||||||
import org.jsoup.nodes.Document; |
import org.jsoup.nodes.Document; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.network.okhttp; |
package cn.wustlinghang.mywust.network.okhttp; |
||||||
|
|
||||||
import okhttp3.Interceptor; |
import okhttp3.Interceptor; |
||||||
import okhttp3.Response; |
import okhttp3.Response; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.network.okhttp; |
package cn.wustlinghang.mywust.network.okhttp; |
||||||
|
|
||||||
import javax.net.ssl.*; |
import javax.net.ssl.*; |
||||||
import java.security.KeyStore; |
import java.security.KeyStore; |
@ -1,7 +1,7 @@ |
|||||||
package cn.linghang.mywust.network; |
package cn.wustlinghang.mywust.network; |
||||||
|
|
||||||
import cn.linghang.mywust.network.entitys.HttpRequest; |
import cn.wustlinghang.mywust.network.entitys.HttpRequest; |
||||||
import cn.linghang.mywust.network.entitys.HttpResponse; |
import cn.wustlinghang.mywust.network.entitys.HttpResponse; |
||||||
|
|
||||||
import java.io.IOException; |
import java.io.IOException; |
||||||
|
|
@ -1,7 +1,7 @@ |
|||||||
package cn.linghang.mywust.network.entitys; |
package cn.wustlinghang.mywust.network.entitys; |
||||||
|
|
||||||
import cn.linghang.mywust.util.RepeatableComparator; |
import cn.wustlinghang.mywust.util.RepeatableComparator; |
||||||
import cn.linghang.mywust.util.StringUtil; |
import cn.wustlinghang.mywust.util.StringUtil; |
||||||
|
|
||||||
import java.util.Comparator; |
import java.util.Comparator; |
||||||
import java.util.HashMap; |
import java.util.HashMap; |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.network.entitys; |
package cn.wustlinghang.mywust.network.entitys; |
||||||
|
|
||||||
import lombok.Builder; |
import lombok.Builder; |
||||||
import lombok.Data; |
import lombok.Data; |
@ -1,137 +1,137 @@ |
|||||||
package cn.linghang.mywust.util; |
package cn.wustlinghang.mywust.util; |
||||||
|
|
||||||
|
|
||||||
import org.apache.commons.codec.binary.Hex; |
import org.apache.commons.codec.binary.Hex; |
||||||
|
|
||||||
import javax.crypto.BadPaddingException; |
import javax.crypto.BadPaddingException; |
||||||
import javax.crypto.Cipher; |
import javax.crypto.Cipher; |
||||||
import javax.crypto.IllegalBlockSizeException; |
import javax.crypto.IllegalBlockSizeException; |
||||||
import javax.crypto.NoSuchPaddingException; |
import javax.crypto.NoSuchPaddingException; |
||||||
import java.math.BigInteger; |
import java.math.BigInteger; |
||||||
import java.nio.charset.StandardCharsets; |
import java.nio.charset.StandardCharsets; |
||||||
import java.security.InvalidKeyException; |
import java.security.InvalidKeyException; |
||||||
import java.security.KeyFactory; |
import java.security.KeyFactory; |
||||||
import java.security.NoSuchAlgorithmException; |
import java.security.NoSuchAlgorithmException; |
||||||
import java.security.interfaces.RSAPublicKey; |
import java.security.interfaces.RSAPublicKey; |
||||||
import java.security.spec.InvalidKeySpecException; |
import java.security.spec.InvalidKeySpecException; |
||||||
import java.security.spec.RSAPublicKeySpec; |
import java.security.spec.RSAPublicKeySpec; |
||||||
|
|
||||||
import static java.lang.Integer.parseInt; |
import static java.lang.Integer.parseInt; |
||||||
|
|
||||||
/** |
/** |
||||||
* <h>密码加密工具类</h> |
* <h>密码加密工具类</h> |
||||||
* |
* |
||||||
* <p>使用统一登陆的加密方法对密码进行加密的工具类</p> |
* <p>使用统一登陆的加密方法对密码进行加密的工具类</p> |
||||||
* <p>研究发现统一认证登录对密码的加密方式只是简单的RSA NoPadding加密(虽然但是,貌似私钥也放在前端了...)</p> |
* <p>研究发现统一认证登录对密码的加密方式只是简单的RSA NoPadding加密(虽然但是,貌似私钥也放在前端了...)</p> |
||||||
* <p>加密过程大概如下:</p> |
* <p>加密过程大概如下:</p> |
||||||
* <p>- 通过modulus模数和exponent指数生成rsa公钥</p> |
* <p>- 通过modulus模数和exponent指数生成rsa公钥</p> |
||||||
* <p>- 将明文反转后用上面生成的公钥进行RSA加密,明文填充使用NoPadding填充(0填充)</p> |
* <p>- 将明文反转后用上面生成的公钥进行RSA加密,明文填充使用NoPadding填充(0填充)</p> |
||||||
* <p>- 将生成的字节数组转换成16进制字符串,得到加密后的数据</p> |
* <p>- 将生成的字节数组转换成16进制字符串,得到加密后的数据</p> |
||||||
* <br> |
* <br> |
||||||
* <p>希望不要再改登录方式了 [拜] </p> |
* <p>希望不要再改登录方式了 [拜] </p> |
||||||
* |
* |
||||||
* @author : lensfrex |
* @author : lensfrex |
||||||
* @description : 使用统一登陆的加密方法对密码进行加密的工具类 |
* @description : 使用统一登陆的加密方法对密码进行加密的工具类 |
||||||
* @create : 2022-09-18 14:42:06 |
* @create : 2022-09-18 14:42:06 |
||||||
* @edit : 2022-10-14 14:42:06 |
* @edit : 2022-10-14 14:42:06 |
||||||
*/ |
*/ |
||||||
public class PasswordEncoder { |
public class PasswordEncoder { |
||||||
private static final String MODULUS = "b5eeb166e069920e80bebd1fea4829d3d1f3216f2aabe79b6c47a3c18dcee5fd22c2e7ac519cab59198ece036dcf289ea8201e2a0b9ded307f8fb704136eaeb670286f5ad44e691005ba9ea5af04ada5367cd724b5a26fdb5120cc95b6431604bd219c6b7d83a6f8f24b43918ea988a76f93c333aa5a20991493d4eb1117e7b1"; |
private static final String MODULUS = "b5eeb166e069920e80bebd1fea4829d3d1f3216f2aabe79b6c47a3c18dcee5fd22c2e7ac519cab59198ece036dcf289ea8201e2a0b9ded307f8fb704136eaeb670286f5ad44e691005ba9ea5af04ada5367cd724b5a26fdb5120cc95b6431604bd219c6b7d83a6f8f24b43918ea988a76f93c333aa5a20991493d4eb1117e7b1"; |
||||||
private static final String EXPONENT = "10001"; |
private static final String EXPONENT = "10001"; |
||||||
|
|
||||||
private static final RSAPublicKey PUBLIC_KEY = PasswordEncoder.generatePublicKey(); |
private static final RSAPublicKey PUBLIC_KEY = PasswordEncoder.generatePublicKey(); |
||||||
|
|
||||||
private static Cipher cipher; |
private static Cipher cipher; |
||||||
|
|
||||||
// 单例加密/解密器
|
// 单例加密/解密器
|
||||||
static { |
static { |
||||||
try { |
try { |
||||||
cipher = Cipher.getInstance("RSA/ECB/NoPadding"); |
cipher = Cipher.getInstance("RSA/ECB/NoPadding"); |
||||||
cipher.init(Cipher.ENCRYPT_MODE, PUBLIC_KEY); |
cipher.init(Cipher.ENCRYPT_MODE, PUBLIC_KEY); |
||||||
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException e) { |
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException e) { |
||||||
// 会报错的地方都是因为算法不正确,这里都是固定的值,出错了就是程序写错了,在测试的时候就应该发现的问题
|
// 会报错的地方都是因为算法不正确,这里都是固定的值,出错了就是程序写错了,在测试的时候就应该发现的问题
|
||||||
// 对于调用者不必处理这种异常,但是开发测试的时候应该要打日志来发现问题
|
// 对于调用者不必处理这种异常,但是开发测试的时候应该要打日志来发现问题
|
||||||
System.err.println("加密出错"); |
System.err.println("加密出错"); |
||||||
e.printStackTrace(); |
e.printStackTrace(); |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
/** |
/** |
||||||
* 按照统一登陆的加密方法,加密密码 |
* 按照统一登陆的加密方法,加密密码 |
||||||
* |
* |
||||||
* @param password 密码明文 |
* @param password 密码明文 |
||||||
* @return 加密后的密码(小写) |
* @return 加密后的密码(小写) |
||||||
*/ |
*/ |
||||||
public static String encodePassword(String password) { |
public static String encodePassword(String password) { |
||||||
try { |
try { |
||||||
// 反转明文
|
// 反转明文
|
||||||
byte[] reversedTextData = new StringBuffer(password) |
byte[] reversedTextData = new StringBuffer(password) |
||||||
.reverse() |
.reverse() |
||||||
.toString() |
.toString() |
||||||
.getBytes(StandardCharsets.UTF_8); |
.getBytes(StandardCharsets.UTF_8); |
||||||
|
|
||||||
// 完成加密
|
// 完成加密
|
||||||
return Hex.encodeHexString(cipher.doFinal(reversedTextData)); |
return Hex.encodeHexString(cipher.doFinal(reversedTextData)); |
||||||
} catch (IllegalBlockSizeException | BadPaddingException e) { |
} catch (IllegalBlockSizeException | BadPaddingException e) { |
||||||
// 会报错的地方都是因为算法不正确,这里都是固定的值,出错了就是程序写错了,在测试的时候就应该发现的问题
|
// 会报错的地方都是因为算法不正确,这里都是固定的值,出错了就是程序写错了,在测试的时候就应该发现的问题
|
||||||
// 对于调用者不必处理这种异常,但是开发测试的时候应该要打日志来发现问题
|
// 对于调用者不必处理这种异常,但是开发测试的时候应该要打日志来发现问题
|
||||||
System.err.println("加密出错"); |
System.err.println("加密出错"); |
||||||
e.printStackTrace(); |
e.printStackTrace(); |
||||||
} |
} |
||||||
|
|
||||||
return ""; |
return ""; |
||||||
} |
} |
||||||
|
|
||||||
/** |
/** |
||||||
* 使用modulus模数和exponent指数生成rsa公钥 |
* 使用modulus模数和exponent指数生成rsa公钥 |
||||||
* |
* |
||||||
* @return 公钥 |
* @return 公钥 |
||||||
*/ |
*/ |
||||||
private static RSAPublicKey generatePublicKey() { |
private static RSAPublicKey generatePublicKey() { |
||||||
try { |
try { |
||||||
BigInteger mod = new BigInteger(PasswordEncoder.MODULUS, 16); |
BigInteger mod = new BigInteger(PasswordEncoder.MODULUS, 16); |
||||||
BigInteger exp = new BigInteger(PasswordEncoder.EXPONENT, 16); |
BigInteger exp = new BigInteger(PasswordEncoder.EXPONENT, 16); |
||||||
|
|
||||||
RSAPublicKeySpec keySpec = new RSAPublicKeySpec(mod, exp); |
RSAPublicKeySpec keySpec = new RSAPublicKeySpec(mod, exp); |
||||||
|
|
||||||
return (RSAPublicKey) KeyFactory.getInstance("RSA").generatePublic(keySpec); |
return (RSAPublicKey) KeyFactory.getInstance("RSA").generatePublic(keySpec); |
||||||
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) { |
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) { |
||||||
// 会报错的地方都是因为算法不正确,这里都是固定的值,出错了就是程序写错了,在测试的时候就应该发现的问题
|
// 会报错的地方都是因为算法不正确,这里都是固定的值,出错了就是程序写错了,在测试的时候就应该发现的问题
|
||||||
// 对于调用者不必处理这种异常,但是开发测试的时候应该要打日志来发现问题
|
// 对于调用者不必处理这种异常,但是开发测试的时候应该要打日志来发现问题
|
||||||
System.err.println("生成公钥出错"); |
System.err.println("生成公钥出错"); |
||||||
e.printStackTrace(); |
e.printStackTrace(); |
||||||
} |
} |
||||||
|
|
||||||
return null; |
return null; |
||||||
} |
} |
||||||
|
|
||||||
/** |
/** |
||||||
* <p>使用旧版登录页的方法加密密码(bkjx系统直接登录)</p> |
* <p>使用旧版登录页的方法加密密码(bkjx系统直接登录)</p> |
||||||
* <p>是直接照搬官网js代码的,只是经过了一点小修改,没有具体研究是什么加密方式(大概率可能是自创的),性能可能会有点差</p> |
* <p>是直接照搬官网js代码的,只是经过了一点小修改,没有具体研究是什么加密方式(大概率可能是自创的),性能可能会有点差</p> |
||||||
* |
* |
||||||
* @param dataString 加密前置字符串 |
* @param dataString 加密前置字符串 |
||||||
* @param password 密码明文 |
* @param password 密码明文 |
||||||
* @return 加密后的密文 |
* @return 加密后的密文 |
||||||
*/ |
*/ |
||||||
public static String legacyPassword(String username, String password, String dataString) { |
public static String legacyPassword(String username, String password, String dataString) { |
||||||
String[] parts = dataString.split("#"); |
String[] parts = dataString.split("#"); |
||||||
StringBuilder scode = new StringBuilder(parts[0]); |
StringBuilder scode = new StringBuilder(parts[0]); |
||||||
String sxh = parts[1]; |
String sxh = parts[1]; |
||||||
|
|
||||||
String code = username + "%%%" + password; |
String code = username + "%%%" + password; |
||||||
|
|
||||||
StringBuilder encoded = new StringBuilder(); |
StringBuilder encoded = new StringBuilder(); |
||||||
for (int i = 0, codeLength = code.length(); i < codeLength; i++) { |
for (int i = 0, codeLength = code.length(); i < codeLength; i++) { |
||||||
if (i < 20) { |
if (i < 20) { |
||||||
int index = sxh.charAt(i) - 48; |
int index = sxh.charAt(i) - 48; |
||||||
encoded.append(code.charAt(i)).append(scode, 0, index); |
encoded.append(code.charAt(i)).append(scode, 0, index); |
||||||
scode.delete(0, index); |
scode.delete(0, index); |
||||||
} else { |
} else { |
||||||
encoded.append(code, i, codeLength); |
encoded.append(code, i, codeLength); |
||||||
i = codeLength; |
i = codeLength; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
return encoded.toString(); |
return encoded.toString(); |
||||||
} |
} |
||||||
} |
} |
@ -1,4 +1,4 @@ |
|||||||
package cn.linghang.mywust.util; |
package cn.wustlinghang.mywust.util; |
||||||
|
|
||||||
import java.util.Comparator; |
import java.util.Comparator; |
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue