{
+// @Override
+// public void serialize(OffsetDateTimeWrapper value, SerializerProvider serializers, com.fasterxml.jackson.core.JsonGenerator gen) throws IOException {
+// gen.writeString(value.getDateTime().format(DateTimeFormatter.ISO_OFFSET_DATE_TIME));
+// }
+
+ @Override
+ public void serialize(OffsetDateTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
+ gen.writeString(value.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME));
+ }
+}
diff --git a/flx-ai/src/main/resources/application.yml b/flx-ai/src/main/resources/application.yml
index 0f984de..26f77d5 100644
--- a/flx-ai/src/main/resources/application.yml
+++ b/flx-ai/src/main/resources/application.yml
@@ -43,6 +43,7 @@ management:
mybatis-plus:
mapper-locations: classpath*:/mapper/**/*.xml
typeAliasesPackage: com.pjilisense.flxai.entity
+ configLocation: classpath:/mybatis-config.xml
global-config:
db-config:
id-type: ASSIGN_ID
@@ -50,12 +51,12 @@ mybatis-plus:
#logic-delete-value: 1
#logic-not-delete-value: 0
banner: false
- configuration:
- log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
- map-underscore-to-camel-case: true
- cache-enabled: false
- call-setters-on-nulls: true
- jdbc-type-for-null: 'null'
+ #configuration:
+ #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+ #map-underscore-to-camel-case: true
+ #cache-enabled: false
+ #call-setters-on-nulls: true
+ #jdbc-type-for-null: 'null'
configuration-properties:
prefix:
blobType: BLOB
diff --git a/flx-ai/src/main/resources/mapper/postgres/FilesDao.xml b/flx-ai/src/main/resources/mapper/postgres/FilesDao.xml
new file mode 100644
index 0000000..607a628
--- /dev/null
+++ b/flx-ai/src/main/resources/mapper/postgres/FilesDao.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UPDATE files SET name = #{name,jdbcType=VARCHAR} WHERE id = #{id}
+
+
+
+ UPDATE files SET file_status = #{fileStatus,jdbcType=VARCHAR} WHERE id = #{id}
+
+
+
+ UPDATE files SET file_category = #{fileCategory,jdbcType=VARCHAR} WHERE id = #{id}
+
+
\ No newline at end of file
diff --git a/flx-ai/src/main/resources/mybatis-config.xml b/flx-ai/src/main/resources/mybatis-config.xml
new file mode 100644
index 0000000..0a56887
--- /dev/null
+++ b/flx-ai/src/main/resources/mybatis-config.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/flx-ai/src/test/java/test/com/pjilisense/flxai/controller/FilesControllerTest.java b/flx-ai/src/test/java/test/com/pjilisense/flxai/controller/FilesControllerTest.java
new file mode 100644
index 0000000..78f981b
--- /dev/null
+++ b/flx-ai/src/test/java/test/com/pjilisense/flxai/controller/FilesControllerTest.java
@@ -0,0 +1,84 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package test.com.pjilisense.flxai.controller;
+
+import com.alibaba.fastjson.JSON;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import test.com.pjilisense.flxai.TestUtils;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class FilesControllerTest {
+ @BeforeEach
+ public void setUpTestDataWithinTransaction() {
+ // set up test data within the transaction
+ }
+ @AfterEach
+ public void tearDownWithinTransaction() {
+ // execute "tear down" logic within the transaction
+ }
+
+ @Test
+ public void testGetAllAiTools() {
+ String url = TestUtils.WebconnectURL+"/api/robot/files/file_2FbUmaefz5b4";
+ String charset = TestUtils.UTF8;
+ try {
+ String body = TestUtils.doGet(url, charset);
+ System.out.println(body);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ @Test
+ public void testmodifyFileName() {
+ String url = TestUtils.WebconnectURL+"/api/robot/files/modifyFileName";
+ String charset = TestUtils.UTF8;
+ try {
+ Map params = new HashMap();
+ params.put("id","file_2FbUmaefz5b4");
+ params.put("name","jykc2.sql");
+ String body = TestUtils.doPost(url, JSON.toJSONString(params), charset);
+ System.out.println(body);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void testmodifyFileStatus() {
+ String url = TestUtils.WebconnectURL+"/api/robot/files/modifyFileStatus";
+ String charset = TestUtils.UTF8;
+ try {
+ Map params = new HashMap();
+ params.put("id","file_2FbUmaefz5b4");
+ params.put("fileStatus","1");
+ String body = TestUtils.doPost(url, JSON.toJSONString(params), charset);
+ System.out.println(body);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ @Test
+ public void testmodifyFileCategory() {
+ String url = TestUtils.WebconnectURL+"/api/robot/files/modifyFileCategory";
+ String charset = TestUtils.UTF8;
+ try {
+ Map params = new HashMap();
+ params.put("id","file_2FbUmaefz5b4");
+ params.put("fileCategory","1");
+ String body = TestUtils.doPost(url, JSON.toJSONString(params), charset);
+ System.out.println(body);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
\ No newline at end of file