Commit 8ee0512d by mushishixian

推荐接口

parent 2d80e9d5
*
!.gitignore
\ No newline at end of file
...@@ -12,6 +12,8 @@ api_url = http://192.168.2.232:60004 ...@@ -12,6 +12,8 @@ api_url = http://192.168.2.232:60004
url = http://192.168.2.232:9200 url = http://192.168.2.232:9200
urls = http://192.168.2.232:9200,http://192.168.2.232:9200 urls = http://192.168.2.232:9200,http://192.168.2.232:9200
index_name = future,rochester,tme,verical,element14,digikey,chip1stop,aipco,arrow,alliedelec,avnet,mouser,zhuanmai,peigenesis,powell,rs,buerklin,liexin_ziying index_name = future,rochester,tme,verical,element14,digikey,chip1stop,aipco,arrow,alliedelec,avnet,mouser,zhuanmai,peigenesis,powell,rs,buerklin,liexin_ziying
search_supplier = future,rochester,tme,verical,element14,digikey,chip1stop,aipco,arrow,alliedelec,avnet,mouser,peigenesis,powell,rs,buerklin,zhuanmai
hk_delivery_type_supplier = future,rochester,tme,verical,element14,digikey,chip1stop,aipco,arrow,alliedelec,avnet,mouser,peigenesis,powell,rs,buerklin
[database] [database]
user_name = root user_name = root
......
...@@ -14,7 +14,13 @@ func init() { ...@@ -14,7 +14,13 @@ func init() {
WithMiddleware(Cors_Middleware()). WithMiddleware(Cors_Middleware()).
WithEndpoint(AutoSpuEndpoint(bomService)). WithEndpoint(AutoSpuEndpoint(bomService)).
WithRequest(AutoSpuRequest()). WithRequest(AutoSpuRequest()).
WithResponse(AutoSpuResponse()).Build("/autospu", "GET") WithResponse(AutoSpuResponse()).Build("/autospu", "POST")
gin_.NewBuilder().WithService(bomService).
WithMiddleware(Check_Middleware()).
WithMiddleware(Cors_Middleware()).
WithEndpoint(RecommendEndpoint(bomService)).
WithRequest(RecommendRequest()).
WithResponse(RecommendResponse()).Build("/recommend", "POST")
} }
//获取列表相关 //获取列表相关
...@@ -46,3 +52,32 @@ func AutoSpuResponse() gin_.DecodeResponseFunc { ...@@ -46,3 +52,32 @@ func AutoSpuResponse() gin_.DecodeResponseFunc {
return nil return nil
} }
} }
//获取列表相关
func RecommendEndpoint(c *service.BomServiceImpl) gin_.Endpoint {
return func(context *gin.Context, request interface{}) (response interface{}, err error) {
rsp := &bom.RecommendResponse{}
err = c.Recommend(context, request.(*bom.RecommendRequest), rsp)
return rsp, err
}
}
//这个函数的作用是怎么处理请求
func RecommendRequest() gin_.EncodeRequestFunc {
return func(context *gin.Context) (i interface{}, e error) {
bReq := &bom.RecommendRequest{}
err := context.Bind(bReq) //使用的是post参数
if err != nil {
return nil, err
}
return bReq, nil
}
}
//这个函数作用是:怎么处理响应结果
func RecommendResponse() gin_.DecodeResponseFunc {
return func(context *gin.Context, res interface{}) error {
context.JSON(200, res)
return nil
}
}
...@@ -16,6 +16,7 @@ require ( ...@@ -16,6 +16,7 @@ require (
github.com/prometheus/common v0.9.1 github.com/prometheus/common v0.9.1
github.com/smartystreets/goconvey v1.6.4 // indirect github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/stretchr/testify v1.5.1 // indirect github.com/stretchr/testify v1.5.1 // indirect
github.com/syyongx/php2go v0.9.4
github.com/tidwall/gjson v1.6.0 github.com/tidwall/gjson v1.6.0
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 // indirect golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 // indirect
golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect
......
package model
type ApiGoods struct {
GoodsID string `json:"goods_id"`
GoodsName string `json:"goods_name"`
GoodsType int `json:"goods_type"`
SupplierID int `json:"supplier_id"`
Moq int `json:"moq"`
Mpq int `json:"mpq"`
Stock int `json:"stock"`
HkDeliveryTime string `json:"hk_delivery_time"`
CnDeliveryTime string `json:"cn_delivery_time"`
LadderPrice []LadderPrice `json:"ladder_price"`
BrandName string `json:"brand_name"`
SupplierName string `json:"supplier_name"`
BrandID int `json:"brand_id"`
IsBuy int `json:"is_buy"`
Mpl int `json:"mpl"`
Status int `json:"status"`
Pdf string `json:"pdf"`
Encap string `json:"encap"`
AcType int `json:"ac_type"`
//ErpTax bool `json:"erp_tax"`
}
type LadderPrice struct {
Purchases int `json:"purchases"`
PriceUs float64 `json:"price_us"`
PriceCn float64 `json:"price_cn"`
PriceAc float64 `json:"price_ac"`
}
\ No newline at end of file
...@@ -3,6 +3,7 @@ package common ...@@ -3,6 +3,7 @@ package common
import ( import (
"crypto/md5" "crypto/md5"
"encoding/hex" "encoding/hex"
"github.com/syyongx/php2go"
) )
// Md5 md5() // Md5 md5()
...@@ -10,4 +11,25 @@ func Md5(str string) string { ...@@ -10,4 +11,25 @@ func Md5(str string) string {
hash := md5.New() hash := md5.New()
hash.Write([]byte(str)) hash.Write([]byte(str))
return hex.EncodeToString(hash.Sum(nil)) return hex.EncodeToString(hash.Sum(nil))
}
//非精确匹配,字符串截取向下80%,5个字符以下不截,5-10个截一个,10-20个向下取80%,20个以上向下取70%
func SubKeyWordStr(str string) string {
strLen := len(str)
strLenFloat := float64(strLen)
if strLen < 5 {
return str
}
if strLen >= 5 && strLen <= 10 {
str = php2go.Substr(str, 0, strLen-1)
}
if strLen > 10 && strLen <= 20 {
num := php2go.Floor(strLenFloat * 0.2)
str = php2go.Substr(str, 0, strLen-int(num))
}
if strLen > 20 {
num := php2go.Floor(strLenFloat * 0.3)
str = php2go.Substr(str, 0, strLen-int(num))
}
return str
} }
\ No newline at end of file
...@@ -20,45 +20,6 @@ var _ = math.Inf ...@@ -20,45 +20,6 @@ var _ = math.Inf
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type GoodsNameModel struct {
GoodsName string `protobuf:"bytes,1,opt,name=goods_name,json=goodsName,proto3" json:"goods_name,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GoodsNameModel) Reset() { *m = GoodsNameModel{} }
func (m *GoodsNameModel) String() string { return proto.CompactTextString(m) }
func (*GoodsNameModel) ProtoMessage() {}
func (*GoodsNameModel) Descriptor() ([]byte, []int) {
return fileDescriptor_f689add15dae9986, []int{0}
}
func (m *GoodsNameModel) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GoodsNameModel.Unmarshal(m, b)
}
func (m *GoodsNameModel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GoodsNameModel.Marshal(b, m, deterministic)
}
func (m *GoodsNameModel) XXX_Merge(src proto.Message) {
xxx_messageInfo_GoodsNameModel.Merge(m, src)
}
func (m *GoodsNameModel) XXX_Size() int {
return xxx_messageInfo_GoodsNameModel.Size(m)
}
func (m *GoodsNameModel) XXX_DiscardUnknown() {
xxx_messageInfo_GoodsNameModel.DiscardUnknown(m)
}
var xxx_messageInfo_GoodsNameModel proto.InternalMessageInfo
func (m *GoodsNameModel) GetGoodsName() string {
if m != nil {
return m.GoodsName
}
return ""
}
type AutoSpuRequest struct { type AutoSpuRequest struct {
// @inject_tag: uri:"goods_name" // @inject_tag: uri:"goods_name"
GoodsName string `protobuf:"bytes,1,opt,name=goods_name,json=goodsName,proto3" json:"goods_name,omitempty" uri:"goods_name"` GoodsName string `protobuf:"bytes,1,opt,name=goods_name,json=goodsName,proto3" json:"goods_name,omitempty" uri:"goods_name"`
...@@ -71,7 +32,7 @@ func (m *AutoSpuRequest) Reset() { *m = AutoSpuRequest{} } ...@@ -71,7 +32,7 @@ func (m *AutoSpuRequest) Reset() { *m = AutoSpuRequest{} }
func (m *AutoSpuRequest) String() string { return proto.CompactTextString(m) } func (m *AutoSpuRequest) String() string { return proto.CompactTextString(m) }
func (*AutoSpuRequest) ProtoMessage() {} func (*AutoSpuRequest) ProtoMessage() {}
func (*AutoSpuRequest) Descriptor() ([]byte, []int) { func (*AutoSpuRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_f689add15dae9986, []int{1} return fileDescriptor_f689add15dae9986, []int{0}
} }
func (m *AutoSpuRequest) XXX_Unmarshal(b []byte) error { func (m *AutoSpuRequest) XXX_Unmarshal(b []byte) error {
...@@ -103,8 +64,9 @@ type AutoSpuResponse struct { ...@@ -103,8 +64,9 @@ type AutoSpuResponse struct {
// @inject_tag: json:"error_code" // @inject_tag: json:"error_code"
ErrorCode int32 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code"` ErrorCode int32 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code"`
// @inject_tag: json:"error_message" // @inject_tag: json:"error_message"
ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message"` ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message"`
Data []string `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"` // @inject_tag: json:"data"
Data []string `protobuf:"bytes,3,rep,name=data,proto3" json:"data"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
...@@ -114,7 +76,7 @@ func (m *AutoSpuResponse) Reset() { *m = AutoSpuResponse{} } ...@@ -114,7 +76,7 @@ func (m *AutoSpuResponse) Reset() { *m = AutoSpuResponse{} }
func (m *AutoSpuResponse) String() string { return proto.CompactTextString(m) } func (m *AutoSpuResponse) String() string { return proto.CompactTextString(m) }
func (*AutoSpuResponse) ProtoMessage() {} func (*AutoSpuResponse) ProtoMessage() {}
func (*AutoSpuResponse) Descriptor() ([]byte, []int) { func (*AutoSpuResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_f689add15dae9986, []int{2} return fileDescriptor_f689add15dae9986, []int{1}
} }
func (m *AutoSpuResponse) XXX_Unmarshal(b []byte) error { func (m *AutoSpuResponse) XXX_Unmarshal(b []byte) error {
...@@ -156,28 +118,749 @@ func (m *AutoSpuResponse) GetData() []string { ...@@ -156,28 +118,749 @@ func (m *AutoSpuResponse) GetData() []string {
return nil return nil
} }
type RecommendRequest struct {
// @inject_tag: form:"goods_name"
GoodsName string `protobuf:"bytes,1,opt,name=goods_name,json=goodsName,proto3" json:"goods_name,omitempty" form:"goods_name"`
// @inject_tag: form:"num"
Num int32 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty" form:"num"`
// @inject_tag: form:"delivery_type"
DeliveryType int32 `protobuf:"varint,3,opt,name=delivery_type,json=deliveryType,proto3" json:"delivery_type,omitempty" form:"delivery_type"`
// @inject_tag: form:"flag"
Flag int32 `protobuf:"varint,4,opt,name=flag,proto3" json:"flag,omitempty" form:"flag"`
// @inject_tag: form:"p"
P int32 `protobuf:"varint,5,opt,name=p,proto3" json:"p,omitempty" form:"p"`
// @inject_tag: form:"offset"
Offset int32 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset,omitempty" form:"offset"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RecommendRequest) Reset() { *m = RecommendRequest{} }
func (m *RecommendRequest) String() string { return proto.CompactTextString(m) }
func (*RecommendRequest) ProtoMessage() {}
func (*RecommendRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_f689add15dae9986, []int{2}
}
func (m *RecommendRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RecommendRequest.Unmarshal(m, b)
}
func (m *RecommendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RecommendRequest.Marshal(b, m, deterministic)
}
func (m *RecommendRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_RecommendRequest.Merge(m, src)
}
func (m *RecommendRequest) XXX_Size() int {
return xxx_messageInfo_RecommendRequest.Size(m)
}
func (m *RecommendRequest) XXX_DiscardUnknown() {
xxx_messageInfo_RecommendRequest.DiscardUnknown(m)
}
var xxx_messageInfo_RecommendRequest proto.InternalMessageInfo
func (m *RecommendRequest) GetGoodsName() string {
if m != nil {
return m.GoodsName
}
return ""
}
func (m *RecommendRequest) GetNum() int32 {
if m != nil {
return m.Num
}
return 0
}
func (m *RecommendRequest) GetDeliveryType() int32 {
if m != nil {
return m.DeliveryType
}
return 0
}
func (m *RecommendRequest) GetFlag() int32 {
if m != nil {
return m.Flag
}
return 0
}
func (m *RecommendRequest) GetP() int32 {
if m != nil {
return m.P
}
return 0
}
func (m *RecommendRequest) GetOffset() int32 {
if m != nil {
return m.Offset
}
return 0
}
type ResponseData struct {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Flag int32 `protobuf:"varint,2,opt,name=flag,proto3" json:"flag,omitempty"`
Data []*GoodsModel `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ResponseData) Reset() { *m = ResponseData{} }
func (m *ResponseData) String() string { return proto.CompactTextString(m) }
func (*ResponseData) ProtoMessage() {}
func (*ResponseData) Descriptor() ([]byte, []int) {
return fileDescriptor_f689add15dae9986, []int{3}
}
func (m *ResponseData) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ResponseData.Unmarshal(m, b)
}
func (m *ResponseData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ResponseData.Marshal(b, m, deterministic)
}
func (m *ResponseData) XXX_Merge(src proto.Message) {
xxx_messageInfo_ResponseData.Merge(m, src)
}
func (m *ResponseData) XXX_Size() int {
return xxx_messageInfo_ResponseData.Size(m)
}
func (m *ResponseData) XXX_DiscardUnknown() {
xxx_messageInfo_ResponseData.DiscardUnknown(m)
}
var xxx_messageInfo_ResponseData proto.InternalMessageInfo
func (m *ResponseData) GetTotal() int64 {
if m != nil {
return m.Total
}
return 0
}
func (m *ResponseData) GetFlag() int32 {
if m != nil {
return m.Flag
}
return 0
}
func (m *ResponseData) GetData() []*GoodsModel {
if m != nil {
return m.Data
}
return nil
}
type RecommendResponse struct {
// @inject_tag: json:"error_code"
ErrorCode int32 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code"`
// @inject_tag: json:"error_message"
ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message"`
// @inject_tag: json:"data"
Data *ResponseData `protobuf:"bytes,3,opt,name=data,proto3" json:"data"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RecommendResponse) Reset() { *m = RecommendResponse{} }
func (m *RecommendResponse) String() string { return proto.CompactTextString(m) }
func (*RecommendResponse) ProtoMessage() {}
func (*RecommendResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_f689add15dae9986, []int{4}
}
func (m *RecommendResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RecommendResponse.Unmarshal(m, b)
}
func (m *RecommendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RecommendResponse.Marshal(b, m, deterministic)
}
func (m *RecommendResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_RecommendResponse.Merge(m, src)
}
func (m *RecommendResponse) XXX_Size() int {
return xxx_messageInfo_RecommendResponse.Size(m)
}
func (m *RecommendResponse) XXX_DiscardUnknown() {
xxx_messageInfo_RecommendResponse.DiscardUnknown(m)
}
var xxx_messageInfo_RecommendResponse proto.InternalMessageInfo
func (m *RecommendResponse) GetErrorCode() int32 {
if m != nil {
return m.ErrorCode
}
return 0
}
func (m *RecommendResponse) GetErrorMessage() string {
if m != nil {
return m.ErrorMessage
}
return ""
}
func (m *RecommendResponse) GetData() *ResponseData {
if m != nil {
return m.Data
}
return nil
}
type OTHER_ATTRS struct {
GrossWegiht string `protobuf:"bytes,1,opt,name=gross_wegiht,json=grossWegiht,proto3" json:"gross_wegiht,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *OTHER_ATTRS) Reset() { *m = OTHER_ATTRS{} }
func (m *OTHER_ATTRS) String() string { return proto.CompactTextString(m) }
func (*OTHER_ATTRS) ProtoMessage() {}
func (*OTHER_ATTRS) Descriptor() ([]byte, []int) {
return fileDescriptor_f689add15dae9986, []int{5}
}
func (m *OTHER_ATTRS) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_OTHER_ATTRS.Unmarshal(m, b)
}
func (m *OTHER_ATTRS) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_OTHER_ATTRS.Marshal(b, m, deterministic)
}
func (m *OTHER_ATTRS) XXX_Merge(src proto.Message) {
xxx_messageInfo_OTHER_ATTRS.Merge(m, src)
}
func (m *OTHER_ATTRS) XXX_Size() int {
return xxx_messageInfo_OTHER_ATTRS.Size(m)
}
func (m *OTHER_ATTRS) XXX_DiscardUnknown() {
xxx_messageInfo_OTHER_ATTRS.DiscardUnknown(m)
}
var xxx_messageInfo_OTHER_ATTRS proto.InternalMessageInfo
func (m *OTHER_ATTRS) GetGrossWegiht() string {
if m != nil {
return m.GrossWegiht
}
return ""
}
type LADDER_PRICE struct {
Purchases int64 `protobuf:"varint,1,opt,name=purchases,proto3" json:"purchases,omitempty"`
PriceCn float32 `protobuf:"fixed32,2,opt,name=price_cn,json=priceCn,proto3" json:"price_cn,omitempty"`
PriceUs float32 `protobuf:"fixed32,3,opt,name=price_us,json=priceUs,proto3" json:"price_us,omitempty"`
PriceAc float32 `protobuf:"fixed32,4,opt,name=price_ac,json=priceAc,proto3" json:"price_ac,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *LADDER_PRICE) Reset() { *m = LADDER_PRICE{} }
func (m *LADDER_PRICE) String() string { return proto.CompactTextString(m) }
func (*LADDER_PRICE) ProtoMessage() {}
func (*LADDER_PRICE) Descriptor() ([]byte, []int) {
return fileDescriptor_f689add15dae9986, []int{6}
}
func (m *LADDER_PRICE) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LADDER_PRICE.Unmarshal(m, b)
}
func (m *LADDER_PRICE) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LADDER_PRICE.Marshal(b, m, deterministic)
}
func (m *LADDER_PRICE) XXX_Merge(src proto.Message) {
xxx_messageInfo_LADDER_PRICE.Merge(m, src)
}
func (m *LADDER_PRICE) XXX_Size() int {
return xxx_messageInfo_LADDER_PRICE.Size(m)
}
func (m *LADDER_PRICE) XXX_DiscardUnknown() {
xxx_messageInfo_LADDER_PRICE.DiscardUnknown(m)
}
var xxx_messageInfo_LADDER_PRICE proto.InternalMessageInfo
func (m *LADDER_PRICE) GetPurchases() int64 {
if m != nil {
return m.Purchases
}
return 0
}
func (m *LADDER_PRICE) GetPriceCn() float32 {
if m != nil {
return m.PriceCn
}
return 0
}
func (m *LADDER_PRICE) GetPriceUs() float32 {
if m != nil {
return m.PriceUs
}
return 0
}
func (m *LADDER_PRICE) GetPriceAc() float32 {
if m != nil {
return m.PriceAc
}
return 0
}
type GoodsModel struct {
OtherAttrs *OTHER_ATTRS `protobuf:"bytes,1,opt,name=other_attrs,json=otherAttrs,proto3" json:"other_attrs,omitempty"`
PickType int64 `protobuf:"varint,2,opt,name=pick_type,json=pickType,proto3" json:"pick_type,omitempty"`
Barcode string `protobuf:"bytes,3,opt,name=barcode,proto3" json:"barcode,omitempty"`
GoodsId string `protobuf:"bytes,4,opt,name=goods_id,json=goodsId,proto3" json:"goods_id,omitempty"`
GoodsType int64 `protobuf:"varint,5,opt,name=goods_type,json=goodsType,proto3" json:"goods_type,omitempty"`
SupplierId int64 `protobuf:"varint,6,opt,name=supplier_id,json=supplierId,proto3" json:"supplier_id,omitempty"`
BrandId int64 `protobuf:"varint,7,opt,name=brand_id,json=brandId,proto3" json:"brand_id,omitempty"`
ClassId1 int64 `protobuf:"varint,8,opt,name=class_id1,json=classId1,proto3" json:"class_id1,omitempty"`
ClassId2 int64 `protobuf:"varint,9,opt,name=class_id2,json=classId2,proto3" json:"class_id2,omitempty"`
GoodsName string `protobuf:"bytes,10,opt,name=goods_name,json=goodsName,proto3" json:"goods_name,omitempty"`
Status int64 `protobuf:"varint,11,opt,name=status,proto3" json:"status,omitempty"`
Encoded string `protobuf:"bytes,12,opt,name=encoded,proto3" json:"encoded,omitempty"`
Encap string `protobuf:"bytes,13,opt,name=encap,proto3" json:"encap,omitempty"`
Packing int64 `protobuf:"varint,14,opt,name=packing,proto3" json:"packing,omitempty"`
GoodsUnit int64 `protobuf:"varint,15,opt,name=goods_unit,json=goodsUnit,proto3" json:"goods_unit,omitempty"`
GoodsImages bool `protobuf:"varint,16,opt,name=goods_images,json=goodsImages,proto3" json:"goods_images,omitempty"`
Pdf string `protobuf:"bytes,17,opt,name=pdf,proto3" json:"pdf,omitempty"`
GoodsBrief string `protobuf:"bytes,18,opt,name=goods_brief,json=goodsBrief,proto3" json:"goods_brief,omitempty"`
Moq int64 `protobuf:"varint,19,opt,name=moq,proto3" json:"moq,omitempty"`
Mpq int64 `protobuf:"varint,20,opt,name=mpq,proto3" json:"mpq,omitempty"`
LadderPrice []*LADDER_PRICE `protobuf:"bytes,21,rep,name=ladder_price,json=ladderPrice,proto3" json:"ladder_price,omitempty"`
UpdateTime int64 `protobuf:"varint,22,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
SkuName string `protobuf:"bytes,23,opt,name=sku_name,json=skuName,proto3" json:"sku_name,omitempty"`
Mpl int64 `protobuf:"varint,24,opt,name=mpl,proto3" json:"mpl,omitempty"`
Stock int64 `protobuf:"varint,25,opt,name=stock,proto3" json:"stock,omitempty"`
Attrs string `protobuf:"bytes,26,opt,name=attrs,proto3" json:"attrs,omitempty"`
Cost string `protobuf:"bytes,27,opt,name=cost,proto3" json:"cost,omitempty"`
NewCost string `protobuf:"bytes,28,opt,name=new_cost,json=newCost,proto3" json:"new_cost,omitempty"`
SupplierStock int64 `protobuf:"varint,29,opt,name=supplier_stock,json=supplierStock,proto3" json:"supplier_stock,omitempty"`
SelfSupplierType int64 `protobuf:"varint,30,opt,name=self_supplier_type,json=selfSupplierType,proto3" json:"self_supplier_type,omitempty"`
CnDeliveryTime string `protobuf:"bytes,31,opt,name=cn_delivery_time,json=cnDeliveryTime,proto3" json:"cn_delivery_time,omitempty"`
BrandName string `protobuf:"bytes,32,opt,name=brand_name,json=brandName,proto3" json:"brand_name,omitempty"`
SupplierName string `protobuf:"bytes,33,opt,name=supplier_name,json=supplierName,proto3" json:"supplier_name,omitempty"`
GoodsUnitName string `protobuf:"bytes,34,opt,name=goods_unit_name,json=goodsUnitName,proto3" json:"goods_unit_name,omitempty"`
PackingName string `protobuf:"bytes,35,opt,name=packing_name,json=packingName,proto3" json:"packing_name,omitempty"`
MpqUnitName string `protobuf:"bytes,36,opt,name=mpq_unit_name,json=mpqUnitName,proto3" json:"mpq_unit_name,omitempty"`
AcType int64 `protobuf:"varint,37,opt,name=ac_type,json=acType,proto3" json:"ac_type,omitempty"`
AllowCoupon int64 `protobuf:"varint,38,opt,name=allow_coupon,json=allowCoupon,proto3" json:"allow_coupon,omitempty"`
ClassId1Name string `protobuf:"bytes,39,opt,name=class_id1_name,json=classId1Name,proto3" json:"class_id1_name,omitempty"`
ClassId2Name string `protobuf:"bytes,40,opt,name=class_id2_name,json=classId2Name,proto3" json:"class_id2_name,omitempty"`
IsBuy int64 `protobuf:"varint,41,opt,name=is_buy,json=isBuy,proto3" json:"is_buy,omitempty"`
HkDeliveryType string `protobuf:"bytes,42,opt,name=hk_delivery_type,json=hkDeliveryType,proto3" json:"hk_delivery_type,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GoodsModel) Reset() { *m = GoodsModel{} }
func (m *GoodsModel) String() string { return proto.CompactTextString(m) }
func (*GoodsModel) ProtoMessage() {}
func (*GoodsModel) Descriptor() ([]byte, []int) {
return fileDescriptor_f689add15dae9986, []int{7}
}
func (m *GoodsModel) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GoodsModel.Unmarshal(m, b)
}
func (m *GoodsModel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GoodsModel.Marshal(b, m, deterministic)
}
func (m *GoodsModel) XXX_Merge(src proto.Message) {
xxx_messageInfo_GoodsModel.Merge(m, src)
}
func (m *GoodsModel) XXX_Size() int {
return xxx_messageInfo_GoodsModel.Size(m)
}
func (m *GoodsModel) XXX_DiscardUnknown() {
xxx_messageInfo_GoodsModel.DiscardUnknown(m)
}
var xxx_messageInfo_GoodsModel proto.InternalMessageInfo
func (m *GoodsModel) GetOtherAttrs() *OTHER_ATTRS {
if m != nil {
return m.OtherAttrs
}
return nil
}
func (m *GoodsModel) GetPickType() int64 {
if m != nil {
return m.PickType
}
return 0
}
func (m *GoodsModel) GetBarcode() string {
if m != nil {
return m.Barcode
}
return ""
}
func (m *GoodsModel) GetGoodsId() string {
if m != nil {
return m.GoodsId
}
return ""
}
func (m *GoodsModel) GetGoodsType() int64 {
if m != nil {
return m.GoodsType
}
return 0
}
func (m *GoodsModel) GetSupplierId() int64 {
if m != nil {
return m.SupplierId
}
return 0
}
func (m *GoodsModel) GetBrandId() int64 {
if m != nil {
return m.BrandId
}
return 0
}
func (m *GoodsModel) GetClassId1() int64 {
if m != nil {
return m.ClassId1
}
return 0
}
func (m *GoodsModel) GetClassId2() int64 {
if m != nil {
return m.ClassId2
}
return 0
}
func (m *GoodsModel) GetGoodsName() string {
if m != nil {
return m.GoodsName
}
return ""
}
func (m *GoodsModel) GetStatus() int64 {
if m != nil {
return m.Status
}
return 0
}
func (m *GoodsModel) GetEncoded() string {
if m != nil {
return m.Encoded
}
return ""
}
func (m *GoodsModel) GetEncap() string {
if m != nil {
return m.Encap
}
return ""
}
func (m *GoodsModel) GetPacking() int64 {
if m != nil {
return m.Packing
}
return 0
}
func (m *GoodsModel) GetGoodsUnit() int64 {
if m != nil {
return m.GoodsUnit
}
return 0
}
func (m *GoodsModel) GetGoodsImages() bool {
if m != nil {
return m.GoodsImages
}
return false
}
func (m *GoodsModel) GetPdf() string {
if m != nil {
return m.Pdf
}
return ""
}
func (m *GoodsModel) GetGoodsBrief() string {
if m != nil {
return m.GoodsBrief
}
return ""
}
func (m *GoodsModel) GetMoq() int64 {
if m != nil {
return m.Moq
}
return 0
}
func (m *GoodsModel) GetMpq() int64 {
if m != nil {
return m.Mpq
}
return 0
}
func (m *GoodsModel) GetLadderPrice() []*LADDER_PRICE {
if m != nil {
return m.LadderPrice
}
return nil
}
func (m *GoodsModel) GetUpdateTime() int64 {
if m != nil {
return m.UpdateTime
}
return 0
}
func (m *GoodsModel) GetSkuName() string {
if m != nil {
return m.SkuName
}
return ""
}
func (m *GoodsModel) GetMpl() int64 {
if m != nil {
return m.Mpl
}
return 0
}
func (m *GoodsModel) GetStock() int64 {
if m != nil {
return m.Stock
}
return 0
}
func (m *GoodsModel) GetAttrs() string {
if m != nil {
return m.Attrs
}
return ""
}
func (m *GoodsModel) GetCost() string {
if m != nil {
return m.Cost
}
return ""
}
func (m *GoodsModel) GetNewCost() string {
if m != nil {
return m.NewCost
}
return ""
}
func (m *GoodsModel) GetSupplierStock() int64 {
if m != nil {
return m.SupplierStock
}
return 0
}
func (m *GoodsModel) GetSelfSupplierType() int64 {
if m != nil {
return m.SelfSupplierType
}
return 0
}
func (m *GoodsModel) GetCnDeliveryTime() string {
if m != nil {
return m.CnDeliveryTime
}
return ""
}
func (m *GoodsModel) GetBrandName() string {
if m != nil {
return m.BrandName
}
return ""
}
func (m *GoodsModel) GetSupplierName() string {
if m != nil {
return m.SupplierName
}
return ""
}
func (m *GoodsModel) GetGoodsUnitName() string {
if m != nil {
return m.GoodsUnitName
}
return ""
}
func (m *GoodsModel) GetPackingName() string {
if m != nil {
return m.PackingName
}
return ""
}
func (m *GoodsModel) GetMpqUnitName() string {
if m != nil {
return m.MpqUnitName
}
return ""
}
func (m *GoodsModel) GetAcType() int64 {
if m != nil {
return m.AcType
}
return 0
}
func (m *GoodsModel) GetAllowCoupon() int64 {
if m != nil {
return m.AllowCoupon
}
return 0
}
func (m *GoodsModel) GetClassId1Name() string {
if m != nil {
return m.ClassId1Name
}
return ""
}
func (m *GoodsModel) GetClassId2Name() string {
if m != nil {
return m.ClassId2Name
}
return ""
}
func (m *GoodsModel) GetIsBuy() int64 {
if m != nil {
return m.IsBuy
}
return 0
}
func (m *GoodsModel) GetHkDeliveryType() string {
if m != nil {
return m.HkDeliveryType
}
return ""
}
func init() { func init() {
proto.RegisterType((*GoodsNameModel)(nil), "bom.GoodsNameModel")
proto.RegisterType((*AutoSpuRequest)(nil), "bom.AutoSpuRequest") proto.RegisterType((*AutoSpuRequest)(nil), "bom.AutoSpuRequest")
proto.RegisterType((*AutoSpuResponse)(nil), "bom.AutoSpuResponse") proto.RegisterType((*AutoSpuResponse)(nil), "bom.AutoSpuResponse")
proto.RegisterType((*RecommendRequest)(nil), "bom.RecommendRequest")
proto.RegisterType((*ResponseData)(nil), "bom.ResponseData")
proto.RegisterType((*RecommendResponse)(nil), "bom.RecommendResponse")
proto.RegisterType((*OTHER_ATTRS)(nil), "bom.OTHER_ATTRS")
proto.RegisterType((*LADDER_PRICE)(nil), "bom.LADDER_PRICE")
proto.RegisterType((*GoodsModel)(nil), "bom.GoodsModel")
} }
func init() { proto.RegisterFile("bom.proto", fileDescriptor_f689add15dae9986) } func init() { proto.RegisterFile("bom.proto", fileDescriptor_f689add15dae9986) }
var fileDescriptor_f689add15dae9986 = []byte{ var fileDescriptor_f689add15dae9986 = []byte{
// 211 bytes of a gzipped FileDescriptorProto // 1003 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0xcd, 0x6a, 0x84, 0x30, 0x1f, 0x8b, 0x08, 0x00, 0x00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, 0x9d, 0xaa, 0x01, 0x56, 0x3d, 0x85, 0x56, 0xac,
0x83, 0x69, 0xb1, 0x66, 0xdf, 0x90, 0x2b, 0x62, 0x7d, 0x5b, 0xac, 0xad, 0xf6, 0x8b, 0x65, 0xb0,
0xfb, 0x91, 0xfb, 0x96, 0xb4, 0x5f, 0x2c, 0x87, 0xb5, 0xcf, 0xdc, 0xe0, 0x16, 0xe0, 0x56, 0xa6,
0x63, 0x91, 0x7f, 0xb6, 0x8e, 0x7d, 0x0f, 0xed, 0xf2, 0x53, 0xee, 0x3d, 0x41, 0x73, 0xef, 0xfe,
0x13, 0x78, 0x71, 0xb2, 0x0b, 0xd2, 0xb7, 0x61, 0xda, 0xc2, 0x7f, 0x0f, 0x3f, 0xfe, 0x1b, 0x00,
0x00, 0xff, 0xff, 0xdf, 0x01, 0xa0, 0x4b, 0x4a, 0x08, 0x00, 0x00,
} }
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: goods.proto
package goods
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type OTHER_ATTRS struct {
GrossWegiht string `protobuf:"bytes,1,opt,name=gross_wegiht,json=grossWegiht,proto3" json:"gross_wegiht,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *OTHER_ATTRS) Reset() { *m = OTHER_ATTRS{} }
func (m *OTHER_ATTRS) String() string { return proto.CompactTextString(m) }
func (*OTHER_ATTRS) ProtoMessage() {}
func (*OTHER_ATTRS) Descriptor() ([]byte, []int) {
return fileDescriptor_a30593c5487368b0, []int{0}
}
func (m *OTHER_ATTRS) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_OTHER_ATTRS.Unmarshal(m, b)
}
func (m *OTHER_ATTRS) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_OTHER_ATTRS.Marshal(b, m, deterministic)
}
func (m *OTHER_ATTRS) XXX_Merge(src proto.Message) {
xxx_messageInfo_OTHER_ATTRS.Merge(m, src)
}
func (m *OTHER_ATTRS) XXX_Size() int {
return xxx_messageInfo_OTHER_ATTRS.Size(m)
}
func (m *OTHER_ATTRS) XXX_DiscardUnknown() {
xxx_messageInfo_OTHER_ATTRS.DiscardUnknown(m)
}
var xxx_messageInfo_OTHER_ATTRS proto.InternalMessageInfo
func (m *OTHER_ATTRS) GetGrossWegiht() string {
if m != nil {
return m.GrossWegiht
}
return ""
}
type LADDER_PRICE struct {
Purchases int64 `protobuf:"varint,1,opt,name=purchases,proto3" json:"purchases,omitempty"`
PriceCn float32 `protobuf:"fixed32,2,opt,name=price_cn,json=priceCn,proto3" json:"price_cn,omitempty"`
PriceUs float32 `protobuf:"fixed32,3,opt,name=price_us,json=priceUs,proto3" json:"price_us,omitempty"`
PriceAc float32 `protobuf:"fixed32,4,opt,name=price_ac,json=priceAc,proto3" json:"price_ac,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *LADDER_PRICE) Reset() { *m = LADDER_PRICE{} }
func (m *LADDER_PRICE) String() string { return proto.CompactTextString(m) }
func (*LADDER_PRICE) ProtoMessage() {}
func (*LADDER_PRICE) Descriptor() ([]byte, []int) {
return fileDescriptor_a30593c5487368b0, []int{1}
}
func (m *LADDER_PRICE) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LADDER_PRICE.Unmarshal(m, b)
}
func (m *LADDER_PRICE) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LADDER_PRICE.Marshal(b, m, deterministic)
}
func (m *LADDER_PRICE) XXX_Merge(src proto.Message) {
xxx_messageInfo_LADDER_PRICE.Merge(m, src)
}
func (m *LADDER_PRICE) XXX_Size() int {
return xxx_messageInfo_LADDER_PRICE.Size(m)
}
func (m *LADDER_PRICE) XXX_DiscardUnknown() {
xxx_messageInfo_LADDER_PRICE.DiscardUnknown(m)
}
var xxx_messageInfo_LADDER_PRICE proto.InternalMessageInfo
func (m *LADDER_PRICE) GetPurchases() int64 {
if m != nil {
return m.Purchases
}
return 0
}
func (m *LADDER_PRICE) GetPriceCn() float32 {
if m != nil {
return m.PriceCn
}
return 0
}
func (m *LADDER_PRICE) GetPriceUs() float32 {
if m != nil {
return m.PriceUs
}
return 0
}
func (m *LADDER_PRICE) GetPriceAc() float32 {
if m != nil {
return m.PriceAc
}
return 0
}
type GoodsModel struct {
OtherAttrs *OTHER_ATTRS `protobuf:"bytes,1,opt,name=other_attrs,json=otherAttrs,proto3" json:"other_attrs,omitempty"`
PickType int64 `protobuf:"varint,2,opt,name=pick_type,json=pickType,proto3" json:"pick_type,omitempty"`
Barcode string `protobuf:"bytes,3,opt,name=barcode,proto3" json:"barcode,omitempty"`
GoodsId string `protobuf:"bytes,4,opt,name=goods_id,json=goodsId,proto3" json:"goods_id,omitempty"`
GoodsType int64 `protobuf:"varint,5,opt,name=goods_type,json=goodsType,proto3" json:"goods_type,omitempty"`
SupplierId int64 `protobuf:"varint,6,opt,name=supplier_id,json=supplierId,proto3" json:"supplier_id,omitempty"`
BrandId int64 `protobuf:"varint,7,opt,name=brand_id,json=brandId,proto3" json:"brand_id,omitempty"`
ClassId1 int64 `protobuf:"varint,8,opt,name=class_id1,json=classId1,proto3" json:"class_id1,omitempty"`
ClassId2 int64 `protobuf:"varint,9,opt,name=class_id2,json=classId2,proto3" json:"class_id2,omitempty"`
GoodsName string `protobuf:"bytes,10,opt,name=goods_name,json=goodsName,proto3" json:"goods_name,omitempty"`
Status int64 `protobuf:"varint,11,opt,name=status,proto3" json:"status,omitempty"`
Encoded string `protobuf:"bytes,12,opt,name=encoded,proto3" json:"encoded,omitempty"`
Encap string `protobuf:"bytes,13,opt,name=encap,proto3" json:"encap,omitempty"`
Packing int64 `protobuf:"varint,14,opt,name=packing,proto3" json:"packing,omitempty"`
GoodsUnit int64 `protobuf:"varint,15,opt,name=goods_unit,json=goodsUnit,proto3" json:"goods_unit,omitempty"`
GoodsImages bool `protobuf:"varint,16,opt,name=goods_images,json=goodsImages,proto3" json:"goods_images,omitempty"`
Pdf bool `protobuf:"varint,17,opt,name=pdf,proto3" json:"pdf,omitempty"`
GoodsBrief string `protobuf:"bytes,18,opt,name=goods_brief,json=goodsBrief,proto3" json:"goods_brief,omitempty"`
Moq int64 `protobuf:"varint,19,opt,name=moq,proto3" json:"moq,omitempty"`
Mpq int64 `protobuf:"varint,20,opt,name=mpq,proto3" json:"mpq,omitempty"`
LadderPrice []*LADDER_PRICE `protobuf:"bytes,21,rep,name=ladder_price,json=ladderPrice,proto3" json:"ladder_price,omitempty"`
UpdateTime int64 `protobuf:"varint,22,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
SkuName string `protobuf:"bytes,23,opt,name=sku_name,json=skuName,proto3" json:"sku_name,omitempty"`
Mpl int64 `protobuf:"varint,24,opt,name=mpl,proto3" json:"mpl,omitempty"`
Stock int64 `protobuf:"varint,25,opt,name=stock,proto3" json:"stock,omitempty"`
Attrs string `protobuf:"bytes,26,opt,name=attrs,proto3" json:"attrs,omitempty"`
Cost string `protobuf:"bytes,27,opt,name=cost,proto3" json:"cost,omitempty"`
NewCost string `protobuf:"bytes,28,opt,name=new_cost,json=newCost,proto3" json:"new_cost,omitempty"`
SupplierStock int64 `protobuf:"varint,29,opt,name=supplier_stock,json=supplierStock,proto3" json:"supplier_stock,omitempty"`
SelfSupplierType int64 `protobuf:"varint,30,opt,name=self_supplier_type,json=selfSupplierType,proto3" json:"self_supplier_type,omitempty"`
CnDeliveryTime string `protobuf:"bytes,31,opt,name=cn_delivery_time,json=cnDeliveryTime,proto3" json:"cn_delivery_time,omitempty"`
BrandName string `protobuf:"bytes,32,opt,name=brand_name,json=brandName,proto3" json:"brand_name,omitempty"`
SupplierName string `protobuf:"bytes,33,opt,name=supplier_name,json=supplierName,proto3" json:"supplier_name,omitempty"`
GoodsUnitName string `protobuf:"bytes,34,opt,name=goods_unit_name,json=goodsUnitName,proto3" json:"goods_unit_name,omitempty"`
PackingName string `protobuf:"bytes,35,opt,name=packing_name,json=packingName,proto3" json:"packing_name,omitempty"`
MpqUnitName string `protobuf:"bytes,36,opt,name=mpq_unit_name,json=mpqUnitName,proto3" json:"mpq_unit_name,omitempty"`
AcType int64 `protobuf:"varint,37,opt,name=ac_type,json=acType,proto3" json:"ac_type,omitempty"`
AllowCoupon int64 `protobuf:"varint,38,opt,name=allow_coupon,json=allowCoupon,proto3" json:"allow_coupon,omitempty"`
ClassId1Name string `protobuf:"bytes,39,opt,name=class_id1_name,json=classId1Name,proto3" json:"class_id1_name,omitempty"`
ClassId2Name string `protobuf:"bytes,40,opt,name=class_id2_name,json=classId2Name,proto3" json:"class_id2_name,omitempty"`
IsBuy int64 `protobuf:"varint,41,opt,name=is_buy,json=isBuy,proto3" json:"is_buy,omitempty"`
HkDeliveryType string `protobuf:"bytes,42,opt,name=hk_delivery_type,json=hkDeliveryType,proto3" json:"hk_delivery_type,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GoodsModel) Reset() { *m = GoodsModel{} }
func (m *GoodsModel) String() string { return proto.CompactTextString(m) }
func (*GoodsModel) ProtoMessage() {}
func (*GoodsModel) Descriptor() ([]byte, []int) {
return fileDescriptor_a30593c5487368b0, []int{2}
}
func (m *GoodsModel) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GoodsModel.Unmarshal(m, b)
}
func (m *GoodsModel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GoodsModel.Marshal(b, m, deterministic)
}
func (m *GoodsModel) XXX_Merge(src proto.Message) {
xxx_messageInfo_GoodsModel.Merge(m, src)
}
func (m *GoodsModel) XXX_Size() int {
return xxx_messageInfo_GoodsModel.Size(m)
}
func (m *GoodsModel) XXX_DiscardUnknown() {
xxx_messageInfo_GoodsModel.DiscardUnknown(m)
}
var xxx_messageInfo_GoodsModel proto.InternalMessageInfo
func (m *GoodsModel) GetOtherAttrs() *OTHER_ATTRS {
if m != nil {
return m.OtherAttrs
}
return nil
}
func (m *GoodsModel) GetPickType() int64 {
if m != nil {
return m.PickType
}
return 0
}
func (m *GoodsModel) GetBarcode() string {
if m != nil {
return m.Barcode
}
return ""
}
func (m *GoodsModel) GetGoodsId() string {
if m != nil {
return m.GoodsId
}
return ""
}
func (m *GoodsModel) GetGoodsType() int64 {
if m != nil {
return m.GoodsType
}
return 0
}
func (m *GoodsModel) GetSupplierId() int64 {
if m != nil {
return m.SupplierId
}
return 0
}
func (m *GoodsModel) GetBrandId() int64 {
if m != nil {
return m.BrandId
}
return 0
}
func (m *GoodsModel) GetClassId1() int64 {
if m != nil {
return m.ClassId1
}
return 0
}
func (m *GoodsModel) GetClassId2() int64 {
if m != nil {
return m.ClassId2
}
return 0
}
func (m *GoodsModel) GetGoodsName() string {
if m != nil {
return m.GoodsName
}
return ""
}
func (m *GoodsModel) GetStatus() int64 {
if m != nil {
return m.Status
}
return 0
}
func (m *GoodsModel) GetEncoded() string {
if m != nil {
return m.Encoded
}
return ""
}
func (m *GoodsModel) GetEncap() string {
if m != nil {
return m.Encap
}
return ""
}
func (m *GoodsModel) GetPacking() int64 {
if m != nil {
return m.Packing
}
return 0
}
func (m *GoodsModel) GetGoodsUnit() int64 {
if m != nil {
return m.GoodsUnit
}
return 0
}
func (m *GoodsModel) GetGoodsImages() bool {
if m != nil {
return m.GoodsImages
}
return false
}
func (m *GoodsModel) GetPdf() bool {
if m != nil {
return m.Pdf
}
return false
}
func (m *GoodsModel) GetGoodsBrief() string {
if m != nil {
return m.GoodsBrief
}
return ""
}
func (m *GoodsModel) GetMoq() int64 {
if m != nil {
return m.Moq
}
return 0
}
func (m *GoodsModel) GetMpq() int64 {
if m != nil {
return m.Mpq
}
return 0
}
func (m *GoodsModel) GetLadderPrice() []*LADDER_PRICE {
if m != nil {
return m.LadderPrice
}
return nil
}
func (m *GoodsModel) GetUpdateTime() int64 {
if m != nil {
return m.UpdateTime
}
return 0
}
func (m *GoodsModel) GetSkuName() string {
if m != nil {
return m.SkuName
}
return ""
}
func (m *GoodsModel) GetMpl() int64 {
if m != nil {
return m.Mpl
}
return 0
}
func (m *GoodsModel) GetStock() int64 {
if m != nil {
return m.Stock
}
return 0
}
func (m *GoodsModel) GetAttrs() string {
if m != nil {
return m.Attrs
}
return ""
}
func (m *GoodsModel) GetCost() string {
if m != nil {
return m.Cost
}
return ""
}
func (m *GoodsModel) GetNewCost() string {
if m != nil {
return m.NewCost
}
return ""
}
func (m *GoodsModel) GetSupplierStock() int64 {
if m != nil {
return m.SupplierStock
}
return 0
}
func (m *GoodsModel) GetSelfSupplierType() int64 {
if m != nil {
return m.SelfSupplierType
}
return 0
}
func (m *GoodsModel) GetCnDeliveryTime() string {
if m != nil {
return m.CnDeliveryTime
}
return ""
}
func (m *GoodsModel) GetBrandName() string {
if m != nil {
return m.BrandName
}
return ""
}
func (m *GoodsModel) GetSupplierName() string {
if m != nil {
return m.SupplierName
}
return ""
}
func (m *GoodsModel) GetGoodsUnitName() string {
if m != nil {
return m.GoodsUnitName
}
return ""
}
func (m *GoodsModel) GetPackingName() string {
if m != nil {
return m.PackingName
}
return ""
}
func (m *GoodsModel) GetMpqUnitName() string {
if m != nil {
return m.MpqUnitName
}
return ""
}
func (m *GoodsModel) GetAcType() int64 {
if m != nil {
return m.AcType
}
return 0
}
func (m *GoodsModel) GetAllowCoupon() int64 {
if m != nil {
return m.AllowCoupon
}
return 0
}
func (m *GoodsModel) GetClassId1Name() string {
if m != nil {
return m.ClassId1Name
}
return ""
}
func (m *GoodsModel) GetClassId2Name() string {
if m != nil {
return m.ClassId2Name
}
return ""
}
func (m *GoodsModel) GetIsBuy() int64 {
if m != nil {
return m.IsBuy
}
return 0
}
func (m *GoodsModel) GetHkDeliveryType() string {
if m != nil {
return m.HkDeliveryType
}
return ""
}
func init() {
proto.RegisterType((*OTHER_ATTRS)(nil), "goods.OTHER_ATTRS")
proto.RegisterType((*LADDER_PRICE)(nil), "goods.LADDER_PRICE")
proto.RegisterType((*GoodsModel)(nil), "goods.GoodsModel")
}
func init() { proto.RegisterFile("goods.proto", fileDescriptor_a30593c5487368b0) }
var fileDescriptor_a30593c5487368b0 = []byte{
// 774 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x54, 0x5d, 0x6f, 0xea, 0x46,
0x10, 0x15, 0x97, 0x1b, 0x3e, 0xc6, 0xc0, 0xa5, 0x7b, 0xef, 0x4d, 0x36, 0x4d, 0xd2, 0x00, 0xf9,
0x28, 0xad, 0xaa, 0xa8, 0x21, 0x52, 0xdf, 0x09, 0x89, 0x5a, 0xa4, 0x7e, 0x44, 0x0e, 0x51, 0x1f,
0xad, 0x65, 0xbd, 0x01, 0x0b, 0x7f, 0x2c, 0x5e, 0xbb, 0x11, 0x0f, 0xfd, 0x2b, 0xfd, 0xad, 0xd5,
0xce, 0x18, 0x70, 0xde, 0x3c, 0x67, 0xce, 0xee, 0x9c, 0x39, 0x9c, 0x05, 0x9c, 0x45, 0x92, 0xf8,
0xe6, 0x46, 0xa7, 0x49, 0x96, 0xb0, 0x03, 0x2c, 0x06, 0x3f, 0x83, 0xf3, 0xd7, 0xec, 0xb7, 0x47,
0xd7, 0x1b, 0xcf, 0x66, 0xee, 0x33, 0xeb, 0x43, 0x6b, 0x91, 0x26, 0xc6, 0x78, 0x6f, 0x6a, 0x11,
0x2c, 0x33, 0x5e, 0xe9, 0x55, 0x86, 0x4d, 0xd7, 0x41, 0xec, 0x6f, 0x84, 0x06, 0xff, 0x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39, 0x08, 0x89, 0x5b, 0xf7, 0xa1, 0x25, 0xc2, 0x30,
0xb1, 0x3e, 0xe7, 0x3a, 0x89, 0xf9, 0x35, 0x76, 0x1d, 0xc4, 0x26, 0x08, 0xb1, 0x4b, 0xe8, 0xec,
0x9e, 0x28, 0x0d, 0xf8, 0x9e, 0x16, 0xda, 0xbe, 0x53, 0x9c, 0x50, 0x62, 0x8d, 0x88, 0x35, 0x7c,
0xc7, 0x1a, 0x21, 0xeb, 0x2b, 0xd4, 0x02, 0xe3, 0xcd, 0xf3, 0x0d, 0xff, 0x81, 0x52, 0x11, 0x98,
0xfb, 0x7c, 0x63, 0xbd, 0x5f, 0xae, 0x4a, 0xde, 0x5b, 0x9d, 0x3f, 0x92, 0xf7, 0xcb, 0xd5, 0xce,
0xfb, 0x8d, 0x56, 0xf3, 0x1a, 0xfe, 0xbf, 0xdf, 0xfd, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x3b, 0xa6,
0xc1, 0x76, 0xee, 0x05, 0x00, 0x00,
}
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: goods.proto
package goods
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
...@@ -5,10 +5,6 @@ service BomService { ...@@ -5,10 +5,6 @@ service BomService {
rpc AutoSpu(AutoSpuRequest) returns (AutoSpuResponse); rpc AutoSpu(AutoSpuRequest) returns (AutoSpuResponse);
} }
message GoodsNameModel{
string goods_name = 1;
}
message AutoSpuRequest { message AutoSpuRequest {
// @inject_tag: uri:"goods_name" // @inject_tag: uri:"goods_name"
string goods_name = 1; string goods_name = 1;
...@@ -19,5 +15,94 @@ message AutoSpuResponse{ ...@@ -19,5 +15,94 @@ message AutoSpuResponse{
int32 error_code = 1; int32 error_code = 1;
// @inject_tag: json:"error_message" // @inject_tag: json:"error_message"
string error_message = 2; string error_message = 2;
// @inject_tag: json:"data"
repeated string data = 3; repeated string data = 3;
} }
message RecommendRequest{
// @inject_tag: form:"goods_name"
string goods_name = 1;
// @inject_tag: form:"num"
int32 num = 2;
// @inject_tag: form:"delivery_type"
int32 delivery_type = 3;
// @inject_tag: form:"flag"
int32 flag = 4;
// @inject_tag: form:"p"
int32 p = 5;
// @inject_tag: form:"offset"
int32 offset = 6;
}
message ResponseData{
int64 total = 1;
int32 flag = 2;
repeated GoodsModel data = 3;
}
message RecommendResponse{
// @inject_tag: json:"error_code"
int32 error_code = 1;
// @inject_tag: json:"error_message"
string error_message = 2;
// @inject_tag: json:"data"
ResponseData data = 3;
}
message OTHER_ATTRS {
string gross_wegiht = 1;
}
message LADDER_PRICE {
int64 purchases = 1;
float price_cn = 2;
float price_us = 3;
float price_ac = 4;
}
message GoodsModel {
OTHER_ATTRS other_attrs = 1;
int64 pick_type = 2;
string barcode = 3;
string goods_id = 4;
int64 goods_type = 5;
int64 supplier_id = 6;
int64 brand_id = 7;
int64 class_id1 = 8;
int64 class_id2 = 9;
string goods_name = 10;
int64 status = 11;
string encoded = 12;
string encap = 13;
int64 packing = 14;
int64 goods_unit = 15;
bool goods_images = 16;
string pdf = 17;
string goods_brief = 18;
int64 moq = 19;
int64 mpq = 20;
repeated LADDER_PRICE ladder_price = 21;
int64 update_time = 22;
string sku_name = 23;
int64 mpl = 24;
int64 stock = 25;
string attrs = 26;
string cost = 27;
string new_cost = 28;
int64 supplier_stock = 29;
int64 self_supplier_type = 30;
string cn_delivery_time = 31;
string brand_name = 32;
string supplier_name = 33;
string goods_unit_name = 34;
string packing_name = 35;
string mpq_unit_name = 36;
int64 ac_type = 37;
int64 allow_coupon = 38;
string class_id1_name = 39;
string class_id2_name = 40;
int64 is_buy = 41;
string hk_delivery_type = 42;
}
\ No newline at end of file
syntax = "proto3";
package goods;
message OTHER_ATTRS {
string gross_wegiht = 1;
}
message LADDER_PRICE {
int64 purchases = 1;
float price_cn = 2;
float price_us = 3;
float price_ac = 4;
}
message GoodsModel {
OTHER_ATTRS other_attrs = 1;
int64 pick_type = 2;
string barcode = 3;
string goods_id = 4;
int64 goods_type = 5;
int64 supplier_id = 6;
int64 brand_id = 7;
int64 class_id1 = 8;
int64 class_id2 = 9;
string goods_name = 10;
int64 status = 11;
string encoded = 12;
string encap = 13;
int64 packing = 14;
int64 goods_unit = 15;
bool goods_images = 16;
bool pdf = 17;
string goods_brief = 18;
int64 moq = 19;
int64 mpq = 20;
repeated LADDER_PRICE ladder_price = 21;
int64 update_time = 22;
string sku_name = 23;
int64 mpl = 24;
int64 stock = 25;
string attrs = 26;
string cost = 27;
string new_cost = 28;
int64 supplier_stock = 29;
int64 self_supplier_type = 30;
string cn_delivery_time = 31;
string brand_name = 32;
string supplier_name = 33;
string goods_unit_name = 34;
string packing_name = 35;
string mpq_unit_name = 36;
int64 ac_type = 37;
int64 allow_coupon = 38;
string class_id1_name = 39;
string class_id2_name = 40;
int64 is_buy = 41;
string hk_delivery_type = 42;
}
\ No newline at end of file
...@@ -4,19 +4,15 @@ import ( ...@@ -4,19 +4,15 @@ import (
"context" "context"
"github.com/prometheus/common/log" "github.com/prometheus/common/log"
"github.com/tidwall/gjson" "github.com/tidwall/gjson"
elastic "gopkg.in/olivere/elastic.v5" "gopkg.in/olivere/elastic.v5"
"regexp" "regexp"
"search_server/dao" "search_server/pkg/common"
"search_server/pkg/config"
"search_server/pkg/es" "search_server/pkg/es"
"search_server/protopb/bom" "search_server/protopb/bom"
. "search_server/protopb/course"
"strings" "strings"
) )
//func NewCourseModel(id int32, name string) *CourseModel {
// return &CourseModel{CourseId: id, CourseName: name}
//}
type BomServiceImpl struct{} type BomServiceImpl struct{}
func (bs *BomServiceImpl) AutoSpu(ctx context.Context, req *bom.AutoSpuRequest, rsp *bom.AutoSpuResponse) error { func (bs *BomServiceImpl) AutoSpu(ctx context.Context, req *bom.AutoSpuRequest, rsp *bom.AutoSpuResponse) error {
...@@ -25,20 +21,14 @@ func (bs *BomServiceImpl) AutoSpu(ctx context.Context, req *bom.AutoSpuRequest, ...@@ -25,20 +21,14 @@ func (bs *BomServiceImpl) AutoSpu(ctx context.Context, req *bom.AutoSpuRequest,
return nil return nil
} }
func (bs *BomServiceImpl) GetDetail(ctx context.Context, req *DetailRequest, rsp *DetailResponse) error { func (bs *BomServiceImpl) Recommend(ctx context.Context, req *bom.RecommendRequest, rsp *bom.RecommendResponse) error {
//只取课程详细 if req.GoodsName == "" || req.Flag == 0 {
if req.FetchType == 0 || req.FetchType == 1 || req.FetchType == 3 { rsp.ErrorCode = 101
if err := dao.GetCourseDetail(int(req.CourseId)).Find(rsp.Course).Error; err != nil { rsp.ErrorMessage = "参数不全"
return err return nil
}
}
//只取计数表详细
if req.FetchType == 2 || req.FetchType == 3 {
if err := dao.GetCourseCounts(int(req.CourseId)).Find(&rsp.Counts).Error; err != nil {
return err
}
} }
recommendData := Recommend(req)
rsp.Data = recommendData
return nil return nil
} }
...@@ -78,3 +68,114 @@ func getTermQuery(goodsName string) (query *elastic.BoolQuery) { ...@@ -78,3 +68,114 @@ func getTermQuery(goodsName string) (query *elastic.BoolQuery) {
query.MustNot(elastic.NewTermQuery("brand_id", 0)) query.MustNot(elastic.NewTermQuery("brand_id", 0))
return query return query
} }
//推荐商品搜索
func Recommend(req *bom.RecommendRequest) (rsp *bom.ResponseData) {
//转换请求参数
req = changeRecommendReq(req)
//获取需要请求的索引
index := getRecommendSearchIndex(req)
//是否是精确匹配
isRawSearch := false
if req.Flag == 3 {
isRawSearch = true
}
//获取es的请求参数
queryJson := getRecommendSearchParams(isRawSearch, req)
result, err := es.CurlES(index, queryJson)
if err != nil {
log.Error(err)
}
//获取需要的数据
total := gjson.Get(result, "hits.total").Int()
var response bom.ResponseData
response.Total = total
//获取goods_id列表去商品服务获取商品
list := gjson.Get(result, "hits.hits.#._source").Array()
var goodsIdList []string
var goodsIdListStr string
for _, goods := range list {
goodsId := gjson.Get(goods.String(), "goods_id").String()
goodsIdList = append(goodsIdList, goodsId)
}
goodsIdListStr = strings.Join(goodsIdList, ",")
goodsList, err := GetGoodsInfo(goodsIdListStr)
response.Data = goodsList
response.Flag = req.Flag
return &response
}
//处理recommend接口的请求参数
func changeRecommendReq(req *bom.RecommendRequest) (res *bom.RecommendRequest) {
//设置默认值
if req.Num == 0 {
req.Num = 1
}
if req.P == 0 {
req.P = 1
}
if !(req.P > 1) {
req.Flag = 3
}
//转换处理商品名称
replace, _ := regexp.Compile("[^A-Za-z0-9]+")
req.GoodsName = replace.ReplaceAllString(req.GoodsName, "")
req.GoodsName = strings.ToUpper(req.GoodsName)
if req.Flag == 2 {
//截取字符后再精确匹配
req.GoodsName = common.SubKeyWordStr(req.GoodsName)
}
return req
}
//获取recommend接口需要请求的索引
func getRecommendSearchIndex(req *bom.RecommendRequest) (index string) {
index = config.Get("es.hk_delivery_type_supplier").String()
//如果是内地收货的情况下
if req.DeliveryType == 1 {
index = index + ",liexin_ziying,zhuanmai"
}
return
}
//获取请求es的参数
func getRecommendSearchParams(isRawSearch bool, req *bom.RecommendRequest) (result string) {
result = getBomTermQuery(req.GoodsName, "", req.Num, isRawSearch)
return
}
//获取bom单的term查询
func getBomTermQuery(goodsName, brandName string, number int32, isRawSearch bool) (result string) {
query := elastic.NewBoolQuery()
if isRawSearch {
field := "auto_goods_name.raw"
replace, _ := regexp.Compile("[^A-Za-z0-9]+")
goodsName := replace.ReplaceAllString(goodsName, "")
goodsName = strings.ToUpper(goodsName)
//搜索商品名称
query = query.Filter(elastic.NewTermQuery(field, goodsName))
//判断是否存在brandName,存在就去搜索brandName
if brandName != "" {
brandName = strings.ToUpper(brandName)
query = query.Should(elastic.NewConstantScoreQuery(elastic.NewTermQuery("brand_name", brandName)).Boost(2))
}
//搜索库存
query = query.Should(elastic.NewConstantScoreQuery(elastic.NewRangeQuery("stock").Gte(number)))
} else {
field := "auto_goods_name"
query = query.Must(elastic.NewTermQuery(field, goodsName))
}
//query = query.Filter(elastic.NewTermQuery("status", 1))
source := elastic.NewSearchSource().Query(query)
source.From(0)
if isRawSearch {
source.Size(100)
} else {
source.Size(1)
}
source.Sort("_score", false).Sort("sort", false).Sort("single_price", true)
queryRequest := elastic.NewSearchRequest().Source(source)
result, _ = queryRequest.Body()
return result
}
package service
import (
"github.com/imroc/req"
"github.com/tidwall/gjson"
"search_server/pkg/config"
"search_server/protopb/bom"
)
func GetGoodsInfo(goodsIdsStr string) (goodsList []*bom.GoodsModel, err error) {
goodsServerUrl := config.Get("goods.api_url").String()
params := req.Param{
"goods_id": goodsIdsStr,
}
//fmt.Println(goodsIdsStr)
resp, err := req.Post(goodsServerUrl+"/synchronization", params)
if err != nil {
return
}
//先判断返回的data是不是字典,不是字典代表可能是返回字符串了
if gjson.Get(resp.String(), "data").IsObject() {
for _, data := range gjson.Get(resp.String(), "data").Map() {
//还要去判断是否是bool
if data.IsObject() {
var goods bom.GoodsModel
goods.GoodsName = data.Get("goods_name").String()
goods.GoodsId = data.Get("goods_id").String()
goods.BrandId = data.Get("goods_id").Int()
goods.Pdf = data.Get("pdf").String()
goods.Stock = data.Get("stock").Int()
goods.Mpq = data.Get("mpq").Int()
goods.Moq = data.Get("moq").Int()
goods.SupplierName = data.Get("supplier_name").String()
goods.BrandName = data.Get("brand_name").String()
goods.HkDeliveryType = data.Get("hk_delivery_time").String()
goods.CnDeliveryTime = data.Get("cn_delivery_time").String()
goods.IsBuy = data.Get("is_buy").Int()
goods.Mpl = data.Get("mpl").Int()
goods.Encap = data.Get("encap").String()
goods.SupplierId = data.Get("supplier_id").Int()
goods.Status = data.Get("status").Int()
goods.GoodsType = data.Get("goods_type").Int()
goods.AcType = data.Get("ac_type").Int()
var ladderPrice []*bom.LADDER_PRICE
for _, price := range data.Get("ladder_price").Array() {
var ladder bom.LADDER_PRICE
ladder = bom.LADDER_PRICE{
Purchases: price.Get("purchases").Int(),
PriceUs: float32(price.Get("price_us").Float()),
PriceCn: float32(price.Get("price_cn").Float()),
PriceAc: float32(price.Get("price_ac").Float()),
}
ladderPrice = append(ladderPrice, &ladder)
}
goods.LadderPrice = ladderPrice
goodsList = append(goodsList, &goods)
}
}
}
return
}
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