Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qsh-wc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
honghuiliu
qsh-wc
Commits
f1678c23
Commit
f1678c23
authored
Sep 07, 2022
by
honghuiliu
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改redis 前缀 以及bug修复
parent
39150375
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
17 additions
and
4 deletions
+17
-4
login.go
server/api/v1/web/login.go
+2
-1
config-prod.yaml
server/config-prod.yaml
+1
-0
config-test.yaml
server/config-test.yaml
+1
-0
config.yaml
server/config.yaml
+1
-0
mobile_check.go
server/middleware/mobile_check.go
+2
-1
patrol.go
server/request/patrol.go
+1
-0
qsh_partol.go
server/service/admin/qsh_partol.go
+3
-0
patrolService.go
server/service/web/patrolService.go
+4
-1
toiletService.go
server/service/web/toiletService.go
+2
-1
No files found.
server/api/v1/web/login.go
View file @
f1678c23
...
...
@@ -29,7 +29,8 @@ func Login(c *gin.Context) {
u
:=
&
system
.
SysUser
{
Username
:
l
.
Username
,
Password
:
l
.
Password
}
key
:=
ghelp
.
Md5
(
ghelp
.
CreateUnique
())
prefixKey
:=
"qsh_wc:"
+
key
prefix
:=
global
.
GVA_VP
.
GetString
(
"redis.prefix"
)
prefixKey
:=
prefix
+
key
if
user
,
err
:=
userService
.
Login
(
u
);
err
!=
nil
{
global
.
GVA_LOG
.
Error
(
"登陆失败! 用户名不存在或者密码错误!"
,
zap
.
Error
(
err
))
response
.
FailWithMessage
(
"用户名不存在或者密码错误"
,
c
)
...
...
server/config-prod.yaml
View file @
f1678c23
...
...
@@ -118,6 +118,7 @@ qiniu:
secret-key
:
"
"
use-cdn-domains
:
false
redis
:
prefix
:
"
qsh_wc_prod:"
db
:
0
addr
:
"
r-bp1cm5ncyvq2hnul81.redis.rds.aliyuncs.com:6379"
password
:
"
rRk2k3nf9JJi283lk119Jvwz"
...
...
server/config-test.yaml
View file @
f1678c23
...
...
@@ -118,6 +118,7 @@ qiniu:
secret-key
:
"
"
use-cdn-domains
:
false
redis
:
prefix
:
"
qsh_wc:"
db
:
0
addr
:
"
r-bp1cm5ncyvq2hnul81.redis.rds.aliyuncs.com:6379"
password
:
"
rRk2k3nf9JJi283lk119Jvwz"
...
...
server/config.yaml
View file @
f1678c23
...
...
@@ -118,6 +118,7 @@ qiniu:
secret-key
:
"
"
use-cdn-domains
:
false
redis
:
prefix
:
"
qsh_wc:"
db
:
0
addr
:
"
r-bp1cm5ncyvq2hnul81pd.redis.rds.aliyuncs.com:16379"
password
:
"
rRk2k3nf9JJi283lk119Jvwz"
...
...
server/middleware/mobile_check.go
View file @
f1678c23
...
...
@@ -23,7 +23,8 @@ func Token() gin.HandlerFunc {
c
.
Abort
()
return
}
res
:=
global
.
GVA_REDIS
.
Get
(
c
,
"qsh_wc:"
+
token
)
prefix
:=
global
.
GVA_VP
.
GetString
(
"redis.prefix"
)
res
:=
global
.
GVA_REDIS
.
Get
(
c
,
prefix
+
token
)
if
res
.
Err
()
!=
nil
{
response
.
Result
(
1000
,
""
,
"token不存在"
,
c
)
...
...
server/request/patrol.go
View file @
f1678c23
...
...
@@ -7,6 +7,7 @@ type PatrolList struct {
StartTime
string
`json:"start_time"`
EndTime
string
`json:"end_time"`
Type
int
`json:"type"`
ToiletId
int
`json:"toilet_id"`
}
type
GetPatrolId
struct
{
...
...
server/service/admin/qsh_partol.go
View file @
f1678c23
...
...
@@ -60,6 +60,9 @@ func (qshPartolService *QshPartolService) GetQshPartolInfoList(info adminReq.Qsh
if
info
.
Type
!=
0
{
db
=
db
.
Where
(
"type = ?"
,
info
.
Type
)
}
if
info
.
ToiletId
!=
0
{
db
=
db
.
Where
(
"toilet_id = ?"
,
info
.
Toilet
)
}
err
=
db
.
Count
(
&
total
)
.
Error
if
err
!=
nil
{
return
...
...
server/service/web/patrolService.go
View file @
f1678c23
...
...
@@ -28,11 +28,14 @@ func (l *PatrolService) GetPatrolList(arg request.PatrolList) ([]admin.QshPatrol
if
arg
.
Type
!=
0
{
db
.
Where
(
"type = ?"
,
arg
.
Type
)
}
if
arg
.
ToiletId
!=
0
{
db
.
Where
(
"toilet_id = ?"
,
arg
.
ToiletId
)
}
err
:=
db
.
Count
(
&
total
)
.
Error
if
err
!=
nil
{
return
patrolList
,
total
,
err
}
err
=
db
.
Limit
(
limit
)
.
Offset
(
offset
)
.
Preload
(
"Toilet"
)
.
Find
(
&
patrolList
)
.
Error
err
=
db
.
Debug
()
.
Limit
(
limit
)
.
Offset
(
offset
)
.
Preload
(
"Toilet"
)
.
Find
(
&
patrolList
)
.
Error
if
err
!=
nil
{
return
patrolList
,
total
,
err
}
...
...
server/service/web/toiletService.go
View file @
f1678c23
...
...
@@ -26,7 +26,8 @@ func (l *ToiletService) GetToiletList(toilet request.Toilet) ([]admin.QshToilet,
func
(
l
*
ToiletService
)
GetToiletDetail
(
toilet
request
.
GetId
)
(
admin
.
QshToilet
,
error
)
{
var
toiletInfo
admin
.
QshToilet
err
:=
global
.
GVA_DB
.
Model
(
toiletInfo
)
.
First
(
&
toiletInfo
)
.
Error
err
:=
global
.
GVA_DB
.
Model
(
toiletInfo
)
.
Where
(
"id = ?"
,
toilet
.
ID
)
.
First
(
&
toiletInfo
)
.
Error
if
err
!=
nil
{
return
toiletInfo
,
err
}
...
...
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