|
@@ -32,8 +32,10 @@ func (s ProjectService) CreateProject(projectCreateParam *vo.ProjectCreateParam)
|
|
|
productInfoToJson, _ := json.Marshal(product)
|
|
|
productPhotosToJson, _ := json.Marshal(productPhotos)
|
|
|
// d) 任务截止时间
|
|
|
- recruitDdl := time.Time{} //赋零值
|
|
|
- recruitDdl, _ = time.ParseInLocation("2006-01-02 15:04:05", projectCreateParam.RecruitDdl, time.Local)
|
|
|
+ recruitDdl, err1 := time.ParseInLocation("2006-01-02 15:04:05", projectCreateParam.RecruitDdl, time.Local)
|
|
|
+ if err1 != nil {
|
|
|
+ return nil, errors.New("failed to parse recruitDdl")
|
|
|
+ }
|
|
|
// d)创建种草任务
|
|
|
var operatorType int64
|
|
|
if projectCreateParam.SubAccountId == 0 {
|
|
@@ -48,6 +50,9 @@ func (s ProjectService) CreateProject(projectCreateParam *vo.ProjectCreateParam)
|
|
|
infoAutoDefault := entity.InfoAutoDefault{}
|
|
|
infoAutoDefault = dao.InfoAutoDefaultDao{}.GetAutoDefaultLast(projectCreateParam.EnterpriseId)
|
|
|
t := time.Now()
|
|
|
+ if recruitDdl.Before(t) {
|
|
|
+ return nil, errors.New("截止时间异常,请重试")
|
|
|
+ }
|
|
|
newProject := entity.Project{
|
|
|
ProjectStatus: 1,
|
|
|
ProjectType: projectCreateParam.ProjectType,
|