29 changed files with 530 additions and 254 deletions
@ -0,0 +1,22 @@ |
|||||
|
package com.bnyer.img.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ApiModel("标签图片分页接收类") |
||||
|
public class SignImgPageDto extends BasePageDto { |
||||
|
|
||||
|
@NotNull(message = "分类id不能为空!") |
||||
|
@ApiModelProperty(value="分类id") |
||||
|
private Long typeId; |
||||
|
|
||||
|
@NotNull(message = "标签id不能为空!") |
||||
|
@ApiModelProperty(value="标签id") |
||||
|
private Long signId; |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.bnyer.img.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ApiModel("标签分类分页接收类") |
||||
|
public class SignTypePageDto extends BasePageDto { |
||||
|
|
||||
|
@NotNull(message = "分类id不能为空!") |
||||
|
@ApiModelProperty(value="分类id") |
||||
|
private Long typeId; |
||||
|
} |
||||
@ -1,81 +0,0 @@ |
|||||
package com.bnyer.img.service; |
|
||||
|
|
||||
import com.bnyer.img.domain.ImgSignRelation; |
|
||||
import com.bnyer.img.domain.Sign; |
|
||||
import com.bnyer.img.dto.ImgSignRelationPageDto; |
|
||||
import com.bnyer.img.dto.SignPageDto; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* @Author qyh |
|
||||
* @Date 2022/7/10 21:23 |
|
||||
* @Description |
|
||||
*/ |
|
||||
public interface ImgSignRelationService { |
|
||||
/** |
|
||||
* 新增imgSignRelation |
|
||||
* @param imgSignRelation |
|
||||
* @return |
|
||||
*/ |
|
||||
int insert(ImgSignRelation imgSignRelation); |
|
||||
|
|
||||
/** |
|
||||
* 修改imgSignRelation |
|
||||
* @param imgSignRelation - |
|
||||
* @return - |
|
||||
*/ |
|
||||
int update(ImgSignRelation imgSignRelation); |
|
||||
|
|
||||
/** |
|
||||
* 批量删除imgSignRelation |
|
||||
* @param ids ids |
|
||||
* @return - |
|
||||
*/ |
|
||||
int delete(List<Long> ids); |
|
||||
|
|
||||
/** |
|
||||
* 查询imgSignRelation分页 |
|
||||
* @param dto 分页对象 |
|
||||
* @return - |
|
||||
*/ |
|
||||
List<ImgSignRelation> queryPage(ImgSignRelationPageDto dto); |
|
||||
|
|
||||
/** |
|
||||
* 查询imgSignRelation详情 |
|
||||
* @param id 主键id |
|
||||
* @return - |
|
||||
*/ |
|
||||
ImgSignRelation queryDetails(Long id); |
|
||||
|
|
||||
/** |
|
||||
* 查询小程序imgSignRelation列表 |
|
||||
* @param imgId 图片id |
|
||||
* @return - |
|
||||
*/ |
|
||||
List<ImgSignRelation> queryListByImgId(String imgId); |
|
||||
|
|
||||
/** |
|
||||
* 查询小程序imgSignRelation列表 |
|
||||
* @param signId 标签id |
|
||||
* @return - |
|
||||
*/ |
|
||||
List<ImgSignRelation> queryListBySignId(String signId); |
|
||||
|
|
||||
|
|
||||
/** |
|
||||
* 变更显示状态 |
|
||||
* @param id 主键id |
|
||||
* @param status 状态 |
|
||||
* @return - |
|
||||
*/ |
|
||||
int changeStatus(Long id,String status); |
|
||||
|
|
||||
/** |
|
||||
* 根据列名+条件删除 |
|
||||
* @param columnName 要删除的列名 |
|
||||
* @param conditions 根据什么条件删除 |
|
||||
* @return |
|
||||
*/ |
|
||||
int deleteByColumn(String columnName,Long conditions); |
|
||||
} |
|
||||
@ -1,104 +0,0 @@ |
|||||
package com.bnyer.img.service.impl; |
|
||||
|
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
||||
import com.bnyer.common.core.utils.StringUtils; |
|
||||
import com.bnyer.img.domain.Banner; |
|
||||
import com.bnyer.img.domain.ImgSignRelation; |
|
||||
import com.bnyer.img.domain.Sign; |
|
||||
import com.bnyer.img.dto.ImgSignRelationPageDto; |
|
||||
import com.bnyer.img.dto.SignPageDto; |
|
||||
import com.bnyer.img.mapper.ImgSignRelationMapper; |
|
||||
import com.bnyer.img.service.ImgSignRelationService; |
|
||||
import lombok.extern.slf4j.Slf4j; |
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
import org.springframework.transaction.annotation.Transactional; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* @Author qyh |
|
||||
* @Date 2022/7/10 21:22 |
|
||||
* @Description |
|
||||
*/ |
|
||||
@Service |
|
||||
@Slf4j |
|
||||
public class ImgSignRelationServiceImpl implements ImgSignRelationService { |
|
||||
@Autowired |
|
||||
private ImgSignRelationMapper imgSignRelationMapper; |
|
||||
@Override |
|
||||
@Transactional(rollbackFor = Exception.class) |
|
||||
public int insert(ImgSignRelation imgSignRelation) { |
|
||||
return imgSignRelationMapper.insert(imgSignRelation); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
@Transactional(rollbackFor = Exception.class) |
|
||||
public int update(ImgSignRelation imgSignRelation) { |
|
||||
return imgSignRelationMapper.updateById(imgSignRelation); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
@Transactional(rollbackFor = Exception.class) |
|
||||
public int delete(List<Long> ids) { |
|
||||
return imgSignRelationMapper.deleteBatchIds(ids); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public List<ImgSignRelation> queryPage(ImgSignRelationPageDto dto) { |
|
||||
LambdaQueryWrapper<ImgSignRelation> wrapper = new LambdaQueryWrapper<>(); |
|
||||
if(dto.getImgId()!=null){ |
|
||||
wrapper.like(ImgSignRelation::getImgId,dto.getImgId()); |
|
||||
} |
|
||||
if(dto.getSignId()!=null){ |
|
||||
wrapper.eq(ImgSignRelation::getSignId, dto.getSignId()); |
|
||||
} |
|
||||
if(StringUtils.isNotBlank(dto.getIsShow())){ |
|
||||
wrapper.eq(ImgSignRelation::getIsShow, dto.getIsShow()); |
|
||||
} |
|
||||
wrapper.orderByDesc(ImgSignRelation::getSort); |
|
||||
return imgSignRelationMapper.selectList(wrapper); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public ImgSignRelation queryDetails(Long id) { |
|
||||
return imgSignRelationMapper.selectById(id); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public List<ImgSignRelation> queryListByImgId(String imgId) { |
|
||||
QueryWrapper<ImgSignRelation> wrapper = new QueryWrapper<>(); |
|
||||
wrapper.eq("img_id",imgId); |
|
||||
return imgSignRelationMapper.selectList(wrapper); |
|
||||
} |
|
||||
@Override |
|
||||
public List<ImgSignRelation> queryListBySignId(String signId) { |
|
||||
QueryWrapper<ImgSignRelation> wrapper = new QueryWrapper<>(); |
|
||||
wrapper.eq("sign_id",signId); |
|
||||
return imgSignRelationMapper.selectList(wrapper); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
@Transactional(rollbackFor = Exception.class) |
|
||||
public int changeStatus(Long id, String status) { |
|
||||
LambdaUpdateWrapper<ImgSignRelation> wrapper = new LambdaUpdateWrapper<>(); |
|
||||
wrapper.eq(ImgSignRelation::getId,id); |
|
||||
ImgSignRelation imgSignRelation = new ImgSignRelation(); |
|
||||
imgSignRelation.setIsShow(status); |
|
||||
return imgSignRelationMapper.update(imgSignRelation,wrapper); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
@Transactional(rollbackFor = Exception.class) |
|
||||
public int deleteByColumn(String columnName, Long conditions) { |
|
||||
QueryWrapper<ImgSignRelation> wrapper = new QueryWrapper<>(); |
|
||||
if (conditions!=null){ |
|
||||
wrapper.eq(columnName,conditions); |
|
||||
imgSignRelationMapper.delete(wrapper); |
|
||||
} |
|
||||
|
|
||||
return 0; |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,48 @@ |
|||||
|
package com.bnyer.img.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ApiModel("图片标签响应类") |
||||
|
public class ImgSignVo implements Serializable { |
||||
|
|
||||
|
@ApiModelProperty(value="id") |
||||
|
private Long id; |
||||
|
|
||||
|
@ApiModelProperty(value="图片地址") |
||||
|
private String imgUrl; |
||||
|
|
||||
|
@ApiModelProperty(value="用户id") |
||||
|
private Long creatorId; |
||||
|
|
||||
|
@ApiModelProperty(value="分类id") |
||||
|
private Long typeId; |
||||
|
|
||||
|
@ApiModelProperty(value="下载量") |
||||
|
private Integer downloadNum; |
||||
|
|
||||
|
@ApiModelProperty(value="点赞量") |
||||
|
private Integer greatNum; |
||||
|
|
||||
|
@ApiModelProperty(value="收藏量") |
||||
|
private Integer collectionNum; |
||||
|
|
||||
|
@ApiModelProperty(value="状态(0->待审核;1->审核通过;2->审核拒绝;3->已上架;4->已下架))") |
||||
|
private String status; |
||||
|
|
||||
|
@ApiModelProperty(value="是否热门(0->冷门;1->热门)") |
||||
|
private String isHot; |
||||
|
|
||||
|
@ApiModelProperty(value="标签列表") |
||||
|
private List<SignRelationVo> signList; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
package com.bnyer.img.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ApiModel("sign图片响应体") |
||||
|
public class SignImgVo implements Serializable { |
||||
|
@ApiModelProperty(value="标签id") |
||||
|
private Long signId; |
||||
|
|
||||
|
@ApiModelProperty(value="标签名称") |
||||
|
private String signName; |
||||
|
|
||||
|
@ApiModelProperty(value="背景图") |
||||
|
private String img; |
||||
|
|
||||
|
@ApiModelProperty(value="分类id") |
||||
|
private Long typeId; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.bnyer.img.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ApiModel("标签关系响应体") |
||||
|
public class SignRelationVo implements Serializable { |
||||
|
@ApiModelProperty(value="标签id") |
||||
|
private Long signId; |
||||
|
|
||||
|
@ApiModelProperty(value="标签名称") |
||||
|
private String signName; |
||||
|
|
||||
|
@ApiModelProperty(value="标签图片主键id") |
||||
|
private Long signImgRelationId; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.bnyer.img.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
@Getter |
||||
|
@Setter |
||||
|
@ApiModel("sign响应体") |
||||
|
public class SignVo implements Serializable { |
||||
|
@ApiModelProperty(value="主键id") |
||||
|
private Long id; |
||||
|
|
||||
|
@ApiModelProperty(value="标签名称") |
||||
|
private String name; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
} |
||||
Loading…
Reference in new issue