admin
2021-05-06 42f05d2b835ed1ee41ca32cf76fe11849a890cb4
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
package com.ks.goldcorn.mapper;
 
import com.ks.goldcorn.pojo.DO.GoldCornAppInfo;
import com.ks.goldcorn.service.GoldCornAppManager;
import com.ks.goldcorn.service.remote.GoldCornAppService;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.yeshi.utils.TimeUtil;
 
import javax.annotation.Resource;
import java.util.List;
 
@SpringBootTest
public class AppTest {
 
    @Resource
    private GoldCornAppService goldCornAppService;
 
    @Resource
    private GoldCornAppManager goldCornAppManager;
 
 
    @Test
    public void addApp() throws Exception {
        GoldCornAppInfo appInfo = new GoldCornAppInfo();
        appInfo.setAppCode("test1");
        appInfo.setAppName("测试应用");
        appInfo.setAppDesc("测试应用");
        appInfo.setRemarks("备注");
        goldCornAppManager.addApp(appInfo);
    }
 
    @Test
    public void search() {
        List<GoldCornAppInfo> list = goldCornAppManager.searchByName("测试", 1, 10);
        long count = goldCornAppManager.countSearchByName("测试");
        System.out.println(list);
    }
 
    @Test
    public void delete() throws Exception {
        GoldCornAppInfo app = goldCornAppService.selectByCode("test");
        goldCornAppManager.deleteApp(app.getId());
    }
 
    @Test
    public void update() {
        GoldCornAppInfo app = goldCornAppService.selectByCode("test1");
        System.out.println(TimeUtil.getGernalTime(app.getCreateTime().getTime(),"yyyy-MM-dd HH:mm:ss"));
        app.setRemarks("测试备注");
        goldCornAppManager.updateApp(app);
    }
 
 
}