@@ -73,7 +73,7 @@ func GetPublicPlatoonBasic(c *gin.Context) { | |||||
// @Param req body interface{} true "公排设置表单内容" | // @Param req body interface{} true "公排设置表单内容" | ||||
// @Success 200 {string} "success" | // @Success 200 {string} "success" | ||||
// @Failure 400 {object} md.Response "具体错误" | // @Failure 400 {object} md.Response "具体错误" | ||||
// @Router /api/publicPlatoon/getBasic [post] | |||||
// @Router /api/publicPlatoon/updateBasic [put] | |||||
func UpdatePublicPlatoonBasic(c *gin.Context) { | func UpdatePublicPlatoonBasic(c *gin.Context) { | ||||
var req *md.UpdatePublicPlatoonBasicReq | var req *md.UpdatePublicPlatoonBasicReq | ||||
if err := c.ShouldBindJSON(&req); err != nil { | if err := c.ShouldBindJSON(&req); err != nil { | ||||
@@ -179,134 +179,124 @@ func GetRelationshipMap(c *gin.Context) { | |||||
// @Accept json | // @Accept json | ||||
// @Produce json | // @Produce json | ||||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | // @param Authorization header string true "验证参数Bearer和token空格拼接" | ||||
// @Param req query public_platoon.FindUserRelationshipMapReq true "用户ID" | |||||
// @Success 200 {object} public_platoon.RelationshipMap "具体数据" | |||||
// @Param uid query string true "用户ID" | |||||
// @Success 200 {object} md.TreeNode "具体数据" | |||||
// @Failure 400 {object} md.Response "具体错误" | // @Failure 400 {object} md.Response "具体错误" | ||||
// @Router /api/publicPlatoon/findUserRelationshipMap [get] | // @Router /api/publicPlatoon/findUserRelationshipMap [get] | ||||
//func FindUserRelationshipMap(c *gin.Context) { | |||||
// var req *public_platoon.FindUserRelationshipMapReq | |||||
// if err := c.ShouldBindQuery(&req); err != nil { | |||||
// e.OutErr(c, e.ERR_INVALID_ARGS, err) | |||||
// return | |||||
// } | |||||
// | |||||
// RelationDb := implement.NewPublicPlatoonUserRelationDb(db.Db) | |||||
// relations, err1 := RelationDb.PublicPlatoonUserRelationFindByUid(req.Uid) | |||||
// if err1 != nil { | |||||
// e.OutErr(c, e.ERR_DB_ORM, err1) | |||||
// return | |||||
// } | |||||
// | |||||
// userDb := implement.NewUserDb(db.Db) | |||||
// user, err3 := userDb.UserGetOneById(relations[0].Uid) | |||||
// if err3 != nil { | |||||
// e.OutErr(c, e.ERR_DB_ORM, err3.Error()) | |||||
// return | |||||
// } | |||||
// var son []public_platoon.RelationshipMap | |||||
// res := public_platoon.RelationshipMap{ | |||||
// AvatarUrl: user.Avatar, | |||||
// Phone: user.Phone, | |||||
// Nickname: user.Nickname, | |||||
// Uid: user.Id, | |||||
// Pid: relations[0].RecommendUid, | |||||
// Level: relations[0].Level1, | |||||
// Position: relations[0].Position1, | |||||
// SystemID: relations[0].Id, | |||||
// Son: son, | |||||
// } | |||||
// for i := 1; i < len(relations); i++ { | |||||
// user, err4 := userDb.UserGetOneById(relations[i].Uid) | |||||
// if err4 != nil { | |||||
// e.OutErr(c, e.ERR_DB_ORM, err4.Error()) | |||||
// return | |||||
// } | |||||
// node := public_platoon.RelationshipMap{ | |||||
// AvatarUrl: user.Avatar, | |||||
// Phone: user.Phone, | |||||
// Nickname: user.Nickname, | |||||
// Uid: user.Id, | |||||
// Pid: relations[i].RecommendUid, | |||||
// Level: relations[i].Level1, | |||||
// Position: relations[i].Position1, | |||||
// SystemID: relations[i].Id, | |||||
// Son: nil, | |||||
// } | |||||
// res.Son = append(res.Son, node) | |||||
// } | |||||
// e.OutSuc(c, res, nil) | |||||
//} | |||||
// | |||||
//// FindSubUserRelationshipMap | |||||
//// @Summary 制度中心-公排管理-关系分布图(获取指定用户上级) | |||||
//// @Tags 公排管理 | |||||
//// @Description 关系分布图(获取指定用户上级) | |||||
//// @Accept json | |||||
//// @Produce json | |||||
//// @param Authorization header string true "验证参数Bearer和token空格拼接" | |||||
//// @Param req query public_platoon.FindSubUserRelationshipMapReq true "用户ID" | |||||
//// @Success 200 {object} public_platoon.RelationshipMap "具体数据" | |||||
//// @Failure 400 {object} md.Response "具体错误" | |||||
//// @Router /api/publicPlatoon/findSubUserRelationshipMap [get] | |||||
//func FindSubUserRelationshipMap(c *gin.Context) { | |||||
// var req *public_platoon.FindSubUserRelationshipMapReq | |||||
// if err := c.ShouldBindQuery(&req); err != nil { | |||||
// e.OutErr(c, e.ERR_INVALID_ARGS, err) | |||||
// return | |||||
// } | |||||
// | |||||
// RelationDb := implement.NewPublicPlatoonUserRelationDb(db.Db) | |||||
// sonRelation, err1 := RelationDb.PublicPlatoonUserRelationGetOneByUid(req.Uid) | |||||
// if err1 != nil { | |||||
// e.OutErr(c, e.ERR_DB_ORM, err1) | |||||
// return | |||||
// } | |||||
// parentRelation, err2 := RelationDb.PublicPlatoonUserRelationGetOneByUid(sonRelation.FatherUid1) | |||||
// if err2 != nil { | |||||
// e.OutErr(c, e.ERR_DB_ORM, err2) | |||||
// return | |||||
// } | |||||
// | |||||
// userDb := implement.NewUserDb(db.Db) | |||||
// son, err3 := userDb.UserGetOneById(sonRelation.Uid) | |||||
// if err3 != nil { | |||||
// e.OutErr(c, e.ERR_DB_ORM, err3.Error()) | |||||
// return | |||||
// } | |||||
// | |||||
// parent, err4 := userDb.UserGetOneById(parentRelation.Uid) | |||||
// if err4 != nil { | |||||
// e.OutErr(c, e.ERR_DB_ORM, err4.Error()) | |||||
// return | |||||
// } | |||||
// | |||||
// var sonNode []public_platoon.RelationshipMap | |||||
// sonNode1 := public_platoon.RelationshipMap{ | |||||
// AvatarUrl: son.Avatar, | |||||
// Phone: son.Phone, | |||||
// Nickname: son.Nickname, | |||||
// Uid: son.Id, | |||||
// Pid: sonRelation.RecommendUid, | |||||
// Level: sonRelation.Level1, | |||||
// Position: sonRelation.Position1, | |||||
// SystemID: sonRelation.Id, | |||||
// Son: nil, | |||||
// } | |||||
// sonNode = append(sonNode, sonNode1) | |||||
// res := public_platoon.RelationshipMap{ | |||||
// AvatarUrl: parent.Avatar, | |||||
// Phone: parent.Phone, | |||||
// Nickname: parent.Nickname, | |||||
// Uid: parent.Id, | |||||
// Pid: parentRelation.RecommendUid, | |||||
// Level: parentRelation.Level1, | |||||
// Position: parentRelation.Position1, | |||||
// SystemID: parentRelation.Id, | |||||
// Son: sonNode, | |||||
// } | |||||
// e.OutSuc(c, res, nil) | |||||
//} | |||||
func FindUserRelationshipMap(c *gin.Context) { | |||||
uid := c.Query("uid") | |||||
userRelationDb := implement.NewPublicPlatoonUserRelationDb(db.Db) | |||||
var err error | |||||
var relation *model.PublicPlatoonUserRelation | |||||
relation, err = userRelationDb.PublicPlatoonUserRelationGetOneByParams(map[string]interface{}{ | |||||
"key": "uid", | |||||
"value": uid, | |||||
}) | |||||
if err != nil { | |||||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||||
return | |||||
} | |||||
var list *md.TreeNode | |||||
list, err = svc.GetTrees(db.Db, relation, 3) | |||||
if err != nil { | |||||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||||
return | |||||
} | |||||
e.OutSuc(c, list, nil) | |||||
} | |||||
// FindSubUserRelationshipMap | |||||
// @Summary 制度中心-公排管理-关系分布图(获取指定用户上级) | |||||
// @Tags 公排管理 | |||||
// @Description 关系分布图(获取指定用户上级) | |||||
// @Accept json | |||||
// @Produce json | |||||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | |||||
// @Param uid query string true "用户ID" | |||||
// @Success 200 {object} md.RelationshipMap "具体数据" | |||||
// @Failure 400 {object} md.Response "具体错误" | |||||
// @Router /api/publicPlatoon/findSubUserRelationshipMap [get] | |||||
func FindSubUserRelationshipMap(c *gin.Context) { | |||||
uid := c.Query("uid") | |||||
RelationDb := implement.NewPublicPlatoonUserRelationDb(db.Db) | |||||
sonRelation, err1 := RelationDb.PublicPlatoonUserRelationGetOneByParams(map[string]interface{}{ | |||||
"key": "uid", | |||||
"value": uid, | |||||
}) | |||||
if err1 != nil { | |||||
e.OutErr(c, e.ERR_DB_ORM, err1) | |||||
return | |||||
} | |||||
parentRelation, err2 := RelationDb.PublicPlatoonUserRelationGetOneByParams(map[string]interface{}{ | |||||
"key": "uid", | |||||
"value": sonRelation.FatherUid1, | |||||
}) | |||||
if err2 != nil { | |||||
e.OutErr(c, e.ERR_DB_ORM, err2) | |||||
return | |||||
} | |||||
userDb := implement.NewUserDb(db.Db) | |||||
son, err3 := userDb.UserGetOneByParams(map[string]interface{}{ | |||||
"key": "id", | |||||
"value": sonRelation.Uid, | |||||
}) | |||||
if err3 != nil { | |||||
e.OutErr(c, e.ERR_DB_ORM, err3.Error()) | |||||
return | |||||
} | |||||
parent, err4 := userDb.UserGetOneByParams(map[string]interface{}{ | |||||
"key": "id", | |||||
"value": parentRelation.Uid, | |||||
}) | |||||
if err4 != nil { | |||||
e.OutErr(c, e.ERR_DB_ORM, err4.Error()) | |||||
return | |||||
} | |||||
var sonNode []*md.TreeNode | |||||
sonNode = append(sonNode, &md.TreeNode{ | |||||
AvatarURL: son.Avatar, | |||||
Phone: son.Phone, | |||||
Nickname: son.Nickname, | |||||
Uid: son.Id, | |||||
PID: sonRelation.RecommendUid, | |||||
Level: sonRelation.Level1, | |||||
Position: sonRelation.Position1, | |||||
SystemID: sonRelation.Id, | |||||
Son: nil, | |||||
}) | |||||
res := md.TreeNode{ | |||||
AvatarURL: parent.Avatar, | |||||
Phone: parent.Phone, | |||||
Nickname: parent.Nickname, | |||||
Uid: parent.Id, | |||||
PID: parentRelation.RecommendUid, | |||||
Level: parentRelation.Level1, | |||||
Position: parentRelation.Position1, | |||||
SystemID: parentRelation.Id, | |||||
Son: sonNode, | |||||
} | |||||
e.OutSuc(c, res, nil) | |||||
} | |||||
// ExchangeUserPosition | |||||
// @Summary 制度中心-公排管理-关系分布图(位置转换) | |||||
// @Tags 公排管理 | |||||
// @Description 关系分布图(位置转换) | |||||
// @Accept json | |||||
// @Produce json | |||||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | |||||
// @Param req body interface{} true "需要交换的两个位置" | |||||
// @Success 200 {} "成功返回" | |||||
// @Failure 400 {object} md.Response "具体错误" | |||||
// @Router /api/publicPlatoon/exchangeUserPosition [post] | |||||
func ExchangeUserPosition(c *gin.Context) { | func ExchangeUserPosition(c *gin.Context) { | ||||
var req *md.ExchangeUserPositionReq | var req *md.ExchangeUserPositionReq | ||||
if err1 := c.ShouldBindJSON(&req); err1 != nil { | if err1 := c.ShouldBindJSON(&req); err1 != nil { | ||||
@@ -314,8 +304,8 @@ func ExchangeUserPosition(c *gin.Context) { | |||||
return | return | ||||
} | } | ||||
relationDb := implement.NewPublicPlatoonUserRelationDb(db.Db) | |||||
relation1, err2 := relationDb.PublicPlatoonUserRelationGetOneByPosition(req.Position1) | |||||
userRelationDb := implement.NewPublicPlatoonUserRelationDb(db.Db) | |||||
relation1, err2 := userRelationDb.PublicPlatoonUserRelationGetOneByPosition(req.Position1) | |||||
if err2 != nil { | if err2 != nil { | ||||
e.OutErr(c, e.ERR_DB_ORM, err2) | e.OutErr(c, e.ERR_DB_ORM, err2) | ||||
return | return | ||||
@@ -325,7 +315,7 @@ func ExchangeUserPosition(c *gin.Context) { | |||||
return | return | ||||
} | } | ||||
relation2, err3 := relationDb.PublicPlatoonUserRelationGetOneByPosition(req.Position1) | |||||
relation2, err3 := userRelationDb.PublicPlatoonUserRelationGetOneByPosition(req.Position1) | |||||
if err3 != nil { | if err3 != nil { | ||||
e.OutErr(c, e.ERR_DB_ORM, err3) | e.OutErr(c, e.ERR_DB_ORM, err3) | ||||
return | return | ||||
@@ -339,9 +329,11 @@ func ExchangeUserPosition(c *gin.Context) { | |||||
e.OutErr(c, e.ERR_BAD_REQUEST, errors.New("创始人位置不能被修改")) | e.OutErr(c, e.ERR_BAD_REQUEST, errors.New("创始人位置不能被修改")) | ||||
} | } | ||||
//uid1 := relation1.Uid | |||||
//uid2 := relation2.Uid | |||||
//recommendUid1 := relation1.RecommendUid | |||||
//recommendUid2 := relation2.RecommendUid | |||||
//relation1.Uid = "" | |||||
err4 := svc.ExchangeUserPosition(db.Db, relation1, relation2) | |||||
if err4 != nil { | |||||
e.OutErr(c, e.ERR_DB_ORM, err4.Error()) | |||||
return | |||||
} | |||||
e.OutSuc(c, nil, nil) | |||||
} | } |
@@ -43,17 +43,9 @@ type RelationshipMapResp struct { | |||||
SearchUid string `json:"searchUid"` | SearchUid string `json:"searchUid"` | ||||
} | } | ||||
type FindUserRelationshipMapReq struct { | |||||
Uid int64 `json:"uid"` | |||||
} | |||||
type FindSubUserRelationshipMapReq struct { | |||||
Uid int64 `json:"uid"` | |||||
} | |||||
type ExchangeUserPositionReq struct { | type ExchangeUserPositionReq struct { | ||||
Position1 int64 `json:"position_1"` | |||||
Position2 int64 `json:"position_2"` | |||||
Position1 int64 `json:"position_1,required"` | |||||
Position2 int64 `json:"position_2,required"` | |||||
} | } | ||||
type TreeNode struct { | type TreeNode struct { | ||||
@@ -63,7 +55,7 @@ type TreeNode struct { | |||||
Uid int64 `json:"uid"` | Uid int64 `json:"uid"` | ||||
PID int64 `json:"pid"` | PID int64 `json:"pid"` | ||||
Position int64 `json:"position"` | Position int64 `json:"position"` | ||||
SystemID int64 `json:"system_id"` | |||||
SystemID int `json:"system_id"` | |||||
Level int `json:"level"` | Level int `json:"level"` | ||||
Son []*TreeNode `json:"son"` | Son []*TreeNode `json:"son"` | ||||
} | } |
@@ -62,8 +62,8 @@ func rInstitutionalManagement(r *gin.RouterGroup) { //制度管理 | |||||
rPublicPlatoon.GET("/getBasic", public_platoon.GetPublicPlatoonBasic) | rPublicPlatoon.GET("/getBasic", public_platoon.GetPublicPlatoonBasic) | ||||
rPublicPlatoon.PUT("/updateBasic", public_platoon.UpdatePublicPlatoonBasic) | rPublicPlatoon.PUT("/updateBasic", public_platoon.UpdatePublicPlatoonBasic) | ||||
rPublicPlatoon.GET("/relationshipMap", public_platoon.GetRelationshipMap) | rPublicPlatoon.GET("/relationshipMap", public_platoon.GetRelationshipMap) | ||||
//rPublicPlatoon.GET("/findUserRelationshipMap", public_platoon.FindUserRelationshipMap) | |||||
//rPublicPlatoon.GET("/findSubUserRelationshipMap", public_platoon.FindSubUserRelationshipMap) | |||||
rPublicPlatoon.GET("/findUserRelationshipMap", public_platoon.FindUserRelationshipMap) | |||||
rPublicPlatoon.GET("/findSubUserRelationshipMap", public_platoon.FindSubUserRelationshipMap) | |||||
rPublicPlatoon.POST("/exchangeUserPosition", public_platoon.ExchangeUserPosition) | rPublicPlatoon.POST("/exchangeUserPosition", public_platoon.ExchangeUserPosition) | ||||
} | } | ||||
} | } | ||||
@@ -3,6 +3,8 @@ package svc | |||||
import ( | import ( | ||||
md "applet/app/md/institutional_management/public_platoon" | md "applet/app/md/institutional_management/public_platoon" | ||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" | "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | ||||
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" | |||||
"fmt" | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -79,3 +81,58 @@ func GetTrees(engine *xorm.Engine, firstUser *model.PublicPlatoonUserRelation, l | |||||
trees([]*md.TreeNode{rootNode}) | trees([]*md.TreeNode{rootNode}) | ||||
return rootNode, nil | return rootNode, nil | ||||
} | } | ||||
func ExchangeUserPosition(engine *xorm.Engine, relation1, relation2 *model.PublicPlatoonUserRelation) (err error) { | |||||
uid1 := relation1.Uid | |||||
uid2 := relation2.Uid | |||||
recommendUid1 := relation1.RecommendUid | |||||
recommendUid2 := relation2.RecommendUid | |||||
relation1.Uid = uid2 | |||||
relation2.Uid = uid1 | |||||
relation1.RecommendUid = recommendUid2 | |||||
relation2.RecommendUid = recommendUid1 | |||||
forceColums := []string{"recommend_uid", "uid"} | |||||
session := engine.NewSession() | |||||
defer session.Close() | |||||
if err := session.Begin(); err != nil { | |||||
return zhios_order_relate_logx.Error(err) | |||||
} | |||||
_, err = session.Where("id = ?", relation1.Id).Cols(forceColums...).Update(session, &relation1) | |||||
if err != nil { | |||||
return zhios_order_relate_logx.Error(err) | |||||
} | |||||
_, err = session.Where("id = ?", relation2.Id).Cols(forceColums...).Update(session, &relation2) | |||||
if err != nil { | |||||
return zhios_order_relate_logx.Error(err) | |||||
} | |||||
m := new(model.PublicPlatoonUserRelation) | |||||
for i := 1; i < 9; i++ { | |||||
str := fmt.Sprintf("father_uid%d", i) | |||||
_, err = session.Table(m).Where(fmt.Sprintf("%s = ?", str), uid1).Cols(str).Update(map[string]interface{}{str: -66}) | |||||
_, err = session.Table(m).Where(fmt.Sprintf("%s = ?", str), uid2).Cols(str).Update(map[string]interface{}{str: -666}) | |||||
if err != nil { | |||||
return zhios_order_relate_logx.Error(err) | |||||
} | |||||
} | |||||
for i := 1; i < 9; i++ { | |||||
str := fmt.Sprintf("father_uid%d", i) | |||||
_, err = session.Table(m).Where(fmt.Sprintf("%s = ?", str), -66).Cols(str).Update(map[string]interface{}{str: uid2}) | |||||
_, err = session.Table(m).Where(fmt.Sprintf("%s = ?", str), -666).Cols(str).Update(map[string]interface{}{str: uid1}) | |||||
if err != nil { | |||||
return zhios_order_relate_logx.Error(err) | |||||
} | |||||
} | |||||
if err = session.Commit(); err != nil { | |||||
return zhios_order_relate_logx.Error(err) | |||||
} | |||||
return nil | |||||
} |
@@ -103,9 +103,54 @@ const docTemplate = `{ | |||||
} | } | ||||
} | } | ||||
}, | }, | ||||
"/api/publicPlatoon/getBasic": { | |||||
"/api/publicPlatoon/exchangeUserPosition": { | |||||
"post": { | |||||
"description": "关系分布图(位置转换)", | |||||
"consumes": [ | |||||
"application/json" | |||||
], | |||||
"produces": [ | |||||
"application/json" | |||||
], | |||||
"tags": [ | |||||
"公排管理" | |||||
], | |||||
"summary": "制度中心-公排管理-关系分布图(位置转换)", | |||||
"parameters": [ | |||||
{ | |||||
"type": "string", | |||||
"description": "验证参数Bearer和token空格拼接", | |||||
"name": "Authorization", | |||||
"in": "header", | |||||
"required": true | |||||
}, | |||||
{ | |||||
"description": "需要交换的两个位置", | |||||
"name": "req", | |||||
"in": "body", | |||||
"required": true, | |||||
"schema": {} | |||||
} | |||||
], | |||||
"responses": { | |||||
"200": { | |||||
"description": "成功返回", | |||||
"schema": { | |||||
"type": "" | |||||
} | |||||
}, | |||||
"400": { | |||||
"description": "具体错误", | |||||
"schema": { | |||||
"$ref": "#/definitions/md.Response" | |||||
} | |||||
} | |||||
} | |||||
} | |||||
}, | |||||
"/api/publicPlatoon/findSubUserRelationshipMap": { | |||||
"get": { | "get": { | ||||
"description": "公排基础设置(获取)", | |||||
"description": "关系分布图(获取指定用户上级)", | |||||
"consumes": [ | "consumes": [ | ||||
"application/json" | "application/json" | ||||
], | ], | ||||
@@ -115,7 +160,7 @@ const docTemplate = `{ | |||||
"tags": [ | "tags": [ | ||||
"公排管理" | "公排管理" | ||||
], | ], | ||||
"summary": "制度中心-公排管理-公排基础设置(获取)", | |||||
"summary": "制度中心-公排管理-关系分布图(获取指定用户上级)", | |||||
"parameters": [ | "parameters": [ | ||||
{ | { | ||||
"type": "string", | "type": "string", | ||||
@@ -123,13 +168,20 @@ const docTemplate = `{ | |||||
"name": "Authorization", | "name": "Authorization", | ||||
"in": "header", | "in": "header", | ||||
"required": true | "required": true | ||||
}, | |||||
{ | |||||
"type": "string", | |||||
"description": "用户ID", | |||||
"name": "uid", | |||||
"in": "query", | |||||
"required": true | |||||
} | } | ||||
], | ], | ||||
"responses": { | "responses": { | ||||
"200": { | "200": { | ||||
"description": "具体数据", | "description": "具体数据", | ||||
"schema": { | "schema": { | ||||
"$ref": "#/definitions/md.GetPublicPlatoonBasicResp" | |||||
"$ref": "#/definitions/md.RelationshipMap" | |||||
} | } | ||||
}, | }, | ||||
"400": { | "400": { | ||||
@@ -139,9 +191,11 @@ const docTemplate = `{ | |||||
} | } | ||||
} | } | ||||
} | } | ||||
}, | |||||
"post": { | |||||
"description": "公排基础设置(修改)", | |||||
} | |||||
}, | |||||
"/api/publicPlatoon/findUserRelationshipMap": { | |||||
"get": { | |||||
"description": "关系分布图(获取指定用户下级)", | |||||
"consumes": [ | "consumes": [ | ||||
"application/json" | "application/json" | ||||
], | ], | ||||
@@ -151,7 +205,7 @@ const docTemplate = `{ | |||||
"tags": [ | "tags": [ | ||||
"公排管理" | "公排管理" | ||||
], | ], | ||||
"summary": "制度中心-公排管理-公排基础设置(修改)", | |||||
"summary": "制度中心-公排管理-关系分布图(获取指定用户下级)", | |||||
"parameters": [ | "parameters": [ | ||||
{ | { | ||||
"type": "string", | "type": "string", | ||||
@@ -161,18 +215,56 @@ const docTemplate = `{ | |||||
"required": true | "required": true | ||||
}, | }, | ||||
{ | { | ||||
"description": "公排设置表单内容", | |||||
"name": "req", | |||||
"in": "body", | |||||
"required": true, | |||||
"schema": {} | |||||
"type": "string", | |||||
"description": "用户ID", | |||||
"name": "uid", | |||||
"in": "query", | |||||
"required": true | |||||
} | } | ||||
], | ], | ||||
"responses": { | "responses": { | ||||
"200": { | "200": { | ||||
"description": "success", | |||||
"description": "具体数据", | |||||
"schema": { | "schema": { | ||||
"type": "string" | |||||
"$ref": "#/definitions/md.TreeNode" | |||||
} | |||||
}, | |||||
"400": { | |||||
"description": "具体错误", | |||||
"schema": { | |||||
"$ref": "#/definitions/md.Response" | |||||
} | |||||
} | |||||
} | |||||
} | |||||
}, | |||||
"/api/publicPlatoon/getBasic": { | |||||
"get": { | |||||
"description": "公排基础设置(获取)", | |||||
"consumes": [ | |||||
"application/json" | |||||
], | |||||
"produces": [ | |||||
"application/json" | |||||
], | |||||
"tags": [ | |||||
"公排管理" | |||||
], | |||||
"summary": "制度中心-公排管理-公排基础设置(获取)", | |||||
"parameters": [ | |||||
{ | |||||
"type": "string", | |||||
"description": "验证参数Bearer和token空格拼接", | |||||
"name": "Authorization", | |||||
"in": "header", | |||||
"required": true | |||||
} | |||||
], | |||||
"responses": { | |||||
"200": { | |||||
"description": "具体数据", | |||||
"schema": { | |||||
"$ref": "#/definitions/md.GetPublicPlatoonBasicResp" | |||||
} | } | ||||
}, | }, | ||||
"400": { | "400": { | ||||
@@ -235,6 +327,51 @@ const docTemplate = `{ | |||||
} | } | ||||
} | } | ||||
} | } | ||||
}, | |||||
"/api/publicPlatoon/updateBasic": { | |||||
"put": { | |||||
"description": "公排基础设置(修改)", | |||||
"consumes": [ | |||||
"application/json" | |||||
], | |||||
"produces": [ | |||||
"application/json" | |||||
], | |||||
"tags": [ | |||||
"公排管理" | |||||
], | |||||
"summary": "制度中心-公排管理-公排基础设置(修改)", | |||||
"parameters": [ | |||||
{ | |||||
"type": "string", | |||||
"description": "验证参数Bearer和token空格拼接", | |||||
"name": "Authorization", | |||||
"in": "header", | |||||
"required": true | |||||
}, | |||||
{ | |||||
"description": "公排设置表单内容", | |||||
"name": "req", | |||||
"in": "body", | |||||
"required": true, | |||||
"schema": {} | |||||
} | |||||
], | |||||
"responses": { | |||||
"200": { | |||||
"description": "success", | |||||
"schema": { | |||||
"type": "string" | |||||
} | |||||
}, | |||||
"400": { | |||||
"description": "具体错误", | |||||
"schema": { | |||||
"$ref": "#/definitions/md.Response" | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
}, | }, | ||||
"definitions": { | "definitions": { | ||||
@@ -293,6 +430,41 @@ const docTemplate = `{ | |||||
} | } | ||||
} | } | ||||
}, | }, | ||||
"md.RelationshipMap": { | |||||
"type": "object", | |||||
"properties": { | |||||
"avatar_url": { | |||||
"type": "string" | |||||
}, | |||||
"level": { | |||||
"type": "integer" | |||||
}, | |||||
"nickname": { | |||||
"type": "string" | |||||
}, | |||||
"phone": { | |||||
"type": "string" | |||||
}, | |||||
"pid": { | |||||
"type": "integer" | |||||
}, | |||||
"position": { | |||||
"type": "integer" | |||||
}, | |||||
"son": { | |||||
"type": "array", | |||||
"items": { | |||||
"$ref": "#/definitions/md.RelationshipMap" | |||||
} | |||||
}, | |||||
"system_id": { | |||||
"type": "integer" | |||||
}, | |||||
"uid": { | |||||
"type": "integer" | |||||
} | |||||
} | |||||
}, | |||||
"md.Response": { | "md.Response": { | ||||
"type": "object", | "type": "object", | ||||
"properties": { | "properties": { | ||||
@@ -96,9 +96,54 @@ | |||||
} | } | ||||
} | } | ||||
}, | }, | ||||
"/api/publicPlatoon/getBasic": { | |||||
"/api/publicPlatoon/exchangeUserPosition": { | |||||
"post": { | |||||
"description": "关系分布图(位置转换)", | |||||
"consumes": [ | |||||
"application/json" | |||||
], | |||||
"produces": [ | |||||
"application/json" | |||||
], | |||||
"tags": [ | |||||
"公排管理" | |||||
], | |||||
"summary": "制度中心-公排管理-关系分布图(位置转换)", | |||||
"parameters": [ | |||||
{ | |||||
"type": "string", | |||||
"description": "验证参数Bearer和token空格拼接", | |||||
"name": "Authorization", | |||||
"in": "header", | |||||
"required": true | |||||
}, | |||||
{ | |||||
"description": "需要交换的两个位置", | |||||
"name": "req", | |||||
"in": "body", | |||||
"required": true, | |||||
"schema": {} | |||||
} | |||||
], | |||||
"responses": { | |||||
"200": { | |||||
"description": "成功返回", | |||||
"schema": { | |||||
"type": "" | |||||
} | |||||
}, | |||||
"400": { | |||||
"description": "具体错误", | |||||
"schema": { | |||||
"$ref": "#/definitions/md.Response" | |||||
} | |||||
} | |||||
} | |||||
} | |||||
}, | |||||
"/api/publicPlatoon/findSubUserRelationshipMap": { | |||||
"get": { | "get": { | ||||
"description": "公排基础设置(获取)", | |||||
"description": "关系分布图(获取指定用户上级)", | |||||
"consumes": [ | "consumes": [ | ||||
"application/json" | "application/json" | ||||
], | ], | ||||
@@ -108,7 +153,7 @@ | |||||
"tags": [ | "tags": [ | ||||
"公排管理" | "公排管理" | ||||
], | ], | ||||
"summary": "制度中心-公排管理-公排基础设置(获取)", | |||||
"summary": "制度中心-公排管理-关系分布图(获取指定用户上级)", | |||||
"parameters": [ | "parameters": [ | ||||
{ | { | ||||
"type": "string", | "type": "string", | ||||
@@ -116,13 +161,20 @@ | |||||
"name": "Authorization", | "name": "Authorization", | ||||
"in": "header", | "in": "header", | ||||
"required": true | "required": true | ||||
}, | |||||
{ | |||||
"type": "string", | |||||
"description": "用户ID", | |||||
"name": "uid", | |||||
"in": "query", | |||||
"required": true | |||||
} | } | ||||
], | ], | ||||
"responses": { | "responses": { | ||||
"200": { | "200": { | ||||
"description": "具体数据", | "description": "具体数据", | ||||
"schema": { | "schema": { | ||||
"$ref": "#/definitions/md.GetPublicPlatoonBasicResp" | |||||
"$ref": "#/definitions/md.RelationshipMap" | |||||
} | } | ||||
}, | }, | ||||
"400": { | "400": { | ||||
@@ -132,9 +184,11 @@ | |||||
} | } | ||||
} | } | ||||
} | } | ||||
}, | |||||
"post": { | |||||
"description": "公排基础设置(修改)", | |||||
} | |||||
}, | |||||
"/api/publicPlatoon/findUserRelationshipMap": { | |||||
"get": { | |||||
"description": "关系分布图(获取指定用户下级)", | |||||
"consumes": [ | "consumes": [ | ||||
"application/json" | "application/json" | ||||
], | ], | ||||
@@ -144,7 +198,7 @@ | |||||
"tags": [ | "tags": [ | ||||
"公排管理" | "公排管理" | ||||
], | ], | ||||
"summary": "制度中心-公排管理-公排基础设置(修改)", | |||||
"summary": "制度中心-公排管理-关系分布图(获取指定用户下级)", | |||||
"parameters": [ | "parameters": [ | ||||
{ | { | ||||
"type": "string", | "type": "string", | ||||
@@ -154,18 +208,56 @@ | |||||
"required": true | "required": true | ||||
}, | }, | ||||
{ | { | ||||
"description": "公排设置表单内容", | |||||
"name": "req", | |||||
"in": "body", | |||||
"required": true, | |||||
"schema": {} | |||||
"type": "string", | |||||
"description": "用户ID", | |||||
"name": "uid", | |||||
"in": "query", | |||||
"required": true | |||||
} | } | ||||
], | ], | ||||
"responses": { | "responses": { | ||||
"200": { | "200": { | ||||
"description": "success", | |||||
"description": "具体数据", | |||||
"schema": { | "schema": { | ||||
"type": "string" | |||||
"$ref": "#/definitions/md.TreeNode" | |||||
} | |||||
}, | |||||
"400": { | |||||
"description": "具体错误", | |||||
"schema": { | |||||
"$ref": "#/definitions/md.Response" | |||||
} | |||||
} | |||||
} | |||||
} | |||||
}, | |||||
"/api/publicPlatoon/getBasic": { | |||||
"get": { | |||||
"description": "公排基础设置(获取)", | |||||
"consumes": [ | |||||
"application/json" | |||||
], | |||||
"produces": [ | |||||
"application/json" | |||||
], | |||||
"tags": [ | |||||
"公排管理" | |||||
], | |||||
"summary": "制度中心-公排管理-公排基础设置(获取)", | |||||
"parameters": [ | |||||
{ | |||||
"type": "string", | |||||
"description": "验证参数Bearer和token空格拼接", | |||||
"name": "Authorization", | |||||
"in": "header", | |||||
"required": true | |||||
} | |||||
], | |||||
"responses": { | |||||
"200": { | |||||
"description": "具体数据", | |||||
"schema": { | |||||
"$ref": "#/definitions/md.GetPublicPlatoonBasicResp" | |||||
} | } | ||||
}, | }, | ||||
"400": { | "400": { | ||||
@@ -228,6 +320,51 @@ | |||||
} | } | ||||
} | } | ||||
} | } | ||||
}, | |||||
"/api/publicPlatoon/updateBasic": { | |||||
"put": { | |||||
"description": "公排基础设置(修改)", | |||||
"consumes": [ | |||||
"application/json" | |||||
], | |||||
"produces": [ | |||||
"application/json" | |||||
], | |||||
"tags": [ | |||||
"公排管理" | |||||
], | |||||
"summary": "制度中心-公排管理-公排基础设置(修改)", | |||||
"parameters": [ | |||||
{ | |||||
"type": "string", | |||||
"description": "验证参数Bearer和token空格拼接", | |||||
"name": "Authorization", | |||||
"in": "header", | |||||
"required": true | |||||
}, | |||||
{ | |||||
"description": "公排设置表单内容", | |||||
"name": "req", | |||||
"in": "body", | |||||
"required": true, | |||||
"schema": {} | |||||
} | |||||
], | |||||
"responses": { | |||||
"200": { | |||||
"description": "success", | |||||
"schema": { | |||||
"type": "string" | |||||
} | |||||
}, | |||||
"400": { | |||||
"description": "具体错误", | |||||
"schema": { | |||||
"$ref": "#/definitions/md.Response" | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
}, | }, | ||||
"definitions": { | "definitions": { | ||||
@@ -286,6 +423,41 @@ | |||||
} | } | ||||
} | } | ||||
}, | }, | ||||
"md.RelationshipMap": { | |||||
"type": "object", | |||||
"properties": { | |||||
"avatar_url": { | |||||
"type": "string" | |||||
}, | |||||
"level": { | |||||
"type": "integer" | |||||
}, | |||||
"nickname": { | |||||
"type": "string" | |||||
}, | |||||
"phone": { | |||||
"type": "string" | |||||
}, | |||||
"pid": { | |||||
"type": "integer" | |||||
}, | |||||
"position": { | |||||
"type": "integer" | |||||
}, | |||||
"son": { | |||||
"type": "array", | |||||
"items": { | |||||
"$ref": "#/definitions/md.RelationshipMap" | |||||
} | |||||
}, | |||||
"system_id": { | |||||
"type": "integer" | |||||
}, | |||||
"uid": { | |||||
"type": "integer" | |||||
} | |||||
} | |||||
}, | |||||
"md.Response": { | "md.Response": { | ||||
"type": "object", | "type": "object", | ||||
"properties": { | "properties": { | ||||
@@ -36,6 +36,29 @@ definitions: | |||||
token: | token: | ||||
type: string | type: string | ||||
type: object | type: object | ||||
md.RelationshipMap: | |||||
properties: | |||||
avatar_url: | |||||
type: string | |||||
level: | |||||
type: integer | |||||
nickname: | |||||
type: string | |||||
phone: | |||||
type: string | |||||
pid: | |||||
type: integer | |||||
position: | |||||
type: integer | |||||
son: | |||||
items: | |||||
$ref: '#/definitions/md.RelationshipMap' | |||||
type: array | |||||
system_id: | |||||
type: integer | |||||
uid: | |||||
type: integer | |||||
type: object | |||||
md.Response: | md.Response: | ||||
properties: | properties: | ||||
code: | code: | ||||
@@ -136,58 +159,119 @@ paths: | |||||
summary: 登陆 | summary: 登陆 | ||||
tags: | tags: | ||||
- 登录 | - 登录 | ||||
/api/publicPlatoon/getBasic: | |||||
/api/publicPlatoon/exchangeUserPosition: | |||||
post: | |||||
consumes: | |||||
- application/json | |||||
description: 关系分布图(位置转换) | |||||
parameters: | |||||
- description: 验证参数Bearer和token空格拼接 | |||||
in: header | |||||
name: Authorization | |||||
required: true | |||||
type: string | |||||
- description: 需要交换的两个位置 | |||||
in: body | |||||
name: req | |||||
required: true | |||||
schema: {} | |||||
produces: | |||||
- application/json | |||||
responses: | |||||
"200": | |||||
description: 成功返回 | |||||
schema: | |||||
type: "" | |||||
"400": | |||||
description: 具体错误 | |||||
schema: | |||||
$ref: '#/definitions/md.Response' | |||||
summary: 制度中心-公排管理-关系分布图(位置转换) | |||||
tags: | |||||
- 公排管理 | |||||
/api/publicPlatoon/findSubUserRelationshipMap: | |||||
get: | get: | ||||
consumes: | consumes: | ||||
- application/json | - application/json | ||||
description: 公排基础设置(获取) | |||||
description: 关系分布图(获取指定用户上级) | |||||
parameters: | parameters: | ||||
- description: 验证参数Bearer和token空格拼接 | - description: 验证参数Bearer和token空格拼接 | ||||
in: header | in: header | ||||
name: Authorization | name: Authorization | ||||
required: true | required: true | ||||
type: string | type: string | ||||
- description: 用户ID | |||||
in: query | |||||
name: uid | |||||
required: true | |||||
type: string | |||||
produces: | produces: | ||||
- application/json | - application/json | ||||
responses: | responses: | ||||
"200": | "200": | ||||
description: 具体数据 | description: 具体数据 | ||||
schema: | schema: | ||||
$ref: '#/definitions/md.GetPublicPlatoonBasicResp' | |||||
$ref: '#/definitions/md.RelationshipMap' | |||||
"400": | "400": | ||||
description: 具体错误 | description: 具体错误 | ||||
schema: | schema: | ||||
$ref: '#/definitions/md.Response' | $ref: '#/definitions/md.Response' | ||||
summary: 制度中心-公排管理-公排基础设置(获取) | |||||
summary: 制度中心-公排管理-关系分布图(获取指定用户上级) | |||||
tags: | tags: | ||||
- 公排管理 | - 公排管理 | ||||
post: | |||||
/api/publicPlatoon/findUserRelationshipMap: | |||||
get: | |||||
consumes: | consumes: | ||||
- application/json | - application/json | ||||
description: 公排基础设置(修改) | |||||
description: 关系分布图(获取指定用户下级) | |||||
parameters: | parameters: | ||||
- description: 验证参数Bearer和token空格拼接 | - description: 验证参数Bearer和token空格拼接 | ||||
in: header | in: header | ||||
name: Authorization | name: Authorization | ||||
required: true | required: true | ||||
type: string | type: string | ||||
- description: 公排设置表单内容 | |||||
in: body | |||||
name: req | |||||
- description: 用户ID | |||||
in: query | |||||
name: uid | |||||
required: true | required: true | ||||
schema: {} | |||||
type: string | |||||
produces: | produces: | ||||
- application/json | - application/json | ||||
responses: | responses: | ||||
"200": | "200": | ||||
description: success | |||||
description: 具体数据 | |||||
schema: | schema: | ||||
type: string | |||||
$ref: '#/definitions/md.TreeNode' | |||||
"400": | "400": | ||||
description: 具体错误 | description: 具体错误 | ||||
schema: | schema: | ||||
$ref: '#/definitions/md.Response' | $ref: '#/definitions/md.Response' | ||||
summary: 制度中心-公排管理-公排基础设置(修改) | |||||
summary: 制度中心-公排管理-关系分布图(获取指定用户下级) | |||||
tags: | |||||
- 公排管理 | |||||
/api/publicPlatoon/getBasic: | |||||
get: | |||||
consumes: | |||||
- application/json | |||||
description: 公排基础设置(获取) | |||||
parameters: | |||||
- description: 验证参数Bearer和token空格拼接 | |||||
in: header | |||||
name: Authorization | |||||
required: true | |||||
type: string | |||||
produces: | |||||
- application/json | |||||
responses: | |||||
"200": | |||||
description: 具体数据 | |||||
schema: | |||||
$ref: '#/definitions/md.GetPublicPlatoonBasicResp' | |||||
"400": | |||||
description: 具体错误 | |||||
schema: | |||||
$ref: '#/definitions/md.Response' | |||||
summary: 制度中心-公排管理-公排基础设置(获取) | |||||
tags: | tags: | ||||
- 公排管理 | - 公排管理 | ||||
/api/publicPlatoon/relationshipMap: | /api/publicPlatoon/relationshipMap: | ||||
@@ -225,6 +309,36 @@ paths: | |||||
summary: 制度中心-公排管理-关系分布图(获取) | summary: 制度中心-公排管理-关系分布图(获取) | ||||
tags: | tags: | ||||
- 公排管理 | - 公排管理 | ||||
/api/publicPlatoon/updateBasic: | |||||
put: | |||||
consumes: | |||||
- application/json | |||||
description: 公排基础设置(修改) | |||||
parameters: | |||||
- description: 验证参数Bearer和token空格拼接 | |||||
in: header | |||||
name: Authorization | |||||
required: true | |||||
type: string | |||||
- description: 公排设置表单内容 | |||||
in: body | |||||
name: req | |||||
required: true | |||||
schema: {} | |||||
produces: | |||||
- application/json | |||||
responses: | |||||
"200": | |||||
description: success | |||||
schema: | |||||
type: string | |||||
"400": | |||||
description: 具体错误 | |||||
schema: | |||||
$ref: '#/definitions/md.Response' | |||||
summary: 制度中心-公排管理-公排基础设置(修改) | |||||
tags: | |||||
- 公排管理 | |||||
securityDefinitions: | securityDefinitions: | ||||
MasterID: | MasterID: | ||||
in: header | in: header | ||||