admin
2022-05-07 15bedcc619b1edb6eb987f9288db7670e5b38c46
app/src/test/java/test/goldcorn/GoldCornTest.java
@@ -1,6 +1,8 @@
package test.goldcorn;
import com.yeshi.makemoney.app.Application;
import com.yeshi.makemoney.app.entity.SystemEnum;
import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetFrequencyConfig;
import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetRecord;
import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType;
import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetFrequencyConfigException;
@@ -8,6 +10,7 @@
import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetRecordException;
import com.yeshi.makemoney.app.exception.goldcorn.GoldCornMakeException;
import com.yeshi.makemoney.app.exception.user.UserInfoException;
import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetFrequencyConfigService;
import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetRecordService;
import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornMakeService;
import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornSettleService;
@@ -15,6 +18,7 @@
import org.springframework.boot.test.context.SpringBootTest;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@@ -44,6 +48,7 @@
        record.setType(GoldCornGetType.readNovel);
        record.setLevel(GoldCornGetRecord.LEVEL_OWN);
        record.setDay("2022-04-07");
        record.setEventCount(1L);
        goldCornGetRecordService.add(record);
    }
@@ -74,11 +79,9 @@
    @Test
    public void makeGoldCorn() {
        try {
            goldCornMakeService.addGoldCorn(22384L, GoldCornGetType.watchVideo,false,new Date(),null);
            goldCornMakeService.addGoldCorn(22384L, GoldCornGetType.watchVideo, false, new Date(), null, 1L);
//            goldCornMakeService.addGoldCorn(22380L,GoldCornGetType.readNovel,new Date());
        } catch (UserInfoException e) {
            e.printStackTrace();
        } catch (GoldCornGetPriceException e) {
            e.printStackTrace();
        } catch (GoldCornGetFrequencyConfigException e) {
            e.printStackTrace();
@@ -88,9 +91,17 @@
    }
    @Test
    public void settle(){
        goldCornSettleService.startSettle(new Date(System.currentTimeMillis()-1000*60*60*24L));
    public void settle() {
        goldCornSettleService.startSettle(new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24L));
    }
    @Resource
    private GoldCornGetFrequencyConfigService goldCornGetFrequencyConfigService;
    public void getFrequencys() {
        List<GoldCornGetFrequencyConfig> list = goldCornGetFrequencyConfigService.listByTypes(Arrays.asList(new GoldCornGetType[]{GoldCornGetType.watchVideo, GoldCornGetType.readNovel, GoldCornGetType.scanNews}), SystemEnum.svmm, new Date());
    }
}