admin
2020-05-20 98b1a0affd69bbe63223c21fdd2c404e8bedfccb
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
package org.fanli.config;
 
import java.util.Date;
 
import org.junit.Test;
import org.yeshi.utils.DateUtil;
 
import com.yeshi.fanli.entity.brand.BrandInfo;
import com.yeshi.fanli.service.inter.brand.BrandGoodsCaheService;
import com.yeshi.fanli.service.inter.brand.BrandInfoService;
import com.yeshi.fanli.util.BeanUtil;
import com.yeshi.fanli.util.ThreadUtil; 
 
public class Test_Brand {
 
    public static void main(String[] args) {
        BrandInfoService service = BeanUtil.getBean(BrandInfoService.class);
        long count = service.countValidByCid(null);
        if (count == 0)
            return;
 
        for (int page = 0; page < (count / 50) + 1; page++) {
            int p = page;
            ThreadUtil.run(new Runnable() {
                public void run() {
                    service.addShopAndGoods(p*50, 50);
                }
            });
        }
        
    }
    
    
//    @Test
    public void addBrandGoods() {
        try {
            BrandGoodsCaheService service = BeanUtil.getBean(BrandGoodsCaheService.class);
            BrandInfo brandInfo = new BrandInfo();
            brandInfo.setId(50L);
            brandInfo.setName("GAP");
            brandInfo.setShopKey("GAP");
            brandInfo.setIcon("http://ec-1255749512.file.myqcloud.com/img/TaoBaoShop/2bb853de35d845da85b7b10df42424d4.jpeg");
            brandInfo.setSearchKey("GAP");
            
            service.addBrandGoods(brandInfo);
            System.out.println("test");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
    
//    @Test
    public void removeAgoByDate() {
        try {
            BrandInfoService service = BeanUtil.getBean(BrandInfoService.class);
 
            service.removeAgoByDate(DateUtil.reduceDay(1, new Date()));
            
            System.out.println("test");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
    
    
    
 
}