develop
CrazyIter_Bin 3 months ago
parent 6b07db26bd
commit 3fcc218292

@ -115,30 +115,30 @@ public class UploadApiLogInterceptor implements HandlerInterceptor {
root.put("p", "appraisal"); root.put("p", "appraisal");
// 发送请求 // 发送请求
OkHttpClient okHttpClient = new OkHttpClient(); // OkHttpClient okHttpClient = new OkHttpClient();
String requestData = root.toString(); // String requestData = root.toString();
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), requestData); // RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), requestData);
Request okRequest = new Request.Builder() // Request okRequest = new Request.Builder()
.url("http://cdhabook.teammodel.cn:8805/api/http-log") // .url("http://52.130.252.100:8806/api/http-log")
.post(requestBody) // .post(requestBody)
.build(); // .build();
//
okHttpClient.newCall(okRequest).enqueue(new Callback() { // okHttpClient.newCall(okRequest).enqueue(new Callback() {
@Override // @Override
public void onFailure(Call call, IOException e) { // public void onFailure(Call call, IOException e) {
log.error("UploadApiLogIntercepter error") ; // log.error("UploadApiLogIntercepter error") ;
notificationService.send("日志上传告警: 请求发送失败,检查请求发送客户端"); // notificationService.send("日志上传告警: 请求发送失败,检查请求发送客户端");
} // }
//
@Override // @Override
public void onResponse(Call call, Response response) throws IOException { // public void onResponse(Call call, Response response) throws IOException {
if (!response.isSuccessful()) { // if (!response.isSuccessful()) {
log.error("UploadApiLogIntercepter error" ) ; // log.error("UploadApiLogIntercepter error" ) ;
notificationService.send("日志上传告警: 请求响应异常,检查 API 源是否正常"); // notificationService.send("日志上传告警: 请求响应异常,检查 API 源是否正常");
} else { // } else {
log.info("UploadApiLogIntercepter success"); // log.info("UploadApiLogIntercepter success");
} // }
} // }
}); // });
} }
} }

@ -1,7 +1,9 @@
package cn.teammodel.controller.frontend; package cn.teammodel.controller.frontend;
import cn.teammodel.common.R; import cn.teammodel.common.R;
import cn.teammodel.model.entity.school.Teacher;
import cn.teammodel.repository.AppraiseRepository; import cn.teammodel.repository.AppraiseRepository;
import cn.teammodel.repository.TeacherRepository;
import cn.teammodel.service.EvaluationService; import cn.teammodel.service.EvaluationService;
import com.itextpdf.text.DocumentException; import com.itextpdf.text.DocumentException;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -17,6 +19,9 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@RestController @RestController
@RequestMapping("/") @RequestMapping("/")
@ -27,6 +32,8 @@ public class HelloController {
private EvaluationService evaluationService; private EvaluationService evaluationService;
@Resource @Resource
private AppraiseRepository appraiseRepository; private AppraiseRepository appraiseRepository;
@Resource
private TeacherRepository teacherRepository;
@Autowired @Autowired
private Environment env; private Environment env;
@ -35,7 +42,7 @@ public class HelloController {
@PreAuthorize("@ss.hasRole('admin')") @PreAuthorize("@ss.hasRole('admin')")
public R<String> hello() { public R<String> hello() {
System.out.println(SecurityContextHolder.getContext().getAuthentication()); System.out.println(SecurityContextHolder.getContext().getAuthentication());
return new R(200, "success","hello world"); return new R(200, "success","hello world");
} }
@GetMapping("public/free") @GetMapping("public/free")
@ -46,8 +53,11 @@ public class HelloController {
@GetMapping("public/curr") @GetMapping("public/curr")
public R<String> curr() { public R<String> curr() {
String curr = env.getProperty("curr"); String curr = env.getProperty("spring.env");
return new R(200, "success",curr); HashSet<String> set= new HashSet<String>() ;
set.add("1595321354");
List<Teacher> techers= teacherRepository.findAllByCodeAndIdIn("Base", set);
return new R(200, techers,curr);
} }
@GetMapping("public/pdf") @GetMapping("public/pdf")

@ -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

@ -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

@ -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

@ -9,7 +9,7 @@ spring:
# write_timeout: 10240 # write_timeout: 10240
env: dev
mvc: mvc:
pathmatch: pathmatch:
matching-strategy: ant_path_matcher matching-strategy: ant_path_matcher
@ -20,6 +20,7 @@ spring:
# 大小限制 # 大小限制
max-file-size: 10MB max-file-size: 10MB
#测试站数据库 #测试站数据库
env: dev
cloud: cloud:
azure: azure:
cosmos: cosmos:
@ -27,15 +28,21 @@ spring:
database: TEAMModelOS database: TEAMModelOS
key: JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A== key: JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A==
populate-query-metrics: true 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: security:
oauth2: oauth2:
resourceserver: resourceserver:
jwt: jwt:
issuer-uri: https://login.partner.microsoftonline.cn/4807e9cf-87b8-4174-aa5b-e76497d7392b/v2.0 issuer-uri: https://login.partner.microsoftonline.cn/4807e9cf-87b8-4174-aa5b-e76497d7392b/v2.0
audiences: 72643704-b2e7-4b26-b881-bd5865e7a7a5 audiences: 72643704-b2e7-4b26-b881-bd5865e7a7a5
profiles:
active: dev
#企业账户秘钥 #企业账户秘钥
spark: spark:
gpt: gpt:
@ -71,5 +78,4 @@ ies:
server-url-exam-rate: /common/exam/get-exam-point server-url-exam-rate: /common/exam/get-exam-point
server-url-art-analysis: /analysis/art/statistics server-url-art-analysis: /analysis/art/statistics
server-url-blob-sas-rcwld: /blob/sas-rcwld server-url-blob-sas-rcwld: /blob/sas-rcwld
server-url-exam-analysis-list: /common/exam/find-by-analysis server-url-exam-analysis-list: /common/exam/find-by-analysis
curr: default
Loading…
Cancel
Save