admin
2020-12-25 25680e135b5bdc15658622cbfde74bab73cfee77
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;
 
import com.ks.daylucky.dao.ActivityDrawnRecieveNotifyInfoDao;
import com.ks.daylucky.pojo.DO.ActivityDrawnRecieveNotifyInfo;
import com.ks.daylucky.service.ActivityDrawnRecieveNotifyInfoService;
import com.ks.lib.common.dao.MongodbBaseDao;
import com.ks.lib.common.exception.BaseException;
import org.junit.jupiter.api.Test;
import org.yeshi.utils.generater.SpringComponentGenerater;
import org.yeshi.utils.generater.entity.ExceptionData;
import org.yeshi.utils.generater.entity.MongoDBDaoData;
import org.yeshi.utils.generater.entity.ServiceData;
 
public class MongoTest {
 
    @Test
    public void createDao() {
        try {
            SpringComponentGenerater.createMongoDao(new MongoDBDaoData.Builder().setBaseDaoClass(MongodbBaseDao.class).setDaoPackageName("com.ks.daylucky.dao").setEntityClass(ActivityDrawnRecieveNotifyInfo.class).create(), "D:\\workspace\\DayLucky\\service-daylucky\\src\\main\\java\\com\\ks\\daylucky\\dao\\");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
 
    @Test
    public void createService() {
        try {
            SpringComponentGenerater.createService(new ServiceData.Builder().setPackageName("com.ks.daylucky.service").setDaoClass(ActivityDrawnRecieveNotifyInfoDao.class).setEntityClass(ActivityDrawnRecieveNotifyInfo.class).build(), "D:\\workspace\\DayLucky\\service-daylucky\\src\\main\\java\\com\\ks\\daylucky\\service\\");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
 
 
    @Test
    public void createServiceImpl() {
        try {
            SpringComponentGenerater.createServiceImpl(new ServiceData.Builder().setPackageName("com.ks.daylucky.service.impl").setServiceClass(ActivityDrawnRecieveNotifyInfoService.class).setDaoClass(ActivityDrawnRecieveNotifyInfoDao.class).setEntityClass(ActivityDrawnRecieveNotifyInfo.class).build(), "D:\\workspace\\DayLucky\\service-daylucky\\src\\main\\java\\com\\ks\\daylucky\\service\\impl\\");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
    @Test
    public void createException() {
        try {
            SpringComponentGenerater.createException(new ExceptionData.Builder().setPackageName("com.ks.daylucky.exception").setBaseClass(BaseException.class).setEntityClass(ActivityDrawnRecieveNotifyInfo.class).build(), "D:\\workspace\\DayLucky\\service-daylucky\\src\\main\\java\\com\\ks\\daylucky\\exception\\");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
}