|
@@ -60,11 +60,11 @@ func (t TaskController) CreateProduct(c *gin.Context) {
|
|
|
productId, err := service.ProductService{}.CreateProduct(data)
|
|
|
if err != nil {
|
|
|
if err.Error() == "该快手商品已存在!" {
|
|
|
- returnError(c, 30010, err.Error())
|
|
|
+ returnSuccessWithMessage(c, 30010, err.Error(), nil)
|
|
|
return
|
|
|
}
|
|
|
if err.Error() == "商品主图不能为空!" {
|
|
|
- returnError(c, 30020, err.Error())
|
|
|
+ returnSuccessWithMessage(c, 30020, err.Error(), nil)
|
|
|
return
|
|
|
}
|
|
|
logrus.Errorf("[CreateProduct] call CreateProduct err:%+v\n", err)
|
|
@@ -146,7 +146,7 @@ func (t TaskController) CopySelection(c *gin.Context) {
|
|
|
res, err := service.SelectionInfoService{}.CopySelection(data)
|
|
|
if err != nil {
|
|
|
if err.Error() == "任务不存在" {
|
|
|
- returnError(c, 30000, err.Error())
|
|
|
+ returnSuccessWithMessage(c, 30000, err.Error(), nil)
|
|
|
return
|
|
|
}
|
|
|
logrus.Errorf("[CopySelection] call CopySelection err:%+v\n", err)
|
|
@@ -260,6 +260,10 @@ func (t TaskController) CreateProject(c *gin.Context) {
|
|
|
returnError(c, 40000, "Parameter Error: "+err.Error())
|
|
|
return
|
|
|
}
|
|
|
+ if data.RecruitStrategys == nil || len(data.RecruitStrategys) == 0 {
|
|
|
+ returnSuccessWithMessage(c, 30030, "招募策略不能为空", nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
projectId, err := service.ProjectService{}.CreateProject(data)
|
|
|
if err != nil {
|
|
|
logrus.Errorf("[CreateProject] call CreateProject err:%+v\n", err)
|
|
@@ -280,6 +284,10 @@ func (t TaskController) UpdateProject(c *gin.Context) {
|
|
|
returnError(c, 40000, "Parameter Error: "+err.Error())
|
|
|
return
|
|
|
}
|
|
|
+ if data.RecruitStrategys == nil || len(data.RecruitStrategys) == 0 {
|
|
|
+ returnSuccessWithMessage(c, 30030, "招募策略不能为空", nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
projectId, err := service.ProjectService{}.UpdateProject(data)
|
|
|
if err != nil {
|
|
|
logrus.Errorf("[UpdateProject] call UpdateProject err:%+v\n", err)
|
|
@@ -300,6 +308,10 @@ func (t TaskController) UpdateProjectTarget(c *gin.Context) {
|
|
|
returnError(c, 40000, "Parameter Error: "+err.Error())
|
|
|
return
|
|
|
}
|
|
|
+ if data.RecruitStrategys == nil || len(data.RecruitStrategys) == 0 {
|
|
|
+ returnSuccessWithMessage(c, 30030, "招募策略不能为空", nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
projectId, err := service.ProjectService{}.UpdateProjectTarget(data)
|
|
|
if err != nil {
|
|
|
logrus.Errorf("[UpdateProject] call UpdateProject err:%+v\n", err)
|
|
@@ -342,7 +354,7 @@ func (t TaskController) CopyProject(c *gin.Context) {
|
|
|
projectId, err := service.ProjectService{}.CopyProject(data)
|
|
|
if err != nil {
|
|
|
if err.Error() == "任务不存在" {
|
|
|
- returnError(c, 30000, err.Error())
|
|
|
+ returnSuccessWithMessage(c, 30000, err.Error(), nil)
|
|
|
return
|
|
|
}
|
|
|
logrus.Errorf("[CopyProject] call CopyProject err:%+v\n", err)
|
|
@@ -862,7 +874,7 @@ func (t TaskController) CopyLocalLife(c *gin.Context) {
|
|
|
localId, err := service.LocalLifeService{}.CopyLocalLife(data)
|
|
|
if err != nil {
|
|
|
if err.Error() == "任务不存在" {
|
|
|
- returnError(c, 30000, err.Error())
|
|
|
+ returnSuccessWithMessage(c, 30000, err.Error(), nil)
|
|
|
return
|
|
|
}
|
|
|
logrus.Errorf("[CreateLocalLife] call CreateLocalLife err:%+v\n", err)
|