Commit 344f0a26 authored by haoyanbin's avatar haoyanbin

Swag

parent 2d8d58d4
......@@ -168,7 +168,7 @@ func (e OrgTeamMatchEvaluate) Get(c *gin.Context) {
// @Tags <球队>教练评价
// @Accept application/json
// @Product application/json
// @Param data body dto.OrgMatchEvaluateUpdateReq true "body"
// @Param data body dto.OrgTeamMatchEvaluateUpdateReq true "body"
// @Success 200 {string} string "{"code": 200, "message": "修改成功"}"
// @Router /api/v1/org-team-match-evaluate/{id} [put]
// @Security Bearer
......
......@@ -206,30 +206,32 @@ func (e OrgUser) Delete(c *gin.Context) {
// @Router /api/v1/org-user/status [put]
// @Security Bearer
func (e OrgUser) UpdateStatus(c *gin.Context) {
// s := service.OrgUser{}
// req := dto.OrgUserUpdateStatusReq{}
// err := e.MakeContext(c).
// MakeOrm().
// Bind(&req, binding.JSON, nil).
// 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 {
// e.Logger.Error(err)
// return
// }
// e.OK(req.GetId(), "更新成功")
s := service.OrgUser{}
req := dto.OrgUserUpdateStatusReq{}
err := e.MakeContext(c).
MakeOrm().
Bind(&req, binding.JSON, nil).
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.OrgUserUpdateReq{}
reqUpdate.Status = req.Status
err = s.Update(&reqUpdate, p)
if err != nil {
e.Logger.Error(err)
return
}
e.OK(1, "更新成功")
}
// ResetPwd 重置用户密码
......
......@@ -60,6 +60,7 @@ type OrgUserUpdateReq struct {
NickName string `json:"nickName" comment:"姓名"`
NickNameEn string `json:"nickNameEn" comment:"姓名"`
Username string `json:"username" comment:"账号"`
Status string `json:"status" comment:"状态" default:"2"`
common.ControlBy
}
......@@ -75,7 +76,7 @@ func (s *OrgUserUpdateReq) Generate(model *models.SysUser) {
model.NickNameEn = s.NickNameEn
model.Username = s.Username
model.RoleId, _ = strconv.Atoi(s.RoleId)
model.Status = "2"
model.Status = s.Status
model.Password = Pwd("123456")
}
......
......@@ -20,9 +20,14 @@ type OrgMatchEvaluate struct {
// GetPage 获取OrgMatchEvaluate列表
func (e *OrgMatchEvaluate) GetPage(c *dto.OrgMatchEvaluateGetPageReq, p *actions.DataPermission, list *[]dto.OrgMatchEvaluateGetPageReply, count *int64) error {
var err error
field := "omtp.id, ol.league_name, od.division_name, os.season_name, om.rounds," +
"omtp.player_name, om.match_start_time, om.match_end_time," +
"IF(ome.content_status='' or ome.content_status is null,1,ome.content_status)as content_status," +
"IF(ome.mv_status='' or ome.mv_status is null,1,ome.mv_status)as mv_status," +
"IF(ome.status='' or ome.status is null,1,ome.status)as status," +
"ome.remark"
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.content_status, ome.mv_status, ome.status, ome.remark").
Select(field).
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").
......
......@@ -15,24 +15,22 @@ type OrgUser struct {
service.Service
}
// GetPage 获取OrgTeamUser列表
// GetPage 获取OrgUser列表
func (e *OrgUser) GetPage(c *dto.OrgUserGetPageReq, p *actions.DataPermission, list *[]dto.OrgUserGetPageReply, count *int64) error {
var err error
var data models.SysUser
field := "otu.id, oc.club_name, ot.team_name, otu.name, otu.sex, sr.role_name, su.status"
field := "su.user_id, su.username, su.nick_name, su.nick_name_en, sr.role_name, su.status"
err = e.Orm.Table("org_team_user as otu").
err = e.Orm.Table("sys_user as su").
Select(field).
Joins("left join org_team as ot on otu.team_id=ot.id").
Joins("left join org_club as oc on otu.club_id=oc.id").
Joins("left join sys_user as su on otu.user_id=su.user_id").
Joins("left join sys_role as sr on su.role_id=sr.role_id").
Joins("left join sys_role as sr on su.role_id = sr.role_id").
Scopes(
cDto.MakeCondition(c.GetNeedSearch()),
cDto.Paginate(c.GetPageSize(), c.GetPageIndex()),
actions.Permission(data.TableName(), p),
cDto.PassDel("otu"),
cDto.PassDel("su"),
).
Where("su.user_type=?", 2).
Find(list).Limit(-1).Offset(-1).
Count(count).Error
if err != nil {
......@@ -44,14 +42,10 @@ func (e *OrgUser) GetPage(c *dto.OrgUserGetPageReq, p *actions.DataPermission, l
// Get 获取OrgTeamUser对象
func (e *OrgUser) Get(d *dto.OrgUserGetReq, p *actions.DataPermission, model *dto.OrgUserGetReply) error {
field := "otu.id,oc.club_name, otu.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"
field := "su.user_id, su.username, su.nick_name, su.nick_name_en, su.status"
err := e.Orm.Table("org_team_user as otu").
err := e.Orm.Table("sys_user as su").
Select(field).
Joins("left join org_team as ot on otu.team_id=ot.id").
Joins("left join org_club as oc on otu.club_id=oc.id").
Joins("left join sys_user as su on otu.user_id=su.user_id").
Joins("left join sys_role as sr on su.role_id=sr.role_id").
First(model, d.GetId()).Error
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) {
err = errors.New("查看对象不存在或无权查看")
......
......@@ -3903,7 +3903,7 @@ var doc = `{
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.OrgMatchEvaluateUpdateReq"
"$ref": "#/definitions/dto.OrgTeamMatchEvaluateUpdateReq"
}
}
],
......@@ -4605,84 +4605,6 @@ var doc = `{
}
}
},
"/api/v1/org-user/avatar": {
"post": {
"security": [
{
"Bearer": []
}
],
"description": "获取JSON",
"consumes": [
"multipart/form-data"
],
"tags": [
"个人中心"
],
"summary": "修改头像",
"parameters": [
{
"type": "file",
"description": "file",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "{\"code\": 200, \"data\": [...]}",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/org-user/getinfo": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "获取JSON",
"tags": [
"个人中心"
],
"summary": "获取个人信息",
"responses": {
"200": {
"description": "{\"code\": 200, \"data\": [...]}",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/org-user/profile": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "获取JSON",
"tags": [
"个人中心"
],
"summary": "获取个人中心用户",
"responses": {
"200": {
"description": "{\"code\": 200, \"data\": [...]}",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/org-user/pwd/reset": {
"put": {
"security": [
......@@ -4719,42 +4641,6 @@ var doc = `{
}
}
},
"/api/v1/org-user/pwd/set": {
"put": {
"security": [
{
"Bearer": []
}
],
"description": "获取JSON",
"consumes": [
"application/json"
],
"tags": [
"用户"
],
"summary": "重置密码",
"parameters": [
{
"description": "body",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.PassWord"
}
}
],
"responses": {
"200": {
"description": "{\"code\": 200, \"data\": [...]}",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/org-user/status": {
"put": {
"security": [
......@@ -6558,7 +6444,7 @@ var doc = `{
}
},
"/mobile/v1/org-news": {
"get": {
"post": {
"security": [
{
"Bearer": []
......@@ -7284,8 +7170,19 @@ var doc = `{
"dto.OrgLeagueGetPageReq": {
"type": "object",
"properties": {
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"id": {
"type": "integer"
},
"leagueName": {
"description": "联赛级别",
"type": "string"
},
"pageIndex": {
......@@ -7293,6 +7190,15 @@ var doc = `{
},
"pageSize": {
"type": "integer"
},
"status": {
"type": "string"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
......@@ -7820,6 +7726,9 @@ var doc = `{
"playerName": {
"type": "string"
},
"playerUserId": {
"type": "string"
},
"status": {
"type": "string"
},
......@@ -8167,6 +8076,38 @@ var doc = `{
}
}
},
"dto.OrgTeamMatchEvaluateUpdateReq": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"contentStatus": {
"type": "string"
},
"createBy": {
"type": "integer"
},
"id": {
"type": "integer"
},
"matchId": {
"type": "string"
},
"playerId": {
"type": "string"
},
"rounds": {
"type": "string"
},
"teamUserId": {
"type": "string"
},
"updateBy": {
"type": "integer"
}
}
},
"dto.OrgTeamMatchGetPageReq": {
"type": "object",
"properties": {
......@@ -9487,12 +9428,21 @@ var doc = `{
"models.SysDept": {
"type": "object",
"properties": {
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.SysDept"
}
},
"createBy": {
"type": "integer"
},
"createdAt": {
"type": "string"
},
"dataScope": {
"type": "string"
},
"deptId": {
"description": "部门编码",
"type": "integer"
......@@ -9512,6 +9462,9 @@ var doc = `{
"description": "负责人",
"type": "string"
},
"params": {
"type": "string"
},
"parentId": {
"description": "上级部门",
"type": "integer"
......
......@@ -3886,7 +3886,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.OrgMatchEvaluateUpdateReq"
"$ref": "#/definitions/dto.OrgTeamMatchEvaluateUpdateReq"
}
}
],
......@@ -4588,84 +4588,6 @@
}
}
},
"/api/v1/org-user/avatar": {
"post": {
"security": [
{
"Bearer": []
}
],
"description": "获取JSON",
"consumes": [
"multipart/form-data"
],
"tags": [
"个人中心"
],
"summary": "修改头像",
"parameters": [
{
"type": "file",
"description": "file",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "{\"code\": 200, \"data\": [...]}",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/org-user/getinfo": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "获取JSON",
"tags": [
"个人中心"
],
"summary": "获取个人信息",
"responses": {
"200": {
"description": "{\"code\": 200, \"data\": [...]}",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/org-user/profile": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "获取JSON",
"tags": [
"个人中心"
],
"summary": "获取个人中心用户",
"responses": {
"200": {
"description": "{\"code\": 200, \"data\": [...]}",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/org-user/pwd/reset": {
"put": {
"security": [
......@@ -4702,42 +4624,6 @@
}
}
},
"/api/v1/org-user/pwd/set": {
"put": {
"security": [
{
"Bearer": []
}
],
"description": "获取JSON",
"consumes": [
"application/json"
],
"tags": [
"用户"
],
"summary": "重置密码",
"parameters": [
{
"description": "body",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.PassWord"
}
}
],
"responses": {
"200": {
"description": "{\"code\": 200, \"data\": [...]}",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/org-user/status": {
"put": {
"security": [
......@@ -6541,7 +6427,7 @@
}
},
"/mobile/v1/org-news": {
"get": {
"post": {
"security": [
{
"Bearer": []
......@@ -7267,8 +7153,19 @@
"dto.OrgLeagueGetPageReq": {
"type": "object",
"properties": {
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"id": {
"type": "integer"
},
"leagueName": {
"description": "联赛级别",
"type": "string"
},
"pageIndex": {
......@@ -7276,6 +7173,15 @@
},
"pageSize": {
"type": "integer"
},
"status": {
"type": "string"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
......@@ -7803,6 +7709,9 @@
"playerName": {
"type": "string"
},
"playerUserId": {
"type": "string"
},
"status": {
"type": "string"
},
......@@ -8150,6 +8059,38 @@
}
}
},
"dto.OrgTeamMatchEvaluateUpdateReq": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"contentStatus": {
"type": "string"
},
"createBy": {
"type": "integer"
},
"id": {
"type": "integer"
},
"matchId": {
"type": "string"
},
"playerId": {
"type": "string"
},
"rounds": {
"type": "string"
},
"teamUserId": {
"type": "string"
},
"updateBy": {
"type": "integer"
}
}
},
"dto.OrgTeamMatchGetPageReq": {
"type": "object",
"properties": {
......@@ -9470,12 +9411,21 @@
"models.SysDept": {
"type": "object",
"properties": {
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.SysDept"
}
},
"createBy": {
"type": "integer"
},
"createdAt": {
"type": "string"
},
"dataScope": {
"type": "string"
},
"deptId": {
"description": "部门编码",
"type": "integer"
......@@ -9495,6 +9445,9 @@
"description": "负责人",
"type": "string"
},
"params": {
"type": "string"
},
"parentId": {
"description": "上级部门",
"type": "integer"
......
......@@ -232,13 +232,26 @@ definitions:
type: object
dto.OrgLeagueGetPageReq:
properties:
createBy:
type: string
createdAt:
type: string
deletedAt:
type: string
id:
type: integer
leagueName:
description: 联赛级别
type: string
pageIndex:
type: integer
pageSize:
type: integer
status:
type: string
updateBy:
type: string
updatedAt:
type: string
type: object
dto.OrgLeagueInsertReq:
properties:
......@@ -588,6 +601,8 @@ definitions:
type: integer
playerName:
type: string
playerUserId:
type: string
status:
type: string
teamId:
......@@ -818,6 +833,27 @@ definitions:
updateBy:
type: integer
type: object
dto.OrgTeamMatchEvaluateUpdateReq:
properties:
content:
type: string
contentStatus:
type: string
createBy:
type: integer
id:
type: integer
matchId:
type: string
playerId:
type: string
rounds:
type: string
teamUserId:
type: string
updateBy:
type: integer
type: object
dto.OrgTeamMatchGetPageReq:
properties:
divisionId:
......@@ -1714,10 +1750,16 @@ definitions:
type: object
models.SysDept:
properties:
children:
items:
$ref: '#/definitions/models.SysDept'
type: array
createBy:
type: integer
createdAt:
type: string
dataScope:
type: string
deptId:
description: 部门编码
type: integer
......@@ -1732,6 +1774,8 @@ definitions:
leader:
description: 负责人
type: string
params:
type: string
parentId:
description: 上级部门
type: integer
......@@ -4366,7 +4410,7 @@ paths:
name: data
required: true
schema:
$ref: '#/definitions/dto.OrgMatchEvaluateUpdateReq'
$ref: '#/definitions/dto.OrgTeamMatchEvaluateUpdateReq'
responses:
"200":
description: '{"code": 200, "message": "修改成功"}'
......@@ -4877,53 +4921,6 @@ paths:
summary: 修改用户数据
tags:
- 用户
/api/v1/org-user/avatar:
post:
consumes:
- multipart/form-data
description: 获取JSON
parameters:
- description: file
in: formData
name: file
required: true
type: file
responses:
"200":
description: '{"code": 200, "data": [...]}'
schema:
type: string
security:
- Bearer: []
summary: 修改头像
tags:
- 个人中心
/api/v1/org-user/getinfo:
get:
description: 获取JSON
responses:
"200":
description: '{"code": 200, "data": [...]}'
schema:
type: string
security:
- Bearer: []
summary: 获取个人信息
tags:
- 个人中心
/api/v1/org-user/profile:
get:
description: 获取JSON
responses:
"200":
description: '{"code": 200, "data": [...]}'
schema:
type: string
security:
- Bearer: []
summary: 获取个人中心用户
tags:
- 个人中心
/api/v1/org-user/pwd/reset:
put:
consumes:
......@@ -4946,28 +4943,6 @@ paths:
summary: 重置用户密码
tags:
- 用户
/api/v1/org-user/pwd/set:
put:
consumes:
- application/json
description: 获取JSON
parameters:
- description: body
in: body
name: data
required: true
schema:
$ref: '#/definitions/dto.PassWord'
responses:
"200":
description: '{"code": 200, "data": [...]}'
schema:
type: string
security:
- Bearer: []
summary: 重置密码
tags:
- 用户
/api/v1/org-user/status:
put:
consumes:
......@@ -6024,7 +5999,7 @@ paths:
- Bearer: []
summary: 退出登录
/mobile/v1/org-news:
get:
post:
description: <手机端>首页
parameters:
- description: 页条数
......
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