|
|
@@ -1,10 +1,57 @@ |
|
|
|
package public_platoon |
|
|
|
|
|
|
|
import ( |
|
|
|
"applet/app/db" |
|
|
|
"applet/app/e" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" |
|
|
|
"github.com/gin-gonic/gin" |
|
|
|
) |
|
|
|
|
|
|
|
// GetPublicPlatoonBasic |
|
|
|
// @Summary 获取公排设置 |
|
|
|
// @Tags 公排相关接口 |
|
|
|
// @Description 获取公排设置 |
|
|
|
// @Accept json |
|
|
|
// @Produce json |
|
|
|
// @Param Authorization header |
|
|
|
// @Success 200 {object} map[string]interface{} "用户数据" |
|
|
|
// @Failure 400 {object} md.Response "具体错误" |
|
|
|
// @Router /api/publicPlatoon/getBasic [get] |
|
|
|
func GetPublicPlatoonBasic(c *gin.Context) { |
|
|
|
publicPlatoonBasicDb := implement.NewPublicPlatoonBasicSettingDb(db.Db) |
|
|
|
publicPlatoonBasic, err := publicPlatoonBasicDb.PublicPlatoonBasicSettingGetOneByParams(nil) |
|
|
|
if err != nil { |
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err) |
|
|
|
return |
|
|
|
} |
|
|
|
e.OutSuc(c, publicPlatoonBasic, nil) |
|
|
|
} |
|
|
|
|
|
|
|
// UpdatePublicPlatoonBasic |
|
|
|
// @Summary 更改公排设置 |
|
|
|
// @Tags 公排相关接口 |
|
|
|
// @Description 更改公排设置 |
|
|
|
// @Accept json |
|
|
|
// @Produce json |
|
|
|
// @Param Authorization header |
|
|
|
// @Param req body interface{} true "公排设置表单内容" |
|
|
|
// @Success 200 {object} map[string]interface{} "修改数据条数" |
|
|
|
// @Failure 400 {object} md.Response "具体错误" |
|
|
|
// @Router /api/publicPlatoon/getBasic [get] |
|
|
|
func UpdatePublicPlatoonBasic(c *gin.Context) { |
|
|
|
var req *model.PublicPlatoonBasicSetting |
|
|
|
if err := c.ShouldBindJSON(&req); err != nil { |
|
|
|
e.OutErr(c, e.ERR_INVALID_ARGS, err) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
publicPlatoonBasicDb := implement.NewPublicPlatoonBasicSettingDb(db.Db) |
|
|
|
update, err := publicPlatoonBasicDb.PublicPlatoonBasicSettingUpdate(req.Id, req, "") |
|
|
|
if err != nil { |
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
return |
|
|
|
e.OutSuc(c, update, nil) |
|
|
|
} |