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
c00a1323
Commit
c00a1323
authored
3 years ago
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msg
parent
70e23168
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
186 additions
and
104 deletions
+186
-104
org_player_user.go
app/mobile/apis/org_player_user.go
+7
-2
org_match_evaluate.go
app/operate/apis/org_match_evaluate.go
+75
-12
org_match_evaluate.go
app/operate/service/dto/org_match_evaluate.go
+15
-19
org_match_evaluate.go
app/operate/service/org_match_evaluate.go
+40
-23
org_match_evaluate_wonderful.go
app/operate/service/org_match_evaluate_wonderful.go
+25
-27
match.go
common/dto/match.go
+24
-21
No files found.
app/mobile/apis/org_player_user.go
View file @
c00a1323
...
@@ -70,10 +70,15 @@ func (e OrgPlayerUser) GetMsg(c *gin.Context) {
...
@@ -70,10 +70,15 @@ func (e OrgPlayerUser) GetMsg(c *gin.Context) {
smsText
:=
"您的验证码为:"
+
code
smsText
:=
"您的验证码为:"
+
code
if
result
:=
utils
.
SendMobileMsg
(
req
.
Username
,
smsText
);
result
.
Status
==
0
{
if
result
:=
utils
.
SendMobileMsg
(
req
.
Username
,
smsText
);
result
.
Status
==
0
{
reply
:=
new
(
dto
.
GetMsgReply
)
e
.
OK
(
reply
,
"发送成功"
)
return
}
else
{
e
.
Logger
.
Error
(
err
)
e
.
Error
(
500
,
err
,
"发送失败"
)
return
return
}
}
reply
:=
new
(
dto
.
GetMsgReply
)
e
.
OK
(
reply
,
"查询成功"
)
}
}
// GetPage 获取球员账户信息列表
// GetPage 获取球员账户信息列表
...
...
This diff is collapsed.
Click to expand it.
app/operate/apis/org_match_evaluate.go
View file @
c00a1323
...
@@ -83,13 +83,29 @@ func (e OrgMatchEvaluate) GetPageMatch(c *gin.Context) {
...
@@ -83,13 +83,29 @@ func (e OrgMatchEvaluate) GetPageMatch(c *gin.Context) {
reply
:=
new
(
dto
.
GetPageMatchReply
)
reply
:=
new
(
dto
.
GetPageMatchReply
)
replyGetMatchInfo
:=
new
(
cDto
.
PageMatchInfo
)
replyGetMatchInfo
:=
new
(
cDto
.
PageMatchInfo
)
err
=
s
.
GetMatchInfo
(
req
.
Id
,
p
,
replyGetMatchInfo
)
err
=
s
.
GetMatchInfo
(
strconv
.
Itoa
(
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
reply
.
MatchInfo
=
*
replyGetMatchInfo
imgList
:=
make
([]
cDto
.
Wonderful
,
0
)
err
=
s
.
GetPageWonderful
(
replyGetMatchInfo
.
EvaluateId
,
&
imgList
,
1
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
.
MatchImg
=
imgList
mvList
:=
make
([]
cDto
.
Wonderful
,
0
)
err
=
s
.
GetPageWonderful
(
replyGetMatchInfo
.
EvaluateId
,
&
imgList
,
2
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
.
MatchMv
=
mvList
replyGetRoundsScoring
:=
make
([]
cDto
.
RoundsScoring
,
0
)
replyGetRoundsScoring
:=
make
([]
cDto
.
RoundsScoring
,
0
)
err
=
s
.
GetRoundsScoring
(
replyGetMatchInfo
.
PlayerId
,
replyGetMatchInfo
.
Rounds
,
"0"
,
&
replyGetRoundsScoring
)
err
=
s
.
GetRoundsScoring
(
replyGetMatchInfo
.
PlayerId
,
replyGetMatchInfo
.
Rounds
,
"0"
,
&
replyGetRoundsScoring
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -181,25 +197,72 @@ func (e OrgMatchEvaluate) Update(c *gin.Context) {
...
@@ -181,25 +197,72 @@ func (e OrgMatchEvaluate) Update(c *gin.Context) {
p
:=
actions
.
GetPermissionFromContext
(
c
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
err
,
playerId
:=
s
.
IsBeing
(
req
.
MatchId
,
req
.
Rounds
,
req
.
PlayerId
)
err
,
playerId
:=
s
.
IsBeing
(
req
.
MatchId
,
req
.
Rounds
,
req
.
PlayerId
)
eId
:=
0
if
playerId
==
0
{
if
playerId
==
0
{
reqInsertData
:=
dto
.
OrgMatchEvaluateInsertReq
{
reqInsertData
:=
dto
.
OrgMatchEvaluateInsertReq
{
MatchId
:
req
.
MatchId
,
MatchId
:
req
.
MatchId
,
Rounds
:
req
.
Rounds
,
Rounds
:
req
.
Rounds
,
PlayerId
:
req
.
PlayerId
,
PlayerId
:
req
.
PlayerId
,
WonderfulMomentImg
:
req
.
WonderfulMomentImg
,
MvStatus
:
req
.
MvStatus
,
WonderfulMomentMv
:
req
.
WonderfulMomentMv
,
Status
:
req
.
Status
,
WonderfulMomentImgTitle
:
req
.
WonderfulMomentImgTitle
,
WonderfulMomentMvTitle
:
req
.
WonderfulMomentMvTitle
,
MvStatus
:
req
.
MvStatus
,
Status
:
req
.
Status
,
}
}
err
=
s
.
Insert
(
&
reqInsertData
)
err
,
eId
=
s
.
Insert
(
&
reqInsertData
)
}
else
{
}
else
{
err
=
s
.
Update
(
&
req
,
p
)
err
,
eId
=
s
.
Update
(
&
req
,
p
)
}
}
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
}
}
reqWonderfulInsert
:=
dto
.
OrgMatchEvaluateWonderfulInsertReq
{}
reqWonderfulUpdate
:=
dto
.
OrgMatchEvaluateWonderfulUpdateReq
{}
sWonderful
:=
service
.
OrgMatchEvaluateWonderful
{}
err
=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeService
(
&
sWonderful
.
Service
)
.
Errors
if
err
!=
nil
{
e
.
Logger
.
Error
(
err
)
e
.
Error
(
500
,
err
,
err
.
Error
())
return
}
for
_
,
v
:=
range
req
.
MatchImg
{
if
v
.
Id
!=
""
{
reqWonderfulUpdate
.
Id
,
_
=
strconv
.
Atoi
(
v
.
Id
)
reqWonderfulUpdate
.
WonderfulUrl
=
v
.
WonderfulUrl
reqWonderfulUpdate
.
WonderfulTitle
=
v
.
WonderfulTitle
reqWonderfulUpdate
.
SetUpdateBy
(
user
.
GetUserId
(
c
))
sWonderful
.
Update
(
&
reqWonderfulUpdate
)
}
else
{
reqWonderfulInsert
.
Type
=
"1"
reqWonderfulInsert
.
MatchEvaluateId
=
strconv
.
Itoa
(
eId
)
reqWonderfulInsert
.
WonderfulUrl
=
v
.
WonderfulUrl
reqWonderfulInsert
.
WonderfulTitle
=
v
.
WonderfulTitle
reqWonderfulInsert
.
SetCreateBy
(
user
.
GetUserId
(
c
))
sWonderful
.
Insert
(
&
reqWonderfulInsert
)
}
}
for
_
,
vMv
:=
range
req
.
MatchMv
{
if
vMv
.
Id
!=
""
{
reqWonderfulUpdate
.
Id
,
_
=
strconv
.
Atoi
(
vMv
.
Id
)
reqWonderfulUpdate
.
WonderfulUrl
=
vMv
.
WonderfulUrl
reqWonderfulUpdate
.
WonderfulTitle
=
vMv
.
WonderfulTitle
reqWonderfulUpdate
.
SetUpdateBy
(
user
.
GetUserId
(
c
))
sWonderful
.
Update
(
&
reqWonderfulUpdate
)
}
else
{
reqWonderfulInsert
.
Type
=
"1"
reqWonderfulInsert
.
MatchEvaluateId
=
strconv
.
Itoa
(
eId
)
reqWonderfulInsert
.
WonderfulUrl
=
vMv
.
WonderfulUrl
reqWonderfulInsert
.
WonderfulTitle
=
vMv
.
WonderfulTitle
reqWonderfulInsert
.
SetCreateBy
(
user
.
GetUserId
(
c
))
sWonderful
.
Insert
(
&
reqWonderfulInsert
)
}
}
e
.
OK
(
req
.
GetId
(),
"修改成功"
)
e
.
OK
(
req
.
GetId
(),
"修改成功"
)
}
}
This diff is collapsed.
Click to expand it.
app/operate/service/dto/org_match_evaluate.go
View file @
c00a1323
...
@@ -35,10 +35,12 @@ type OrgMatchEvaluateGetPageReply struct {
...
@@ -35,10 +35,12 @@ type OrgMatchEvaluateGetPageReply struct {
}
}
type
GetPageMatchReq
struct
{
type
GetPageMatchReq
struct
{
Id
string
`form:"id" json:"id"`
Id
int
`form:"id" json:"id"`
}
}
type
GetPageMatchReply
struct
{
type
GetPageMatchReply
struct
{
MatchInfo
dto
.
PageMatchInfo
`json:"matchInfo"`
MatchInfo
dto
.
PageMatchInfo
`json:"matchInfo"`
MatchImg
[]
dto
.
Wonderful
`json:"matchImg"`
MatchMv
[]
dto
.
Wonderful
`json:"matchMv"`
TotalScoring
[]
dto
.
TotalScoring
`json:"totalScoring"`
TotalScoring
[]
dto
.
TotalScoring
`json:"totalScoring"`
RoundsScoring
[]
dto
.
RoundsScoring
`json:"roundsScoring"`
RoundsScoring
[]
dto
.
RoundsScoring
`json:"roundsScoring"`
}
}
...
@@ -88,21 +90,19 @@ func (s *OrgMatchEvaluateInsertReq) GetId() interface{} {
...
@@ -88,21 +90,19 @@ func (s *OrgMatchEvaluateInsertReq) GetId() interface{} {
}
}
type
OrgMatchEvaluateUpdateReq
struct
{
type
OrgMatchEvaluateUpdateReq
struct
{
Id
int
`uri:"id" comment:""`
//
Id
int
`uri:"id" comment:""`
//
MatchId
string
`json:"matchId" comment:""`
MatchId
string
`json:"matchId" comment:""`
Rounds
string
`json:"rounds" comment:""`
Rounds
string
`json:"rounds" comment:""`
TeamUserId
string
`json:"teamUserId" comment:"org_team_user表id(教练id)"`
TeamUserId
string
`json:"teamUserId" comment:"org_team_user表id(教练id)"`
PlayerId
string
`json:"playerId" comment:"org_player表id(球员id)"`
PlayerId
string
`json:"playerId" comment:"org_player表id(球员id)"`
Content
string
`json:"content" comment:"教练评价内容"`
Content
string
`json:"content" comment:"教练评价内容"`
ContentStatus
string
`json:"contentStatus" comment:"教练评价状态 1 待评价 2 评价完成"`
ContentStatus
string
`json:"contentStatus" comment:"教练评价状态 1 待评价 2 评价完成"`
WonderfulMomentImg
string
`json:"wonderfulMomentImg" comment:"精彩时刻图"`
MvStatus
string
`json:"mvStatus" comment:"视频维护状态 1 待维护 2 维护完成 3 驳回 4 维护完成"`
WonderfulMomentMv
string
`json:"wonderfulMomentMv" comment:"精彩时刻视频"`
Status
string
`json:"status" comment:"发布状态 1 待审核 3 驳回 4 发布完成"`
WonderfulMomentImgTitle
string
`json:"wonderfulMomentImgTitle" comment:"精彩时刻图标题"`
Remark
string
`json:"remark" comment:"驳回原因"`
WonderfulMomentMvTitle
string
`json:"wonderfulMomentMvTitle" comment:"精彩时刻视频标题"`
MvStatus
string
`json:"mvStatus" comment:"视频维护状态 1 待维护 2 维护完成 3 驳回 4 维护完成"`
Status
string
`json:"status" comment:"发布状态 1 待审核 3 驳回 4 发布完成"`
Remark
string
`json:"remark" comment:"驳回原因"`
common
.
ControlBy
common
.
ControlBy
MatchImg
[]
dto
.
Wonderful
`json:"matchImg"`
MatchMv
[]
dto
.
Wonderful
`json:"matchMv"`
}
}
func
(
s
*
OrgMatchEvaluateUpdateReq
)
Generate
(
model
*
models
.
OrgMatchEvaluate
)
{
func
(
s
*
OrgMatchEvaluateUpdateReq
)
Generate
(
model
*
models
.
OrgMatchEvaluate
)
{
...
@@ -115,10 +115,6 @@ func (s *OrgMatchEvaluateUpdateReq) Generate(model *models.OrgMatchEvaluate) {
...
@@ -115,10 +115,6 @@ func (s *OrgMatchEvaluateUpdateReq) Generate(model *models.OrgMatchEvaluate) {
model
.
PlayerId
=
s
.
PlayerId
model
.
PlayerId
=
s
.
PlayerId
model
.
Content
=
s
.
Content
model
.
Content
=
s
.
Content
model
.
ContentStatus
=
s
.
ContentStatus
model
.
ContentStatus
=
s
.
ContentStatus
model
.
WonderfulMomentImg
=
s
.
WonderfulMomentImg
model
.
WonderfulMomentMv
=
s
.
WonderfulMomentMv
model
.
WonderfulMomentImgTitle
=
s
.
WonderfulMomentImgTitle
model
.
WonderfulMomentMvTitle
=
s
.
WonderfulMomentMvTitle
model
.
MvStatus
=
s
.
MvStatus
model
.
MvStatus
=
s
.
MvStatus
model
.
Status
=
s
.
Status
model
.
Status
=
s
.
Status
model
.
Remark
=
s
.
Remark
model
.
Remark
=
s
.
Remark
...
...
This diff is collapsed.
Click to expand it.
app/operate/service/org_match_evaluate.go
View file @
c00a1323
...
@@ -50,8 +50,9 @@ func (e *OrgMatchEvaluate) GetMatchInfo(id string, p *actions.DataPermission, da
...
@@ -50,8 +50,9 @@ func (e *OrgMatchEvaluate) GetMatchInfo(id string, p *actions.DataPermission, da
err
=
e
.
Orm
.
Table
(
"org_match_team_player as omtp"
)
.
err
=
e
.
Orm
.
Table
(
"org_match_team_player as omtp"
)
.
Select
(
"omtp.id, omtp.match_id, omtp.team_id, ol.league_name, od.division_name, os.season_name, om.rounds,"
+
Select
(
"omtp.id, omtp.match_id, omtp.team_id, ol.league_name, od.division_name, os.season_name, om.rounds,"
+
"oc.club_name, ot.team_name, omtp.player_name, omtp.player_number, omtp.position,"
+
"oc.club_name, ot.team_name, omtp.player_name, omtp.player_number, omtp.position,"
+
"omtp.player_id, om.season_id,"
+
"om
e.id as evaluate_id, om
tp.player_id, om.season_id,"
+
"ota.team_name as team_a_name, otb.team_name as team_b_name"
)
.
"ota.team_name as team_a_name, otb.team_name as team_b_name"
)
.
Joins
(
"left join org_match_evaluate as ome on omtp.match_id = ome.match_id and omtp.rounds=ome.rounds"
)
.
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 and omtp.rounds = om.rounds"
)
.
Joins
(
"left join org_match as om on omtp.match_id = om.id and omtp.rounds = om.rounds"
)
.
...
@@ -63,7 +64,8 @@ func (e *OrgMatchEvaluate) GetMatchInfo(id string, p *actions.DataPermission, da
...
@@ -63,7 +64,8 @@ func (e *OrgMatchEvaluate) GetMatchInfo(id string, p *actions.DataPermission, da
Scopes
(
Scopes
(
actions
.
Permission
(
"omtp"
,
p
),
actions
.
Permission
(
"omtp"
,
p
),
)
.
)
.
First
(
data
,
id
)
.
Error
Where
(
"omtp.id=?"
,
id
)
.
First
(
data
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
e
.
Log
.
Errorf
(
"OrgMatchService GetMatchInfo error:%s
\r\n
"
,
err
)
e
.
Log
.
Errorf
(
"OrgMatchService GetMatchInfo error:%s
\r\n
"
,
err
)
return
err
return
err
...
@@ -71,24 +73,17 @@ func (e *OrgMatchEvaluate) GetMatchInfo(id string, p *actions.DataPermission, da
...
@@ -71,24 +73,17 @@ func (e *OrgMatchEvaluate) GetMatchInfo(id string, p *actions.DataPermission, da
return
nil
return
nil
}
}
func
(
e
*
OrgMatchEvaluate
)
GetPageWonderful
(
c
*
dto
.
OrgMatchEvaluateGetPageReq
,
p
*
actions
.
DataPermission
,
list
*
[]
dto
.
OrgMatchEvaluateGetPageReply
,
count
*
int64
)
error
{
func
(
e
*
OrgMatchEvaluate
)
GetPageWonderful
(
evaluateId
string
,
list
*
[]
cDto
.
Wonderful
,
wType
int
)
error
{
var
err
error
var
err
error
err
=
e
.
Orm
.
Table
(
"org_match_team_player as omtp"
)
.
err
=
e
.
Orm
.
Table
(
"org_match_evaluate_wonderful as omew"
)
.
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.content_status, ome.mv_status, ome.status, ome.remark"
)
.
Select
(
"omew.id, omew.wonderful_url, omew.wonderful_title"
)
.
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 and omtp.rounds = om.rounds"
)
.
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_season as os on os.id = om.season_id"
)
.
Scopes
(
Scopes
(
cDto
.
MakeCondition
(
c
.
GetNeedSearch
()),
cDto
.
PassDel
(
"omew"
),
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
actions
.
Permission
(
"omtp"
,
p
),
cDto
.
PassDel
(
"omtp"
),
)
.
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
Where
(
"match_evaluate_id=?"
,
evaluateId
)
.
Count
(
count
)
.
Error
Where
(
"type=?"
,
wType
)
.
Find
(
list
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
e
.
Log
.
Errorf
(
"OrgMatchService GetPage error:%s
\r\n
"
,
err
)
e
.
Log
.
Errorf
(
"OrgMatchService GetPage error:%s
\r\n
"
,
err
)
return
err
return
err
...
@@ -347,20 +342,20 @@ func (e *OrgMatchEvaluate) Get(d *dto.OrgMatchEvaluateGetReq, p *actions.DataPer
...
@@ -347,20 +342,20 @@ func (e *OrgMatchEvaluate) Get(d *dto.OrgMatchEvaluateGetReq, p *actions.DataPer
}
}
// Insert 创建OrgMatchEvaluate对象
// Insert 创建OrgMatchEvaluate对象
func
(
e
*
OrgMatchEvaluate
)
Insert
(
c
*
dto
.
OrgMatchEvaluateInsertReq
)
error
{
func
(
e
*
OrgMatchEvaluate
)
Insert
(
c
*
dto
.
OrgMatchEvaluateInsertReq
)
(
error
,
int
)
{
var
err
error
var
err
error
var
data
models
.
OrgMatchEvaluate
var
data
models
.
OrgMatchEvaluate
c
.
Generate
(
&
data
)
c
.
Generate
(
&
data
)
err
=
e
.
Orm
.
Create
(
&
data
)
.
Error
err
=
e
.
Orm
.
Create
(
&
data
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
e
.
Log
.
Errorf
(
"OrgMatchEvaluateService Insert error:%s
\r\n
"
,
err
)
e
.
Log
.
Errorf
(
"OrgMatchEvaluateService Insert error:%s
\r\n
"
,
err
)
return
err
return
err
,
0
}
}
return
nil
return
nil
,
data
.
Id
}
}
// Update 修改OrgMatchEvaluate对象
// Update 修改OrgMatchEvaluate对象
func
(
e
*
OrgMatchEvaluate
)
Update
(
c
*
dto
.
OrgMatchEvaluateUpdateReq
,
p
*
actions
.
DataPermission
)
error
{
func
(
e
*
OrgMatchEvaluate
)
Update
(
c
*
dto
.
OrgMatchEvaluateUpdateReq
,
p
*
actions
.
DataPermission
)
(
error
,
int
)
{
var
err
error
var
err
error
var
data
=
models
.
OrgMatchEvaluate
{}
var
data
=
models
.
OrgMatchEvaluate
{}
e
.
Orm
.
Scopes
(
e
.
Orm
.
Scopes
(
...
@@ -369,6 +364,8 @@ func (e *OrgMatchEvaluate) Update(c *dto.OrgMatchEvaluateUpdateReq, p *actions.D
...
@@ -369,6 +364,8 @@ func (e *OrgMatchEvaluate) Update(c *dto.OrgMatchEvaluateUpdateReq, p *actions.D
cDto
.
SetWhere
(
""
,
"rounds"
,
c
.
Rounds
),
cDto
.
SetWhere
(
""
,
"rounds"
,
c
.
Rounds
),
cDto
.
SetWhere
(
""
,
"player_id"
,
c
.
PlayerId
),
cDto
.
SetWhere
(
""
,
"player_id"
,
c
.
PlayerId
),
)
.
First
(
&
data
)
)
.
First
(
&
data
)
id
:=
data
.
Id
c
.
Generate
(
&
data
)
c
.
Generate
(
&
data
)
db
:=
e
.
Orm
.
Scopes
(
db
:=
e
.
Orm
.
Scopes
(
...
@@ -379,12 +376,13 @@ func (e *OrgMatchEvaluate) Update(c *dto.OrgMatchEvaluateUpdateReq, p *actions.D
...
@@ -379,12 +376,13 @@ func (e *OrgMatchEvaluate) Update(c *dto.OrgMatchEvaluateUpdateReq, p *actions.D
)
.
Updates
(
&
data
)
)
.
Updates
(
&
data
)
if
db
.
Error
!=
nil
{
if
db
.
Error
!=
nil
{
e
.
Log
.
Errorf
(
"OrgMatchEvaluateService Save error:%s
\r\n
"
,
err
)
e
.
Log
.
Errorf
(
"OrgMatchEvaluateService Save error:%s
\r\n
"
,
err
)
return
err
return
err
,
0
}
}
if
db
.
RowsAffected
==
0
{
if
db
.
RowsAffected
==
0
{
return
errors
.
New
(
"无权更新该数据"
)
return
errors
.
New
(
"无权更新该数据"
)
,
0
}
}
return
nil
return
nil
,
id
}
}
// Remove 删除OrgMatchEvaluate
// Remove 删除OrgMatchEvaluate
...
@@ -425,3 +423,22 @@ func (e *OrgMatchEvaluate) IsBeing(matchId string, rounds string, playerId strin
...
@@ -425,3 +423,22 @@ func (e *OrgMatchEvaluate) IsBeing(matchId string, rounds string, playerId strin
}
}
return
nil
,
data
.
Id
return
nil
,
data
.
Id
}
}
// Insert 创建OrgMatchTeamPlayer对象
func
(
e
*
OrgMatchEvaluate
)
WonderfulIsBeing
(
id
string
)
(
error
,
int
)
{
var
data
models
.
OrgMatchEvaluate
err
:=
e
.
Orm
.
Table
(
"org_match_evaluate_wonderful"
)
.
Where
(
"id=?"
,
id
)
.
First
(
&
data
)
.
Error
if
err
!=
nil
&&
errors
.
Is
(
err
,
gorm
.
ErrRecordNotFound
)
{
err
=
errors
.
New
(
"查看对象不存在或无权查看"
)
e
.
Log
.
Errorf
(
"Service GetOrgMatchTeamPlayer error:%s
\r\n
"
,
err
)
return
err
,
0
}
if
err
!=
nil
{
e
.
Log
.
Errorf
(
"db error:%s"
,
err
)
return
err
,
0
}
return
nil
,
data
.
Id
}
This diff is collapsed.
Click to expand it.
app/operate/service/org_match_evaluate_wonderful.go
View file @
c00a1323
...
@@ -3,7 +3,7 @@ package service
...
@@ -3,7 +3,7 @@ package service
import
(
import
(
"errors"
"errors"
"github.com/go-admin-team/go-admin-core/sdk/service"
"github.com/go-admin-team/go-admin-core/sdk/service"
"gorm.io/gorm"
"gorm.io/gorm"
"go-admin/app/operate/models"
"go-admin/app/operate/models"
...
@@ -59,9 +59,9 @@ func (e *OrgMatchEvaluateWonderful) Get(d *dto.OrgMatchEvaluateWonderfulGetReq,
...
@@ -59,9 +59,9 @@ func (e *OrgMatchEvaluateWonderful) Get(d *dto.OrgMatchEvaluateWonderfulGetReq,
// Insert 创建OrgMatchEvaluateWonderful对象
// Insert 创建OrgMatchEvaluateWonderful对象
func
(
e
*
OrgMatchEvaluateWonderful
)
Insert
(
c
*
dto
.
OrgMatchEvaluateWonderfulInsertReq
)
error
{
func
(
e
*
OrgMatchEvaluateWonderful
)
Insert
(
c
*
dto
.
OrgMatchEvaluateWonderfulInsertReq
)
error
{
var
err
error
var
err
error
var
data
models
.
OrgMatchEvaluateWonderful
var
data
models
.
OrgMatchEvaluateWonderful
c
.
Generate
(
&
data
)
c
.
Generate
(
&
data
)
err
=
e
.
Orm
.
Create
(
&
data
)
.
Error
err
=
e
.
Orm
.
Create
(
&
data
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
e
.
Log
.
Errorf
(
"OrgMatchEvaluateWonderfulService Insert error:%s
\r\n
"
,
err
)
e
.
Log
.
Errorf
(
"OrgMatchEvaluateWonderfulService Insert error:%s
\r\n
"
,
err
)
...
@@ -71,23 +71,21 @@ func (e *OrgMatchEvaluateWonderful) Insert(c *dto.OrgMatchEvaluateWonderfulInser
...
@@ -71,23 +71,21 @@ func (e *OrgMatchEvaluateWonderful) Insert(c *dto.OrgMatchEvaluateWonderfulInser
}
}
// Update 修改OrgMatchEvaluateWonderful对象
// Update 修改OrgMatchEvaluateWonderful对象
func
(
e
*
OrgMatchEvaluateWonderful
)
Update
(
c
*
dto
.
OrgMatchEvaluateWonderfulUpdateReq
,
p
*
actions
.
DataPermission
)
error
{
func
(
e
*
OrgMatchEvaluateWonderful
)
Update
(
c
*
dto
.
OrgMatchEvaluateWonderfulUpdateReq
)
error
{
var
err
error
var
err
error
var
data
=
models
.
OrgMatchEvaluateWonderful
{}
var
data
=
models
.
OrgMatchEvaluateWonderful
{}
e
.
Orm
.
Scopes
(
e
.
Orm
.
First
(
&
data
,
c
.
GetId
())
actions
.
Permission
(
data
.
TableName
(),
p
),
c
.
Generate
(
&
data
)
)
.
First
(
&
data
,
c
.
GetId
())
c
.
Generate
(
&
data
)
db
:=
e
.
Orm
.
Save
(
&
data
)
db
:=
e
.
Orm
.
Updates
(
&
data
)
if
db
.
Error
!=
nil
{
if
db
.
Error
!=
nil
{
e
.
Log
.
Errorf
(
"OrgMatchEvaluateWonderfulService Save error:%s
\r\n
"
,
err
)
e
.
Log
.
Errorf
(
"OrgMatchEvaluateWonderfulService Save error:%s
\r\n
"
,
err
)
return
err
return
err
}
}
if
db
.
RowsAffected
==
0
{
if
db
.
RowsAffected
==
0
{
return
errors
.
New
(
"无权更新该数据"
)
return
errors
.
New
(
"无权更新该数据"
)
}
}
return
nil
return
nil
}
}
// Remove 删除OrgMatchEvaluateWonderful
// Remove 删除OrgMatchEvaluateWonderful
...
@@ -99,11 +97,11 @@ func (e *OrgMatchEvaluateWonderful) Remove(d *dto.OrgMatchEvaluateWonderfulDelet
...
@@ -99,11 +97,11 @@ func (e *OrgMatchEvaluateWonderful) Remove(d *dto.OrgMatchEvaluateWonderfulDelet
actions
.
Permission
(
data
.
TableName
(),
p
),
actions
.
Permission
(
data
.
TableName
(),
p
),
)
.
Delete
(
&
data
,
d
.
GetId
())
)
.
Delete
(
&
data
,
d
.
GetId
())
if
err
:=
db
.
Error
;
err
!=
nil
{
if
err
:=
db
.
Error
;
err
!=
nil
{
e
.
Log
.
Errorf
(
"Service RemoveOrgMatchEvaluateWonderful error:%s
\r\n
"
,
err
)
e
.
Log
.
Errorf
(
"Service RemoveOrgMatchEvaluateWonderful error:%s
\r\n
"
,
err
)
return
err
return
err
}
}
if
db
.
RowsAffected
==
0
{
if
db
.
RowsAffected
==
0
{
return
errors
.
New
(
"无权删除该数据"
)
return
errors
.
New
(
"无权删除该数据"
)
}
}
return
nil
return
nil
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
common/dto/match.go
View file @
c00a1323
...
@@ -3,27 +3,30 @@ package dto
...
@@ -3,27 +3,30 @@ package dto
import
"gorm.io/gorm"
import
"gorm.io/gorm"
type
PageMatchInfo
struct
{
type
PageMatchInfo
struct
{
Id
string
`json:"id"`
Id
string
`json:"id"`
MatchId
string
`json:"matchId"`
MatchId
string
`json:"matchId"`
LeagueName
string
`json:"leagueName"`
LeagueName
string
`json:"leagueName"`
DivisionName
string
`json:"divisionName"`
DivisionName
string
`json:"divisionName"`
SeasonId
string
`json:"seasonId"`
SeasonId
string
`json:"seasonId"`
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"`
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"`
PlayerNumber
string
`json:"playerNumber"`
PlayerNumber
string
`json:"playerNumber"`
Position
string
`json:"position"`
Position
string
`json:"position"`
Content
string
`json:"content"`
Content
string
`json:"content"`
WonderfulMomentImg
string
`json:"wonderfulMomentImg" comment:"精彩时刻图"`
EvaluateId
string
`json:"evaluateId" comment:"精彩时刻id"`
WonderfulMomentMv
string
`json:"wonderfulMomentMv" comment:"精彩时刻视频"`
TeamAName
string
`json:"team_a_name" comment:"a队名"`
WonderfulMomentImgTitle
string
`json:"wonderfulMomentImgTitle" comment:"精彩时刻图标题"`
TeamBName
string
`json:"team_b_name" comment:"b队名"`
WonderfulMomentMvTitle
string
`json:"wonderfulMomentMvTitle" comment:"精彩时刻视频标题"`
}
TeamAName
string
`json:"team_a_name" comment:"a队名"`
TeamBName
string
`json:"team_b_name" comment:"b队名"`
type
Wonderful
struct
{
Id
string
`json:"精彩时刻id"`
WonderfulUrl
string
`json:"wonderfulUrl" comment:"精彩时刻url"`
WonderfulTitle
string
`json:"wonderfulTitle" comment:"精彩时刻标题"`
}
}
type
TotalScoring
struct
{
type
TotalScoring
struct
{
...
...
This diff is collapsed.
Click to expand it.
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