Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
go_sku_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e8253d38
authored
Oct 18, 2022
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
商品图片和pdf如果是猎芯自己oss的替换输出为https
parent
a6b76238
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletions
model/ly_sku.go
service/service_ly.go
service/service_zy.go
model/ly_sku.go
View file @
e8253d38
package
model
package
model
import
(
import
(
"strings"
"github.com/tidwall/gjson"
"github.com/tidwall/gjson"
)
)
...
@@ -166,6 +168,7 @@ func InitSkuData(sku string) (data LySku) {
...
@@ -166,6 +168,7 @@ func InitSkuData(sku string) (data LySku) {
data
.
GoodsDetails
=
goodsDetail
data
.
GoodsDetails
=
goodsDetail
goodsImages
:=
gjson
.
Get
(
sku
,
"goods_images"
)
.
String
()
goodsImages
:=
gjson
.
Get
(
sku
,
"goods_images"
)
.
String
()
goodsImages
=
strings
.
Replace
(
goodsImages
,
"http://img.ichunt.com"
,
"https://img.ichunt.com"
,
1
)
data
.
GoodsImages
=
goodsImages
data
.
GoodsImages
=
goodsImages
canal
:=
gjson
.
Get
(
sku
,
"canal"
)
.
String
()
canal
:=
gjson
.
Get
(
sku
,
"canal"
)
.
String
()
...
...
service/service_ly.go
View file @
e8253d38
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"go_sku_server/pkg/gredis"
"go_sku_server/pkg/gredis"
"go_sku_server/service/sorter"
"go_sku_server/service/sorter"
"sort"
"sort"
"strings"
"sync"
"sync"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
...
@@ -69,6 +70,7 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
...
@@ -69,6 +70,7 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
if
pdf
==
""
||
(
php2go
.
Strlen
(
spuLargeImage
)
<
5
)
{
if
pdf
==
""
||
(
php2go
.
Strlen
(
spuLargeImage
)
<
5
)
{
sku
.
Pdf
=
""
sku
.
Pdf
=
""
}
else
{
}
else
{
pdf
=
strings
.
Replace
(
pdf
,
"http://img.ichunt.com"
,
"https://img.ichunt.com"
,
1
)
sku
.
Pdf
=
pdf
sku
.
Pdf
=
pdf
}
}
...
...
service/service_zy.go
View file @
e8253d38
...
@@ -214,9 +214,12 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context, goodsIds []string, ch c
...
@@ -214,9 +214,12 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context, goodsIds []string, ch c
if
img
!=
""
{
if
img
!=
""
{
goodsImages
,
_
=
gredis
.
String
(
redisConn
.
Do
(
"HGET"
,
"Self_SelfGoodsSource"
,
img
))
goodsImages
,
_
=
gredis
.
String
(
redisConn
.
Do
(
"HGET"
,
"Self_SelfGoodsSource"
,
img
))
}
}
A
.
Set
(
"goods_images"
,
gjson
.
Get
(
goodsImages
,
"url"
)
.
String
())
image
:=
gjson
.
Get
(
goodsImages
,
"url"
)
.
String
()
image
=
strings
.
Replace
(
image
,
"http://img.ichunt.com"
,
"https://img.ichunt.com"
,
1
)
A
.
Set
(
"goods_images"
,
image
)
pdf
:=
gjson
.
Get
(
info
,
"pdf"
)
.
String
()
pdf
:=
gjson
.
Get
(
info
,
"pdf"
)
.
String
()
pdf
=
strings
.
Replace
(
pdf
,
"http://img.ichunt.com"
,
"https://img.ichunt.com"
,
1
)
if
pdf
!=
""
{
if
pdf
!=
""
{
pdf
,
_
=
gredis
.
String
(
redisConn
.
Do
(
"HGET"
,
"Self_SelfGoodsSource"
,
pdf
))
pdf
,
_
=
gredis
.
String
(
redisConn
.
Do
(
"HGET"
,
"Self_SelfGoodsSource"
,
pdf
))
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment