26 changed files with 641 additions and 516 deletions
@ -0,0 +1,80 @@ |
|||
package com.bnyer.img.controller; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.bnyer.common.core.utils.Sm4Util; |
|||
import com.bnyer.common.core.utils.StringUtils; |
|||
import com.bnyer.common.core.web.controller.BaseController; |
|||
import com.bnyer.common.core.web.domain.AjaxResult; |
|||
import com.bnyer.common.core.web.page.TableDataInfo; |
|||
import com.bnyer.img.domain.TiktokUser; |
|||
import com.bnyer.img.dto.StatusDto; |
|||
import com.bnyer.img.dto.TiktokUserDto; |
|||
import com.bnyer.img.dto.TiktokUserPageDto; |
|||
import com.bnyer.img.service.CreatorService; |
|||
import com.bnyer.img.service.TiktokUserService; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import io.swagger.annotations.ApiParam; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Api(value = "img-creator-【后端】抖音平台艺术家接口",tags = "img-creator-【后端】抖音平台艺术家接口") |
|||
@RestController |
|||
@RequestMapping("/img/creator") |
|||
@Slf4j |
|||
public class CreatorController extends BaseController { |
|||
|
|||
@Autowired |
|||
private CreatorService creatorService; |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询艺术家分页") |
|||
@PostMapping("/page") |
|||
public TableDataInfo pageTiktokUser(@RequestBody @ApiParam("分页对象") TiktokUserPageDto dto){ |
|||
startPage(); |
|||
List<TiktokUser> tiktokUsers = creatorService.queryPage(dto); |
|||
for (TiktokUser tiktokUser : tiktokUsers) { |
|||
if(tiktokUser != null){ |
|||
if(StringUtils.isNotBlank(tiktokUser.getTiktokCode())){ |
|||
tiktokUser.setTiktokCode(Sm4Util.sm4Decrypt(tiktokUser.getTiktokCode())); |
|||
} |
|||
} |
|||
} |
|||
return getDataTable(tiktokUsers); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="修改艺术家") |
|||
@PostMapping(value = "/update") |
|||
public AjaxResult update(@RequestBody @ApiParam("艺术家对象") TiktokUserDto dto){ |
|||
log.debug("修改艺术家参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(creatorService.update(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="删除艺术家") |
|||
@DeleteMapping(value = "/delete/{ids}") |
|||
public AjaxResult deleteTiktokUser(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
|||
log.debug("删除艺术家参数为:{}", ids); |
|||
return AjaxResult.success(creatorService.delete(ids)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询艺术家详情") |
|||
@GetMapping(value = "/details/{id}") |
|||
public AjaxResult detailsTiktokUser(@PathVariable @ApiParam("主键id") Long id){ |
|||
return AjaxResult.success(creatorService.queryDetails(id)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="变更type显示状态") |
|||
@PostMapping(value = "/changeStatus") |
|||
public AjaxResult changeStatus(@Validated @RequestBody @ApiParam("type状态对象") StatusDto dto){ |
|||
log.debug("变更type参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(creatorService.changeStatus(dto.getId(),dto.getStatus())); |
|||
} |
|||
} |
|||
@ -0,0 +1,104 @@ |
|||
package com.bnyer.img.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.*; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/5/30 16:25 |
|||
*/ |
|||
/** |
|||
* 图文平台艺术家表 |
|||
*/ |
|||
@ApiModel(value="com-bnyer-img-domain-Creator") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_creator") |
|||
public class Creator extends BaseDomain { |
|||
/** |
|||
* 主键id |
|||
*/ |
|||
@TableId(value = "id", type = IdType.INPUT) |
|||
@ApiModelProperty(value="主键id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
@TableField(value = "`name`") |
|||
@ApiModelProperty(value="姓名") |
|||
private String name; |
|||
|
|||
/** |
|||
* 搜索码 |
|||
*/ |
|||
@TableField(value = "scan_code") |
|||
@ApiModelProperty(value="搜索码") |
|||
private String scanCode; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
@TableField(value = "phone") |
|||
@ApiModelProperty(value="手机号") |
|||
private String phone; |
|||
|
|||
/** |
|||
* 头像img地址 |
|||
*/ |
|||
@TableField(value = "img") |
|||
@ApiModelProperty(value="头像img地址") |
|||
private String img; |
|||
|
|||
/** |
|||
* 简介 |
|||
*/ |
|||
@TableField(value = "intro") |
|||
@ApiModelProperty(value="简介") |
|||
private String intro; |
|||
|
|||
/** |
|||
* 邀请码 |
|||
*/ |
|||
@TableField(value = "invite_code") |
|||
@ApiModelProperty(value="邀请码") |
|||
private String inviteCode; |
|||
|
|||
/** |
|||
* 状态(0->待审核;1->审核通过;2->审核拒绝) |
|||
*/ |
|||
@TableField(value = "status") |
|||
@ApiModelProperty(value="状态(0->待审核;1->审核通过;2->审核拒绝)") |
|||
private String status; |
|||
|
|||
/** |
|||
* 第三方平台账号详情地址 |
|||
*/ |
|||
@TableField(value = "url") |
|||
@ApiModelProperty(value="第三方平台账号详情地址") |
|||
private String url; |
|||
|
|||
/** |
|||
* 是否活跃(0->不活跃;1->活跃 连续10天以上更新内容) |
|||
*/ |
|||
@TableField(value = "is_hot") |
|||
@ApiModelProperty(value="是否活跃(0->不活跃;1->活跃 连续10天以上更新内容)") |
|||
private String isHot; |
|||
|
|||
/** |
|||
* 是否显示 (0->隐藏;1->显示) |
|||
*/ |
|||
@TableField(value = "is_show") |
|||
@ApiModelProperty(value="是否显示 (0->隐藏;1->显示)") |
|||
private String isShow; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,46 @@ |
|||
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.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("艺术家接收类") |
|||
public class CreatorDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="主键Id") |
|||
private Long id; |
|||
|
|||
@NotBlank(message = "姓名不能为空!") |
|||
@ApiModelProperty(value="姓名") |
|||
private String name; |
|||
|
|||
@NotBlank(message = "搜索码不能为空!") |
|||
@ApiModelProperty(value="搜索码") |
|||
private String scanCode; |
|||
|
|||
@NotBlank(message = "手机号不能为空!") |
|||
@ApiModelProperty(value="手机号") |
|||
private String phone; |
|||
|
|||
@NotBlank(message = "头像不能为空!") |
|||
@ApiModelProperty(value="头像img地址") |
|||
private String img; |
|||
|
|||
@ApiModelProperty(value="简介") |
|||
private String intro; |
|||
|
|||
@NotBlank(message = "邀请码不能为空!") |
|||
@ApiModelProperty(value="邀请码") |
|||
private String inviteCode; |
|||
|
|||
@NotBlank(message = "第三方平台账号详情地址不能为空!") |
|||
@ApiModelProperty(value="第三方平台账号详情地址") |
|||
private String url; |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
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 CreatorPageDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="姓名") |
|||
private String name; |
|||
|
|||
@ApiModelProperty(value="搜索码") |
|||
private String scanCode; |
|||
|
|||
@ApiModelProperty(value="手机号") |
|||
private String phone; |
|||
|
|||
@ApiModelProperty(value="状态(0->待审核;1->审核通过;2->审核拒绝)") |
|||
private String status; |
|||
|
|||
@ApiModelProperty(value="是否活跃(0->不活跃;1->活跃 连续10天以上更新内容)") |
|||
private String isHot; |
|||
|
|||
@ApiModelProperty(value="邀请码") |
|||
private String inviteCode; |
|||
|
|||
@ApiModelProperty(value="是否展示") |
|||
private String isShow; |
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
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; |
|||
import java.io.Serializable; |
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("抖音绑定手机入参") |
|||
public class TiktokBindPhoneDto implements Serializable { |
|||
|
|||
@NotNull(message = "用户Id不能为空!") |
|||
@ApiModelProperty(value = "用户Id") |
|||
private Long userId; |
|||
|
|||
@NotNull(message = "加密数据不能为空!") |
|||
@ApiModelProperty(value = "加密数据") |
|||
private String encryptedData; |
|||
|
|||
@NotNull(message = "sessionKey不能为空!") |
|||
@ApiModelProperty(value = "sessionKey") |
|||
private String sessionKey; |
|||
|
|||
@NotNull(message = "加密算法向量不能为空!") |
|||
@ApiModelProperty(value = "加密算法向量") |
|||
private String iv; |
|||
} |
|||
@ -1,41 +0,0 @@ |
|||
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; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/4/22 16:06 |
|||
*/ |
|||
@Getter |
|||
@Setter |
|||
@ApiModel("抖音艺术家接收类") |
|||
public class TiktokCreaterDto implements Serializable { |
|||
|
|||
@NotNull(message = "id不能为空") |
|||
@ApiModelProperty(value="id") |
|||
private Long id; |
|||
|
|||
@NotNull(message = "抖音号不能为空") |
|||
@ApiModelProperty(value="抖音号") |
|||
private String tiktokNum; |
|||
|
|||
@NotNull(message = "搜索码不能为空") |
|||
@ApiModelProperty(value="搜索码") |
|||
private String scanCode; |
|||
|
|||
@ApiModelProperty(value="邀请码") |
|||
private String inviteCode; |
|||
|
|||
@NotNull(message = "手机号不能为空!") |
|||
@ApiModelProperty(value="手机号") |
|||
private String phone; |
|||
|
|||
@ApiModelProperty(value="简介") |
|||
private String intro; |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.bnyer.img.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.bnyer.img.domain.Creator; |
|||
import com.bnyer.img.vo.CreatorVo; |
|||
import com.bnyer.img.vo.TiktokUserVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/5/30 16:25 |
|||
*/ |
|||
@Mapper |
|||
public interface CreatorMapper extends BaseMapper<Creator> { |
|||
|
|||
/** |
|||
* 查询艺术家图片列表 |
|||
* @return - |
|||
*/ |
|||
List<CreatorVo> queryThreeImgCreatorList(); |
|||
|
|||
/** |
|||
* 根据搜索码查询艺术家信息 |
|||
* @param scanCode 搜索码 |
|||
* @return - |
|||
*/ |
|||
CreatorVo queryThreeImgCreatorListByScanCode(@Param("scanCode") String scanCode); |
|||
} |
|||
@ -0,0 +1,63 @@ |
|||
package com.bnyer.img.service; |
|||
|
|||
import com.bnyer.img.domain.Creator; |
|||
import com.bnyer.img.dto.CreatorDto; |
|||
import com.bnyer.img.dto.CreatorPageDto; |
|||
import com.bnyer.img.vo.CreatorVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/5/30 16:30 |
|||
*/ |
|||
public interface CreatorService { |
|||
|
|||
/** |
|||
* 新增艺术家 |
|||
* @param dto 艺术家参数 |
|||
* @return - |
|||
*/ |
|||
int insertCreator(CreatorDto dto); |
|||
|
|||
/** |
|||
* 修改艺术家 |
|||
* @param dto 艺术家参数 |
|||
* @return - |
|||
*/ |
|||
int updateCreator(CreatorDto dto); |
|||
|
|||
/** |
|||
* 删除艺术家 |
|||
* @param ids 主键ids |
|||
* @return - |
|||
*/ |
|||
int delete(List<Long> ids); |
|||
|
|||
/** |
|||
* 查询艺术家分页 |
|||
* @param params 分页参数 |
|||
* @return - |
|||
*/ |
|||
List<Creator> queryPage(CreatorPageDto params); |
|||
|
|||
/** |
|||
* 查询艺术家详情 |
|||
* @param id 主键id |
|||
* @return - |
|||
*/ |
|||
Creator queryDetails(Long id); |
|||
|
|||
/** |
|||
* 查询艺术家首页3张图列表 |
|||
* @return - |
|||
*/ |
|||
List<CreatorVo> queryThreeImgCreatorList(); |
|||
|
|||
/** |
|||
* 根据搜索码查询艺术家 |
|||
* @param scanCode 搜索码 |
|||
* @return - |
|||
*/ |
|||
CreatorVo queryCreatorImgListByScanCode(String scanCode); |
|||
} |
|||
@ -0,0 +1,135 @@ |
|||
package com.bnyer.img.service.impl; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.bnyer.common.core.exception.ServiceException; |
|||
import com.bnyer.common.core.utils.Sm4Util; |
|||
import com.bnyer.common.redis.service.RedisService; |
|||
import com.bnyer.img.constants.RedisKeyConstant; |
|||
import com.bnyer.img.constants.TiktokConstant; |
|||
import com.bnyer.img.domain.Creator; |
|||
import com.bnyer.img.dto.CreatorDto; |
|||
import com.bnyer.img.dto.CreatorPageDto; |
|||
import com.bnyer.img.mapper.CreatorMapper; |
|||
import com.bnyer.img.service.CreatorService; |
|||
import com.bnyer.img.vo.CreatorVo; |
|||
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; |
|||
import java.util.concurrent.TimeUnit; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/5/30 16:46 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class CreatorServiceImpl implements CreatorService { |
|||
|
|||
@Autowired |
|||
private CreatorMapper creatorMapper; |
|||
|
|||
@Autowired |
|||
private RedisService redisService; |
|||
|
|||
/** |
|||
* 检查用户是否绑定过手机号 |
|||
* @param phone 手机号 |
|||
* @return - |
|||
*/ |
|||
private boolean checkPhone(String phone){ |
|||
LambdaQueryWrapper<Creator> wrapper = new LambdaQueryWrapper<>(); |
|||
wrapper.eq(Creator::getPhone, phone); |
|||
List<Creator> creators = creatorMapper.selectList(wrapper); |
|||
if(creators.size() > 0){ |
|||
return true; |
|||
}else{ |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 检查搜索码是否重复 |
|||
* @param scanCode 搜索码 |
|||
* @return - |
|||
*/ |
|||
private boolean checkScanCode(String scanCode){ |
|||
LambdaQueryWrapper<Creator> wrapper = new LambdaQueryWrapper<>(); |
|||
wrapper.eq(Creator::getScanCode, scanCode); |
|||
List<Creator> creators = creatorMapper.selectList(wrapper); |
|||
if(creators.size() > 0){ |
|||
return true; |
|||
}else{ |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int insertCreator(CreatorDto dto) { |
|||
//检查手机号是否存在
|
|||
boolean b1 = checkPhone(Sm4Util.sm4Encryption(dto.getPhone())); |
|||
if(b1){ |
|||
throw new ServiceException("当前手机号已绑定艺术家,请重新编辑!", TiktokConstant.BINDED_PHONE); |
|||
} |
|||
//检查搜索码是否重复
|
|||
boolean b = this.checkScanCode(dto.getScanCode()); |
|||
if(b){ |
|||
throw new ServiceException("搜索码重复,请重新编辑!",TiktokConstant.SCAN_CODE_REPEAT); |
|||
} |
|||
Creator creator = new Creator(); |
|||
creator.setName(dto.getName()); |
|||
creator.setIntro(dto.getIntro()); |
|||
creator.setImg(dto.getImg()); |
|||
creator.setScanCode(dto.getScanCode()); |
|||
creator.setInviteCode(dto.getInviteCode()); |
|||
creator.setUrl(dto.getUrl()); |
|||
creator.setPhone(Sm4Util.sm4Encryption(dto.getPhone())); |
|||
creator.setIsHot("0"); |
|||
creator.setStatus("0"); |
|||
creator.setIsShow("1"); |
|||
int insert = creatorMapper.insert(creator); |
|||
log.info("手机号【{}】成为艺术家成功!",dto.getPhone()); |
|||
return insert; |
|||
} |
|||
|
|||
@Override |
|||
public int updateCreator(CreatorDto dto) { |
|||
return 0; |
|||
} |
|||
|
|||
@Override |
|||
public int delete(List<Long> ids) { |
|||
return 0; |
|||
} |
|||
|
|||
@Override |
|||
public List<Creator> queryPage(CreatorPageDto params) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public Creator queryDetails(Long id) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public List<CreatorVo> queryThreeImgCreatorList() { |
|||
//走缓存
|
|||
String redisKey = RedisKeyConstant.TIKTOK_CREATOR_IMG_KEY; |
|||
if(redisService.hasKey(redisKey)){ |
|||
return JSONObject.parseArray(redisService.getCacheObject(redisKey).toString(), CreatorVo.class); |
|||
} |
|||
List<CreatorVo> creatorVo = creatorMapper.queryThreeImgCreatorList(); |
|||
redisService.setCacheObject(redisKey,creatorVo,3600L, TimeUnit.SECONDS); |
|||
return creatorVo; |
|||
} |
|||
|
|||
@Override |
|||
public CreatorVo queryCreatorImgListByScanCode(String scanCode) { |
|||
return creatorMapper.queryThreeImgCreatorListByScanCode(scanCode); |
|||
} |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
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 CreatorVo implements Serializable { |
|||
|
|||
@ApiModelProperty(value="id") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="搜索码") |
|||
private String scanCode; |
|||
|
|||
@ApiModelProperty(value="是否热门") |
|||
private String isHot; |
|||
|
|||
@ApiModelProperty(value="头像img地址") |
|||
private String img; |
|||
|
|||
@ApiModelProperty(value="序号") |
|||
private Integer sort; |
|||
|
|||
List<TiktokImgVo> imgList; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -1,24 +0,0 @@ |
|||
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 TiktokUserPhoneInfoVo implements Serializable { |
|||
|
|||
@ApiModelProperty(value="用户绑定的手机号") |
|||
private String phoneNumber; |
|||
|
|||
@ApiModelProperty(value="没有区号的手机号") |
|||
private String purePhoneNumber; |
|||
|
|||
@ApiModelProperty(value="区号") |
|||
private String countryCode; |
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
<?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.bnyer.img.mapper.CreatorMapper"> |
|||
<resultMap id="BaseResultMap" type="com.bnyer.img.domain.Creator"> |
|||
<!--@mbg.generated--> |
|||
<!--@Table img_creator--> |
|||
<id column="id" jdbcType="BIGINT" property="id" /> |
|||
<result column="name" jdbcType="VARCHAR" property="name" /> |
|||
<result column="scan_code" jdbcType="VARCHAR" property="scanCode" /> |
|||
<result column="phone" jdbcType="VARCHAR" property="phone" /> |
|||
<result column="img" jdbcType="VARCHAR" property="img" /> |
|||
<result column="intro" jdbcType="VARCHAR" property="intro" /> |
|||
<result column="invite_code" jdbcType="VARCHAR" property="inviteCode" /> |
|||
<result column="url" jdbcType="VARCHAR" property="url" /> |
|||
<result column="status" jdbcType="CHAR" property="status" /> |
|||
<result column="is_hot" jdbcType="CHAR" property="isHot" /> |
|||
<result column="is_show" jdbcType="CHAR" property="isShow" /> |
|||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
|||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
|||
<result column="sort" jdbcType="INTEGER" property="sort" /> |
|||
</resultMap> |
|||
|
|||
<resultMap id="CreatorThreeList" type="com.bnyer.img.vo.CreatorVo"> |
|||
<!--@mbg.generated--> |
|||
<!--@Table img_creator--> |
|||
<id column="id" jdbcType="BIGINT" property="id" /> |
|||
<result column="scan_code" jdbcType="VARCHAR" property="scanCode" /> |
|||
<result column="img" jdbcType="VARCHAR" property="img" /> |
|||
<result column="is_hot" jdbcType="CHAR" property="isHot" /> |
|||
<result column="sort" jdbcType="INTEGER" property="sort" /> |
|||
<collection property="imgList" ofType="com.bnyer.img.vo.TiktokImgVo" select="com.bnyer.img.mapper.TiktokImgMapper.queryThreeImgs" column="id"/> |
|||
</resultMap> |
|||
<sql id="Base_Column_List"> |
|||
<!--@mbg.generated--> |
|||
id, `name`, scan_code, phone, img, intro, invite_code, url, status, is_hot, is_show, create_time, |
|||
update_time, sort |
|||
</sql> |
|||
|
|||
<select id="queryThreeImgCreatorList" resultMap="CreatorThreeList"> |
|||
select |
|||
id, scan_code,img,is_hot,sort |
|||
from img_creator ic |
|||
where ic.is_show = '1' |
|||
order by ic.create_time desc |
|||
</select> |
|||
|
|||
<select id="queryThreeImgCreatorListByScanCode" resultMap="CreatorThreeList"> |
|||
select |
|||
id, scan_code,img,is_hot,sort |
|||
from img_creator ic |
|||
where ic.is_show = '1' and ic.scan_code = #{scanCode} |
|||
</select> |
|||
</mapper> |
|||
Loading…
Reference in new issue