Kaynağa Gözat

add 新增查询社区分红 新增查询免罚用户

master
shenjiachi 2 hafta önce
ebeveyn
işleme
4ba7ec5aae
6 değiştirilmiş dosya ile 1113 ekleme ve 158 silme
  1. +205
    -16
      app/hdl/institutional_management/public_platoon/hdl_basic.go
  2. +37
    -23
      app/md/institutional_management/public_platoon/md_public_platoon.go
  3. +10
    -0
      app/router/router.go
  4. +322
    -42
      docs/docs.go
  5. +322
    -42
      docs/swagger.json
  6. +217
    -35
      docs/swagger.yaml

+ 205
- 16
app/hdl/institutional_management/public_platoon/hdl_basic.go Dosyayı Görüntüle

@@ -21,7 +21,7 @@ import (
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Success 200 {object} md.GetPublicPlatoonBasicResp "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/publicPlatoon/getBasic [get]
// @Router /api/institutionalManagement/publicPlatoon/getBasic [get]
func GetPublicPlatoonBasic(c *gin.Context) {
publicPlatoonBasicDb := implement.NewPublicPlatoonBasicSettingDb(db.Db)
publicPlatoonBasic, err := publicPlatoonBasicDb.PublicPlatoonBasicSettingGetOne()
@@ -70,10 +70,10 @@ func GetPublicPlatoonBasic(c *gin.Context) {
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param req body interface{} true "公排设置表单内容"
// @Param req body md.UpdatePublicPlatoonBasicReq true "公排设置表单内容"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/publicPlatoon/updateBasic [put]
// @Router /api/institutionalManagement/publicPlatoon/updateBasic [put]
func UpdatePublicPlatoonBasic(c *gin.Context) {
var req *md.UpdatePublicPlatoonBasicReq
if err := c.ShouldBindJSON(&req); err != nil {
@@ -85,7 +85,7 @@ func UpdatePublicPlatoonBasic(c *gin.Context) {

publicPlatoonBasic, err := publicPlatoonBasicDb.PublicPlatoonBasicSettingGetOne()
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err)
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}

@@ -104,7 +104,7 @@ func UpdatePublicPlatoonBasic(c *gin.Context) {

updateAffected, err := publicPlatoonBasicDb.PublicPlatoonBasicSettingUpdate(publicPlatoonBasic.Id, setting, "")
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err)
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
if updateAffected <= 0 {
@@ -125,7 +125,7 @@ func UpdatePublicPlatoonBasic(c *gin.Context) {
// @param uid query string true "uid"
// @Success 200 {object} md.TreeNode "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/publicPlatoon/relationshipMap [get]
// @Router /api/institutionalManagement/publicPlatoon/relationshipMap [get]
func GetRelationshipMap(c *gin.Context) {
phone := c.Query("phone")
uid := c.Query("uid")
@@ -182,7 +182,7 @@ func GetRelationshipMap(c *gin.Context) {
// @Param uid query string true "用户ID"
// @Success 200 {object} md.TreeNode "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/publicPlatoon/findUserRelationshipMap [get]
// @Router /api/institutionalManagement/publicPlatoon/findUserRelationshipMap [get]
func FindUserRelationshipMap(c *gin.Context) {
uid := c.Query("uid")

@@ -216,9 +216,9 @@ func FindUserRelationshipMap(c *gin.Context) {
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param uid query string true "用户ID"
// @Success 200 {object} md.RelationshipMap "具体数据"
// @Success 200 {object} md.TreeNode "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/publicPlatoon/findSubUserRelationshipMap [get]
// @Router /api/institutionalManagement/publicPlatoon/findSubUserRelationshipMap [get]
func FindSubUserRelationshipMap(c *gin.Context) {
uid := c.Query("uid")

@@ -228,7 +228,7 @@ func FindSubUserRelationshipMap(c *gin.Context) {
"value": uid,
})
if err1 != nil {
e.OutErr(c, e.ERR_DB_ORM, err1)
e.OutErr(c, e.ERR_DB_ORM, err1.Error())
return
}

@@ -237,7 +237,7 @@ func FindSubUserRelationshipMap(c *gin.Context) {
"value": sonRelation.FatherUid1,
})
if err2 != nil {
e.OutErr(c, e.ERR_DB_ORM, err2)
e.OutErr(c, e.ERR_DB_ORM, err2.Error())
return
}

@@ -293,21 +293,21 @@ func FindSubUserRelationshipMap(c *gin.Context) {
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param req body interface{} true "需要交换的两个位置"
// @Param req body md.ExchangeUserPositionReq true "需要交换的两个位置"
// @Success 200 {} "成功返回"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/publicPlatoon/exchangeUserPosition [post]
// @Router /api/institutionalManagement/publicPlatoon/exchangeUserPosition [post]
func ExchangeUserPosition(c *gin.Context) {
var req *md.ExchangeUserPositionReq
if err1 := c.ShouldBindJSON(&req); err1 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err1)
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
return
}

userRelationDb := implement.NewPublicPlatoonUserRelationDb(db.Db)
relation1, err2 := userRelationDb.PublicPlatoonUserRelationGetOneByPosition(req.Position1)
if err2 != nil {
e.OutErr(c, e.ERR_DB_ORM, err2)
e.OutErr(c, e.ERR_DB_ORM, err2.Error())
return
}
if relation1 == nil {
@@ -317,7 +317,7 @@ func ExchangeUserPosition(c *gin.Context) {

relation2, err3 := userRelationDb.PublicPlatoonUserRelationGetOneByPosition(req.Position1)
if err3 != nil {
e.OutErr(c, e.ERR_DB_ORM, err3)
e.OutErr(c, e.ERR_DB_ORM, err3.Error())
return
}
if relation2 == nil {
@@ -337,3 +337,192 @@ func ExchangeUserPosition(c *gin.Context) {

e.OutSuc(c, nil, nil)
}

// GetFreePublishUser
// @Summary 制度中心-公排管理-免罚用户(查询)
// @Tags 公排管理
// @Description 免罚用户(查询)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param req body md.GetFreePublishUserReq true "页数和行数必填,uid选填"
// @Success 200 {object} md.GetFreePublishUserResp "成功返回"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/index [post]
func GetFreePublishUser(c *gin.Context) {
var req *md.GetFreePublishUserReq
if err1 := c.ShouldBindJSON(&req); err1 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
return
}

freePunishWithUserDb := implement.NewPublicPlatoonFreePunishWithUserDb(db.Db)
var m []model.PublicPlatoonFreePunishWithUser
var err error
var total int64
if req.Uid != 0 {
m, total, err = freePunishWithUserDb.PublicPlatoonFreePunishWithUserCountAndGetPageByParams(req.Page, req.Limit, map[string]interface{}{
"key": "uid",
"value": req.Uid,
})
} else {
m, total, err = freePunishWithUserDb.PublicPlatoonFreePunishWithUserCountAndGetPageByParams(req.Page, req.Limit, nil)
}
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}

userDb := implement.NewUserDb(db.Db)
var ids []int64
for _, item := range m {
ids = append(ids, item.Uid)
}
users, err2 := userDb.UserFindByParams(map[string]interface{}{
"key": "id",
"value": ids,
})
if err2 != nil {
e.OutErr(c, e.ERR_DB_ORM, err2.Error())
}

var nodes []md.FreePublishUserNode
for _, user := range users {
nodes = append(nodes, md.FreePublishUserNode{
UID: user.Id,
Phone: user.Phone,
Nickname: user.Nickname,
})
}
var paginate md.Paginate
paginate = md.Paginate{
Limit: req.Limit,
Page: req.Page,
Total: total,
}
var resp md.GetFreePublishUserResp
resp = md.GetFreePublishUserResp{
Paginate: paginate,
List: nodes,
}
e.OutSuc(c, resp, nil)
}

// AddFreePublishUser
// @Summary 制度中心-公排管理-免罚用户(新增)
// @Tags 公排管理
// @Description 免罚用户(新增)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param req body md.AddFreePublishUserReq true "页数和行数必填,uid选填"
// @Success 200 {int} "插入数据 ID"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/save [post]
func AddFreePublishUser(c *gin.Context) {
var req *md.AddFreePublishUserReq
if err1 := c.ShouldBindJSON(&req); err1 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
return
}

userDb := implement.NewUserDb(db.Db)
user, err2 := userDb.UserGetOneByParams(map[string]interface{}{
"key": "id",
"value": req.Uid,
})
if err2 != nil {
e.OutErr(c, e.ERR_DB_ORM, err2.Error())
return
}
if user == nil {
e.OutErr(c, e.ERR_DB_ORM, errors.New("该用户不存在"))
}

freePunishWithUserDb := implement.NewPublicPlatoonFreePunishWithUserDb(db.Db)
var m model.PublicPlatoonFreePunishWithUser
m = model.PublicPlatoonFreePunishWithUser{
Uid: req.Uid,
}
id, err3 := freePunishWithUserDb.PublicPlatoonFreePunishWithUserInsert(&m)
if err3 != nil {
e.OutErr(c, e.ERR_DB_ORM, err3.Error())
return
}
e.OutSuc(c, id, nil)
}

// AddCommunityDividends
// @Summary 制度中心-公排管理-社区分红(新增)
// @Tags 公排管理
// @Description 社区分红(新增)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param req body md.AddCommunityDividendsReq true "分红名称、分红总量"
// @Success 200 {int} "插入数据 ID"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/institutionalManagement/publicPlatoon/communityDividends/communityDividendsAdd [post]
func AddCommunityDividends(c *gin.Context) {
var req *md.AddCommunityDividendsReq
if err1 := c.ShouldBindJSON(&req); err1 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
return
}

// todo 判断分红数量是否大于社区分红钱包余额

now := time.Now()
var m model.EggEnergyCommunityDividends
m = model.EggEnergyCommunityDividends{
Name: req.Name,
CoinId: 0,
PersonsNum: 0,
IsOver: 0,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
}
dividendsDb := implement.NewEggEnergyCommunityDividendsDb(db.Db)
id, err := dividendsDb.EggEnergyCommunityDividendsInsert(&m)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
e.OutSuc(c, id, nil)
}

// AddCommunityDividendsWithUser
// @Summary 制度中心-公排管理-社区长列表(新增)
// @Tags 公排管理
// @Description 社区长列表(新增)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param req body md.AddCommunityDividendsWithUserReq true "新增社区长 ID、备注"
// @Success 200 {int} "插入数据 ID"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/institutionalManagement/publicPlatoon/communityDividends/communityDividendsWithUserAdd [post]
func AddCommunityDividendsWithUser(c *gin.Context) {
var req *md.AddCommunityDividendsWithUserReq
if err1 := c.ShouldBindJSON(&req); err1 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
return
}

now := time.Now()
var m model.EggEnergyCommunityDividendsWithUser
m = model.EggEnergyCommunityDividendsWithUser{
Uid: req.Uid,
Memo: req.Memo,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
}

communityDividendsWithUserDb := implement.NewEggEnergyCommunityDividendsWithUserDb(db.Db)
id, err := communityDividendsWithUserDb.EggEnergyCommunityDividendsWithUserInsert(&m)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
e.OutSuc(c, id, nil)
}

+ 37
- 23
app/md/institutional_management/public_platoon/md_public_platoon.go Dosyayı Görüntüle

@@ -20,29 +20,6 @@ type UpdatePublicPlatoonBasicReq struct {
IsSelfActiveGetTeamRevenue int `json:"is_self_active_get_team_revenue"`
}

type GetRelationshipMapReq struct {
Phone int `json:"phone"`
Uid int64 `json:"uid"`
}

type RelationshipMap struct {
AvatarUrl string `json:"avatar_url"`
Phone string `json:"phone"`
Nickname string `json:"nickname"`
Uid int64 `json:"uid"`
Pid int64 `json:"pid"`
Level int `json:"level"`
Position int64 `json:"position"`
SystemID int `json:"system_id"`
Son []RelationshipMap `json:"son"`
}

type RelationshipMapResp struct {
Map RelationshipMap `json:"map"`
BasicSetting GetPublicPlatoonBasicResp `json:"basicSetting"`
SearchUid string `json:"searchUid"`
}

type ExchangeUserPositionReq struct {
Position1 int64 `json:"position_1,required"`
Position2 int64 `json:"position_2,required"`
@@ -59,3 +36,40 @@ type TreeNode struct {
Level int `json:"level"`
Son []*TreeNode `json:"son"`
}

type GetFreePublishUserReq struct {
Limit int `json:"limit,required"`
Uid int64 `json:"uid"`
Page int `json:"page,required"`
}

type FreePublishUserNode struct {
UID int64 `json:"uid"`
Phone string `json:"phone"`
Nickname string `json:"nickname"`
}

type GetFreePublishUserResp struct {
Paginate Paginate `json:"paginate"`
List []FreePublishUserNode `json:"list"`
}

type Paginate struct {
Limit int `json:"limit"`
Page int `json:"page"`
Total int64 `json:"total"`
}

type AddFreePublishUserReq struct {
Uid int64 `json:"uid"`
}

type AddCommunityDividendsReq struct {
Name string `json:"name,required"`
Nums int `json:"nums,required"`
}

type AddCommunityDividendsWithUserReq struct {
Uid int64 `json:"uid,required"`
Memo string `json:"memo"`
}

+ 10
- 0
app/router/router.go Dosyayı Görüntüle

@@ -65,6 +65,16 @@ func rInstitutionalManagement(r *gin.RouterGroup) { //制度管理
rPublicPlatoon.GET("/findUserRelationshipMap", public_platoon.FindUserRelationshipMap)
rPublicPlatoon.GET("/findSubUserRelationshipMap", public_platoon.FindSubUserRelationshipMap)
rPublicPlatoon.POST("/exchangeUserPosition", public_platoon.ExchangeUserPosition)
rPublicPlatoonUserFreePunish := rPublicPlatoon.Group("/publicPlatoonUserFreePunish")
{
rPublicPlatoonUserFreePunish.POST("/index", public_platoon.GetFreePublishUser)
rPublicPlatoonUserFreePunish.POST("/save", public_platoon.AddFreePublishUser)
}
rCommunityDividends := rPublicPlatoon.Group("/communityDividends")
{
rCommunityDividends.POST("/communityDividendsAdd", public_platoon.AddCommunityDividends)
rCommunityDividends.POST("/communityDividendsWithUserAdd", public_platoon.AddCommunityDividendsWithUser)
}
}
}



+ 322
- 42
docs/docs.go Dosyayı Görüntüle

@@ -63,9 +63,9 @@ const docTemplate = `{
}
}
},
"/api/login": {
"/api/institutionalManagement/publicPlatoon/communityDividends/communityDividendsAdd": {
"post": {
"description": "登入",
"description": "社区分红(新增)",
"consumes": [
"application/json"
],
@@ -73,25 +73,32 @@ const docTemplate = `{
"application/json"
],
"tags": [
"登录"
"公排管理"
],
"summary": "登陆",
"summary": "制度中心-公排管理-社区分红(新增)",
"parameters": [
{
"description": "用户名密码",
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "分红名称、分红总量",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.LoginReq"
"$ref": "#/definitions/md.AddCommunityDividendsReq"
}
}
],
"responses": {
"200": {
"description": "token",
"description": "插入数据 ID",
"schema": {
"$ref": "#/definitions/md.LoginResponse"
"type": "int"
}
},
"400": {
@@ -103,7 +110,54 @@ const docTemplate = `{
}
}
},
"/api/publicPlatoon/exchangeUserPosition": {
"/api/institutionalManagement/publicPlatoon/communityDividends/communityDividendsWithUserAdd": {
"post": {
"description": "社区长列表(新增)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"公排管理"
],
"summary": "制度中心-公排管理-社区长列表(新增)",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "新增社区长 ID、备注",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.AddCommunityDividendsWithUserReq"
}
}
],
"responses": {
"200": {
"description": "插入数据 ID",
"schema": {
"type": "int"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/institutionalManagement/publicPlatoon/exchangeUserPosition": {
"post": {
"description": "关系分布图(位置转换)",
"consumes": [
@@ -129,7 +183,9 @@ const docTemplate = `{
"name": "req",
"in": "body",
"required": true,
"schema": {}
"schema": {
"$ref": "#/definitions/md.ExchangeUserPositionReq"
}
}
],
"responses": {
@@ -148,7 +204,7 @@ const docTemplate = `{
}
}
},
"/api/publicPlatoon/findSubUserRelationshipMap": {
"/api/institutionalManagement/publicPlatoon/findSubUserRelationshipMap": {
"get": {
"description": "关系分布图(获取指定用户上级)",
"consumes": [
@@ -181,7 +237,7 @@ const docTemplate = `{
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.RelationshipMap"
"$ref": "#/definitions/md.TreeNode"
}
},
"400": {
@@ -193,7 +249,7 @@ const docTemplate = `{
}
}
},
"/api/publicPlatoon/findUserRelationshipMap": {
"/api/institutionalManagement/publicPlatoon/findUserRelationshipMap": {
"get": {
"description": "关系分布图(获取指定用户下级)",
"consumes": [
@@ -238,7 +294,7 @@ const docTemplate = `{
}
}
},
"/api/publicPlatoon/getBasic": {
"/api/institutionalManagement/publicPlatoon/getBasic": {
"get": {
"description": "公排基础设置(获取)",
"consumes": [
@@ -276,7 +332,101 @@ const docTemplate = `{
}
}
},
"/api/publicPlatoon/relationshipMap": {
"/api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/index": {
"post": {
"description": "免罚用户(查询)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"公排管理"
],
"summary": "制度中心-公排管理-免罚用户(查询)",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "页数和行数必填,uid选填",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.GetFreePublishUserReq"
}
}
],
"responses": {
"200": {
"description": "成功返回",
"schema": {
"$ref": "#/definitions/md.GetFreePublishUserResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/save": {
"post": {
"description": "免罚用户(新增)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"公排管理"
],
"summary": "制度中心-公排管理-免罚用户(新增)",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "页数和行数必填,uid选填",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.AddFreePublishUserReq"
}
}
],
"responses": {
"200": {
"description": "插入数据 ID",
"schema": {
"type": "int"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/institutionalManagement/publicPlatoon/relationshipMap": {
"get": {
"description": "关系分布图(获取)",
"consumes": [
@@ -328,7 +478,7 @@ const docTemplate = `{
}
}
},
"/api/publicPlatoon/updateBasic": {
"/api/institutionalManagement/publicPlatoon/updateBasic": {
"put": {
"description": "公排基础设置(修改)",
"consumes": [
@@ -354,7 +504,9 @@ const docTemplate = `{
"name": "req",
"in": "body",
"required": true,
"schema": {}
"schema": {
"$ref": "#/definitions/md.UpdatePublicPlatoonBasicReq"
}
}
],
"responses": {
@@ -372,9 +524,132 @@ const docTemplate = `{
}
}
}
},
"/api/login": {
"post": {
"description": "登入",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"登录"
],
"summary": "登陆",
"parameters": [
{
"description": "用户名密码",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.LoginReq"
}
}
],
"responses": {
"200": {
"description": "token",
"schema": {
"$ref": "#/definitions/md.LoginResponse"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
}
},
"definitions": {
"md.AddCommunityDividendsReq": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"nums": {
"type": "integer"
}
}
},
"md.AddCommunityDividendsWithUserReq": {
"type": "object",
"properties": {
"memo": {
"type": "string"
},
"uid": {
"type": "integer"
}
}
},
"md.AddFreePublishUserReq": {
"type": "object",
"properties": {
"uid": {
"type": "integer"
}
}
},
"md.ExchangeUserPositionReq": {
"type": "object",
"properties": {
"position_1": {
"type": "integer"
},
"position_2": {
"type": "integer"
}
}
},
"md.FreePublishUserNode": {
"type": "object",
"properties": {
"nickname": {
"type": "string"
},
"phone": {
"type": "string"
},
"uid": {
"type": "integer"
}
}
},
"md.GetFreePublishUserReq": {
"type": "object",
"properties": {
"limit": {
"type": "integer"
},
"page": {
"type": "integer"
},
"uid": {
"type": "integer"
}
}
},
"md.GetFreePublishUserResp": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/md.FreePublishUserNode"
}
},
"paginate": {
"$ref": "#/definitions/md.Paginate"
}
}
},
"md.GetPublicPlatoonBasicResp": {
"type": "object",
"properties": {
@@ -430,37 +705,16 @@ const docTemplate = `{
}
}
},
"md.RelationshipMap": {
"md.Paginate": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string"
},
"level": {
"type": "integer"
},
"nickname": {
"type": "string"
},
"phone": {
"type": "string"
},
"pid": {
"limit": {
"type": "integer"
},
"position": {
"page": {
"type": "integer"
},
"son": {
"type": "array",
"items": {
"$ref": "#/definitions/md.RelationshipMap"
}
},
"system_id": {
"type": "integer"
},
"uid": {
"total": {
"type": "integer"
}
}
@@ -515,6 +769,32 @@ const docTemplate = `{
"type": "integer"
}
}
},
"md.UpdatePublicPlatoonBasicReq": {
"type": "object",
"properties": {
"is_open": {
"type": "integer"
},
"is_self_active_get_team_revenue": {
"type": "integer"
},
"originator_uid": {
"type": "integer"
},
"several_rows": {
"type": "integer"
},
"several_times": {
"type": "integer"
},
"system_punish_replace": {
"type": "integer"
},
"system_punish_replace_value": {
"type": "integer"
}
}
}
},
"securityDefinitions": {


+ 322
- 42
docs/swagger.json Dosyayı Görüntüle

@@ -56,9 +56,9 @@
}
}
},
"/api/login": {
"/api/institutionalManagement/publicPlatoon/communityDividends/communityDividendsAdd": {
"post": {
"description": "登入",
"description": "社区分红(新增)",
"consumes": [
"application/json"
],
@@ -66,25 +66,32 @@
"application/json"
],
"tags": [
"登录"
"公排管理"
],
"summary": "登陆",
"summary": "制度中心-公排管理-社区分红(新增)",
"parameters": [
{
"description": "用户名密码",
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "分红名称、分红总量",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.LoginReq"
"$ref": "#/definitions/md.AddCommunityDividendsReq"
}
}
],
"responses": {
"200": {
"description": "token",
"description": "插入数据 ID",
"schema": {
"$ref": "#/definitions/md.LoginResponse"
"type": "int"
}
},
"400": {
@@ -96,7 +103,54 @@
}
}
},
"/api/publicPlatoon/exchangeUserPosition": {
"/api/institutionalManagement/publicPlatoon/communityDividends/communityDividendsWithUserAdd": {
"post": {
"description": "社区长列表(新增)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"公排管理"
],
"summary": "制度中心-公排管理-社区长列表(新增)",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "新增社区长 ID、备注",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.AddCommunityDividendsWithUserReq"
}
}
],
"responses": {
"200": {
"description": "插入数据 ID",
"schema": {
"type": "int"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/institutionalManagement/publicPlatoon/exchangeUserPosition": {
"post": {
"description": "关系分布图(位置转换)",
"consumes": [
@@ -122,7 +176,9 @@
"name": "req",
"in": "body",
"required": true,
"schema": {}
"schema": {
"$ref": "#/definitions/md.ExchangeUserPositionReq"
}
}
],
"responses": {
@@ -141,7 +197,7 @@
}
}
},
"/api/publicPlatoon/findSubUserRelationshipMap": {
"/api/institutionalManagement/publicPlatoon/findSubUserRelationshipMap": {
"get": {
"description": "关系分布图(获取指定用户上级)",
"consumes": [
@@ -174,7 +230,7 @@
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.RelationshipMap"
"$ref": "#/definitions/md.TreeNode"
}
},
"400": {
@@ -186,7 +242,7 @@
}
}
},
"/api/publicPlatoon/findUserRelationshipMap": {
"/api/institutionalManagement/publicPlatoon/findUserRelationshipMap": {
"get": {
"description": "关系分布图(获取指定用户下级)",
"consumes": [
@@ -231,7 +287,7 @@
}
}
},
"/api/publicPlatoon/getBasic": {
"/api/institutionalManagement/publicPlatoon/getBasic": {
"get": {
"description": "公排基础设置(获取)",
"consumes": [
@@ -269,7 +325,101 @@
}
}
},
"/api/publicPlatoon/relationshipMap": {
"/api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/index": {
"post": {
"description": "免罚用户(查询)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"公排管理"
],
"summary": "制度中心-公排管理-免罚用户(查询)",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "页数和行数必填,uid选填",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.GetFreePublishUserReq"
}
}
],
"responses": {
"200": {
"description": "成功返回",
"schema": {
"$ref": "#/definitions/md.GetFreePublishUserResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/save": {
"post": {
"description": "免罚用户(新增)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"公排管理"
],
"summary": "制度中心-公排管理-免罚用户(新增)",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "页数和行数必填,uid选填",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.AddFreePublishUserReq"
}
}
],
"responses": {
"200": {
"description": "插入数据 ID",
"schema": {
"type": "int"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/institutionalManagement/publicPlatoon/relationshipMap": {
"get": {
"description": "关系分布图(获取)",
"consumes": [
@@ -321,7 +471,7 @@
}
}
},
"/api/publicPlatoon/updateBasic": {
"/api/institutionalManagement/publicPlatoon/updateBasic": {
"put": {
"description": "公排基础设置(修改)",
"consumes": [
@@ -347,7 +497,9 @@
"name": "req",
"in": "body",
"required": true,
"schema": {}
"schema": {
"$ref": "#/definitions/md.UpdatePublicPlatoonBasicReq"
}
}
],
"responses": {
@@ -365,9 +517,132 @@
}
}
}
},
"/api/login": {
"post": {
"description": "登入",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"登录"
],
"summary": "登陆",
"parameters": [
{
"description": "用户名密码",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.LoginReq"
}
}
],
"responses": {
"200": {
"description": "token",
"schema": {
"$ref": "#/definitions/md.LoginResponse"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
}
},
"definitions": {
"md.AddCommunityDividendsReq": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"nums": {
"type": "integer"
}
}
},
"md.AddCommunityDividendsWithUserReq": {
"type": "object",
"properties": {
"memo": {
"type": "string"
},
"uid": {
"type": "integer"
}
}
},
"md.AddFreePublishUserReq": {
"type": "object",
"properties": {
"uid": {
"type": "integer"
}
}
},
"md.ExchangeUserPositionReq": {
"type": "object",
"properties": {
"position_1": {
"type": "integer"
},
"position_2": {
"type": "integer"
}
}
},
"md.FreePublishUserNode": {
"type": "object",
"properties": {
"nickname": {
"type": "string"
},
"phone": {
"type": "string"
},
"uid": {
"type": "integer"
}
}
},
"md.GetFreePublishUserReq": {
"type": "object",
"properties": {
"limit": {
"type": "integer"
},
"page": {
"type": "integer"
},
"uid": {
"type": "integer"
}
}
},
"md.GetFreePublishUserResp": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/md.FreePublishUserNode"
}
},
"paginate": {
"$ref": "#/definitions/md.Paginate"
}
}
},
"md.GetPublicPlatoonBasicResp": {
"type": "object",
"properties": {
@@ -423,37 +698,16 @@
}
}
},
"md.RelationshipMap": {
"md.Paginate": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string"
},
"level": {
"type": "integer"
},
"nickname": {
"type": "string"
},
"phone": {
"type": "string"
},
"pid": {
"limit": {
"type": "integer"
},
"position": {
"page": {
"type": "integer"
},
"son": {
"type": "array",
"items": {
"$ref": "#/definitions/md.RelationshipMap"
}
},
"system_id": {
"type": "integer"
},
"uid": {
"total": {
"type": "integer"
}
}
@@ -508,6 +762,32 @@
"type": "integer"
}
}
},
"md.UpdatePublicPlatoonBasicReq": {
"type": "object",
"properties": {
"is_open": {
"type": "integer"
},
"is_self_active_get_team_revenue": {
"type": "integer"
},
"originator_uid": {
"type": "integer"
},
"several_rows": {
"type": "integer"
},
"several_times": {
"type": "integer"
},
"system_punish_replace": {
"type": "integer"
},
"system_punish_replace_value": {
"type": "integer"
}
}
}
},
"securityDefinitions": {


+ 217
- 35
docs/swagger.yaml Dosyayı Görüntüle

@@ -1,4 +1,57 @@
definitions:
md.AddCommunityDividendsReq:
properties:
name:
type: string
nums:
type: integer
type: object
md.AddCommunityDividendsWithUserReq:
properties:
memo:
type: string
uid:
type: integer
type: object
md.AddFreePublishUserReq:
properties:
uid:
type: integer
type: object
md.ExchangeUserPositionReq:
properties:
position_1:
type: integer
position_2:
type: integer
type: object
md.FreePublishUserNode:
properties:
nickname:
type: string
phone:
type: string
uid:
type: integer
type: object
md.GetFreePublishUserReq:
properties:
limit:
type: integer
page:
type: integer
uid:
type: integer
type: object
md.GetFreePublishUserResp:
properties:
list:
items:
$ref: '#/definitions/md.FreePublishUserNode'
type: array
paginate:
$ref: '#/definitions/md.Paginate'
type: object
md.GetPublicPlatoonBasicResp:
properties:
is_open:
@@ -36,27 +89,13 @@ definitions:
token:
type: string
type: object
md.RelationshipMap:
md.Paginate:
properties:
avatar_url:
type: string
level:
limit:
type: integer
nickname:
type: string
phone:
type: string
pid:
page:
type: integer
position:
type: integer
son:
items:
$ref: '#/definitions/md.RelationshipMap'
type: array
system_id:
type: integer
uid:
total:
type: integer
type: object
md.Response:
@@ -93,6 +132,23 @@ definitions:
uid:
type: integer
type: object
md.UpdatePublicPlatoonBasicReq:
properties:
is_open:
type: integer
is_self_active_get_team_revenue:
type: integer
originator_uid:
type: integer
several_rows:
type: integer
several_times:
type: integer
system_punish_replace:
type: integer
system_punish_replace_value:
type: integer
type: object
host: localhost:4001
info:
contact:
@@ -133,33 +189,69 @@ paths:
summary: Demo测试
tags:
- Demo
/api/login:
/api/institutionalManagement/publicPlatoon/communityDividends/communityDividendsAdd:
post:
consumes:
- application/json
description: 登入
description: 社区分红(新增)
parameters:
- description: 用户名密码
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 分红名称、分红总量
in: body
name: req
required: true
schema:
$ref: '#/definitions/md.LoginReq'
$ref: '#/definitions/md.AddCommunityDividendsReq'
produces:
- application/json
responses:
"200":
description: token
description: 插入数据 ID
schema:
$ref: '#/definitions/md.LoginResponse'
type: int
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 登陆
summary: 制度中心-公排管理-社区分红(新增)
tags:
- 登录
/api/publicPlatoon/exchangeUserPosition:
- 公排管理
/api/institutionalManagement/publicPlatoon/communityDividends/communityDividendsWithUserAdd:
post:
consumes:
- application/json
description: 社区长列表(新增)
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 新增社区长 ID、备注
in: body
name: req
required: true
schema:
$ref: '#/definitions/md.AddCommunityDividendsWithUserReq'
produces:
- application/json
responses:
"200":
description: 插入数据 ID
schema:
type: int
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 制度中心-公排管理-社区长列表(新增)
tags:
- 公排管理
/api/institutionalManagement/publicPlatoon/exchangeUserPosition:
post:
consumes:
- application/json
@@ -174,7 +266,8 @@ paths:
in: body
name: req
required: true
schema: {}
schema:
$ref: '#/definitions/md.ExchangeUserPositionReq'
produces:
- application/json
responses:
@@ -189,7 +282,7 @@ paths:
summary: 制度中心-公排管理-关系分布图(位置转换)
tags:
- 公排管理
/api/publicPlatoon/findSubUserRelationshipMap:
/api/institutionalManagement/publicPlatoon/findSubUserRelationshipMap:
get:
consumes:
- application/json
@@ -211,7 +304,7 @@ paths:
"200":
description: 具体数据
schema:
$ref: '#/definitions/md.RelationshipMap'
$ref: '#/definitions/md.TreeNode'
"400":
description: 具体错误
schema:
@@ -219,7 +312,7 @@ paths:
summary: 制度中心-公排管理-关系分布图(获取指定用户上级)
tags:
- 公排管理
/api/publicPlatoon/findUserRelationshipMap:
/api/institutionalManagement/publicPlatoon/findUserRelationshipMap:
get:
consumes:
- application/json
@@ -249,7 +342,7 @@ paths:
summary: 制度中心-公排管理-关系分布图(获取指定用户下级)
tags:
- 公排管理
/api/publicPlatoon/getBasic:
/api/institutionalManagement/publicPlatoon/getBasic:
get:
consumes:
- application/json
@@ -274,7 +367,69 @@ paths:
summary: 制度中心-公排管理-公排基础设置(获取)
tags:
- 公排管理
/api/publicPlatoon/relationshipMap:
/api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/index:
post:
consumes:
- application/json
description: 免罚用户(查询)
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 页数和行数必填,uid选填
in: body
name: req
required: true
schema:
$ref: '#/definitions/md.GetFreePublishUserReq'
produces:
- application/json
responses:
"200":
description: 成功返回
schema:
$ref: '#/definitions/md.GetFreePublishUserResp'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 制度中心-公排管理-免罚用户(查询)
tags:
- 公排管理
/api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/save:
post:
consumes:
- application/json
description: 免罚用户(新增)
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 页数和行数必填,uid选填
in: body
name: req
required: true
schema:
$ref: '#/definitions/md.AddFreePublishUserReq'
produces:
- application/json
responses:
"200":
description: 插入数据 ID
schema:
type: int
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 制度中心-公排管理-免罚用户(新增)
tags:
- 公排管理
/api/institutionalManagement/publicPlatoon/relationshipMap:
get:
consumes:
- application/json
@@ -309,7 +464,7 @@ paths:
summary: 制度中心-公排管理-关系分布图(获取)
tags:
- 公排管理
/api/publicPlatoon/updateBasic:
/api/institutionalManagement/publicPlatoon/updateBasic:
put:
consumes:
- application/json
@@ -324,7 +479,8 @@ paths:
in: body
name: req
required: true
schema: {}
schema:
$ref: '#/definitions/md.UpdatePublicPlatoonBasicReq'
produces:
- application/json
responses:
@@ -339,6 +495,32 @@ paths:
summary: 制度中心-公排管理-公排基础设置(修改)
tags:
- 公排管理
/api/login:
post:
consumes:
- application/json
description: 登入
parameters:
- description: 用户名密码
in: body
name: req
required: true
schema:
$ref: '#/definitions/md.LoginReq'
produces:
- application/json
responses:
"200":
description: token
schema:
$ref: '#/definitions/md.LoginResponse'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 登陆
tags:
- 登录
securityDefinitions:
MasterID:
in: header


Yükleniyor…
İptal
Kaydet