From 6b07db26bd26a605355a08f89261e0667e454973 Mon Sep 17 00:00:00 2001 From: CrazyIter_Bin Date: Thu, 26 Sep 2024 11:19:12 +0800 Subject: [PATCH] update --- pom.xml | 7 ++ .../controller/frontend/HelloController.java | 18 ++++- src/main/resources/application-dev.yml | 61 +++++++++++++++++ src/main/resources/application-prod.yml | 65 +++++++++++++++++++ src/main/resources/application-test.yml | 61 +++++++++++++++++ src/main/resources/application.yml | 14 ++-- 6 files changed, 214 insertions(+), 12 deletions(-) create mode 100644 src/main/resources/application-dev.yml create mode 100644 src/main/resources/application-prod.yml create mode 100644 src/main/resources/application-test.yml diff --git a/pom.xml b/pom.xml index 084c376..cc19e74 100644 --- a/pom.xml +++ b/pom.xml @@ -221,6 +221,13 @@ true + + maven-resources-plugin + + utf-8 + true + + diff --git a/src/main/java/cn/teammodel/controller/frontend/HelloController.java b/src/main/java/cn/teammodel/controller/frontend/HelloController.java index caeb1a3..52606c4 100644 --- a/src/main/java/cn/teammodel/controller/frontend/HelloController.java +++ b/src/main/java/cn/teammodel/controller/frontend/HelloController.java @@ -5,6 +5,9 @@ import cn.teammodel.repository.AppraiseRepository; import cn.teammodel.service.EvaluationService; import com.itextpdf.text.DocumentException; import io.swagger.annotations.Api; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.bind.annotation.GetMapping; @@ -24,12 +27,15 @@ public class HelloController { private EvaluationService evaluationService; @Resource private AppraiseRepository appraiseRepository; - + @Autowired + private Environment env; + + @GetMapping("hello") @PreAuthorize("@ss.hasRole('admin')") public R hello() { System.out.println(SecurityContextHolder.getContext().getAuthentication()); - + return new R(200, "success","hello world"); } @GetMapping("public/free") @@ -37,7 +43,13 @@ public class HelloController { public R free() { return new R(200, "success","hello world"); } - + @GetMapping("public/curr") + public R curr() { + + String curr = env.getProperty("curr"); + return new R(200, "success",curr); + } + @GetMapping("public/pdf") public void freepdf(HttpServletResponse response) throws DocumentException, IOException { // 设置response参数 // response.reset(); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..951a774 --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,61 @@ +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 new file mode 100644 index 0000000..4042dc5 --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,65 @@ +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 new file mode 100644 index 0000000..c9b3092 --- /dev/null +++ b/src/main/resources/application-test.yml @@ -0,0 +1,61 @@ +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 1259f17..934a81f 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -27,20 +27,15 @@ spring: database: TEAMModelOS key: JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A== populate-query-metrics: true - #正式站数据库 -# 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: @@ -76,4 +71,5 @@ 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 \ No newline at end of file + server-url-exam-analysis-list: /common/exam/find-by-analysis +curr: default \ No newline at end of file