feat(resource): 添加模型图片上传和评论功能
- 新增 ModelImage、ModelImageComment 和 ModelImageLike 等相关实体类 - 实现图片上传、发布和点赞功能 - 添加评论和评论点赞功能 - 集成支付宝支付相关配置和接口feature/comment
parent
9cd8da3803
commit
1eeec91626
|
@ -28,11 +28,11 @@
|
|||
|
||||
<!-- https://mvnrepository.com/artifact/com.alipay.sdk/alipay-sdk-java -->
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alipay.sdk</groupId>-->
|
||||
<!-- <artifactId>alipay-sdk-java</artifactId>-->
|
||||
<!-- <version>4.40.30.ALL</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.alipay.sdk</groupId>
|
||||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>4.40.30.ALL</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.mcwl;
|
||||
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.mcwl.pay.config.AliConfig;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||
import org.springframework.amqp.support.converter.MessageConverter;
|
||||
|
@ -8,6 +9,7 @@ import org.springframework.boot.SpringApplication;
|
|||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
/**
|
||||
|
@ -16,6 +18,7 @@ import org.springframework.context.annotation.Bean;
|
|||
* @author mcwl
|
||||
*/
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
@EnableConfigurationProperties(AliConfig.class)
|
||||
public class McWlApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,65 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.common.utils.oss.OssUtil;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelImageLike;
|
||||
import com.mcwl.resource.domain.dto.ModelImageRes;
|
||||
import com.mcwl.resource.service.ModelImageLikeService;
|
||||
import com.mcwl.resource.service.ModelImageService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/modelImage")
|
||||
@RequiredArgsConstructor
|
||||
public class ModelImageController {
|
||||
|
||||
private final ModelImageService modelImageService;
|
||||
|
||||
private final ModelImageLikeService modelImageLikeService;
|
||||
|
||||
|
||||
/**
|
||||
* 图片上传
|
||||
*/
|
||||
@GetMapping("/upload")
|
||||
public AjaxResult upload(MultipartFile file) {
|
||||
|
||||
return AjaxResult.success("上传成功", OssUtil.uploadMultipartFile(file));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 图片发布
|
||||
*/
|
||||
@PostMapping("/publish")
|
||||
public AjaxResult publish(@RequestBody ModelImageRes modelImageRes) {
|
||||
ModelImage modelImage = new ModelImage();
|
||||
BeanUtil.copyProperties(modelImageRes, modelImage);
|
||||
modelImage.setCreateBy(SecurityUtils.getUsername());
|
||||
modelImage.setUpdateBy(SecurityUtils.getUsername());
|
||||
modelImage.setUpdateTime(new Date());
|
||||
modelImage.setStatus(3);
|
||||
modelImageService.save(modelImage);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片点赞/取消
|
||||
*/
|
||||
@GetMapping("/like/{imageId}")
|
||||
public AjaxResult like(@PathVariable Long imageId) {
|
||||
modelImageLikeService.like(imageId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.mcwl.pay.config;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "mall.mgt.aliPayConfig")
|
||||
@Configuration
|
||||
@Component
|
||||
public class AliConfig {
|
||||
|
||||
private String appId;
|
||||
private String privateKey;
|
||||
private String publicKey;
|
||||
private String gatewayUrl;
|
||||
}
|
|
@ -1,8 +1,11 @@
|
|||
package com.mcwl.resource.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mcwl.common.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**图片表
|
||||
|
@ -16,47 +19,66 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("model_image")
|
||||
public class ModelImage {
|
||||
public class ModelImage extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 图片地址(最多8张,切割)
|
||||
*/
|
||||
private Long image_paths;
|
||||
private String imagePaths;
|
||||
/**
|
||||
* 是否添加水印
|
||||
*/
|
||||
private Long has_watermark;
|
||||
private Integer hasWatermark;
|
||||
/**
|
||||
* 是否会员下载
|
||||
*/
|
||||
private Long is_member_download;
|
||||
private Integer isMemberDownload;
|
||||
/**
|
||||
* 是否不可下载
|
||||
*/
|
||||
private Long is_not_downloadable;
|
||||
private Integer isNotDownloadable;
|
||||
/**
|
||||
* 是否隐藏生成信息
|
||||
*/
|
||||
private Long hide_gen_info;
|
||||
private Integer hideGenInfo;
|
||||
/**
|
||||
* 图片标题(最多30字)
|
||||
*/
|
||||
private Long title;
|
||||
private String title;
|
||||
/**
|
||||
* 图片标签(多个,切割)
|
||||
*/
|
||||
private Long tags;
|
||||
private String tags;
|
||||
/**
|
||||
* 描述信息(最多500)
|
||||
*/
|
||||
private Long description;
|
||||
private String description;
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
* 在线生成数
|
||||
*/
|
||||
private Long del_flag;
|
||||
private Integer onlineGenNum;
|
||||
/**
|
||||
* 下载数
|
||||
*/
|
||||
private Integer downloadNum;
|
||||
/**
|
||||
* 返图数
|
||||
*/
|
||||
private Integer returnNum;
|
||||
/**
|
||||
* 点赞数
|
||||
*/
|
||||
private Integer likeNum;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
package com.mcwl.resource.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mcwl.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 图片评论
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("model_image_comment")
|
||||
public class ModelImageComment extends BaseEntity {
|
||||
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 图片id
|
||||
*/
|
||||
private Long modelImageId;
|
||||
|
||||
/**
|
||||
* 评论内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 父评论id
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 点赞数
|
||||
*/
|
||||
private Integer likeNum;
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.mcwl.resource.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mcwl.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 图片评论点赞
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("model_image_comment_like")
|
||||
public class ModelImageCommentLike extends BaseEntity {
|
||||
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
private Long modelImageCommentId;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.mcwl.resource.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mcwl.common.core.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 图片点赞表
|
||||
*/
|
||||
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ModelImageLike extends BaseEntity {
|
||||
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 图片id
|
||||
*/
|
||||
private Long modelImageId;
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.mcwl.resource.domain.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class ModelImageRes {
|
||||
/**
|
||||
* 图片地址(最多8张,切割)
|
||||
*/
|
||||
@NotBlank(message = "图片地址不能为空")
|
||||
private String imagePaths;
|
||||
/**
|
||||
* 是否添加水印
|
||||
*/
|
||||
private Integer hasWatermark;
|
||||
/**
|
||||
* 是否会员下载
|
||||
*/
|
||||
private Integer isMemberDownload;
|
||||
/**
|
||||
* 是否不可下载
|
||||
*/
|
||||
private Integer isNotDownloadable;
|
||||
/**
|
||||
* 是否隐藏生成信息
|
||||
*/
|
||||
private Integer hideGenInfo;
|
||||
/**
|
||||
* 图片标题(最多30字)
|
||||
*/
|
||||
@NotBlank(message = "图片标题不能为空")
|
||||
private String title;
|
||||
/**
|
||||
* 图片标签(多个,切割)
|
||||
*/
|
||||
private String tags;
|
||||
/**
|
||||
* 描述信息(最多500)
|
||||
*/
|
||||
private String description;
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.mcwl.resource.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.resource.domain.ModelImageComment;
|
||||
import com.mcwl.resource.domain.ModelImageCommentLike;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ModelImageCommentLikeMapper extends BaseMapper<ModelImageCommentLike> {
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.mcwl.resource.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelImageComment;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ModelImageCommentMapper extends BaseMapper<ModelImageComment> {
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.mcwl.resource.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelImageLike;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ModelImageLikeMapper extends BaseMapper<ModelImageLike> {
|
||||
ModelImageLike getLikeImage(Long userId, Long imageId);
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.mcwl.resource.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ModelImageMapper extends BaseMapper<ModelImage> {
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.mcwl.resource.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.resource.domain.ModelImageComment;
|
||||
import com.mcwl.resource.domain.ModelImageCommentLike;
|
||||
|
||||
|
||||
public interface ModelImageCommentLikeService extends IService<ModelImageCommentLike> {
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.mcwl.resource.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelImageComment;
|
||||
|
||||
|
||||
public interface ModelImageCommentService extends IService<ModelImageComment> {
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.mcwl.resource.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelImageLike;
|
||||
|
||||
|
||||
public interface ModelImageLikeService extends IService<ModelImageLike> {
|
||||
|
||||
void like(Long imageId);
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.mcwl.resource.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||
|
||||
|
||||
public interface ModelImageService extends IService<ModelImage> {
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mcwl.resource.domain.ModelImageComment;
|
||||
import com.mcwl.resource.domain.ModelImageCommentLike;
|
||||
import com.mcwl.resource.mapper.ModelImageCommentLikeMapper;
|
||||
import com.mcwl.resource.mapper.ModelImageCommentMapper;
|
||||
import com.mcwl.resource.service.ModelImageCommentLikeService;
|
||||
import com.mcwl.resource.service.ModelImageCommentService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ModelImageCommentLikeServiceImpl extends ServiceImpl<ModelImageCommentLikeMapper, ModelImageCommentLike> implements ModelImageCommentLikeService {
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelImageComment;
|
||||
import com.mcwl.resource.mapper.ModelImageCommentMapper;
|
||||
import com.mcwl.resource.mapper.ModelImageMapper;
|
||||
import com.mcwl.resource.service.ModelImageCommentService;
|
||||
import com.mcwl.resource.service.ModelImageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ModelImageCommentServiceImpl extends ServiceImpl<ModelImageCommentMapper, ModelImageComment> implements ModelImageCommentService {
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.exception.ServiceException;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelImageLike;
|
||||
import com.mcwl.resource.mapper.ModelImageLikeMapper;
|
||||
import com.mcwl.resource.mapper.ModelImageMapper;
|
||||
import com.mcwl.resource.service.ModelImageLikeService;
|
||||
import com.mcwl.resource.service.ModelImageService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ModelImageLikeServiceImpl extends ServiceImpl<ModelImageLikeMapper, ModelImageLike> implements ModelImageLikeService {
|
||||
|
||||
private final ModelImageMapper modelImageMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void like(Long imageId) {
|
||||
ModelImage modelImage = modelImageMapper.selectById(imageId);
|
||||
if (Objects.isNull(modelImage)) {
|
||||
throw new ServiceException("该图片不存在或已下架");
|
||||
}
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
ModelImageLike modelImageLike = baseMapper.getLikeImage(userId, imageId);
|
||||
if (Objects.nonNull(modelImageLike)) {
|
||||
if (Objects.equals(modelImageLike.getDelFlag(), "0")) {
|
||||
modelImageLike.setDelFlag("1");
|
||||
modelImage.setLikeNum(modelImage.getLikeNum() - 1);
|
||||
} else {
|
||||
modelImageLike.setDelFlag("0");
|
||||
modelImage.setLikeNum(modelImage.getLikeNum() + 1);
|
||||
}
|
||||
// 更新点赞记录
|
||||
baseMapper.updateById(modelImageLike);
|
||||
// 更新图片点赞数
|
||||
modelImageMapper.updateById(modelImage);
|
||||
return;
|
||||
}
|
||||
|
||||
// 添加点赞记录
|
||||
modelImageLike = new ModelImageLike();
|
||||
modelImageLike.setUserId(userId);
|
||||
modelImageLike.setModelImageId(imageId);
|
||||
modelImageLike.setCreateBy(SecurityUtils.getUsername());
|
||||
modelImageLike.setUpdateBy(SecurityUtils.getUsername());
|
||||
modelImageLike.setUpdateTime(new Date());
|
||||
baseMapper.insert(modelImageLike);
|
||||
|
||||
// 更新图片点赞数
|
||||
modelImage.setLikeNum(modelImage.getLikeNum() + 1);
|
||||
modelImageMapper.updateById(modelImage);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.resource.domain.MallProductLike;
|
||||
import com.mcwl.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||
import com.mcwl.resource.mapper.MallProductLikeMapper;
|
||||
import com.mcwl.resource.mapper.ModelImageMapper;
|
||||
import com.mcwl.resource.service.MallProductLikeService;
|
||||
import com.mcwl.resource.service.MallProductService;
|
||||
import com.mcwl.resource.service.ModelImageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ModelImageServiceImpl extends ServiceImpl<ModelImageMapper, ModelImage> implements ModelImageService {
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mcwl.resource.mapper.ModelImageLikeMapper">
|
||||
|
||||
<resultMap type="modelImageLike" id="ModelImageLikeResult">
|
||||
<id property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="modelImageId" column="model_image_id"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectModelImageLikeVo">
|
||||
select id,
|
||||
user_id,
|
||||
model_image_id,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
del_flag,
|
||||
remark
|
||||
from model_image_like
|
||||
</sql>
|
||||
|
||||
<select id="getLikeImage" resultMap="ModelImageLikeResult">
|
||||
<include refid="selectModelImageLikeVo"/>
|
||||
where user_id = #{userId}
|
||||
and model_image_id = #{imageId}
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue