changed all end points to small case
This commit is contained in:
parent
f2c1d47749
commit
044876b23b
@ -17,7 +17,7 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
/// Get all answers
|
||||
/// </summary>
|
||||
|
||||
[HttpGet("Answers")]
|
||||
[HttpGet("answers")]
|
||||
public async Task<ActionResult> GetAnswersAsync() {
|
||||
|
||||
var result = await answerProvider.GetAnswersAsync();
|
||||
@ -33,11 +33,11 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
/// </summary>
|
||||
|
||||
|
||||
[HttpGet("Answers/{Id}")]
|
||||
public async Task<ActionResult> GetAnswerByIdAsync(int Id)
|
||||
[HttpGet("answers/{id}")]
|
||||
public async Task<ActionResult> GetAnswerByIdAsync(int id)
|
||||
{
|
||||
|
||||
var result = await answerProvider.GetAnswerByIdAsync(Id);
|
||||
var result = await answerProvider.GetAnswerByIdAsync(id);
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
return Ok(result.Answer);
|
||||
@ -48,7 +48,7 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
/// <summary>
|
||||
/// Get all answers based on responseId.
|
||||
/// </summary>
|
||||
[HttpGet("Answers/ByResponse/{responseid}")]
|
||||
[HttpGet("answers/byresponse/{responseid}")]
|
||||
public async Task<IActionResult> GetAnswersByResponseId(int responseid)
|
||||
{
|
||||
var result = await this.answerProvider.GetAnswersAsync(responseid);
|
||||
@ -62,7 +62,7 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
/// Get all answers based on questionId.
|
||||
/// </summary>
|
||||
|
||||
[HttpGet("Answers/ByQuestion/{questionid}")]
|
||||
[HttpGet("answers/byquestion/{questionid}")]
|
||||
public async Task<IActionResult> AnswersByQuestionId(int questionid)
|
||||
{
|
||||
var result = await this.answerProvider.GetAnswersByQuestionAsync(questionid);
|
||||
@ -76,7 +76,7 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
/// Update an existing answer.
|
||||
/// </summary>
|
||||
|
||||
[HttpPut("Answers")]
|
||||
[HttpPut("answers")]
|
||||
public async Task<IActionResult> UpdateAnswer(Models.Answer answer)
|
||||
{
|
||||
if (answer != null)
|
||||
@ -97,7 +97,7 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
/// Save a new answer.
|
||||
/// </summary>
|
||||
|
||||
[HttpPost("Answers")]
|
||||
[HttpPost("answers")]
|
||||
public async Task<IActionResult> CreateAnswer(Models.Answer answer)
|
||||
{
|
||||
if (answer != null)
|
||||
@ -115,7 +115,7 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
/// Delete an existing answer.
|
||||
/// </summary>
|
||||
|
||||
[HttpDelete("Answers/{id}")]
|
||||
[HttpDelete("answers/{id}")]
|
||||
public async Task<IActionResult> DeleteAnswer(int id)
|
||||
{
|
||||
var result = await this.answerProvider.DeleteAnswerAsync(id);
|
||||
|
@ -22,7 +22,7 @@ namespace DamageAssesment.Api.Attachments.Controllers
|
||||
/// Get all attachments.
|
||||
/// </summary>
|
||||
|
||||
[HttpGet("Attachments")]
|
||||
[HttpGet("attachments")]
|
||||
public async Task<ActionResult> GetAttachmentsAsync()
|
||||
{
|
||||
|
||||
@ -37,7 +37,7 @@ namespace DamageAssesment.Api.Attachments.Controllers
|
||||
/// <summary>
|
||||
/// Get all attachments by attachmentId.
|
||||
/// </summary>
|
||||
[HttpGet("Attachments/{id}")]
|
||||
[HttpGet("attachments/{id}")]
|
||||
public async Task<ActionResult> GetAttachmentbyIdAsync(int id)
|
||||
{
|
||||
|
||||
@ -81,7 +81,7 @@ namespace DamageAssesment.Api.Attachments.Controllers
|
||||
/// Save new Attachment(s)
|
||||
/// </summary>
|
||||
|
||||
[HttpPost("Attachments"), DisableRequestSizeLimit]
|
||||
[HttpPost("attachments"), DisableRequestSizeLimit]
|
||||
public async Task<IActionResult> UploadAttachmentAsync(AttachmentInfo attachmentInfo)
|
||||
{
|
||||
try
|
||||
@ -108,7 +108,7 @@ namespace DamageAssesment.Api.Attachments.Controllers
|
||||
/// Modify an new attachment.
|
||||
/// </summary>
|
||||
|
||||
[HttpPut("Attachments"), DisableRequestSizeLimit]
|
||||
[HttpPut("attachments"), DisableRequestSizeLimit]
|
||||
public async Task<IActionResult> UpdateAttachmentAsync(AttachmentInfo attachmentInfo)
|
||||
{
|
||||
try
|
||||
@ -138,7 +138,7 @@ namespace DamageAssesment.Api.Attachments.Controllers
|
||||
/// <summary>
|
||||
/// Delete an existing attachment.
|
||||
/// </summary>
|
||||
[HttpDelete("Attachments/{id}")]
|
||||
[HttpDelete("attachments/{id}")]
|
||||
public async Task<IActionResult> DeleteAttachment(int id)
|
||||
{
|
||||
// database soft delete
|
||||
|
@ -19,7 +19,7 @@ namespace DamageAssesment.Api.Employees.Controllers
|
||||
/// GET request for retrieving employees.
|
||||
/// </summary>
|
||||
|
||||
[HttpGet("Employees")]
|
||||
[HttpGet("employees")]
|
||||
public async Task<ActionResult> GetEmployeesAsync()
|
||||
{
|
||||
|
||||
@ -36,7 +36,7 @@ namespace DamageAssesment.Api.Employees.Controllers
|
||||
/// GET request for retrieving an employee by ID.
|
||||
/// </summary>
|
||||
|
||||
[HttpGet("Employees/{id}")]
|
||||
[HttpGet("employees/{id}")]
|
||||
public async Task<ActionResult> GetEmployeeByIdAsync(int id)
|
||||
{
|
||||
|
||||
@ -53,7 +53,7 @@ namespace DamageAssesment.Api.Employees.Controllers
|
||||
/// PUT request for updating an existing employee.
|
||||
/// </summary>
|
||||
/// <param name="Employee">The updated employee object.</param>
|
||||
[HttpPut("Employees/{id}")]
|
||||
[HttpPut("employees/{id}")]
|
||||
public async Task<IActionResult> UpdateEmployee(int id, Models.Employee Employee)
|
||||
{
|
||||
if (Employee != null)
|
||||
@ -75,7 +75,7 @@ namespace DamageAssesment.Api.Employees.Controllers
|
||||
/// POST request for creating a new employee.
|
||||
/// </summary>
|
||||
/// <param name="Employee">The employee information for creating a new employee.</param>
|
||||
[HttpPost("Employees")]
|
||||
[HttpPost("employees")]
|
||||
public async Task<IActionResult> CreateEmployee(Models.Employee Employee)
|
||||
{
|
||||
if (Employee != null)
|
||||
@ -93,7 +93,7 @@ namespace DamageAssesment.Api.Employees.Controllers
|
||||
/// DELETE request for deleting an existing employee.
|
||||
/// </summary>
|
||||
/// <param name="id">The ID of the employee to be deleted.</param>
|
||||
[HttpDelete("Employees/{id}")]
|
||||
[HttpDelete("employees/{id}")]
|
||||
public async Task<IActionResult> DeleteEmployee(int id)
|
||||
{
|
||||
var result = await this.EmployeeProvider.DeleteEmployeeAsync(id);
|
||||
|
@ -16,7 +16,7 @@ namespace DamageAssesment.Api.Locations.Controllers
|
||||
/// Get all locations.
|
||||
/// </summary>
|
||||
|
||||
[HttpGet("Locations")]
|
||||
[HttpGet("locations")]
|
||||
public async Task<ActionResult> GetLocationsAsync()
|
||||
{
|
||||
|
||||
@ -32,7 +32,7 @@ namespace DamageAssesment.Api.Locations.Controllers
|
||||
/// Get all locations based on locationdId.
|
||||
/// </summary>
|
||||
|
||||
[HttpGet("Locations/{id}")]
|
||||
[HttpGet("locations/{id}")]
|
||||
public async Task<ActionResult> GetLocationByIdAsync(int id)
|
||||
{
|
||||
|
||||
@ -48,7 +48,7 @@ namespace DamageAssesment.Api.Locations.Controllers
|
||||
/// Update a Location.
|
||||
/// </summary>
|
||||
|
||||
[HttpPut("Locations/{id}")]
|
||||
[HttpPut("locations/{id}")]
|
||||
public async Task<IActionResult> UpdateLocation(int id, Models.Location Location)
|
||||
{
|
||||
if (Location != null)
|
||||
@ -66,7 +66,7 @@ namespace DamageAssesment.Api.Locations.Controllers
|
||||
/// Save a new location.
|
||||
/// </summary>
|
||||
|
||||
[HttpPost("Locations")]
|
||||
[HttpPost("locations")]
|
||||
public async Task<IActionResult> CreateLocation(Models.Location Location)
|
||||
{
|
||||
if (Location != null)
|
||||
@ -84,7 +84,7 @@ namespace DamageAssesment.Api.Locations.Controllers
|
||||
/// Delete an existing location.
|
||||
/// </summary>
|
||||
|
||||
[HttpDelete("Locations/{id}")]
|
||||
[HttpDelete("locations/{id}")]
|
||||
public async Task<IActionResult> DeleteLocation(int id)
|
||||
{
|
||||
var result = await this.LocationProvider.DeleteLocationAsync(id);
|
||||
|
@ -20,8 +20,8 @@ namespace DamageAssesment.Api.Questions.Controllers
|
||||
/// </summary>
|
||||
|
||||
// get all questions
|
||||
[Route("Questions")]
|
||||
[Route("Questions/{language:alpha}")]
|
||||
[Route("questions")]
|
||||
[Route("questions/{language:alpha}")]
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> GetQuestionsAsync(string? language)
|
||||
{
|
||||
@ -37,8 +37,8 @@ namespace DamageAssesment.Api.Questions.Controllers
|
||||
/// <summary>
|
||||
/// GET request for retrieving a question by ID.
|
||||
/// </summary>
|
||||
[Route("Questions/{id}/{language:alpha}")]
|
||||
[Route("Questions/{id:int}")]
|
||||
[Route("questions/{id}/{language:alpha}")]
|
||||
[Route("questions/{id:int}")]
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> GetQuestionByIdAsync(int id, string? language)
|
||||
{
|
||||
@ -55,8 +55,8 @@ namespace DamageAssesment.Api.Questions.Controllers
|
||||
/// GET request for retrieving survey questions based on a survey ID.
|
||||
/// Uri: {Optional language}/GetSurveyQuestions/{surveyId} :Default returns question in all languages
|
||||
/// </summary>
|
||||
[Route("Questions/BySurvey/{surveyId:int}")]
|
||||
[Route("Questions/BySurvey/{surveyId:int}/{language:alpha}")]
|
||||
[Route("questions/bysurvey/{surveyId:int}")]
|
||||
[Route("questions/bysurvey/{surveyId:int}/{language:alpha}")]
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> GetSurveyQuestions(int surveyId,string? language)
|
||||
{
|
||||
@ -71,7 +71,7 @@ namespace DamageAssesment.Api.Questions.Controllers
|
||||
/// PUT request for updating a question (multilingual).
|
||||
/// </summary>
|
||||
|
||||
[HttpPut("Questions")]
|
||||
[HttpPut("questions")]
|
||||
public async Task<IActionResult> UpdateQuestion(Models.Question question)
|
||||
{
|
||||
if (question != null)
|
||||
@ -92,7 +92,7 @@ namespace DamageAssesment.Api.Questions.Controllers
|
||||
/// POST request for creating a new question (multilingual).
|
||||
/// </summary>
|
||||
|
||||
[HttpPost("Questions")]
|
||||
[HttpPost("questions")]
|
||||
public async Task<IActionResult> CreateQuestion(Models.Question question)
|
||||
{
|
||||
if (question != null)
|
||||
@ -110,7 +110,7 @@ namespace DamageAssesment.Api.Questions.Controllers
|
||||
/// DELETE request for deleting a question based on ID.
|
||||
/// </summary>
|
||||
|
||||
[HttpDelete("Questions/{id}")]
|
||||
[HttpDelete("questions/{id}")]
|
||||
public async Task<IActionResult> DeleteQuestion(int id)
|
||||
{
|
||||
var result = await this.questionsProvider.DeleteQuestionAsync(id);
|
||||
@ -125,8 +125,8 @@ namespace DamageAssesment.Api.Questions.Controllers
|
||||
/// GET request for retrieving question categories.
|
||||
/// </summary>
|
||||
|
||||
[HttpGet("Questions/Categories")]
|
||||
[HttpGet("Questions/Categories/{language:alpha}")]
|
||||
[HttpGet("questions/categories")]
|
||||
[HttpGet("questions/categories/{language:alpha}")]
|
||||
public async Task<IActionResult> GetQuestionCategoriesAsync(string? language)
|
||||
{
|
||||
var result = await this.questionsProvider.GetQuestionCategoriesAsync(language);
|
||||
@ -140,8 +140,8 @@ namespace DamageAssesment.Api.Questions.Controllers
|
||||
/// GET request for retrieving a question category by ID.
|
||||
/// </summary>
|
||||
|
||||
[HttpGet("Questions/Categories/{id:int}")]
|
||||
[HttpGet("Questions/Categories/{id:int}/{language:alpha}")]
|
||||
[HttpGet("questions/categories/{id:int}")]
|
||||
[HttpGet("questions/categories/{id:int}/{language:alpha}")]
|
||||
public async Task<IActionResult> GetQuestionCategoryAsync(int id,string? language)
|
||||
{
|
||||
var result = await this.questionsProvider.GetQuestionCategoryAsync(id, language);
|
||||
@ -157,7 +157,7 @@ namespace DamageAssesment.Api.Questions.Controllers
|
||||
/// PUT request for updating a question category.
|
||||
/// </summary>
|
||||
|
||||
[HttpPut("Questions/Categories")]
|
||||
[HttpPut("questions/categories")]
|
||||
public async Task<IActionResult> UpdateQuestionCategory(Models.QuestionCategory questionCategory)
|
||||
{
|
||||
if (questionCategory != null)
|
||||
@ -178,7 +178,7 @@ namespace DamageAssesment.Api.Questions.Controllers
|
||||
/// POST request for creating a new question category.
|
||||
/// </summary>
|
||||
|
||||
[HttpPost("Questions/Categories")]
|
||||
[HttpPost("questions/categories")]
|
||||
public async Task<IActionResult> CreateQuestionCategory(Models.QuestionCategory questionCategory)
|
||||
{
|
||||
if (questionCategory != null)
|
||||
@ -196,7 +196,7 @@ namespace DamageAssesment.Api.Questions.Controllers
|
||||
/// DELETE request for deleting a question category based on ID.
|
||||
/// </summary>
|
||||
|
||||
[HttpDelete("Questions/Categories/{id}")]
|
||||
[HttpDelete("questions/categories/{id}")]
|
||||
public async Task<IActionResult> DeleteQuestionCategory(int id)
|
||||
{
|
||||
var result = await this.questionsProvider.DeleteQuestionCategoryAsync(id);
|
||||
|
@ -17,8 +17,8 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
/// GET request for retrieving survey responses.
|
||||
/// </summary>
|
||||
|
||||
[Route("Responses/{employeeid:int}")]
|
||||
[Route("Responses")]
|
||||
[Route("responses/{employeeid:int}")]
|
||||
[Route("responses")]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetSurveyResponsesAsync(int? employeeid)
|
||||
{
|
||||
@ -36,8 +36,8 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
/// <summary>
|
||||
/// GET request for retrieving survey responses by survey ID.
|
||||
/// </summary>
|
||||
[Route("Responses/BySurvey/{surveyid:int}/{employeeid:int}")]
|
||||
[Route("Responses/BySurvey/{surveyid:int}")]
|
||||
[Route("responses/bysurvey/{surveyid:int}/{employeeid:int}")]
|
||||
[Route("responses/bysurvey/{surveyid:int}")]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetSurveyResponsesAsync(int surveyid, int? employeeid)
|
||||
{
|
||||
@ -54,8 +54,8 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
/// <param name="surveyid">The ID of the survey for which responses are to be retrieved.</param>
|
||||
/// <param name="locationid">The ID of the location for which responses are to be retrieved.</param>
|
||||
|
||||
[Route("Responses/{surveyid:int}/{locationid:int}/{employeeid:int}")]
|
||||
[Route("Responses/{surveyid:int}/{locationid:int}")]
|
||||
[Route("responses/{surveyid:int}/{locationid:int}/{employeeid:int}")]
|
||||
[Route("responses/{surveyid:int}/{locationid:int}")]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetSurveyResponsesBySurveyAndLocationAsync(int surveyid, int locationid,int? employeeid)
|
||||
{
|
||||
@ -73,8 +73,8 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
/// <param name="questionId">The ID of the question for which responses are to be retrieved.</param>
|
||||
/// <param name="answer">The answer for which responses are to be retrieved.</param>
|
||||
|
||||
[Route("Responses/ByAnswer/{surveyid:int}/{questionid:int}/{answer:alpha}/{employeeid:int}")]
|
||||
[Route("Responses/ByAnswer/{surveyid:int}/{questionid:int}/{answer:alpha}")]
|
||||
[Route("responses/byanswer/{surveyid:int}/{questionid:int}/{answer:alpha}/{employeeid:int}")]
|
||||
[Route("responses/byanswer/{surveyid:int}/{questionid:int}/{answer:alpha}")]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetSurveyResponsesByAnswerAsyncAsync(int surveyid, int questionid, string answer, int? employeeid)
|
||||
{
|
||||
@ -91,8 +91,8 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
/// </summary>
|
||||
/// <param name="surveyId">The ID of the survey for which answers are to be retrieved.</param>
|
||||
|
||||
[Route("Responses/ByRegion/{surveyid:int}")]
|
||||
[Route("Responses/ByRegion/{surveyid:int}/{employeeid}")]
|
||||
[Route("responses/byregion/{surveyid:int}")]
|
||||
[Route("responses/byregion/{surveyid:int}/{employeeid}")]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetAnswersByRegionAsync(int surveyid, int? employeeid)
|
||||
{
|
||||
@ -107,8 +107,8 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
/// GET request for retrieving survey responses by survey ID and maintenance center.
|
||||
/// </summary>
|
||||
/// <param name="surveyId">The ID of the survey for which responses are to be retrieved.</param>
|
||||
[Route("Responses/ByMaintenanceCenter/{surveyid:int}/{employeeid:int}")]
|
||||
[Route("Responses/ByMaintenanceCenter/{surveyid:int}")]
|
||||
[Route("responses/bymaintenancecenter/{surveyid:int}/{employeeid:int}")]
|
||||
[Route("responses/bymaintenancecenter/{surveyid:int}")]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetAnswersByMaintenaceCentersync(int surveyid, int? employeeid)
|
||||
{
|
||||
@ -124,7 +124,7 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
/// </summary>
|
||||
/// <param name="responseId">The ID of the survey response to be retrieved.</param>
|
||||
|
||||
[HttpGet("Responses/{id}")]
|
||||
[HttpGet("responses/{id}")]
|
||||
public async Task<ActionResult> GetSurveyResponseByIdAsync(int id)
|
||||
{
|
||||
var result = await this.surveyResponseProvider.GetSurveyResponseByIdAsync(id);
|
||||
@ -140,7 +140,7 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
/// </summary>
|
||||
/// <param name="surveyResponse">The survey response object to be created.</param>
|
||||
|
||||
[HttpPost("Responses")]
|
||||
[HttpPost("responses")]
|
||||
public async Task<ActionResult> PostSurveysAsync(Models.SurveyResponse surveyResponse)
|
||||
{
|
||||
var result = await this.surveyResponseProvider.PostSurveyResponseAsync(surveyResponse);
|
||||
@ -156,7 +156,7 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
/// <param name="Id">The ID of the survey response to be updated.</param>
|
||||
/// <param name="surveyResponse">The updated survey response object.</param>
|
||||
|
||||
[HttpPut("Responses/{id}")]
|
||||
[HttpPut("responses/{id}")]
|
||||
public async Task<ActionResult> PutSurveyResponseAsync(int id, Models.SurveyResponse surveyResponse)
|
||||
{
|
||||
var result = await this.surveyResponseProvider.PutSurveyResponseAsync(id, surveyResponse);
|
||||
@ -173,7 +173,7 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
/// DELETE request for deleting an existing survey response.
|
||||
/// </summary>
|
||||
|
||||
[HttpDelete("Responses/{id}")]
|
||||
[HttpDelete("responses/{id}")]
|
||||
public async Task<ActionResult> DeleteSurveyResponseAsync(int id)
|
||||
{
|
||||
var result = await this.surveyResponseProvider.DeleteSurveyResponseAsync(id);
|
||||
@ -188,7 +188,7 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
/// </summary>
|
||||
/// <param name="request">The answers to be submitted for the survey.</param>
|
||||
|
||||
[HttpPost("Responses/Answers")]
|
||||
[HttpPost("responses/answers")]
|
||||
public async Task<ActionResult> PostSurveyAnswersAsync(Request request)
|
||||
{
|
||||
var result = await this.surveyResponseProvider.PostSurveyAnswersAsync(request);
|
||||
@ -199,8 +199,8 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
return BadRequest(result.ErrorMessage);
|
||||
}
|
||||
|
||||
[Route("Responses/Surveys/active/{employeeid:int}")]
|
||||
[Route("Responses/Surveys/active/{employeeid:int}/{language:alpha}")]
|
||||
[Route("responses/surveys/active/{employeeid:int}")]
|
||||
[Route("responses/surveys/active/{employeeid:int}/{language:alpha}")]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetActiveSurveysAsync(int employeeid, string? language)
|
||||
{
|
||||
@ -212,8 +212,8 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
[Route("Responses/Surveys/historic/{employeeid:int}")]
|
||||
[Route("Responses/Surveys/historic/{employeeid:int}/{language:alpha}")]
|
||||
[Route("responses/surveys/historic/{employeeid:int}")]
|
||||
[Route("responses/surveys/historic/{employeeid:int}/{language:alpha}")]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetHistoricSurveysAsync(int employeeid, string? language)
|
||||
{
|
||||
|
@ -17,17 +17,17 @@
|
||||
},
|
||||
|
||||
"RessourceSettings": {
|
||||
"Employee": "/Employees",
|
||||
"EmployeeById": "/Employees/{0}",
|
||||
"Question": "/Questions",
|
||||
"QuestionById": "/Questions/{0}",
|
||||
"SurveyQuestion": "/Questions/BySurvey/{0}",
|
||||
"Survey": "/Surveys",
|
||||
"SurveyById": "/Surveys/{0}",
|
||||
"Attachment": "/Attachments",
|
||||
"Answer": "/Answers",
|
||||
"AnswerByResponse": "/Answers/ByResponse/{0}",
|
||||
"Location": "/Locations",
|
||||
"Region": "/Regions"
|
||||
"Employee": "/employees",
|
||||
"EmployeeById": "/employees/{0}",
|
||||
"Question": "/questions",
|
||||
"QuestionById": "/questions/{0}",
|
||||
"SurveyQuestion": "/questions/bysurvey/{0}",
|
||||
"Survey": "/surveys",
|
||||
"SurveyById": "/surveys/{0}",
|
||||
"Attachment": "/attachments",
|
||||
"Answer": "/answers",
|
||||
"AnswerByResponse": "/answers/byresponse/{0}",
|
||||
"Location": "/locations",
|
||||
"Region": "/regions"
|
||||
}
|
||||
}
|
||||
|
@ -15,8 +15,8 @@ namespace DamageAssesment.Api.Surveys.Controllers
|
||||
/// <summary>
|
||||
/// GET request for retrieving surveys.
|
||||
/// </summary>
|
||||
[Route("Surveys")]
|
||||
[Route("Surveys/{language:alpha}")]
|
||||
[Route("surveys")]
|
||||
[Route("surveys/{language:alpha}")]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetSurveysAsync(string? language)
|
||||
{
|
||||
@ -31,8 +31,8 @@ namespace DamageAssesment.Api.Surveys.Controllers
|
||||
/// <summary>
|
||||
/// GET request for retrieving surveys by ID.
|
||||
/// </summary>
|
||||
[Route("Surveys/{id:int}")]
|
||||
[Route("Surveys/{id:int}/{language:alpha}")]
|
||||
[Route("surveys/{id:int}")]
|
||||
[Route("surveys/{id:int}/{language:alpha}")]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetSurveysAsync(int id, string? language)
|
||||
{
|
||||
@ -46,7 +46,7 @@ namespace DamageAssesment.Api.Surveys.Controllers
|
||||
/// <summary>
|
||||
/// POST request for creating a new survey.
|
||||
/// </summary>
|
||||
[HttpPost("Surveys")]
|
||||
[HttpPost("surveys")]
|
||||
public async Task<ActionResult> PostSurveysAsync(Models.Survey survey)
|
||||
{
|
||||
var result = await this.surveyProvider.PostSurveyAsync(survey);
|
||||
@ -59,7 +59,7 @@ namespace DamageAssesment.Api.Surveys.Controllers
|
||||
/// <summary>
|
||||
/// PUT request for updating an existing survey (surveyId,Updated Survey data).
|
||||
/// </summary>
|
||||
[HttpPut("Surveys/{id}")]
|
||||
[HttpPut("surveys/{id}")]
|
||||
public async Task<ActionResult> PutSurveysAsync(int id, Models.Survey survey)
|
||||
{
|
||||
var result = await this.surveyProvider.PutSurveyAsync(id, survey);
|
||||
@ -76,7 +76,7 @@ namespace DamageAssesment.Api.Surveys.Controllers
|
||||
/// <summary>
|
||||
/// DELETE request for deleting a survey by ID.
|
||||
/// </summary>
|
||||
[HttpDelete("Surveys/{id}")]
|
||||
[HttpDelete("surveys/{id}")]
|
||||
public async Task<ActionResult> DeleteSurveysAsync(int id)
|
||||
{
|
||||
var result = await this.surveyProvider.DeleteSurveyAsync(id);
|
||||
|
@ -0,0 +1,26 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
|
||||
<PackageReference Include="Moq" Version="4.18.4" />
|
||||
<PackageReference Include="xunit" Version="2.4.2" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -45,7 +45,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
||||
var mockResponse = await MockData.getOkResponse();
|
||||
mockSurveyResponseService.Setup(service => service.GetSurveyResponsesBySurveyAsync(1,1)).ReturnsAsync(mockResponse);
|
||||
var surveyResponseProvider = new SurveyResponsesController(mockSurveyResponseService.Object);
|
||||
var result = (OkObjectResult)await surveyResponseProvider.GetSurveyResponsesAsync(1);
|
||||
var result = (OkObjectResult)await surveyResponseProvider.GetSurveyResponsesAsync(1,1);
|
||||
Assert.Equal(200, result.StatusCode);
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
||||
var mockResponse = await MockData.getResponse();
|
||||
mockSurveyResponseService.Setup(service => service.GetSurveyResponsesBySurveyAsync(1,1)).ReturnsAsync(mockResponse);
|
||||
var surveyResponseProvider = new SurveyResponsesController(mockSurveyResponseService.Object);
|
||||
var result = (NoContentResult)await surveyResponseProvider.GetSurveyResponsesAsync(1);
|
||||
var result = (NoContentResult)await surveyResponseProvider.GetSurveyResponsesAsync(1,1);
|
||||
Assert.Equal(204, result.StatusCode);
|
||||
}
|
||||
|
||||
|
@ -17,14 +17,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DamageAssesment.Api.Locations", "DamageAssesment.Api.Locations\DamageAssesment.Api.Locations.csproj", "{746C67BF-9949-4361-B5D2-358C7607750E}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DamageAssesment.Api.Responses", "DamageAssesment.Api.SurveyResponses\DamageAssesment.Api.Responses.csproj", "{D11808FE-AD1C-4BA6-87FD-9D18B2DC81F2}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DamageAssesment.Api.Questions.Test", "DamageAssesment.Api.QuestionsTest\DamageAssesment.Api.Questions.Test.csproj", "{35CD9231-034D-4999-BCFC-1786DD007ED2}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DamageAssesment.Api.Surveys.Test", "DamageAssesment.Api.Surveys.Test\DamageAssesment.Api.Surveys.Test.csproj", "{ADFB79E3-83C9-454F-A070-49D167BD28CC}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DamageAssesment.Api.Responses.Test", "DamageAssesment.SurveyResponses.Test\DamageAssesment.Api.Responses.Test.csproj", "{6F4B9C9D-CE5D-421A-876F-57D0FEDF8049}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DamageAssesment.Api.Attachments.Test", "DamageAssesment.Api.Attachments.Test\DamageAssesment.Api.Attachments.Test.csproj", "{730E5718-FCE1-42C0-AB76-EA020896A788}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DamageAssesment.Api.Locations.Test", "DamageAssesment.Api.Locations.Test\DamageAssesment.Api.Locations.Test.csproj", "{DA68AE47-6825-41ED-9107-5151822FB083}"
|
||||
@ -41,6 +37,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DamageAssesment.Api.DocuLin
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DamageAssesment.Api.DocuLinks.Test", "DamageAssesment.Api.DocuLinks.Test\DamageAssesment.Api.DocuLinks.Test.csproj", "{A7F17ED7-71D2-4FD0-87E5-D83415078FC0}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DamageAssesment.Api.Responses", "DamageAssesment.Api.SurveyResponses\DamageAssesment.Api.Responses.csproj", "{39AEE725-5F64-46D7-B8AA-5AA4047C46CB}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DamageAssesment.Api.Responses.Test", "DamageAssesment.SurveyResponses.Test\DamageAssesment.Api.Responses.Test.csproj", "{8F0E9915-DD51-48B7-8338-01F0244BD1D7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -63,10 +63,6 @@ Global
|
||||
{746C67BF-9949-4361-B5D2-358C7607750E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{746C67BF-9949-4361-B5D2-358C7607750E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{746C67BF-9949-4361-B5D2-358C7607750E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D11808FE-AD1C-4BA6-87FD-9D18B2DC81F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D11808FE-AD1C-4BA6-87FD-9D18B2DC81F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D11808FE-AD1C-4BA6-87FD-9D18B2DC81F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D11808FE-AD1C-4BA6-87FD-9D18B2DC81F2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{35CD9231-034D-4999-BCFC-1786DD007ED2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{35CD9231-034D-4999-BCFC-1786DD007ED2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{35CD9231-034D-4999-BCFC-1786DD007ED2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@ -75,10 +71,6 @@ Global
|
||||
{ADFB79E3-83C9-454F-A070-49D167BD28CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{ADFB79E3-83C9-454F-A070-49D167BD28CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{ADFB79E3-83C9-454F-A070-49D167BD28CC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6F4B9C9D-CE5D-421A-876F-57D0FEDF8049}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6F4B9C9D-CE5D-421A-876F-57D0FEDF8049}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6F4B9C9D-CE5D-421A-876F-57D0FEDF8049}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6F4B9C9D-CE5D-421A-876F-57D0FEDF8049}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{730E5718-FCE1-42C0-AB76-EA020896A788}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{730E5718-FCE1-42C0-AB76-EA020896A788}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{730E5718-FCE1-42C0-AB76-EA020896A788}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@ -111,6 +103,14 @@ Global
|
||||
{A7F17ED7-71D2-4FD0-87E5-D83415078FC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A7F17ED7-71D2-4FD0-87E5-D83415078FC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A7F17ED7-71D2-4FD0-87E5-D83415078FC0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{39AEE725-5F64-46D7-B8AA-5AA4047C46CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{39AEE725-5F64-46D7-B8AA-5AA4047C46CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{39AEE725-5F64-46D7-B8AA-5AA4047C46CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{39AEE725-5F64-46D7-B8AA-5AA4047C46CB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8F0E9915-DD51-48B7-8338-01F0244BD1D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8F0E9915-DD51-48B7-8338-01F0244BD1D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8F0E9915-DD51-48B7-8338-01F0244BD1D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8F0E9915-DD51-48B7-8338-01F0244BD1D7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
Loading…
Reference in New Issue
Block a user