commit
006286da0c
@ -0,0 +1,42 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>wusthelper-backend</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<packaging>pom</packaging> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>jakarta.annotation</groupId> |
||||||
|
<artifactId>jakarta.annotation-api</artifactId> |
||||||
|
<version>2.1.1</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>javax.annotation</groupId> |
||||||
|
<artifactId>javax.annotation-api</artifactId> |
||||||
|
<version>1.3.2</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.projectlombok</groupId> |
||||||
|
<artifactId>lombok</artifactId> |
||||||
|
<version>1.18.26</version> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>central</id> |
||||||
|
<url>https://repo1.maven.org/maven2</url> |
||||||
|
</repository> |
||||||
|
<repository> |
||||||
|
<snapshots> |
||||||
|
<enabled>true</enabled> |
||||||
|
</snapshots> |
||||||
|
<id>github</id> |
||||||
|
<url>https://maven.pkg.github.com/LingHangStudio/mywust</url> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
</project> |
@ -0,0 +1,38 @@ |
|||||||
|
target/ |
||||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||||
|
!**/src/main/**/target/ |
||||||
|
!**/src/test/**/target/ |
||||||
|
|
||||||
|
### IntelliJ IDEA ### |
||||||
|
.idea/modules.xml |
||||||
|
.idea/jarRepositories.xml |
||||||
|
.idea/compiler.xml |
||||||
|
.idea/libraries/ |
||||||
|
*.iws |
||||||
|
*.iml |
||||||
|
*.ipr |
||||||
|
|
||||||
|
### Eclipse ### |
||||||
|
.apt_generated |
||||||
|
.classpath |
||||||
|
.factorypath |
||||||
|
.project |
||||||
|
.settings |
||||||
|
.springBeans |
||||||
|
.sts4-cache |
||||||
|
|
||||||
|
### NetBeans ### |
||||||
|
/nbproject/private/ |
||||||
|
/nbbuild/ |
||||||
|
/dist/ |
||||||
|
/nbdist/ |
||||||
|
/.nb-gradle/ |
||||||
|
build/ |
||||||
|
!**/src/main/**/build/ |
||||||
|
!**/src/test/**/build/ |
||||||
|
|
||||||
|
### VS Code ### |
||||||
|
.vscode/ |
||||||
|
|
||||||
|
### Mac OS ### |
||||||
|
.DS_Store |
@ -0,0 +1,3 @@ |
|||||||
|
[submodule "external-library/mywust"] |
||||||
|
path = external-library/mywust |
||||||
|
url = https://github.com/LingHangStudio/mywust.git |
@ -0,0 +1,8 @@ |
|||||||
|
# Default ignored files |
||||||
|
/shelf/ |
||||||
|
/workspace.xml |
||||||
|
# Editor-based HTTP Client requests |
||||||
|
/httpRequests/ |
||||||
|
# Datasource local storage ignored files |
||||||
|
/dataSources/ |
||||||
|
/dataSources.local.xml |
@ -0,0 +1,42 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project version="4"> |
||||||
|
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8"> |
||||||
|
<file url="file://$PROJECT_DIR$/backend-main/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/backend-main/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/backend-main/web/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/backend-main/web/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/common/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/common/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-common/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-common/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-core/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-core/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-network-httpclient/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-network-httpclient/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-network-okhttp/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-network-okhttp/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-network/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-network/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-test/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-test/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-util/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-util/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/mywust/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/external-library/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/sub-services/graduate/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/sub-services/graduate/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/sub-services/library/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/sub-services/library/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/sub-services/physics/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/sub-services/physics/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/sub-services/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/sub-services/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/sub-services/undergrad/src/main/java" charset="UTF-8" /> |
||||||
|
<file url="file://$PROJECT_DIR$/sub-services/undergrad/src/main/resources" charset="UTF-8" /> |
||||||
|
<file url="PROJECT" charset="UTF-8" /> |
||||||
|
</component> |
||||||
|
</project> |
@ -0,0 +1,15 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project version="4"> |
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" /> |
||||||
|
<component name="MavenProjectsManager"> |
||||||
|
<option name="originalFiles"> |
||||||
|
<list> |
||||||
|
<option value="$PROJECT_DIR$/pom.xml" /> |
||||||
|
<option value="$PROJECT_DIR$/external-library/mywust/pom.xml" /> |
||||||
|
</list> |
||||||
|
</option> |
||||||
|
</component> |
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="graalvm-17" project-jdk-type="JavaSDK"> |
||||||
|
<output url="file://$PROJECT_DIR$/out" /> |
||||||
|
</component> |
||||||
|
</project> |
@ -0,0 +1,124 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project version="4"> |
||||||
|
<component name="Palette2"> |
||||||
|
<group name="Swing"> |
||||||
|
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> |
||||||
|
<initial-values> |
||||||
|
<property name="text" value="Button" /> |
||||||
|
</initial-values> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
||||||
|
<initial-values> |
||||||
|
<property name="text" value="RadioButton" /> |
||||||
|
</initial-values> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
||||||
|
<initial-values> |
||||||
|
<property name="text" value="CheckBox" /> |
||||||
|
</initial-values> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> |
||||||
|
<initial-values> |
||||||
|
<property name="text" value="Label" /> |
||||||
|
</initial-values> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||||
|
<preferred-size width="150" height="-1" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||||
|
<preferred-size width="150" height="-1" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||||
|
<preferred-size width="150" height="-1" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
||||||
|
<preferred-size width="200" height="200" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
||||||
|
<preferred-size width="200" height="200" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> |
||||||
|
<preferred-size width="-1" height="20" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> |
||||||
|
</item> |
||||||
|
</group> |
||||||
|
</component> |
||||||
|
</project> |
@ -0,0 +1,7 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project version="4"> |
||||||
|
<component name="VcsDirectoryMappings"> |
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" /> |
||||||
|
<mapping directory="$PROJECT_DIR$/external-library/mywust" vcs="Git" /> |
||||||
|
</component> |
||||||
|
</project> |
@ -0,0 +1,42 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>backend-main</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<packaging>pom</packaging> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>jakarta.annotation</groupId> |
||||||
|
<artifactId>jakarta.annotation-api</artifactId> |
||||||
|
<version>2.1.1</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>javax.annotation</groupId> |
||||||
|
<artifactId>javax.annotation-api</artifactId> |
||||||
|
<version>1.3.2</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.projectlombok</groupId> |
||||||
|
<artifactId>lombok</artifactId> |
||||||
|
<version>1.18.26</version> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>central</id> |
||||||
|
<url>https://repo1.maven.org/maven2</url> |
||||||
|
</repository> |
||||||
|
<repository> |
||||||
|
<snapshots> |
||||||
|
<enabled>true</enabled> |
||||||
|
</snapshots> |
||||||
|
<id>github</id> |
||||||
|
<url>https://maven.pkg.github.com/LingHangStudio/mywust</url> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
</project> |
@ -0,0 +1,38 @@ |
|||||||
|
target/ |
||||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||||
|
!**/src/main/**/target/ |
||||||
|
!**/src/test/**/target/ |
||||||
|
|
||||||
|
### IntelliJ IDEA ### |
||||||
|
.idea/modules.xml |
||||||
|
.idea/jarRepositories.xml |
||||||
|
.idea/compiler.xml |
||||||
|
.idea/libraries/ |
||||||
|
*.iws |
||||||
|
*.iml |
||||||
|
*.ipr |
||||||
|
|
||||||
|
### Eclipse ### |
||||||
|
.apt_generated |
||||||
|
.classpath |
||||||
|
.factorypath |
||||||
|
.project |
||||||
|
.settings |
||||||
|
.springBeans |
||||||
|
.sts4-cache |
||||||
|
|
||||||
|
### NetBeans ### |
||||||
|
/nbproject/private/ |
||||||
|
/nbbuild/ |
||||||
|
/dist/ |
||||||
|
/nbdist/ |
||||||
|
/.nb-gradle/ |
||||||
|
build/ |
||||||
|
!**/src/main/**/build/ |
||||||
|
!**/src/test/**/build/ |
||||||
|
|
||||||
|
### VS Code ### |
||||||
|
.vscode/ |
||||||
|
|
||||||
|
### Mac OS ### |
||||||
|
.DS_Store |
@ -0,0 +1,24 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<parent> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>wusthelper-backend</artifactId> |
||||||
|
<version>${revision}</version> |
||||||
|
</parent> |
||||||
|
|
||||||
|
<artifactId>backend-main</artifactId> |
||||||
|
<packaging>pom</packaging> |
||||||
|
<modules> |
||||||
|
<module>web</module> |
||||||
|
</modules> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
</properties> |
||||||
|
|
||||||
|
</project> |
@ -0,0 +1,7 @@ |
|||||||
|
package cn.wustlinghang; |
||||||
|
|
||||||
|
public class Main { |
||||||
|
public static void main(String[] args) { |
||||||
|
System.out.println("Hello world!"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,41 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>web</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>jakarta.annotation</groupId> |
||||||
|
<artifactId>jakarta.annotation-api</artifactId> |
||||||
|
<version>2.1.1</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>javax.annotation</groupId> |
||||||
|
<artifactId>javax.annotation-api</artifactId> |
||||||
|
<version>1.3.2</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.projectlombok</groupId> |
||||||
|
<artifactId>lombok</artifactId> |
||||||
|
<version>1.18.26</version> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>central</id> |
||||||
|
<url>https://repo1.maven.org/maven2</url> |
||||||
|
</repository> |
||||||
|
<repository> |
||||||
|
<snapshots> |
||||||
|
<enabled>true</enabled> |
||||||
|
</snapshots> |
||||||
|
<id>github</id> |
||||||
|
<url>https://maven.pkg.github.com/LingHangStudio/mywust</url> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
</project> |
@ -0,0 +1,38 @@ |
|||||||
|
target/ |
||||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||||
|
!**/src/main/**/target/ |
||||||
|
!**/src/test/**/target/ |
||||||
|
|
||||||
|
### IntelliJ IDEA ### |
||||||
|
.idea/modules.xml |
||||||
|
.idea/jarRepositories.xml |
||||||
|
.idea/compiler.xml |
||||||
|
.idea/libraries/ |
||||||
|
*.iws |
||||||
|
*.iml |
||||||
|
*.ipr |
||||||
|
|
||||||
|
### Eclipse ### |
||||||
|
.apt_generated |
||||||
|
.classpath |
||||||
|
.factorypath |
||||||
|
.project |
||||||
|
.settings |
||||||
|
.springBeans |
||||||
|
.sts4-cache |
||||||
|
|
||||||
|
### NetBeans ### |
||||||
|
/nbproject/private/ |
||||||
|
/nbbuild/ |
||||||
|
/dist/ |
||||||
|
/nbdist/ |
||||||
|
/.nb-gradle/ |
||||||
|
build/ |
||||||
|
!**/src/main/**/build/ |
||||||
|
!**/src/test/**/build/ |
||||||
|
|
||||||
|
### VS Code ### |
||||||
|
.vscode/ |
||||||
|
|
||||||
|
### Mac OS ### |
||||||
|
.DS_Store |
@ -0,0 +1,20 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<parent> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>backend-main</artifactId> |
||||||
|
<version>${revision}</version> |
||||||
|
</parent> |
||||||
|
|
||||||
|
<artifactId>web</artifactId> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
</properties> |
||||||
|
|
||||||
|
</project> |
@ -0,0 +1,7 @@ |
|||||||
|
package cn.wustlinghang; |
||||||
|
|
||||||
|
public class Main { |
||||||
|
public static void main(String[] args) { |
||||||
|
System.out.println("Hello world!"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,41 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>common</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>jakarta.annotation</groupId> |
||||||
|
<artifactId>jakarta.annotation-api</artifactId> |
||||||
|
<version>2.1.1</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>javax.annotation</groupId> |
||||||
|
<artifactId>javax.annotation-api</artifactId> |
||||||
|
<version>1.3.2</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.projectlombok</groupId> |
||||||
|
<artifactId>lombok</artifactId> |
||||||
|
<version>1.18.26</version> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>central</id> |
||||||
|
<url>https://repo1.maven.org/maven2</url> |
||||||
|
</repository> |
||||||
|
<repository> |
||||||
|
<snapshots> |
||||||
|
<enabled>true</enabled> |
||||||
|
</snapshots> |
||||||
|
<id>github</id> |
||||||
|
<url>https://maven.pkg.github.com/LingHangStudio/mywust</url> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
</project> |
@ -0,0 +1,38 @@ |
|||||||
|
target/ |
||||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||||
|
!**/src/main/**/target/ |
||||||
|
!**/src/test/**/target/ |
||||||
|
|
||||||
|
### IntelliJ IDEA ### |
||||||
|
.idea/modules.xml |
||||||
|
.idea/jarRepositories.xml |
||||||
|
.idea/compiler.xml |
||||||
|
.idea/libraries/ |
||||||
|
*.iws |
||||||
|
*.iml |
||||||
|
*.ipr |
||||||
|
|
||||||
|
### Eclipse ### |
||||||
|
.apt_generated |
||||||
|
.classpath |
||||||
|
.factorypath |
||||||
|
.project |
||||||
|
.settings |
||||||
|
.springBeans |
||||||
|
.sts4-cache |
||||||
|
|
||||||
|
### NetBeans ### |
||||||
|
/nbproject/private/ |
||||||
|
/nbbuild/ |
||||||
|
/dist/ |
||||||
|
/nbdist/ |
||||||
|
/.nb-gradle/ |
||||||
|
build/ |
||||||
|
!**/src/main/**/build/ |
||||||
|
!**/src/test/**/build/ |
||||||
|
|
||||||
|
### VS Code ### |
||||||
|
.vscode/ |
||||||
|
|
||||||
|
### Mac OS ### |
||||||
|
.DS_Store |
@ -0,0 +1,20 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<parent> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>wusthelper-backend</artifactId> |
||||||
|
<version>${revision}</version> |
||||||
|
</parent> |
||||||
|
|
||||||
|
<artifactId>common</artifactId> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
</properties> |
||||||
|
|
||||||
|
</project> |
@ -0,0 +1,20 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.rpc.request; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class RpcRequest { |
||||||
|
private final Map<String, String> arg; |
||||||
|
|
||||||
|
public RpcRequest() { |
||||||
|
this.arg = new HashMap<>(); |
||||||
|
} |
||||||
|
|
||||||
|
public RpcRequest addArg(String key, String value) { |
||||||
|
this.arg.put(key, value); |
||||||
|
return this; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,63 @@ |
|||||||
|
/* |
||||||
|
* Class created by lensfrex. |
||||||
|
*/ |
||||||
|
|
||||||
|
package cn.wustlinghang.wusthelper.rpc.response; |
||||||
|
|
||||||
|
public enum ResponseCode { |
||||||
|
SUCCESS(20000, "成功"), |
||||||
|
REQUEST_TOO_FAST(20001, "技能冷却中..."), |
||||||
|
INVALID_REQUEST(30000, "非法请求"), |
||||||
|
PARAM_WRONG(30001, "参数错误"), |
||||||
|
PERMISSION_DENIED(40000, "权限不足"), |
||||||
|
TOKEN_EXPIRED(40001, "token过期"), |
||||||
|
TOKEN_INVALID(40002, "token无效"), |
||||||
|
SERVER_INTERNAL_ERROR(50000, "服务器内部错误"), |
||||||
|
API_NOT_IMPLEMENT(0, "接口未实现"), |
||||||
|
|
||||||
|
STUDENT_ID_DOES_NOT_EXISTS(60001,"学生学号不存在"), |
||||||
|
USER_WAS_BANNED_PUBLISH(60201, "用户被禁止发布告示信息"), |
||||||
|
IMAGE_FORMAT_WORN(60202, "上传的图片格式有误"), |
||||||
|
NOTICE_WAS_INTERCEPT(60203, "消息被系统拦截发布"), |
||||||
|
|
||||||
|
USER_DOES_NOT_MATCH_PUBLISHER(60301, "请求用户与告示发表者不匹配"), |
||||||
|
|
||||||
|
REQUEST_FILE_DOES_NOT_EXIST(60701, "请求的文件不存在"); |
||||||
|
|
||||||
|
private final int code; |
||||||
|
|
||||||
|
private final String message; |
||||||
|
|
||||||
|
ResponseCode(int code, String message) { |
||||||
|
this.code = code; |
||||||
|
this.message = message; |
||||||
|
} |
||||||
|
|
||||||
|
public int getCode() { |
||||||
|
return code; |
||||||
|
} |
||||||
|
|
||||||
|
public String getMessage() { |
||||||
|
return message; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
enum Code { |
||||||
|
Success, Fail, Wron |
||||||
|
} |
||||||
|
|
||||||
|
class Singleton { |
||||||
|
private static Singleton instance; |
||||||
|
|
||||||
|
private Singleton() { |
||||||
|
} |
||||||
|
|
||||||
|
public static Singleton getInstance() { |
||||||
|
if (instance == null) { |
||||||
|
instance = new Singleton(); |
||||||
|
} |
||||||
|
|
||||||
|
return instance; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,19 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.rpc.response; |
||||||
|
|
||||||
|
public record RpcResponse<T>(int code, String msg, T data) { |
||||||
|
public static <T> RpcResponse<T> success(T data) { |
||||||
|
return new RpcResponse<>(ResponseCode.SUCCESS.getCode(), "ok", data); |
||||||
|
} |
||||||
|
|
||||||
|
public static <T> RpcResponse<T> success() { |
||||||
|
return success(null); |
||||||
|
} |
||||||
|
|
||||||
|
public static <T> RpcResponse<T> error(int code, String message) { |
||||||
|
return new RpcResponse<>(code, message, null); |
||||||
|
} |
||||||
|
|
||||||
|
public static <T> RpcResponse<T> error(ResponseCode code) { |
||||||
|
return error(code.getCode(), code.getMessage()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,42 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>external-library</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<packaging>pom</packaging> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>jakarta.annotation</groupId> |
||||||
|
<artifactId>jakarta.annotation-api</artifactId> |
||||||
|
<version>2.1.1</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>javax.annotation</groupId> |
||||||
|
<artifactId>javax.annotation-api</artifactId> |
||||||
|
<version>1.3.2</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.projectlombok</groupId> |
||||||
|
<artifactId>lombok</artifactId> |
||||||
|
<version>1.18.26</version> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>central</id> |
||||||
|
<url>https://repo1.maven.org/maven2</url> |
||||||
|
</repository> |
||||||
|
<repository> |
||||||
|
<snapshots> |
||||||
|
<enabled>true</enabled> |
||||||
|
</snapshots> |
||||||
|
<id>github</id> |
||||||
|
<url>https://maven.pkg.github.com/LingHangStudio/mywust</url> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
</project> |
@ -0,0 +1,38 @@ |
|||||||
|
target/ |
||||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||||
|
!**/src/main/**/target/ |
||||||
|
!**/src/test/**/target/ |
||||||
|
|
||||||
|
### IntelliJ IDEA ### |
||||||
|
.idea/modules.xml |
||||||
|
.idea/jarRepositories.xml |
||||||
|
.idea/compiler.xml |
||||||
|
.idea/libraries/ |
||||||
|
*.iws |
||||||
|
*.iml |
||||||
|
*.ipr |
||||||
|
|
||||||
|
### Eclipse ### |
||||||
|
.apt_generated |
||||||
|
.classpath |
||||||
|
.factorypath |
||||||
|
.project |
||||||
|
.settings |
||||||
|
.springBeans |
||||||
|
.sts4-cache |
||||||
|
|
||||||
|
### NetBeans ### |
||||||
|
/nbproject/private/ |
||||||
|
/nbbuild/ |
||||||
|
/dist/ |
||||||
|
/nbdist/ |
||||||
|
/.nb-gradle/ |
||||||
|
build/ |
||||||
|
!**/src/main/**/build/ |
||||||
|
!**/src/test/**/build/ |
||||||
|
|
||||||
|
### VS Code ### |
||||||
|
.vscode/ |
||||||
|
|
||||||
|
### Mac OS ### |
||||||
|
.DS_Store |
@ -0,0 +1 @@ |
|||||||
|
Subproject commit 4b32c584249bffec4767d4b6a075af842127d5d2 |
@ -0,0 +1,24 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<parent> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>wusthelper-backend</artifactId> |
||||||
|
<version>${revision}</version> |
||||||
|
</parent> |
||||||
|
|
||||||
|
<artifactId>external-library</artifactId> |
||||||
|
<packaging>pom</packaging> |
||||||
|
<modules> |
||||||
|
<module>mywust</module> |
||||||
|
</modules> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
</properties> |
||||||
|
|
||||||
|
</project> |
@ -0,0 +1,117 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>wusthelper-backend</artifactId> |
||||||
|
<version>${revision}</version> |
||||||
|
|
||||||
|
<packaging>pom</packaging> |
||||||
|
<modules> |
||||||
|
<module>backend-main</module> |
||||||
|
<module>sub-services</module> |
||||||
|
<module>common</module> |
||||||
|
<module>external-library</module> |
||||||
|
</modules> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<revision>0.0.1-SNAPSHOT</revision> |
||||||
|
|
||||||
|
<!-- 最低版本java 17 --> |
||||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
|
||||||
|
<mywust.version>0.0.2-SNAPSHOT</mywust.version> |
||||||
|
<lombok.version>1.18.26</lombok.version> |
||||||
|
<hutool.version>5.8.20</hutool.version> |
||||||
|
</properties> |
||||||
|
|
||||||
|
<dependencies> |
||||||
|
<!-- 解决javax和jakarta包名不兼容的屁事 --> |
||||||
|
<dependency> |
||||||
|
<groupId>jakarta.annotation</groupId> |
||||||
|
<artifactId>jakarta.annotation-api</artifactId> |
||||||
|
<version>2.1.1</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>javax.annotation</groupId> |
||||||
|
<artifactId>javax.annotation-api</artifactId> |
||||||
|
<version>1.3.2</version> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.projectlombok</groupId> |
||||||
|
<artifactId>lombok</artifactId> |
||||||
|
<version>${lombok.version}</version> |
||||||
|
<!-- 不要把lombok打包进jar去,只在编译时用就行 --> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.junit.jupiter</groupId> |
||||||
|
<artifactId>junit-jupiter</artifactId> |
||||||
|
<version>RELEASE</version> |
||||||
|
<scope>test</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
|
||||||
|
<dependencyManagement> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.hutool</groupId> |
||||||
|
<artifactId>hutool-bom</artifactId> |
||||||
|
<version>${hutool.version}</version> |
||||||
|
<type>pom</type> |
||||||
|
<scope>import</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
</dependencyManagement> |
||||||
|
|
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>central</id> |
||||||
|
<url>https://repo1.maven.org/maven2</url> |
||||||
|
</repository> |
||||||
|
|
||||||
|
<!-- GitHub packages上的maven仓库源 --> |
||||||
|
<repository> |
||||||
|
<id>github</id> |
||||||
|
<url>https://maven.pkg.github.com/LingHangStudio/mywust</url> |
||||||
|
<snapshots> |
||||||
|
<enabled>true</enabled> |
||||||
|
</snapshots> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
|
||||||
|
<build> |
||||||
|
<plugins> |
||||||
|
<plugin> |
||||||
|
<groupId>org.codehaus.mojo</groupId> |
||||||
|
<artifactId>flatten-maven-plugin</artifactId> |
||||||
|
<version>1.3.0</version> |
||||||
|
<configuration> |
||||||
|
</configuration> |
||||||
|
<executions> |
||||||
|
<execution> |
||||||
|
<id>flatten</id> |
||||||
|
<phase>process-resources</phase> |
||||||
|
<goals> |
||||||
|
<goal>flatten</goal> |
||||||
|
</goals> |
||||||
|
</execution> |
||||||
|
<execution> |
||||||
|
<id>flatten.clean</id> |
||||||
|
<phase>clean</phase> |
||||||
|
<goals> |
||||||
|
<goal>clean</goal> |
||||||
|
</goals> |
||||||
|
</execution> |
||||||
|
</executions> |
||||||
|
</plugin> |
||||||
|
</plugins> |
||||||
|
</build> |
||||||
|
|
||||||
|
</project> |
@ -0,0 +1,60 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>sub-services</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<packaging>pom</packaging> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang</groupId> |
||||||
|
<artifactId>mywust-core</artifactId> |
||||||
|
<version>0.0.2-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang</groupId> |
||||||
|
<artifactId>mywust-network-okhttp</artifactId> |
||||||
|
<version>0.0.2-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>common</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>jakarta.annotation</groupId> |
||||||
|
<artifactId>jakarta.annotation-api</artifactId> |
||||||
|
<version>2.1.1</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>javax.annotation</groupId> |
||||||
|
<artifactId>javax.annotation-api</artifactId> |
||||||
|
<version>1.3.2</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.projectlombok</groupId> |
||||||
|
<artifactId>lombok</artifactId> |
||||||
|
<version>1.18.26</version> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>central</id> |
||||||
|
<url>https://repo1.maven.org/maven2</url> |
||||||
|
</repository> |
||||||
|
<repository> |
||||||
|
<snapshots> |
||||||
|
<enabled>true</enabled> |
||||||
|
</snapshots> |
||||||
|
<id>github</id> |
||||||
|
<url>https://maven.pkg.github.com/LingHangStudio/mywust</url> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
</project> |
@ -0,0 +1,38 @@ |
|||||||
|
target/ |
||||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||||
|
!**/src/main/**/target/ |
||||||
|
!**/src/test/**/target/ |
||||||
|
|
||||||
|
### IntelliJ IDEA ### |
||||||
|
.idea/modules.xml |
||||||
|
.idea/jarRepositories.xml |
||||||
|
.idea/compiler.xml |
||||||
|
.idea/libraries/ |
||||||
|
*.iws |
||||||
|
*.iml |
||||||
|
*.ipr |
||||||
|
|
||||||
|
### Eclipse ### |
||||||
|
.apt_generated |
||||||
|
.classpath |
||||||
|
.factorypath |
||||||
|
.project |
||||||
|
.settings |
||||||
|
.springBeans |
||||||
|
.sts4-cache |
||||||
|
|
||||||
|
### NetBeans ### |
||||||
|
/nbproject/private/ |
||||||
|
/nbbuild/ |
||||||
|
/dist/ |
||||||
|
/nbdist/ |
||||||
|
/.nb-gradle/ |
||||||
|
build/ |
||||||
|
!**/src/main/**/build/ |
||||||
|
!**/src/test/**/build/ |
||||||
|
|
||||||
|
### VS Code ### |
||||||
|
.vscode/ |
||||||
|
|
||||||
|
### Mac OS ### |
||||||
|
.DS_Store |
@ -0,0 +1,59 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>graduate</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang</groupId> |
||||||
|
<artifactId>mywust-core</artifactId> |
||||||
|
<version>0.0.2-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang</groupId> |
||||||
|
<artifactId>mywust-network-okhttp</artifactId> |
||||||
|
<version>0.0.2-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>common</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>jakarta.annotation</groupId> |
||||||
|
<artifactId>jakarta.annotation-api</artifactId> |
||||||
|
<version>2.1.1</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>javax.annotation</groupId> |
||||||
|
<artifactId>javax.annotation-api</artifactId> |
||||||
|
<version>1.3.2</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.projectlombok</groupId> |
||||||
|
<artifactId>lombok</artifactId> |
||||||
|
<version>1.18.26</version> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>central</id> |
||||||
|
<url>https://repo1.maven.org/maven2</url> |
||||||
|
</repository> |
||||||
|
<repository> |
||||||
|
<snapshots> |
||||||
|
<enabled>true</enabled> |
||||||
|
</snapshots> |
||||||
|
<id>github</id> |
||||||
|
<url>https://maven.pkg.github.com/LingHangStudio/mywust</url> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
</project> |
@ -0,0 +1,38 @@ |
|||||||
|
target/ |
||||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||||
|
!**/src/main/**/target/ |
||||||
|
!**/src/test/**/target/ |
||||||
|
|
||||||
|
### IntelliJ IDEA ### |
||||||
|
.idea/modules.xml |
||||||
|
.idea/jarRepositories.xml |
||||||
|
.idea/compiler.xml |
||||||
|
.idea/libraries/ |
||||||
|
*.iws |
||||||
|
*.iml |
||||||
|
*.ipr |
||||||
|
|
||||||
|
### Eclipse ### |
||||||
|
.apt_generated |
||||||
|
.classpath |
||||||
|
.factorypath |
||||||
|
.project |
||||||
|
.settings |
||||||
|
.springBeans |
||||||
|
.sts4-cache |
||||||
|
|
||||||
|
### NetBeans ### |
||||||
|
/nbproject/private/ |
||||||
|
/nbbuild/ |
||||||
|
/dist/ |
||||||
|
/nbdist/ |
||||||
|
/.nb-gradle/ |
||||||
|
build/ |
||||||
|
!**/src/main/**/build/ |
||||||
|
!**/src/test/**/build/ |
||||||
|
|
||||||
|
### VS Code ### |
||||||
|
.vscode/ |
||||||
|
|
||||||
|
### Mac OS ### |
||||||
|
.DS_Store |
@ -0,0 +1,20 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<parent> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>sub-services</artifactId> |
||||||
|
<version>${revision}</version> |
||||||
|
</parent> |
||||||
|
|
||||||
|
<artifactId>graduate</artifactId> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
</properties> |
||||||
|
|
||||||
|
</project> |
@ -0,0 +1,7 @@ |
|||||||
|
package cn.wustlinghang; |
||||||
|
|
||||||
|
public class Main { |
||||||
|
public static void main(String[] args) { |
||||||
|
System.out.println("Hello world!"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,59 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>library</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang</groupId> |
||||||
|
<artifactId>mywust-core</artifactId> |
||||||
|
<version>0.0.2-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang</groupId> |
||||||
|
<artifactId>mywust-network-okhttp</artifactId> |
||||||
|
<version>0.0.2-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>common</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>jakarta.annotation</groupId> |
||||||
|
<artifactId>jakarta.annotation-api</artifactId> |
||||||
|
<version>2.1.1</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>javax.annotation</groupId> |
||||||
|
<artifactId>javax.annotation-api</artifactId> |
||||||
|
<version>1.3.2</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.projectlombok</groupId> |
||||||
|
<artifactId>lombok</artifactId> |
||||||
|
<version>1.18.26</version> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>central</id> |
||||||
|
<url>https://repo1.maven.org/maven2</url> |
||||||
|
</repository> |
||||||
|
<repository> |
||||||
|
<snapshots> |
||||||
|
<enabled>true</enabled> |
||||||
|
</snapshots> |
||||||
|
<id>github</id> |
||||||
|
<url>https://maven.pkg.github.com/LingHangStudio/mywust</url> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
</project> |
@ -0,0 +1,38 @@ |
|||||||
|
target/ |
||||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||||
|
!**/src/main/**/target/ |
||||||
|
!**/src/test/**/target/ |
||||||
|
|
||||||
|
### IntelliJ IDEA ### |
||||||
|
.idea/modules.xml |
||||||
|
.idea/jarRepositories.xml |
||||||
|
.idea/compiler.xml |
||||||
|
.idea/libraries/ |
||||||
|
*.iws |
||||||
|
*.iml |
||||||
|
*.ipr |
||||||
|
|
||||||
|
### Eclipse ### |
||||||
|
.apt_generated |
||||||
|
.classpath |
||||||
|
.factorypath |
||||||
|
.project |
||||||
|
.settings |
||||||
|
.springBeans |
||||||
|
.sts4-cache |
||||||
|
|
||||||
|
### NetBeans ### |
||||||
|
/nbproject/private/ |
||||||
|
/nbbuild/ |
||||||
|
/dist/ |
||||||
|
/nbdist/ |
||||||
|
/.nb-gradle/ |
||||||
|
build/ |
||||||
|
!**/src/main/**/build/ |
||||||
|
!**/src/test/**/build/ |
||||||
|
|
||||||
|
### VS Code ### |
||||||
|
.vscode/ |
||||||
|
|
||||||
|
### Mac OS ### |
||||||
|
.DS_Store |
@ -0,0 +1,20 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<parent> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>sub-services</artifactId> |
||||||
|
<version>${revision}</version> |
||||||
|
</parent> |
||||||
|
|
||||||
|
<artifactId>library</artifactId> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
</properties> |
||||||
|
|
||||||
|
</project> |
@ -0,0 +1,7 @@ |
|||||||
|
package cn.wustlinghang; |
||||||
|
|
||||||
|
public class Main { |
||||||
|
public static void main(String[] args) { |
||||||
|
System.out.println("Hello world!"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,59 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>physics</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang</groupId> |
||||||
|
<artifactId>mywust-core</artifactId> |
||||||
|
<version>0.0.2-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang</groupId> |
||||||
|
<artifactId>mywust-network-okhttp</artifactId> |
||||||
|
<version>0.0.2-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>common</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>jakarta.annotation</groupId> |
||||||
|
<artifactId>jakarta.annotation-api</artifactId> |
||||||
|
<version>2.1.1</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>javax.annotation</groupId> |
||||||
|
<artifactId>javax.annotation-api</artifactId> |
||||||
|
<version>1.3.2</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.projectlombok</groupId> |
||||||
|
<artifactId>lombok</artifactId> |
||||||
|
<version>1.18.26</version> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>central</id> |
||||||
|
<url>https://repo1.maven.org/maven2</url> |
||||||
|
</repository> |
||||||
|
<repository> |
||||||
|
<snapshots> |
||||||
|
<enabled>true</enabled> |
||||||
|
</snapshots> |
||||||
|
<id>github</id> |
||||||
|
<url>https://maven.pkg.github.com/LingHangStudio/mywust</url> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
</project> |
@ -0,0 +1,38 @@ |
|||||||
|
target/ |
||||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||||
|
!**/src/main/**/target/ |
||||||
|
!**/src/test/**/target/ |
||||||
|
|
||||||
|
### IntelliJ IDEA ### |
||||||
|
.idea/modules.xml |
||||||
|
.idea/jarRepositories.xml |
||||||
|
.idea/compiler.xml |
||||||
|
.idea/libraries/ |
||||||
|
*.iws |
||||||
|
*.iml |
||||||
|
*.ipr |
||||||
|
|
||||||
|
### Eclipse ### |
||||||
|
.apt_generated |
||||||
|
.classpath |
||||||
|
.factorypath |
||||||
|
.project |
||||||
|
.settings |
||||||
|
.springBeans |
||||||
|
.sts4-cache |
||||||
|
|
||||||
|
### NetBeans ### |
||||||
|
/nbproject/private/ |
||||||
|
/nbbuild/ |
||||||
|
/dist/ |
||||||
|
/nbdist/ |
||||||
|
/.nb-gradle/ |
||||||
|
build/ |
||||||
|
!**/src/main/**/build/ |
||||||
|
!**/src/test/**/build/ |
||||||
|
|
||||||
|
### VS Code ### |
||||||
|
.vscode/ |
||||||
|
|
||||||
|
### Mac OS ### |
||||||
|
.DS_Store |
@ -0,0 +1,20 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<parent> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>sub-services</artifactId> |
||||||
|
<version>${revision}</version> |
||||||
|
</parent> |
||||||
|
|
||||||
|
<artifactId>physics</artifactId> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
</properties> |
||||||
|
|
||||||
|
</project> |
@ -0,0 +1,7 @@ |
|||||||
|
package cn.wustlinghang; |
||||||
|
|
||||||
|
public class Main { |
||||||
|
public static void main(String[] args) { |
||||||
|
System.out.println("Hello world!"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,45 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<parent> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>wusthelper-backend</artifactId> |
||||||
|
<version>${revision}</version> |
||||||
|
</parent> |
||||||
|
|
||||||
|
<artifactId>sub-services</artifactId> |
||||||
|
<packaging>pom</packaging> |
||||||
|
<modules> |
||||||
|
<module>undergrad</module> |
||||||
|
<module>graduate</module> |
||||||
|
<module>library</module> |
||||||
|
<module>physics</module> |
||||||
|
</modules> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
</properties> |
||||||
|
|
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang</groupId> |
||||||
|
<artifactId>mywust-core</artifactId> |
||||||
|
<version>0.0.2-SNAPSHOT</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang</groupId> |
||||||
|
<artifactId>mywust-network-okhttp</artifactId> |
||||||
|
<version>${mywust.version}</version> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>common</artifactId> |
||||||
|
<version>${revision}</version> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
</project> |
@ -0,0 +1,101 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>undergrad</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>io.quarkus</groupId> |
||||||
|
<artifactId>quarkus-resteasy-reactive</artifactId> |
||||||
|
<version>3.1.3.Final</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>io.quarkus</groupId> |
||||||
|
<artifactId>quarkus-resteasy-reactive-jackson</artifactId> |
||||||
|
<version>3.1.3.Final</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>io.quarkus</groupId> |
||||||
|
<artifactId>quarkus-resteasy-deployment</artifactId> |
||||||
|
<version>3.1.3.Final</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>io.quarkus</groupId> |
||||||
|
<artifactId>quarkus-core-deployment</artifactId> |
||||||
|
<version>3.1.3.Final</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>io.quarkus</groupId> |
||||||
|
<artifactId>quarkus-hibernate-validator</artifactId> |
||||||
|
<version>3.1.3.Final</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.hibernate.validator</groupId> |
||||||
|
<artifactId>hibernate-validator</artifactId> |
||||||
|
<version>8.0.1.Final</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.hutool</groupId> |
||||||
|
<artifactId>hutool-core</artifactId> |
||||||
|
<version>5.8.20</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang</groupId> |
||||||
|
<artifactId>mywust-core</artifactId> |
||||||
|
<version>0.0.2-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang</groupId> |
||||||
|
<artifactId>mywust-network-okhttp</artifactId> |
||||||
|
<version>0.0.2-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>common</artifactId> |
||||||
|
<version>0.0.1-SNAPSHOT</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>jakarta.annotation</groupId> |
||||||
|
<artifactId>jakarta.annotation-api</artifactId> |
||||||
|
<version>2.1.1</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>javax.annotation</groupId> |
||||||
|
<artifactId>javax.annotation-api</artifactId> |
||||||
|
<version>1.3.2</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.projectlombok</groupId> |
||||||
|
<artifactId>lombok</artifactId> |
||||||
|
<version>1.18.26</version> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>central</id> |
||||||
|
<url>https://repo1.maven.org/maven2</url> |
||||||
|
</repository> |
||||||
|
<repository> |
||||||
|
<snapshots> |
||||||
|
<enabled>true</enabled> |
||||||
|
</snapshots> |
||||||
|
<id>github</id> |
||||||
|
<url>https://maven.pkg.github.com/LingHangStudio/mywust</url> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
</project> |
@ -0,0 +1,38 @@ |
|||||||
|
target/ |
||||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||||
|
!**/src/main/**/target/ |
||||||
|
!**/src/test/**/target/ |
||||||
|
|
||||||
|
### IntelliJ IDEA ### |
||||||
|
.idea/modules.xml |
||||||
|
.idea/jarRepositories.xml |
||||||
|
.idea/compiler.xml |
||||||
|
.idea/libraries/ |
||||||
|
*.iws |
||||||
|
*.iml |
||||||
|
*.ipr |
||||||
|
|
||||||
|
### Eclipse ### |
||||||
|
.apt_generated |
||||||
|
.classpath |
||||||
|
.factorypath |
||||||
|
.project |
||||||
|
.settings |
||||||
|
.springBeans |
||||||
|
.sts4-cache |
||||||
|
|
||||||
|
### NetBeans ### |
||||||
|
/nbproject/private/ |
||||||
|
/nbbuild/ |
||||||
|
/dist/ |
||||||
|
/nbdist/ |
||||||
|
/.nb-gradle/ |
||||||
|
build/ |
||||||
|
!**/src/main/**/build/ |
||||||
|
!**/src/test/**/build/ |
||||||
|
|
||||||
|
### VS Code ### |
||||||
|
.vscode/ |
||||||
|
|
||||||
|
### Mac OS ### |
||||||
|
.DS_Store |
@ -0,0 +1,160 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<parent> |
||||||
|
<groupId>cn.wustlinghang.wusthelper</groupId> |
||||||
|
<artifactId>sub-services</artifactId> |
||||||
|
<version>${revision}</version> |
||||||
|
</parent> |
||||||
|
|
||||||
|
<artifactId>undergrad</artifactId> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id> |
||||||
|
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id> |
||||||
|
<quarkus.platform.version>3.1.3.Final</quarkus.platform.version> |
||||||
|
<compiler-plugin.version>3.8.1</compiler-plugin.version> |
||||||
|
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
|
||||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||||
|
<maven.compiler.parameters>true</maven.compiler.parameters> |
||||||
|
|
||||||
|
<hibernate-validator.version>8.0.1.Final</hibernate-validator.version> |
||||||
|
</properties> |
||||||
|
|
||||||
|
<dependencyManagement> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>io.quarkus</groupId> |
||||||
|
<artifactId>quarkus-bom</artifactId> |
||||||
|
<version>${quarkus.platform.version}</version> |
||||||
|
<type>pom</type> |
||||||
|
<scope>import</scope> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
</dependencyManagement> |
||||||
|
|
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>io.quarkus</groupId> |
||||||
|
<artifactId>quarkus-resteasy-reactive</artifactId> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>io.quarkus</groupId> |
||||||
|
<artifactId>quarkus-resteasy-reactive-jackson</artifactId> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>io.quarkus</groupId> |
||||||
|
<artifactId>quarkus-resteasy-deployment</artifactId> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>io.quarkus</groupId> |
||||||
|
<artifactId>quarkus-core-deployment</artifactId> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<!-- 参数校验 --> |
||||||
|
<dependency> |
||||||
|
<groupId>io.quarkus</groupId> |
||||||
|
<artifactId>quarkus-hibernate-validator</artifactId> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.hibernate.validator</groupId> |
||||||
|
<artifactId>hibernate-validator</artifactId> |
||||||
|
<version>${hibernate-validator.version}</version> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>io.quarkus</groupId> |
||||||
|
<artifactId>quarkus-junit5</artifactId> |
||||||
|
<scope>test</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>io.rest-assured</groupId> |
||||||
|
<artifactId>rest-assured</artifactId> |
||||||
|
<scope>test</scope> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>cn.hutool</groupId> |
||||||
|
<artifactId>hutool-core</artifactId> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
|
||||||
|
<build> |
||||||
|
<plugins> |
||||||
|
<plugin> |
||||||
|
<artifactId>maven-compiler-plugin</artifactId> |
||||||
|
<version>${compiler-plugin.version}</version> |
||||||
|
</plugin> |
||||||
|
<plugin> |
||||||
|
<artifactId>maven-surefire-plugin</artifactId> |
||||||
|
<version>${surefire-plugin.version}</version> |
||||||
|
<configuration> |
||||||
|
<systemPropertyVariables> |
||||||
|
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> |
||||||
|
<maven.home>${maven.home}</maven.home> |
||||||
|
<file.encoding>UTF-8</file.encoding> |
||||||
|
</systemPropertyVariables> |
||||||
|
</configuration> |
||||||
|
</plugin> |
||||||
|
<plugin> |
||||||
|
<groupId>${quarkus.platform.group-id}</groupId> |
||||||
|
<artifactId>quarkus-maven-plugin</artifactId> |
||||||
|
<version>${quarkus.platform.version}</version> |
||||||
|
<configuration> |
||||||
|
<systemProperties> |
||||||
|
<file.encoding>UTF-8</file.encoding> |
||||||
|
</systemProperties> |
||||||
|
</configuration> |
||||||
|
<executions> |
||||||
|
<execution> |
||||||
|
<goals> |
||||||
|
<goal>build</goal> |
||||||
|
</goals> |
||||||
|
</execution> |
||||||
|
</executions> |
||||||
|
</plugin> |
||||||
|
</plugins> |
||||||
|
</build> |
||||||
|
|
||||||
|
<profiles> |
||||||
|
<profile> |
||||||
|
<id>native</id> |
||||||
|
<activation> |
||||||
|
<property> |
||||||
|
<name>native</name> |
||||||
|
</property> |
||||||
|
</activation> |
||||||
|
<properties> |
||||||
|
<quarkus.package.type>native</quarkus.package.type> |
||||||
|
</properties> |
||||||
|
<build> |
||||||
|
<plugins> |
||||||
|
<plugin> |
||||||
|
<artifactId>maven-failsafe-plugin</artifactId> |
||||||
|
<version>${surefire-plugin.version}</version> |
||||||
|
<executions> |
||||||
|
<execution> |
||||||
|
<goals> |
||||||
|
<goal>integration-test</goal> |
||||||
|
<goal>verify</goal> |
||||||
|
</goals> |
||||||
|
<configuration> |
||||||
|
<systemPropertyVariables> |
||||||
|
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path> |
||||||
|
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> |
||||||
|
<maven.home>${maven.home}</maven.home> |
||||||
|
</systemPropertyVariables> |
||||||
|
</configuration> |
||||||
|
</execution> |
||||||
|
</executions> |
||||||
|
</plugin> |
||||||
|
</plugins> |
||||||
|
</build> |
||||||
|
</profile> |
||||||
|
</profiles> |
||||||
|
</project> |
@ -0,0 +1,54 @@ |
|||||||
|
#### |
||||||
|
# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode |
||||||
|
# |
||||||
|
# Before building the container image run: |
||||||
|
# |
||||||
|
# ./mvnw package |
||||||
|
# |
||||||
|
# Then, build the image with: |
||||||
|
# |
||||||
|
# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/getting-started-jvm . |
||||||
|
# |
||||||
|
# Then run the container using: |
||||||
|
# |
||||||
|
# docker run -i --rm -p 8080:8080 quarkus/getting-started-jvm |
||||||
|
# |
||||||
|
# If you want to include the debug port into your docker image |
||||||
|
# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5050 |
||||||
|
# |
||||||
|
# Then run the container using : |
||||||
|
# |
||||||
|
# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/getting-started-jvm |
||||||
|
# |
||||||
|
### |
||||||
|
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 |
||||||
|
|
||||||
|
ARG JAVA_PACKAGE=java-11-openjdk-headless |
||||||
|
ARG RUN_JAVA_VERSION=1.3.8 |
||||||
|
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' |
||||||
|
# Install java and the run-java script |
||||||
|
# Also set up permissions for user `1001` |
||||||
|
RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \ |
||||||
|
&& microdnf update \ |
||||||
|
&& microdnf clean all \ |
||||||
|
&& mkdir /deployments \ |
||||||
|
&& chown 1001 /deployments \ |
||||||
|
&& chmod "g+rwX" /deployments \ |
||||||
|
&& chown 1001:root /deployments \ |
||||||
|
&& curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \ |
||||||
|
&& chown 1001 /deployments/run-java.sh \ |
||||||
|
&& chmod 540 /deployments/run-java.sh \ |
||||||
|
&& echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security |
||||||
|
|
||||||
|
# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size. |
||||||
|
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" |
||||||
|
# We make four distinct layers so if there are application changes the library layers can be re-used |
||||||
|
COPY --chown=1001 target/quarkus-app/lib/ /deployments/lib/ |
||||||
|
COPY --chown=1001 target/quarkus-app/*.jar /deployments/ |
||||||
|
COPY --chown=1001 target/quarkus-app/app/ /deployments/app/ |
||||||
|
COPY --chown=1001 target/quarkus-app/quarkus/ /deployments/quarkus/ |
||||||
|
|
||||||
|
EXPOSE 8080 |
||||||
|
USER 1001 |
||||||
|
|
||||||
|
ENTRYPOINT [ "/deployments/run-java.sh" ] |
@ -0,0 +1,51 @@ |
|||||||
|
#### |
||||||
|
# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode |
||||||
|
# |
||||||
|
# Before building the container image run: |
||||||
|
# |
||||||
|
# ./mvnw package -Dquarkus.package.type=legacy-jar |
||||||
|
# |
||||||
|
# Then, build the image with: |
||||||
|
# |
||||||
|
# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/getting-started-legacy-jar . |
||||||
|
# |
||||||
|
# Then run the container using: |
||||||
|
# |
||||||
|
# docker run -i --rm -p 8080:8080 quarkus/getting-started-legacy-jar |
||||||
|
# |
||||||
|
# If you want to include the debug port into your docker image |
||||||
|
# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5050 |
||||||
|
# |
||||||
|
# Then run the container using : |
||||||
|
# |
||||||
|
# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/getting-started-legacy-jar |
||||||
|
# |
||||||
|
### |
||||||
|
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 |
||||||
|
|
||||||
|
ARG JAVA_PACKAGE=java-11-openjdk-headless |
||||||
|
ARG RUN_JAVA_VERSION=1.3.8 |
||||||
|
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' |
||||||
|
# Install java and the run-java script |
||||||
|
# Also set up permissions for user `1001` |
||||||
|
RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \ |
||||||
|
&& microdnf update \ |
||||||
|
&& microdnf clean all \ |
||||||
|
&& mkdir /deployments \ |
||||||
|
&& chown 1001 /deployments \ |
||||||
|
&& chmod "g+rwX" /deployments \ |
||||||
|
&& chown 1001:root /deployments \ |
||||||
|
&& curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \ |
||||||
|
&& chown 1001 /deployments/run-java.sh \ |
||||||
|
&& chmod 540 /deployments/run-java.sh \ |
||||||
|
&& echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security |
||||||
|
|
||||||
|
# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size. |
||||||
|
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" |
||||||
|
COPY target/lib/* /deployments/lib/ |
||||||
|
COPY target/*-runner.jar /deployments/app.jar |
||||||
|
|
||||||
|
EXPOSE 8080 |
||||||
|
USER 1001 |
||||||
|
|
||||||
|
ENTRYPOINT [ "/deployments/run-java.sh" ] |
@ -0,0 +1,27 @@ |
|||||||
|
#### |
||||||
|
# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode |
||||||
|
# |
||||||
|
# Before building the container image run: |
||||||
|
# |
||||||
|
# ./mvnw package -Pnative |
||||||
|
# |
||||||
|
# Then, build the image with: |
||||||
|
# |
||||||
|
# docker build -f src/main/docker/Dockerfile.native -t quarkus/getting-started . |
||||||
|
# |
||||||
|
# Then run the container using: |
||||||
|
# |
||||||
|
# docker run -i --rm -p 8080:8080 quarkus/getting-started |
||||||
|
# |
||||||
|
### |
||||||
|
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 |
||||||
|
WORKDIR /work/ |
||||||
|
RUN chown 1001 /work \ |
||||||
|
&& chmod "g+rwX" /work \ |
||||||
|
&& chown 1001:root /work |
||||||
|
COPY --chown=1001:root target/*-runner /work/application |
||||||
|
|
||||||
|
EXPOSE 8080 |
||||||
|
USER 1001 |
||||||
|
|
||||||
|
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] |
@ -0,0 +1,23 @@ |
|||||||
|
#### |
||||||
|
# This Dockerfile is used in order to build a distroless container that runs the Quarkus application in native (no JVM) mode |
||||||
|
# |
||||||
|
# Before building the container image run: |
||||||
|
# |
||||||
|
# ./mvnw package -Pnative |
||||||
|
# |
||||||
|
# Then, build the image with: |
||||||
|
# |
||||||
|
# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/getting-started . |
||||||
|
# |
||||||
|
# Then run the container using: |
||||||
|
# |
||||||
|
# docker run -i --rm -p 8080:8080 quarkus/getting-started |
||||||
|
# |
||||||
|
### |
||||||
|
FROM quay.io/quarkus/quarkus-micro-image:1.0 |
||||||
|
COPY target/*-runner /application |
||||||
|
|
||||||
|
EXPOSE 8080 |
||||||
|
USER 1001 |
||||||
|
|
||||||
|
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] |
@ -0,0 +1,32 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.api.json; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
|
import cn.wustlinghang.wusthelper.internal.undergrad.services.LoginService; |
||||||
|
import jakarta.validation.constraints.NotNull; |
||||||
|
import jakarta.ws.rs.GET; |
||||||
|
import jakarta.ws.rs.Path; |
||||||
|
import jakarta.ws.rs.QueryParam; |
||||||
|
|
||||||
|
import java.io.IOException; |
||||||
|
|
||||||
|
@Path("/cookie") |
||||||
|
public class CookieApi { |
||||||
|
private final LoginService loginService; |
||||||
|
|
||||||
|
public CookieApi(LoginService loginService) { |
||||||
|
this.loginService = loginService; |
||||||
|
} |
||||||
|
|
||||||
|
@GET |
||||||
|
@Path("/") |
||||||
|
public String login(@QueryParam("username") @NotNull String username, |
||||||
|
@QueryParam("password") @NotNull String password) throws IOException, ApiException { |
||||||
|
return loginService.login(username, password, false); |
||||||
|
} |
||||||
|
|
||||||
|
@GET |
||||||
|
@Path("/verify") |
||||||
|
public Boolean verify(@QueryParam("cookie") @NotNull String cookie) throws IOException { |
||||||
|
return loginService.verify(cookie); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,52 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.api.json; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.core.parser.undergraduate.UndergradCourseTableParser; |
||||||
|
import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradCourseTableApiService; |
||||||
|
import cn.wustlinghang.mywust.data.global.Course; |
||||||
|
import cn.wustlinghang.mywust.data.global.StudentInfo; |
||||||
|
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
|
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
|
import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; |
||||||
|
import jakarta.enterprise.context.ApplicationScoped; |
||||||
|
import jakarta.validation.constraints.NotNull; |
||||||
|
import jakarta.ws.rs.GET; |
||||||
|
import jakarta.ws.rs.POST; |
||||||
|
import jakarta.ws.rs.Path; |
||||||
|
import jakarta.ws.rs.QueryParam; |
||||||
|
|
||||||
|
import java.io.IOException; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@Path("/course_table") |
||||||
|
@ApplicationScoped |
||||||
|
public class CourseTableApi { |
||||||
|
private final UndergradCourseTableApiService studentInfoApiService; |
||||||
|
private final UndergradCourseTableParser studentInfoPageParser; |
||||||
|
|
||||||
|
public CourseTableApi(UndergradCourseTableApiService studentInfoApiService, |
||||||
|
UndergradCourseTableParser studentInfoPageParser) { |
||||||
|
this.studentInfoApiService = studentInfoApiService; |
||||||
|
this.studentInfoPageParser = studentInfoPageParser; |
||||||
|
} |
||||||
|
|
||||||
|
@GET |
||||||
|
@Path("/") |
||||||
|
public List<Course> get(@QueryParam("cookie") @NotNull String cookie, @QueryParam("term") String term) |
||||||
|
throws IOException, ApiException, ParseException { |
||||||
|
String html = studentInfoApiService.getPage(term, cookie); |
||||||
|
return this.parse(html); |
||||||
|
} |
||||||
|
|
||||||
|
@GET |
||||||
|
@Path("/agent") |
||||||
|
public String agent(@QueryParam("cookie") @NotNull String cookie, @QueryParam("term") String term) |
||||||
|
throws IOException, ApiException { |
||||||
|
return studentInfoApiService.getPage(term, cookie); |
||||||
|
} |
||||||
|
|
||||||
|
@POST |
||||||
|
@Path("/parse") |
||||||
|
public List<Course> parse(String html) throws ParseException { |
||||||
|
return studentInfoPageParser.parse(html); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,51 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.api.json; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.core.parser.undergraduate.UndergradStudentInfoPageParser; |
||||||
|
import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradStudentInfoApiService; |
||||||
|
import cn.wustlinghang.mywust.data.global.StudentInfo; |
||||||
|
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
|
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
|
import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; |
||||||
|
import jakarta.enterprise.context.ApplicationScoped; |
||||||
|
import jakarta.validation.constraints.NotNull; |
||||||
|
import jakarta.ws.rs.GET; |
||||||
|
import jakarta.ws.rs.POST; |
||||||
|
import jakarta.ws.rs.Path; |
||||||
|
import jakarta.ws.rs.QueryParam; |
||||||
|
|
||||||
|
import java.io.IOException; |
||||||
|
|
||||||
|
@Path("/credit_status") |
||||||
|
@ApplicationScoped |
||||||
|
public class CreditStatusApi { |
||||||
|
private final UndergradStudentInfoApiService studentInfoApiService; |
||||||
|
private final UndergradStudentInfoPageParser studentInfoPageParser; |
||||||
|
|
||||||
|
public CreditStatusApi(UndergradStudentInfoApiService studentInfoApiService, |
||||||
|
UndergradStudentInfoPageParser studentInfoPageParser) { |
||||||
|
this.studentInfoApiService = studentInfoApiService; |
||||||
|
this.studentInfoPageParser = studentInfoPageParser; |
||||||
|
} |
||||||
|
|
||||||
|
@GET |
||||||
|
@Path("/") |
||||||
|
public RpcResponse<StudentInfo> get(String cookie) throws IOException, ApiException, ParseException { |
||||||
|
String html = studentInfoApiService.getPage(cookie); |
||||||
|
return this.parse(html); |
||||||
|
} |
||||||
|
|
||||||
|
@GET |
||||||
|
@Path("/agent") |
||||||
|
public RpcResponse<String> agent(@QueryParam("cookie") @NotNull String cookie) |
||||||
|
throws IOException, ApiException { |
||||||
|
String html = studentInfoApiService.getPage(cookie); |
||||||
|
return RpcResponse.success(html); |
||||||
|
} |
||||||
|
|
||||||
|
@POST |
||||||
|
@Path("/parse") |
||||||
|
public RpcResponse<StudentInfo> parse(String html) throws ParseException { |
||||||
|
StudentInfo result = studentInfoPageParser.parse(html); |
||||||
|
return RpcResponse.success(result); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,51 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.api.json; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.core.parser.undergraduate.UndergradStudentInfoPageParser; |
||||||
|
import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradStudentInfoApiService; |
||||||
|
import cn.wustlinghang.mywust.data.global.StudentInfo; |
||||||
|
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
|
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
|
import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; |
||||||
|
import jakarta.enterprise.context.ApplicationScoped; |
||||||
|
import jakarta.validation.constraints.NotNull; |
||||||
|
import jakarta.ws.rs.GET; |
||||||
|
import jakarta.ws.rs.POST; |
||||||
|
import jakarta.ws.rs.Path; |
||||||
|
import jakarta.ws.rs.QueryParam; |
||||||
|
|
||||||
|
import java.io.IOException; |
||||||
|
|
||||||
|
@Path("/score") |
||||||
|
@ApplicationScoped |
||||||
|
public class ScoreApi { |
||||||
|
private final UndergradStudentInfoApiService studentInfoApiService; |
||||||
|
private final UndergradStudentInfoPageParser studentInfoPageParser; |
||||||
|
|
||||||
|
public ScoreApi(UndergradStudentInfoApiService studentInfoApiService, |
||||||
|
UndergradStudentInfoPageParser studentInfoPageParser) { |
||||||
|
this.studentInfoApiService = studentInfoApiService; |
||||||
|
this.studentInfoPageParser = studentInfoPageParser; |
||||||
|
} |
||||||
|
|
||||||
|
@GET |
||||||
|
@Path("/") |
||||||
|
public RpcResponse<StudentInfo> get(String cookie) throws IOException, ApiException, ParseException { |
||||||
|
String html = studentInfoApiService.getPage(cookie); |
||||||
|
return this.parse(html); |
||||||
|
} |
||||||
|
|
||||||
|
@GET |
||||||
|
@Path("/agent") |
||||||
|
public RpcResponse<String> agent(@QueryParam("cookie") @NotNull String cookie) |
||||||
|
throws IOException, ApiException { |
||||||
|
String html = studentInfoApiService.getPage(cookie); |
||||||
|
return RpcResponse.success(html); |
||||||
|
} |
||||||
|
|
||||||
|
@POST |
||||||
|
@Path("/parse") |
||||||
|
public RpcResponse<StudentInfo> parse(String html) throws ParseException { |
||||||
|
StudentInfo result = studentInfoPageParser.parse(html); |
||||||
|
return RpcResponse.success(result); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,47 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.api.json; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.core.parser.undergraduate.UndergradStudentInfoPageParser; |
||||||
|
import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradStudentInfoApiService; |
||||||
|
import cn.wustlinghang.mywust.data.global.StudentInfo; |
||||||
|
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
|
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
|
import jakarta.enterprise.context.ApplicationScoped; |
||||||
|
import jakarta.validation.constraints.NotNull; |
||||||
|
import jakarta.ws.rs.GET; |
||||||
|
import jakarta.ws.rs.POST; |
||||||
|
import jakarta.ws.rs.Path; |
||||||
|
import jakarta.ws.rs.QueryParam; |
||||||
|
|
||||||
|
import java.io.IOException; |
||||||
|
|
||||||
|
@Path("/student_info") |
||||||
|
@ApplicationScoped |
||||||
|
public class StudentInfoApi { |
||||||
|
private final UndergradStudentInfoApiService studentInfoApiService; |
||||||
|
private final UndergradStudentInfoPageParser studentInfoPageParser; |
||||||
|
|
||||||
|
public StudentInfoApi(UndergradStudentInfoApiService studentInfoApiService, |
||||||
|
UndergradStudentInfoPageParser studentInfoPageParser) { |
||||||
|
this.studentInfoApiService = studentInfoApiService; |
||||||
|
this.studentInfoPageParser = studentInfoPageParser; |
||||||
|
} |
||||||
|
|
||||||
|
@GET |
||||||
|
@Path("/") |
||||||
|
public StudentInfo get(@QueryParam("cookie") @NotNull String cookie) throws IOException, ApiException, ParseException { |
||||||
|
return this.parse(this.agent(cookie)); |
||||||
|
} |
||||||
|
|
||||||
|
@GET |
||||||
|
@Path("/agent") |
||||||
|
public String agent(@QueryParam("cookie") @NotNull String cookie) |
||||||
|
throws IOException, ApiException { |
||||||
|
return studentInfoApiService.getPage(cookie); |
||||||
|
} |
||||||
|
|
||||||
|
@POST |
||||||
|
@Path("/parse") |
||||||
|
public StudentInfo parse(String html) throws ParseException { |
||||||
|
return studentInfoPageParser.parse(html); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,51 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.api.json; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.core.parser.undergraduate.UndergradStudentInfoPageParser; |
||||||
|
import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradStudentInfoApiService; |
||||||
|
import cn.wustlinghang.mywust.data.global.StudentInfo; |
||||||
|
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
|
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
|
import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; |
||||||
|
import jakarta.enterprise.context.ApplicationScoped; |
||||||
|
import jakarta.validation.constraints.NotNull; |
||||||
|
import jakarta.ws.rs.GET; |
||||||
|
import jakarta.ws.rs.POST; |
||||||
|
import jakarta.ws.rs.Path; |
||||||
|
import jakarta.ws.rs.QueryParam; |
||||||
|
|
||||||
|
import java.io.IOException; |
||||||
|
|
||||||
|
@Path("/training_plan") |
||||||
|
@ApplicationScoped |
||||||
|
public class TrainingPlanApi { |
||||||
|
private final UndergradStudentInfoApiService studentInfoApiService; |
||||||
|
private final UndergradStudentInfoPageParser studentInfoPageParser; |
||||||
|
|
||||||
|
public TrainingPlanApi(UndergradStudentInfoApiService studentInfoApiService, |
||||||
|
UndergradStudentInfoPageParser studentInfoPageParser) { |
||||||
|
this.studentInfoApiService = studentInfoApiService; |
||||||
|
this.studentInfoPageParser = studentInfoPageParser; |
||||||
|
} |
||||||
|
|
||||||
|
@GET |
||||||
|
@Path("/") |
||||||
|
public RpcResponse<StudentInfo> get(String cookie) throws IOException, ApiException, ParseException { |
||||||
|
String html = studentInfoApiService.getPage(cookie); |
||||||
|
return this.parse(html); |
||||||
|
} |
||||||
|
|
||||||
|
@GET |
||||||
|
@Path("/agent") |
||||||
|
public RpcResponse<String> agent(@QueryParam("cookie") @NotNull String cookie) |
||||||
|
throws IOException, ApiException { |
||||||
|
String html = studentInfoApiService.getPage(cookie); |
||||||
|
return RpcResponse.success(html); |
||||||
|
} |
||||||
|
|
||||||
|
@POST |
||||||
|
@Path("/parse") |
||||||
|
public RpcResponse<StudentInfo> parse(String html) throws ParseException { |
||||||
|
StudentInfo result = studentInfoPageParser.parse(html); |
||||||
|
return RpcResponse.success(result); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,15 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.api.json.handler; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
|
import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; |
||||||
|
import jakarta.ws.rs.core.Response; |
||||||
|
import jakarta.ws.rs.ext.ExceptionMapper; |
||||||
|
import jakarta.ws.rs.ext.Provider; |
||||||
|
|
||||||
|
@Provider |
||||||
|
public class ApiExceptionHandler extends ExceptionHandlerBase implements ExceptionMapper<ApiException> { |
||||||
|
@Override |
||||||
|
public Response toResponse(ApiException e) { |
||||||
|
return super.toResponse(e.getCodeValue(), e.toString(), "ApiExceptionHandler"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.api.json.handler; |
||||||
|
|
||||||
|
import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; |
||||||
|
import jakarta.ws.rs.core.Response; |
||||||
|
import jakarta.ws.rs.ext.ExceptionMapper; |
||||||
|
import jakarta.ws.rs.ext.Provider; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
|
||||||
|
@Slf4j |
||||||
|
@Provider |
||||||
|
public class DefaultExceptionHandler extends ExceptionHandlerBase implements ExceptionMapper<Exception> { |
||||||
|
@Override |
||||||
|
public Response toResponse(Exception e) { |
||||||
|
log.error("未知异常:", e); |
||||||
|
return super.toResponse( |
||||||
|
ResponseCode.SERVER_INTERNAL_ERROR, |
||||||
|
e.toString(), |
||||||
|
"DefaultExceptionHandler" |
||||||
|
); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,33 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.api.json.handler; |
||||||
|
|
||||||
|
import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; |
||||||
|
import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; |
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException; |
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper; |
||||||
|
import jakarta.ws.rs.core.MediaType; |
||||||
|
import jakarta.ws.rs.core.Response; |
||||||
|
|
||||||
|
public abstract class ExceptionHandlerBase { |
||||||
|
public static final String EXCEPTION_HEADER_KEY = "X-exception-handler"; |
||||||
|
|
||||||
|
private static final ObjectMapper objectMapper = new ObjectMapper(); |
||||||
|
|
||||||
|
public Response toResponse(ResponseCode code, String msg, String handlerName) { |
||||||
|
return toResponse(code.getCode(), msg, handlerName); |
||||||
|
} |
||||||
|
|
||||||
|
public Response toResponse(int code, String msg, String handlerName) { |
||||||
|
Object response; |
||||||
|
try { |
||||||
|
response = objectMapper.writeValueAsString(RpcResponse.error(code, msg)); |
||||||
|
} catch (JsonProcessingException e) { |
||||||
|
response = RpcResponse.error(ResponseCode.SERVER_INTERNAL_ERROR); |
||||||
|
} |
||||||
|
|
||||||
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR) |
||||||
|
.entity(response) |
||||||
|
.header(EXCEPTION_HEADER_KEY, handlerName) |
||||||
|
.type(MediaType.APPLICATION_JSON) |
||||||
|
.build(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,23 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.api.json.handler; |
||||||
|
|
||||||
|
import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; |
||||||
|
import jakarta.ws.rs.core.Response; |
||||||
|
import jakarta.ws.rs.ext.ExceptionMapper; |
||||||
|
import jakarta.ws.rs.ext.Provider; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
|
||||||
|
import java.io.IOException; |
||||||
|
|
||||||
|
@Slf4j |
||||||
|
@Provider |
||||||
|
public class IOExceptionHandler extends ExceptionHandlerBase implements ExceptionMapper<IOException> { |
||||||
|
@Override |
||||||
|
public Response toResponse(IOException e) { |
||||||
|
log.error("IO异常:", e); |
||||||
|
return super.toResponse( |
||||||
|
ResponseCode.SERVER_INTERNAL_ERROR, |
||||||
|
e.toString(), |
||||||
|
"IOExceptionHandler" |
||||||
|
); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.api.json.handler; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
|
import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; |
||||||
|
import jakarta.ws.rs.core.Response; |
||||||
|
import jakarta.ws.rs.ext.ExceptionMapper; |
||||||
|
import jakarta.ws.rs.ext.Provider; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
|
||||||
|
@Slf4j |
||||||
|
@Provider |
||||||
|
public class ParseExceptionHandler extends ExceptionHandlerBase implements ExceptionMapper<ParseException> { |
||||||
|
@Override |
||||||
|
public Response toResponse(ParseException e) { |
||||||
|
log.error("解析异常:", e); |
||||||
|
return super.toResponse( |
||||||
|
ResponseCode.SERVER_INTERNAL_ERROR, |
||||||
|
e.toString(), |
||||||
|
"ParseExceptionHandler" |
||||||
|
); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,23 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.api.json.handler; |
||||||
|
|
||||||
|
import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; |
||||||
|
import jakarta.validation.ConstraintViolationException; |
||||||
|
import jakarta.validation.ValidationException; |
||||||
|
import jakarta.ws.rs.core.Response; |
||||||
|
import jakarta.ws.rs.ext.ExceptionMapper; |
||||||
|
import jakarta.ws.rs.ext.Provider; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
|
||||||
|
@Slf4j |
||||||
|
@Provider |
||||||
|
public class ValidationExceptionHandler extends ExceptionHandlerBase |
||||||
|
implements ExceptionMapper<ValidationException> { |
||||||
|
@Override |
||||||
|
public Response toResponse(ValidationException e) { |
||||||
|
return super.toResponse( |
||||||
|
ResponseCode.PARAM_WRONG, |
||||||
|
"参数错误:" + e.toString(), |
||||||
|
"ValidationExceptionHandler" |
||||||
|
); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,36 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.api.json.interceptor; |
||||||
|
|
||||||
|
import cn.wustlinghang.wusthelper.internal.undergrad.api.json.handler.ExceptionHandlerBase; |
||||||
|
import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; |
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper; |
||||||
|
import jakarta.ws.rs.WebApplicationException; |
||||||
|
import jakarta.ws.rs.core.HttpHeaders; |
||||||
|
import jakarta.ws.rs.core.MediaType; |
||||||
|
import jakarta.ws.rs.ext.Provider; |
||||||
|
import jakarta.ws.rs.ext.WriterInterceptor; |
||||||
|
import jakarta.ws.rs.ext.WriterInterceptorContext; |
||||||
|
|
||||||
|
import java.io.IOException; |
||||||
|
|
||||||
|
@Provider |
||||||
|
public class ResponseWrapperInterceptor implements WriterInterceptor { |
||||||
|
private final ObjectMapper objectMapper; |
||||||
|
|
||||||
|
public ResponseWrapperInterceptor(ObjectMapper objectMapper) { |
||||||
|
this.objectMapper = objectMapper; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException { |
||||||
|
boolean hasException = context.getHeaders().get(ExceptionHandlerBase.EXCEPTION_HEADER_KEY) != null; |
||||||
|
if (!hasException) { |
||||||
|
Object data = context.getEntity(); |
||||||
|
RpcResponse<Object> wrappedResponse = RpcResponse.success(data); |
||||||
|
String json = objectMapper.writeValueAsString(wrappedResponse); |
||||||
|
context.getHeaders().putSingle(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); |
||||||
|
context.setEntity(json); |
||||||
|
} |
||||||
|
|
||||||
|
context.proceed(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.bean; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper; |
||||||
|
import jakarta.enterprise.context.ApplicationScoped; |
||||||
|
import jakarta.inject.Singleton; |
||||||
|
|
||||||
|
public class JacksonBean { |
||||||
|
@ApplicationScoped |
||||||
|
public ObjectMapper objectMapper() { |
||||||
|
return new ObjectMapper(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,36 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.bean; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.core.parser.undergraduate.*; |
||||||
|
import jakarta.enterprise.context.ApplicationScoped; |
||||||
|
|
||||||
|
public class MywustParserBeans { |
||||||
|
@ApplicationScoped |
||||||
|
public UndergradCourseTableParser undergradCourseTableParser() { |
||||||
|
return new UndergradCourseTableParser(); |
||||||
|
} |
||||||
|
|
||||||
|
@ApplicationScoped |
||||||
|
public UndergradScoreParser undergradScoreParser() { |
||||||
|
return new UndergradScoreParser(); |
||||||
|
} |
||||||
|
|
||||||
|
@ApplicationScoped |
||||||
|
public UndergradStudentInfoPageParser undergradStudentInfoPageParser() { |
||||||
|
return new UndergradStudentInfoPageParser(); |
||||||
|
} |
||||||
|
|
||||||
|
@ApplicationScoped |
||||||
|
public UndergradTrainingPlanPageParser undergradTrainingPlanPageParser() { |
||||||
|
return new UndergradTrainingPlanPageParser(); |
||||||
|
} |
||||||
|
|
||||||
|
@ApplicationScoped |
||||||
|
public UndergradCreditStatusParser undergradCreditStatusParser() { |
||||||
|
return new UndergradCreditStatusParser(); |
||||||
|
} |
||||||
|
|
||||||
|
@ApplicationScoped |
||||||
|
public UndergradExamDelayParser undergradExamDelayParser() { |
||||||
|
return new UndergradExamDelayParser(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,63 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.bean; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.core.request.service.auth.UndergraduateLogin; |
||||||
|
import cn.wustlinghang.mywust.core.request.service.undergraduate.*; |
||||||
|
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
|
import cn.wustlinghang.mywust.network.Requester; |
||||||
|
import cn.wustlinghang.mywust.network.okhttp.SimpleOkhttpRequester; |
||||||
|
import jakarta.inject.Singleton; |
||||||
|
|
||||||
|
public class MywustRequestAgentBeans { |
||||||
|
|
||||||
|
@Singleton |
||||||
|
public RequestClientOption requestClientOption() { |
||||||
|
RequestClientOption.Proxy proxy = RequestClientOption.Proxy.builder() |
||||||
|
.address("127.0.0.1") |
||||||
|
.port(8080) |
||||||
|
.build(); |
||||||
|
RequestClientOption option = new RequestClientOption(); |
||||||
|
// option.setProxy(proxy);
|
||||||
|
|
||||||
|
return option; |
||||||
|
} |
||||||
|
|
||||||
|
@Singleton |
||||||
|
public Requester requester(RequestClientOption option) { |
||||||
|
return new SimpleOkhttpRequester(option, true); |
||||||
|
} |
||||||
|
|
||||||
|
@Singleton |
||||||
|
public UndergraduateLogin undergraduateLogin(Requester requester) { |
||||||
|
return new UndergraduateLogin(requester); |
||||||
|
} |
||||||
|
|
||||||
|
@Singleton |
||||||
|
public UndergradCourseTableApiService undergradCourseTableApiService(Requester requester) { |
||||||
|
return new UndergradCourseTableApiService(requester); |
||||||
|
} |
||||||
|
|
||||||
|
@Singleton |
||||||
|
public UndergradScoreApiService undergradScoreApiService(Requester requester) { |
||||||
|
return new UndergradScoreApiService(requester); |
||||||
|
} |
||||||
|
|
||||||
|
@Singleton |
||||||
|
public UndergradStudentInfoApiService undergradStudentInfoApiService(Requester requester) { |
||||||
|
return new UndergradStudentInfoApiService(requester); |
||||||
|
} |
||||||
|
|
||||||
|
@Singleton |
||||||
|
public UndergradTrainingPlanApiService undergradTrainingPlanApiService(Requester requester) { |
||||||
|
return new UndergradTrainingPlanApiService(requester); |
||||||
|
} |
||||||
|
|
||||||
|
@Singleton |
||||||
|
public UndergradCreditStatusApiService undergradCreditStatusApiService(Requester requester) { |
||||||
|
return new UndergradCreditStatusApiService(requester); |
||||||
|
} |
||||||
|
|
||||||
|
@Singleton |
||||||
|
public UndergradExamDelayApiService undergradExamDelayApiService(Requester requester) { |
||||||
|
return new UndergradExamDelayApiService(requester); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,4 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.exception; |
||||||
|
|
||||||
|
public class InternalException extends Exception { |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.services; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.core.request.service.auth.UndergraduateLogin; |
||||||
|
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
|
import cn.wustlinghang.mywust.network.RequestClientOption; |
||||||
|
import jakarta.enterprise.context.ApplicationScoped; |
||||||
|
|
||||||
|
import java.io.IOException; |
||||||
|
|
||||||
|
@ApplicationScoped |
||||||
|
public class LoginService { |
||||||
|
private final RequestClientOption option; |
||||||
|
private final UndergraduateLogin undergraduateLogin; |
||||||
|
|
||||||
|
public LoginService(RequestClientOption option, |
||||||
|
UndergraduateLogin undergraduateLogin) { |
||||||
|
this.option = option; |
||||||
|
this.undergraduateLogin = undergraduateLogin; |
||||||
|
} |
||||||
|
|
||||||
|
public String login(String username, String password, boolean legacy) throws IOException, ApiException { |
||||||
|
if (legacy) { |
||||||
|
return undergraduateLogin.getLoginCookieLegacy(username, password, option); |
||||||
|
} else { |
||||||
|
return undergraduateLogin.getLoginCookie(username, password, option); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public boolean verify(String cookie) throws IOException { |
||||||
|
return !undergraduateLogin.checkCookiesFail(cookie); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,60 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.services; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.core.parser.undergraduate.*; |
||||||
|
import cn.wustlinghang.mywust.data.global.Course; |
||||||
|
import cn.wustlinghang.mywust.data.global.Score; |
||||||
|
import cn.wustlinghang.mywust.data.global.StudentInfo; |
||||||
|
import cn.wustlinghang.mywust.data.undergrad.ExamDelayApplication; |
||||||
|
import cn.wustlinghang.mywust.exception.ParseException; |
||||||
|
import jakarta.enterprise.context.ApplicationScoped; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@ApplicationScoped |
||||||
|
public class ParseService { |
||||||
|
private final UndergradCourseTableParser courseTableParser; |
||||||
|
private final UndergradScoreParser scoreParser; |
||||||
|
private final UndergradStudentInfoPageParser studentInfoPageParser; |
||||||
|
private final UndergradTrainingPlanPageParser trainingPlanPageParser; |
||||||
|
private final UndergradCreditStatusParser creditStatusParser; |
||||||
|
private final UndergradExamDelayParser examDelayParser; |
||||||
|
|
||||||
|
public ParseService(UndergradCourseTableParser courseTableParser, |
||||||
|
UndergradScoreParser scoreParser, |
||||||
|
UndergradStudentInfoPageParser studentInfoPageParser, |
||||||
|
UndergradTrainingPlanPageParser trainingPlanPageParser, |
||||||
|
UndergradCreditStatusParser creditStatusParser, |
||||||
|
UndergradExamDelayParser examDelayParser) { |
||||||
|
|
||||||
|
this.courseTableParser = courseTableParser; |
||||||
|
this.scoreParser = scoreParser; |
||||||
|
this.studentInfoPageParser = studentInfoPageParser; |
||||||
|
this.trainingPlanPageParser = trainingPlanPageParser; |
||||||
|
this.creditStatusParser = creditStatusParser; |
||||||
|
this.examDelayParser = examDelayParser; |
||||||
|
} |
||||||
|
|
||||||
|
public List<Course> parseCourseTable(String data) throws ParseException { |
||||||
|
return courseTableParser.parse(data); |
||||||
|
} |
||||||
|
|
||||||
|
public List<Score> parseScore(String data) throws ParseException { |
||||||
|
return scoreParser.parse(data); |
||||||
|
} |
||||||
|
|
||||||
|
public StudentInfo parseStudentInfo(String data) throws ParseException { |
||||||
|
return studentInfoPageParser.parse(data); |
||||||
|
} |
||||||
|
|
||||||
|
public String parseTrainingPlan(String data) throws ParseException { |
||||||
|
return trainingPlanPageParser.parse(data); |
||||||
|
} |
||||||
|
|
||||||
|
public String parseCreditStatus(String data) throws ParseException { |
||||||
|
return creditStatusParser.parse(data); |
||||||
|
} |
||||||
|
|
||||||
|
public List<ExamDelayApplication> parseExamDelayApplications(String data) throws ParseException { |
||||||
|
return examDelayParser.parse(data); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,62 @@ |
|||||||
|
package cn.wustlinghang.wusthelper.internal.undergrad.services; |
||||||
|
|
||||||
|
import cn.wustlinghang.mywust.core.request.service.undergraduate.*; |
||||||
|
import cn.wustlinghang.mywust.exception.ApiException; |
||||||
|
import jakarta.enterprise.context.ApplicationScoped; |
||||||
|
|
||||||
|
import java.io.IOException; |
||||||
|
|
||||||
|
@ApplicationScoped |
||||||
|
public class RequestAgentService { |
||||||
|
private final UndergradCourseTableApiService courseTableApiService; |
||||||
|
private final UndergradScoreApiService scoreApiService; |
||||||
|
private final UndergradStudentInfoApiService studentInfoApiService; |
||||||
|
private final UndergradTrainingPlanApiService trainingPlanApiService; |
||||||
|
private final UndergradCreditStatusApiService creditStatusApiService; |
||||||
|
private final UndergradExamDelayApiService examDelayApiService; |
||||||
|
|
||||||
|
public RequestAgentService(UndergradCourseTableApiService courseTableApiService, |
||||||
|
UndergradScoreApiService scoreApiService, |
||||||
|
UndergradStudentInfoApiService studentInfoApiService, |
||||||
|
UndergradTrainingPlanApiService trainingPlanApiService, |
||||||
|
UndergradCreditStatusApiService creditStatusApiService, |
||||||
|
UndergradExamDelayApiService examDelayApiService) { |
||||||
|
|
||||||
|
this.courseTableApiService = courseTableApiService; |
||||||
|
this.scoreApiService = scoreApiService; |
||||||
|
this.studentInfoApiService = studentInfoApiService; |
||||||
|
this.trainingPlanApiService = trainingPlanApiService; |
||||||
|
this.creditStatusApiService = creditStatusApiService; |
||||||
|
this.examDelayApiService = examDelayApiService; |
||||||
|
} |
||||||
|
|
||||||
|
public String getStudentInfoPage(String cookie) throws IOException, ApiException { |
||||||
|
return studentInfoApiService.getPage(cookie); |
||||||
|
} |
||||||
|
|
||||||
|
public String getCourseTable(String cookie, String term) throws IOException, ApiException { |
||||||
|
return courseTableApiService.getPage(term, cookie); |
||||||
|
} |
||||||
|
|
||||||
|
public String getScore(String cookie) throws IOException, ApiException { |
||||||
|
return scoreApiService.getPage(cookie); |
||||||
|
} |
||||||
|
|
||||||
|
public String getTrainingPlan(String cookie) throws IOException, ApiException { |
||||||
|
return trainingPlanApiService.getPage(cookie); |
||||||
|
} |
||||||
|
|
||||||
|
public String getCreditStatus(String cookie) throws IOException, ApiException { |
||||||
|
return creditStatusApiService.getPage(cookie, null, false); |
||||||
|
} |
||||||
|
|
||||||
|
public UndergradExamDelayApiService.ExamActivity[] getExamActivities(String cookie, String term) |
||||||
|
throws IOException, ApiException { |
||||||
|
return examDelayApiService.getActivities(term, cookie); |
||||||
|
} |
||||||
|
|
||||||
|
public String getExamDelayApplications(String cookie, String term, String activityId) |
||||||
|
throws IOException, ApiException { |
||||||
|
return examDelayApiService.getPage(term, activityId, cookie); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,152 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<title>getting-started - 1.0.0-SNAPSHOT</title> |
||||||
|
<style> |
||||||
|
h1, h2, h3, h4, h5, h6 { |
||||||
|
margin-bottom: 0.5rem; |
||||||
|
font-weight: 400; |
||||||
|
line-height: 1.5; |
||||||
|
} |
||||||
|
|
||||||
|
h1 { |
||||||
|
font-size: 2.5rem; |
||||||
|
} |
||||||
|
|
||||||
|
h2 { |
||||||
|
font-size: 2rem |
||||||
|
} |
||||||
|
|
||||||
|
h3 { |
||||||
|
font-size: 1.75rem |
||||||
|
} |
||||||
|
|
||||||
|
h4 { |
||||||
|
font-size: 1.5rem |
||||||
|
} |
||||||
|
|
||||||
|
h5 { |
||||||
|
font-size: 1.25rem |
||||||
|
} |
||||||
|
|
||||||
|
h6 { |
||||||
|
font-size: 1rem |
||||||
|
} |
||||||
|
|
||||||
|
.lead { |
||||||
|
font-weight: 300; |
||||||
|
font-size: 2rem; |
||||||
|
} |
||||||
|
|
||||||
|
.banner { |
||||||
|
font-size: 2.7rem; |
||||||
|
margin: 0; |
||||||
|
padding: 2rem 1rem; |
||||||
|
background-color: #00A1E2; |
||||||
|
color: white; |
||||||
|
} |
||||||
|
|
||||||
|
body { |
||||||
|
margin: 0; |
||||||
|
font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; |
||||||
|
} |
||||||
|
|
||||||
|
code { |
||||||
|
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; |
||||||
|
font-size: 87.5%; |
||||||
|
color: #e83e8c; |
||||||
|
word-break: break-word; |
||||||
|
} |
||||||
|
|
||||||
|
.left-column { |
||||||
|
padding: .75rem; |
||||||
|
max-width: 75%; |
||||||
|
min-width: 55%; |
||||||
|
} |
||||||
|
|
||||||
|
.right-column { |
||||||
|
padding: .75rem; |
||||||
|
max-width: 25%; |
||||||
|
} |
||||||
|
|
||||||
|
.container { |
||||||
|
display: flex; |
||||||
|
width: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
li { |
||||||
|
margin: 0.75rem; |
||||||
|
} |
||||||
|
|
||||||
|
.right-section { |
||||||
|
margin-left: 1rem; |
||||||
|
padding-left: 0.5rem; |
||||||
|
} |
||||||
|
|
||||||
|
.right-section h3 { |
||||||
|
padding-top: 0; |
||||||
|
font-weight: 200; |
||||||
|
} |
||||||
|
|
||||||
|
.right-section ul { |
||||||
|
border-left: 0.3rem solid #00A1E2; |
||||||
|
list-style-type: none; |
||||||
|
padding-left: 0; |
||||||
|
} |
||||||
|
|
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
|
||||||
|
<div class="banner lead"> |
||||||
|
Your new Cloud-Native application is ready! |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="container"> |
||||||
|
<div class="left-column"> |
||||||
|
<p class="lead"> Congratulations, you have created a new Quarkus application.</p> |
||||||
|
|
||||||
|
<h2>Why do you see this?</h2> |
||||||
|
|
||||||
|
<p>This page is served by Quarkus. The source is in |
||||||
|
<code>src/main/resources/META-INF/resources/index.html</code>.</p> |
||||||
|
|
||||||
|
<h2>What can I do from here?</h2> |
||||||
|
|
||||||
|
<p>If not already done, run the application in <em>dev mode</em> using: <code>mvn quarkus:dev</code>. |
||||||
|
</p> |
||||||
|
<ul> |
||||||
|
<li>Add REST resources, Servlets, functions and other services in <code>src/main/java</code>.</li> |
||||||
|
<li>Your static assets are located in <code>src/main/resources/META-INF/resources</code>.</li> |
||||||
|
<li>Configure your application in <code>src/main/resources/application.properties</code>. |
||||||
|
</li> |
||||||
|
</ul> |
||||||
|
|
||||||
|
<h2>How do I get rid of this page?</h2> |
||||||
|
<p>Just delete the <code>src/main/resources/META-INF/resources/index.html</code> file.</p> |
||||||
|
</div> |
||||||
|
<div class="right-column"> |
||||||
|
<div class="right-section"> |
||||||
|
<h3>Application</h3> |
||||||
|
<ul> |
||||||
|
<li>GroupId: org.acme</li> |
||||||
|
<li>ArtifactId: getting-started</li> |
||||||
|
<li>Version: 1.0.0-SNAPSHOT</li> |
||||||
|
<li>Quarkus Version: 0.11.0</li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
<div class="right-section"> |
||||||
|
<h3>Next steps</h3> |
||||||
|
<ul> |
||||||
|
<li><a href="https://quarkus.io/guides/maven-tooling.html">Setup your IDE</a></li> |
||||||
|
<li><a href="https://quarkus.io/guides/getting-started-guide.html">Getting started</a></li> |
||||||
|
<li><a href="https://quarkus.io">Quarkus Web Site</a></li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
|
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,5 @@ |
|||||||
|
# Quarkus Configuration file |
||||||
|
# key = value |
||||||
|
quarkus.http.port=22800 |
||||||
|
#quarkus.log.level=DEBUG |
||||||
|
quarkus.log.file.encoding=UTF-8 |
Loading…
Reference in new issue