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
import
(
"strings"
"github.com/tidwall/gjson"
)
...
...
@@ -166,6 +168,7 @@ func InitSkuData(sku string) (data LySku) {
data
.
GoodsDetails
=
goodsDetail
goodsImages
:=
gjson
.
Get
(
sku
,
"goods_images"
)
.
String
()
goodsImages
=
strings
.
Replace
(
goodsImages
,
"http://img.ichunt.com"
,
"https://img.ichunt.com"
,
1
)
data
.
GoodsImages
=
goodsImages
canal
:=
gjson
.
Get
(
sku
,
"canal"
)
.
String
()
...
...
service/service_ly.go
View file @
e8253d38
...
...
@@ -5,6 +5,7 @@ import (
"go_sku_server/pkg/gredis"
"go_sku_server/service/sorter"
"sort"
"strings"
"sync"
"github.com/gin-gonic/gin"
...
...
@@ -69,6 +70,7 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
if
pdf
==
""
||
(
php2go
.
Strlen
(
spuLargeImage
)
<
5
)
{
sku
.
Pdf
=
""
}
else
{
pdf
=
strings
.
Replace
(
pdf
,
"http://img.ichunt.com"
,
"https://img.ichunt.com"
,
1
)
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
if
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
=
strings
.
Replace
(
pdf
,
"http://img.ichunt.com"
,
"https://img.ichunt.com"
,
1
)
if
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