diff --git a/src/main/java/cn/teammodel/config/intercepter/UploadApiLogInterceptor.java b/src/main/java/cn/teammodel/config/intercepter/UploadApiLogInterceptor.java index 24a20d7..692a95f 100644 --- a/src/main/java/cn/teammodel/config/intercepter/UploadApiLogInterceptor.java +++ b/src/main/java/cn/teammodel/config/intercepter/UploadApiLogInterceptor.java @@ -115,30 +115,30 @@ public class UploadApiLogInterceptor implements HandlerInterceptor { root.put("p", "appraisal"); // 发送请求 - OkHttpClient okHttpClient = new OkHttpClient(); - String requestData = root.toString(); - RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), requestData); - Request okRequest = new Request.Builder() - .url("http://cdhabook.teammodel.cn:8805/api/http-log") - .post(requestBody) - .build(); - - okHttpClient.newCall(okRequest).enqueue(new Callback() { - @Override - public void onFailure(Call call, IOException e) { - log.error("UploadApiLogIntercepter error") ; - notificationService.send("日志上传告警: 请求发送失败,检查请求发送客户端"); - } - - @Override - public void onResponse(Call call, Response response) throws IOException { - if (!response.isSuccessful()) { - log.error("UploadApiLogIntercepter error" ) ; - notificationService.send("日志上传告警: 请求响应异常,检查 API 源是否正常"); - } else { - log.info("UploadApiLogIntercepter success"); - } - } - }); +// OkHttpClient okHttpClient = new OkHttpClient(); +// String requestData = root.toString(); +// RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), requestData); +// Request okRequest = new Request.Builder() +// .url("http://52.130.252.100:8806/api/http-log") +// .post(requestBody) +// .build(); +// +// okHttpClient.newCall(okRequest).enqueue(new Callback() { +// @Override +// public void onFailure(Call call, IOException e) { +// log.error("UploadApiLogIntercepter error") ; +// notificationService.send("日志上传告警: 请求发送失败,检查请求发送客户端"); +// } +// +// @Override +// public void onResponse(Call call, Response response) throws IOException { +// if (!response.isSuccessful()) { +// log.error("UploadApiLogIntercepter error" ) ; +// notificationService.send("日志上传告警: 请求响应异常,检查 API 源是否正常"); +// } else { +// log.info("UploadApiLogIntercepter success"); +// } +// } +// }); } } diff --git a/src/main/java/cn/teammodel/controller/frontend/HelloController.java b/src/main/java/cn/teammodel/controller/frontend/HelloController.java index 52606c4..e50254f 100644 --- a/src/main/java/cn/teammodel/controller/frontend/HelloController.java +++ b/src/main/java/cn/teammodel/controller/frontend/HelloController.java @@ -1,7 +1,9 @@ package cn.teammodel.controller.frontend; import cn.teammodel.common.R; +import cn.teammodel.model.entity.school.Teacher; import cn.teammodel.repository.AppraiseRepository; +import cn.teammodel.repository.TeacherRepository; import cn.teammodel.service.EvaluationService; import com.itextpdf.text.DocumentException; import io.swagger.annotations.Api; @@ -17,6 +19,9 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Set; @RestController @RequestMapping("/") @@ -27,6 +32,8 @@ public class HelloController { private EvaluationService evaluationService; @Resource private AppraiseRepository appraiseRepository; + @Resource + private TeacherRepository teacherRepository; @Autowired private Environment env; @@ -35,7 +42,7 @@ public class HelloController { @PreAuthorize("@ss.hasRole('admin')") public R hello() { System.out.println(SecurityContextHolder.getContext().getAuthentication()); - + return new R(200, "success","hello world"); } @GetMapping("public/free") @@ -46,8 +53,11 @@ public class HelloController { @GetMapping("public/curr") public R curr() { - String curr = env.getProperty("curr"); - return new R(200, "success",curr); + String curr = env.getProperty("spring.env"); + HashSet set= new HashSet() ; + set.add("1595321354"); + List techers= teacherRepository.findAllByCodeAndIdIn("Base", set); + return new R(200, techers,curr); } @GetMapping("public/pdf") diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml deleted file mode 100644 index 951a774..0000000 --- a/src/main/resources/application-dev.yml +++ /dev/null @@ -1,61 +0,0 @@ -spring: -# redis: -# dabase: 9 -# host: 52.130.252.100 -# port: 6379 -# password: habook -# ssl: false -# abort_connection: false -# write_timeout: 10240 - - env: dev - mvc: - pathmatch: - matching-strategy: ant_path_matcher - - # 文件上传 - servlet: - multipart: - # 大小限制 - max-file-size: 10MB - #测试站数据库 - cloud: - azure: - cosmos: - endpoint: https://cdhabookdep-free.documents.azure.cn:443 - database: TEAMModelOS - key: JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A== - populate-query-metrics: true - security: - oauth2: - resourceserver: - jwt: - issuer-uri: https://login.partner.microsoftonline.cn/4807e9cf-87b8-4174-aa5b-e76497d7392b/v2.0 - audiences: 72643704-b2e7-4b26-b881-bd5865e7a7a5 -#企业账户秘钥 -spark: - gpt: - endpoint: https://spark-api.xf-yun.com/v3.5/chat - appId: 7971f265 - apiKey: 866cd866de47fd55d3bac79ecbfcdae3 - apiSecret: MDQ3YzFlNzI0MDEzMjgwYmJkNGFhOTkz - cache_timeout: 1800000 # 30min - cache_context: 3 -jwt: - secret: fXO6ko/qyXeYrkecPeKdgXnuLXf9vMEtnBC9OB3s+aA= - -# 钉钉 webhook -ding: - server-url: https://oapi.dingtalk.com/robot/send?access_token=32d9b24f69c2c4fd7c2dab43268b6258a7214d2620e0805d7b6d1429003b64b6 -#IES 课堂记录 -ies: - server-url: /common/lesson-record/get-lesson-record - server-url-group: /grouplist/get-members-listids - server-url-pdf-data: /school/art/get-pdf-data - server-url-update-custom-comment: /school/art/update-custom-comment - server-url-overview: /overall-education/overview - server-url-exam-rate: /common/exam/get-exam-point - server-url-art-analysis: /analysis/art/statistics - server-url-blob-sas-rcwld: /blob/sas-rcwld - server-url-exam-analysis-list: /common/exam/find-by-analysis -curr: dev \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml deleted file mode 100644 index 4042dc5..0000000 --- a/src/main/resources/application-prod.yml +++ /dev/null @@ -1,65 +0,0 @@ -spring: -# redis: -# dabase: 9 -# host: 52.130.252.100 -# port: 6379 -# password: habook -# ssl: false -# abort_connection: false -# write_timeout: 10240 - - - env: dev - mvc: - pathmatch: - matching-strategy: ant_path_matcher - - # 文件上传 - servlet: - multipart: - # 大小限制 - max-file-size: 10MB - #正式站数据库 - cloud: - azure: - cosmos: - endpoint: https://teammodelos.documents.azure.cn:443 - database: TEAMModelOS - key: clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg== - populate-query-metrics: true - security: - oauth2: - resourceserver: - jwt: - issuer-uri: https://login.partner.microsoftonline.cn/4807e9cf-87b8-4174-aa5b-e76497d7392b/v2.0 - audiences: 72643704-b2e7-4b26-b881-bd5865e7a7a5 - profiles: - active: test - -#企业账户秘钥 -spark: - gpt: - endpoint: https://spark-api.xf-yun.com/v3.5/chat - appId: 7971f265 - apiKey: 866cd866de47fd55d3bac79ecbfcdae3 - apiSecret: MDQ3YzFlNzI0MDEzMjgwYmJkNGFhOTkz - cache_timeout: 1800000 # 30min - cache_context: 3 -jwt: - secret: fXO6ko/qyXeYrkecPeKdgXnuLXf9vMEtnBC9OB3s+aA= - -# 钉钉 webhook -ding: - server-url: https://oapi.dingtalk.com/robot/send?access_token=32d9b24f69c2c4fd7c2dab43268b6258a7214d2620e0805d7b6d1429003b64b6 -#IES 课堂记录 -ies: - server-url: /common/lesson-record/get-lesson-record - server-url-group: /grouplist/get-members-listids - server-url-pdf-data: /school/art/get-pdf-data - server-url-update-custom-comment: /school/art/update-custom-comment - server-url-overview: /overall-education/overview - server-url-exam-rate: /common/exam/get-exam-point - server-url-art-analysis: /analysis/art/statistics - server-url-blob-sas-rcwld: /blob/sas-rcwld - server-url-exam-analysis-list: /common/exam/find-by-analysis -curr: prod \ No newline at end of file diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml deleted file mode 100644 index c9b3092..0000000 --- a/src/main/resources/application-test.yml +++ /dev/null @@ -1,61 +0,0 @@ -spring: -# redis: -# dabase: 9 -# host: 52.130.252.100 -# port: 6379 -# password: habook -# ssl: false -# abort_connection: false -# write_timeout: 10240 - - env: dev - mvc: - pathmatch: - matching-strategy: ant_path_matcher - - # 文件上传 - servlet: - multipart: - # 大小限制 - max-file-size: 10MB - #测试站数据库 - cloud: - azure: - cosmos: - endpoint: https://cdhabookdep-free.documents.azure.cn:443 - database: TEAMModelOS - key: JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A== - populate-query-metrics: true - security: - oauth2: - resourceserver: - jwt: - issuer-uri: https://login.partner.microsoftonline.cn/4807e9cf-87b8-4174-aa5b-e76497d7392b/v2.0 - audiences: 72643704-b2e7-4b26-b881-bd5865e7a7a5 -#企业账户秘钥 -spark: - gpt: - endpoint: https://spark-api.xf-yun.com/v3.5/chat - appId: 7971f265 - apiKey: 866cd866de47fd55d3bac79ecbfcdae3 - apiSecret: MDQ3YzFlNzI0MDEzMjgwYmJkNGFhOTkz - cache_timeout: 1800000 # 30min - cache_context: 3 -jwt: - secret: fXO6ko/qyXeYrkecPeKdgXnuLXf9vMEtnBC9OB3s+aA= - -# 钉钉 webhook -ding: - server-url: https://oapi.dingtalk.com/robot/send?access_token=32d9b24f69c2c4fd7c2dab43268b6258a7214d2620e0805d7b6d1429003b64b6 -#IES 课堂记录 -ies: - server-url: /common/lesson-record/get-lesson-record - server-url-group: /grouplist/get-members-listids - server-url-pdf-data: /school/art/get-pdf-data - server-url-update-custom-comment: /school/art/update-custom-comment - server-url-overview: /overall-education/overview - server-url-exam-rate: /common/exam/get-exam-point - server-url-art-analysis: /analysis/art/statistics - server-url-blob-sas-rcwld: /blob/sas-rcwld - server-url-exam-analysis-list: /common/exam/find-by-analysis -curr: test \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 934a81f..64c0c73 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: # write_timeout: 10240 - env: dev + mvc: pathmatch: matching-strategy: ant_path_matcher @@ -20,6 +20,7 @@ spring: # 大小限制 max-file-size: 10MB #测试站数据库 + env: dev cloud: azure: cosmos: @@ -27,15 +28,21 @@ spring: database: TEAMModelOS key: JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A== populate-query-metrics: true + #正式站数据库 +# env: prod +# cloud: +# azure: +# cosmos: +# endpoint: https://teammodelos.documents.azure.cn:443 +# database: TEAMModelOS +# key: clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg== +# populate-query-metrics: true security: oauth2: resourceserver: jwt: issuer-uri: https://login.partner.microsoftonline.cn/4807e9cf-87b8-4174-aa5b-e76497d7392b/v2.0 audiences: 72643704-b2e7-4b26-b881-bd5865e7a7a5 - profiles: - active: dev - #企业账户秘钥 spark: gpt: @@ -71,5 +78,4 @@ ies: server-url-exam-rate: /common/exam/get-exam-point server-url-art-analysis: /analysis/art/statistics server-url-blob-sas-rcwld: /blob/sas-rcwld - server-url-exam-analysis-list: /common/exam/find-by-analysis -curr: default \ No newline at end of file + server-url-exam-analysis-list: /common/exam/find-by-analysis \ No newline at end of file