brynhild 3 年 前
コミット
49bf8bbeee
30 ファイル変更271 行追加28 行削除
  1. 4 2
      .idea/.gitignore
  2. 2 3
      .idea/compiler.xml
  3. 0 10
      .idea/jarRepositories.xml
  4. 1 3
      .idea/misc.xml
  5. 2 2
      src/main/java/com/main/config/GlobalCrossConfig.java
  6. 5 1
      src/main/java/com/main/entity/Task.java
  7. 4 3
      src/main/java/com/main/repository/acuta/CategoryRepository.java
  8. 1 1
      src/main/java/com/main/schedule/AutoActiveTask.java
  9. 2 0
      src/main/java/com/main/service/impl/StudentServiceImpl.java
  10. 2 3
      src/main/java/com/main/service/impl/TeacherServiceImpl.java
  11. 2 0
      src/main/java/com/main/transfer/teacher/vo/AddTask.java
  12. 10 0
      zzjProxy/.idea/.gitignore
  13. 18 0
      zzjProxy/.idea/compiler.xml
  14. 6 0
      zzjProxy/.idea/encodings.xml
  15. 30 0
      zzjProxy/.idea/jarRepositories.xml
  16. 22 0
      zzjProxy/.idea/misc.xml
  17. 6 0
      zzjProxy/.idea/vcs.xml
  18. 94 0
      zzjProxy/pom.xml
  19. 13 0
      zzjProxy/src/main/java/com/main/Application.java
  20. 23 0
      zzjProxy/src/main/java/com/main/config/GlobalCrossConfig.java
  21. 8 0
      zzjProxy/src/main/resources/application.yaml
  22. 8 0
      zzjProxy/target/classes/application.yaml
  23. BIN
      zzjProxy/target/classes/com/main/Application.class
  24. BIN
      zzjProxy/target/classes/com/main/config/GlobalCrossConfig.class
  25. 4 0
      zzjProxy/target/maven-archiver/pom.properties
  26. 2 0
      zzjProxy/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  27. 2 0
      zzjProxy/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  28. 0 0
      zzjProxy/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
  29. BIN
      zzjProxy/target/proxy.jar
  30. BIN
      zzjProxy/target/proxy.jar.original

+ 4 - 2
.idea/.gitignore

@@ -1,8 +1,10 @@
 # Default ignored files
 /shelf/
 /workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
 # Datasource local storage ignored files
 /dataSources/
 /dataSources.local.xml
-# Editor-based HTTP Client requests
-/httpRequests/
+# Zeppelin ignored files
+/ZeppelinRemoteNotebooks/

+ 2 - 3
.idea/compiler.xml

@@ -2,18 +2,17 @@
 <project version="4">
   <component name="CompilerConfiguration">
     <annotationProcessing>
-      <profile default="true" name="Default" enabled="true" />
       <profile name="Maven default annotation processors profile" enabled="true">
         <sourceOutputDir name="target/generated-sources/annotations" />
         <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
         <outputRelativeToContentRoot value="true" />
-        <module name="智助教" />
+        <module name="dc" />
       </profile>
     </annotationProcessing>
   </component>
   <component name="JavacSettings">
     <option name="ADDITIONAL_OPTIONS_OVERRIDE">
-      <module name="智助教" options="-parameters" />
+      <module name="dc" options="-parameters" />
     </option>
   </component>
 </project>

+ 0 - 10
.idea/jarRepositories.xml

@@ -1,11 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="RemoteRepositoriesConfiguration">
-    <remote-repository>
-      <option name="id" value="spring-snapshots" />
-      <option name="name" value="spring-snapshots" />
-      <option name="url" value="https://repo.spring.io/snapshot" />
-    </remote-repository>
     <remote-repository>
       <option name="id" value="central" />
       <option name="name" value="Central Repository" />
@@ -21,10 +16,5 @@
       <option name="name" value="JBoss Community repository" />
       <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
     </remote-repository>
