From 6314e0fa48921b57c3e57efeb5965ff73c7d53e3 Mon Sep 17 00:00:00 2001 From: ronger Date: Thu, 13 Jan 2022 22:21:51 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=8C=BA=E5=88=86=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/rymcu/forest/service/impl/TagServiceImpl.java | 4 ++-- .../java/com/rymcu/forest/service/impl/TopicServiceImpl.java | 4 ++-- .../com/rymcu/forest/web/api/common/UploadController.java | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/rymcu/forest/service/impl/TagServiceImpl.java b/src/main/java/com/rymcu/forest/service/impl/TagServiceImpl.java index 62504c8..09b4680 100644 --- a/src/main/java/com/rymcu/forest/service/impl/TagServiceImpl.java +++ b/src/main/java/com/rymcu/forest/service/impl/TagServiceImpl.java @@ -144,7 +144,7 @@ public class TagServiceImpl extends AbstractService implements TagService { newTag.setTagTitle(tag.getTagTitle()); newTag.setTagUri(tag.getTagUri()); if (StringUtils.isNotBlank(tag.getTagIconPath()) && tag.getTagIconPath().contains("base64")) { - String tagIconPath = UploadController.uploadBase64File(tag.getTagIconPath(), 0); + String tagIconPath = UploadController.uploadBase64File(tag.getTagIconPath(), 2); newTag.setTagIconPath(tagIconPath); } else { newTag.setTagIconPath(tag.getTagIconPath()); @@ -158,7 +158,7 @@ public class TagServiceImpl extends AbstractService implements TagService { } else { tag.setUpdatedTime(new Date()); if (StringUtils.isNotBlank(tag.getTagIconPath()) && tag.getTagIconPath().contains("base64")) { - String tagIconPath = UploadController.uploadBase64File(tag.getTagIconPath(), 0); + String tagIconPath = UploadController.uploadBase64File(tag.getTagIconPath(), 2); tag.setTagIconPath(tagIconPath); } result = tagMapper.update(tag.getIdTag(), tag.getTagUri(), tag.getTagIconPath(), tag.getTagStatus(), tag.getTagDescription(), tag.getTagReservation()); diff --git a/src/main/java/com/rymcu/forest/service/impl/TopicServiceImpl.java b/src/main/java/com/rymcu/forest/service/impl/TopicServiceImpl.java index 4b3d021..8ee2856 100644 --- a/src/main/java/com/rymcu/forest/service/impl/TopicServiceImpl.java +++ b/src/main/java/com/rymcu/forest/service/impl/TopicServiceImpl.java @@ -66,7 +66,7 @@ public class TopicServiceImpl extends AbstractService implements TopicSer newTopic.setTopicTitle(topic.getTopicTitle()); newTopic.setTopicUri(topic.getTopicUri()); if (StringUtils.isNotBlank(topic.getTopicIconPath()) && topic.getTopicIconPath().contains("base64")) { - String topicIconPath = UploadController.uploadBase64File(topic.getTopicIconPath(), 0); + String topicIconPath = UploadController.uploadBase64File(topic.getTopicIconPath(), 3); newTopic.setTopicIconPath(topicIconPath); } else { newTopic.setTopicIconPath(topic.getTopicIconPath()); @@ -81,7 +81,7 @@ public class TopicServiceImpl extends AbstractService implements TopicSer result = topicMapper.insertSelective(newTopic); } else { if (StringUtils.isNotBlank(topic.getTopicIconPath()) && topic.getTopicIconPath().contains("base64")) { - String topicIconPath = UploadController.uploadBase64File(topic.getTopicIconPath(), 0); + String topicIconPath = UploadController.uploadBase64File(topic.getTopicIconPath(), 3); topic.setTopicIconPath(topicIconPath); } topic.setUpdatedTime(new Date()); diff --git a/src/main/java/com/rymcu/forest/web/api/common/UploadController.java b/src/main/java/com/rymcu/forest/web/api/common/UploadController.java index 565a231..5ea38c9 100644 --- a/src/main/java/com/rymcu/forest/web/api/common/UploadController.java +++ b/src/main/java/com/rymcu/forest/web/api/common/UploadController.java @@ -57,7 +57,10 @@ public class UploadController { typePath = "article"; break; case 2: - typePath = "tags"; + typePath = "tag"; + break; + case 3: + typePath = "topic"; break; default: typePath = "images";