Commit 3834d28d by huangchengyi

1.0

parent 7ff1937b
Showing with 0 additions and 71 deletions
package controller
import (
"encoding/json"
"fmt"
"github.com/gin-gonic/gin"
"search_server/service/ly"
"time"
)
//搜索型号
func GetMouserData(c *gin.Context) {
goodsName, _ := c.GetPostForm("goods_name")
//lycon := new(ly.CommonLyService)
//调外链拿数据
apiData := ly.OutLinkMouser(&goodsName, "-1")
//var shu string
//for _, info := range apiData {
//
// //PrintHtml(t.ctx,&t.flag,"snSku:"+snSku+" 查询得出sku"+skuId+" info",info)
// //jsonDatas,_ := json.Marshal(map[string]interface{}{
// // "dddd":"333333",
// // "ninifa":"333333",
// // "3333":"333333",
// // "gagaga":"333333",
// //})
// //fmt.Println(len(info))
// josn, errs := json.Marshal(info)
// if errs != nil {
// fmt.Println("错误")
// }
// shu += string(josn)
//}
// jsonDatas,_ := json.Marshal(map[string]interface{}{
// "dddd":"333333",
// "ninifa":"333333",
// "3333":"333333",
// "gagaga":"333333",
// })
josn, errs := json.Marshal(apiData)
if errs != nil {
fmt.Println("错误")
}
time.Sleep(1 * time.Second)
temp := string(josn)
c.JSON(200, temp)
return
//供应商详情
//supplierInfo := model.SUPPLIER_REDIS_INFO{
// SupplierId:14,
// SupplierNickname: "mouser",
//}
//err := lycon.GetSkuByGoodsSn(apiData,&supplierInfo)
//var errCode int
//if !err {
// errCode = 1
//}
//res := common.BomResponse{
// ErrCode: errCode,
// ErrMsg: "",
// Data: "",
//}
//c.JSON(200, map[string]interface{}{
// "error_code":777777,
// "err_msg":"ddddd2",
//})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment