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
75f1a3c9
Commit
75f1a3c9
authored
Jan 07, 2022
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
影像维护
parent
1475ff59
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
39 deletions
+54
-39
org_match_evaluate.go
app/operate/apis/org_match_evaluate.go
+16
-34
org_match_evaluate.go
app/operate/models/org_match_evaluate.go
+2
-2
org_match_evaluate.go
app/operate/router/org_match_evaluate.go
+0
-1
org_match_evaluate.go
app/operate/service/dto/org_match_evaluate.go
+5
-0
org_match_evaluate.go
app/operate/service/org_match_evaluate.go
+31
-2
No files found.
app/operate/apis/org_match_evaluate.go
View file @
75f1a3c9
...
@@ -179,41 +179,23 @@ func (e OrgMatchEvaluate) Update(c *gin.Context) {
...
@@ -179,41 +179,23 @@ func (e OrgMatchEvaluate) Update(c *gin.Context) {
req
.
SetUpdateBy
(
user
.
GetUserId
(
c
))
req
.
SetUpdateBy
(
user
.
GetUserId
(
c
))
p
:=
actions
.
GetPermissionFromContext
(
c
)
p
:=
actions
.
GetPermissionFromContext
(
c
)
err
=
s
.
Update
(
&
req
,
p
)
err
,
playerId
:=
s
.
IsBeing
(
req
.
MatchId
,
req
.
Rounds
,
req
.
PlayerId
)
if
err
!=
nil
{
if
playerId
==
0
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"修改比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
reqInsertData
:=
dto
.
OrgMatchEvaluateInsertReq
{
return
MatchId
:
req
.
MatchId
,
}
Rounds
:
req
.
Rounds
,
e
.
OK
(
req
.
GetId
(),
"修改成功"
)
PlayerId
:
req
.
PlayerId
,
}
WonderfulMomentImg
:
req
.
WonderfulMomentImg
,
WonderfulMomentMv
:
req
.
WonderfulMomentMv
,
// Update <赛事>赛后评价影像维护
WonderfulMomentImgTitle
:
req
.
WonderfulMomentImgTitle
,
// @Summary <赛事>赛后评价影像维护
WonderfulMomentMvTitle
:
req
.
WonderfulMomentMvTitle
,
// @Description <赛事>赛后评价影像维护
MvStatus
:
req
.
MvStatus
,
// @Tags <赛事>赛后评价
Status
:
req
.
Status
,
// @Accept application/json
}
// @Product application/json
err
=
s
.
Insert
(
&
reqInsertData
)
// @Param data body dto.OrgMatchEvaluateUpdateReq true "body"
}
else
{
// @Success 200 {string} string "{"code": 200, "message": "修改成功"}"
err
=
s
.
Update
(
&
req
,
p
)
// @Router /api/v1/org-match-evaluate/status/{id} [put]
// @Security Bearer
func
(
e
OrgMatchEvaluate
)
Status
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgMatchEvaluateUpdateReq
{}
s
:=
service
.
OrgMatchEvaluate
{}
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
Bind
(
&
req
)
.
MakeService
(
&
s
.
Service
)
.
Errors
if
err
!=
nil
{
e
.
Logger
.
Error
(
err
)
e
.
Error
(
500
,
err
,
err
.
Error
())
return
}
}
req
.
SetUpdateBy
(
user
.
GetUserId
(
c
))
p
:=
actions
.
GetPermissionFromContext
(
c
)
err
=
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
...
...
app/operate/models/org_match_evaluate.go
View file @
75f1a3c9
...
@@ -8,8 +8,8 @@ import (
...
@@ -8,8 +8,8 @@ import (
type
OrgMatchEvaluate
struct
{
type
OrgMatchEvaluate
struct
{
models
.
Model
models
.
Model
MatchId
string
`json:"matchId" gorm:"type:bigint(20);comment:比赛id"`
Rounds
string
`json:"rounds" gorm:"type:bigint(20);comment:
Rounds
"`
Rounds
string
`json:"rounds" gorm:"type:bigint(20);comment:
轮次
"`
TeamUserId
string
`json:"teamUserId" gorm:"type:bigint(20);comment:org_team_user表id(教练id)"`
TeamUserId
string
`json:"teamUserId" gorm:"type:bigint(20);comment:org_team_user表id(教练id)"`
PlayerId
string
`json:"playerId" gorm:"type:bigint(20);comment:org_player表id(球员id)"`
PlayerId
string
`json:"playerId" gorm:"type:bigint(20);comment:org_player表id(球员id)"`
Content
string
`json:"content" gorm:"type:text;comment:教练评价内容"`
Content
string
`json:"content" gorm:"type:text;comment:教练评价内容"`
...
...
app/operate/router/org_match_evaluate.go
View file @
75f1a3c9
...
@@ -21,6 +21,5 @@ func registerOrgMatchEvaluateRouter(v1 *gin.RouterGroup, authMiddleware *jwt.Gin
...
@@ -21,6 +21,5 @@ func registerOrgMatchEvaluateRouter(v1 *gin.RouterGroup, authMiddleware *jwt.Gin
r
.
GET
(
"/get-match"
,
api
.
GetPageMatch
)
r
.
GET
(
"/get-match"
,
api
.
GetPageMatch
)
r
.
GET
(
"/:id"
,
api
.
Get
)
r
.
GET
(
"/:id"
,
api
.
Get
)
r
.
PUT
(
"/:id"
,
api
.
Update
)
r
.
PUT
(
"/:id"
,
api
.
Update
)
r
.
PUT
(
"/status/:id"
,
api
.
Status
)
}
}
}
}
app/operate/service/dto/org_match_evaluate.go
View file @
75f1a3c9
...
@@ -44,6 +44,7 @@ type GetPageMatchReply struct {
...
@@ -44,6 +44,7 @@ type GetPageMatchReply struct {
//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
//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
type
OrgMatchEvaluateOrder
struct
{
type
OrgMatchEvaluateOrder
struct
{
Id
int
`form:"idOrder" search:"type:order;column:id;table:org_match_evaluate"`
Id
int
`form:"idOrder" search:"type:order;column:id;table:org_match_evaluate"`
MatchId
string
`form:"matchIdOrder" search:"type:order;column:matchId;table:org_match_evaluate"`
Rounds
string
`form:"roundsOrder" search:"type:order;column:rounds;table:org_match_evaluate"`
Rounds
string
`form:"roundsOrder" search:"type:order;column:rounds;table:org_match_evaluate"`
TeamUserId
string
`form:"teamUserIdOrder" search:"type:order;column:team_user_id;table:org_match_evaluate"`
TeamUserId
string
`form:"teamUserIdOrder" search:"type:order;column:team_user_id;table:org_match_evaluate"`
PlayerId
string
`form:"playerIdOrder" search:"type:order;column:player_id;table:org_match_evaluate"`
PlayerId
string
`form:"playerIdOrder" search:"type:order;column:player_id;table:org_match_evaluate"`
...
@@ -68,6 +69,7 @@ func (m *OrgMatchEvaluateGetPageReq) GetNeedSearch() interface{} {
...
@@ -68,6 +69,7 @@ func (m *OrgMatchEvaluateGetPageReq) GetNeedSearch() interface{} {
type
OrgMatchEvaluateInsertReq
struct
{
type
OrgMatchEvaluateInsertReq
struct
{
Id
int
`json:"-" comment:""`
//
Id
int
`json:"-" 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)"`
...
@@ -86,6 +88,7 @@ func (s *OrgMatchEvaluateInsertReq) Generate(model *models.OrgMatchEvaluate) {
...
@@ -86,6 +88,7 @@ func (s *OrgMatchEvaluateInsertReq) Generate(model *models.OrgMatchEvaluate) {
if
s
.
Id
==
0
{
if
s
.
Id
==
0
{
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
}
}
model
.
MatchId
=
s
.
MatchId
model
.
Rounds
=
s
.
Rounds
model
.
Rounds
=
s
.
Rounds
model
.
TeamUserId
=
s
.
TeamUserId
model
.
TeamUserId
=
s
.
TeamUserId
model
.
PlayerId
=
s
.
PlayerId
model
.
PlayerId
=
s
.
PlayerId
...
@@ -105,6 +108,7 @@ func (s *OrgMatchEvaluateInsertReq) GetId() interface{} {
...
@@ -105,6 +108,7 @@ 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:""`
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)"`
...
@@ -123,6 +127,7 @@ func (s *OrgMatchEvaluateUpdateReq) Generate(model *models.OrgMatchEvaluate) {
...
@@ -123,6 +127,7 @@ func (s *OrgMatchEvaluateUpdateReq) Generate(model *models.OrgMatchEvaluate) {
if
s
.
Id
==
0
{
if
s
.
Id
==
0
{
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
model
.
Model
=
common
.
Model
{
Id
:
s
.
Id
}
}
}
model
.
MatchId
=
s
.
MatchId
model
.
Rounds
=
s
.
Rounds
model
.
Rounds
=
s
.
Rounds
model
.
TeamUserId
=
s
.
TeamUserId
model
.
TeamUserId
=
s
.
TeamUserId
model
.
PlayerId
=
s
.
PlayerId
model
.
PlayerId
=
s
.
PlayerId
...
...
app/operate/service/org_match_evaluate.go
View file @
75f1a3c9
...
@@ -341,10 +341,18 @@ func (e *OrgMatchEvaluate) Update(c *dto.OrgMatchEvaluateUpdateReq, p *actions.D
...
@@ -341,10 +341,18 @@ func (e *OrgMatchEvaluate) Update(c *dto.OrgMatchEvaluateUpdateReq, p *actions.D
var
data
=
models
.
OrgMatchEvaluate
{}
var
data
=
models
.
OrgMatchEvaluate
{}
e
.
Orm
.
Scopes
(
e
.
Orm
.
Scopes
(
actions
.
Permission
(
data
.
TableName
(),
p
),
actions
.
Permission
(
data
.
TableName
(),
p
),
)
.
First
(
&
data
,
c
.
GetId
())
cDto
.
SetWhere
(
""
,
"match_id"
,
c
.
MatchId
),
cDto
.
SetWhere
(
""
,
"rounds"
,
c
.
Rounds
),
cDto
.
SetWhere
(
""
,
"player_id"
,
c
.
PlayerId
),
)
.
First
(
&
data
)
c
.
Generate
(
&
data
)
c
.
Generate
(
&
data
)
db
:=
e
.
Orm
.
Updates
(
&
data
)
db
:=
e
.
Orm
.
Scopes
(
actions
.
Permission
(
data
.
TableName
(),
p
),
cDto
.
SetWhere
(
""
,
"match_id"
,
c
.
MatchId
),
cDto
.
SetWhere
(
""
,
"rounds"
,
c
.
Rounds
),
cDto
.
SetWhere
(
""
,
"player_id"
,
c
.
PlayerId
),
)
.
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
...
@@ -372,3 +380,24 @@ func (e *OrgMatchEvaluate) Remove(d *dto.OrgMatchEvaluateDeleteReq, p *actions.D
...
@@ -372,3 +380,24 @@ func (e *OrgMatchEvaluate) Remove(d *dto.OrgMatchEvaluateDeleteReq, p *actions.D
}
}
return
nil
return
nil
}
}
// Insert 创建OrgMatchTeamPlayer对象
func
(
e
*
OrgMatchEvaluate
)
IsBeing
(
matchId
string
,
rounds
string
,
playerId
string
)
(
error
,
int
)
{
var
data
models
.
OrgMatchEvaluate
err
:=
e
.
Orm
.
Model
(
&
data
)
.
Where
(
"match_id=?"
,
matchId
)
.
Where
(
"rounds=?"
,
rounds
)
.
Where
(
"player_id=?"
,
playerId
)
.
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
}
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