Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
W
weimob
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
weimob
Commits
4c47a1f5
提交
4c47a1f5
authored
12月 09, 2021
作者:
lihaixin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更改结构体名称
上级
b1e3c5f2
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
28 行增加
和
28 行删除
+28
-28
after.go
weimob/after.go
+4
-4
authorize.go
weimob/authorize.go
+2
-2
goods.go
weimob/goods.go
+14
-14
order.go
weimob/order.go
+4
-4
weimob.go
weimob/weimob.go
+4
-4
没有找到文件。
weimob/after.go
浏览文件 @
4c47a1f5
...
...
@@ -5,7 +5,7 @@ import (
"errors"
)
func
(
w
*
w
eimobConfig
)
RightsDetial
(
accessToken
,
rightsId
string
)
(
res
RightsDetialRes
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
RightsDetial
(
accessToken
,
rightsId
string
)
(
res
RightsDetialRes
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/rights/getRightsOrderDetail?accesstoken="
+
accessToken
query
:=
map
[
string
]
interface
{}{
"id"
:
rightsId
}
...
...
@@ -19,7 +19,7 @@ func (w *weimobConfig) RightsDetial(accessToken, rightsId string) (res RightsDet
}
//拒绝售后
func
(
w
*
w
eimobConfig
)
AfterSaleRefuse
(
accesstoken
string
,
id
int64
,
refusedReason
string
)
(
res
string
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
AfterSaleRefuse
(
accesstoken
string
,
id
int64
,
refusedReason
string
)
(
res
string
,
err
error
)
{
if
id
<=
0
{
err
=
errors
.
New
(
"售后id不能为空"
)
return
...
...
@@ -42,7 +42,7 @@ func (w *weimobConfig) AfterSaleRefuse(accesstoken string, id int64, refusedReas
}
//同意售后
func
(
w
*
w
eimobConfig
)
AfterSaleAgree
(
accesstoken
string
,
id
,
rightsType
int64
)
(
res
string
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
AfterSaleAgree
(
accesstoken
string
,
id
,
rightsType
int64
)
(
res
string
,
err
error
)
{
if
id
<=
0
{
err
=
errors
.
New
(
"售后id不能为空"
)
return
...
...
@@ -65,7 +65,7 @@ func (w *weimobConfig) AfterSaleAgree(accesstoken string, id, rightsType int64)
}
//商家确认收货 a
func
(
w
*
w
eimobConfig
)
ConfirmReceivedRightsGoods
(
accesstoken
string
,
id
int64
)
(
res
string
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
ConfirmReceivedRightsGoods
(
accesstoken
string
,
id
int64
)
(
res
string
,
err
error
)
{
if
id
<=
0
{
err
=
errors
.
New
(
"售后id不能为空"
)
return
...
...
weimob/authorize.go
浏览文件 @
4c47a1f5
...
...
@@ -5,7 +5,7 @@ import (
)
//获取授权店铺
func
(
w
*
w
eimobConfig
)
GetShopRefreshToken
(
clientId
,
clientSecret
,
redirectUri
,
code
string
)
(
data
*
ShopAccessTokenRes
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
GetShopRefreshToken
(
clientId
,
clientSecret
,
redirectUri
,
code
string
)
(
data
*
ShopAccessTokenRes
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"fuwu/b/oauth2/token?code="
+
code
+
"&grant_type=authorization_code&client_id="
+
clientId
+
"&client_secret="
+
clientSecret
+
"&redirect_uri="
+
redirectUri
res
:=
w
.
DoPost
(
url
,
map
[
string
]
interface
{}{})
err
=
json
.
Unmarshal
([]
byte
(
res
),
&
data
)
...
...
@@ -13,7 +13,7 @@ func (w *weimobConfig) GetShopRefreshToken(clientId, clientSecret, redirectUri,
}
//刷新店铺access_token接口
func
(
w
*
w
eimobConfig
)
GetShopAccessToken
(
clientId
,
clientSecret
,
refreshToken
string
)
(
data
*
ShopAccessTokenRes
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
GetShopAccessToken
(
clientId
,
clientSecret
,
refreshToken
string
)
(
data
*
ShopAccessTokenRes
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"fuwu/b/oauth2/token?grant_type=refresh_token&client_id="
+
clientId
+
"&client_secret="
+
clientSecret
+
"&refresh_token="
+
refreshToken
res
:=
w
.
DoPost
(
url
,
map
[
string
]
interface
{}{})
err
=
json
.
Unmarshal
([]
byte
(
res
),
&
data
)
...
...
weimob/goods.go
浏览文件 @
4c47a1f5
...
...
@@ -4,7 +4,7 @@ import (
"encoding/json"
)
func
(
w
*
w
eimobConfig
)
GetSkuId
(
accesstoken
string
,
outerSkuCode
int
,
storeId
string
)
(
res
*
GetSkuIdRes
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
GetSkuId
(
accesstoken
string
,
outerSkuCode
int
,
storeId
string
)
(
res
*
GetSkuIdRes
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/singleProduct/queryProductListBySkuCode?accesstoken="
+
accesstoken
data
:=
w
.
DoPost
(
url
,
map
[
string
]
interface
{}{
"skuCode"
:
outerSkuCode
,
"storeId"
:
storeId
})
...
...
@@ -12,20 +12,20 @@ func (w *weimobConfig) GetSkuId(accesstoken string, outerSkuCode int, storeId st
return
}
func
(
w
*
w
eimobConfig
)
UpdatePrice
(
accesstoken
string
,
req
map
[
string
]
interface
{})
(
res
*
WeimobRes
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
UpdatePrice
(
accesstoken
string
,
req
map
[
string
]
interface
{})
(
res
*
WeimobRes
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/retailGoods/updatePrice?accesstoken="
+
accesstoken
data
:=
w
.
DoPost
(
url
,
req
)
err
=
json
.
Unmarshal
([]
byte
(
data
),
&
res
)
return
}
func
(
w
*
w
eimobConfig
)
UpdateStock
(
accesstoken
string
,
req
map
[
string
]
interface
{})
(
res
*
WeimobRes
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
UpdateStock
(
accesstoken
string
,
req
map
[
string
]
interface
{})
(
res
*
WeimobRes
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/goods/updateStock?accesstoken="
+
accesstoken
data
:=
w
.
DoPost
(
url
,
req
)
err
=
json
.
Unmarshal
([]
byte
(
data
),
&
res
)
return
}
func
(
w
*
w
eimobConfig
)
GoodsDetail
(
accesstoken
,
goodId
string
)
(
res
*
WeimobGoodsDetialResult
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
GoodsDetail
(
accesstoken
,
goodId
string
)
(
res
*
WeimobGoodsDetialResult
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/goods/queryGoodsDetail?accesstoken="
+
accesstoken
body
,
_
:=
json
.
Marshal
(
map
[
string
]
string
{
"goodsId"
:
goodId
})
data
:=
w
.
PostJSON
(
url
,
body
)
...
...
@@ -34,7 +34,7 @@ func (w *weimobConfig) GoodsDetail(accesstoken, goodId string) (res *WeimobGoods
}
//查询模板
func
(
w
*
w
eimobConfig
)
FindFreightTemplateList
(
accesstoken
string
)
(
res
*
FindFreightTemplateListRes
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
FindFreightTemplateList
(
accesstoken
string
)
(
res
*
FindFreightTemplateListRes
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/goods/findFreightTemplateList?accesstoken="
+
accesstoken
data
:=
w
.
DoPost
(
url
,
map
[
string
]
interface
{}{})
err
=
json
.
Unmarshal
([]
byte
(
data
),
&
res
)
...
...
@@ -42,7 +42,7 @@ func (w *weimobConfig) FindFreightTemplateList(accesstoken string) (res *FindFre
}
//查询快递
func
(
w
*
w
eimobConfig
)
FindDeliveryTypeList
(
accesstoken
string
)
(
res
*
FindDeliveryTypeListRes
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
FindDeliveryTypeList
(
accesstoken
string
)
(
res
*
FindDeliveryTypeListRes
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/goods/findDeliveryTypeList?accesstoken="
+
accesstoken
data
:=
w
.
DoPost
(
url
,
map
[
string
]
interface
{}{})
err
=
json
.
Unmarshal
([]
byte
(
data
),
&
res
)
...
...
@@ -50,7 +50,7 @@ func (w *weimobConfig) FindDeliveryTypeList(accesstoken string) (res *FindDelive
}
//查询sku
func
(
w
*
w
eimobConfig
)
CategoryAttrInfo
(
accesstoken
string
,
deliveryParams
map
[
string
]
interface
{})
(
res
*
CategoryAttrInfoRes
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
CategoryAttrInfo
(
accesstoken
string
,
deliveryParams
map
[
string
]
interface
{})
(
res
*
CategoryAttrInfoRes
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/category/queryCategoryAttrInfo?accesstoken="
+
accesstoken
queryBody
,
err
:=
json
.
Marshal
(
deliveryParams
)
if
err
!=
nil
{
...
...
@@ -62,7 +62,7 @@ func (w *weimobConfig) CategoryAttrInfo(accesstoken string, deliveryParams map[s
}
//添加sku
func
(
w
*
w
eimobConfig
)
AddAttributeName
(
accesstoken
string
,
deliveryParams
map
[
string
]
interface
{})
(
res
*
AddAttributeNameRes
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
AddAttributeName
(
accesstoken
string
,
deliveryParams
map
[
string
]
interface
{})
(
res
*
AddAttributeNameRes
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/category/addAttribute?accesstoken="
+
accesstoken
body
,
err
:=
json
.
Marshal
(
deliveryParams
)
if
err
!=
nil
{
...
...
@@ -74,7 +74,7 @@ func (w *weimobConfig) AddAttributeName(accesstoken string, deliveryParams map[s
}
//添加sku值
func
(
w
*
w
eimobConfig
)
AddAttributeValue
(
accesstoken
string
,
deliveryParams
map
[
string
]
interface
{})
(
res
*
AddAttributeValueRes
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
AddAttributeValue
(
accesstoken
string
,
deliveryParams
map
[
string
]
interface
{})
(
res
*
AddAttributeValueRes
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/category/addAttrValue?accesstoken="
+
accesstoken
body
,
err
:=
json
.
Marshal
(
deliveryParams
)
if
err
!=
nil
{
...
...
@@ -85,7 +85,7 @@ func (w *weimobConfig) AddAttributeValue(accesstoken string, deliveryParams map[
return
}
func
(
w
*
w
eimobConfig
)
Add
(
accesstoken
string
,
good
map
[
string
]
interface
{})
(
res
*
WeimobGoodsResult
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
Add
(
accesstoken
string
,
good
map
[
string
]
interface
{})
(
res
*
WeimobGoodsResult
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/goods/addGoods?accesstoken="
+
accesstoken
body
,
err
:=
json
.
Marshal
(
good
)
if
err
!=
nil
{
...
...
@@ -95,7 +95,7 @@ func (w *weimobConfig) Add(accesstoken string, good map[string]interface{}) (res
err
=
json
.
Unmarshal
([]
byte
(
data
),
&
res
)
return
}
func
(
w
*
w
eimobConfig
)
Update
(
accesstoken
string
,
good
map
[
string
]
interface
{})
(
res
*
WeimobGoodsResult
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
Update
(
accesstoken
string
,
good
map
[
string
]
interface
{})
(
res
*
WeimobGoodsResult
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/goods/updateGoods?accesstoken="
+
accesstoken
body
,
err
:=
json
.
Marshal
(
good
)
if
err
!=
nil
{
...
...
@@ -106,7 +106,7 @@ func (w *weimobConfig) Update(accesstoken string, good map[string]interface{}) (
return
}
func
(
w
*
w
eimobConfig
)
Dels
(
accesstoken
string
,
goodIds
[]
int64
)
(
res
*
WeimobGoodsDelResult
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
Dels
(
accesstoken
string
,
goodIds
[]
int64
)
(
res
*
WeimobGoodsDelResult
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/goods/deleteGoods?accesstoken="
+
accesstoken
body
,
_
:=
json
.
Marshal
(
map
[
string
][]
int64
{
"goodsIdList"
:
goodIds
})
data
:=
w
.
PostJSON
(
url
,
body
)
...
...
@@ -114,13 +114,13 @@ func (w *weimobConfig) Dels(accesstoken string, goodIds []int64) (res *WeimobGoo
return
}
func
(
w
*
w
eimobConfig
)
CategoryTree
(
accesstoken
string
)
(
res
*
Result
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
CategoryTree
(
accesstoken
string
)
(
res
*
Result
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/category/queryCategoryTree?accesstoken="
+
accesstoken
data
:=
w
.
DoPost
(
url
,
map
[
string
]
interface
{}{})
err
=
json
.
Unmarshal
([]
byte
(
data
),
&
res
)
return
}
func
(
w
*
w
eimobConfig
)
ChildrenCategory
(
accesstoken
string
,
categoryId
int
)
(
res
*
Result
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
ChildrenCategory
(
accesstoken
string
,
categoryId
int
)
(
res
*
Result
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/category/queryChildrenCategory?accesstoken="
+
accesstoken
body
:=
map
[
string
]
interface
{}{
"categoryId"
:
categoryId
,
...
...
weimob/order.go
浏览文件 @
4c47a1f5
...
...
@@ -5,7 +5,7 @@ import (
"errors"
)
func
(
w
*
w
eimobConfig
)
OrderDetial
(
accesstoken
,
orderNo
string
)
(
res
*
WeimodOrderDetialRes
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
OrderDetial
(
accesstoken
,
orderNo
string
)
(
res
*
WeimodOrderDetialRes
,
err
error
)
{
if
len
(
orderNo
)
<=
0
{
err
=
errors
.
New
(
"订单号错误"
)
return
...
...
@@ -21,7 +21,7 @@ func (w *weimobConfig) OrderDetial(accesstoken, orderNo string) (res *WeimodOrde
}
//微店取消订单
func
(
w
*
w
eimobConfig
)
WeimobCancelOrder
(
accesstoken
,
orderNo
,
specificCancelReason
,
cancelReason
string
,
cancelReasonId
int
)
(
res
string
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
WeimobCancelOrder
(
accesstoken
,
orderNo
,
specificCancelReason
,
cancelReason
string
,
cancelReasonId
int
)
(
res
string
,
err
error
)
{
if
len
(
orderNo
)
<=
0
{
err
=
errors
.
New
(
"订单号错误"
)
return
...
...
@@ -49,7 +49,7 @@ func (w *weimobConfig) WeimobCancelOrder(accesstoken, orderNo, specificCancelRea
}
//微店发货接口
func
(
w
*
w
eimobConfig
)
WeimobLogisticsAddMultiPack
(
accesstoken
string
,
deliveryParams
map
[
string
]
interface
{})
(
res
string
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
WeimobLogisticsAddMultiPack
(
accesstoken
string
,
deliveryParams
map
[
string
]
interface
{})
(
res
string
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/order/deliveryOrder?accesstoken="
+
accesstoken
body
,
err
:=
json
.
Marshal
(
deliveryParams
)
if
err
!=
nil
{
...
...
@@ -59,7 +59,7 @@ func (w *weimobConfig) WeimobLogisticsAddMultiPack(accesstoken string, deliveryP
err
=
json
.
Unmarshal
([]
byte
(
data
),
&
res
)
return
}
func
(
w
*
w
eimobConfig
)
OrderList
(
accesstoken
string
,
order
*
WeimodOrderListReq
)
(
res
*
WeimodOrderListRes
,
err
error
)
{
func
(
w
*
W
eimobConfig
)
OrderList
(
accesstoken
string
,
order
*
WeimodOrderListReq
)
(
res
*
WeimodOrderListRes
,
err
error
)
{
url
:=
w
.
ApiUrl
+
"api/1_0/ec/order/queryOrderList?accesstoken="
+
accesstoken
body
,
err
:=
json
.
Marshal
(
order
)
if
err
!=
nil
{
...
...
weimob/weimob.go
浏览文件 @
4c47a1f5
...
...
@@ -7,18 +7,18 @@ import (
"net/http"
)
type
w
eimobConfig
struct
{
type
W
eimobConfig
struct
{
ApiUrl
string
ServerName
string
}
var
Weimob
=
w
eimobConfig
{
var
Weimob
=
W
eimobConfig
{
" you ApiUrl"
,
//无特殊情况为 "https://dopen.weimob.com/",
"you ServerName"
,
//项目名
}
//post json参数
func
(
w
*
w
eimobConfig
)
PostJSON
(
url
string
,
data
[]
byte
)
string
{
func
(
w
*
W
eimobConfig
)
PostJSON
(
url
string
,
data
[]
byte
)
string
{
req
,
err
:=
http
.
NewRequest
(
"POST"
,
url
,
bytes
.
NewReader
(
data
))
if
err
!=
nil
{
return
""
...
...
@@ -39,7 +39,7 @@ func (w *weimobConfig) PostJSON(url string, data []byte) string {
}
//Json post
func
(
w
*
w
eimobConfig
)
DoPost
(
url
string
,
params
map
[
string
]
interface
{})
string
{
func
(
w
*
W
eimobConfig
)
DoPost
(
url
string
,
params
map
[
string
]
interface
{})
string
{
data
,
errp
:=
json
.
Marshal
(
params
)
if
errp
!=
nil
{
// logs.Log("POST/PostJSON/ERR", "error", "参数json化错误:【%v】 ", errp)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论