fix
This commit is contained in:
@@ -74,7 +74,7 @@ func (h *Organization) FindDepartment(c *gin.Context) {
|
||||
id, _ := strconv.ParseUint(c.Query("id"), 10, 64)
|
||||
item, err := h.service.Department(c.Request.Context(), uint(id))
|
||||
if err != nil {
|
||||
httpx.Fail(c, "获取失败")
|
||||
httpx.Fail(c, "获取失败:"+err.Error())
|
||||
return
|
||||
}
|
||||
httpx.Write(c, httpx.CodeSuccess, item, "获取成功")
|
||||
@@ -83,7 +83,7 @@ func (h *Organization) DepartmentUsers(c *gin.Context) {
|
||||
id, _ := strconv.ParseUint(c.Query("deptId"), 10, 64)
|
||||
ids, err := h.service.DepartmentUserIDs(c.Request.Context(), uint(id))
|
||||
if err != nil {
|
||||
httpx.Fail(c, "获取失败")
|
||||
httpx.Fail(c, "获取失败:"+err.Error())
|
||||
return
|
||||
}
|
||||
if ids == nil {
|
||||
@@ -98,10 +98,10 @@ func (h *Organization) SetDepartmentUsers(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if err := h.service.SetDepartmentUsers(c.Request.Context(), &req); err != nil {
|
||||
httpx.Fail(c, "设置失败")
|
||||
httpx.Fail(c, "设置失败:"+err.Error())
|
||||
return
|
||||
}
|
||||
httpx.OK(c)
|
||||
httpx.Write(c, httpx.CodeSuccess, gin.H{}, "设置成功")
|
||||
}
|
||||
func (h *Organization) SetUserDepartments(c *gin.Context) {
|
||||
var req dto.SetUserDepartmentsRequest
|
||||
@@ -113,7 +113,7 @@ func (h *Organization) SetUserDepartments(c *gin.Context) {
|
||||
httpx.Fail(c, "设置失败")
|
||||
return
|
||||
}
|
||||
httpx.OK(c)
|
||||
httpx.Write(c, httpx.CodeSuccess, gin.H{}, "设置成功")
|
||||
}
|
||||
|
||||
func (h *Organization) ListPositions(c *gin.Context) {
|
||||
@@ -177,7 +177,7 @@ func (h *Organization) FindPosition(c *gin.Context) {
|
||||
id, _ := strconv.ParseUint(c.Query("id"), 10, 64)
|
||||
item, err := h.service.Position(c.Request.Context(), uint(id))
|
||||
if err != nil {
|
||||
httpx.Fail(c, "获取失败")
|
||||
httpx.Fail(c, "获取失败:"+err.Error())
|
||||
return
|
||||
}
|
||||
httpx.Write(c, httpx.CodeSuccess, item, "获取成功")
|
||||
@@ -186,7 +186,7 @@ func (h *Organization) PositionUsers(c *gin.Context) {
|
||||
id, _ := strconv.ParseUint(c.Query("positionId"), 10, 64)
|
||||
ids, err := h.service.PositionUserIDs(c.Request.Context(), uint(id))
|
||||
if err != nil {
|
||||
httpx.Fail(c, "获取失败")
|
||||
httpx.Fail(c, "获取失败:"+err.Error())
|
||||
return
|
||||
}
|
||||
if ids == nil {
|
||||
@@ -201,10 +201,10 @@ func (h *Organization) SetPositionUsers(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if err := h.service.SetPositionUsers(c.Request.Context(), &req); err != nil {
|
||||
httpx.Fail(c, "设置失败")
|
||||
httpx.Fail(c, "设置失败:"+err.Error())
|
||||
return
|
||||
}
|
||||
httpx.OK(c)
|
||||
httpx.Write(c, httpx.CodeSuccess, gin.H{}, "设置成功")
|
||||
}
|
||||
func (h *Organization) SetUserPositions(c *gin.Context) {
|
||||
var req dto.SetUserPositionsRequest
|
||||
@@ -216,5 +216,5 @@ func (h *Organization) SetUserPositions(c *gin.Context) {
|
||||
httpx.Fail(c, "设置失败")
|
||||
return
|
||||
}
|
||||
httpx.OK(c)
|
||||
httpx.Write(c, httpx.CodeSuccess, gin.H{}, "设置成功")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user