Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
wang
/
golang-open-platform
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
01371268
authored
Feb 26, 2021
by
wang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
隐藏不必要的函数
parent
3ff83008
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
doc/redis_config_generate.go
open/dao.go
open/validate.go
doc/redis_config_generate.go
View file @
01371268
...
...
@@ -176,8 +176,8 @@ func redisHashSet(key string,values map[string]interface{}) {
b
,
_
=
json
.
Marshal
(
string
(
b
))
hsetStr
:=
"Hset "
+
key
+
" "
+
string
(
hashk
)
+
" "
+
string
(
b
)
fmt
.
Println
(
hsetStr
)
fmt
.
Println
(
"对应计时的min key
\n
flowUse_"
+
hashk
+
"_min"
)
fmt
.
Println
(
"对应计时的day key
\n
flowUse_"
+
hashk
+
"_day"
)
//
fmt.Println("对应计时的min key\nflowUse_"+hashk+"_min")
//
fmt.Println("对应计时的day key\nflowUse_"+hashk+"_day")
}
}
...
...
open/dao.go
View file @
01371268
...
...
@@ -15,7 +15,7 @@ type Dao struct {
//获取白名单列表 openWhiteList
func
(
this
*
Dao
)
getOpenWhiteList
()(
whitestr
string
,
err
error
){
/*
func (this *Dao) getOpenWhiteList()(whitestr string,err error){
redisReadConn := gredis.Conn("search_r")
defer redisReadConn.Close()
whitestr,err=redis.String(redisReadConn.Do("Get","openWhiteList"))
...
...
@@ -36,7 +36,7 @@ func (this *Dao) getBusinessList()(listStr string,err error){
return "",e.NewApiError("business",BUSINESSERR1)
}
return listStr,nil
}
}
*/
//获取商家接口配置 openBusinessInterface
func
(
this
*
Dao
)
GetbusinessInterface
(
token
string
,
interfaceName
string
)
(
Str
string
,
err
error
)
{
...
...
open/validate.go
View file @
01371268
...
...
@@ -3,7 +3,6 @@ package open
import
(
"github.com/gin-gonic/gin"
"github.com/gomodule/redigo/redis"
"github.com/tidwall/gjson"
"golang_open_platform/pkg/common"
"golang_open_platform/pkg/e"
"golang_open_platform/pkg/gredis"
...
...
@@ -50,7 +49,7 @@ func (this *openValidate) ipValidate(ctx *gin.Context,token string) error {
}
//白名单验证
func
(
this
*
openValidate
)
whiteValidate
(
ctx
*
gin
.
Context
)
error
{
/*
func (this *openValidate) whiteValidate(ctx *gin.Context)error {
whiteStr,err:=this.dao.getOpenWhiteList()
if(err!=nil){
...
...
@@ -66,7 +65,7 @@ func (this *openValidate) whiteValidate(ctx *gin.Context)error {
}
common.PrintStdout().Printf(strconv.Itoa(WHILTREDISEERR2)+":Not on the white list ip:"+ctx.ClientIP())
return e.NewApiError("Not on the white list",WHILTREDISEERR2)
}
}
*/
/**
...
...
@@ -80,7 +79,7 @@ func (this *openValidate) exitValidate(token string) error{
boolInt
,
err
:=
redis
.
Int
(
redisCon
.
Do
(
"SISMEMBER"
,
key
,
token
))
if
(
err
!=
nil
&&
err
!=
redis
.
ErrNil
){
common
.
PrintStdout
()
.
Printf
(
"读取
供应商列表出错 出错"
)
common
.
PrintStdout
()
.
Printf
(
"读取
商redis列表出错 :"
+
err
.
Error
()
)
return
e
.
NewApiError
(
"service err"
,
BUSINESSERR1
)
}
if
(
boolInt
!=
1
){
...
...
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