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
6b6904ea
Commit
6b6904ea
authored
Sep 02, 2022
by
honghuiliu
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日常提交
parent
64b36e18
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
partol.go
server/api/v1/web/partol.go
+5
-1
patrol.go
server/request/patrol.go
+1
-1
web.go
server/router/web.go
+1
-0
patrolService.go
server/service/web/patrolService.go
+12
-0
No files found.
server/api/v1/web/partol.go
View file @
6b6904ea
...
@@ -27,5 +27,9 @@ func GetPatrolList(c *gin.Context) {
...
@@ -27,5 +27,9 @@ func GetPatrolList(c *gin.Context) {
func
GetPatrolDetail
(
c
*
gin
.
Context
)
{
func
GetPatrolDetail
(
c
*
gin
.
Context
)
{
var
arg
request
.
GetPatrolId
var
arg
request
.
GetPatrolId
_
=
c
.
ShouldBindJSON
(
&
arg
)
_
=
c
.
ShouldBindJSON
(
&
arg
)
//patrolService.GetPatrolDetail(arg)
if
data
,
err
:=
patrolService
.
GetPatrolDetail
(
arg
);
err
!=
nil
{
response
.
FailWithMessage
(
err
.
Error
(),
c
)
}
else
{
response
.
OkWithData
(
data
,
c
)
}
}
}
server/request/patrol.go
View file @
6b6904ea
...
@@ -10,5 +10,5 @@ type PatrolList struct {
...
@@ -10,5 +10,5 @@ type PatrolList struct {
}
}
type
GetPatrolId
struct
{
type
GetPatrolId
struct
{
ID
string
`json:"id"`
ID
int
`json:"id"`
}
}
server/router/web.go
View file @
6b6904ea
...
@@ -21,5 +21,6 @@ func InitWebRouter(router *gin.Engine) {
...
@@ -21,5 +21,6 @@ func InitWebRouter(router *gin.Engine) {
patrol
:=
webRouter
.
Group
(
"patrol"
)
patrol
:=
webRouter
.
Group
(
"patrol"
)
{
{
patrol
.
POST
(
"getPatrolList"
,
web
.
GetPatrolList
)
patrol
.
POST
(
"getPatrolList"
,
web
.
GetPatrolList
)
patrol
.
POST
(
"getPatrolDetail"
,
web
.
GetPatrolDetail
)
}
}
}
}
server/service/web/patrolService.go
View file @
6b6904ea
...
@@ -38,3 +38,15 @@ func (l *PatrolService) GetPatrolList(arg request.PatrolList) ([]admin.QshPatrol
...
@@ -38,3 +38,15 @@ func (l *PatrolService) GetPatrolList(arg request.PatrolList) ([]admin.QshPatrol
}
}
return
patrolList
,
total
,
nil
return
patrolList
,
total
,
nil
}
}
func
(
l
*
PatrolService
)
GetPatrolDetail
(
arg
request
.
GetPatrolId
)
(
admin
.
QshPatrol
,
error
)
{
var
patrolList
admin
.
QshPatrol
db
:=
global
.
GVA_DB
.
Model
(
admin
.
QshPatrol
{})
db
.
Where
(
"id = ?"
,
arg
.
ID
)
err
:=
db
.
First
(
&
patrolList
)
.
Error
if
err
!=
nil
{
return
patrolList
,
err
}
return
patrolList
,
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