Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
L
library
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
library
Commits
66f06a3f
提交
66f06a3f
authored
2月 27, 2023
作者:
张立波
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
淘特
上级
5d7cc674
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
90 行增加
和
85 行删除
+90
-85
model.go
notify/model.go
+1
-1
ali.go
upstream/ali/ali.go
+2
-2
dwd.go
upstream/dwd/dwd.go
+5
-1
dwd_token.go
upstream/dwd/dwd_token.go
+2
-2
hdh.go
upstream/hdh/hdh.go
+1
-1
itao.go
upstream/itao/itao.go
+22
-23
itao_goods.go
upstream/itao/itao_goods.go
+19
-19
itao_logistics.go
upstream/itao/itao_logistics.go
+31
-29
itao_refund.go
upstream/itao/itao_refund.go
+2
-2
itao_upload.go
upstream/itao/itao_upload.go
+1
-1
base.go
upstream/schl/base.go
+2
-2
tm.go
upstream/tm/tm.go
+1
-1
wpc.go
upstream/wpc/wpc.go
+1
-1
没有找到文件。
notify/model.go
浏览文件 @
66f06a3f
...
@@ -27,7 +27,7 @@ type NotifyGoodsData struct {
...
@@ -27,7 +27,7 @@ type NotifyGoodsData struct {
type
ThirdGoods
struct
{
type
ThirdGoods
struct
{
ThirdId
interface
{}
`json:"third_id"`
//三方商品id
ThirdId
interface
{}
`json:"third_id"`
//三方商品id
Skus
[]
int
`json:"skus"`
//三方规格id
Skus
[]
int
`json:"skus
,omitempty
"`
//三方规格id
}
}
//通知消息系统
//通知消息系统
...
...
upstream/ali/ali.go
浏览文件 @
66f06a3f
...
@@ -86,9 +86,9 @@ func (s *Config) Post(ctx context.Context, method string, params g.Map) (str str
...
@@ -86,9 +86,9 @@ func (s *Config) Post(ctx context.Context, method string, params g.Map) (str str
ctx
=
context
.
WithValue
(
ctx
,
"Method"
,
"POST"
)
ctx
=
context
.
WithValue
(
ctx
,
"Method"
,
"POST"
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
Url
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
Url
)
if
err
!=
nil
{
if
err
!=
nil
{
g
.
Log
()
.
C
at
(
PkgName
)
.
Ctx
(
ctx
)
.
Infof
(
"参数【%v】错误【%v】响应时间【%v】"
,
paramStr
,
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
g
.
Log
()
.
C
tx
(
ctx
)
.
Cat
(
PkgName
)
.
Cat
(
"error"
)
.
Infof
(
"参数【%v】错误【%v】响应时间【%v】"
,
paramStr
,
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
}
else
{
}
else
{
g
.
Log
()
.
C
at
(
PkgName
)
.
Ctx
(
ctx
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
str
,
gtime
.
TimestampMilli
()
-
Start
)
g
.
Log
()
.
C
tx
(
ctx
)
.
Cat
(
PkgName
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
str
,
gtime
.
TimestampMilli
()
-
Start
)
}
}
}()
}()
str
=
resp
.
ReadAllString
()
str
=
resp
.
ReadAllString
()
...
...
upstream/dwd/dwd.go
浏览文件 @
66f06a3f
...
@@ -15,6 +15,7 @@ type Config struct {
...
@@ -15,6 +15,7 @@ type Config struct {
AppKey
string
AppKey
string
AppSecret
string
AppSecret
string
API
string
API
string
DB
int
}
}
var
server
*
Config
var
server
*
Config
...
@@ -24,6 +25,9 @@ const CacheKey = "dwd:token"
...
@@ -24,6 +25,9 @@ const CacheKey = "dwd:token"
func
New
(
req
*
Config
)
{
func
New
(
req
*
Config
)
{
server
=
req
server
=
req
if
server
.
DB
==
0
{
server
.
DB
=
10
}
return
return
}
}
...
@@ -89,7 +93,7 @@ func post(ctx context.Context, method string, req interface{}) (res *CommonRes,
...
@@ -89,7 +93,7 @@ func post(ctx context.Context, method string, req interface{}) (res *CommonRes,
ctx
=
context
.
WithValue
(
ctx
,
"Method"
,
"POST"
)
ctx
=
context
.
WithValue
(
ctx
,
"Method"
,
"POST"
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
method
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
method
)
if
err
!=
nil
{
if
err
!=
nil
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Infof
(
"参数【%v】错误【%v】响应时间【%v】"
,
request
.
MustToJsonString
(),
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
PkgName
)
.
Cat
(
"error"
)
.
Infof
(
"参数【%v】错误【%v】响应时间【%v】"
,
request
.
MustToJsonString
(),
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
}
else
{
}
else
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
PkgName
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
request
.
MustToJsonString
(),
str
,
gtime
.
TimestampMilli
()
-
Start
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
PkgName
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
request
.
MustToJsonString
(),
str
,
gtime
.
TimestampMilli
()
-
Start
)
}
}
...
...
upstream/dwd/dwd_token.go
浏览文件 @
66f06a3f
...
@@ -52,7 +52,7 @@ func (s *tokenDwd) Access(ctx context.Context) (res string, err error) {
...
@@ -52,7 +52,7 @@ func (s *tokenDwd) Access(ctx context.Context) (res string, err error) {
defer
func
()
{
defer
func
()
{
_
=
conn
.
Close
()
_
=
conn
.
Close
()
}()
}()
_
,
_
=
conn
.
DoVar
(
"SELECT"
,
10
)
_
,
_
=
conn
.
DoVar
(
"SELECT"
,
server
.
DB
)
cache
,
_
:=
conn
.
DoVar
(
"HGETALL"
,
CacheKey
)
cache
,
_
:=
conn
.
DoVar
(
"HGETALL"
,
CacheKey
)
if
!
cache
.
IsEmpty
()
{
if
!
cache
.
IsEmpty
()
{
_
=
cache
.
Scan
(
&
s
)
_
=
cache
.
Scan
(
&
s
)
...
@@ -90,7 +90,7 @@ func (s *tokenDwd) post(ctx context.Context, req interface{}) (res string, err e
...
@@ -90,7 +90,7 @@ func (s *tokenDwd) post(ctx context.Context, req interface{}) (res string, err e
ctx
=
context
.
WithValue
(
ctx
,
"Method"
,
"POST"
)
ctx
=
context
.
WithValue
(
ctx
,
"Method"
,
"POST"
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"token"
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"token"
)
if
err
!=
nil
{
if
err
!=
nil
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Infof
(
"参数【%v】错误【%v】响应时间【%v】"
,
request
.
MustToJsonString
(),
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
PkgName
)
.
Cat
(
"error"
)
.
Infof
(
"参数【%v】错误【%v】响应时间【%v】"
,
request
.
MustToJsonString
(),
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
}
else
{
}
else
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
PkgName
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
request
.
MustToJsonString
(),
res
,
gtime
.
TimestampMilli
()
-
Start
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
PkgName
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
request
.
MustToJsonString
(),
res
,
gtime
.
TimestampMilli
()
-
Start
)
}
}
...
...
upstream/hdh/hdh.go
浏览文件 @
66f06a3f
...
@@ -48,7 +48,7 @@ func post(ctx context.Context, method string, req interface{}) (res string, err
...
@@ -48,7 +48,7 @@ func post(ctx context.Context, method string, req interface{}) (res string, err
ctx
=
context
.
WithValue
(
ctx
,
"Method"
,
"POST"
)
ctx
=
context
.
WithValue
(
ctx
,
"Method"
,
"POST"
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
Url
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
Url
)
if
err
!=
nil
{
if
err
!=
nil
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Infof
(
"参数【%v】错误【%v】响应时间【%v】"
,
param
.
MustToJsonString
(),
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
pkgName
)
.
Cat
(
"error"
)
.
Infof
(
"参数【%v】错误【%v】响应时间【%v】"
,
param
.
MustToJsonString
(),
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
}
else
{
}
else
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
pkgName
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
param
.
MustToJsonString
(),
res
,
gtime
.
TimestampMilli
()
-
Start
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
pkgName
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
param
.
MustToJsonString
(),
res
,
gtime
.
TimestampMilli
()
-
Start
)
}
}
...
...
upstream/itao/itao.go
浏览文件 @
66f06a3f
...
@@ -8,9 +8,7 @@ import (
...
@@ -8,9 +8,7 @@ import (
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gctx"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/os/gtimer"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/util/gconv"
"net/url"
"net/url"
"sort"
"sort"
...
@@ -22,6 +20,7 @@ type Config struct {
...
@@ -22,6 +20,7 @@ type Config struct {
ApiUrl
string
ApiUrl
string
AppKey
string
AppKey
string
AppSecret
string
AppSecret
string
DB
int
}
}
var
server
*
Config
var
server
*
Config
...
@@ -32,10 +31,9 @@ const Host = "https://open.huoju6.com/openapi/param2/1/com.huoju6.open/"
...
@@ -32,10 +31,9 @@ const Host = "https://open.huoju6.com/openapi/param2/1/com.huoju6.open/"
func
New
(
req
*
Config
)
{
func
New
(
req
*
Config
)
{
server
=
req
server
=
req
gtimer
.
Add
(
time
.
Hour
,
func
()
{
if
server
.
DB
==
0
{
var
ctx
=
gctx
.
New
()
server
.
DB
=
10
_
,
_
=
server
.
accessToken
(
ctx
)
}
})
return
return
}
}
...
@@ -78,7 +76,7 @@ func sign(method string, req g.Map) (err error) {
...
@@ -78,7 +76,7 @@ func sign(method string, req g.Map) (err error) {
}
}
func
(
s
*
Config
)
Post
(
ctx
context
.
Context
,
method
string
,
params
g
.
Map
)
(
str
string
,
err
error
)
{
func
(
s
*
Config
)
Post
(
ctx
context
.
Context
,
method
string
,
params
g
.
Map
)
(
str
string
,
err
error
)
{
params
[
"access_token"
],
err
=
s
.
Get
AccessToken
(
ctx
)
params
[
"access_token"
],
err
=
AccessToken
(
ctx
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
...
@@ -116,7 +114,7 @@ func Post(ctx context.Context, method string, params g.Map) (str string, err err
...
@@ -116,7 +114,7 @@ func Post(ctx context.Context, method string, params g.Map) (str string, err err
}
}
func
(
s
*
Config
)
Get
(
ctx
context
.
Context
,
method
string
,
params
g
.
Map
)
(
str
string
,
err
error
)
{
func
(
s
*
Config
)
Get
(
ctx
context
.
Context
,
method
string
,
params
g
.
Map
)
(
str
string
,
err
error
)
{
params
[
"access_token"
],
err
=
s
.
Get
AccessToken
(
ctx
)
params
[
"access_token"
],
err
=
AccessToken
(
ctx
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
...
@@ -157,43 +155,43 @@ func Get(ctx context.Context, method string, params g.Map) (str string, err erro
...
@@ -157,43 +155,43 @@ func Get(ctx context.Context, method string, params g.Map) (str string, err erro
}
}
func
(
s
*
Config
)
Get
AccessToken
(
ctx
context
.
Context
)
(
res
string
,
err
error
)
{
func
AccessToken
(
ctx
context
.
Context
)
(
res
string
,
err
error
)
{
var
conn
=
g
.
Redis
()
.
Conn
()
var
conn
=
g
.
Redis
()
.
Conn
()
defer
func
()
{
defer
func
()
{
_
=
conn
.
Close
()
_
=
conn
.
Close
()
}()
}()
_
,
_
=
conn
.
DoVar
(
"SELECT"
,
10
)
_
,
_
=
conn
.
DoVar
(
"SELECT"
,
server
.
DB
)
cache
,
_
:=
conn
.
DoVar
(
"HGETALL"
,
CacheKey
)
cache
,
_
:=
conn
.
DoVar
(
"HGETALL"
,
CacheKey
)
if
cache
.
IsEmpty
()
{
if
cache
.
IsEmpty
()
{
err
=
gerror
.
New
(
"获取token 失败"
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
PkgName
)
.
Line
(
true
)
.
Info
(
"获取token失败"
)
err
=
gerror
.
New
(
"获取token失败"
)
return
return
}
}
var
result
*
AuthTokenRes
var
result
*
AuthTokenRes
_
=
gjson
.
New
(
cache
)
.
Scan
(
&
result
)
_
=
gjson
.
New
(
cache
)
.
Scan
(
&
result
)
if
result
==
nil
||
result
.
AccessToken
==
""
{
if
result
==
nil
{
err
=
gerror
.
New
(
"获取token 失败"
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
PkgName
)
.
Line
(
true
)
.
Info
(
"获取token失败"
)
err
=
gerror
.
New
(
"获取token失败"
)
return
return
}
}
if
result
.
AccessTokenExpireTime
<
gtime
.
TimestampMilli
()
{
if
result
.
AccessToken
==
""
||
result
.
AccessTokenExpireTime
<
gtime
.
TimestampMilli
()
{
result
,
err
=
s
.
accessToken
(
ctx
)
result
,
err
=
RefreshToken
(
ctx
)
if
err
!=
nil
{
return
}
}
}
res
=
result
.
AccessToken
res
=
result
.
AccessToken
return
return
}
}
//
access
Token 刷新
//
Refresh
Token 刷新
func
(
s
*
Config
)
access
Token
(
ctx
context
.
Context
)
(
res
*
AuthTokenRes
,
err
error
)
{
func
Refresh
Token
(
ctx
context
.
Context
)
(
res
*
AuthTokenRes
,
err
error
)
{
var
conn
=
g
.
Redis
()
.
Conn
()
var
conn
=
g
.
Redis
()
.
Conn
()
defer
func
()
{
defer
func
()
{
_
=
conn
.
Close
()
_
=
conn
.
Close
()
}()
}()
_
,
_
=
conn
.
DoVar
(
"SELECT"
,
10
)
_
,
_
=
conn
.
DoVar
(
"SELECT"
,
server
.
DB
)
cache
,
_
:=
conn
.
DoVar
(
"HGETALL"
,
CacheKey
)
cache
,
_
:=
conn
.
DoVar
(
"HGETALL"
,
CacheKey
)
if
cache
.
IsEmpty
()
{
if
cache
.
IsEmpty
()
{
err
=
gerror
.
New
(
"获取token 失败"
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
PkgName
)
.
Line
(
true
)
.
Info
(
"获取token失败"
)
err
=
gerror
.
New
(
"获取token失败"
)
return
return
}
}
_
=
gjson
.
New
(
cache
)
.
Scan
(
&
res
)
_
=
gjson
.
New
(
cache
)
.
Scan
(
&
res
)
...
@@ -205,7 +203,8 @@ func (s *Config) accessToken(ctx context.Context) (res *AuthTokenRes, err error)
...
@@ -205,7 +203,8 @@ func (s *Config) accessToken(ctx context.Context) (res *AuthTokenRes, err error)
return
return
}
}
if
res
.
Code
!=
"success"
{
if
res
.
Code
!=
"success"
{
err
=
gerror
.
New
(
"获取token 失败"
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
PkgName
)
.
Line
(
true
)
.
Info
(
"获取token失败"
)
err
=
gerror
.
New
(
"获取token失败"
)
return
return
}
}
_
,
_
=
conn
.
Do
(
"HMSET"
,
CacheKey
,
"accessToken"
,
res
.
AccessToken
,
"accessTokenExpireTime"
,
res
.
AccessTokenExpireTime
)
_
,
_
=
conn
.
Do
(
"HMSET"
,
CacheKey
,
"accessToken"
,
res
.
AccessToken
,
"accessTokenExpireTime"
,
res
.
AccessTokenExpireTime
)
...
...
upstream/itao/itao_goods.go
浏览文件 @
66f06a3f
...
@@ -95,12 +95,12 @@ type GoodsDetailRes struct {
...
@@ -95,12 +95,12 @@ type GoodsDetailRes struct {
}
`json:"debugInfoMap"`
}
`json:"debugInfoMap"`
EnterNewLink
string
`json:"enterNewLink"`
EnterNewLink
string
`json:"enterNewLink"`
Item
struct
{
Item
struct
{
CategoryId
[]
string
`json:"categoryId"`
CategoryId
[]
string
`json:"categoryId"`
//商品的类目列表,从一级类目开始
CategoryName
[]
string
`json:"categoryName"`
CategoryName
[]
string
`json:"categoryName"`
//商品的类目标题
City
string
`json:"city"`
City
string
`json:"city"`
FastPostFee
int
`json:"fastPostFee"`
FastPostFee
int
`json:"fastPostFee"`
//商品的快递费用
Images
[]
string
`json:"images"`
Images
[]
string
`json:"images"`
ItemId
string
`json:"itemId"`
ItemId
string
`json:"itemId"`
//商品id
ItemServices
[]
struct
{
ItemServices
[]
struct
{
ActionTitle
string
`json:"actionTitle,omitempty"`
ActionTitle
string
`json:"actionTitle,omitempty"`
ActionUrl
string
`json:"actionUrl,omitempty"`
ActionUrl
string
`json:"actionUrl,omitempty"`
...
@@ -108,33 +108,33 @@ type GoodsDetailRes struct {
...
@@ -108,33 +108,33 @@ type GoodsDetailRes struct {
Title
string
`json:"title"`
Title
string
`json:"title"`
}
`json:"itemServices"`
}
`json:"itemServices"`
MainPic
string
`json:"mainPic"`
MainPic
string
`json:"mainPic"`
OrdinaryPostFee
int
`json:"ordinaryPostFee"`
OrdinaryPostFee
int
`json:"ordinaryPostFee"`
//商品的平邮费用
Props
[]
struct
{
Props
[]
struct
{
Content
string
`json:"content"`
Content
string
`json:"content"`
Word
string
`json:"word"`
Word
string
`json:"word"`
}
`json:"props"`
}
`json:"props"`
Prov
string
`json:"prov"`
Prov
string
`json:"prov"`
Receipt
bool
`json:"receipt"`
Receipt
bool
`json:"receipt"`
SoldQuantity
int
`json:"soldQuantity"`
SoldQuantity
int
`json:"soldQuantity"`
//商品的销量
Status
int
`json:"status"`
Status
int
`json:"status"`
//商品的状态 0,1正常,-1:用户删除,-2:用户下架,-3 小二下架,-4 小二删除,-5 从未上架,-9 CC
Title
string
`json:"title"`
Title
string
`json:"title"`
//商品的类目标题
}
`json:"item"`
}
`json:"item"`
Seller
struct
{
Seller
struct
{
//商品的卖家信息
ShopName
string
`json:"shopName"`
ShopName
string
`json:"shopName"`
//店铺名称
SellerId
string
`json:"sellerId"`
SellerId
string
`json:"sellerId"`
}
`json:"seller"`
}
`json:"seller"`
SkuBase
struct
{
SkuBase
struct
{
Props
[]
struct
{
Props
[]
struct
{
Name
string
`json:"name"`
Name
string
`json:"name"`
//sku的属性名称
Pid
string
`json:"pid"`
Pid
string
`json:"pid"`
//sku的属性id
Values
[]
struct
{
Values
[]
struct
{
Image
string
`json:"image"`
Image
string
`json:"image"`
Name
string
`json:"name"`
Name
string
`json:"name"`
//sku的属性内容
Vid
string
`json:"vid"`
Vid
string
`json:"vid"`
//sku的属性内容id
}
`json:"values"`
}
`json:"values"`
}
`json:"props"`
}
`json:"props"`
Skus
[]
struct
{
Skus
[]
struct
{
PropPath
string
`json:"propPath"`
PropPath
string
`json:"propPath"`
//sku的属性路径
SkuId
string
`json:"skuId"`
SkuId
string
`json:"skuId"`
}
`json:"skus"`
}
`json:"skus"`
}
`json:"skuBase"`
}
`json:"skuBase"`
...
@@ -144,11 +144,11 @@ type GoodsDetailRes struct {
...
@@ -144,11 +144,11 @@ type GoodsDetailRes struct {
}
}
type
GoodsItem
struct
{
type
GoodsItem
struct
{
QuantityVague
string
`json:"quantityVague"`
QuantityVague
string
`json:"quantityVague"`
//模糊化库存,实际库存大于200时展示200,小于200时展示实际的值
OriginalPrice
string
`json:"originalPrice"`
OriginalPrice
string
`json:"originalPrice"`
//特价,报名特价版的价格 单位:分
FinalPrice
string
`json:"finalPrice"`
FinalPrice
string
`json:"finalPrice"`
TjbMarketPrice
string
`json:"tjbMarketPrice"`
TjbMarketPrice
string
`json:"tjbMarketPrice"`
//市场价
PriceMoney
string
`json:"priceMoney"`
PriceMoney
string
`json:"priceMoney"`
//单品优惠价,参与活动后得价格
}
}
//Detail 详情
//Detail 详情
...
...
upstream/itao/itao_logistics.go
浏览文件 @
66f06a3f
...
@@ -12,35 +12,37 @@ type logistics struct {
...
@@ -12,35 +12,37 @@ type logistics struct {
var
Logistics
=
logistics
{}
var
Logistics
=
logistics
{}
type
LogisticsTraceRes
struct
{
type
LogisticsTraceRes
struct
{
Result
struct
{
Success
bool
`json:"success"`
Result
[]
struct
{
ErrMsg
string
`json:"errMsg"`
DetailList
[]
struct
{
ErrCode
string
`json:"errCode"`
Action
string
`json:"action"`
Result
[]
struct
{
GmtCreate
string
`json:"gmtCreate"`
CompanyList
[]
struct
{
StanderdDesc
string
`json:"standerdDesc"`
BrandCode
string
`json:"brandCode"`
Status
string
`json:"status"`
CompanyName
string
`json:"companyName"`
Time
string
`json:"time"`
}
`json:"companyList"`
MailNo
string
`json:"mailNo,omitempty"`
DetailList
[]
struct
{
TpName
string
`json:"tpName,omitempty"`
Action
string
`json:"action"`
}
`json:"detailList"`
GmtCreate
string
`json:"gmtCreate"`
GoodsList
[]
interface
{}
`json:"goodsList"`
StanderdDesc
string
`json:"standerdDesc"`
MailNo
string
`json:"mailNo"`
Status
string
`json:"status"`
Receiver
struct
{
Time
string
`json:"time"`
Adr
string
`json:"adr"`
MailNo
string
`json:"mailNo,omitempty"`
CityName
string
`json:"cityName"`
TpName
string
`json:"tpName,omitempty"`
DistrictName
string
`json:"districtName"`
}
`json:"detailList"`
Name
string
`json:"name"`
GoodsList
[]
interface
{}
`json:"goodsList"`
ProvinceName
string
`json:"provinceName"`
MailNo
string
`json:"mailNo"`
Telphone
string
`json:"telphone"`
Receiver
struct
{
}
`json:"receiver"`
Adr
string
`json:"adr"`
Status
struct
{
CityName
string
`json:"cityName"`
StatusCode
string
`json:"statusCode"`
DistrictName
string
`json:"districtName"`
StatusDesc
string
`json:"statusDesc"`
Name
string
`json:"name"`
}
`json:"status"`
ProvinceName
string
`json:"provinceName"`
}
`json:"result"`
Telphone
string
`json:"telphone"`
Success
bool
`json:"success"`
}
`json:"receiver"`
ErrMsg
string
`json:"errMsg"`
Status
struct
{
ErrCode
string
`json:"errCode"`
StatusCode
string
`json:"statusCode"`
StatusDesc
string
`json:"statusDesc"`
}
`json:"status"`
}
`json:"result"`
}
`json:"result"`
}
}
...
...
upstream/itao/itao_refund.go
浏览文件 @
66f06a3f
...
@@ -110,7 +110,7 @@ func (s refund) Create(ctx context.Context, req RefundCreateReq, image ...string
...
@@ -110,7 +110,7 @@ func (s refund) Create(ctx context.Context, req RefundCreateReq, image ...string
//Cancle 取消售后
//Cancle 取消售后
//`bizOrderId` 子订单号
//`bizOrderId` 子订单号
//`disputeId` 售后单号
//`disputeId` 售后单号
func
(
s
refund
)
Canc
le
(
ctx
context
.
Context
,
bizOrderId
,
disputeId
string
)
(
res
*
CommonRes
,
err
error
)
{
func
(
s
refund
)
Canc
el
(
ctx
context
.
Context
,
bizOrderId
,
disputeId
string
)
(
res
*
CommonRes
,
err
error
)
{
method
:=
"tt.refund.refundRevoke"
method
:=
"tt.refund.refundRevoke"
result
,
err
:=
server
.
Post
(
ctx
,
method
,
g
.
Map
{
result
,
err
:=
server
.
Post
(
ctx
,
method
,
g
.
Map
{
...
@@ -153,7 +153,7 @@ type RefundSubmitRes struct {
...
@@ -153,7 +153,7 @@ type RefundSubmitRes struct {
//Submit 提交物流信息
//Submit 提交物流信息
func
(
s
refund
)
Submit
(
ctx
context
.
Context
,
req
RefundSubmitReq
,
image
...
string
)
(
res
*
CommonRes
,
err
error
)
{
func
(
s
refund
)
Submit
(
ctx
context
.
Context
,
req
RefundSubmitReq
,
image
...
string
)
(
res
*
CommonRes
,
err
error
)
{
method
:=
"tt.refund.
refundSubmit
"
method
:=
"tt.refund.
submitLogisticInfo.v1
"
if
len
(
image
)
>
0
{
if
len
(
image
)
>
0
{
for
_
,
item
:=
range
image
{
for
_
,
item
:=
range
image
{
req
.
LeaveMessagePics
=
append
(
req
.
LeaveMessagePics
,
RefundPic
{
MessagePic
:
item
})
req
.
LeaveMessagePics
=
append
(
req
.
LeaveMessagePics
,
RefundPic
{
MessagePic
:
item
})
...
...
upstream/itao/itao_upload.go
浏览文件 @
66f06a3f
...
@@ -33,7 +33,7 @@ func (s upload) Image(ctx context.Context, req UploadImageReq) (res *UploadImage
...
@@ -33,7 +33,7 @@ func (s upload) Image(ctx context.Context, req UploadImageReq) (res *UploadImage
req
.
FileContent
=
"base64"
req
.
FileContent
=
"base64"
}
}
var
request
=
g
.
Map
{}
var
request
=
g
.
Map
{}
request
[
"access_token"
],
err
=
server
.
Get
AccessToken
(
ctx
)
request
[
"access_token"
],
err
=
AccessToken
(
ctx
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
...
...
upstream/schl/base.go
浏览文件 @
66f06a3f
...
@@ -46,10 +46,10 @@ func (c *Config) Post(ctx context.Context, api string, bodyMap g.Map) (result st
...
@@ -46,10 +46,10 @@ func (c *Config) Post(ctx context.Context, api string, bodyMap g.Map) (result st
defer
func
()
{
defer
func
()
{
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
api
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
api
)
if
err
!=
nil
{
if
err
!=
nil
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
"error"
)
.
Async
(
true
)
.
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
pkgName
)
.
Cat
(
"error"
)
.
Infof
(
"参数【%v】错误【%v】响应时间:【%v ms】"
,
gjson
.
New
(
bodyMap
)
.
MustToJsonString
(),
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
Infof
(
"参数【%v】错误【%v】响应时间:【%v ms】"
,
gjson
.
New
(
bodyMap
)
.
MustToJsonString
(),
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
}
else
{
}
else
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
pkgName
)
.
Async
(
true
)
.
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
pkgName
)
.
Infof
(
"参数【%v】响应【%v】响应时间:【%v ms】"
,
gjson
.
New
(
bodyMap
)
.
MustToJsonString
(),
result
,
gtime
.
TimestampMilli
()
-
Start
)
Infof
(
"参数【%v】响应【%v】响应时间:【%v ms】"
,
gjson
.
New
(
bodyMap
)
.
MustToJsonString
(),
result
,
gtime
.
TimestampMilli
()
-
Start
)
}
}
}()
}()
...
...
upstream/tm/tm.go
浏览文件 @
66f06a3f
...
@@ -110,7 +110,7 @@ func post(ctx context.Context, method string, params map[string]string) (str str
...
@@ -110,7 +110,7 @@ func post(ctx context.Context, method string, params map[string]string) (str str
ctx
=
context
.
WithValue
(
ctx
,
"Method"
,
"POST"
)
ctx
=
context
.
WithValue
(
ctx
,
"Method"
,
"POST"
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
apiUrl
+
params
[
"Action"
])
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
apiUrl
+
params
[
"Action"
])
if
err
!=
nil
{
if
err
!=
nil
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Infof
(
"参数【%v】错误【%v】响应时间【%v】"
,
paramStr
,
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
PkgName
)
.
Cat
(
"error"
)
.
Infof
(
"参数【%v】错误【%v】响应时间【%v】"
,
paramStr
,
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
}
else
{
}
else
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
PkgName
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
paramStr
,
str
,
gtime
.
TimestampMilli
()
-
Start
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
PkgName
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
paramStr
,
str
,
gtime
.
TimestampMilli
()
-
Start
)
}
}
...
...
upstream/wpc/wpc.go
浏览文件 @
66f06a3f
...
@@ -95,7 +95,7 @@ func post(ctx context.Context, method string, req interface{}) (res string, err
...
@@ -95,7 +95,7 @@ func post(ctx context.Context, method string, req interface{}) (res string, err
ctx
=
context
.
WithValue
(
ctx
,
"Method"
,
"POST"
)
ctx
=
context
.
WithValue
(
ctx
,
"Method"
,
"POST"
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
method
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
method
)
if
err
!=
nil
{
if
err
!=
nil
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Infof
(
"参数【%v】错误【%v】响应时间【%v】"
,
paramStr
,
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
pkgName
)
.
Cat
(
"error"
)
.
Infof
(
"参数【%v】错误【%v】响应时间【%v】"
,
paramStr
,
err
.
Error
(),
gtime
.
TimestampMilli
()
-
Start
)
}
else
{
}
else
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
pkgName
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
paramStr
,
res
,
gtime
.
TimestampMilli
()
-
Start
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
pkgName
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
paramStr
,
res
,
gtime
.
TimestampMilli
()
-
Start
)
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论