加入挑战

This commit is contained in:
marvzhang
2020-03-19 18:56:59 +08:00
parent e3a059eb7c
commit e33dfd7992
30 changed files with 504 additions and 21 deletions

View File

@@ -32,7 +32,7 @@ func (ch *Challenge) Save() error {
ch.UpdateTs = time.Now()
if err := c.UpdateId(ch.Id, c); err != nil {
if err := c.UpdateId(ch.Id, ch); err != nil {
debug.PrintStack()
return err
}

View File

@@ -26,7 +26,7 @@ type Task struct {
TotalDuration float64 `json:"total_duration" bson:"total_duration"`
Pid int `json:"pid" bson:"pid"`
RunType string `json:"run_type" bson:"run_type"`
ScheduleId bson.ObjectId `json:"schedule_id" bson:"schedule_id"`
//ScheduleId bson.ObjectId `json:"schedule_id" bson:"schedule_id"`
// 前端数据
SpiderName string `json:"spider_name"`

View File

@@ -19,8 +19,9 @@ type User struct {
Email string `json:"email" bson:"email"`
Setting UserSetting `json:"setting" bson:"setting"`
CreateTs time.Time `json:"create_ts" bson:"create_ts"`
UpdateTs time.Time `json:"update_ts" bson:"update_ts"`
UserId bson.ObjectId `json:"user_id" bson:"user_id"`
CreateTs time.Time `json:"create_ts" bson:"create_ts"`
UpdateTs time.Time `json:"update_ts" bson:"update_ts"`
}
type UserSetting struct {