Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nbya
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
haoyanbin
nbya
Commits
3dfe5710
Commit
3dfe5710
authored
Jan 15, 2022
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
89cd0fa7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
49 additions
and
33 deletions
+49
-33
org_league.go
app/operate/service/dto/org_league.go
+34
-33
org_team.go
app/operate/service/dto/org_team.go
+1
-0
org_club.go
app/operate/service/org_club.go
+1
-0
org_club_player.go
app/operate/service/org_club_player.go
+3
-0
org_club_team.go
app/operate/service/org_club_team.go
+1
-0
org_match.go
app/operate/service/org_match.go
+2
-0
org_team.go
app/operate/service/org_team.go
+1
-0
search.go
common/dto/search.go
+6
-0
No files found.
app/operate/service/dto/org_league.go
View file @
3dfe5710
...
@@ -8,19 +8,19 @@ import (
...
@@ -8,19 +8,19 @@ import (
)
)
type
OrgLeagueGetPageReq
struct
{
type
OrgLeagueGetPageReq
struct
{
dto
.
Pagination
`search:"-"`
dto
.
Pagination
`search:"-"`
OrgLeagueOrder
OrgLeagueOrder
}
}
type
OrgLeagueOrder
struct
{
Id
int
`form:"idOrder" search:"type:order;column:id;table:org_league"`
type
OrgLeagueOrder
struct
{
LeagueName
string
`form:"leagueNameOrder" search:"type:order;column:league_name
;table:org_league"`
Id
int
`form:"idOrder" search:"type:order;column:id
;table:org_league"`
Status
string
`form:"statusOrder" search:"type:order;column:status
;table:org_league"`
LeagueName
string
`form:"leagueNameOrder" search:"type:order;column:league_name
;table:org_league"`
CreateBy
string
`form:"createByOrder" search:"type:order;column:create_by
;table:org_league"`
Status
string
`form:"statusOrder" search:"type:order;column:status
;table:org_league"`
UpdateBy
string
`form:"updateByOrder" search:"type:order;column:upd
ate_by;table:org_league"`
CreateBy
string
`form:"createByOrder" search:"type:order;column:cre
ate_by;table:org_league"`
CreatedAt
time
.
Time
`form:"createdAtOrder" search:"type:order;column:created_at
;table:org_league"`
UpdateBy
string
`form:"updateByOrder" search:"type:order;column:update_by
;table:org_league"`
UpdatedAt
time
.
Time
`form:"updatedAtOrder" search:"type:order;column:upd
ated_at;table:org_league"`
CreatedAt
time
.
Time
`form:"createdAtOrder" search:"type:order;column:cre
ated_at;table:org_league"`
DeletedAt
time
.
Time
`form:"deletedAtOrder" search:"type:order;column:dele
ted_at;table:org_league"`
UpdatedAt
time
.
Time
`form:"updatedAtOrder" search:"type:order;column:upda
ted_at;table:org_league"`
DeletedAt
time
.
Time
`form:"deletedAtOrder" search:"type:order;column:deleted_at;table:org_league"`
}
}
func
(
m
*
OrgLeagueGetPageReq
)
GetNeedSearch
()
interface
{}
{
func
(
m
*
OrgLeagueGetPageReq
)
GetNeedSearch
()
interface
{}
{
...
@@ -28,18 +28,18 @@ func (m *OrgLeagueGetPageReq) GetNeedSearch() interface{} {
...
@@ -28,18 +28,18 @@ func (m *OrgLeagueGetPageReq) GetNeedSearch() interface{} {
}
}
type
OrgLeagueInsertReq
struct
{
type
OrgLeagueInsertReq
struct
{
Id
int
`json:"-" comment:""`
//
Id
int
`json:"-" comment:""`
//
LeagueName
string
`json:"leagueName" comment:"联赛级别"`
LeagueName
string
`json:"leagueName" comment:"联赛级别"`
Status
string
`json:"status" comment:"联赛开启状态 1 是 0 否"`
Status
string
`json:"status" comment:"联赛开启状态 1 是 0 否"`
common
.
ControlBy
common
.
ControlBy
}
}
func
(
s
*
OrgLeagueInsertReq
)
Generate
(
model
*
models
.
OrgLeague
)
{
func
(
s
*
OrgLeagueInsertReq
)
Generate
(
model
*
models
.
OrgLeague
)
{
if
s
.
Id
==
0
{
if
s
.
Id
==
0
{
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
}
}
model
.
LeagueName
=
s
.
LeagueName
model
.
LeagueName
=
s
.
LeagueName
model
.
Status
=
s
.
Status
model
.
Status
=
s
.
Status
}
}
func
(
s
*
OrgLeagueInsertReq
)
GetId
()
interface
{}
{
func
(
s
*
OrgLeagueInsertReq
)
GetId
()
interface
{}
{
...
@@ -47,18 +47,18 @@ func (s *OrgLeagueInsertReq) GetId() interface{} {
...
@@ -47,18 +47,18 @@ func (s *OrgLeagueInsertReq) GetId() interface{} {
}
}
type
OrgLeagueUpdateReq
struct
{
type
OrgLeagueUpdateReq
struct
{
Id
int
`uri:"id" comment:""`
//
Id
int
`uri:"id" comment:""`
//
LeagueName
string
`json:"leagueName" comment:"联赛级别"`
LeagueName
string
`json:"leagueName" comment:"联赛级别"`
Status
string
`json:"status" comment:"联赛开启状态 1 是 0 否"`
Status
string
`json:"status" comment:"联赛开启状态 1 是 0 否"`
common
.
ControlBy
common
.
ControlBy
}
}
func
(
s
*
OrgLeagueUpdateReq
)
Generate
(
model
*
models
.
OrgLeague
)
{
func
(
s
*
OrgLeagueUpdateReq
)
Generate
(
model
*
models
.
OrgLeague
)
{
if
s
.
Id
==
0
{
if
s
.
Id
==
0
{
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
}
}
model
.
LeagueName
=
s
.
LeagueName
model
.
LeagueName
=
s
.
LeagueName
model
.
Status
=
s
.
Status
model
.
Status
=
s
.
Status
}
}
func
(
s
*
OrgLeagueUpdateReq
)
GetId
()
interface
{}
{
func
(
s
*
OrgLeagueUpdateReq
)
GetId
()
interface
{}
{
...
@@ -67,8 +67,9 @@ func (s *OrgLeagueUpdateReq) GetId() interface{} {
...
@@ -67,8 +67,9 @@ func (s *OrgLeagueUpdateReq) GetId() interface{} {
// OrgLeagueGetReq 功能获取请求参数
// OrgLeagueGetReq 功能获取请求参数
type
OrgLeagueGetReq
struct
{
type
OrgLeagueGetReq
struct
{
Id
int
`uri:"id"`
Id
int
`uri:"id"`
}
}
func
(
s
*
OrgLeagueGetReq
)
GetId
()
interface
{}
{
func
(
s
*
OrgLeagueGetReq
)
GetId
()
interface
{}
{
return
s
.
Id
return
s
.
Id
}
}
...
@@ -80,4 +81,4 @@ type OrgLeagueDeleteReq struct {
...
@@ -80,4 +81,4 @@ type OrgLeagueDeleteReq struct {
func
(
s
*
OrgLeagueDeleteReq
)
GetId
()
interface
{}
{
func
(
s
*
OrgLeagueDeleteReq
)
GetId
()
interface
{}
{
return
s
.
Ids
return
s
.
Ids
}
}
\ No newline at end of file
app/operate/service/dto/org_team.go
View file @
3dfe5710
...
@@ -12,6 +12,7 @@ type OrgTeamGetPageReq struct {
...
@@ -12,6 +12,7 @@ type OrgTeamGetPageReq struct {
TeamName
string
`form:"teamName" json:"teamName" search:"type:contains;column:team_name;table:ot" comment:"球队名称"`
//球队名称
TeamName
string
`form:"teamName" json:"teamName" search:"type:contains;column:team_name;table:ot" comment:"球队名称"`
//球队名称
CreateStartTime
string
`form:"createStartTime" search:"type:gte;column:created_at;table:ot" comment:"开始时间"`
//开始时间
CreateStartTime
string
`form:"createStartTime" search:"type:gte;column:created_at;table:ot" comment:"开始时间"`
//开始时间
CreateEndTime
string
`form:"createEndTime" search:"type:lte;column:created_at;table:ot" comment:"结束时间"`
//结束时间
CreateEndTime
string
`form:"createEndTime" search:"type:lte;column:created_at;table:ot" comment:"结束时间"`
//结束时间
OrgTeamOrder
}
}
type
OrgTeamGetPageReply
struct
{
type
OrgTeamGetPageReply
struct
{
...
...
app/operate/service/org_club.go
View file @
3dfe5710
...
@@ -27,6 +27,7 @@ func (e *OrgClub) GetPage(c *dto.OrgClubGetPageReq, p *actions.DataPermission, l
...
@@ -27,6 +27,7 @@ func (e *OrgClub) GetPage(c *dto.OrgClubGetPageReq, p *actions.DataPermission, l
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
actions
.
Permission
(
data
.
TableName
(),
p
),
actions
.
Permission
(
data
.
TableName
(),
p
),
cDto
.
PassDel
(
"org_club"
),
)
.
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Count
(
count
)
.
Error
Count
(
count
)
.
Error
...
...
app/operate/service/org_club_player.go
View file @
3dfe5710
...
@@ -32,6 +32,7 @@ func (e *OrgClubPlayer) GetPage(c *dto.OrgClubPlayerGetPageReq, p *actions.DataP
...
@@ -32,6 +32,7 @@ func (e *OrgClubPlayer) GetPage(c *dto.OrgClubPlayerGetPageReq, p *actions.DataP
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
actions
.
Permission
(
"omtp"
,
p
),
actions
.
Permission
(
"omtp"
,
p
),
cDto
.
PassDel
(
"omtp"
),
)
.
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Count
(
count
)
.
Error
Count
(
count
)
.
Error
...
@@ -57,6 +58,7 @@ func (e *OrgClubPlayer) GetMatchInfo(id string, p *actions.DataPermission, data
...
@@ -57,6 +58,7 @@ func (e *OrgClubPlayer) GetMatchInfo(id string, p *actions.DataPermission, data
Joins
(
"left join org_season as os on os.id = om.season_id"
)
.
Joins
(
"left join org_season as os on os.id = om.season_id"
)
.
Scopes
(
Scopes
(
actions
.
Permission
(
"omtp"
,
p
),
actions
.
Permission
(
"omtp"
,
p
),
cDto
.
PassDel
(
"omtp"
),
)
.
)
.
First
(
data
,
id
)
.
Error
First
(
data
,
id
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -79,6 +81,7 @@ func (e *OrgClubPlayer) GetRoundsScoring(playerId string, rounds string, teamPla
...
@@ -79,6 +81,7 @@ func (e *OrgClubPlayer) GetRoundsScoring(playerId string, rounds string, teamPla
cDto
.
SetWhere
(
"omtp"
,
"player_id"
,
playerId
),
cDto
.
SetWhere
(
"omtp"
,
"player_id"
,
playerId
),
cDto
.
SetWhere
(
"omtp"
,
"rounds"
,
rounds
),
cDto
.
SetWhere
(
"omtp"
,
"rounds"
,
rounds
),
cDto
.
SetWhere
(
"omtp"
,
"id"
,
teamPlayerId
),
cDto
.
SetWhere
(
"omtp"
,
"id"
,
teamPlayerId
),
//cDto.PassDel("omtp"),
)
.
)
.
Find
(
data
)
.
Error
Find
(
data
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
...
...
app/operate/service/org_club_team.go
View file @
3dfe5710
...
@@ -35,6 +35,7 @@ func (e *OrgClubTeam) GetPage(c *dto.OrgClubTeamGetPageReq, p *actions.DataPermi
...
@@ -35,6 +35,7 @@ func (e *OrgClubTeam) GetPage(c *dto.OrgClubTeamGetPageReq, p *actions.DataPermi
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
actions
.
Permission
(
data
.
TableName
(),
p
),
actions
.
Permission
(
data
.
TableName
(),
p
),
cDto
.
PassDel
(
"ompt"
),
)
.
)
.
Group
(
"omtp.team_id"
)
.
Group
(
"omtp.team_id"
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
...
...
app/operate/service/org_match.go
View file @
3dfe5710
...
@@ -34,6 +34,7 @@ func (e *OrgMatch) GetPage(c *dto.OrgMatchGetPageReq, p *actions.DataPermission,
...
@@ -34,6 +34,7 @@ func (e *OrgMatch) GetPage(c *dto.OrgMatchGetPageReq, p *actions.DataPermission,
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
actions
.
Permission
(
data
.
TableName
(),
p
),
actions
.
Permission
(
data
.
TableName
(),
p
),
cDto
.
PassDel
(
"om"
),
)
.
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Count
(
count
)
.
Error
Count
(
count
)
.
Error
...
@@ -61,6 +62,7 @@ func (e *OrgMatch) GetPageForTeam(c *dto.OrgMatchGetPageReq, p *actions.DataPerm
...
@@ -61,6 +62,7 @@ func (e *OrgMatch) GetPageForTeam(c *dto.OrgMatchGetPageReq, p *actions.DataPerm
Scopes
(
Scopes
(
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
cDto
.
PassDel
(
"om"
),
actions
.
Permission
(
data
.
TableName
(),
p
),
actions
.
Permission
(
data
.
TableName
(),
p
),
)
.
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
...
...
app/operate/service/org_team.go
View file @
3dfe5710
...
@@ -28,6 +28,7 @@ func (e *OrgTeam) GetPage(c *dto.OrgTeamGetPageReq, p *actions.DataPermission, l
...
@@ -28,6 +28,7 @@ func (e *OrgTeam) GetPage(c *dto.OrgTeamGetPageReq, p *actions.DataPermission, l
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
actions
.
Permission
(
data
.
TableName
(),
p
),
actions
.
Permission
(
data
.
TableName
(),
p
),
cDto
.
PassDel
(
"ot"
),
)
.
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Count
(
count
)
.
Error
Count
(
count
)
.
Error
...
...
common/dto/search.go
View file @
3dfe5710
...
@@ -82,3 +82,9 @@ func Paginate(pageSize, pageIndex int) func(db *gorm.DB) *gorm.DB {
...
@@ -82,3 +82,9 @@ func Paginate(pageSize, pageIndex int) func(db *gorm.DB) *gorm.DB {
return
db
.
Offset
(
offset
)
.
Limit
(
pageSize
)
return
db
.
Offset
(
offset
)
.
Limit
(
pageSize
)
}
}
}
}
func
PassDel
(
tableName
string
)
func
(
db
*
gorm
.
DB
)
*
gorm
.
DB
{
return
func
(
db
*
gorm
.
DB
)
*
gorm
.
DB
{
return
db
.
Where
(
tableName
+
".deleted_at is null"
)
}
}
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