|
@@ -3,6 +3,8 @@ package service
|
|
import (
|
|
import (
|
|
"context"
|
|
"context"
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "strconv"
|
|
|
|
+ "strings"
|
|
"youngee_b_api/db"
|
|
"youngee_b_api/db"
|
|
"youngee_b_api/model/common_model"
|
|
"youngee_b_api/model/common_model"
|
|
"youngee_b_api/model/gorm_model"
|
|
"youngee_b_api/model/gorm_model"
|
|
@@ -29,6 +31,15 @@ func (*project) Create(ctx context.Context, newProject http_model.CreateProjectR
|
|
}
|
|
}
|
|
// 按照品牌名-商品名对项目进行命名
|
|
// 按照品牌名-商品名对项目进行命名
|
|
projectName := product.BrandName + "-" + product.ProductName
|
|
projectName := product.BrandName + "-" + product.ProductName
|
|
|
|
+ //feeForm := fmt.Sprintf("[")
|
|
|
|
+ feeFrom := []string{}
|
|
|
|
+ for _, strategy := range newProject.RecruitStrategys {
|
|
|
|
+ //if strategy.StrategyID
|
|
|
|
+ feeFrom = append(feeFrom, strconv.FormatInt(strategy.FeeForm, 10))
|
|
|
|
+ //feeForm += string(strategy.StrategyID)
|
|
|
|
+ }
|
|
|
|
+ feeFroms := strings.Join(feeFrom, ",")
|
|
|
|
+
|
|
projectInfo := gorm_model.ProjectInfo{
|
|
projectInfo := gorm_model.ProjectInfo{
|
|
ProjectName: projectName,
|
|
ProjectName: projectName,
|
|
ProjectStatus: 1,
|
|
ProjectStatus: 1,
|
|
@@ -41,6 +52,7 @@ func (*project) Create(ctx context.Context, newProject http_model.CreateProjectR
|
|
ContentType: newProject.ContentType,
|
|
ContentType: newProject.ContentType,
|
|
EnterpriseID: enterpriseID,
|
|
EnterpriseID: enterpriseID,
|
|
ProductID: newProject.ProductID,
|
|
ProductID: newProject.ProductID,
|
|
|
|
+ FeeForm: feeFroms,
|
|
}
|
|
}
|
|
// db create ProjectInfo
|
|
// db create ProjectInfo
|
|
projectID, err := db.CreateProject(ctx, projectInfo)
|
|
projectID, err := db.CreateProject(ctx, projectInfo)
|
|
@@ -89,6 +101,7 @@ func (*project) Create(ctx context.Context, newProject http_model.CreateProjectR
|
|
return res, nil
|
|
return res, nil
|
|
}
|
|
}
|
|
func (*project) Update(ctx context.Context, newProject http_model.UpdateProjectRequest, enterpriseID int64) (*http_model.UpdateProjectData, error) {
|
|
func (*project) Update(ctx context.Context, newProject http_model.UpdateProjectRequest, enterpriseID int64) (*http_model.UpdateProjectData, error) {
|
|
|
|
+ fmt.Println("newproject:", newProject)
|
|
project := gorm_model.ProjectInfo{
|
|
project := gorm_model.ProjectInfo{
|
|
ProjectID: conv.MustInt64(newProject.ProjectID),
|
|
ProjectID: conv.MustInt64(newProject.ProjectID),
|
|
RecruitDdl: newProject.RecruitDdl,
|
|
RecruitDdl: newProject.RecruitDdl,
|