Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
L
library
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
library
Commits
806dad2d
提交
806dad2d
authored
9月 30, 2024
作者:
张立波
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tm v3
上级
bd552da5
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
196 行增加
和
20 行删除
+196
-20
tm_goods_detail.go
upstream/tmv3/tm_goods_detail.go
+57
-20
tm_goods_spu_saleinfo.go
upstream/tmv3/tm_goods_spu_saleinfo.go
+63
-0
tm_goods_spu_saleinfos.go
upstream/tmv3/tm_goods_spu_saleinfos.go
+76
-0
没有找到文件。
upstream/tmv3/tm_goods_detail.go
浏览文件 @
806dad2d
...
...
@@ -15,46 +15,83 @@ type GoodsDetailReq struct {
}
type
GoodsDetailRes
struct
{
CanSell
bool
`json:"canSell"`
FuzzyQuantity
string
`json:"fuzzyQuantity"`
LmItemId
string
`json:"lmItemId"`
ProductId
string
`json:"productId"`
ProductStatus
string
`json:"productStatus"`
Quantity
int
`json:"quantity"`
RequestId
string
`json:"requestId"`
ShopId
string
`json:"shopId"`
Skus
[]
struct
{
CanSell
bool
`json:"canSell"`
FuzzyQuantity
string
`json:"fuzzyQuantity"`
MarkPrice
int
`json:"markPrice"`
Price
int
`json:"price"`
ProductId
string
`json:"productId"`
Quantity
int
`json:"quantity"`
Title
string
`json:"title"`
PicUrl
string
`json:"picUrl"`
DescPath
string
`json:"descPath"`
CategoryLeafId
int
`json:"categoryLeafId"`
Images
[]
string
`json:"images"`
Properties
[]
struct
{
Text
string
`json:"text"`
Values
[]
string
`json:"values"`
}
`json:"properties"`
ProductSpecs
[]
struct
{
KeyId
int
`json:"keyId"`
Key
string
`json:"key"`
Values
[]
struct
{
ValueId
int
`json:"valueId"`
Value
string
`json:"value"`
}
`json:"values"`
}
`json:"productSpecs"`
Skus
[]
struct
{
ShopId
string
`json:"shopId"`
ProductId
string
`json:"productId"`
SkuId
string
`json:"skuId"`
SkuStatus
string
`json:"skuStatus"`
Title
string
`json:"title"`
PicUrl
string
`json:"picUrl"`
SkuSpecs
[]
struct
{
KeyId
int
`json:"keyId"`
Key
string
`json:"key"`
ValueId
int
`json:"valueId"`
Value
string
`json:"value"`
}
`json:"skuSpecs"`
SkuSpecsCode
string
`json:"skuSpecsCode"`
SkuStatus
string
`json:"skuStatus"`
CanSell
bool
`json:"canSell"`
Quantity
int
`json:"quantity"`
FuzzyQuantity
string
`json:"fuzzyQuantity"`
Price
int
`json:"price"`
MarkPrice
int
`json:"markPrice"`
PlatformPrice
int
`json:"platformPrice"`
DivisionCode
string
`json:"divisionCode"`
}
`json:"skus"`
Title
string
`json:"title"`
CanSell
bool
`json:"canSell"`
ProductType
string
`json:"productType"`
ProductStatus
string
`json:"productStatus"`
ShopId
string
`json:"shopId"`
Quantity
int
`json:"quantity"`
FuzzyQuantity
string
`json:"fuzzyQuantity"`
TaxRate
interface
{}
`json:"taxRate"`
TaxCode
interface
{}
`json:"taxCode"`
CategoryChain
[]
struct
{
CategoryId
int
`json:"categoryId"`
Name
string
`json:"name"`
ParentId
int
`json:"parentId"`
Level
int
`json:"level"`
IsLeaf
bool
`json:"isLeaf"`
}
`json:"categoryChain"`
SoldQuantity
string
`json:"soldQuantity"`
DivisionCode
string
`json:"divisionCode"`
}
// Detail 查询选品池商品详情
func
(
s
goodsTm
)
Detail
(
ctx
context
.
Context
,
req
GoodsDetailReq
)
(
res
*
GoodsDetailRes
,
err
error
)
{
Start
:=
gtime
.
TimestampMilli
()
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"GetSelectionProduct
SaleInfo
"
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"GetSelectionProduct"
)
defer
func
()
{
Log
(
ctx
,
req
,
res
,
err
,
Start
)
}()
if
req
.
PurchaserId
==
""
{
req
.
PurchaserId
=
PurchaserId
}
Request
:=
&
client
.
GetSelectionProduct
SaleInfo
Request
{
Request
:=
&
client
.
GetSelectionProductRequest
{
PurchaserId
:
tea
.
String
(
req
.
PurchaserId
),
}
if
req
.
DivisionCode
!=
""
{
Request
.
SetDivisionCode
(
req
.
DivisionCode
)
}
r
,
err
:=
server
.
GetSelectionProduct
SaleInfo
(
tea
.
String
(
req
.
ProductId
),
Request
)
r
,
err
:=
server
.
GetSelectionProduct
(
tea
.
String
(
req
.
ProductId
),
Request
)
if
err
!=
nil
{
return
}
...
...
upstream/tmv3/tm_goods_spu_saleinfo.go
0 → 100644
浏览文件 @
806dad2d
package
tmv3
import
(
"context"
"github.com/alibabacloud-go/linkedmall-20230930/v2/client"
"github.com/alibabacloud-go/tea/tea"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/os/gtime"
)
type
SpuSaleInfoReq
struct
{
ProductId
string
PurchaserId
string
DivisionCode
string
}
type
SpuSaleInfoRes
struct
{
CanSell
bool
`json:"canSell"`
FuzzyQuantity
string
`json:"fuzzyQuantity"`
LmItemId
string
`json:"lmItemId"`
ProductId
string
`json:"productId"`
ProductStatus
string
`json:"productStatus"`
Quantity
int
`json:"quantity"`
RequestId
string
`json:"requestId"`
ShopId
string
`json:"shopId"`
Skus
[]
struct
{
CanSell
bool
`json:"canSell"`
FuzzyQuantity
string
`json:"fuzzyQuantity"`
MarkPrice
int
`json:"markPrice"`
Price
int
`json:"price"`
ProductId
string
`json:"productId"`
Quantity
int
`json:"quantity"`
ShopId
string
`json:"shopId"`
SkuId
string
`json:"skuId"`
SkuStatus
string
`json:"skuStatus"`
Title
string
`json:"title"`
}
`json:"skus"`
Title
string
`json:"title"`
}
// SpuSaleInfo 查询选品池商品销售信息
func
(
s
goodsTm
)
SpuSaleInfo
(
ctx
context
.
Context
,
req
SpuSaleInfoReq
)
(
res
*
SpuSaleInfoRes
,
err
error
)
{
Start
:=
gtime
.
TimestampMilli
()
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"GetSelectionProductSaleInfo"
)
defer
func
()
{
Log
(
ctx
,
req
,
res
,
err
,
Start
)
}()
if
req
.
PurchaserId
==
""
{
req
.
PurchaserId
=
PurchaserId
}
Request
:=
&
client
.
GetSelectionProductSaleInfoRequest
{
PurchaserId
:
tea
.
String
(
req
.
PurchaserId
),
}
if
req
.
DivisionCode
!=
""
{
Request
.
SetDivisionCode
(
req
.
DivisionCode
)
}
r
,
err
:=
server
.
GetSelectionProductSaleInfo
(
tea
.
String
(
req
.
ProductId
),
Request
)
if
err
!=
nil
{
return
}
err
=
gjson
.
New
(
r
.
Body
)
.
Scan
(
&
res
)
return
}
upstream/tmv3/tm_goods_spu_saleinfos.go
0 → 100644
浏览文件 @
806dad2d
package
tmv3
import
(
"context"
"github.com/alibabacloud-go/linkedmall-20230930/v2/client"
"github.com/alibabacloud-go/tea/tea"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gtime"
)
type
SpuSaleInfosReq
struct
{
DivisionCode
string
PurchaserId
string
ProductIds
[]
string
}
type
SpuSaleInfosRes
struct
{
RequestId
string
`json:"requestId"`
ProductSaleInfos
[]
struct
{
RequestId
interface
{}
`json:"requestId"`
ShopId
string
`json:"shopId"`
DivisionCode
string
`json:"divisionCode"`
ProductId
string
`json:"productId"`
Title
string
`json:"title"`
Skus
[]
struct
{
ShopId
string
`json:"shopId"`
DivisionCode
string
`json:"divisionCode"`
ProductId
string
`json:"productId"`
SkuId
string
`json:"skuId"`
Title
string
`json:"title"`
SkuStatus
string
`json:"skuStatus"`
CanSell
bool
`json:"canSell"`
Quantity
int
`json:"quantity"`
FuzzyQuantity
string
`json:"fuzzyQuantity"`
Price
int
`json:"price"`
MarkPrice
int
`json:"markPrice"`
}
`json:"skus"`
CanSell
bool
`json:"canSell"`
ProductStatus
string
`json:"productStatus"`
Quantity
int
`json:"quantity"`
FuzzyQuantity
string
`json:"fuzzyQuantity"`
}
`json:"productSaleInfos"`
}
// SpuSaleInfos 查询选品池商品销售信息
func
(
s
goodsTm
)
SpuSaleInfos
(
ctx
context
.
Context
,
req
SpuSaleInfosReq
)
(
res
*
SpuSaleInfosRes
,
err
error
)
{
Start
:=
gtime
.
TimestampMilli
()
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"ListSelectionProductSaleInfos"
)
defer
func
()
{
Log
(
ctx
,
req
,
res
,
err
,
Start
)
}()
if
req
.
PurchaserId
==
""
{
req
.
PurchaserId
=
PurchaserId
}
Request
:=
&
client
.
ListSelectionProductSaleInfosRequest
{}
var
Body
=
new
(
client
.
ProductSaleInfoListQuery
)
Body
.
SetPurchaserId
(
req
.
PurchaserId
)
if
req
.
DivisionCode
!=
""
{
Body
.
SetDivisionCode
(
req
.
DivisionCode
)
}
var
list
[]
*
string
for
_
,
item
:=
range
req
.
ProductIds
{
list
=
append
(
list
,
tea
.
String
(
item
))
}
Body
.
SetProductIds
(
list
)
Request
.
SetBody
(
Body
)
r
,
err
:=
server
.
ListSelectionProductSaleInfos
(
Request
)
if
err
!=
nil
{
return
}
g
.
Log
()
.
Info
(
r
.
Body
)
err
=
gjson
.
New
(
r
.
Body
)
.
Scan
(
&
res
)
return
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论