This commit is contained in:
苏尹岚
2020-12-09 17:53:08 +08:00
parent a3258e9d1a
commit 4a4e4a69a9
3 changed files with 21 additions and 5 deletions

View File

@@ -93,6 +93,7 @@ func InitServiceInfo(version string, buildTime time.Time, gitCommit string) {
}]`,
"billTypeNames": model.BillTypeNames,
"deliveryStatusName": model.DeliveryStatusName,
"cashbackName": model.CashbackName,
},
}
}

View File

@@ -53,10 +53,13 @@ func PublishJob(ctx *jxcontext.Context, jobExt *model.JobExt) (errCode string, e
finishedAt time.Time
DayTimeBegin, DayTimeEnd = jxutils.GetDayTime()
)
//需根据任务类型做一些参数判断,比如门店商品链接,地址
// switch job.JobCategoryID {
// case 1:
// }
// 需根据任务类型做一些参数判断,比如门店商品链接,地址
switch job.JobCategoryID {
case model.JobCategoryIDwmtg:
default:
return errCode, fmt.Errorf("暂不支持的任务类型! %v", job.JobCategoryID)
}
if data, err := json.Marshal(jobExt); err == nil {
json.Unmarshal(data, &job)
}

View File

@@ -30,6 +30,11 @@ const (
JobTypeNormal = 0 //普通任务
JobTypeMtMember = 1 //美团会员任务
JobTypeJdDelivery = 2 //京东快递任务
JobCashbackPrice = 1 //返现类型固定返现
JobCashbackPercentage = 2 //返现类型比例返现
JobCategoryIDwmtg = 3 //任务类型外卖推广
)
var (
@@ -39,6 +44,11 @@ var (
OrderStatusFinished: "已妥投",
OrderStatusCanceled: "已取消",
}
CashbackName = map[int]string{
JobCashbackPrice: "固定返现",
JobCashbackPercentage: "比例返现",
}
)
type Job struct {
@@ -51,7 +61,9 @@ type Job struct {
Content string `orm:"size(500)" json:"content"` //任务内容
Count int `json:"count"` //任务数量
SurplusCount int `json:"surplusCount"` //剩余数量
AvgPrice int `json:"avgPrice"` //单个任务金额
AvgPrice int `json:"avgPrice"` //单个任务金额或预估金额
Percentage int `json:"percentage"` //如果是比例返现,返现比例
CashbackType int `json:"cashbackType"` //返现方式1为固定返现2为比例返现
TotalPrice int `json:"totalPrice"` //任务总金额
Status int `json:"status"` //任务状态
Address string `orm:"size(500)" json:"address"` //任务地址