示例#1
0
 internal static bool FeedbackEscalationTeam(FeedbackEscalationTeamReq req)
 {
     if (req == null || string.IsNullOrEmpty(req.device_id) ||
         string.IsNullOrEmpty(req.os_type) ||
         req.user_id <= 0)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
        public IActionResult FeedbackEscalationTeam(FeedbackEscalationTeamReq req)
        {
            EscalationUserResp resp = new EscalationUserResp();

            try
            {
                if (RequestValidator.FeedbackEscalationTeam(req))
                {
                    if (req.user_id == JwtToken.GetUserID(req.token))
                    {
                        var user  = UserCRUD.GetUser(req.user_id);
                        int?scale = UserCRUD.GetUserRole(req.user_id).Scale;

                        resp.status_code    = Ok().StatusCode;
                        resp.status_message = StatusMessage.Success;
                        resp.UserList       = UserCRUD.GetEscalationUserList(user.Id, user.CompanyId, scale ?? 0, 0);
                    }
                    else
                    {
                        resp.status_code    = Unauthorized().StatusCode;
                        resp.status_message = StatusMessage.UnAuthorised;
                    }
                }
                else
                {
                    resp.status_code    = BadRequest().StatusCode;
                    resp.status_message = StatusMessage.BadRequest;
                }
            }
            catch (Exception es)
            {
                resp.status_code    = 500;
                resp.status_message = StatusMessage.InternalServerError;
            }

            return(Ok(resp));
        }