package com.taoke.autopay;
|
|
import com.taoke.autopay.dao.ClientInfoMapper;
|
import com.taoke.autopay.dao.KeyOrderMapper;
|
import com.taoke.autopay.entity.ClientInfo;
|
import com.taoke.autopay.entity.OrderDistributeCountInfo;
|
import com.taoke.autopay.exception.KeyOrderException;
|
import com.taoke.autopay.service.ClientInfoService;
|
import com.taoke.autopay.service.KeyOrderService;
|
import com.taoke.autopay.utils.StringUtil;
|
import org.junit.jupiter.api.Test;
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import javax.annotation.Resource;
|
import java.util.Date;
|
import java.util.List;
|
|
@SpringBootTest
|
class AutopayApplicationTests {
|
|
@Resource
|
private ClientInfoMapper mapper;
|
|
@Resource
|
private ClientInfoService clientInfoService;
|
|
@Resource
|
private KeyOrderService keyOrderService;
|
|
@Resource
|
private KeyOrderMapper keyOrderMapper;
|
|
@Test
|
void addClientInfo(){
|
for(int i=4;i<50;i++) {
|
ClientInfo info=new ClientInfo();
|
info.setRule(0);
|
info.setAccount("c"+i);
|
info.setPwd("e10adc3949ba59abbe56e057f20f883e");
|
info.setCreateTime(new Date());
|
info.setName("客户端"+i);
|
mapper.insertSelective(info);
|
}
|
}
|
|
@Test
|
void test2() throws KeyOrderException {
|
|
keyOrderService.addKeyOrder("【\uD83D\uDC4D z h`i付宝\uD83D\uDC4D】亲,复制 T:/TQEx7jy96Gr o:/b CA5742 2020/12/07打开支付宝就可以帮我\uD83C\uDFEE付款啦\uD83D\uDCAAhttps://ur.alipay.com/_72G9ZwXA6jz28jdJUNhUx7");
|
}
|
|
@Test
|
void test4(){
|
clientInfoService.logout(3L);
|
}
|
|
@Test
|
void test3() throws Exception {
|
keyOrderService.deleteAll(new Date(System.currentTimeMillis() - 1000*60*60*24L *5));
|
}
|
|
@Test
|
void contextLoads() {
|
ClientInfo info=new ClientInfo();
|
info.setName("超级管理员");
|
info.setAccount("admin");
|
info.setPwd(StringUtil.Md5("123456"));
|
info.setCreateTime(new Date());
|
info.setRule(ClientInfo.RULE_ADMIN);
|
mapper.insertSelective(info);
|
|
ClientInfoMapper.DaoQuery query=new ClientInfoMapper.DaoQuery();
|
query.count=10;
|
query.start = 0;
|
List<ClientInfo> list = mapper.list(query);
|
System.out.println(list.size());
|
|
}
|
|
}
|