|
@@ -5,7 +5,6 @@ import (
|
|
|
"eta/eta_mini_ht_api/common/utils/page"
|
|
|
"eta/eta_mini_ht_api/controllers"
|
|
|
productService "eta/eta_mini_ht_api/service/product"
|
|
|
- "fmt"
|
|
|
)
|
|
|
|
|
|
var (
|
|
@@ -90,29 +89,19 @@ func (p *ProductController) RelatePackage(productId int) {
|
|
|
// @Description 获取商品信息
|
|
|
// @Success 200 {object} controllers.BaseResponse
|
|
|
// @router /productSearch [get]
|
|
|
-func (p *ProductController) ProductSearch(productType, key string) {
|
|
|
+func (p *ProductController) ProductSearch(productType, key string, isSignal bool) {
|
|
|
controllers.Wrap(&p.BaseController, func() (result *controllers.WrapData, err error) {
|
|
|
result = p.InitWrapData("搜索产品信息失败")
|
|
|
if !productMap[productType] {
|
|
|
- p.FailedResult("搜索产品信息失败", result)
|
|
|
err = exception.New(exception.ProductTypeError)
|
|
|
+ p.FailedResult("搜索产品信息失败", result)
|
|
|
return
|
|
|
}
|
|
|
- //for i := 0; i < len(productMap); i++ {
|
|
|
- // //if productType == productMap[i] {
|
|
|
- // // productList, err := productService.ProductSearch(productType, key)
|
|
|
- // // if err != nil {
|
|
|
- // // p.FailedResult("搜索产品信息失败", result)
|
|
|
- // // return
|
|
|
- // // }
|
|
|
- // }
|
|
|
+ //if isSignal {
|
|
|
+ // productList, err := productService.ProductSearch(productType, key)
|
|
|
+ //} else {
|
|
|
+ // productList, err := productService.PackageSearch(key)
|
|
|
//}
|
|
|
- fmt.Printf("productType:%v,key:%v\n", productType, key)
|
|
|
- if err != nil {
|
|
|
- p.FailedResult("获取关联套餐信息失败", result)
|
|
|
- err = exception.New(exception.ProductTypeError)
|
|
|
- return
|
|
|
- }
|
|
|
if err != nil {
|
|
|
p.FailedResult("搜索产品信息失败", result)
|
|
|
return
|