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
f4300b15
Commit
f4300b15
authored
Jan 13, 2022
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
fda74e92
Changes
33
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
2569 additions
and
628 deletions
+2569
-628
sys_user.go
app/admin/models/sys_user.go
+19
-18
sys_user.go
app/admin/service/dto/sys_user.go
+29
-26
org_club.go
app/operate/apis/org_club.go
+144
-59
org_club_player.go
app/operate/apis/org_club_player.go
+63
-33
org_club_team.go
app/operate/apis/org_club_team.go
+169
-32
org_team.go
app/operate/apis/org_team.go
+76
-60
org_team_player.go
app/operate/apis/org_team_player.go
+61
-31
org_team_team.go
app/operate/apis/org_team_team.go
+17
-17
org_team_user.go
app/operate/apis/org_team_user.go
+60
-60
org_club.go
app/operate/models/org_club.go
+13
-12
org_player.go
app/operate/models/org_player.go
+0
-1
org_club_player.go
app/operate/router/org_club_player.go
+3
-3
org_club_team.go
app/operate/router/org_club_team.go
+4
-3
org_team_player.go
app/operate/router/org_team_player.go
+3
-3
org_team_team.go
app/operate/router/org_team_team.go
+3
-3
org_club.go
app/operate/service/dto/org_club.go
+46
-52
org_club_player.go
app/operate/service/dto/org_club_player.go
+53
-0
org_club_team.go
app/operate/service/dto/org_club_team.go
+64
-0
org_club_user.go
app/operate/service/dto/org_club_user.go
+34
-33
org_team.go
app/operate/service/dto/org_team.go
+40
-33
org_team_player.go
app/operate/service/dto/org_team_player.go
+53
-0
org_team_team.go
app/operate/service/dto/org_team_team.go
+64
-0
org_team_user.go
app/operate/service/dto/org_team_user.go
+70
-59
org_club.go
app/operate/service/org_club.go
+26
-26
org_club_player.go
app/operate/service/org_club_player.go
+315
-0
org_club_team.go
app/operate/service/org_club_team.go
+356
-0
org_club_user.go
app/operate/service/org_club_user.go
+55
-27
org_match_evaluate.go
app/operate/service/org_match_evaluate.go
+4
-4
org_team_player.go
app/operate/service/org_team_player.go
+315
-0
org_team_team.go
app/operate/service/org_team_team.go
+356
-0
org_team_user.go
app/operate/service/org_team_user.go
+41
-33
match.go
common/dto/match.go
+1
-0
common.go
common/utils/common.go
+12
-0
No files found.
app/admin/models/sys_user.go
View file @
f4300b15
...
@@ -11,6 +11,7 @@ type SysUser struct {
...
@@ -11,6 +11,7 @@ type SysUser struct {
Username
string
`json:"username" gorm:"size:64;comment:用户名"`
Username
string
`json:"username" gorm:"size:64;comment:用户名"`
Password
string
`json:"-" gorm:"size:128;comment:密码"`
Password
string
`json:"-" gorm:"size:128;comment:密码"`
NickName
string
`json:"nickName" gorm:"size:128;comment:昵称"`
NickName
string
`json:"nickName" gorm:"size:128;comment:昵称"`
NickNameEn
string
`json:"nickNameEn" gorm:"size:128;comment:昵称"`
Phone
string
`json:"phone" gorm:"size:11;comment:手机号"`
Phone
string
`json:"phone" gorm:"size:11;comment:手机号"`
RoleId
int
`json:"roleId" gorm:"size:20;comment:角色ID"`
RoleId
int
`json:"roleId" gorm:"size:20;comment:角色ID"`
Salt
string
`json:"-" gorm:"size:255;comment:加盐"`
Salt
string
`json:"-" gorm:"size:255;comment:加盐"`
...
...
app/admin/service/dto/sys_user.go
View file @
f4300b15
...
@@ -93,6 +93,7 @@ type SysUserInsertReq struct {
...
@@ -93,6 +93,7 @@ type SysUserInsertReq struct {
Username
string
`json:"username" comment:"用户名" vd:"len($)>0"`
Username
string
`json:"username" comment:"用户名" vd:"len($)>0"`
Password
string
`json:"password" comment:"密码"`
Password
string
`json:"password" comment:"密码"`
NickName
string
`json:"nickName" comment:"昵称" vd:"len($)>0"`
NickName
string
`json:"nickName" comment:"昵称" vd:"len($)>0"`
NickNameEn
string
`json:"nickNameEn" comment:"昵称" vd:"len($)>0"`
Phone
string
`json:"phone" comment:"手机号" vd:"len($)>0"`
Phone
string
`json:"phone" comment:"手机号" vd:"len($)>0"`
RoleId
int
`json:"roleId" comment:"角色ID"`
RoleId
int
`json:"roleId" comment:"角色ID"`
Avatar
string
`json:"avatar" comment:"头像"`
Avatar
string
`json:"avatar" comment:"头像"`
...
@@ -131,6 +132,7 @@ type SysUserUpdateReq struct {
...
@@ -131,6 +132,7 @@ type SysUserUpdateReq struct {
UserId
int
`json:"userId" comment:"用户ID"`
// 用户ID
UserId
int
`json:"userId" comment:"用户ID"`
// 用户ID
Username
string
`json:"username" comment:"用户名" vd:"len($)>0"`
Username
string
`json:"username" comment:"用户名" vd:"len($)>0"`
NickName
string
`json:"nickName" comment:"昵称" vd:"len($)>0"`
NickName
string
`json:"nickName" comment:"昵称" vd:"len($)>0"`
NickNameEn
string
`json:"nickNameEn" comment:"昵称" vd:"len($)>0"`
Phone
string
`json:"phone" comment:"手机号" vd:"len($)>0"`
Phone
string
`json:"phone" comment:"手机号" vd:"len($)>0"`
RoleId
int
`json:"roleId" comment:"角色ID"`
RoleId
int
`json:"roleId" comment:"角色ID"`
Avatar
string
`json:"avatar" comment:"头像"`
Avatar
string
`json:"avatar" comment:"头像"`
...
@@ -149,6 +151,7 @@ func (s *SysUserUpdateReq) Generate(model *models.SysUser) {
...
@@ -149,6 +151,7 @@ func (s *SysUserUpdateReq) Generate(model *models.SysUser) {
}
}
model
.
Username
=
s
.
Username
model
.
Username
=
s
.
Username
model
.
NickName
=
s
.
NickName
model
.
NickName
=
s
.
NickName
model
.
NickNameEn
=
s
.
NickNameEn
model
.
Phone
=
s
.
Phone
model
.
Phone
=
s
.
Phone
model
.
RoleId
=
s
.
RoleId
model
.
RoleId
=
s
.
RoleId
model
.
Avatar
=
s
.
Avatar
model
.
Avatar
=
s
.
Avatar
...
...
app/operate/apis/org_club.go
View file @
f4300b15
...
@@ -2,12 +2,15 @@ package apis
...
@@ -2,12 +2,15 @@ package apis
import
(
import
(
"fmt"
"fmt"
"strconv"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/sdk/api"
"github.com/go-admin-team/go-admin-core/sdk/api"
"github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth/user"
"github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth/user"
_
"github.com/go-admin-team/go-admin-core/sdk/pkg/response"
_
"github.com/go-admin-team/go-admin-core/sdk/pkg/response"
sService
"go-admin/app/admin/service"
sDto
"go-admin/app/admin/service/dto"
"go-admin/app/operate/models"
"go-admin/app/operate/models"
"go-admin/app/operate/service"
"go-admin/app/operate/service"
"go-admin/app/operate/service/dto"
"go-admin/app/operate/service/dto"
...
@@ -84,7 +87,7 @@ func (e OrgClub) Get(c *gin.Context) {
...
@@ -84,7 +87,7 @@ func (e OrgClub) Get(c *gin.Context) {
return
return
}
}
e
.
OK
(
object
,
"查询成功"
)
e
.
OK
(
object
,
"查询成功"
)
}
}
// Insert <俱乐部>创建俱乐部
// Insert <俱乐部>创建俱乐部
...
@@ -119,6 +122,56 @@ func (e OrgClub) Insert(c *gin.Context) {
...
@@ -119,6 +122,56 @@ func (e OrgClub) Insert(c *gin.Context) {
return
return
}
}
sSysUser
:=
sService
.
SysUser
{}
reqSysUser
:=
sDto
.
SysUserInsertReq
{}
reqSysUser
.
Username
=
req
.
ClubUserName
reqSysUser
.
Password
=
"123456"
reqSysUser
.
NickName
=
req
.
ClubContacts
reqSysUser
.
NickNameEn
=
req
.
ClubContactsEn
reqSysUser
.
Phone
=
req
.
ClubMobile
reqSysUser
.
RoleId
=
1
reqSysUser
.
Avatar
=
""
reqSysUser
.
Sex
=
"0"
reqSysUser
.
Email
=
""
reqSysUser
.
DeptId
=
1
reqSysUser
.
PostId
=
1
reqSysUser
.
Remark
=
"俱乐部"
reqSysUser
.
Status
=
"2"
// 设置创建人
reqSysUser
.
SetCreateBy
(
user
.
GetUserId
(
c
))
err
=
sSysUser
.
Insert
(
&
reqSysUser
)
if
err
!=
nil
{
e
.
Logger
.
Error
(
err
)
e
.
Error
(
500
,
err
,
err
.
Error
())
return
}
//关联表添加
reqClubUser
:=
dto
.
OrgClubUserInsertReq
{}
sClubUser
:=
service
.
OrgClubUser
{}
errClubUser
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
Bind
(
&
req
)
.
MakeService
(
&
s
.
Service
)
.
Errors
if
errClubUser
!=
nil
{
e
.
Logger
.
Error
(
err
)
e
.
Error
(
500
,
err
,
err
.
Error
())
return
}
reqClubUser
.
UserId
=
strconv
.
Itoa
(
reqSysUser
.
GetId
()
.
(
int
))
reqClubUser
.
ClubId
=
strconv
.
Itoa
(
req
.
GetId
()
.
(
int
))
// 设置创建人
reqClubUser
.
SetCreateBy
(
user
.
GetUserId
(
c
))
err
=
sClubUser
.
Insert
(
&
reqClubUser
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"创建俱乐部 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
e
.
OK
(
req
.
GetId
(),
"创建成功"
)
e
.
OK
(
req
.
GetId
(),
"创建成功"
)
}
}
...
@@ -153,7 +206,24 @@ func (e OrgClub) Update(c *gin.Context) {
...
@@ -153,7 +206,24 @@ func (e OrgClub) Update(c *gin.Context) {
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"修改俱乐部 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"修改俱乐部 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
e
.
OK
(
req
.
GetId
(),
"修改成功"
)
sSysUser
:=
sService
.
SysUser
{}
reqSysUser
:=
sDto
.
SysUserUpdateReq
{}
reqSysUser
.
Username
=
req
.
ClubUserName
reqSysUser
.
NickName
=
req
.
ClubContacts
reqSysUser
.
NickNameEn
=
req
.
ClubContactsEn
reqSysUser
.
Phone
=
req
.
ClubMobile
// 设置创建人
reqSysUser
.
SetCreateBy
(
user
.
GetUserId
(
c
))
err
=
sSysUser
.
Update
(
&
reqSysUser
,
p
)
if
err
!=
nil
{
e
.
Logger
.
Error
(
err
)
e
.
Error
(
500
,
err
,
err
.
Error
())
return
}
e
.
OK
(
req
.
GetId
(),
"修改成功"
)
}
}
// Delete <俱乐部>删除俱乐部
// Delete <俱乐部>删除俱乐部
...
@@ -186,5 +256,20 @@ func (e OrgClub) Delete(c *gin.Context) {
...
@@ -186,5 +256,20 @@ func (e OrgClub) Delete(c *gin.Context) {
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"删除俱乐部失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"删除俱乐部失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
e
.
OK
(
req
.
GetId
(),
"删除成功"
)
sOrgClubUser
:=
service
.
OrgClubUser
{}
_
,
userId
:=
sOrgClubUser
.
GetUserId
(
req
.
GetId
()
.
(
int
))
sSysUser
:=
sService
.
SysUser
{}
reqSysUser
:=
sDto
.
SysUserById
{}
reqSysUser
.
Id
,
_
=
strconv
.
Atoi
(
userId
)
// 设置编辑人
reqSysUser
.
SetUpdateBy
(
user
.
GetUserId
(
c
))
err
=
sSysUser
.
Remove
(
&
reqSysUser
,
p
)
if
err
!=
nil
{
e
.
Logger
.
Error
(
err
)
return
}
e
.
OK
(
req
.
GetId
(),
"删除成功"
)
}
}
app/operate/apis/org_club_player.go
View file @
f4300b15
...
@@ -2,12 +2,13 @@ package apis
...
@@ -2,12 +2,13 @@ package apis
import
(
import
(
"fmt"
"fmt"
cDto
"go-admin/common/dto"
"strconv"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/sdk/api"
"github.com/go-admin-team/go-admin-core/sdk/api"
_
"github.com/go-admin-team/go-admin-core/sdk/pkg/response"
_
"github.com/go-admin-team/go-admin-core/sdk/pkg/response"
"go-admin/app/operate/models"
"go-admin/app/operate/service"
"go-admin/app/operate/service"
"go-admin/app/operate/service/dto"
"go-admin/app/operate/service/dto"
"go-admin/common/actions"
"go-admin/common/actions"
...
@@ -27,8 +28,8 @@ type OrgClubPlayer struct {
...
@@ -27,8 +28,8 @@ type OrgClubPlayer struct {
// @Router /api/v1/org-player [get]
// @Router /api/v1/org-player [get]
// @Security Bearer
// @Security Bearer
func
(
e
OrgClubPlayer
)
GetPage
(
c
*
gin
.
Context
)
{
func
(
e
OrgClubPlayer
)
GetPage
(
c
*
gin
.
Context
)
{
req
:=
dto
.
Org
PlayerGetPageReq
{}
req
:=
dto
.
OrgClub
PlayerGetPageReq
{}
s
:=
service
.
Org
Player
{}
s
:=
service
.
OrgClub
Player
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
Bind
(
&
req
)
.
...
@@ -41,12 +42,12 @@ func (e OrgClubPlayer) GetPage(c *gin.Context) {
...
@@ -41,12 +42,12 @@ func (e OrgClubPlayer) GetPage(c *gin.Context) {
}
}
p
:=
actions
.
GetPermissionFromContext
(
c
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
list
:=
make
([]
models
.
OrgPlayer
,
0
)
list
:=
make
([]
dto
.
OrgClubPlayerGetPageReply
,
0
)
var
count
int64
var
count
int64
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
if
err
!=
nil
{
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取球
员
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取球
队
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
...
@@ -60,11 +61,11 @@ func (e OrgClubPlayer) GetPage(c *gin.Context) {
...
@@ -60,11 +61,11 @@ func (e OrgClubPlayer) GetPage(c *gin.Context) {
// @Param pageSize query int false "页条数"
// @Param pageSize query int false "页条数"
// @Param pageIndex query int false "页码"
// @Param pageIndex query int false "页码"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /api/v1/org-player/get-match [get]
// @Router /api/v1/org-
club-
player/get-match [get]
// @Security Bearer
// @Security Bearer
func
(
e
OrgClubPlayer
)
GetPageMatch
(
c
*
gin
.
Context
)
{
func
(
e
OrgClubPlayer
)
GetPageMatch
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgPlayerGetPage
Req
{}
req
:=
dto
.
GetPageMatchClubPlayer
Req
{}
s
:=
service
.
OrgPlayer
{}
s
:=
service
.
Org
Club
Player
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
Bind
(
&
req
)
.
...
@@ -77,16 +78,33 @@ func (e OrgClubPlayer) GetPageMatch(c *gin.Context) {
...
@@ -77,16 +78,33 @@ func (e OrgClubPlayer) GetPageMatch(c *gin.Context) {
}
}
p
:=
actions
.
GetPermissionFromContext
(
c
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
list
:=
make
([]
models
.
OrgPlayer
,
0
)
reply
:=
new
(
dto
.
GetPageMatchReply
)
var
count
int64
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
replyGetMatchInfo
:=
new
(
cDto
.
PageMatchInfo
)
err
=
s
.
GetMatchInfo
(
req
.
Id
,
p
,
replyGetMatchInfo
)
if
err
!=
nil
{
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取
球员
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取
比赛球员信息
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
reply
.
MatchInfo
=
*
replyGetMatchInfo
e
.
PageOK
(
list
,
int
(
count
),
req
.
GetPageIndex
(),
req
.
GetPageSize
(),
"查询成功"
)
replyGetRoundsScoring
:=
make
([]
cDto
.
RoundsScoring
,
0
)
err
=
s
.
GetRoundsScoring
(
replyGetMatchInfo
.
PlayerId
,
replyGetMatchInfo
.
Rounds
,
"0"
,
&
replyGetRoundsScoring
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
.
RoundsScoring
=
replyGetRoundsScoring
replyGetTotalScoring
:=
make
([]
cDto
.
TotalScoring
,
0
)
err
=
s
.
GetTotalScoring
(
replyGetMatchInfo
.
PlayerId
,
replyGetMatchInfo
.
Rounds
,
replyGetMatchInfo
.
SeasonId
,
&
replyGetTotalScoring
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
.
TotalScoring
=
replyGetTotalScoring
e
.
OK
(
reply
,
"查询成功"
)
}
}
// Get <俱乐部>获取球员比赛详情
// Get <俱乐部>获取球员比赛详情
...
@@ -95,11 +113,11 @@ func (e OrgClubPlayer) GetPageMatch(c *gin.Context) {
...
@@ -95,11 +113,11 @@ func (e OrgClubPlayer) GetPageMatch(c *gin.Context) {
// @Tags <俱乐部>球员
// @Tags <俱乐部>球员
// @Param id path string false "id"
// @Param id path string false "id"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /api/v1/org-
player/{id}
[get]
// @Router /api/v1/org-
club-player/get
[get]
// @Security Bearer
// @Security Bearer
func
(
e
OrgClubPlayer
)
Get
(
c
*
gin
.
Context
)
{
func
(
e
OrgClubPlayer
)
Get
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgPlayerGetReq
{}
req
:=
dto
.
Org
Club
PlayerGetReq
{}
s
:=
service
.
OrgPlayer
{}
s
:=
service
.
Org
Club
Player
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
Bind
(
&
req
)
.
...
@@ -110,14 +128,26 @@ func (e OrgClubPlayer) Get(c *gin.Context) {
...
@@ -110,14 +128,26 @@ func (e OrgClubPlayer) Get(c *gin.Context) {
e
.
Error
(
500
,
err
,
err
.
Error
())
e
.
Error
(
500
,
err
,
err
.
Error
())
return
return
}
}
var
object
models
.
OrgPlayer
p
:=
actions
.
GetPermissionFromContext
(
c
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
err
=
s
.
Get
(
&
req
,
p
,
&
object
)
reply
:=
new
(
dto
.
OrgMatchEvaluateGetReply
)
replyGetMatchInfo
:=
new
(
cDto
.
PageMatchInfo
)
err
=
s
.
GetMatchInfo
(
strconv
.
Itoa
(
req
.
Id
),
p
,
replyGetMatchInfo
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
.
MatchInfo
=
*
replyGetMatchInfo
replyGetRoundsScoring
:=
make
([]
cDto
.
RoundsScoring
,
0
)
err
=
s
.
GetRoundsScoring
(
replyGetMatchInfo
.
PlayerId
,
replyGetMatchInfo
.
Rounds
,
strconv
.
Itoa
(
req
.
Id
),
&
replyGetRoundsScoring
)
if
err
!=
nil
{
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取
球员
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取
比赛球员信息
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
reply
.
RoundsScoring
=
replyGetRoundsScoring
e
.
OK
(
object
,
"查询成功"
)
e
.
OK
(
reply
,
"查询成功"
)
}
}
app/operate/apis/org_club_team.go
View file @
f4300b15
...
@@ -2,12 +2,14 @@ package apis
...
@@ -2,12 +2,14 @@ package apis
import
(
import
(
"fmt"
"fmt"
"go-admin/app/operate/models"
cDto
"go-admin/common/dto"
"strconv"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/sdk/api"
"github.com/go-admin-team/go-admin-core/sdk/api"
_
"github.com/go-admin-team/go-admin-core/sdk/pkg/response"
_
"github.com/go-admin-team/go-admin-core/sdk/pkg/response"
"go-admin/app/operate/models"
"go-admin/app/operate/service"
"go-admin/app/operate/service"
"go-admin/app/operate/service/dto"
"go-admin/app/operate/service/dto"
"go-admin/common/actions"
"go-admin/common/actions"
...
@@ -27,8 +29,8 @@ type OrgClubTeam struct {
...
@@ -27,8 +29,8 @@ type OrgClubTeam struct {
// @Router /api/v1/org-club-team [get]
// @Router /api/v1/org-club-team [get]
// @Security Bearer
// @Security Bearer
func
(
e
OrgClubTeam
)
GetPage
(
c
*
gin
.
Context
)
{
func
(
e
OrgClubTeam
)
GetPage
(
c
*
gin
.
Context
)
{
req
:=
dto
.
Org
TeamGetPageReq
{}
req
:=
dto
.
OrgClub
TeamGetPageReq
{}
s
:=
service
.
Org
Team
{}
s
:=
service
.
OrgClub
Team
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
Bind
(
&
req
)
.
...
@@ -41,7 +43,7 @@ func (e OrgClubTeam) GetPage(c *gin.Context) {
...
@@ -41,7 +43,7 @@ func (e OrgClubTeam) GetPage(c *gin.Context) {
}
}
p
:=
actions
.
GetPermissionFromContext
(
c
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
list
:=
make
([]
models
.
OrgTeam
,
0
)
list
:=
make
([]
dto
.
OrgClubTeamGetPageReply
,
0
)
var
count
int64
var
count
int64
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
...
@@ -63,8 +65,8 @@ func (e OrgClubTeam) GetPage(c *gin.Context) {
...
@@ -63,8 +65,8 @@ func (e OrgClubTeam) GetPage(c *gin.Context) {
// @Router /api/v1/org-club-team/get-match [get]
// @Router /api/v1/org-club-team/get-match [get]
// @Security Bearer
// @Security Bearer
func
(
e
OrgClubTeam
)
GetPageMatch
(
c
*
gin
.
Context
)
{
func
(
e
OrgClubTeam
)
GetPageMatch
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgTeamGetPage
Req
{}
req
:=
dto
.
GetPageMatchClubTeam
Req
{}
s
:=
service
.
OrgTeam
{}
s
:=
service
.
Org
Club
Team
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
Bind
(
&
req
)
.
...
@@ -77,16 +79,33 @@ func (e OrgClubTeam) GetPageMatch(c *gin.Context) {
...
@@ -77,16 +79,33 @@ func (e OrgClubTeam) GetPageMatch(c *gin.Context) {
}
}
p
:=
actions
.
GetPermissionFromContext
(
c
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
list
:=
make
([]
models
.
OrgTeam
,
0
)
reply
:=
new
(
dto
.
GetPageMatchReply
)
var
count
int64
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
replyGetMatchInfo
:=
new
(
cDto
.
PageMatchInfo
)
err
=
s
.
GetMatchInfo
(
strconv
.
Itoa
(
req
.
TeamId
),
p
,
replyGetMatchInfo
)
if
err
!=
nil
{
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取
球队
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取
比赛球员信息
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
reply
.
MatchInfo
=
*
replyGetMatchInfo
e
.
PageOK
(
list
,
int
(
count
),
req
.
GetPageIndex
(),
req
.
GetPageSize
(),
"查询成功"
)
replyGetRoundsScoring
:=
make
([]
cDto
.
RoundsScoring
,
0
)
err
=
s
.
GetRoundsScoring
(
replyGetMatchInfo
.
PlayerId
,
replyGetMatchInfo
.
Rounds
,
&
replyGetRoundsScoring
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
.
RoundsScoring
=
replyGetRoundsScoring
replyGetTotalScoring
:=
make
([]
cDto
.
TotalScoring
,
0
)
err
=
s
.
GetTotalScoring
(
replyGetMatchInfo
.
PlayerId
,
replyGetMatchInfo
.
Rounds
,
replyGetMatchInfo
.
SeasonId
,
&
replyGetTotalScoring
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
.
TotalScoring
=
replyGetTotalScoring
e
.
OK
(
reply
,
"查询成功"
)
}
}
// Get <俱乐部>获取球队比赛详情
// Get <俱乐部>获取球队比赛详情
...
@@ -95,11 +114,11 @@ func (e OrgClubTeam) GetPageMatch(c *gin.Context) {
...
@@ -95,11 +114,11 @@ func (e OrgClubTeam) GetPageMatch(c *gin.Context) {
// @Tags <俱乐部>球队
// @Tags <俱乐部>球队
// @Param id path string false "id"
// @Param id path string false "id"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /api/v1/org-club-team/
{id}
[get]
// @Router /api/v1/org-club-team/
get
[get]
// @Security Bearer
// @Security Bearer
func
(
e
OrgClubTeam
)
Get
(
c
*
gin
.
Context
)
{
func
(
e
OrgClubTeam
)
Get
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgTeamGetReq
{}
req
:=
dto
.
Org
Club
TeamGetReq
{}
s
:=
service
.
OrgTeam
{}
s
:=
service
.
Org
Club
Team
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
Bind
(
&
req
)
.
...
@@ -110,14 +129,132 @@ func (e OrgClubTeam) Get(c *gin.Context) {
...
@@ -110,14 +129,132 @@ func (e OrgClubTeam) Get(c *gin.Context) {
e
.
Error
(
500
,
err
,
err
.
Error
())
e
.
Error
(
500
,
err
,
err
.
Error
())
return
return
}
}
var
object
models
.
OrgTeam
p
:=
actions
.
GetPermissionFromContext
(
c
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
err
=
s
.
Get
(
&
req
,
p
,
&
object
)
reply
:=
new
(
dto
.
OrgMatchEvaluateGetReply
)
replyGetMatchInfo
:=
new
(
cDto
.
PageMatchInfo
)
err
=
s
.
GetMatchInfo
(
strconv
.
Itoa
(
req
.
TeamId
),
p
,
replyGetMatchInfo
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
.
MatchInfo
=
*
replyGetMatchInfo
replyGetRoundsScoring
:=
make
([]
cDto
.
RoundsScoring
,
0
)
err
=
s
.
GetRoundsScoring
(
replyGetMatchInfo
.
TeamId
,
replyGetMatchInfo
.
Rounds
,
&
replyGetRoundsScoring
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
.
RoundsScoring
=
replyGetRoundsScoring
e
.
OK
(
reply
,
"查询成功"
)
}
// Get <赛事>获取比赛附加数据(比赛详情,联赛,赛区,赛季,球队)
// @Summary <赛事>获取比赛附加数据(比赛详情,联赛,赛区,赛季,球队)
// @Description <赛事>获取比赛附加数据(比赛详情,联赛,赛区,赛季,球队)
// @Tags <赛事>比赛
// @Param id path string false "id"
// @Success 200 {string} string {data=models.OrgMatchGetInfoReq} "{"code": 200, "data": [...]}"
// @Router /api/v1/org-club-team/info [get]
// @Security Bearer
func
(
e
OrgClubTeam
)
GetInfo
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgClubTeamGetInfoReq
{}
s
:=
service
.
OrgClubTeam
{}
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
Bind
(
&
req
)
.
MakeService
(
&
s
.
Service
)
.
Errors
if
err
!=
nil
{
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取球队失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Logger
.
Error
(
err
)
e
.
Error
(
500
,
err
,
err
.
Error
())
return
return
}
}
e
.
OK
(
object
,
"查询成功"
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
//联赛级别列表
sOrgLeague
:=
service
.
OrgLeague
{}
listOrgLeague
:=
make
([]
models
.
OrgLeague
,
0
)
var
countOrgLeague
int64
=
0
err
=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeService
(
&
sOrgLeague
.
Service
)
.
Errors
reqOrgLeague
:=
new
(
dto
.
OrgLeagueGetPageReq
)
reqOrgLeague
.
PageIndex
=
1
reqOrgLeague
.
PageSize
=
999
err
=
sOrgLeague
.
GetPage
(
reqOrgLeague
,
p
,
&
listOrgLeague
,
&
countOrgLeague
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取联赛 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
//赛季列表
sOrgSeason
:=
service
.
OrgSeason
{}
listOrgSeason
:=
make
([]
models
.
OrgSeason
,
0
)
var
countOrgSeason
int64
=
0
err
=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeService
(
&
sOrgSeason
.
Service
)
.
Errors
reqOrgSeason
:=
new
(
dto
.
OrgSeasonGetPageReq
)
reqOrgSeason
.
PageIndex
=
1
reqOrgSeason
.
PageSize
=
999
err
=
sOrgSeason
.
GetPage
(
reqOrgSeason
,
p
,
&
listOrgSeason
,
&
countOrgSeason
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取联赛 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
//赛区列表
sOrgDivision
:=
service
.
OrgDivision
{}
listOrgDivision
:=
make
([]
models
.
OrgDivision
,
0
)
var
countOrgDivision
int64
=
0
err
=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeService
(
&
sOrgDivision
.
Service
)
.
Errors
reqOrgDivision
:=
new
(
dto
.
OrgDivisionGetPageReq
)
reqOrgDivision
.
PageIndex
=
1
reqOrgDivision
.
PageSize
=
999
err
=
sOrgDivision
.
GetPage
(
reqOrgDivision
,
p
,
&
listOrgDivision
,
&
countOrgDivision
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取联赛 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
//球队列表
sOrgTeam
:=
service
.
OrgTeam
{}
listOrgTeam
:=
make
([]
models
.
OrgTeam
,
0
)
var
countOrgTeam
int64
=
0
err
=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeService
(
&
sOrgTeam
.
Service
)
.
Errors
reqOrgTeam
:=
new
(
dto
.
OrgTeamGetPageReq
)
reqOrgTeam
.
PageIndex
=
1
reqOrgTeam
.
PageSize
=
999
err
=
sOrgTeam
.
GetPage
(
reqOrgTeam
,
p
,
&
listOrgTeam
,
&
countOrgTeam
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取联赛 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
:=
dto
.
OrgMatchGetInfoReply
{
OrgLeagueList
:
listOrgLeague
,
OrgSeasonList
:
listOrgSeason
,
OrgDivisionList
:
listOrgDivision
,
OrgTeamList
:
listOrgTeam
,
}
e
.
OK
(
reply
,
"查询成功"
)
}
}
app/operate/apis/org_team.go
View file @
f4300b15
...
@@ -2,11 +2,11 @@ package apis
...
@@ -2,11 +2,11 @@ package apis
import
(
import
(
"fmt"
"fmt"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/sdk/api"
"github.com/go-admin-team/go-admin-core/sdk/api"
"github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth/user"
"github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth/user"
_
"github.com/go-admin-team/go-admin-core/sdk/pkg/response"
_
"github.com/go-admin-team/go-admin-core/sdk/pkg/response"
"strconv"
"go-admin/app/operate/models"
"go-admin/app/operate/models"
"go-admin/app/operate/service"
"go-admin/app/operate/service"
...
@@ -83,8 +83,24 @@ func (e OrgTeam) Get(c *gin.Context) {
...
@@ -83,8 +83,24 @@ func (e OrgTeam) Get(c *gin.Context) {
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取球队失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取球队失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
if
object
.
ClubId
==
""
{
sOrgClubUser
:=
service
.
OrgClubUser
{}
_
,
object
.
ClubId
=
sOrgClubUser
.
GetClubId
(
user
.
GetUserId
(
c
))
}
reqClub
:=
dto
.
OrgClubGetReq
{}
sClub
:=
service
.
OrgClub
{}
var
objectClub
models
.
OrgClub
reqClub
.
Id
,
_
=
strconv
.
Atoi
(
object
.
ClubId
)
err
=
sClub
.
Get
(
&
reqClub
,
p
,
&
objectClub
)
reply
:=
dto
.
OrgTeamGetReply
{}
reply
.
ClubId
=
object
.
ClubId
reply
.
ClubName
=
objectClub
.
ClubName
reply
.
TeamName
=
object
.
TeamName
e
.
OK
(
object
,
"查询成功"
)
e
.
OK
(
object
,
"查询成功"
)
}
}
// Insert <球队>创建球队
// Insert <球队>创建球队
...
@@ -153,7 +169,7 @@ func (e OrgTeam) Update(c *gin.Context) {
...
@@ -153,7 +169,7 @@ func (e OrgTeam) Update(c *gin.Context) {
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"修改球队 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"修改球队 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
e
.
OK
(
req
.
GetId
(),
"修改成功"
)
e
.
OK
(
req
.
GetId
(),
"修改成功"
)
}
}
// Delete <球队>删除球队
// Delete <球队>删除球队
...
@@ -186,5 +202,5 @@ func (e OrgTeam) Delete(c *gin.Context) {
...
@@ -186,5 +202,5 @@ func (e OrgTeam) Delete(c *gin.Context) {
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"删除球队失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"删除球队失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
e
.
OK
(
req
.
GetId
(),
"删除成功"
)
e
.
OK
(
req
.
GetId
(),
"删除成功"
)
}
}
app/operate/apis/org_team_player.go
View file @
f4300b15
...
@@ -2,12 +2,13 @@ package apis
...
@@ -2,12 +2,13 @@ package apis
import
(
import
(
"fmt"
"fmt"
cDto
"go-admin/common/dto"
"strconv"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/sdk/api"
"github.com/go-admin-team/go-admin-core/sdk/api"
_
"github.com/go-admin-team/go-admin-core/sdk/pkg/response"
_
"github.com/go-admin-team/go-admin-core/sdk/pkg/response"
"go-admin/app/operate/models"
"go-admin/app/operate/service"
"go-admin/app/operate/service"
"go-admin/app/operate/service/dto"
"go-admin/app/operate/service/dto"
"go-admin/common/actions"
"go-admin/common/actions"
...
@@ -27,8 +28,8 @@ type OrgTeamPlayer struct {
...
@@ -27,8 +28,8 @@ type OrgTeamPlayer struct {
// @Router /api/v1/org-team-player [get]
// @Router /api/v1/org-team-player [get]
// @Security Bearer
// @Security Bearer
func
(
e
OrgTeamPlayer
)
GetPage
(
c
*
gin
.
Context
)
{
func
(
e
OrgTeamPlayer
)
GetPage
(
c
*
gin
.
Context
)
{
req
:=
dto
.
Org
PlayerGetPageReq
{}
req
:=
dto
.
OrgTeam
PlayerGetPageReq
{}
s
:=
service
.
Org
Player
{}
s
:=
service
.
OrgTeam
Player
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
Bind
(
&
req
)
.
...
@@ -41,12 +42,12 @@ func (e OrgTeamPlayer) GetPage(c *gin.Context) {
...
@@ -41,12 +42,12 @@ func (e OrgTeamPlayer) GetPage(c *gin.Context) {
}
}
p
:=
actions
.
GetPermissionFromContext
(
c
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
list
:=
make
([]
models
.
OrgPlayer
,
0
)
list
:=
make
([]
dto
.
OrgTeamPlayerGetPageReply
,
0
)
var
count
int64
var
count
int64
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
if
err
!=
nil
{
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取球
员
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取球
队
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
...
@@ -63,8 +64,8 @@ func (e OrgTeamPlayer) GetPage(c *gin.Context) {
...
@@ -63,8 +64,8 @@ func (e OrgTeamPlayer) GetPage(c *gin.Context) {
// @Router /api/v1/org-team-player/get-match [get]
// @Router /api/v1/org-team-player/get-match [get]
// @Security Bearer
// @Security Bearer
func
(
e
OrgTeamPlayer
)
GetPageMatch
(
c
*
gin
.
Context
)
{
func
(
e
OrgTeamPlayer
)
GetPageMatch
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgPlayerGetPage
Req
{}
req
:=
dto
.
GetPageMatchTeamPlayer
Req
{}
s
:=
service
.
OrgPlayer
{}
s
:=
service
.
Org
Team
Player
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
Bind
(
&
req
)
.
...
@@ -77,16 +78,33 @@ func (e OrgTeamPlayer) GetPageMatch(c *gin.Context) {
...
@@ -77,16 +78,33 @@ func (e OrgTeamPlayer) GetPageMatch(c *gin.Context) {
}
}
p
:=
actions
.
GetPermissionFromContext
(
c
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
list
:=
make
([]
models
.
OrgPlayer
,
0
)
reply
:=
new
(
dto
.
GetPageMatchReply
)
var
count
int64
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
replyGetMatchInfo
:=
new
(
cDto
.
PageMatchInfo
)
err
=
s
.
GetMatchInfo
(
req
.
Id
,
p
,
replyGetMatchInfo
)
if
err
!=
nil
{
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取
球员
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取
比赛球员信息
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
reply
.
MatchInfo
=
*
replyGetMatchInfo
e
.
PageOK
(
list
,
int
(
count
),
req
.
GetPageIndex
(),
req
.
GetPageSize
(),
"查询成功"
)
replyGetRoundsScoring
:=
make
([]
cDto
.
RoundsScoring
,
0
)
err
=
s
.
GetRoundsScoring
(
replyGetMatchInfo
.
PlayerId
,
replyGetMatchInfo
.
Rounds
,
"0"
,
&
replyGetRoundsScoring
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
.
RoundsScoring
=
replyGetRoundsScoring
replyGetTotalScoring
:=
make
([]
cDto
.
TotalScoring
,
0
)
err
=
s
.
GetTotalScoring
(
replyGetMatchInfo
.
PlayerId
,
replyGetMatchInfo
.
Rounds
,
replyGetMatchInfo
.
SeasonId
,
&
replyGetTotalScoring
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
.
TotalScoring
=
replyGetTotalScoring
e
.
OK
(
reply
,
"查询成功"
)
}
}
// Get <球队>获取球员表现比赛详情
// Get <球队>获取球员表现比赛详情
...
@@ -98,8 +116,8 @@ func (e OrgTeamPlayer) GetPageMatch(c *gin.Context) {
...
@@ -98,8 +116,8 @@ func (e OrgTeamPlayer) GetPageMatch(c *gin.Context) {
// @Router /api/v1/org-team-player/{id} [get]
// @Router /api/v1/org-team-player/{id} [get]
// @Security Bearer
// @Security Bearer
func
(
e
OrgTeamPlayer
)
Get
(
c
*
gin
.
Context
)
{
func
(
e
OrgTeamPlayer
)
Get
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgPlayerGetReq
{}
req
:=
dto
.
Org
Team
PlayerGetReq
{}
s
:=
service
.
OrgPlayer
{}
s
:=
service
.
Org
Team
Player
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
Bind
(
&
req
)
.
...
@@ -110,14 +128,26 @@ func (e OrgTeamPlayer) Get(c *gin.Context) {
...
@@ -110,14 +128,26 @@ func (e OrgTeamPlayer) Get(c *gin.Context) {
e
.
Error
(
500
,
err
,
err
.
Error
())
e
.
Error
(
500
,
err
,
err
.
Error
())
return
return
}
}
var
object
models
.
OrgPlayer
p
:=
actions
.
GetPermissionFromContext
(
c
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
err
=
s
.
Get
(
&
req
,
p
,
&
object
)
reply
:=
new
(
dto
.
OrgMatchEvaluateGetReply
)
replyGetMatchInfo
:=
new
(
cDto
.
PageMatchInfo
)
err
=
s
.
GetMatchInfo
(
strconv
.
Itoa
(
req
.
Id
),
p
,
replyGetMatchInfo
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
.
MatchInfo
=
*
replyGetMatchInfo
replyGetRoundsScoring
:=
make
([]
cDto
.
RoundsScoring
,
0
)
err
=
s
.
GetRoundsScoring
(
replyGetMatchInfo
.
PlayerId
,
replyGetMatchInfo
.
Rounds
,
strconv
.
Itoa
(
req
.
Id
),
&
replyGetRoundsScoring
)
if
err
!=
nil
{
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取
球员
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取
比赛球员信息
失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
reply
.
RoundsScoring
=
replyGetRoundsScoring
e
.
OK
(
object
,
"查询成功"
)
e
.
OK
(
reply
,
"查询成功"
)
}
}
app/operate/apis/org_team_team.go
View file @
f4300b15
...
@@ -27,8 +27,8 @@ type OrgTeamTeam struct {
...
@@ -27,8 +27,8 @@ type OrgTeamTeam struct {
// @Router /api/v1/org-team-team [get]
// @Router /api/v1/org-team-team [get]
// @Security Bearer
// @Security Bearer
func
(
e
OrgTeamTeam
)
GetPage
(
c
*
gin
.
Context
)
{
func
(
e
OrgTeamTeam
)
GetPage
(
c
*
gin
.
Context
)
{
req
:=
dto
.
Org
TeamGetPageReq
{}
req
:=
dto
.
OrgTeam
TeamGetPageReq
{}
s
:=
service
.
Org
Team
{}
s
:=
service
.
OrgTeam
Team
{}
err
:=
e
.
MakeContext
(
c
)
.
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeOrm
()
.
Bind
(
&
req
)
.
Bind
(
&
req
)
.
...
@@ -41,7 +41,7 @@ func (e OrgTeamTeam) GetPage(c *gin.Context) {
...
@@ -41,7 +41,7 @@ func (e OrgTeamTeam) GetPage(c *gin.Context) {
}
}
p
:=
actions
.
GetPermissionFromContext
(
c
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
list
:=
make
([]
models
.
OrgTeam
,
0
)
list
:=
make
([]
dto
.
OrgTeamTeamGetPageReply
,
0
)
var
count
int64
var
count
int64
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
...
@@ -119,5 +119,5 @@ func (e OrgTeamTeam) Get(c *gin.Context) {
...
@@ -119,5 +119,5 @@ func (e OrgTeamTeam) Get(c *gin.Context) {
return
return
}
}
e
.
OK
(
object
,
"查询成功"
)
e
.
OK
(
object
,
"查询成功"
)
}
}
app/operate/apis/org_team_user.go
View file @
f4300b15
...
@@ -42,7 +42,7 @@ func (e OrgTeamUser) GetPage(c *gin.Context) {
...
@@ -42,7 +42,7 @@ func (e OrgTeamUser) GetPage(c *gin.Context) {
}
}
p
:=
actions
.
GetPermissionFromContext
(
c
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
list
:=
make
([]
models
.
OrgTeamUser
,
0
)
list
:=
make
([]
dto
.
OrgTeamUserGetPageReply
,
0
)
var
count
int64
var
count
int64
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
...
@@ -84,7 +84,7 @@ func (e OrgTeamUser) Get(c *gin.Context) {
...
@@ -84,7 +84,7 @@ func (e OrgTeamUser) Get(c *gin.Context) {
return
return
}
}
e
.
OK
(
object
,
"查询成功"
)
e
.
OK
(
object
,
"查询成功"
)
}
}
// Insert <球队>创建工作人员
// Insert <球队>创建工作人员
...
@@ -153,7 +153,7 @@ func (e OrgTeamUser) Update(c *gin.Context) {
...
@@ -153,7 +153,7 @@ func (e OrgTeamUser) Update(c *gin.Context) {
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"修改球队人员账户信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"修改球队人员账户信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
e
.
OK
(
req
.
GetId
(),
"修改成功"
)
e
.
OK
(
req
.
GetId
(),
"修改成功"
)
}
}
// Delete <球队>删除工作人员
// Delete <球队>删除工作人员
...
@@ -186,5 +186,5 @@ func (e OrgTeamUser) Delete(c *gin.Context) {
...
@@ -186,5 +186,5 @@ func (e OrgTeamUser) Delete(c *gin.Context) {
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"删除球队人员账户信息失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"删除球队人员账户信息失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
return
}
}
e
.
OK
(
req
.
GetId
(),
"删除成功"
)
e
.
OK
(
req
.
GetId
(),
"删除成功"
)
}
}
app/operate/models/org_club.go
View file @
f4300b15
...
@@ -8,9 +8,10 @@ import (
...
@@ -8,9 +8,10 @@ import (
type
OrgClub
struct
{
type
OrgClub
struct
{
models
.
Model
models
.
Model
ClubName
string
`json:"clubName" gorm:"type:varchar(255);comment:俱乐部名称"`
ClubName
string
`json:"clubName" gorm:"type:varchar(255);comment:俱乐部名称"`
ClubContacts
string
`json:"clubContacts" gorm:"type:varchar(60);comment:俱乐部联系人"`
ClubUserName
string
`json:"clubUserName" gorm:"type:varchar(120);comment:俱乐部账号"`
ClubContacts
string
`json:"clubContacts" gorm:"type:varchar(120);comment:俱乐部联系人"`
ClubContactsEn
string
`json:"clubContactsEn" gorm:"type:varchar(120);comment:俱乐部联系人"`
ClubMobile
string
`json:"clubMobile" gorm:"type:varchar(30);comment:俱乐部联系电话"`
ClubMobile
string
`json:"clubMobile" gorm:"type:varchar(30);comment:俱乐部联系电话"`
ClubLogo
string
`json:"clubLogo" gorm:"type:varchar(255);comment:俱乐部logo"`
ClubLogo
string
`json:"clubLogo" gorm:"type:varchar(255);comment:俱乐部logo"`
ClubQrcode
string
`json:"clubQrcode" gorm:"type:varchar(255);comment:俱乐部二维码"`
ClubQrcode
string
`json:"clubQrcode" gorm:"type:varchar(255);comment:俱乐部二维码"`
...
...
app/operate/models/org_player.go
View file @
f4300b15
...
@@ -8,7 +8,6 @@ import (
...
@@ -8,7 +8,6 @@ import (
type
OrgPlayer
struct
{
type
OrgPlayer
struct
{
models
.
Model
models
.
Model
ClubId
string
`json:"clubId" gorm:"type:bigint(20);comment:org_club表id"`
ClubId
string
`json:"clubId" gorm:"type:bigint(20);comment:org_club表id"`
TeamId
string
`json:"teamId" gorm:"type:bigint(20);comment:org_team表id"`
TeamId
string
`json:"teamId" gorm:"type:bigint(20);comment:org_team表id"`
PlayerName
string
`json:"playerName" gorm:"type:varchar(60);comment:球员姓名"`
PlayerName
string
`json:"playerName" gorm:"type:varchar(60);comment:球员姓名"`
...
...
app/operate/router/org_club_player.go
View file @
f4300b15
...
@@ -18,7 +18,7 @@ func registerOrgClubPlayerRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWT
...
@@ -18,7 +18,7 @@ func registerOrgClubPlayerRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWT
r
:=
v1
.
Group
(
"/org-club-player"
)
.
Use
(
authMiddleware
.
MiddlewareFunc
())
.
Use
(
middleware
.
AuthCheckRole
())
r
:=
v1
.
Group
(
"/org-club-player"
)
.
Use
(
authMiddleware
.
MiddlewareFunc
())
.
Use
(
middleware
.
AuthCheckRole
())
{
{
r
.
GET
(
""
,
api
.
GetPage
)
r
.
GET
(
""
,
api
.
GetPage
)
r
.
GET
(
"get-match"
,
api
.
GetPageMatch
)
r
.
GET
(
"
/
get-match"
,
api
.
GetPageMatch
)
r
.
GET
(
"/
:id
"
,
api
.
Get
)
r
.
GET
(
"/
get
"
,
api
.
Get
)
}
}
}
}
app/operate/router/org_club_team.go
View file @
f4300b15
...
@@ -18,7 +18,8 @@ func registerOrgClubTeamRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMi
...
@@ -18,7 +18,8 @@ func registerOrgClubTeamRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMi
r
:=
v1
.
Group
(
"/org-club-team"
)
.
Use
(
authMiddleware
.
MiddlewareFunc
())
.
Use
(
middleware
.
AuthCheckRole
())
r
:=
v1
.
Group
(
"/org-club-team"
)
.
Use
(
authMiddleware
.
MiddlewareFunc
())
.
Use
(
middleware
.
AuthCheckRole
())
{
{
r
.
GET
(
""
,
api
.
GetPage
)
r
.
GET
(
""
,
api
.
GetPage
)
r
.
GET
(
"get-match"
,
api
.
GetPageMatch
)
r
.
GET
(
"/get-match"
,
api
.
GetPageMatch
)
r
.
GET
(
"/:id"
,
api
.
Get
)
r
.
GET
(
"/get"
,
api
.
Get
)
r
.
GET
(
"/info"
,
api
.
GetInfo
)
}
}
}
}
app/operate/router/org_team_player.go
View file @
f4300b15
...
@@ -18,7 +18,7 @@ func registerOrgTeamPlayerRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWT
...
@@ -18,7 +18,7 @@ func registerOrgTeamPlayerRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWT
r
:=
v1
.
Group
(
"/org-team-player"
)
.
Use
(
authMiddleware
.
MiddlewareFunc
())
.
Use
(
middleware
.
AuthCheckRole
())
r
:=
v1
.
Group
(
"/org-team-player"
)
.
Use
(
authMiddleware
.
MiddlewareFunc
())
.
Use
(
middleware
.
AuthCheckRole
())
{
{
r
.
GET
(
""
,
api
.
GetPage
)
r
.
GET
(
""
,
api
.
GetPage
)
r
.
GET
(
"get-match"
,
api
.
GetPageMatch
)
r
.
GET
(
"
/
get-match"
,
api
.
GetPageMatch
)
r
.
GET
(
"/
:id
"
,
api
.
Get
)
r
.
GET
(
"/
get
"
,
api
.
Get
)
}
}
}
}
app/operate/router/org_team_team.go
View file @
f4300b15
...
@@ -18,7 +18,7 @@ func registerOrgTeamTeamRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMi
...
@@ -18,7 +18,7 @@ func registerOrgTeamTeamRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMi
r
:=
v1
.
Group
(
"/org-team-team"
)
.
Use
(
authMiddleware
.
MiddlewareFunc
())
.
Use
(
middleware
.
AuthCheckRole
())
r
:=
v1
.
Group
(
"/org-team-team"
)
.
Use
(
authMiddleware
.
MiddlewareFunc
())
.
Use
(
middleware
.
AuthCheckRole
())
{
{
r
.
GET
(
""
,
api
.
GetPage
)
r
.
GET
(
""
,
api
.
GetPage
)
r
.
GET
(
"get-match"
,
api
.
GetPageMatch
)
r
.
GET
(
"
/
get-match"
,
api
.
GetPageMatch
)
r
.
GET
(
"/
:id
"
,
api
.
Get
)
r
.
GET
(
"/
get
"
,
api
.
Get
)
}
}
}
}
app/operate/service/dto/org_club.go
View file @
f4300b15
...
@@ -4,26 +4,11 @@ import (
...
@@ -4,26 +4,11 @@ import (
"go-admin/app/operate/models"
"go-admin/app/operate/models"
"go-admin/common/dto"
"go-admin/common/dto"
common
"go-admin/common/models"
common
"go-admin/common/models"
"time"
)
)
type
OrgClubGetPageReq
struct
{
type
OrgClubGetPageReq
struct
{
dto
.
Pagination
`search:"-"`
dto
.
Pagination
`search:"-"`
OrgClubOrder
ClubName
string
`form:"clubNameOrder" json:"clubName" comment:"俱乐部名称"`
}
type
OrgClubOrder
struct
{
Id
int
`form:"idOrder" search:"type:order;column:id;table:org_club"`
ClubName
string
`form:"clubNameOrder" search:"type:order;column:club_name;table:org_club"`
ClubContacts
string
`form:"clubContactsOrder" search:"type:order;column:club_contacts;table:org_club"`
ClubMobile
string
`form:"clubMobileOrder" search:"type:order;column:club_mobile;table:org_club"`
ClubLogo
string
`form:"clubLogoOrder" search:"type:order;column:club_logo;table:org_club"`
ClubQrcode
string
`form:"clubQrcodeOrder" search:"type:order;column:club_qrcode;table:org_club"`
CreateBy
string
`form:"createByOrder" search:"type:order;column:create_by;table:org_club"`
UpdateBy
string
`form:"updateByOrder" search:"type:order;column:update_by;table:org_club"`
CreatedAt
time
.
Time
`form:"createdAtOrder" search:"type:order;column:created_at;table:org_club"`
UpdatedAt
time
.
Time
`form:"updatedAtOrder" search:"type:order;column:updated_at;table:org_club"`
DeletedAt
time
.
Time
`form:"deletedAtOrder" search:"type:order;column:deleted_at;table:org_club"`
}
}
func
(
m
*
OrgClubGetPageReq
)
GetNeedSearch
()
interface
{}
{
func
(
m
*
OrgClubGetPageReq
)
GetNeedSearch
()
interface
{}
{
...
@@ -33,7 +18,9 @@ func (m *OrgClubGetPageReq) GetNeedSearch() interface{} {
...
@@ -33,7 +18,9 @@ func (m *OrgClubGetPageReq) GetNeedSearch() interface{} {
type
OrgClubInsertReq
struct
{
type
OrgClubInsertReq
struct
{
Id
int
`json:"-" comment:""`
//
Id
int
`json:"-" comment:""`
//
ClubName
string
`json:"clubName" comment:"俱乐部名称"`
ClubName
string
`json:"clubName" comment:"俱乐部名称"`
ClubUserName
string
`json:"clubUserName" comment:"俱乐部账号"`
ClubContacts
string
`json:"clubContacts" comment:"俱乐部联系人"`
ClubContacts
string
`json:"clubContacts" comment:"俱乐部联系人"`
ClubContactsEn
string
`json:"clubContactsEn" comment:"俱乐部联系人"`
ClubMobile
string
`json:"clubMobile" comment:"俱乐部联系电话"`
ClubMobile
string
`json:"clubMobile" comment:"俱乐部联系电话"`
ClubLogo
string
`json:"clubLogo" comment:"俱乐部logo"`
ClubLogo
string
`json:"clubLogo" comment:"俱乐部logo"`
ClubQrcode
string
`json:"clubQrcode" comment:"俱乐部二维码"`
ClubQrcode
string
`json:"clubQrcode" comment:"俱乐部二维码"`
...
@@ -42,10 +29,12 @@ type OrgClubInsertReq struct {
...
@@ -42,10 +29,12 @@ type OrgClubInsertReq struct {
func
(
s
*
OrgClubInsertReq
)
Generate
(
model
*
models
.
OrgClub
)
{
func
(
s
*
OrgClubInsertReq
)
Generate
(
model
*
models
.
OrgClub
)
{
if
s
.
Id
==
0
{
if
s
.
Id
==
0
{
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
}
}
model
.
ClubName
=
s
.
ClubName
model
.
ClubName
=
s
.
ClubName
model
.
ClubUserName
=
s
.
ClubUserName
model
.
ClubContacts
=
s
.
ClubContacts
model
.
ClubContacts
=
s
.
ClubContacts
model
.
ClubContactsEn
=
s
.
ClubContactsEn
model
.
ClubMobile
=
s
.
ClubMobile
model
.
ClubMobile
=
s
.
ClubMobile
model
.
ClubLogo
=
s
.
ClubLogo
model
.
ClubLogo
=
s
.
ClubLogo
model
.
ClubQrcode
=
s
.
ClubQrcode
model
.
ClubQrcode
=
s
.
ClubQrcode
...
@@ -58,7 +47,9 @@ func (s *OrgClubInsertReq) GetId() interface{} {
...
@@ -58,7 +47,9 @@ func (s *OrgClubInsertReq) GetId() interface{} {
type
OrgClubUpdateReq
struct
{
type
OrgClubUpdateReq
struct
{
Id
int
`uri:"id" comment:""`
//
Id
int
`uri:"id" comment:""`
//
ClubName
string
`json:"clubName" comment:"俱乐部名称"`
ClubName
string
`json:"clubName" comment:"俱乐部名称"`
ClubUserName
string
`json:"clubUserName" comment:"俱乐部账号"`
ClubContacts
string
`json:"clubContacts" comment:"俱乐部联系人"`
ClubContacts
string
`json:"clubContacts" comment:"俱乐部联系人"`
ClubContactsEn
string
`json:"clubContactsEn" comment:"俱乐部联系人"`
ClubMobile
string
`json:"clubMobile" comment:"俱乐部联系电话"`
ClubMobile
string
`json:"clubMobile" comment:"俱乐部联系电话"`
ClubLogo
string
`json:"clubLogo" comment:"俱乐部logo"`
ClubLogo
string
`json:"clubLogo" comment:"俱乐部logo"`
ClubQrcode
string
`json:"clubQrcode" comment:"俱乐部二维码"`
ClubQrcode
string
`json:"clubQrcode" comment:"俱乐部二维码"`
...
@@ -67,10 +58,12 @@ type OrgClubUpdateReq struct {
...
@@ -67,10 +58,12 @@ type OrgClubUpdateReq struct {
func
(
s
*
OrgClubUpdateReq
)
Generate
(
model
*
models
.
OrgClub
)
{
func
(
s
*
OrgClubUpdateReq
)
Generate
(
model
*
models
.
OrgClub
)
{
if
s
.
Id
==
0
{
if
s
.
Id
==
0
{
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
}
}
model
.
ClubName
=
s
.
ClubName
model
.
ClubName
=
s
.
ClubName
model
.
ClubUserName
=
s
.
ClubUserName
model
.
ClubContacts
=
s
.
ClubContacts
model
.
ClubContacts
=
s
.
ClubContacts
model
.
ClubContactsEn
=
s
.
ClubContactsEn
model
.
ClubMobile
=
s
.
ClubMobile
model
.
ClubMobile
=
s
.
ClubMobile
model
.
ClubLogo
=
s
.
ClubLogo
model
.
ClubLogo
=
s
.
ClubLogo
model
.
ClubQrcode
=
s
.
ClubQrcode
model
.
ClubQrcode
=
s
.
ClubQrcode
...
@@ -84,13 +77,14 @@ func (s *OrgClubUpdateReq) GetId() interface{} {
...
@@ -84,13 +77,14 @@ func (s *OrgClubUpdateReq) GetId() interface{} {
type
OrgClubGetReq
struct
{
type
OrgClubGetReq
struct
{
Id
int
`uri:"id"`
Id
int
`uri:"id"`
}
}
func
(
s
*
OrgClubGetReq
)
GetId
()
interface
{}
{
func
(
s
*
OrgClubGetReq
)
GetId
()
interface
{}
{
return
s
.
Id
return
s
.
Id
}
}
// OrgClubDeleteReq 功能删除请求参数
// OrgClubDeleteReq 功能删除请求参数
type
OrgClubDeleteReq
struct
{
type
OrgClubDeleteReq
struct
{
Ids
[]
int
`json:"ids"`
Ids
int
`json:"ids"`
}
}
func
(
s
*
OrgClubDeleteReq
)
GetId
()
interface
{}
{
func
(
s
*
OrgClubDeleteReq
)
GetId
()
interface
{}
{
...
...
app/operate/service/dto/org_club_player.go
0 → 100644
View file @
f4300b15
package
dto
import
(
"go-admin/common/dto"
)
type
OrgClubPlayerGetPageReq
struct
{
dto
.
Pagination
`search:"-"`
LeagueId
string
`form:"leagueId" search:"type:exact;column:league_id;table:om" comment:"联赛级别id"`
//联赛级别id
DivisionId
string
`form:"divisionId" search:"type:exact;column:division_id;table:om" comment:"赛区id"`
//赛区id
SeasonId
string
`form:"seasonId" search:"type:exact;column:season_id;table:om" comment:"赛季id"`
//赛季id
Rounds
string
`form:"rounds" search:"type:exact;column:rounds;table:omtp" comment:"轮次"`
//轮次
PlayerName
string
`form:"playerName" search:"type:contains;column:player_name;table:omtp" comment:"球员名称"`
//球员名称
}
type
OrgClubPlayerGetPageReply
struct
{
Id
string
`json:"id"`
Rank
string
`json:"rank"`
LeagueName
string
`json:"leagueName"`
SeasonName
string
`json:"seasonName"`
Rounds
string
`json:"rounds"`
PlayerName
string
`json:"playerName"`
PlayerNumber
string
`json:"playerNumber" comment:"球衣号码"`
Position
string
`json:"position" comment:"场上位置"`
dto
.
TotalScoring
}
type
GetPageMatchClubPlayerReq
struct
{
Id
string
`form:"id" json:"id"`
}
type
GetPageMatchClubPlayerReply
struct
{
MatchInfo
dto
.
PageMatchInfo
`json:"matchInfo"`
TotalScoring
[]
dto
.
TotalScoring
`json:"totalScoring"`
RoundsScoring
[]
dto
.
RoundsScoring
`json:"roundsScoring"`
}
func
(
m
*
OrgClubPlayerGetPageReq
)
GetNeedSearch
()
interface
{}
{
return
*
m
}
// OrgMatchEvaluateGetReq 功能获取请求参数
type
OrgClubPlayerGetReq
struct
{
Id
int
`uri:"id"`
}
type
OrgClubPlayerGetReply
struct
{
MatchInfo
dto
.
PageMatchInfo
`json:"matchInfo"`
RoundsScoring
[]
dto
.
RoundsScoring
`json:"roundsScoring"`
}
func
(
s
*
OrgClubPlayerGetReq
)
GetId
()
interface
{}
{
return
s
.
Id
}
app/operate/service/dto/org_club_team.go
0 → 100644
View file @
f4300b15
package
dto
import
(
"go-admin/app/operate/models"
"go-admin/common/dto"
)
type
OrgClubTeamGetPageReq
struct
{
dto
.
Pagination
`search:"-"`
TeamId
string
`form:"teamId" search:"type:exact;column:team_id;table:ot" comment:""`
LeagueId
string
`form:"leagueId" search:"type:exact;column:league_id;table:om" comment:""`
DivisionId
string
`form:"divisionId" search:"type:exact;column:division_id;table:om" comment:""`
SeasonId
string
`form:"seasonId" search:"type:exact;column:season_id;table:om" comment:""`
Rounds
string
`form:"rounds" search:"type:exact;column:rounds;table:om" comment:""`
}
type
OrgClubTeamGetPageReply
struct
{
TeamId
string
`json:"teamId"`
Rank
string
`json:"rank"`
LeagueName
string
`json:"leagueName"`
DivisionName
string
`json:"divisionName"`
SeasonName
string
`json:"seasonName"`
Rounds
string
`json:"rounds"`
dto
.
TotalScoring
}
type
OrgClubTeamGetInfoReq
struct
{
}
type
OrgClubTeamGetInfoReply
struct
{
OrgMatch
models
.
OrgMatch
`form:"orgMatch"`
OrgLeagueList
[]
models
.
OrgLeague
`form:"orgLeagueList"`
OrgSeasonList
[]
models
.
OrgSeason
`form:"orgSeasonList"`
OrgDivisionList
[]
models
.
OrgDivision
`form:"orgDivisionList"`
OrgTeamList
[]
models
.
OrgTeam
`form:"orgTeamList"`
}
func
(
m
*
OrgClubTeamGetPageReq
)
GetNeedSearch
()
interface
{}
{
return
*
m
}
// OrgMatchGetReq 功能获取请求参数
type
OrgClubTeamGetReq
struct
{
TeamId
int
`form:"teamId" json:"teamId"`
Rounds
int
`form:"rounds" json:"rounds"`
}
type
OrgClubTeamGetReply
struct
{
OrgMatch
models
.
OrgMatch
`form:"orgMatch" json:"orgMatch"`
OrgMatchTeamAPlayer
[]
models
.
OrgMatchTeamPlayer
`form:"orgMatchTeamAPlayer" json:"orgMatchTeamAPlayer"`
OrgMatchTeamBPlayer
[]
models
.
OrgMatchTeamPlayer
`form:"orgMatchTeamBPlayer" json:"orgMatchTeamBPlayer"`
}
func
(
s
*
OrgClubTeamGetReq
)
GetId
()
interface
{}
{
return
s
.
TeamId
}
type
GetPageMatchClubTeamReq
struct
{
TeamId
int
`form:"teamId" json:"teamId"`
}
type
GetPageMatchClubTeamReply
struct
{
MatchInfo
dto
.
PageMatchInfo
`json:"matchInfo"`
TotalScoring
[]
dto
.
TotalScoring
`json:"totalScoring"`
RoundsScoring
[]
dto
.
RoundsScoring
`json:"roundsScoring"`
}
app/operate/service/dto/org_club_user.go
View file @
f4300b15
...
@@ -12,7 +12,8 @@ type OrgClubUserGetPageReq struct {
...
@@ -12,7 +12,8 @@ type OrgClubUserGetPageReq struct {
OrgClubUserOrder
OrgClubUserOrder
}
}
type
OrgClubUserOrder
struct
{
Id
int
`form:"idOrder" search:"type:order;column:id;table:org_club_user"`
type
OrgClubUserOrder
struct
{
Id
int
`form:"idOrder" search:"type:order;column:id;table:org_club_user"`
UserId
string
`form:"userIdOrder" search:"type:order;column:user_id;table:org_club_user"`
UserId
string
`form:"userIdOrder" search:"type:order;column:user_id;table:org_club_user"`
ClubId
string
`form:"clubIdOrder" search:"type:order;column:club_id;table:org_club_user"`
ClubId
string
`form:"clubIdOrder" search:"type:order;column:club_id;table:org_club_user"`
CreateBy
string
`form:"createByOrder" search:"type:order;column:create_by;table:org_club_user"`
CreateBy
string
`form:"createByOrder" search:"type:order;column:create_by;table:org_club_user"`
...
@@ -20,7 +21,6 @@ type OrgClubUserOrder struct {Id int `form:"idOrder" search:"type:order;column:
...
@@ -20,7 +21,6 @@ type OrgClubUserOrder struct {Id int `form:"idOrder" search:"type:order;column:
CreatedAt
time
.
Time
`form:"createdAtOrder" search:"type:order;column:created_at;table:org_club_user"`
CreatedAt
time
.
Time
`form:"createdAtOrder" search:"type:order;column:created_at;table:org_club_user"`
UpdatedAt
time
.
Time
`form:"updatedAtOrder" search:"type:order;column:updated_at;table:org_club_user"`
UpdatedAt
time
.
Time
`form:"updatedAtOrder" search:"type:order;column:updated_at;table:org_club_user"`
DeletedAt
time
.
Time
`form:"deletedAtOrder" search:"type:order;column:deleted_at;table:org_club_user"`
DeletedAt
time
.
Time
`form:"deletedAtOrder" search:"type:order;column:deleted_at;table:org_club_user"`
}
}
func
(
m
*
OrgClubUserGetPageReq
)
GetNeedSearch
()
interface
{}
{
func
(
m
*
OrgClubUserGetPageReq
)
GetNeedSearch
()
interface
{}
{
...
@@ -36,7 +36,7 @@ type OrgClubUserInsertReq struct {
...
@@ -36,7 +36,7 @@ type OrgClubUserInsertReq struct {
func
(
s
*
OrgClubUserInsertReq
)
Generate
(
model
*
models
.
OrgClubUser
)
{
func
(
s
*
OrgClubUserInsertReq
)
Generate
(
model
*
models
.
OrgClubUser
)
{
if
s
.
Id
==
0
{
if
s
.
Id
==
0
{
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
}
}
model
.
UserId
=
s
.
UserId
model
.
UserId
=
s
.
UserId
model
.
ClubId
=
s
.
ClubId
model
.
ClubId
=
s
.
ClubId
...
@@ -55,7 +55,7 @@ type OrgClubUserUpdateReq struct {
...
@@ -55,7 +55,7 @@ type OrgClubUserUpdateReq struct {
func
(
s
*
OrgClubUserUpdateReq
)
Generate
(
model
*
models
.
OrgClubUser
)
{
func
(
s
*
OrgClubUserUpdateReq
)
Generate
(
model
*
models
.
OrgClubUser
)
{
if
s
.
Id
==
0
{
if
s
.
Id
==
0
{
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
}
}
model
.
UserId
=
s
.
UserId
model
.
UserId
=
s
.
UserId
model
.
ClubId
=
s
.
ClubId
model
.
ClubId
=
s
.
ClubId
...
@@ -69,6 +69,7 @@ func (s *OrgClubUserUpdateReq) GetId() interface{} {
...
@@ -69,6 +69,7 @@ func (s *OrgClubUserUpdateReq) GetId() interface{} {
type
OrgClubUserGetReq
struct
{
type
OrgClubUserGetReq
struct
{
Id
int
`uri:"id"`
Id
int
`uri:"id"`
}
}
func
(
s
*
OrgClubUserGetReq
)
GetId
()
interface
{}
{
func
(
s
*
OrgClubUserGetReq
)
GetId
()
interface
{}
{
return
s
.
Id
return
s
.
Id
}
}
...
...
app/operate/service/dto/org_team.go
View file @
f4300b15
...
@@ -12,7 +12,8 @@ type OrgTeamGetPageReq struct {
...
@@ -12,7 +12,8 @@ type OrgTeamGetPageReq struct {
OrgTeamOrder
OrgTeamOrder
}
}
type
OrgTeamOrder
struct
{
Id
int
`form:"idOrder" search:"type:order;column:id;table:org_team"`
type
OrgTeamOrder
struct
{
Id
int
`form:"idOrder" search:"type:order;column:id;table:org_team"`
ClubId
string
`form:"clubIdOrder" search:"type:order;column:club_id;table:org_team"`
ClubId
string
`form:"clubIdOrder" search:"type:order;column:club_id;table:org_team"`
TeamName
string
`form:"teamNameOrder" search:"type:order;column:team_name;table:org_team"`
TeamName
string
`form:"teamNameOrder" search:"type:order;column:team_name;table:org_team"`
CreateBy
string
`form:"createByOrder" search:"type:order;column:create_by;table:org_team"`
CreateBy
string
`form:"createByOrder" search:"type:order;column:create_by;table:org_team"`
...
@@ -20,7 +21,6 @@ type OrgTeamOrder struct {Id int `form:"idOrder" search:"type:order;column:id;t
...
@@ -20,7 +21,6 @@ type OrgTeamOrder struct {Id int `form:"idOrder" search:"type:order;column:id;t
CreatedAt
time
.
Time
`form:"createdAtOrder" search:"type:order;column:created_at;table:org_team"`
CreatedAt
time
.
Time
`form:"createdAtOrder" search:"type:order;column:created_at;table:org_team"`
UpdatedAt
time
.
Time
`form:"updatedAtOrder" search:"type:order;column:updated_at;table:org_team"`
UpdatedAt
time
.
Time
`form:"updatedAtOrder" search:"type:order;column:updated_at;table:org_team"`
DeletedAt
time
.
Time
`form:"deletedAtOrder" search:"type:order;column:deleted_at;table:org_team"`
DeletedAt
time
.
Time
`form:"deletedAtOrder" search:"type:order;column:deleted_at;table:org_team"`
}
}
func
(
m
*
OrgTeamGetPageReq
)
GetNeedSearch
()
interface
{}
{
func
(
m
*
OrgTeamGetPageReq
)
GetNeedSearch
()
interface
{}
{
...
@@ -36,7 +36,7 @@ type OrgTeamInsertReq struct {
...
@@ -36,7 +36,7 @@ type OrgTeamInsertReq struct {
func
(
s
*
OrgTeamInsertReq
)
Generate
(
model
*
models
.
OrgTeam
)
{
func
(
s
*
OrgTeamInsertReq
)
Generate
(
model
*
models
.
OrgTeam
)
{
if
s
.
Id
==
0
{
if
s
.
Id
==
0
{
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
}
}
model
.
ClubId
=
s
.
ClubId
model
.
ClubId
=
s
.
ClubId
model
.
TeamName
=
s
.
TeamName
model
.
TeamName
=
s
.
TeamName
...
@@ -55,7 +55,7 @@ type OrgTeamUpdateReq struct {
...
@@ -55,7 +55,7 @@ type OrgTeamUpdateReq struct {
func
(
s
*
OrgTeamUpdateReq
)
Generate
(
model
*
models
.
OrgTeam
)
{
func
(
s
*
OrgTeamUpdateReq
)
Generate
(
model
*
models
.
OrgTeam
)
{
if
s
.
Id
==
0
{
if
s
.
Id
==
0
{
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
}
}
model
.
ClubId
=
s
.
ClubId
model
.
ClubId
=
s
.
ClubId
model
.
TeamName
=
s
.
TeamName
model
.
TeamName
=
s
.
TeamName
...
@@ -69,6 +69,13 @@ func (s *OrgTeamUpdateReq) GetId() interface{} {
...
@@ -69,6 +69,13 @@ func (s *OrgTeamUpdateReq) GetId() interface{} {
type
OrgTeamGetReq
struct
{
type
OrgTeamGetReq
struct
{
Id
int
`uri:"id"`
Id
int
`uri:"id"`
}
}
type
OrgTeamGetReply
struct
{
ClubId
string
`json:"club_id"`
ClubName
string
`json:"club_name"`
TeamName
string
`json:"team_name"`
}
func
(
s
*
OrgTeamGetReq
)
GetId
()
interface
{}
{
func
(
s
*
OrgTeamGetReq
)
GetId
()
interface
{}
{
return
s
.
Id
return
s
.
Id
}
}
...
...
app/operate/service/dto/org_team_player.go
0 → 100644
View file @
f4300b15
package
dto
import
(
"go-admin/common/dto"
)
type
OrgTeamPlayerGetPageReq
struct
{
dto
.
Pagination
`search:"-"`
LeagueId
string
`form:"leagueId" search:"type:exact;column:league_id;table:om" comment:"联赛级别id"`
//联赛级别id
DivisionId
string
`form:"divisionId" search:"type:exact;column:division_id;table:om" comment:"赛区id"`
//赛区id
SeasonId
string
`form:"seasonId" search:"type:exact;column:season_id;table:om" comment:"赛季id"`
//赛季id
Rounds
string
`form:"rounds" search:"type:exact;column:rounds;table:omtp" comment:"轮次"`
//轮次
PlayerName
string
`form:"playerName" search:"type:contains;column:player_name;table:omtp" comment:"球员名称"`
//球员名称
}
type
OrgTeamPlayerGetPageReply
struct
{
Id
string
`json:"id"`
Rank
string
`json:"rank"`
LeagueName
string
`json:"leagueName"`
SeasonName
string
`json:"seasonName"`
Rounds
string
`json:"rounds"`
PlayerName
string
`json:"playerName"`
PlayerNumber
string
`json:"playerNumber" comment:"球衣号码"`
Position
string
`json:"position" comment:"场上位置"`
dto
.
TotalScoring
}
type
GetPageMatchTeamPlayerReq
struct
{
Id
string
`form:"id" json:"id"`
}
type
GetPageMatchTeamPlayerReply
struct
{
MatchInfo
dto
.
PageMatchInfo
`json:"matchInfo"`
TotalScoring
[]
dto
.
TotalScoring
`json:"totalScoring"`
RoundsScoring
[]
dto
.
RoundsScoring
`json:"roundsScoring"`
}
func
(
m
*
OrgTeamPlayerGetPageReq
)
GetNeedSearch
()
interface
{}
{
return
*
m
}
// OrgMatchEvaluateGetReq 功能获取请求参数
type
OrgTeamPlayerGetReq
struct
{
Id
int
`uri:"id"`
}
type
OrgTeamPlayerGetReply
struct
{
MatchInfo
dto
.
PageMatchInfo
`json:"matchInfo"`
RoundsScoring
[]
dto
.
RoundsScoring
`json:"roundsScoring"`
}
func
(
s
*
OrgTeamPlayerGetReq
)
GetId
()
interface
{}
{
return
s
.
Id
}
app/operate/service/dto/org_team_team.go
0 → 100644
View file @
f4300b15
package
dto
import
(
"go-admin/app/operate/models"
"go-admin/common/dto"
)
type
OrgTeamTeamGetPageReq
struct
{
dto
.
Pagination
`search:"-"`
TeamId
string
`form:"teamId" search:"type:exact;column:team_id;table:ot" comment:""`
LeagueId
string
`form:"leagueId" search:"type:exact;column:league_id;table:om" comment:""`
DivisionId
string
`form:"divisionId" search:"type:exact;column:division_id;table:om" comment:""`
SeasonId
string
`form:"seasonId" search:"type:exact;column:season_id;table:om" comment:""`
Rounds
string
`form:"rounds" search:"type:exact;column:rounds;table:om" comment:""`
}
type
OrgTeamTeamGetPageReply
struct
{
TeamId
string
`json:"teamId"`
Rank
string
`json:"rank"`
LeagueName
string
`json:"leagueName"`
DivisionName
string
`json:"divisionName"`
SeasonName
string
`json:"seasonName"`
Rounds
string
`json:"rounds"`
dto
.
TotalScoring
}
type
OrgTeamTeamGetInfoReq
struct
{
}
type
OrgTeamTeamGetInfoReply
struct
{
OrgMatch
models
.
OrgMatch
`form:"orgMatch"`
OrgLeagueList
[]
models
.
OrgLeague
`form:"orgLeagueList"`
OrgSeasonList
[]
models
.
OrgSeason
`form:"orgSeasonList"`
OrgDivisionList
[]
models
.
OrgDivision
`form:"orgDivisionList"`
OrgTeamList
[]
models
.
OrgTeam
`form:"orgTeamList"`
}
func
(
m
*
OrgTeamTeamGetPageReq
)
GetNeedSearch
()
interface
{}
{
return
*
m
}
// OrgMatchGetReq 功能获取请求参数
type
OrgTeamTeamGetReq
struct
{
TeamId
int
`form:"teamId" json:"teamId"`
Rounds
int
`form:"rounds" json:"rounds"`
}
type
OrgTeamTeamGetReply
struct
{
OrgMatch
models
.
OrgMatch
`form:"orgMatch" json:"orgMatch"`
OrgMatchTeamAPlayer
[]
models
.
OrgMatchTeamPlayer
`form:"orgMatchTeamAPlayer" json:"orgMatchTeamAPlayer"`
OrgMatchTeamBPlayer
[]
models
.
OrgMatchTeamPlayer
`form:"orgMatchTeamBPlayer" json:"orgMatchTeamBPlayer"`
}
func
(
s
*
OrgTeamTeamGetReq
)
GetId
()
interface
{}
{
return
s
.
TeamId
}
type
GetPageMatchTeamTeamReq
struct
{
TeamId
int
`form:"teamId" json:"teamId"`
}
type
GetPageMatchTeamTeamReply
struct
{
MatchInfo
dto
.
PageMatchInfo
`json:"matchInfo"`
TotalScoring
[]
dto
.
TotalScoring
`json:"totalScoring"`
RoundsScoring
[]
dto
.
RoundsScoring
`json:"roundsScoring"`
}
app/operate/service/dto/org_team_user.go
View file @
f4300b15
...
@@ -4,28 +4,23 @@ import (
...
@@ -4,28 +4,23 @@ import (
"go-admin/app/operate/models"
"go-admin/app/operate/models"
"go-admin/common/dto"
"go-admin/common/dto"
common
"go-admin/common/models"
common
"go-admin/common/models"
"time"
)
)
type
OrgTeamUserGetPageReq
struct
{
type
OrgTeamUserGetPageReq
struct
{
dto
.
Pagination
`search:"-"`
dto
.
Pagination
`search:"-"`
OrgTeamUserOrder
TeamName
string
`form:"teamName" search:"type:contains;column:team_name;table:ot" comment:"球队名称"`
//球队名称
Name
string
`form:"name" search:"type:contains;column:name;table:otu" comment:"姓名"`
//姓名
Status
string
`form:"status" search:"type:exact;column:status;table:su" comment:"状态"`
//状态
}
}
type
OrgTeamUserOrder
struct
{
Id
int
`form:"idOrder" search:"type:order;column:id;table:org_team_user"`
type
OrgTeamUserGetPageReply
struct
{
ClubId
string
`form:"clubIdOrder" search:"type:order;column:club_id;table:org_team_user"`
Id
string
`json:"id"`
TeamId
string
`form:"teamIdOrder" search:"type:order;column:team_id;table:org_team_user"`
ClubName
string
`json:"clubName"`
UserId
string
`form:"userIdOrder" search:"type:order;column:user_id;table:org_team_user"`
TeamName
string
`json:"teamName"`
Name
string
`form:"nameOrder" search:"type:order;column:name;table:org_team_user"`
Name
string
`json:"name"`
Sex
string
`form:"sexOrder" search:"type:order;column:sex;table:org_team_user"`
Sex
string
`json:"sex"`
UserImg
string
`form:"userImgOrder" search:"type:order;column:user_img;table:org_team_user"`
RoleName
string
`json:"roleName"`
SignImg
string
`form:"signImgOrder" search:"type:order;column:sign_img;table:org_team_user"`
Status
string
`json:"status"`
CreateBy
string
`form:"createByOrder" search:"type:order;column:create_by;table:org_team_user"`
UpdateBy
string
`form:"updateByOrder" search:"type:order;column:update_by;table:org_team_user"`
CreatedAt
time
.
Time
`form:"createdAtOrder" search:"type:order;column:created_at;table:org_team_user"`
UpdatedAt
time
.
Time
`form:"updatedAtOrder" search:"type:order;column:updated_at;table:org_team_user"`
DeletedAt
time
.
Time
`form:"deletedAtOrder" search:"type:order;column:deleted_at;table:org_team_user"`
}
}
func
(
m
*
OrgTeamUserGetPageReq
)
GetNeedSearch
()
interface
{}
{
func
(
m
*
OrgTeamUserGetPageReq
)
GetNeedSearch
()
interface
{}
{
...
@@ -46,7 +41,7 @@ type OrgTeamUserInsertReq struct {
...
@@ -46,7 +41,7 @@ type OrgTeamUserInsertReq struct {
func
(
s
*
OrgTeamUserInsertReq
)
Generate
(
model
*
models
.
OrgTeamUser
)
{
func
(
s
*
OrgTeamUserInsertReq
)
Generate
(
model
*
models
.
OrgTeamUser
)
{
if
s
.
Id
==
0
{
if
s
.
Id
==
0
{
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
}
}
model
.
ClubId
=
s
.
ClubId
model
.
ClubId
=
s
.
ClubId
model
.
TeamId
=
s
.
TeamId
model
.
TeamId
=
s
.
TeamId
...
@@ -75,7 +70,7 @@ type OrgTeamUserUpdateReq struct {
...
@@ -75,7 +70,7 @@ type OrgTeamUserUpdateReq struct {
func
(
s
*
OrgTeamUserUpdateReq
)
Generate
(
model
*
models
.
OrgTeamUser
)
{
func
(
s
*
OrgTeamUserUpdateReq
)
Generate
(
model
*
models
.
OrgTeamUser
)
{
if
s
.
Id
==
0
{
if
s
.
Id
==
0
{
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
}
}
model
.
ClubId
=
s
.
ClubId
model
.
ClubId
=
s
.
ClubId
model
.
TeamId
=
s
.
TeamId
model
.
TeamId
=
s
.
TeamId
...
@@ -94,6 +89,22 @@ func (s *OrgTeamUserUpdateReq) GetId() interface{} {
...
@@ -94,6 +89,22 @@ func (s *OrgTeamUserUpdateReq) GetId() interface{} {
type
OrgTeamUserGetReq
struct
{
type
OrgTeamUserGetReq
struct
{
Id
int
`uri:"id"`
Id
int
`uri:"id"`
}
}
type
OrgTeamUserGetReply
struct
{
Id
string
`json:"id"`
ClubName
string
`json:"clubName"`
TeamId
string
`json:"teamId"`
TeamName
string
`json:"teamName"`
Name
string
`json:"name"`
Sex
string
`json:"sex"`
UserImg
string
`json:"userImg" comment:"用户照片"`
SignImg
string
`json:"signImg" comment:"签名照片"`
RoleId
string
`json:"roleId"`
RoleName
string
`json:"roleName"`
Username
string
`json:"username"`
Status
string
`json:"status"`
}
func
(
s
*
OrgTeamUserGetReq
)
GetId
()
interface
{}
{
func
(
s
*
OrgTeamUserGetReq
)
GetId
()
interface
{}
{
return
s
.
Id
return
s
.
Id
}
}
...
...
app/operate/service/org_club.go
View file @
f4300b15
app/operate/service/org_club_player.go
0 → 100644
View file @
f4300b15
This diff is collapsed.
Click to expand it.
app/operate/service/org_club_team.go
0 → 100644
View file @
f4300b15
This diff is collapsed.
Click to expand it.
app/operate/service/org_club_user.go
View file @
f4300b15
...
@@ -57,6 +57,34 @@ func (e *OrgClubUser) Get(d *dto.OrgClubUserGetReq, p *actions.DataPermission, m
...
@@ -57,6 +57,34 @@ func (e *OrgClubUser) Get(d *dto.OrgClubUserGetReq, p *actions.DataPermission, m
return
nil
return
nil
}
}
// Get 获取OrgClubUser对象
func
(
e
*
OrgClubUser
)
GetUserId
(
clubId
int
)
(
error
,
string
)
{
var
data
models
.
OrgClubUser
err
:=
e
.
Orm
.
Table
(
"org_club_user"
)
.
Where
(
"club_id=?"
,
clubId
)
.
First
(
data
)
.
Error
if
err
!=
nil
{
e
.
Log
.
Errorf
(
"db error:%s"
,
err
)
return
err
,
""
}
return
nil
,
data
.
UserId
}
// Get 获取OrgClubUser对象
func
(
e
*
OrgClubUser
)
GetClubId
(
userId
int
)
(
error
,
string
)
{
var
data
models
.
OrgClubUser
err
:=
e
.
Orm
.
Table
(
"org_club_user"
)
.
Where
(
"user_id=?"
,
userId
)
.
First
(
data
)
.
Error
if
err
!=
nil
{
e
.
Log
.
Errorf
(
"db error:%s"
,
err
)
return
err
,
""
}
return
nil
,
data
.
ClubId
}
// Insert 创建OrgClubUser对象
// Insert 创建OrgClubUser对象
func
(
e
*
OrgClubUser
)
Insert
(
c
*
dto
.
OrgClubUserInsertReq
)
error
{
func
(
e
*
OrgClubUser
)
Insert
(
c
*
dto
.
OrgClubUserInsertReq
)
error
{
var
err
error
var
err
error
...
...
app/operate/service/org_match_evaluate.go
View file @
f4300b15
...
@@ -24,7 +24,7 @@ func (e *OrgMatchEvaluate) GetPage(c *dto.OrgMatchEvaluateGetPageReq, p *actions
...
@@ -24,7 +24,7 @@ func (e *OrgMatchEvaluate) GetPage(c *dto.OrgMatchEvaluateGetPageReq, p *actions
err
=
e
.
Orm
.
Table
(
"org_match_team_player as omtp"
)
.
err
=
e
.
Orm
.
Table
(
"org_match_team_player as omtp"
)
.
Select
(
"omtp.id, ol.league_name, od.division_name, os.season_name, om.rounds, omtp.player_name, om.match_start_time, om.match_end_time, ome.mv_status, ome.status, ome.remark"
)
.
Select
(
"omtp.id, ol.league_name, od.division_name, os.season_name, om.rounds, omtp.player_name, om.match_start_time, om.match_end_time, ome.mv_status, ome.status, ome.remark"
)
.
Joins
(
"left join org_match_evaluate as ome on omtp.player_id = ome.player_id"
)
.
Joins
(
"left join org_match_evaluate as ome on omtp.player_id = ome.player_id"
)
.
Joins
(
"left join org_match as om on omtp.match_id = om.id"
)
.
Joins
(
"left join org_match as om on omtp.match_id = om.id
and omtp.rounds = om.rounds
"
)
.
Joins
(
"left join org_league as ol on ol.id = om.league_id"
)
.
Joins
(
"left join org_league as ol on ol.id = om.league_id"
)
.
Joins
(
"left join org_division as od on od.id = om.division_id"
)
.
Joins
(
"left join org_division as od on od.id = om.division_id"
)
.
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"
)
.
...
@@ -55,7 +55,7 @@ func (e *OrgMatchEvaluate) GetMatchInfo(id string, p *actions.DataPermission, da
...
@@ -55,7 +55,7 @@ func (e *OrgMatchEvaluate) GetMatchInfo(id string, p *actions.DataPermission, da
Joins
(
"left join org_match_evaluate as ome on omtp.player_id = ome.player_id"
)
.
Joins
(
"left join org_match_evaluate as ome on omtp.player_id = ome.player_id"
)
.
Joins
(
"left join org_club as oc on omtp.club_id = oc.id"
)
.
Joins
(
"left join org_club as oc on omtp.club_id = oc.id"
)
.
Joins
(
"left join org_team as ot on omtp.team_id = ot.id"
)
.
Joins
(
"left join org_team as ot on omtp.team_id = ot.id"
)
.
Joins
(
"left join org_match as om on omtp.match_id = om.id"
)
.
Joins
(
"left join org_match as om on omtp.match_id = om.id
and omtp.rounds = om.rounds
"
)
.
Joins
(
"left join org_league as ol on ol.id = om.league_id"
)
.
Joins
(
"left join org_league as ol on ol.id = om.league_id"
)
.
Joins
(
"left join org_division as od on od.id = om.division_id"
)
.
Joins
(
"left join org_division as od on od.id = om.division_id"
)
.
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"
)
.
...
@@ -79,7 +79,7 @@ func (e *OrgMatchEvaluate) GetRoundsScoring(playerId string, rounds string, team
...
@@ -79,7 +79,7 @@ func (e *OrgMatchEvaluate) GetRoundsScoring(playerId string, rounds string, team
Select
(
"omtp.id, om.match_start_time, om.rounds, om.grouping, ot.team_name as other_team, "
+
Select
(
"omtp.id, om.match_start_time, om.rounds, om.grouping, ot.team_name as other_team, "
+
"omtp.scoring, omtp.scoring, omtp.rebound, omtp.assist, omtp.steal, omtp.free_throw, "
+
"omtp.scoring, omtp.scoring, omtp.rebound, omtp.assist, omtp.steal, omtp.free_throw, "
+
"omtp.block_shot, omtp.foul, omtp.two_point_shot, omtp.three_point_shot"
)
.
"omtp.block_shot, omtp.foul, omtp.two_point_shot, omtp.three_point_shot"
)
.
Joins
(
"left join org_match as om on omtp.match_id = om.id"
)
.
Joins
(
"left join org_match as om on omtp.match_id = om.id
and omtp.rounds = om.rounds
"
)
.
Joins
(
"left join org_team as ot on omtp.other_team_id = ot.id"
)
.
Joins
(
"left join org_team as ot on omtp.other_team_id = ot.id"
)
.
Scopes
(
Scopes
(
cDto
.
SetWhere
(
"omtp"
,
"player_id"
,
playerId
),
cDto
.
SetWhere
(
"omtp"
,
"player_id"
,
playerId
),
...
@@ -123,7 +123,7 @@ func (e *OrgMatchEvaluate) statisticsScoring(playerId string, rounds string, sea
...
@@ -123,7 +123,7 @@ func (e *OrgMatchEvaluate) statisticsScoring(playerId string, rounds string, sea
}
}
err
=
e
.
Orm
.
Table
(
"org_match_team_player as omtp"
)
.
err
=
e
.
Orm
.
Table
(
"org_match_team_player as omtp"
)
.
Joins
(
"left join org_match as om on omtp.match_id = om.id"
)
.
Joins
(
"left join org_match as om on omtp.match_id = om.id
and omtp.rounds = om.rounds
"
)
.
Select
(
field
)
.
Select
(
field
)
.
Where
(
"omtp.player_id = ?"
,
playerId
)
.
Where
(
"omtp.player_id = ?"
,
playerId
)
.
Where
(
"omtp.rounds = ?"
,
rounds
)
.
Where
(
"omtp.rounds = ?"
,
rounds
)
.
...
...
app/operate/service/org_team_player.go
0 → 100644
View file @
f4300b15
This diff is collapsed.
Click to expand it.
app/operate/service/org_team_team.go
0 → 100644
View file @
f4300b15
This diff is collapsed.
Click to expand it.
app/operate/service/org_team_user.go
View file @
f4300b15
...
@@ -17,11 +17,17 @@ type OrgTeamUser struct {
...
@@ -17,11 +17,17 @@ type OrgTeamUser struct {
}
}
// GetPage 获取OrgTeamUser列表
// GetPage 获取OrgTeamUser列表
func
(
e
*
OrgTeamUser
)
GetPage
(
c
*
dto
.
OrgTeamUserGetPageReq
,
p
*
actions
.
DataPermission
,
list
*
[]
models
.
OrgTeamUser
,
count
*
int64
)
error
{
func
(
e
*
OrgTeamUser
)
GetPage
(
c
*
dto
.
OrgTeamUserGetPageReq
,
p
*
actions
.
DataPermission
,
list
*
[]
dto
.
OrgTeamUserGetPageReply
,
count
*
int64
)
error
{
var
err
error
var
err
error
var
data
models
.
OrgTeamUser
var
data
models
.
OrgTeamUser
field
:=
"oc.club_name, ot.team_name, otu.name, otu.sex, sr.role_name, su.status"
err
=
e
.
Orm
.
Model
(
&
data
)
.
err
=
e
.
Orm
.
Table
(
"org_team_user as otu"
)
.
Select
(
field
)
.
Joins
(
"org_team as ot on otu.team_id=ot.id"
)
.
Joins
(
"org_club as oc on otu.club_id=oc.id"
)
.
Joins
(
"sys_user as su on otu.user_id=su.user_id"
)
.
Joins
(
"sys_role as sr on su.role_id=sr.role_id"
)
.
Scopes
(
Scopes
(
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
...
@@ -38,12 +44,14 @@ func (e *OrgTeamUser) GetPage(c *dto.OrgTeamUserGetPageReq, p *actions.DataPermi
...
@@ -38,12 +44,14 @@ func (e *OrgTeamUser) GetPage(c *dto.OrgTeamUserGetPageReq, p *actions.DataPermi
// Get 获取OrgTeamUser对象
// Get 获取OrgTeamUser对象
func
(
e
*
OrgTeamUser
)
Get
(
d
*
dto
.
OrgTeamUserGetReq
,
p
*
actions
.
DataPermission
,
model
*
models
.
OrgTeamUser
)
error
{
func
(
e
*
OrgTeamUser
)
Get
(
d
*
dto
.
OrgTeamUserGetReq
,
p
*
actions
.
DataPermission
,
model
*
models
.
OrgTeamUser
)
error
{
var
data
models
.
OrgTeamUser
field
:=
"oc.club_name, ot.team_id, ot.team_name, otu.name, otu.sex, otu.user_img, otu.sign_img, sr.role_id, sr.role_name, su.username, su.status"
err
:=
e
.
Orm
.
Model
(
&
data
)
.
err
:=
e
.
Orm
.
Table
(
"org_team_user as otu"
)
.
Scopes
(
Select
(
field
)
.
actions
.
Permission
(
data
.
TableName
(),
p
),
Joins
(
"org_team as ot on otu.team_id=ot.id"
)
.
)
.
Joins
(
"org_club as oc on otu.club_id=oc.id"
)
.
Joins
(
"sys_user as su on otu.user_id=su.id"
)
.
Joins
(
"sys_role as sr on su.role_id=sr.role_id"
)
.
First
(
model
,
d
.
GetId
())
.
Error
First
(
model
,
d
.
GetId
())
.
Error
if
err
!=
nil
&&
errors
.
Is
(
err
,
gorm
.
ErrRecordNotFound
)
{
if
err
!=
nil
&&
errors
.
Is
(
err
,
gorm
.
ErrRecordNotFound
)
{
err
=
errors
.
New
(
"查看对象不存在或无权查看"
)
err
=
errors
.
New
(
"查看对象不存在或无权查看"
)
...
...
common/dto/match.go
View file @
f4300b15
...
@@ -10,6 +10,7 @@ type PageMatchInfo struct {
...
@@ -10,6 +10,7 @@ type PageMatchInfo struct {
SeasonName
string
`json:"seasonName"`
SeasonName
string
`json:"seasonName"`
Rounds
string
`json:"rounds"`
Rounds
string
`json:"rounds"`
ClubName
string
`json:"clubName"`
ClubName
string
`json:"clubName"`
TeamId
string
`json:"teamId"`
TeamName
string
`json:"teamName"`
TeamName
string
`json:"teamName"`
PlayerId
string
`json:"playerId"`
PlayerId
string
`json:"playerId"`
PlayerName
string
`json:"playerName"`
PlayerName
string
`json:"playerName"`
...
...
common/utils/common.go
0 → 100644
View file @
f4300b15
package
utils
import
"strconv"
func
StringToInt
(
data
string
)
int
{
reply
,
_
:=
strconv
.
Atoi
(
data
)
return
reply
}
func
GetAvg
(
data
string
,
count
int64
)
string
{
return
strconv
.
Itoa
(
StringToInt
(
data
)
/
int
(
count
))
}
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