package controllers import ( "ERP_user/models/Account" "git.baozhida.cn/ERP_libs/lib" beego "github.com/beego/beego/v2/server/web" ) type DeptController struct { beego.Controller User Account.User } func (c *DeptController) Prepare() { c.User = *Account.User_r } // 部门列表 - func (c *DeptController) List() { c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: Account.Read_Dept_List()} c.ServeJSON() return } // 岗位列表 - func (c *DeptController) Post_List() { T_dept, _ := c.GetInt("T_dept") if T_dept == 0 { c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_dept Err!"} c.ServeJSON() return } c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: Account.Read_Post_List(T_dept)} c.ServeJSON() return }