From 5d59b9bec1d06679620e9a2a22b7fb8928e8210f Mon Sep 17 00:00:00 2001 From: wenyu441069198 <14186472+wenyu441069198@user.noreply.gitee.com> Date: Fri, 23 Aug 2024 12:03:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0=E4=B8=8A=E4=BC=A0=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../teaching/backend/controller/cms/CmsEssayController.java | 4 ++-- .../backend/service/impl/cms/CmsEssayServiceImpl.java | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/teaching/backend/controller/cms/CmsEssayController.java b/src/main/java/com/teaching/backend/controller/cms/CmsEssayController.java index 42bfc5d..19e79df 100644 --- a/src/main/java/com/teaching/backend/controller/cms/CmsEssayController.java +++ b/src/main/java/com/teaching/backend/controller/cms/CmsEssayController.java @@ -33,7 +33,7 @@ public class CmsEssayController { * @return */ @PostMapping("/add") - public BaseResponse addEssay(@RequestBody CmsEssay cmsEssay){ + public BaseResponse addEssay(CmsEssay cmsEssay){ return cmsEssayService.addEssay(cmsEssay); } @@ -74,7 +74,7 @@ public class CmsEssayController { * @return */ @PutMapping("/edit/status") - public BaseResponse editStatus(CmsEssay cmsEssay){ + public BaseResponse editStatus(@RequestBody CmsEssay cmsEssay){ return cmsEssayService.editStatus(cmsEssay); } } diff --git a/src/main/java/com/teaching/backend/service/impl/cms/CmsEssayServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/cms/CmsEssayServiceImpl.java index 5e091fc..61420bf 100644 --- a/src/main/java/com/teaching/backend/service/impl/cms/CmsEssayServiceImpl.java +++ b/src/main/java/com/teaching/backend/service/impl/cms/CmsEssayServiceImpl.java @@ -9,6 +9,7 @@ import com.teaching.backend.model.entity.cms.CmsEssay; import com.teaching.backend.service.cms.ICmsEssayService; import org.springframework.stereotype.Service; +import java.time.LocalDate; import java.util.List; /** @@ -24,6 +25,7 @@ public class CmsEssayServiceImpl extends ServiceImpl i @Override public BaseResponse addEssay(CmsEssay cmsEssay) { + cmsEssay.setPublishTime(LocalDate.now()); save(cmsEssay); return ResultUtils.success("添加成功"); }