Commit 8ee233d0 authored by brent's avatar brent

modify client api

parent fcb32eb6
...@@ -16,6 +16,7 @@ import ( ...@@ -16,6 +16,7 @@ import (
"math/big" "math/big"
"net/http" "net/http"
"strconv" "strconv"
"strings"
"time" "time"
) )
...@@ -505,11 +506,11 @@ func (server *ClientController) TaskReward() { ...@@ -505,11 +506,11 @@ func (server *ClientController) TaskReward() {
for _, task := range types { for _, task := range types {
if task.Id == item.TaskId { if task.Id == item.TaskId {
item.Type = models.ModelType(task.Type).String() item.Type = models.ModelType(task.Type).String()
if strings.Compare(item.Type, "unknown") == 0 {
item.Type = "base task"
}
item.BaseModel = task.BaseModel item.BaseModel = task.BaseModel
} }
if task.Id == 998 {
item.Type = "base task"
}
} }
workload := big.NewInt(item.Workload) workload := big.NewInt(item.Workload)
weiPerWorkload, _ := strconv.Atoi(value.Wei) weiPerWorkload, _ := strconv.Atoi(value.Wei)
......
...@@ -14,6 +14,7 @@ import ( ...@@ -14,6 +14,7 @@ import (
registor "github.com/odysseus/service-registry/registry" registor "github.com/odysseus/service-registry/registry"
"net/http" "net/http"
"strconv" "strconv"
"strings"
"time" "time"
) )
...@@ -289,7 +290,7 @@ func (server *ExplorerController) Tasks() { ...@@ -289,7 +290,7 @@ func (server *ExplorerController) Tasks() {
ProfitAcc: task.ProfitAcc, ProfitAcc: task.ProfitAcc,
WorkerAcc: task.WorkerAcc, WorkerAcc: task.WorkerAcc,
} }
if taskId == 998 { if strings.Compare(reTask.Type, "unknown") == 0 {
reTask.Type = "base task" reTask.Type = "base task"
} }
responseTasks = append(responseTasks, reTask) responseTasks = append(responseTasks, reTask)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment