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
c14432ef
Commit
c14432ef
authored
Jan 17, 2022
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update
parent
6eb1de23
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
240 additions
and
120 deletions
+240
-120
sys_user.go
app/admin/service/dto/sys_user.go
+2
-2
org_player.go
app/operate/apis/org_player.go
+38
-0
org_team_user.go
app/operate/apis/org_team_user.go
+52
-2
org_player.go
app/operate/models/org_player.go
+1
-0
org_player.go
app/operate/router/org_player.go
+2
-1
org_player_user.go
app/operate/router/org_player_user.go
+1
-1
org_team_user.go
app/operate/router/org_team_user.go
+2
-1
org_match.go
app/operate/service/dto/org_match.go
+2
-2
org_player.go
app/operate/service/dto/org_player.go
+8
-1
org_team_user.go
app/operate/service/dto/org_team_user.go
+7
-0
org_ad.go
app/operate/service/org_ad.go
+26
-26
org_club_user.go
app/operate/service/org_club_user.go
+1
-1
org_division.go
app/operate/service/org_division.go
+26
-26
org_league.go
app/operate/service/org_league.go
+26
-26
org_match.go
app/operate/service/org_match.go
+1
-1
org_news.go
app/operate/service/org_news.go
+26
-26
org_player.go
app/operate/service/org_player.go
+1
-1
org_player_user.go
app/operate/service/org_player_user.go
+1
-1
org_season.go
app/operate/service/org_season.go
+1
-1
org_team_user.go
app/operate/service/org_team_user.go
+16
-1
No files found.
app/admin/service/dto/sys_user.go
View file @
c14432ef
...
...
@@ -102,7 +102,7 @@ type SysUserInsertReq struct {
DeptId
int
`json:"deptId" comment:"部门" vd:"$>0"`
PostId
int
`json:"postId" comment:"岗位"`
Remark
string
`json:"remark" comment:"备注"`
Status
string
`json:"status" comment:"状态" vd:"len($)>0" default:"
1
"`
Status
string
`json:"status" comment:"状态" vd:"len($)>0" default:"
2
"`
common
.
ControlBy
}
...
...
@@ -141,7 +141,7 @@ type SysUserUpdateReq struct {
DeptId
int
`json:"deptId" comment:"部门" vd:"$>0"`
PostId
int
`json:"postId" comment:"岗位"`
Remark
string
`json:"remark" comment:"备注"`
Status
string
`json:"status" comment:"状态" default:"
1
"`
Status
string
`json:"status" comment:"状态" default:"
2
"`
common
.
ControlBy
}
...
...
app/operate/apis/org_player.go
View file @
c14432ef
...
...
@@ -220,3 +220,41 @@ func (e OrgPlayer) Delete(c *gin.Context) {
}
e
.
OK
(
req
.
GetId
(),
"删除成功"
)
}
// Update <球队>修改球员状态
// @Summary <球队>修改球员状态
// @Description <球队>修改球员状态
// @Tags <球队>工作人员
// @Accept application/json
// @Product application/json
// @Param data body dto.OrgTeamUserUpdateReq true "body"
// @Success 200 {string} string "{"code": 200, "message": "修改成功"}"
// @Router /api/v1/org-player/update-status [put]
// @Security Bearer
func
(
e
OrgPlayer
)
UpdateStatus
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgPlayerUpdateStatusReq
{}
s
:=
service
.
OrgPlayer
{}
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
)
reqUpdate
:=
dto
.
OrgPlayerUpdateReq
{}
reqUpdate
.
Id
=
req
.
Id
reqUpdate
.
Status
=
req
.
Status
err
=
s
.
Update
(
&
reqUpdate
,
p
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"修改球队人员账户信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
e
.
OK
(
req
.
Id
,
"修改成功"
)
}
app/operate/apis/org_team_user.go
View file @
c14432ef
...
...
@@ -193,7 +193,7 @@ func (e OrgTeamUser) Update(c *gin.Context) {
reqSysUser
.
UserId
,
_
=
strconv
.
Atoi
(
req
.
UserId
)
// 设置创建人
reqSysUser
.
Set
Cre
ateBy
(
user
.
GetUserId
(
c
))
reqSysUser
.
Set
Upd
ateBy
(
user
.
GetUserId
(
c
))
err
=
sSysUser
.
Update
(
&
reqSysUser
,
p
)
if
err
!=
nil
{
e
.
Logger
.
Error
(
err
)
...
...
@@ -204,6 +204,56 @@ func (e OrgTeamUser) Update(c *gin.Context) {
e
.
OK
(
req
.
GetId
(),
"修改成功"
)
}
// Update <球队>修改工作人员
// @Summary <球队>修改工作人员
// @Description <球队>修改工作人员
// @Tags <球队>工作人员
// @Accept application/json
// @Product application/json
// @Param data body dto.OrgTeamUserUpdateReq true "body"
// @Success 200 {string} string "{"code": 200, "message": "修改成功"}"
// @Router /api/v1/org-team-user/update-status [put]
// @Security Bearer
func
(
e
OrgTeamUser
)
UpdateStatus
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgTeamUserUpdateStatusReq
{}
s
:=
service
.
OrgTeamUser
{}
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
,
userId
:=
s
.
GetUserId
(
req
.
Id
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"修改球队人员账户信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
sSysUser
:=
sService
.
SysUser
{}
reqSysUser
:=
sDto
.
SysUserUpdateReq
{}
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeService
(
&
sSysUser
.
Service
)
reqSysUser
.
Status
=
req
.
Status
reqSysUser
.
UserId
,
_
=
strconv
.
Atoi
(
userId
)
// 设置创建人
reqSysUser
.
SetUpdateBy
(
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
.
Id
,
"修改成功"
)
}
// Delete <球队>删除工作人员
// @Summary <球队>删除工作人员
// @Description <球队>删除工作人员
...
...
@@ -229,7 +279,7 @@ func (e OrgTeamUser) Delete(c *gin.Context) {
// req.SetUpdateBy(user.GetUserId(c))
p
:=
actions
.
GetPermissionFromContext
(
c
)
_
,
userIds
:=
s
.
GetUserId
(
req
.
Ids
)
_
,
userIds
:=
s
.
GetUserId
s
(
req
.
Ids
)
err
=
s
.
Remove
(
&
req
,
p
)
if
err
!=
nil
{
...
...
app/operate/models/org_player.go
View file @
c14432ef
...
...
@@ -18,6 +18,7 @@ type OrgPlayer struct {
PlayerImg
string
`json:"playerImg" gorm:"type:varchar(255);comment:球员照片"`
PlayerUserId
string
`json:"playerUserId" gorm:"type:bigint(20);comment:org_player_user表id"`
ShareConf
string
`json:"shareConf" gorm:"type:tinyint(1);comment:分享功能 1 开启 2 关闭"`
Status
string
`json:"status" gorm:"type:tinyint(1);comment:状态 1 离队 2 在队"`
models
.
ModelTime
models
.
ControlBy
}
...
...
app/operate/router/org_player.go
View file @
c14432ef
...
...
@@ -21,6 +21,7 @@ func registerOrgPlayerRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMidd
r
.
GET
(
"/:id"
,
api
.
Get
)
r
.
POST
(
""
,
api
.
Insert
)
r
.
PUT
(
"/:id"
,
api
.
Update
)
r
.
PUT
(
"/update-status"
,
api
.
UpdateStatus
)
r
.
DELETE
(
""
,
api
.
Delete
)
}
}
app/operate/router/org_player_user.go
View file @
c14432ef
app/operate/router/org_team_user.go
View file @
c14432ef
...
...
@@ -21,6 +21,7 @@ func registerOrgTeamUserRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMi
r
.
GET
(
"/:id"
,
api
.
Get
)
r
.
POST
(
""
,
api
.
Insert
)
r
.
PUT
(
"/:id"
,
api
.
Update
)
r
.
PUT
(
"/update-status"
,
api
.
UpdateStatus
)
r
.
DELETE
(
""
,
api
.
Delete
)
}
}
app/operate/service/dto/org_match.go
View file @
c14432ef
...
...
@@ -30,8 +30,8 @@ type OrgMatchGetPageReply struct {
TeamBName
string
`json:"team_b_name"`
TeamAId
string
`json:"teamAId"`
TeamBId
string
`json:"teamBId"`
MatchStartTime
time
.
Time
`json:"matchStartTime
Order
"`
MatchEndTime
time
.
Time
`json:"matchEndTime
Order
"`
MatchStartTime
time
.
Time
`json:"matchStartTime"`
MatchEndTime
time
.
Time
`json:"matchEndTime"`
Status
string
`json:"status"`
}
...
...
app/operate/service/dto/org_player.go
View file @
c14432ef
...
...
@@ -103,6 +103,12 @@ type OrgPlayerUpdateReq struct {
ShareConf
string
`json:"shareConf" comment:"分享功能 1 开启 2 关闭"`
PlayerNameEn
string
`json:"playerNameEn" comment:"球员名称英文"`
Username
string
`json:"username" comment:"账号"`
Status
string
`json:"status" comment:"状态 1 离队 2 在队"`
//状态 1 离队 2 在队
common
.
ControlBy
}
type
OrgPlayerUpdateStatusReq
struct
{
Id
int
`json:"id" comment:""`
//
Status
string
`json:"status" comment:"状态 1 离队 2 在队"`
//状态 1 离队 2 在队
common
.
ControlBy
}
...
...
@@ -120,6 +126,7 @@ func (s *OrgPlayerUpdateReq) Generate(model *models.OrgPlayer) {
model
.
PlayerImg
=
s
.
PlayerImg
model
.
PlayerUserId
=
s
.
PlayerUserId
model
.
ShareConf
=
s
.
ShareConf
model
.
Status
=
s
.
Status
}
func
(
s
*
OrgPlayerUpdateReq
)
GetId
()
interface
{}
{
...
...
@@ -146,7 +153,7 @@ type OrgPlayerGetReply struct {
PlayerImg
string
`json:"playerImg" comment:"球员照片"`
Username
string
`json:"username" comment:"账号"`
ShareConf
string
`json:"shareConf" comment:"分享功能 1 开启 2 关闭"`
Status
string
`json:"status" comment:"状态
"`
Status
string
`json:"status" comment:"状态
1 离队 2 在队"`
//1 离队 2 在队
}
func
(
s
*
OrgPlayerGetReq
)
GetId
()
interface
{}
{
...
...
app/operate/service/dto/org_team_user.go
View file @
c14432ef
...
...
@@ -71,6 +71,13 @@ type OrgTeamUserUpdateReq struct {
UserImg
string
`json:"userImg" comment:"用户照片"`
SignImg
string
`json:"signImg" comment:"签名照片"`
UserName
string
`json:"userName" comment:"账号"`
Status
string
`json:"status" comment:"状态 1 离职 2 在职"`
//状态 1 离职 2 在职
common
.
ControlBy
}
type
OrgTeamUserUpdateStatusReq
struct
{
Id
int
`json:"id" comment:""`
//
Status
string
`json:"status" comment:"状态 1 离职 2 在职"`
//状态 1 离职 2 在职
common
.
ControlBy
}
...
...
app/operate/service/org_ad.go
View file @
c14432ef
...
...
@@ -79,7 +79,7 @@ func (e *OrgAd) Update(c *dto.OrgAdUpdateReq, p *actions.DataPermission) error {
)
.
First
(
&
data
,
c
.
GetId
())
c
.
Generate
(
&
data
)
db
:=
e
.
Orm
.
Save
(
&
data
)
db
:=
e
.
Orm
.
Updates
(
&
data
)
if
db
.
Error
!=
nil
{
e
.
Log
.
Errorf
(
"OrgAdService Save error:%s
\r\n
"
,
err
)
return
err
...
...
app/operate/service/org_club_user.go
View file @
c14432ef
...
...
@@ -124,7 +124,7 @@ func (e *OrgClubUser) Update(c *dto.OrgClubUserUpdateReq, p *actions.DataPermiss
)
.
First
(
&
data
,
c
.
GetId
())
c
.
Generate
(
&
data
)
db
:=
e
.
Orm
.
Save
(
&
data
)
db
:=
e
.
Orm
.
Updates
(
&
data
)
if
db
.
Error
!=
nil
{
e
.
Log
.
Errorf
(
"OrgClubUserService Save error:%s
\r\n
"
,
err
)
return
err
...
...
app/operate/service/org_division.go
View file @
c14432ef
...
...
@@ -79,7 +79,7 @@ func (e *OrgDivision) Update(c *dto.OrgDivisionUpdateReq, p *actions.DataPermiss
)
.
First
(
&
data
,
c
.
GetId
())
c
.
Generate
(
&
data
)
db
:=
e
.
Orm
.
Save
(
&
data
)
db
:=
e
.
Orm
.
Updates
(
&
data
)
if
db
.
Error
!=
nil
{
e
.
Log
.
Errorf
(
"OrgDivisionService Save error:%s
\r\n
"
,
err
)
return
err
...
...
app/operate/service/org_league.go
View file @
c14432ef
...
...
@@ -79,7 +79,7 @@ func (e *OrgLeague) Update(c *dto.OrgLeagueUpdateReq, p *actions.DataPermission)
)
.
First
(
&
data
,
c
.
GetId
())
c
.
Generate
(
&
data
)
db
:=
e
.
Orm
.
Save
(
&
data
)
db
:=
e
.
Orm
.
Updates
(
&
data
)
if
db
.
Error
!=
nil
{
e
.
Log
.
Errorf
(
"OrgLeagueService Save error:%s
\r\n
"
,
err
)
return
err
...
...
app/operate/service/org_match.go
View file @
c14432ef
...
...
@@ -117,7 +117,7 @@ func (e *OrgMatch) Update(c *dto.OrgMatchUpdateReq, p *actions.DataPermission) e
)
.
First
(
&
data
,
c
.
GetId
())
c
.
Generate
(
&
data
)
db
:=
e
.
Orm
.
Save
(
&
data
)
db
:=
e
.
Orm
.
Updates
(
&
data
)
if
db
.
Error
!=
nil
{
e
.
Log
.
Errorf
(
"OrgMatchService Save error:%s
\r\n
"
,
err
)
return
err
...
...
app/operate/service/org_news.go
View file @
c14432ef
...
...
@@ -79,7 +79,7 @@ func (e *OrgNews) Update(c *dto.OrgNewsUpdateReq, p *actions.DataPermission) err
)
.
First
(
&
data
,
c
.
GetId
())
c
.
Generate
(
&
data
)
db
:=
e
.
Orm
.
Save
(
&
data
)
db
:=
e
.
Orm
.
Updates
(
&
data
)
if
db
.
Error
!=
nil
{
e
.
Log
.
Errorf
(
"OrgNewsService Save error:%s
\r\n
"
,
err
)
return
err
...
...
app/operate/service/org_player.go
View file @
c14432ef
...
...
@@ -91,7 +91,7 @@ func (e *OrgPlayer) Update(c *dto.OrgPlayerUpdateReq, p *actions.DataPermission)
)
.
First
(
&
data
,
c
.
GetId
())
c
.
Generate
(
&
data
)
db
:=
e
.
Orm
.
Save
(
&
data
)
db
:=
e
.
Orm
.
Updates
(
&
data
)
if
db
.
Error
!=
nil
{
e
.
Log
.
Errorf
(
"OrgPlayerService Save error:%s
\r\n
"
,
err
)
return
err
...
...
app/operate/service/org_player_user.go
View file @
c14432ef
...
...
@@ -80,7 +80,7 @@ func (e *OrgPlayerUser) Update(c *dto.OrgPlayerUserUpdateReq, p *actions.DataPer
)
.
First
(
&
data
,
c
.
GetId
())
c
.
Generate
(
&
data
)
db
:=
e
.
Orm
.
Save
(
&
data
)
db
:=
e
.
Orm
.
Updates
(
&
data
)
if
db
.
Error
!=
nil
{
e
.
Log
.
Errorf
(
"OrgPlayerUserService Save error:%s
\r\n
"
,
err
)
return
err
...
...
app/operate/service/org_season.go
View file @
c14432ef
...
...
@@ -83,7 +83,7 @@ func (e *OrgSeason) Update(c *dto.OrgSeasonUpdateReq, p *actions.DataPermission)
)
.
First
(
&
data
,
c
.
GetId
())
c
.
Generate
(
&
data
)
db
:=
e
.
Orm
.
Save
(
&
data
)
db
:=
e
.
Orm
.
Updates
(
&
data
)
if
db
.
Error
!=
nil
{
e
.
Log
.
Errorf
(
"OrgSeasonService Save error:%s
\r\n
"
,
err
)
return
err
...
...
app/operate/service/org_team_user.go
View file @
c14432ef
...
...
@@ -123,7 +123,7 @@ func (e *OrgTeamUser) Remove(d *dto.OrgTeamUserDeleteReq, p *actions.DataPermiss
}
// GetPage 获取OrgTeamUser列表
func
(
e
*
OrgTeamUser
)
GetUserId
(
ids
[]
int
)
(
error
,
[]
int
)
{
func
(
e
*
OrgTeamUser
)
GetUserId
s
(
ids
[]
int
)
(
error
,
[]
int
)
{
list
:=
make
([]
models
.
OrgTeamUser
,
0
)
field
:=
"user_id"
...
...
@@ -152,3 +152,18 @@ func (e *OrgTeamUser) GetTeamId(userId int) (error, string) {
}
return
nil
,
data
.
TeamId
}
// Get 获取OrgClubUser对象
func
(
e
*
OrgTeamUser
)
GetUserId
(
teamId
int
)
(
error
,
string
)
{
data
:=
new
(
models
.
OrgTeamUser
)
err
:=
e
.
Orm
.
Table
(
"org_team_user"
)
.
Select
(
"user_id"
)
.
Where
(
"team_id=?"
,
teamId
)
.
First
(
&
data
)
.
Error
if
err
!=
nil
{
e
.
Log
.
Errorf
(
"db error:%s"
,
err
)
return
err
,
""
}
return
nil
,
data
.
UserId
}
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