mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
22 lines
355 B
Go
22 lines
355 B
Go
package challenge
|
|
|
|
import (
|
|
"crawlab/model"
|
|
"github.com/globalsign/mgo/bson"
|
|
)
|
|
|
|
type CreateScheduleService struct {
|
|
UserId bson.ObjectId
|
|
}
|
|
|
|
func (s *CreateScheduleService) Check() (bool, error) {
|
|
query := bson.M{
|
|
"user_id": s.UserId,
|
|
}
|
|
list, err := model.GetScheduleList(query)
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
return len(list) > 0, nil
|
|
}
|