...
|
...
|
@@ -17,26 +17,14 @@ func (c *CompanyController) URLMapping() { |
|
|
//c.Mapping("AccessToken", c.AccessToken)
|
|
|
}
|
|
|
|
|
|
// DepartmentAdd 部门列表
|
|
|
// @router /:companyid/department [get]
|
|
|
// DepartmentList 部门列表
|
|
|
// @router /department [get]
|
|
|
func (c *CompanyController) DepartmentList() {
|
|
|
log.Debug("DepartmentList param:%v", c.Ctx.Input.Param(":companyid"))
|
|
|
|
|
|
var msg *protocol.ResponseMessage
|
|
|
defer func() {
|
|
|
c.ResposeJson(msg)
|
|
|
}()
|
|
|
var (
|
|
|
param string
|
|
|
companyid int64
|
|
|
err error
|
|
|
)
|
|
|
param = c.Ctx.Input.Param(":companyid")
|
|
|
companyid, err = strconv.ParseInt(param, 10, 64)
|
|
|
if err != nil {
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
companyid := c.GetCompanyId()
|
|
|
if companyid <= 0 {
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
...
|
...
|
@@ -48,7 +36,7 @@ func (c *CompanyController) DepartmentList() { |
|
|
msg = protocol.NewReturnResponse(listdata, err)
|
|
|
}
|
|
|
|
|
|
// DepartmentAdd 部门列表
|
|
|
// DepartmentOne 部门信息
|
|
|
// @router /department/:id [get]
|
|
|
func (c *CompanyController) DepartmentOne() {
|
|
|
log.Debug("DepartmentOne param:%v", c.Ctx.Input.Param(":id"))
|
...
|
...
|
@@ -87,12 +75,12 @@ func (c *CompanyController) DepartmentAdd() { |
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
param.CompanyID = c.GetCompanyId()
|
|
|
if param.CompanyID <= 0 {
|
|
|
log.Error("param.CompanyID <= 0")
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
//err := protocol.NewErrWithMessage("101", nil)
|
|
|
err := servecompany.DepartmentAdd(param)
|
|
|
msg = protocol.NewReturnResponse(nil, err)
|
|
|
return
|
...
|
...
|
@@ -112,6 +100,7 @@ func (c *CompanyController) DepartmentUpdate() { |
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
param.CompanyID = c.GetCompanyId()
|
|
|
if param.ID <= 0 {
|
|
|
log.Error(" param.ID <= 0 ")
|
|
|
msg = protocol.BadRequestParam("1")
|
...
|
...
|
@@ -136,7 +125,7 @@ func (c *CompanyController) DepartmentDelete() { |
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
|
|
|
param.CompanyID = c.GetCompanyId()
|
|
|
err := servecompany.DepartmentDelete(param)
|
|
|
msg = protocol.NewReturnResponse(nil, err)
|
|
|
return
|
...
|
...
|
@@ -155,6 +144,8 @@ func (c *CompanyController) PositionAdd() { |
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
|
|
|
param.CompanyID = c.GetCompanyId()
|
|
|
positioninfo, err := servecompany.PositionAdd(param)
|
|
|
msg = protocol.NewReturnResponse(positioninfo, err)
|
|
|
return
|
...
|
...
|
@@ -173,6 +164,7 @@ func (c *CompanyController) PositionEdit() { |
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
param.CompanyID = c.GetCompanyId()
|
|
|
positioninfo, err := servecompany.PositionEdit(param)
|
|
|
msg = protocol.NewReturnResponse(positioninfo, err)
|
|
|
return
|
...
|
...
|
@@ -191,13 +183,14 @@ func (c *CompanyController) PositionDelete() { |
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
param.CompanyID = c.GetCompanyId()
|
|
|
err := servecompany.PositionDelete(param)
|
|
|
msg = protocol.NewReturnResponse(nil, err)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// PositionList 获取职位列表
|
|
|
// @router /:companyid/position [get]
|
|
|
// @router /position [get]
|
|
|
func (c *CompanyController) PositionList() {
|
|
|
var msg *protocol.ResponseMessage
|
|
|
defer func() {
|
...
|
...
|
@@ -209,8 +202,8 @@ func (c *CompanyController) PositionList() { |
|
|
list []protocol.ResponsePositionInfo
|
|
|
companyid int64
|
|
|
)
|
|
|
param := c.Ctx.Input.Param(":companyid")
|
|
|
companyid, _ = strconv.ParseInt(param, 10, 64)
|
|
|
|
|
|
companyid = c.GetCompanyId()
|
|
|
if companyid <= 0 {
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
...
|
...
|
@@ -219,3 +212,8 @@ func (c *CompanyController) PositionList() { |
|
|
msg = protocol.NewReturnResponse(list, err)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
//获取公司的基本信息
|
|
|
func (c *CompanyController) BaseInfo() {
|
|
|
|
|
|
} |
...
|
...
|
|