diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelCommentController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelCommentController.java index be291c7..0d1f003 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelCommentController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/ModelCommentController.java @@ -43,8 +43,8 @@ public class ModelCommentController { @ApiOperation(value = "模型点赞/取消") @RepeatSubmit @GetMapping("/modelLike/{modelId}") - public AjaxResult like(@PathVariable Long imageId) { - modelLikeService.like(imageId); + public AjaxResult like(@PathVariable Long modelId) { + modelLikeService.like(modelId); return AjaxResult.success(); } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/domain/dto/ModelImagePageRes.java b/mcwl-resource/src/main/java/com/mcwl/resource/domain/dto/ModelImagePageRes.java index df04fce..72a72b5 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/domain/dto/ModelImagePageRes.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/domain/dto/ModelImagePageRes.java @@ -1,10 +1,12 @@ package com.mcwl.resource.domain.dto; +import com.fasterxml.jackson.annotation.JsonFormat; import com.mcwl.common.core.page.PageDomain; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; import java.util.Date; @@ -27,12 +29,14 @@ public class ModelImagePageRes extends PageDomain { * 开始时间 */ @ApiModelProperty(value = "开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date startTime; /** * 结束时间 */ @ApiModelProperty(value = "结束时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date endTime; diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/mapper/ModelImageLikeMapper.java b/mcwl-resource/src/main/java/com/mcwl/resource/mapper/ModelImageLikeMapper.java index 3395100..e389a5f 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/mapper/ModelImageLikeMapper.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/mapper/ModelImageLikeMapper.java @@ -10,5 +10,5 @@ import org.apache.ibatis.annotations.Param; public interface ModelImageLikeMapper extends BaseMapper { ModelImageLike getLikeImage(@Param("userId") Long userId, @Param("imageId") Long imageId); - void updateDelFlagById(@Param("userId") Long userId, @Param("imageId") Long imageId); + void updateDelFlagById(ModelImageLike modelImageLike); } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/mapper/ModelLikeMapper.java b/mcwl-resource/src/main/java/com/mcwl/resource/mapper/ModelLikeMapper.java index 8d7be89..63e780d 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/mapper/ModelLikeMapper.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/mapper/ModelLikeMapper.java @@ -17,4 +17,5 @@ import org.apache.ibatis.annotations.Param; public interface ModelLikeMapper extends BaseMapper { ModelLike getLike(@Param("userId") Long userId, @Param("modelId") Long modelId); + void updateDelFlagById(ModelLike modelLike); } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelImageLikeServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelImageLikeServiceImpl.java index 82d5d37..0e549cc 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelImageLikeServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/ModelImageLikeServiceImpl.java @@ -59,7 +59,7 @@ public class ModelImageLikeServiceImpl extends ServiceImpl update model_image_like - set del_flag = !del_flag + set del_flag = #{delFlag} where user_id = #{userId} and model_image_id = #{imageId} diff --git a/mcwl-resource/src/main/resources/mapper/resource/ModelLikeMapper.xml b/mcwl-resource/src/main/resources/mapper/resource/ModelLikeMapper.xml index 51c3dd7..4032bd8 100644 --- a/mcwl-resource/src/main/resources/mapper/resource/ModelLikeMapper.xml +++ b/mcwl-resource/src/main/resources/mapper/resource/ModelLikeMapper.xml @@ -3,6 +3,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + update model_like + set del_flag = #{delFlag} + where user_id = #{userId} and model_id = #{modelId} +