Skip to content

Commit

Permalink
1.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoeMeow1027 committed Sep 6, 2024
1 parent 204328e commit b87eb31
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
# DUTWRAPPER CHANGE LOG

This file will list all version log for modified, added or removed functions of dutwrapper (Java language).
This file will list all version log for modified, added or removed functions of dutwrapper wiht Java language.

## 1.11.1
- [Fixed] Fixed issue cause duplicate re-study subject results.
- [Changed] Property `id` in `AccountInformation.SubjectResult` changed from ~~`String`~~ to `AccountInformation.SubjectCode`.

## 1.11.0
- Merge all class in `model` package to `AccountInformation` class.
- Moving `Account` class functions to `Accounts` class and this will return each data type in `AccountInformation` class.
- Change some properties in `AccountInfrormation` class (merged from whole class in `model` package). You'll need to modify your code to working again.
- Optimize codes.
- [Changed] Merge all class in `model` package to `AccountInformation` class.
- [Changed] Moving `Account` class functions to `Accounts` class and this will return each data type in `AccountInformation` class.
- [Changed] Change some properties in `AccountInfrormation` class (merged from whole class in `model` package). You'll need to modify your code to working again.
- [Implemented] Optimize codes.

## 1.10.2
- Merge all class related to News into once.
- Merge all class related to Utils into once.
- SetPrintStackTrace in HttpClientWrapper has been moved to `Variables` class.
- Updated Gradle to 8.9 and all dependencies to latest.
- [Changed] Merge all class related to News into once.
- [Changed] Merge all class related to Utils into once.
- [Changed] SetPrintStackTrace in HttpClientWrapper has been moved to `Variables` class.
- [Implemented] Updated Gradle to 8.9 and all dependencies to latest.

## 1.10.1
- [New] We're trying to sync properties serialize name between Java, Net, Python.
- [Changed] Updated dependencies to latest.
- [Changed] Removed `NewsGlobalGroupByDate` and `NewsSubjectGroupByDate`.
- [Fixed] `java.net.UnknownHostException` was thrown even you include them in try-catch.
- [Removed] Removed `NewsGlobalGroupByDate`.

## 1.10.0
- `Account.Session` class is now in part of Account class.
Expand Down
27 changes: 18 additions & 9 deletions src/main/java/io/dutwrapper/dutwrapper/AccountInformation.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,20 @@ public void setEnd(@Nonnull Integer end) {
public static class SubjectCode implements Serializable {
// Area 1
@SerializedName("subject_id")
private @Nullable String subjectId = null;
private @Nullable String subjectId;
// Area 2
@SerializedName("school_year_id")
private @Nullable String schoolYearId = null;
private @Nullable String schoolYearId;
// Area 3
@SerializedName("student_year_id")
private String studentYearId = "";
private String studentYearId;
// Area 4
@SerializedName("class_id")
private String classId = "";
private String classId;

public SubjectCode(String studentYearId, String classId) {
this.subjectId = null;
this.schoolYearId = null;
this.studentYearId = studentYearId;
this.classId = classId;
}
Expand All @@ -71,8 +73,15 @@ public SubjectCode(String input) {
this.studentYearId = input.split("\\.")[2];
this.classId = input.split("\\.")[3];
} else if (input.split("\\.").length == 2) {
this.subjectId = null;
this.schoolYearId = null;
this.studentYearId = input.split("\\.")[0];
this.classId = input.split("\\.")[1];
} else {
this.subjectId = null;
this.schoolYearId = null;
this.studentYearId = "-";
this.classId = "-";
}
}

Expand Down Expand Up @@ -110,7 +119,7 @@ public void setClassId(String classId) {

@Override
public String toString() {
return toString(true);
return toString(subjectId == null || schoolYearId == null);
}

public String toString(Boolean twoLastDigitOnly) {
Expand Down Expand Up @@ -1037,7 +1046,7 @@ public static class SubjectResult implements Serializable {
@SerializedName("is_extended_summer")
private Boolean isExtendedSemester;
@SerializedName("id")
private String id;
private SubjectCode id;
@SerializedName("name")
private String name;
@SerializedName("credit")
Expand Down Expand Up @@ -1069,7 +1078,7 @@ public static class SubjectResult implements Serializable {
@SerializedName("is_restudy")
private Boolean isReStudy;

public SubjectResult(Integer index, String schoolYear, Boolean isExtendedSemester, String id, String name,
public SubjectResult(Integer index, String schoolYear, Boolean isExtendedSemester, SubjectCode id, String name,
Double credit, @Nullable String pointFormula, @Nullable Double pointBT, @Nullable Double pointBV, @Nullable Double pointCC, @Nullable Double pointCK,
@Nullable Double pointGK, @Nullable Double pointQT, @Nullable Double pointTH, @Nullable Double pointTT, @Nullable Double resultT10, @Nullable Double resultT4, @Nullable String resultByChar,
Boolean isReStudy) {
Expand Down Expand Up @@ -1118,11 +1127,11 @@ public void setIsExtendedSemester(Boolean isExtendedSemester) {
this.isExtendedSemester = isExtendedSemester;
}

public String getId() {
public SubjectCode getId() {
return id;
}

public void setId(String id) {
public void setId(SubjectCode id) {
this.id = id;
}

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/io/dutwrapper/dutwrapper/Accounts.java
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ public static AccountInformation.TrainingStatus fetchTrainingStatus(@Nonnull Ses
Integer.parseInt(cellList.get(0).text()),
cellList.get(1).text(),
cellList.get(2).hasClass("GridCheck"),
cellList.get(3).text(),
new AccountInformation.SubjectCode(cellList.get(3).text()),
cellList.get(4).text(),
Utils.jsoupExtraUtils.elementToDoubleOrNull(cellList.get(5)),
cellList.get(6).text().isEmpty() ? null : cellList.get(6).text(),
Expand All @@ -619,7 +619,8 @@ public static AccountInformation.TrainingStatus fetchTrainingStatus(@Nonnull Ses
Utils.jsoupExtraUtils.elementToDoubleOrNull(cellList.get(15)),
Utils.jsoupExtraUtils.elementToDoubleOrNull(cellList.get(16)),
cellList.get(17).text(),
accSubjectResult.stream().anyMatch(p -> p.getName().contains(cellList.get(4).text())));
accSubjectResult.stream().anyMatch(p -> p.getId().getSubjectId().compareTo(new AccountInformation.SubjectCode(cellList.get(3).text()).getSubjectId() != null ? (new AccountInformation.SubjectCode(cellList.get(3).text()).getSubjectId()) : "") == 0)
);

accSubjectResult.add(item);
}
Expand Down

0 comments on commit b87eb31

Please sign in to comment.