|
@@ -12,6 +12,7 @@ import (
|
|
|
"github.com/kataras/iris/v12"
|
|
|
"go.mod/services"
|
|
|
"go.mod/web/utils"
|
|
|
+ "go.mod/web/viewmodels"
|
|
|
)
|
|
|
|
|
|
type ProjectBs struct {
|
|
@@ -118,20 +119,27 @@ func (c *ProjectBs) Get() {
|
|
|
// @Router /backstage/cld [get]
|
|
|
func (c *ProjectBs) GetCld() {
|
|
|
|
|
|
- AccountData, err := c.ServiceBackstage.ValidRuleProject(c.Ctx)
|
|
|
+ cldData := viewmodels.StaffCld{}
|
|
|
+ err := c.Ctx.ReadForm(&cldData)
|
|
|
if err != nil {
|
|
|
- ErrMsg := utils.FormValidError(err)
|
|
|
- c.Ctx.JSON(iris.Map{"code": -1, "msg": ErrMsg})
|
|
|
+ c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
// 获得项目ID
|
|
|
- projectIdInt, err := utils.GetDecryptId(AccountData.Id)
|
|
|
- if err != nil {
|
|
|
- c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
|
|
|
- return
|
|
|
+ categoryId := 0
|
|
|
+ if cldData.CategoryId != "" {
|
|
|
+ categoryId, err = utils.GetDecryptId(cldData.CategoryId)
|
|
|
+ if err != nil {
|
|
|
+ c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
// 获得项目信息
|
|
|
- ProjectData, err := c.ServiceProject.Get(projectIdInt)
|
|
|
+ ProjectData := ""
|
|
|
+ c.ServiceBackstage.GetCld(categoryId)
|
|
|
+ // ProjectData, err := c.ServiceBackstage.GetCld(categoryId)
|
|
|
if err != nil {
|
|
|
c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
|
|
|
return
|