Commit 339630e0 authored by haoyanbin's avatar haoyanbin

1

parent 851bf0db
......@@ -30,7 +30,7 @@ type SysUser struct {
// @Security Bearer
func (e SysUser) GetPage(c *gin.Context) {
s := service.SysUser{}
req :=dto.SysUserGetPageReq{}
req := dto.SysUserGetPageReq{}
err := e.MakeContext(c).
MakeOrm().
Bind(&req).
......@@ -67,7 +67,7 @@ func (e SysUser) GetPage(c *gin.Context) {
// @Security Bearer
func (e SysUser) Get(c *gin.Context) {
s := service.SysUser{}
req :=dto.SysUserById{}
req := dto.SysUserById{}
err := e.MakeContext(c).
MakeOrm().
Bind(&req, nil).
......@@ -101,7 +101,7 @@ func (e SysUser) Get(c *gin.Context) {
// @Security Bearer
func (e SysUser) Insert(c *gin.Context) {
s := service.SysUser{}
req :=dto.SysUserInsertReq{}
req := dto.SysUserInsertReq{}
err := e.MakeContext(c).
MakeOrm().
Bind(&req, binding.JSON).
......@@ -136,7 +136,7 @@ func (e SysUser) Insert(c *gin.Context) {
// @Security Bearer
func (e SysUser) Update(c *gin.Context) {
s := service.SysUser{}
req :=dto.SysUserUpdateReq{}
req := dto.SysUserUpdateReq{}
err := e.MakeContext(c).
MakeOrm().
Bind(&req).
......@@ -171,7 +171,7 @@ func (e SysUser) Update(c *gin.Context) {
// @Security Bearer
func (e SysUser) Delete(c *gin.Context) {
s := service.SysUser{}
req :=dto.SysUserById{}
req := dto.SysUserById{}
err := e.MakeContext(c).
MakeOrm().
Bind(&req, binding.JSON).
......@@ -208,7 +208,7 @@ func (e SysUser) Delete(c *gin.Context) {
// @Security Bearer
func (e SysUser) InsetAvatar(c *gin.Context) {
s := service.SysUser{}
req :=dto.UpdateSysUserAvatarReq{}
req := dto.UpdateSysUserAvatarReq{}
err := e.MakeContext(c).
MakeOrm().
MakeService(&s.Service).
......@@ -257,7 +257,7 @@ func (e SysUser) InsetAvatar(c *gin.Context) {
// @Security Bearer
func (e SysUser) UpdateStatus(c *gin.Context) {
s := service.SysUser{}
req :=dto.UpdateSysUserStatusReq{}
req := dto.UpdateSysUserStatusReq{}
err := e.MakeContext(c).
MakeOrm().
Bind(&req, binding.JSON, nil).
......@@ -294,7 +294,7 @@ func (e SysUser) UpdateStatus(c *gin.Context) {
// @Security Bearer
func (e SysUser) ResetPwd(c *gin.Context) {
s := service.SysUser{}
req :=dto.ResetSysUserPwdReq{}
req := dto.ResetSysUserPwdReq{}
err := e.MakeContext(c).
MakeOrm().
Bind(&req, binding.JSON).
......@@ -331,7 +331,7 @@ func (e SysUser) ResetPwd(c *gin.Context) {
// @Security Bearer
func (e SysUser) UpdatePwd(c *gin.Context) {
s := service.SysUser{}
req :=dto.PassWord{}
req := dto.PassWord{}
err := e.MakeContext(c).
MakeOrm().
Bind(&req).
......@@ -364,7 +364,7 @@ func (e SysUser) UpdatePwd(c *gin.Context) {
// @Security Bearer
func (e SysUser) GetProfile(c *gin.Context) {
s := service.SysUser{}
req :=dto.SysUserById{}
req := dto.SysUserById{}
err := e.MakeContext(c).
MakeOrm().
MakeService(&s.Service).
......@@ -401,7 +401,7 @@ func (e SysUser) GetProfile(c *gin.Context) {
// @Router /api/v1/getinfo [get]
// @Security Bearer
func (e SysUser) GetInfo(c *gin.Context) {
req :=dto.SysUserById{}
req := dto.SysUserById{}
s := service.SysUser{}
r := service.SysRole{}
err := e.MakeContext(c).
......
......@@ -80,6 +80,7 @@ func (e *SysUser) Insert(c *dto.SysUserInsertReq) error {
e.Log.Errorf("db error: %s", err)
return err
}
c.UserId = data.UserId
return nil
}
......
......@@ -124,7 +124,8 @@ func (e OrgClub) Insert(c *gin.Context) {
sSysUser := sService.SysUser{}
reqSysUser := sDto.SysUserInsertReq{}
reqSysUser.Username = req.ClubUserName
e.MakeContext(c).MakeOrm().MakeService(&sSysUser.Service)
reqSysUser.Username = req.ClubUsername
reqSysUser.Password = "123456"
reqSysUser.NickName = req.ClubContacts
reqSysUser.NickNameEn = req.ClubContactsEn
......@@ -150,6 +151,7 @@ func (e OrgClub) Insert(c *gin.Context) {
//关联表添加
reqClubUser := dto.OrgClubUserInsertReq{}
sClubUser := service.OrgClubUser{}
e.MakeContext(c).MakeOrm().MakeService(&sClubUser.Service)
errClubUser := e.MakeContext(c).
MakeOrm().
Bind(&req).
......@@ -209,7 +211,7 @@ func (e OrgClub) Update(c *gin.Context) {
sSysUser := sService.SysUser{}
reqSysUser := sDto.SysUserUpdateReq{}
reqSysUser.Username = req.ClubUserName
reqSysUser.Username = req.ClubUsername
reqSysUser.NickName = req.ClubContacts
reqSysUser.NickNameEn = req.ClubContactsEn
reqSysUser.Phone = req.ClubMobile
......
......@@ -2,6 +2,9 @@ package apis
import (
"fmt"
sService "go-admin/app/admin/service"
sDto "go-admin/app/admin/service/dto"
"strconv"
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/sdk/api"
......@@ -110,9 +113,35 @@ func (e OrgTeamUser) Insert(c *gin.Context) {
e.Error(500, err, err.Error())
return
}
sSysUser := sService.SysUser{}
reqSysUser := sDto.SysUserInsertReq{}
e.MakeContext(c).MakeOrm().MakeService(&sSysUser.Service)
reqSysUser.Username = req.UserName
reqSysUser.Password = "123456"
reqSysUser.NickName = req.Name
reqSysUser.NickNameEn = req.NameEn
reqSysUser.Phone = req.UserName
reqSysUser.RoleId = 1
reqSysUser.Avatar = ""
reqSysUser.Sex = req.Sex
reqSysUser.Email = ""
reqSysUser.DeptId = 1
reqSysUser.PostId = 1
reqSysUser.Remark = "球队工作人员"
reqSysUser.Status = "2"
// 设置创建人
req.SetCreateBy(user.GetUserId(c))
reqSysUser.SetCreateBy(user.GetUserId(c))
err = sSysUser.Insert(&reqSysUser)
if err != nil {
e.Logger.Error(err)
e.Error(500, err, err.Error())
return
}
// 设置创建人
req.SetCreateBy(user.GetUserId(c))
req.UserId = strconv.Itoa(reqSysUser.GetId().(int))
err = s.Insert(&req)
if err != nil {
e.Error(500, err, fmt.Sprintf("创建球队人员账户信息 失败,\r\n失败信息 %s", err.Error()))
......
......@@ -9,7 +9,7 @@ import (
type OrgClub struct {
models.Model
ClubName string `json:"clubName" gorm:"type:varchar(255);comment:俱乐部名称"`
ClubUserName string `json:"clubUserName" gorm:"type:varchar(120);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:俱乐部联系电话"`
......
......@@ -9,13 +9,14 @@ import (
type OrgTeamUser struct {
models.Model
ClubId string `json:"clubId" gorm:"type:int(11);comment:org_club表id"`
TeamId string `json:"teamId" gorm:"type:int(11);comment:org_team表id"`
UserId string `json:"userId" gorm:"type:int(11);comment:sys_user表id"`
Name string `json:"name" gorm:"type:int(11);comment:姓名"`
Sex string `json:"sex" gorm:"type:int(11);comment:性别"`
UserImg string `json:"userImg" gorm:"type:int(11);comment:用户照片"`
SignImg string `json:"signImg" gorm:"type:int(11);comment:签名照片"`
ClubId string `json:"clubId" gorm:"type:int(20);comment:org_club表id"`
TeamId string `json:"teamId" gorm:"type:int(20);comment:org_team表id"`
UserId string `json:"userId" gorm:"type:int(20);comment:sys_user表id"`
Name string `json:"name" gorm:"type:varchar(120);comment:姓名"`
NameEn string `json:"nameEn" gorm:"type:varchar(120);comment:姓名"`
Sex string `json:"sex" gorm:"type:varchar(120);comment:性别"`
UserImg string `json:"userImg" gorm:"type:varchar(255);comment:用户照片"`
SignImg string `json:"signImg" gorm:"type:varchar(255);comment:签名照片"`
models.ModelTime
models.ControlBy
}
......
......@@ -8,7 +8,9 @@ import (
type OrgClubGetPageReq struct {
dto.Pagination `search:"-"`
ClubName string `form:"clubNameOrder" json:"clubName" comment:"俱乐部名称"`
ClubName string `form:"clubName" json:"clubName" search:"type:contains;column:club_name;table:org_club" comment:"俱乐部名称"`
CreateStartTime string `form:"createStartTime" search:"type:gte;column:create_at;table:org_club" comment:"开始时间"`
CreateEndTime string `form:"createEndTime" search:"type:lte;column:create_at;table:org_club" comment:"结束时间"`
}
func (m *OrgClubGetPageReq) GetNeedSearch() interface{} {
......@@ -18,7 +20,7 @@ func (m *OrgClubGetPageReq) GetNeedSearch() interface{} {
type OrgClubInsertReq struct {
Id int `json:"-" comment:""` //
ClubName string `json:"clubName" comment:"俱乐部名称"`
ClubUserName string `json:"clubUserName" comment:"俱乐部账号"`
ClubUsername string `json:"clubUsername" comment:"俱乐部账号"`
ClubContacts string `json:"clubContacts" comment:"俱乐部联系人"`
ClubContactsEn string `json:"clubContactsEn" comment:"俱乐部联系人"`
ClubMobile string `json:"clubMobile" comment:"俱乐部联系电话"`
......@@ -32,7 +34,7 @@ func (s *OrgClubInsertReq) Generate(model *models.OrgClub) {
model.Model = common.Model{Id: s.Id}
}
model.ClubName = s.ClubName
model.ClubUserName = s.ClubUserName
model.ClubUsername = s.ClubUsername
model.ClubContacts = s.ClubContacts
model.ClubContactsEn = s.ClubContactsEn
model.ClubMobile = s.ClubMobile
......@@ -47,7 +49,7 @@ func (s *OrgClubInsertReq) GetId() interface{} {
type OrgClubUpdateReq struct {
Id int `uri:"id" comment:""` //
ClubName string `json:"clubName" comment:"俱乐部名称"`
ClubUserName string `json:"clubUserName" comment:"俱乐部账号"`
ClubUsername string `json:"clubUsername" comment:"俱乐部账号"`
ClubContacts string `json:"clubContacts" comment:"俱乐部联系人"`
ClubContactsEn string `json:"clubContactsEn" comment:"俱乐部联系人"`
ClubMobile string `json:"clubMobile" comment:"俱乐部联系电话"`
......@@ -61,7 +63,7 @@ func (s *OrgClubUpdateReq) Generate(model *models.OrgClub) {
model.Model = common.Model{Id: s.Id}
}
model.ClubName = s.ClubName
model.ClubUserName = s.ClubUserName
model.ClubUsername = s.ClubUsername
model.ClubContacts = s.ClubContacts
model.ClubContactsEn = s.ClubContactsEn
model.ClubMobile = s.ClubMobile
......
......@@ -31,11 +31,14 @@ type OrgTeamUserInsertReq struct {
Id int `json:"-" comment:""` //
ClubId string `json:"clubId" comment:"org_club表id"`
TeamId string `json:"teamId" comment:"org_team表id"`
UserId string `json:"userId" comment:"sys_user表id"`
RoleId string `json:"roleId" comment:"角色id"`
UserId string `json:"userId" comment:"用户id"`
Name string `json:"name" comment:"姓名"`
NameEn string `json:"name_en" comment:"姓名"`
Sex string `json:"sex" comment:"性别"`
UserImg string `json:"userImg" comment:"用户照片"`
SignImg string `json:"signImg" comment:"签名照片"`
UserName string `json:"userName" comment:"账号"`
common.ControlBy
}
......
......@@ -21,7 +21,8 @@ func (e *OrgClub) GetPage(c *dto.OrgClubGetPageReq, p *actions.DataPermission, l
var err error
var data models.OrgClub
err = e.Orm.Model(&data).
err = e.Orm.Table("org_club").
Select("id,club_name,created_at,club_contacts,club_contacts_en,club_mobile").
Scopes(
cDto.MakeCondition(c.GetNeedSearch()),
cDto.Paginate(c.GetPageSize(), c.GetPageIndex()),
......@@ -67,6 +68,7 @@ func (e *OrgClub) Insert(c *dto.OrgClubInsertReq) error {
e.Log.Errorf("OrgClubService Insert error:%s \r\n", err)
return err
}
c.Id = data.Id
return nil
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -58,6 +58,8 @@ definitions:
properties:
clubContacts:
type: string
clubContactsEn:
type: string
clubLogo:
type: string
clubMobile:
......@@ -66,6 +68,8 @@ definitions:
type: string
clubQrcode:
type: string
clubUserName:
type: string
createBy:
type: integer
updateBy:
......@@ -75,6 +79,8 @@ definitions:
properties:
clubContacts:
type: string
clubContactsEn:
type: string
clubLogo:
type: string
clubMobile:
......@@ -83,6 +89,8 @@ definitions:
type: string
clubQrcode:
type: string
clubUserName:
type: string
createBy:
type: integer
id:
......@@ -164,6 +172,9 @@ definitions:
type: object
dto.OrgMatchEvaluateGetPageReq:
properties:
contentStatus:
description: 教练评价状态 1 待评价 2 评价完成
type: string
divisionId:
description: 赛区id
type: string
......@@ -194,6 +205,8 @@ definitions:
properties:
content:
type: string
contentStatus:
type: string
createBy:
type: integer
id:
......@@ -595,6 +608,10 @@ definitions:
type: integer
name:
type: string
name_en:
type: string
roleId:
type: string
sex:
type: string
signImg:
......@@ -607,6 +624,8 @@ definitions:
type: string
userImg:
type: string
userName:
type: string
type: object
dto.OrgTeamUserUpdateReq:
properties:
......@@ -1215,6 +1234,8 @@ definitions:
type: string
nickName:
type: string
nickNameEn:
type: string
password:
type: string
phone:
......@@ -1250,6 +1271,8 @@ definitions:
type: string
nickName:
type: string
nickNameEn:
type: string
phone:
type: string
postId:
......@@ -2437,6 +2460,46 @@ paths:
summary: <俱乐部>创建俱乐部
tags:
- <俱乐部>俱乐部
/api/v1/org-club-player/get:
get:
description: <俱乐部>获取球员比赛详情
parameters:
- description: id
in: path
name: id
type: string
responses:
"200":
description: '{"code": 200, "data": [...]}'
schema:
type: string
security:
- Bearer: []
summary: <俱乐部>获取球员比赛详情
tags:
- <俱乐部>球员
/api/v1/org-club-player/get-match:
get:
description: <俱乐部>获取球员比赛列表
parameters:
- description: 页条数
in: query
name: pageSize
type: integer
- description: 页码
in: query
name: pageIndex
type: integer
responses:
"200":
description: '{"code": 200, "data": [...]}'
schema:
type: string
security:
- Bearer: []
summary: <俱乐部>获取球员比赛列表
tags:
- <俱乐部>球员
/api/v1/org-club-team:
get:
description: <俱乐部>获取球队数据列表
......@@ -2459,7 +2522,7 @@ paths:
summary: <俱乐部>获取球队数据列表
tags:
- <俱乐部>球队
/api/v1/org-club-team/{id}:
/api/v1/org-club-team/get:
get:
description: <俱乐部>获取球队比赛详情
parameters:
......@@ -2499,6 +2562,24 @@ paths:
summary: <俱乐部>获取球队比赛列表
tags:
- <俱乐部>球队
/api/v1/org-club-team/info:
get:
description: <赛事>获取比赛附加数据(比赛详情,联赛,赛区,赛季,球队)
parameters:
- description: id
in: path
name: id
type: string
responses:
"200":
description: '{"code": 200, "data": [...]}'
schema:
type: string
security:
- Bearer: []
summary: <赛事>获取比赛附加数据(比赛详情,联赛,赛区,赛季,球队)
tags:
- <赛事>比赛
/api/v1/org-club-user:
delete:
description: 删除俱乐部账户信息
......@@ -2744,7 +2825,7 @@ paths:
- <赛事>赛区
/api/v1/org-league:
delete:
description: 删除联赛
description: <赛事>删除联赛
parameters:
- description: ids
in: body
......@@ -2760,11 +2841,11 @@ paths:
type: string
security:
- Bearer: []
summary: 删除联赛
summary: <赛事>删除联赛
tags:
- 联赛
- <赛事>联赛
get:
description: 获取联赛列表
description: <赛事>获取联赛列表
parameters:
- description: 页条数
in: query
......@@ -2781,13 +2862,13 @@ paths:
type: string
security:
- Bearer: []
summary: 获取联赛列表
summary: <赛事>获取联赛列表
tags:
- 联赛
- <赛事>联赛
post:
consumes:
- application/json
description: 创建联赛
description: <赛事>创建联赛
parameters:
- description: data
in: body
......@@ -2802,12 +2883,12 @@ paths:
type: string
security:
- Bearer: []
summary: 创建联赛
summary: <赛事>创建联赛
tags:
- 联赛
- <赛事>联赛
/api/v1/org-league/{id}:
get:
description: 获取联赛
description: <赛事>获取联赛
parameters:
- description: id
in: path
......@@ -2820,13 +2901,13 @@ paths:
type: string
security:
- Bearer: []
summary: 获取联赛
summary: <赛事>获取联赛
tags:
- 联赛
- <赛事>联赛
put:
consumes:
- application/json
description: 修改联赛
description: <赛事>修改联赛
parameters:
- description: body
in: body
......@@ -2841,9 +2922,9 @@ paths:
type: string
security:
- Bearer: []
summary: 修改联赛
summary: <赛事>修改联赛
tags:
- 联赛
- <赛事>联赛
/api/v1/org-match:
delete:
description: <赛事>删除比赛
......@@ -3363,7 +3444,7 @@ paths:
tags:
- <球队>球员
get:
description: <俱乐部>获取球员数据列表
description: <球队>获取球员列表
parameters:
- description: 页条数
in: query
......@@ -3380,9 +3461,9 @@ paths:
type: string
security:
- Bearer: []
summary: <俱乐部>获取球员数据列表
summary: <球队>获取球员列表
tags:
- <俱乐部>球员
- <球队>球员
post:
consumes:
- application/json
......@@ -3508,7 +3589,7 @@ paths:
- 球员账户信息
/api/v1/org-player/{id}:
get:
description: <俱乐部>获取球员比赛详情
description: <球队>获取球员
parameters:
- description: id
in: path
......@@ -3521,9 +3602,9 @@ paths:
type: string
security:
- Bearer: []
summary: <俱乐部>获取球员比赛详情
summary: <球队>获取球员
tags:
- <俱乐部>球员
- <球队>球员
put:
consumes:
- application/json
......@@ -3545,28 +3626,6 @@ paths:
summary: <球队>修改球员
tags:
- <球队>球员
/api/v1/org-player/get-match:
get:
description: <俱乐部>获取球员比赛列表
parameters:
- description: 页条数
in: query
name: pageSize
type: integer
- description: 页码
in: query
name: pageIndex
type: integer
responses:
"200":
description: '{"code": 200, "data": [...]}'
schema:
type: string
security:
- Bearer: []
summary: <俱乐部>获取球员比赛列表
tags:
- <俱乐部>球员
/api/v1/org-season:
delete:
description: 删除赛季
......@@ -3912,6 +3971,24 @@ paths:
summary: <球队>获取比赛所有球员
tags:
- <球队>比赛
/api/v1/org-team-match/info/{id}:
get:
description: <赛事>获取比赛附加数据(比赛详情,联赛,赛区,赛季,球队)
parameters:
- description: id
in: path
name: id
type: string
responses:
"200":
description: '{"code": 200, "data": [...]}'
schema:
type: string
security:
- Bearer: []
summary: <赛事>获取比赛附加数据(比赛详情,联赛,赛区,赛季,球队)
tags:
- <赛事>比赛
/api/v1/org-team-match/update-players/{id}:
put:
consumes:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment