Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
search_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
26d8bc65
authored
Jul 06, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
b22eb23a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
28 deletions
pkg/config/redis.go
routes/router.go
service/ziyin_service.go
pkg/config/redis.go
View file @
26d8bc65
...
...
@@ -13,42 +13,17 @@ type RedisDatabase struct {
//多数据库配置
func
BuildRedisConfgs
()
(
RedisDatabaseMap
map
[
string
]
RedisDatabase
)
{
return
map
[
string
]
RedisDatabase
{
"search_r
ead
"
:
{
"search_r"
:
{
Host
:
Get
(
"default_redis_read.host"
)
.
String
(),
Password
:
Get
(
"default_redis_read.password"
)
.
String
(),
MaxIdle
:
Get
(
"default_redis_read.max_idle"
)
.
String
(),
MaxActive
:
Get
(
"default_redis_read.max_active"
)
.
String
(),
},
"search_w
rite
"
:
{
"search_w"
:
{
Host
:
Get
(
"default_redis_write.host"
)
.
String
(),
Password
:
Get
(
"default_redis_write.password"
)
.
String
(),
MaxIdle
:
Get
(
"default_redis_read.max_idle"
)
.
String
(),
MaxActive
:
Get
(
"default_redis_read.max_active"
)
.
String
(),
},
"spu_read"
:
{
Host
:
Get
(
"default_redis_read.host"
)
.
String
(),
Password
:
Get
(
"default_redis_read.password"
)
.
String
(),
MaxIdle
:
Get
(
"default_redis_read.max_idle"
)
.
String
(),
MaxActive
:
Get
(
"default_redis_read.max_active"
)
.
String
(),
},
"spu_write"
:
{
Host
:
Get
(
"default_redis_write.host"
)
.
String
(),
Password
:
Get
(
"default_redis_write.password"
)
.
String
(),
MaxIdle
:
Get
(
"default_redis_read.max_idle"
)
.
String
(),
MaxActive
:
Get
(
"default_redis_read.max_active"
)
.
String
(),
},
"api_read"
:
{
Host
:
Get
(
"api_redis_read.host"
)
.
String
(),
Password
:
Get
(
"api_redis_read.password"
)
.
String
(),
MaxIdle
:
Get
(
"api_redis_read.max_idle"
)
.
String
(),
MaxActive
:
Get
(
"api_redis_read.max_active"
)
.
String
(),
},
"api_write"
:
{
Host
:
Get
(
"api_redis_write.host"
)
.
String
(),
Password
:
Get
(
"api_redis_write.password"
)
.
String
(),
MaxIdle
:
Get
(
"api_redis_write.max_idle"
)
.
String
(),
MaxActive
:
Get
(
"api_redis_write.max_active"
)
.
String
(),
},
}
}
routes/router.go
View file @
26d8bc65
...
...
@@ -14,7 +14,7 @@ func InitRouter() *gin.Engine {
//路由
r
.
POST
(
"/search/bom/autospu"
,
controller
.
AutoSpu
)
r
.
POST
(
"/search/bom/recommend"
,
controller
.
Recommend
)
//
r.POST("search/ZiYing/zyh", controller.Zyh)
r
.
POST
(
"search/ZiYing/zyh"
,
controller
.
Zyh
)
//快手平台相关
//r.GET("/search/quote", controller.QuoteIndex)
...
...
service/ziyin_service.go
View file @
26d8bc65
...
...
@@ -6,6 +6,7 @@ import (
"reflect"
"search_server/model"
"search_server/pkg/config"
"search_server/pkg/gredis"
)
type
ZyServiceImpl
struct
{}
...
...
@@ -59,5 +60,12 @@ func zy(ctx *gin.Context, req *model.ZyhRequest,_type byte,isCheck byte) (rsp *m
fmt
.
Printf
(
"%+v"
,
req
)
fmt
.
Println
(
reflect
.
TypeOf
(
req
.
ClassIdcondition
))
fmt
.
Println
(
req
.
ClassIdcondition
)
redis_s_r
:=
gredis
.
Conn
(
"search_r"
)
defer
func
(){
redis_s_r
.
Close
()
}()
return
nil
}
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