From 3deac71914d38bea89a0521fcb92e7d919c11927 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Thu, 21 Apr 2022 15:28:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- renren-admin/src/main/resources/application-dev.yml | 6 ++++++ renren-admin/src/main/resources/application-prod.yml | 4 +++- renren-admin/src/main/resources/application-test.yml | 8 +++++++- renren-admin/src/main/resources/application.yml | 5 ----- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/renren-admin/src/main/resources/application-dev.yml b/renren-admin/src/main/resources/application-dev.yml index f11dd7f0..20b7d853 100644 --- a/renren-admin/src/main/resources/application-dev.yml +++ b/renren-admin/src/main/resources/application-dev.yml @@ -49,6 +49,12 @@ spring: config: multi-statement-allow: true +#上传的静态资源配置 +resource: + root_url: 15.2.21.238 + path: /home/yth/files/ + devModelFilePath: /home/yth/files/resource + ##多数据源的配置,需要引用renren-dynamic-datasource #dynamic: # datasource: diff --git a/renren-admin/src/main/resources/application-prod.yml b/renren-admin/src/main/resources/application-prod.yml index 385d3856..55a3c001 100644 --- a/renren-admin/src/main/resources/application-prod.yml +++ b/renren-admin/src/main/resources/application-prod.yml @@ -32,6 +32,8 @@ spring: wall: config: multi-statement-allow: true +#上传的静态资源配置 resource: root_url: 15.2.21.238 - path: /home/yth/files/ \ No newline at end of file + path: /data/services/nengli/files/ + devModelFilePath: /data/services/nengli/files/resource \ No newline at end of file diff --git a/renren-admin/src/main/resources/application-test.yml b/renren-admin/src/main/resources/application-test.yml index 8e237325..00d88a91 100644 --- a/renren-admin/src/main/resources/application-test.yml +++ b/renren-admin/src/main/resources/application-test.yml @@ -31,4 +31,10 @@ spring: merge-sql: false wall: config: - multi-statement-allow: true \ No newline at end of file + multi-statement-allow: true + +#上传的静态资源配置 +resource: + root_url: 15.2.21.238 + path: /home/yth/files/ + devModelFilePath: /home/yth/files/resource \ No newline at end of file diff --git a/renren-admin/src/main/resources/application.yml b/renren-admin/src/main/resources/application.yml index 88c72531..7f120d30 100644 --- a/renren-admin/src/main/resources/application.yml +++ b/renren-admin/src/main/resources/application.yml @@ -1,8 +1,3 @@ -#上传的静态资源配置 -resource: - root_url: 15.2.21.238 - path: /home/yth/files/ - devModelFilePath: /home/yth/files/resource # Tomcat server: tomcat: From 5932ba8f8eac811e58657226e133372e07d9321b Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Thu, 21 Apr 2022 17:05:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8A=A0=E7=94=B3=E8=B4=AD=E8=BD=A6?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resourceCar/controller/ResourceCarController.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resourceCar/controller/ResourceCarController.java b/renren-admin/src/main/java/io/renren/modules/resourceCar/controller/ResourceCarController.java index 13c73656..f06ac6bb 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceCar/controller/ResourceCarController.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceCar/controller/ResourceCarController.java @@ -1,5 +1,6 @@ package io.renren.modules.resourceCar.controller; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; import io.renren.common.annotation.LogOperation; @@ -67,8 +68,12 @@ public class ResourceCarController { public Result save(@RequestBody ResourceCarDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - resourceCarService.insertOrUpdate(dto); - return new Result(); + if (ObjectUtil.isAllNotEmpty(dto.getResourceId()) || ObjectUtil.isAllNotEmpty(dto.getUserId())) { + resourceCarService.insertOrUpdate(dto); + return new Result(); + } else { + return new Result().error(500, "加申购车失败,请重试!"); + } } @DeleteMapping("/delete")