|
|
@ -0,0 +1,87 @@ |
|
|
|
package com.jbs.modules.sys.web; |
|
|
|
|
|
|
|
import com.jbs.common.utils.DateUtils; |
|
|
|
import com.jbs.common.utils.IdGen; |
|
|
|
import com.jbs.common.utils.IdUtils; |
|
|
|
import com.jbs.framework.utils.SecurityUtils; |
|
|
|
import com.jbs.modules.sce.pojo.dto.SceInfoDto; |
|
|
|
import com.jbs.modules.sce.pojo.dto.SceProcessDto; |
|
|
|
import com.jbs.modules.sce.service.SceInfoService; |
|
|
|
import com.jbs.modules.sce.service.SceProcessService; |
|
|
|
import com.jbs.modules.sys.pojo.entity.SysUser; |
|
|
|
import com.jbs.modules.sys.service.SysUserService; |
|
|
|
import com.jbs.modules.tips.pojo.dto.TipsInfoDto; |
|
|
|
import com.jbs.modules.tips.service.TipsInfoService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
@RestController |
|
|
|
@RequestMapping("test") |
|
|
|
public class TestController { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SysUserService userService; |
|
|
|
@Autowired |
|
|
|
private SceInfoService sceInfoService; |
|
|
|
@Autowired |
|
|
|
private SceProcessService sceProcessService; |
|
|
|
@Autowired |
|
|
|
private TipsInfoService tipsInfoService; |
|
|
|
|
|
|
|
@PostMapping("") |
|
|
|
public void test() { |
|
|
|
for(int i = 1; i <= 10000; i++){ |
|
|
|
//用户 |
|
|
|
SysUser user = new SysUser(); |
|
|
|
user.setNickName("昵称"+IdGen.randomInt6Digit()); |
|
|
|
user.setUserName("18295"+IdGen.randomInt6Digit()); |
|
|
|
//随机生成密码 |
|
|
|
String password = String.valueOf(IdGen.randomInt6Digit()); |
|
|
|
user.setPassword(SecurityUtils.encryptPassword(password)); |
|
|
|
user.setPhonenumber("18295"+IdGen.randomInt6Digit()); |
|
|
|
user.setUserId(IdUtils.getSnowId()); |
|
|
|
user.setCreateTime(new Date()); |
|
|
|
user.setUserType("01"); |
|
|
|
user.setLevel(0); |
|
|
|
user.setDisLevel(0); |
|
|
|
user.setIfCertification(0); |
|
|
|
user.setBalanceValue(0.00); |
|
|
|
userService.insertUser(user); |
|
|
|
//剧本 |
|
|
|
SceInfoDto sceInfoDto = new SceInfoDto(); |
|
|
|
sceInfoDto.preInsert(); |
|
|
|
sceInfoDto.setCode(DateUtils.dateTime()+ IdGen.randomInt6Digit()); |
|
|
|
sceInfoDto.setTitle("标题"+IdGen.randomInt6Digit()); |
|
|
|
sceInfoDto.setStudioName("工作室"+IdGen.randomInt6Digit()); |
|
|
|
sceInfoDto.setLabelName("标签"+IdGen.randomInt6Digit()); |
|
|
|
sceInfoDto.setIntroduction("<p>简介"+IdGen.randomInt6Digit()+"</p>"); |
|
|
|
sceInfoDto.setState(1); |
|
|
|
sceInfoService.insertSelectiveByDto(sceInfoDto); |
|
|
|
//流程 |
|
|
|
SceProcessDto sceProcessDto = new SceProcessDto(); |
|
|
|
sceProcessDto.preInsert(); |
|
|
|
sceProcessDto.setTitle("开场"); |
|
|
|
sceProcessDto.setScenarioId(sceInfoDto.getId()); |
|
|
|
sceProcessDto.setCode(DateUtils.dateTime()+ IdGen.randomInt6Digit()); |
|
|
|
sceProcessDto.setType(1); |
|
|
|
sceProcessDto.setIntroduction("简介"+IdGen.randomInt6Digit()); |
|
|
|
sceProcessDto.setSort(1); |
|
|
|
sceProcessService.insertSelectiveByDto(sceProcessDto); |
|
|
|
//tops |
|
|
|
TipsInfoDto tipsInfoDto = new TipsInfoDto(); |
|
|
|
tipsInfoDto.preInsert(); |
|
|
|
tipsInfoDto.setScenarioId(sceInfoDto.getId()); |
|
|
|
tipsInfoDto.setProcessId(sceProcessDto.getId()); |
|
|
|
tipsInfoDto.setContent("内容"+IdGen.randomInt6Digit()); |
|
|
|
tipsInfoDto.setSort(1); |
|
|
|
tipsInfoDto.setLikeCount(0); |
|
|
|
tipsInfoService.insertSelectiveByDto(tipsInfoDto); |
|
|
|
System.out.println(i+"---------------成功"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |