|
@@ -196,16 +196,16 @@ func (this *ProductController) AddProduct() {
|
|
|
}
|
|
|
switch req.Type {
|
|
|
case "report":
|
|
|
- product.RiskLevel, product.Title, err = services.GetRiskLevel("report", req.SourceId)
|
|
|
+ _, product.Title, err = services.GetRiskLevel("report", req.SourceId)
|
|
|
product.IsPermanent = true
|
|
|
case "audio":
|
|
|
- product.RiskLevel, product.Title, err = services.GetRiskLevel("audio", req.SourceId)
|
|
|
+ _, product.Title, err = services.GetRiskLevel("audio", req.SourceId)
|
|
|
product.IsPermanent = true
|
|
|
case "video":
|
|
|
- product.RiskLevel, product.Title, err = services.GetRiskLevel("video", req.SourceId)
|
|
|
+ _, product.Title, err = services.GetRiskLevel("video", req.SourceId)
|
|
|
product.IsPermanent = true
|
|
|
case "package":
|
|
|
- product.RiskLevel, permissionName, err = services.GetRiskLevel("package", req.SourceId)
|
|
|
+ _, permissionName, err = services.GetRiskLevel("package", req.SourceId)
|
|
|
default:
|
|
|
br.Msg = "产品类型错误"
|
|
|
br.ErrMsg = "获取产品列表失败,Err:产品类型错误"
|
|
@@ -222,16 +222,7 @@ func (this *ProductController) AddProduct() {
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
- if product.RiskLevel == "" {
|
|
|
- br.Msg = "新增产品错误"
|
|
|
- br.ErrMsg = "未获取到风险等级"
|
|
|
- return
|
|
|
- }
|
|
|
- if !checkProductRiskLevel(product.RiskLevel) {
|
|
|
- br.Msg = "产品风险等级不合法"
|
|
|
- br.ErrMsg = "产品风险等级不合法:" + product.RiskLevel
|
|
|
- return
|
|
|
- }
|
|
|
+
|
|
|
if product.Title == "" {
|
|
|
br.Msg = "产品名称不能为空"
|
|
|
br.ErrMsg = "产品名称不能为空"
|
|
@@ -502,7 +493,6 @@ func (this *ProductController) ProductList() {
|
|
|
ProductName: product.Title,
|
|
|
ProductType: CNProductMap[product.Type],
|
|
|
PublishedTime: product.CreatedTime.Format(time.DateTime),
|
|
|
- RiskLevel: product.RiskLevel,
|
|
|
Price: fmt.Sprintf("¥%s", product.Price),
|
|
|
SaleStatus: CNSaleStatusMap[product.SaleStatus],
|
|
|
CoverSrc: product.CoverSrc,
|
|
@@ -621,13 +611,13 @@ func (this *ProductController) EditProduct() {
|
|
|
}
|
|
|
switch req.Type {
|
|
|
case "report":
|
|
|
- product.RiskLevel, product.Title, err = services.GetRiskLevel("report", req.SourceId)
|
|
|
+ _, product.Title, err = services.GetRiskLevel("report", req.SourceId)
|
|
|
case "audio":
|
|
|
- product.RiskLevel, product.Title, err = services.GetRiskLevel("audio", req.SourceId)
|
|
|
+ _, product.Title, err = services.GetRiskLevel("audio", req.SourceId)
|
|
|
case "video":
|
|
|
- product.RiskLevel, product.Title, err = services.GetRiskLevel("video", req.SourceId)
|
|
|
+ _, product.Title, err = services.GetRiskLevel("video", req.SourceId)
|
|
|
case "package":
|
|
|
- product.RiskLevel, _, err = services.GetRiskLevel("package", req.SourceId)
|
|
|
+ _, _, err = services.GetRiskLevel("package", req.SourceId)
|
|
|
default:
|
|
|
br.Msg = "产品类型错误"
|
|
|
br.ErrMsg = "获取产品列表失败,Err:产品类型错误"
|
|
@@ -643,16 +633,7 @@ func (this *ProductController) EditProduct() {
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
- if product.RiskLevel == "" {
|
|
|
- br.Msg = "编辑产品失败"
|
|
|
- br.ErrMsg = "未获取到风险等级"
|
|
|
- return
|
|
|
- }
|
|
|
- if !checkProductRiskLevel(product.RiskLevel) {
|
|
|
- br.Msg = "产品风险等级不合法"
|
|
|
- br.ErrMsg = "产品风险等级不合法:" + product.RiskLevel
|
|
|
- return
|
|
|
- }
|
|
|
+
|
|
|
if product.Title == "" {
|
|
|
br.Msg = "产品名称不能为空"
|
|
|
br.ErrMsg = "产品名称不能为空"
|