Api: added links field for success response

This commit is contained in:
pavelbannov 2023-01-30 16:57:29 +03:00
parent 6dc710be0a
commit 8f922bd8cf

View File

@ -104,6 +104,8 @@ public class SuccessApiResponse : CommonApiResponse
}
}
public List<Link> Links { get; set; }
public SuccessApiResponse()
{
@ -114,6 +116,15 @@ public class SuccessApiResponse : CommonApiResponse
Status = 0;
_httpContext = httpContext;
Response = response;
Links = new List<Link>(1)
{
new Link()
{
Href = httpContext.Request.GetUrlRewriter().ToString(),
Action = httpContext.Request.Method
}
};
}
}
@ -141,3 +152,9 @@ public class CommonApiError
return result;
}
}
public class Link
{
public string Href { get; set; }
public string Action { get; set; }
}