From 1f5b00a74962064182e8256bb78f6bd20ed48b87 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Mon, 29 Jul 2024 13:56:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/new_module/admin/AdminDataController.java | 2 +- src/main/resources/application-pro.yml | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminDataController.java b/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminDataController.java index 09930b1..d5884ca 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminDataController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/new_module/admin/AdminDataController.java @@ -223,7 +223,7 @@ public class AdminDataController { } } // 更新对象 - adminDataMapper.updateByPrimaryKeyWithBLOBs(adminDataWithBLOBs); + adminDataMapper.updateByPrimaryKeySelective(adminDataWithBLOBs); } catch (Exception e) { e.printStackTrace(); return new ResultEntity<>(HttpStatus.INTERNAL_SERVER_ERROR, "编辑失败请联系管理员!"); diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-pro.yml index 1c9ff60..a350ebe 100644 --- a/src/main/resources/application-pro.yml +++ b/src/main/resources/application-pro.yml @@ -12,8 +12,7 @@ spring: # 文件存储 file: type: local - path: /usr/local/tianzeProject/resource_center/uploadFile - + path: /usr/local/tianzeProject/resourceCenter/uploadFile timer: enable: false @@ -25,4 +24,7 @@ swagger: description: 天择外汇模拟交易WebAPI接口文档 contactName: 深圳天择教育科技有限公司 contactAddress: www.sztzjy.com - version: @project.version@ \ No newline at end of file + version: @project.version@ + +tch: + serverAddress: http://120.79.54.255:9998 \ No newline at end of file From 117ee4c9c56e1869d1c45a40901be36088aaf98f Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Mon, 29 Jul 2024 14:02:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-pro.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-pro.yml index a350ebe..e5c5cf8 100644 --- a/src/main/resources/application-pro.yml +++ b/src/main/resources/application-pro.yml @@ -3,9 +3,9 @@ spring: datasource: druid: db-type: mysql - url: jdbc:mysql://${DB_HOST:120.78.220.29}:${DB_PORT:3307}/${DB_NAME:resource_center}?useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true + url: jdbc:mysql://${DB_HOST:120.79.54.255}:${DB_PORT:3306}/${DB_NAME:resource_center}?useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true username: ${DB_USER:root} - password: ${DB_PWD:sztzjy2017} + password: ${DB_PWD:Sztzjy506} driver-class-name: com.mysql.cj.jdbc.Driver From b0567ebbb7d64a75b09391f73ab4fe04ef11216b Mon Sep 17 00:00:00 2001 From: whb <17803890193@163.com> Date: Mon, 29 Jul 2024 16:55:50 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=B9=B1=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../new_module/stu/StuJupyterController.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuJupyterController.java b/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuJupyterController.java index d64e75f..44aa672 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuJupyterController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/new_module/stu/StuJupyterController.java @@ -17,6 +17,7 @@ import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPut; +import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; @@ -317,8 +318,6 @@ public class StuJupyterController { } - - try (CloseableHttpClient client = HttpClients.createDefault()) { String notebookContent = "{" + "\"cells\": [" @@ -354,19 +353,12 @@ public class StuJupyterController { + "}"; - - - - // 在根目录下创建新的笔记本 HttpPut createNotebookRequest = new HttpPut(JUPYTER_URL + "/api/contents/"+name+".ipynb"); - - - createNotebookRequest.addHeader("Authorization", "token " + adminJupyterTokenList.get(0).getToken()); - createNotebookRequest.addHeader("Content-Type", "application/json"); - createNotebookRequest.setEntity(new StringEntity("{\"type\": \"notebook\", \"content\": " + notebookContent + "}")); - + createNotebookRequest.addHeader("Content-Type", "application/json charset=UTF-8"); + //createNotebookRequest.setEntity(new StringEntity("{\"type\": \"notebook\", \"content\": " + notebookContent + "}")); + createNotebookRequest.setEntity(new StringEntity("{\"type\": \"notebook\", \"content\": " + notebookContent + "}", ContentType.APPLICATION_JSON.withCharset("UTF-8"))); try (CloseableHttpResponse createNotebookResponse = client.execute(createNotebookRequest)) { int statusCode = createNotebookResponse.getStatusLine().getStatusCode(); if (statusCode == 201) {