forked from MDCPS/DamageAssessment_Backend
Swagger Documentation Enhancement (273)
This commit is contained in:
@ -14,7 +14,10 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
public AnswersController(IAnswersProvider answersProvider) {
|
||||
this.answerProvider=answersProvider;
|
||||
}
|
||||
//get all answers
|
||||
/// <summary>
|
||||
/// Get all answers
|
||||
/// </summary>
|
||||
|
||||
[HttpGet("Answers")]
|
||||
public async Task<ActionResult> GetAnswersAsync() {
|
||||
|
||||
@ -26,7 +29,11 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
return NoContent();
|
||||
|
||||
}
|
||||
//get answer based on answerid
|
||||
/// <summary>
|
||||
/// Get an answer based on answerId.
|
||||
/// </summary>
|
||||
|
||||
|
||||
[HttpGet("Answers/{Id}")]
|
||||
public async Task<ActionResult> GetAnswerByIdAsync(int Id)
|
||||
{
|
||||
@ -39,7 +46,9 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
return NotFound();
|
||||
|
||||
}
|
||||
// get all answers based on response id
|
||||
/// <summary>
|
||||
/// Get all answers based on responseId.
|
||||
/// </summary>
|
||||
[HttpGet("AnswersByResponse/{ResponseId}")]
|
||||
public async Task<IActionResult> GetAnswersByResponseId(int ResponseId)
|
||||
{
|
||||
@ -50,7 +59,10 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
}
|
||||
return NoContent();
|
||||
}
|
||||
// get all answers based on question id
|
||||
/// <summary>
|
||||
/// Get all answers based on questionId.
|
||||
/// </summary>
|
||||
|
||||
[HttpGet("AnswersByQuestion/{QuestionId}")]
|
||||
public async Task<IActionResult> AnswersByQuestionId(int QuestionId)
|
||||
{
|
||||
@ -61,7 +73,9 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
}
|
||||
return NotFound();
|
||||
}
|
||||
//update existing answer
|
||||
/// <summary>
|
||||
/// Update an existing answer.
|
||||
/// </summary>
|
||||
|
||||
[HttpPut("Answers")]
|
||||
public async Task<IActionResult> UpdateAnswer(Db.Answer answer)
|
||||
@ -80,7 +94,10 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
}
|
||||
return NotFound();
|
||||
}
|
||||
//save new answer
|
||||
/// <summary>
|
||||
/// Save a new answer.
|
||||
/// </summary>
|
||||
|
||||
[HttpPost("Answers")]
|
||||
public async Task<IActionResult> CreateAnswer(Db.Answer answer)
|
||||
{
|
||||
@ -95,7 +112,10 @@ namespace DamageAssesment.Api.Answers.Controllers
|
||||
}
|
||||
return CreatedAtRoute("DefaultApi", new { id = answer.Id }, answer);
|
||||
}
|
||||
//delete existing answer
|
||||
/// <summary>
|
||||
/// Delete an existing answer.
|
||||
/// </summary>
|
||||
|
||||
[HttpDelete("Answers/{id}")]
|
||||
public async Task<IActionResult> DeleteAnswer(int id)
|
||||
{
|
||||
|
Reference in New Issue
Block a user