/* * @description: 合同管理相关API * @Author: CP * @Date: 2020-10-26 15:27:04 * @FilePath: \construction_management\web\api\contract_api.go */ package api import ( "github.com/kataras/iris/v12" "go.mod/services" "go.mod/web/utils" ) type ContractApi struct { //框架-web应用上下文环境 Ctx iris.Context // // 需要用的service ServiceTree services.TreeService // ServiceLogin services.LoginService // ServiceProject services.ProjectService } func (c *ContractApi) Get() { // 获得项目ID projectIdInt, err := utils.GetProjectId(c.Ctx) if err != nil { c.Ctx.JSON(iris.Map{ "code": -1, "msg": err, }) return } // 获得层级文件夹 FolderData := c.ServiceTree.GetAllContract(projectIdInt) c.Ctx.JSON(iris.Map{ "code": 0, "msg": "", "data": FolderData, }) }