diff --git a/pom.xml b/pom.xml index 26564ce..4bcac48 100644 --- a/pom.xml +++ b/pom.xml @@ -203,6 +203,12 @@ 0.4.8 + + com.baomidou + mybatis-plus-generator + 3.5.11 + + diff --git a/src/main/java/com/cultural/heritage/controller/book/PhotoProductsController.java b/src/main/java/com/cultural/heritage/controller/book/PhotoProductsController.java index b35e33d..3108486 100644 --- a/src/main/java/com/cultural/heritage/controller/book/PhotoProductsController.java +++ b/src/main/java/com/cultural/heritage/controller/book/PhotoProductsController.java @@ -5,6 +5,7 @@ import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.cultural.heritage.annotation.AuthCheck; import com.cultural.heritage.common.BaseResponse; @@ -320,7 +321,15 @@ public class PhotoProductsController { PhotoProducts photoProducts = photoProductsService.getById(id); PhotoProductsMainInfoVO photoProductsMainInfoVO = new PhotoProductsMainInfoVO(); BeanUtils.copyProperties(photoProducts, photoProductsMainInfoVO); - photoProductsMainInfoVO.setRichText(DecoderUtils.decodeText(photoProductsMainInfoVO.getRichText())); + + String richText = photoProductsMainInfoVO.getRichText(); + try { + if (StringUtils.isNotBlank(richText)) { + photoProductsMainInfoVO.setRichText(DecoderUtils.decodeText(richText)); + } + } catch (Exception e) { + photoProductsMainInfoVO.setRichText(""); + } return ResultUtils.success(photoProductsMainInfoVO); } @@ -422,7 +431,14 @@ public class PhotoProductsController { // 封装成BookingPhotoProductsVO列表 PhotoProductsVO photoProductsVO = new PhotoProductsVO(); BeanUtils.copyProperties(photoProducts, photoProductsVO); - photoProductsVO.setRichText(DecoderUtils.decodeText(photoProductsVO.getRichText())); + String richText = photoProductsVO.getRichText(); + try { + if (StringUtils.isNotBlank(richText)) { + photoProductsVO.setRichText(DecoderUtils.decodeText(richText)); + } + } catch (Exception e) { + photoProducts.setRichText(""); + } photoProductsVO.setBookingDateVOList(bookingDateVOList); return ResultUtils.success(photoProductsVO); diff --git a/src/main/java/com/cultural/heritage/controller/good/GoodController.java b/src/main/java/com/cultural/heritage/controller/good/GoodController.java index b66f28a..acdbd05 100644 --- a/src/main/java/com/cultural/heritage/controller/good/GoodController.java +++ b/src/main/java/com/cultural/heritage/controller/good/GoodController.java @@ -486,7 +486,14 @@ public class GoodController { Good good = goodService.getById(id); ThrowUtils.throwIf(good == null, ErrorCode.OPERATION_ERROR, "商品不存在"); - good.setRichText(DecoderUtils.decodeText(good.getRichText())); + String richText = good.getRichText(); + try { + if (StringUtils.isNotBlank(richText)) { + good.setRichText(DecoderUtils.decodeText(richText)); + } + } catch (Exception e) { + good.setRichText(""); + } GoodPageVO goodPageVO = new GoodPageVO(); BeanUtils.copyProperties(good, goodPageVO); return ResultUtils.success(goodPageVO); @@ -610,6 +617,15 @@ public class GoodController { ThrowUtils.throwIf(good == null, ErrorCode.NOT_FOUND_ERROR, "商品不存在"); ServiceGoodVO serviceGoodVO = new ServiceGoodVO(); BeanUtils.copyProperties(good, serviceGoodVO); + + String richText = serviceGoodVO.getRichText(); + try { + if (StringUtils.isNotBlank(richText)) { + serviceGoodVO.setRichText(DecoderUtils.decodeText(richText)); + } + } catch (Exception e) { + serviceGoodVO.setRichText(""); + } Long goodVOId = serviceGoodVO.getId(); // 获取预约日期表和预约时间段表合并的结果集 List appointmentDateTimePeriodVOList = appointmentDateService.queryAppointmentDateDetailById(goodVOId); diff --git a/src/main/java/com/cultural/heritage/utils/UrlUtil.java b/src/main/java/com/cultural/heritage/utils/UrlUtil.java deleted file mode 100644 index cfa1f29..0000000 --- a/src/main/java/com/cultural/heritage/utils/UrlUtil.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.cultural.heritage.utils; - -//请求工具类 -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.net.URL; -import java.net.URLConnection; -import java.util.Iterator; -import java.util.Map; - -public class UrlUtil { - /** - * 向指定 URL 发送POST方法的请求 - * - * @param url 发送请求的 URL - * @return 所代表远程资源的响应结果 - */ - public static String sendPost(String url, Map paramMap) { - PrintWriter out = null; - BufferedReader in = null; - String result = ""; - - String param = ""; - Iterator it = paramMap.keySet().iterator(); - - while(it.hasNext()) { - String key = it.next(); - param += key + "=" + paramMap.get(key) + "&"; - } - - try { - URL realUrl = new URL(url); - // 打开和URL之间的连接 - URLConnection conn = realUrl.openConnection(); - // 设置通用的请求属性 - conn.setRequestProperty("accept", "*/*"); - conn.setRequestProperty("connection", "Keep-Alive"); - conn.setRequestProperty("Accept-Charset", "utf-8"); - conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); - // 发送POST请求必须设置如下两行 - conn.setDoOutput(true); - conn.setDoInput(true); - // 获取URLConnection对象对应的输出流 - out = new PrintWriter(conn.getOutputStream()); - // 发送请求参数 - out.print(param); - // flush输出流的缓冲 - out.flush(); - // 定义BufferedReader输入流来读取URL的响应 - in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); - String line; - while ((line = in.readLine()) != null) { - result += line; - } - } catch (Exception e) { - e.printStackTrace(); - } - //使用finally块来关闭输出流、输入流 - finally{ - try{ - if(out!=null){ - out.close(); - } - if(in!=null){ - in.close(); - } - } - catch(IOException ex){ - ex.printStackTrace(); - } - } - return result; - } -} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 4d2085f..a5351c2 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -10,7 +10,7 @@ spring: # max-lifetime: 120000 - # 开发环境 +# 开发环境 driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://123.249.108.160:3306/feiyi-sc?serverTimezone=Asia/Shanghai username: feiyi-sc @@ -31,6 +31,17 @@ spring: +# 新环境 +# driver-class-name: com.mysql.cj.jdbc.Driver +# url: jdbc:mysql://1.94.237.210:3306/feiyi?serverTimezone=Asia/Shanghai +# username: root +# password: Cxzyt331 +# hikari: +# maximum-pool-size: 20 +# max-lifetime: 120000 + + + # 生产环境 rabbitmq: @@ -44,7 +55,7 @@ spring: prefetch: 1 -# 测试环境 +# 测试环境 # rabbitmq: # host: 154.8.193.216 # port: 5672 @@ -56,18 +67,43 @@ spring: # prefetch: 1 +# 新环境 +# rabbitmq: +# host: 1.94.237.210 +# port: 5672 +# username: admin +# password: Cxzyt331 +# virtual-host: vhost +# listener: +# simple: +# prefetch: 1 + + servlet: + multipart: + max-file-size: 20MB + max-request-size: 20MB + + +# 开发环境 data: redis: port: 6379 host: 123.249.108.160 database: 0 password: yuanteng - servlet: - multipart: - max-file-size: 20MB - max-request-size: 20MB + + + +# 开发环境 +# data: +# redis: +# port: 6379 +# host: 1.94.237.210 +# database: 0 +# password: Cxzyt331 + springdoc: @@ -75,12 +111,12 @@ springdoc: server: - port: 9092 -# port: 8888 -# ssl: -# key-store: classpath:carboner.cn.jks -# key-store-password: 6gsn1hke4m4f7 -# key-store-type: JKS +# port: 9093 + port: 8888 + ssl: + key-store: classpath:carboner.cn.jks + key-store-password: 6gsn1hke4m4f7 + key-store-type: JKS servlet: context-path: /api @@ -94,8 +130,8 @@ mybatis-plus: mapper-locations: classpath:mapper/*.xml configuration: map-underscore-to-camel-case: false -# log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl +# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl global-config: db-config: logic-delete-field: isDelete #全局逻辑删除的实体字段名 @@ -136,6 +172,7 @@ wx: # notifyUrl: https://winning-mouse-internally.ngrok-free.app # notifyUrl: http://123.249.108.160:8888 # notifyUrl: http://154.8.193.216:9092 +# notifyUrl: http://154.8.193.216:9093 notifyUrl: https://www.carboner.cn:8888 #微信服务器地址