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
0b90376f
authored
Jan 25, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
temp
parent
46efb559
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
cmd/http_server.go
controller/sku_controller.go
service/service_ly.go
cmd/http_server.go
View file @
0b90376f
...
...
@@ -3,7 +3,6 @@ package main
import
(
"flag"
"github.com/gin-gonic/gin"
logger
"github.com/ichunt2019/log"
"github.com/micro/go-micro/v2/web"
"go_sku_server/boot"
"go_sku_server/pkg/config"
...
...
controller/sku_controller.go
View file @
0b90376f
...
...
@@ -13,7 +13,7 @@ import (
"time"
)
const
goods
_slice_c
ount
=
10
//每多少个型号id开启一个协程
const
goods
SliceC
ount
=
10
//每多少个型号id开启一个协程
/*
查询商品详情(自营或者联营)
...
...
@@ -34,7 +34,6 @@ const goods_slice_count = 10 //每多少个型号id开启一个协程
func
CommonController
(
ctx
*
gin
.
Context
)
map
[
string
]
interface
{}
{
common
.
PrintDebugHeader
(
ctx
)
//开启debug调试
zyService
:=
service
.
ZiyingService
{}
//实例化自营查询
lyService
:=
service
.
LyService
{}
//实例化自营查询
var
goodsIdArr
[]
string
...
...
@@ -64,7 +63,7 @@ func CommonController(ctx *gin.Context) map[string]interface{} {
}
if
len
(
goodsId
)
<
19
{
//自营
zyGoodsId
=
append
(
zyGoodsId
,
goodsId
)
if
len
(
zyGoodsId
)
>=
goods
_slice_c
ount
{
if
len
(
zyGoodsId
)
>=
goods
SliceC
ount
{
common
.
PrintDebugHtml
(
ctx
,
"zy增加协程1001:"
)
common
.
PrintDebugHtml
(
ctx
,
zyGoodsId
)
//wg.Add(1) //协程计数一
...
...
@@ -74,7 +73,7 @@ func CommonController(ctx *gin.Context) map[string]interface{} {
}
}
else
{
//联营
lyGoodsId
=
append
(
lyGoodsId
,
goodsId
)
if
len
(
lyGoodsId
)
>=
goods
_slice_c
ount
{
if
len
(
lyGoodsId
)
>=
goods
SliceC
ount
{
common
.
PrintDebugHtml
(
ctx
,
"ly增加协程1002:"
)
common
.
PrintDebugHtml
(
ctx
,
lyGoodsId
)
//wg.Add(1)
...
...
service/service_ly.go
View file @
0b90376f
...
...
@@ -4,6 +4,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/gogf/gf/util/gconv"
"github.com/gomodule/redigo/redis"
logger
"github.com/ichunt2019/log"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
"go_sku_server/model"
...
...
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