Эх сурвалжийг харах

[fix]
1、将用户点赞记录接口转换为用户收藏接口

chenchen 4 сар өмнө
parent
commit
ef354eef01

+ 6 - 1
application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/WebSiteTourismTravelNotesPublishController.java

@@ -8,6 +8,7 @@ import com.tourism.common.core.object.*;
 import com.tourism.common.core.util.MyCommonUtil;
 import com.tourism.common.core.util.MyModelUtil;
 import com.tourism.common.core.util.MyPageUtil;
+import com.tourism.common.core.validator.UpdateGroup;
 import com.tourism.common.log.annotation.OperationLog;
 import com.tourism.common.log.model.constant.SysOperationLogType;
 import com.tourism.common.sequence.wrapper.IdGeneratorWrapper;
@@ -188,7 +189,7 @@ public class WebSiteTourismTravelNotesPublishController {
     @PostMapping("/publishDraft")
     @Transactional
     public ResponseResult<Void> publishDraft(@RequestBody TourismProjectTravelNotesWriteDto tourismProjectTravelNotesWriteDto) {
-        String errorMessage = MyCommonUtil.getModelValidationError(tourismProjectTravelNotesWriteDto);
+        String errorMessage = MyCommonUtil.getModelValidationError(tourismProjectTravelNotesWriteDto,UpdateGroup.class);
         if (errorMessage != null) {
             return ResponseResult.success(null);
         }
@@ -340,6 +341,10 @@ public class WebSiteTourismTravelNotesPublishController {
     @OperationLog(type = SysOperationLogType.UPDATE)
     @PostMapping("/savePerfect")
     public ResponseResult<Void> savePerfect(@RequestBody WebsiteTourUserDto websiteTourUserDto) {
+        String errorMessage = MyCommonUtil.getModelValidationError(websiteTourUserDto, UpdateGroup.class);
+        if (errorMessage != null) {
+            return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
+        }
         Long userId = TokenData.takeFromRequest().getUserId();
         TourUser tourUser = tourUserService.getById(userId);
         TourUser tourUserModel = MyModelUtil.copyTo(tourUser, TourUser.class);

+ 2 - 2
application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/WebsiteTourismProjectTravelNotesController.java

@@ -101,7 +101,7 @@ public class WebsiteTourismProjectTravelNotesController {
     }
 
     /**
-     * 用户游记点赞
+     * 用户游记收藏
      * param travelNotesId 游记id
      * param type 0取消点赞 1点赞
      * @return 应答结果对象,包含查询结果集。
@@ -116,7 +116,7 @@ public class WebsiteTourismProjectTravelNotesController {
     }
 
     /**
-     * 用户是否对该游记进行点赞
+     * 用户是否对该游记进行收藏
      * param travelNotesId 游记id
      * @return 应答结果对象,包含查询结果集。
      */

+ 5 - 0
application-webadmin/src/main/java/com/tourism/webadmin/app/website/dto/WebsiteTourUserDto.java

@@ -1,6 +1,9 @@
 package com.tourism.webadmin.app.website.dto;
 
+import com.tourism.common.core.validator.UpdateGroup;
 import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
 import lombok.Data;
 
 /**
@@ -26,11 +29,13 @@ public class WebsiteTourUserDto {
     /**
      *  邮箱
      */
+    @NotBlank(message = "邮箱不能为空!", groups = {UpdateGroup.class})
     private String email;
 
     /**
      *  昵称
      */
+    @NotBlank(message = "昵称不能为空!", groups = {UpdateGroup.class})
     private String showName;