-    <remote-repository>
-      <option name="id" value="spring-milestones" />
-      <option name="name" value="spring-milestones" />
-      <option name="url" value="https://repo.spring.io/milestone" />
-    </remote-repository>
   </component>
 </project>

+ 1 - 3
.idea/misc.xml

@@ -8,9 +8,7 @@
       </list>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
-    <output url="file://$PROJECT_DIR$/out" />
-  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="openjdk-17" project-jdk-type="JavaSDK" />
   <component name="ProjectType">
     <option name="id" value="jpab" />
   </component>

+ 2 - 2
src/main/java/com/main/config/GlobalCrossConfig.java

@@ -6,10 +6,10 @@ import org.springframework.web.cors.CorsConfiguration;
 import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
 import org.springframework.web.filter.CorsFilter;
 
-@Configuration
+//@Configuration
 public class GlobalCrossConfig {
 
-    @Bean
+//    @Bean
     public CorsFilter corsFilter() {
         CorsConfiguration configuration = new CorsConfiguration();
         configuration.addAllowedOrigin("*");

+ 5 - 1
src/main/java/com/main/entity/Task.java

@@ -49,15 +49,19 @@ public class Task extends LogicDeleteEntity {
     @Column(name = "submit_type")
     private Integer submitType;
 
+    @Column(name = "_require")
+    private String require;
+
     public Task(AddTask info) {
         this.setTaskName(info.getTaskName());
         this.setAnswer(info.getAnswer());
         this.setContent(info.getContent());
         this.setState(TaskConstant.NOT_STARTED);
         this.setDeadline(info.getDeadline() + ":59");
-        this.setPublishTime(info.getPublishTime() + ":00");
+        this.setPublishTime(info.getPublishTime() + ":59");
         this.setCriticalValue(info.getCriticalValue());
         this.setTaskType(info.getTaskType());
         this.setSubmitType(info.getSubmitType());
+        this.setRequire(info.getRequire());
     }
 }

+ 4 - 3
src/main/java/com/main/repository/acuta/CategoryRepository.java

@@ -45,7 +45,7 @@ public class CategoryRepository {
         adbPlaceHolderMgr.set_int("id",id);
 
         final ADBClientFace clientFace = acutaDBRepository.getClientFace();
-        String sql="select id,name from category where id=#id#";
+        String sql="select id,name from category where id= #id#";
 
         final ADBResultNode select = clientFace.select(acutaDBRepository.getDatabase(), sql, adbFetcher, adbPlaceHolderMgr);
 
@@ -106,12 +106,13 @@ public class CategoryRepository {
         adbFetcher.mb_force_xss_filter = true;
 
         final ADBClientFace clientFace = acutaDBRepository.getClientFace();
-        String sql="select id,name from category where owner_id=#id#";
+        System.out.println(id);
+        String sql="select id,name from category where owner_id = #id#";
 
         ADBPlaceHolderMgr placeHolderMgr=new ADBPlaceHolderMgr();
         placeHolderMgr.set_int("id",id);
 
-        final ADBResultNode select = clientFace.select(acutaDBRepository.getDatabase(), sql, adbFetcher);
+        final ADBResultNode select = clientFace.select(acutaDBRepository.getDatabase(), sql, adbFetcher,placeHolderMgr);
 
         if(select.mi_ret==0){
             categoryList=new ArrayList<>();

+ 1 - 1
src/main/java/com/main/schedule/AutoActiveTask.java

@@ -41,7 +41,7 @@ public class AutoActiveTask {
 
     public void notifyAdd(Task task) {
         long difference = TimeUtil.getTimeDifference(task.getPublishTime());
-        if (difference < 0 && difference > -300000) {
+        if (difference < 60 && difference > -300000) {
             activeTask(TimeUtil.getCurrentTimeString(), task);
         }
     }

+ 2 - 0
src/main/java/com/main/service/impl/StudentServiceImpl.java

@@ -51,10 +51,12 @@ public class StudentServiceImpl implements IStudentService {
         }
         Long taskId = (Long) redisTemplate.opsForValue().get(RedisConstant.TASK_CODE_LIST + info.getTaskCode());
         if (taskId == null) {
+            System.out.println("无法从缓存中查询到任务");
             return new Result(false, StatusCode.ERROR, "任务未开启");
         }
 
         Task task = getTaskFromCache(info.getTaskCode());
+        System.out.println("从缓存或数据库中查询到的任务信息:"+task);
         if (TimeUtil.getTimeDifference(task.getPublishTime()) < 0) {
             return new Result(false, StatusCode.ERROR, "任务未开启");
         }

+ 2 - 3
src/main/java/com/main/service/impl/TeacherServiceImpl.java

@@ -142,10 +142,10 @@ public class TeacherServiceImpl implements ITeacherService {
         if (tokenValidateResult == null) {
             return new Result(false, StatusCode.ERROR, "身份验证失败");
         }
-        if (TimeUtil.getTimeDifference(info.getPublishTime() + ":00") > 0) {
+        if (TimeUtil.getTimeDifference(info.getPublishTime() + ":59") > 0) {
             return new Result(false, StatusCode.ERROR, "发布时间太早");
         }
-        if (!TimeUtil.isValidTimeString(info.getPublishTime() + ":00", info.getDeadline() + ":59")) {
+        if (!TimeUtil.isValidTimeString(info.getPublishTime() + ":59", info.getDeadline() + ":59")) {
             return new Result(false, StatusCode.ERROR, "时间不合法,请检查时间格式或截止时间是否早于发布时间");
         }
 
@@ -161,7 +161,6 @@ public class TeacherServiceImpl implements ITeacherService {
 
             if (taskType == TaskConstant.EXPLAIN) {
                 keywords = answer.split("[,,]");
-
             }
             if (taskType == TaskConstant.OBJECT) {
                 keywords = answer.split("//");

+ 2 - 0
src/main/java/com/main/transfer/teacher/vo/AddTask.java

@@ -37,4 +37,6 @@ public class AddTask {
     private List<Long> contentFileList;
     @JsonProperty("answer_file_list")
     private List<Long> answerFileList;
+
+    private String require;
 }

+ 10 - 0
zzjProxy/.idea/.gitignore

@@ -0,0 +1,10 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Zeppelin ignored files
+/ZeppelinRemoteNotebooks/

+ 18 - 0
zzjProxy/.idea/compiler.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <annotationProcessing>
+      <profile name="Maven default annotation processors profile" enabled="true">
+        <sourceOutputDir name="target/generated-sources/annotations" />
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
+        <outputRelativeToContentRoot value="true" />
+        <module name="zzjProxy" />
+      </profile>
+    </annotationProcessing>
+  </component>
+  <component name="JavacSettings">
+    <option name="ADDITIONAL_OPTIONS_OVERRIDE">
+      <module name="zzjProxy" options="-parameters" />
+    </option>
+  </component>
+</project>

+ 6 - 0
zzjProxy/.idea/encodings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
+  </component>
+</project>

+ 30 - 0
zzjProxy/.idea/jarRepositories.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Central Repository" />
+      <option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="spring-milestones" />
+      <option name="name" value="Spring Milestones" />
+      <option name="url" value="https://repo.spring.io/milestone" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="spring-snapshots" />
+      <option name="name" value="Spring Snapshots" />
+      <option name="url" value="https://repo.spring.io/snapshot" />
+    </remote-repository>
+  </component>
+</project>

+ 22 - 0
zzjProxy/.idea/misc.xml

@@ -0,0 +1,22 @@
+<?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" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+  <component name="ProjectType">
+    <option name="id" value="jpab" />
+  </component>
+  <component name="SwUserDefinedSpecifications">
+    <option name="specTypeByUrl">
+      <map />
+    </option>
+  </component>
+</project>

+ 6 - 0
zzjProxy/.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
+  </component>
+</project>

+ 94 - 0
zzjProxy/pom.xml

@@ -0,0 +1,94 @@
+<?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>org.example</groupId>
+    <artifactId>zzjProxy</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+
+    <parent>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <groupId>org.springframework.boot</groupId>
+        <version>2.0.1.RELEASE</version>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>proxy</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.0.1.RELEASE</version>
+            </plugin>
+        </plugins>
+    </build>
+
+    <repositories>
+        <repository>
+            <id>spring-snapshots</id>
+            <name>Spring Snapshots</name>
+            <url>https://repo.spring.io/snapshot</url>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </repository>
+        <repository>
+            <id>spring-milestones</id>
+            <name>Spring Milestones</name>
+            <url>https://repo.spring.io/milestone</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+    </repositories>
+
+    <pluginRepositories>
+        <pluginRepository>
+            <id>spring-snapshots</id>
+            <name>Spring Snapshots</name>
+            <url>https://repo.spring.io/snapshot</url>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </pluginRepository>
+        <pluginRepository>
+            <id>spring-milestones</id>
+            <name>Spring Milestones</name>
+            <url>https://repo.spring.io/milestone</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>Finchley.SR2</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+</project>

+ 13 - 0
zzjProxy/src/main/java/com/main/Application.java

@@ -0,0 +1,13 @@
+package com.main;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
+
+@SpringBootApplication
+@EnableZuulProxy
+public class Application {
+    public static void main(String[] args) {
+        SpringApplication.run(Application.class,args);
+    }
+}

+ 23 - 0
zzjProxy/src/main/java/com/main/config/GlobalCrossConfig.java

@@ -0,0 +1,23 @@
+package com.main.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+@Configuration
+public class GlobalCrossConfig {
+
+    @Bean
+    public CorsFilter corsFilter() {
+        CorsConfiguration configuration = new CorsConfiguration();
+        configuration.addAllowedOrigin("*");
+        configuration.setAllowCredentials(true);
+        configuration.addAllowedMethod("*");
+        configuration.addAllowedHeader("*");
+        UrlBasedCorsConfigurationSource configurationSource = new UrlBasedCorsConfigurationSource();
+        configurationSource.registerCorsConfiguration("/**", configuration);
+        return new CorsFilter(configurationSource);
+    }
+}

+ 8 - 0
zzjProxy/src/main/resources/application.yaml

@@ -0,0 +1,8 @@
+zuul:
+  routes:
+    any:
+      path: /**
+      url: http://152.136.209.176:8081
+  sensitive-headers:
+server:
+  port: 8081

+ 8 - 0
zzjProxy/target/classes/application.yaml

@@ -0,0 +1,8 @@
+zuul:
+  routes:
+    any:
+      path: /**
+      url: http://152.136.209.176:8081
+  sensitive-headers:
+server:
+  port: 8081

BIN
zzjProxy/target/classes/com/main/Application.class


BIN
zzjProxy/target/classes/com/main/config/GlobalCrossConfig.class


+ 4 - 0
zzjProxy/target/maven-archiver/pom.properties

@@ -0,0 +1,4 @@
+#Created by Apache Maven 3.6.3
+version=1.0-SNAPSHOT
+groupId=org.example
+artifactId=zzjProxy

+ 2 - 0
zzjProxy/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1,2 @@
+com\main\Application.class
+com\main\config\GlobalCrossConfig.class

+ 2 - 0
zzjProxy/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -0,0 +1,2 @@
+C:\Users\Orange\Desktop\zzjProxy\src\main\java\com\main\Application.java
+C:\Users\Orange\Desktop\zzjProxy\src\main\java\com\main\config\GlobalCrossConfig.java

+ 0 - 0
zzjProxy/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst


BIN
zzjProxy/target/proxy.jar


BIN
zzjProxy/target/proxy.jar.original