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;
|
}
|
}
|