admin
2022-04-29 6cc97918a5a42e37a3c3867cc5b78a0b9fd43a24
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
package com.yeshi.makemoney.app.vo.goldcorn;
 
import com.yeshi.makemoney.app.entity.config.AppJumpType;
import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetFrequencyConfig;
import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetPrice;
import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType;
import com.yeshi.makemoney.app.entity.goldcorn.GoldCornTaskTypeInfo;
 
/**
 * @author hxh
 * @title: GoldCornTaskVO
 * @description: 任务列表输出
 * @date 2022/4/28 14:38
 */
public class GoldCornTaskVO {
 
    private String icon;
    private String name;
    private String process;
    private int price;
    private String priceUnit;
    private String actionName;
    private boolean active;
    private AppJumpType jumpType;
 
    public static GoldCornTaskVO create(GoldCornTaskTypeInfo task, GoldCornGetPrice price, GoldCornGetFrequencyConfig frequencyConfig, Long eventCount) {
        eventCount = eventCount == null ? 0L : eventCount;
        GoldCornTaskVO vo = new GoldCornTaskVO();
        vo.setIcon(task.getIcon());
        vo.setName(task.getName());
 
        boolean finish = (frequencyConfig.getLimitCount() <= eventCount.longValue());
        vo.setActive(!finish);
 
        StringBuffer processBuffer = new StringBuffer();
        processBuffer.append("今日进度 (");
        if (task.getType() == GoldCornGetType.watchVideo) {
            vo.setActionName("去完成");
            vo.setPrice(price.getCornNum());
            vo.setPriceUnit("金币/分钟");
            processBuffer.append(eventCount / 60);
            processBuffer.append("/");
            processBuffer.append(frequencyConfig.getLimitCount() / 60);
            processBuffer.append("分钟");
 
            vo.setJumpType(AppJumpType.drawVideo);
        } else if (task.getType() == GoldCornGetType.scanNews) {
            vo.setActionName("看资讯");
            vo.setPrice(price.getCornNum());
            vo.setPriceUnit("金币/篇");
            processBuffer.append(eventCount);
            processBuffer.append("/");
            processBuffer.append(frequencyConfig.getLimitCount());
            vo.setJumpType(AppJumpType.news);
        } else if (task.getType() == GoldCornGetType.readNovel) {
            vo.setActionName("看小说");
            vo.setPrice(price.getCornNum());
            vo.setPriceUnit("金币/分钟");
            processBuffer.append(eventCount / 60);
            processBuffer.append("/");
            processBuffer.append(frequencyConfig.getLimitCount() / 60);
            processBuffer.append("分钟");
 
            vo.setJumpType(AppJumpType.novel);
        } else if (task.getType() == GoldCornGetType.invite) {
            vo.setActionName("去邀请");
            vo.setPrice(price.getCornNum());
            vo.setPriceUnit("金币/人");
            processBuffer.append(eventCount);
            processBuffer.append("/");
            processBuffer.append(frequencyConfig.getLimitCount());
 
            vo.setJumpType(AppJumpType.invite);
        } else if (task.getType() == GoldCornGetType.extract) {
            vo.setActionName("去提现");
            vo.setPrice(price.getCornNum());
            vo.setPriceUnit("金币/次");
            processBuffer.append(eventCount);
            processBuffer.append("/");
            processBuffer.append(frequencyConfig.getLimitCount());
 
            vo.setJumpType(AppJumpType.extract);
        }
        processBuffer.append(")");
        vo.setProcess(processBuffer.toString());
        return vo;
    }
 
 
    public String getIcon() {
        return icon;
    }
 
    public void setIcon(String icon) {
        this.icon = icon;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public String getProcess() {
        return process;
    }
 
    public void setProcess(String process) {
        this.process = process;
    }
 
    public int getPrice() {
        return price;
    }
 
    public void setPrice(int price) {
        this.price = price;
    }
 
    public String getActionName() {
        return actionName;
    }
 
    public void setActionName(String actionName) {
        this.actionName = actionName;
    }
 
    public boolean isActive() {
        return active;
    }
 
    public void setActive(boolean active) {
        this.active = active;
    }
 
    public AppJumpType getJumpType() {
        return jumpType;
    }
 
    public void setJumpType(AppJumpType jumpType) {
        this.jumpType = jumpType;
    }
 
    public String getPriceUnit() {
        return priceUnit;
    }
 
    public void setPriceUnit(String priceUnit) {
        this.priceUnit = priceUnit;
    }
}