|
|
@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSON; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
import com.bnyer.common.core.constant.TiktokConstant; |
|
|
import com.bnyer.common.core.constant.TiktokConstant; |
|
|
import com.bnyer.common.core.domain.Creator; |
|
|
import com.bnyer.common.core.domain.*; |
|
|
import com.bnyer.common.core.domain.InviteLog; |
|
|
|
|
|
import com.bnyer.common.core.domain.TiktokImg; |
|
|
|
|
|
import com.bnyer.common.core.domain.VerifyLog; |
|
|
|
|
|
import com.bnyer.common.core.dto.CreatorDto; |
|
|
import com.bnyer.common.core.dto.CreatorDto; |
|
|
import com.bnyer.common.core.dto.CreatorPageDto; |
|
|
import com.bnyer.common.core.dto.CreatorPageDto; |
|
|
import com.bnyer.common.core.dto.VerifyCreatorDto; |
|
|
import com.bnyer.common.core.dto.VerifyCreatorDto; |
|
|
@ -16,10 +13,7 @@ import com.bnyer.common.core.exception.ServiceException; |
|
|
import com.bnyer.common.core.utils.Sm4Util; |
|
|
import com.bnyer.common.core.utils.Sm4Util; |
|
|
import com.bnyer.common.core.utils.StringUtils; |
|
|
import com.bnyer.common.core.utils.StringUtils; |
|
|
import com.bnyer.common.core.utils.uuid.IdUtils; |
|
|
import com.bnyer.common.core.utils.uuid.IdUtils; |
|
|
import com.bnyer.system.mapper.CreatorMapper; |
|
|
import com.bnyer.system.mapper.*; |
|
|
import com.bnyer.system.mapper.InviteLogMapper; |
|
|
|
|
|
import com.bnyer.system.mapper.TiktokImgMapper; |
|
|
|
|
|
import com.bnyer.system.mapper.VerifyLogMapper; |
|
|
|
|
|
import com.bnyer.system.service.ICreatorService; |
|
|
import com.bnyer.system.service.ICreatorService; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.codec.digest.Md5Crypt; |
|
|
import org.apache.commons.codec.digest.Md5Crypt; |
|
|
@ -53,11 +47,14 @@ public class CreatorServiceImpl implements ICreatorService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private InviteLogMapper inviteLogMapper; |
|
|
private InviteLogMapper inviteLogMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private CommonImgsMapper commonImgsMapper; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void insertRobot() { |
|
|
public void insertRobot() { |
|
|
//批量生成3个机器人
|
|
|
//批量生成3个机器人
|
|
|
for (int i = 0; i < 3; i++) { |
|
|
for (int i = 0; i < 4; i++) { |
|
|
Creator creator = new Creator(); |
|
|
Creator creator = new Creator(); |
|
|
creator.setIsRobot("1"); |
|
|
creator.setIsRobot("1"); |
|
|
creator.setCreateTime(new Date()); |
|
|
creator.setCreateTime(new Date()); |
|
|
@ -112,6 +109,31 @@ public class CreatorServiceImpl implements ICreatorService { |
|
|
}while (creatorByPhone != null); |
|
|
}while (creatorByPhone != null); |
|
|
creator.setPhone(robotPhone); |
|
|
creator.setPhone(robotPhone); |
|
|
creatorMapper.insert(creator); |
|
|
creatorMapper.insert(creator); |
|
|
|
|
|
|
|
|
|
|
|
//获取公共素材库图片
|
|
|
|
|
|
LambdaQueryWrapper<CommonImgs> commonImgsWrapper = new LambdaQueryWrapper(); |
|
|
|
|
|
commonImgsWrapper.eq(CommonImgs::getType,"0"); |
|
|
|
|
|
commonImgsWrapper.eq(CommonImgs::getIsShow,"1"); |
|
|
|
|
|
List<String> commonImgs = commonImgsMapper.selectList(commonImgsWrapper).stream().map(CommonImgs::getImgUrl).collect(Collectors.toList()); |
|
|
|
|
|
//设置12张发布图片数据
|
|
|
|
|
|
for (int j = 0; j < 12; j++) { |
|
|
|
|
|
TiktokImg robotImg = new TiktokImg(); |
|
|
|
|
|
robotImg.setCreatorId(creator.getId()); |
|
|
|
|
|
robotImg.setStatus("2"); |
|
|
|
|
|
robotImg.setIsOriginal("0"); |
|
|
|
|
|
robotImg.setCreateTime(new Date()); |
|
|
|
|
|
robotImg.setUpdateTime(new Date()); |
|
|
|
|
|
robotImg.setSort(0); |
|
|
|
|
|
robotImg.setIsShow("1"); |
|
|
|
|
|
robotImg.setGreatNum(IdUtils.numberGen()); |
|
|
|
|
|
robotImg.setCollectionNum(IdUtils.numberGen()); |
|
|
|
|
|
robotImg.setDownloadNum(IdUtils.numberGen()); |
|
|
|
|
|
robotImg.setTypeId(1L); |
|
|
|
|
|
//随机获取一张头像图片
|
|
|
|
|
|
Collections.shuffle(commonImgs); |
|
|
|
|
|
robotImg.setImgUrl(commonImgs.get(0)); |
|
|
|
|
|
tiktokImgMapper.insert(robotImg); |
|
|
|
|
|
} |
|
|
log.debug("【图文平台后台】生成了机器人艺术家:{}", JSON.toJSONString(creator.getPhone())); |
|
|
log.debug("【图文平台后台】生成了机器人艺术家:{}", JSON.toJSONString(creator.getPhone())); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|