admin
2024-07-03 158b3be9024917bc5798486777dead4dd167abc7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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 test4() {
        clientInfoService.logout(3L);
    }
 
    @Test
    void test3() throws Exception {
        for (int i = 0; i < 100; i++) {
            Long uid = keyOrderService.getCanDistributeUid();
            System.out.println(uid);
        }
    }
 
    @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());
 
    }
 
}