organization

This commit is contained in:
skiffer-git 2022-04-17 12:32:28 +08:00
parent 6d55f35404
commit 9def85f9ba
2 changed files with 4 additions and 4 deletions

View File

@ -88,7 +88,7 @@ func UpdateDepartment(c *gin.Context) {
} }
func GetSubDepartment(c *gin.Context) { func GetSubDepartment(c *gin.Context) {
params := api.GetDepartmentReq{} params := api.GetSubDepartmentReq{}
if err := c.BindJSON(&params); err != nil { if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error()) log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
@ -116,7 +116,7 @@ func GetSubDepartment(c *gin.Context) {
return return
} }
apiResp := api.GetDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, DepartmentList: RpcResp.DepartmentList} apiResp := api.GetSubDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, DepartmentList: RpcResp.DepartmentList}
apiResp.Data = jsonData.JsonDataList(RpcResp.DepartmentList) apiResp.Data = jsonData.JsonDataList(RpcResp.DepartmentList)
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp) c.JSON(http.StatusOK, apiResp)

View File

@ -21,11 +21,11 @@ type UpdateDepartmentResp struct {
CommResp CommResp
} }
type GetDepartmentReq struct { type GetSubDepartmentReq struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
DepartmentID string DepartmentID string
} }
type GetDepartmentResp struct { type GetSubDepartmentResp struct {
CommResp CommResp
DepartmentList []*open_im_sdk.Department `json:"-"` DepartmentList []*open_im_sdk.Department `json:"-"`
Data []map[string]interface{} `json:"data"` Data []map[string]interface{} `json:"data"`