Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
YuChia-Wei committed Oct 2, 2024
1 parent c1334ff commit 7488633
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/dotnetLab.WebApi/Controllers/SampleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ public SampleController(IMediator mediator)
[ProducesResponseType<ApiResponse<SimpleDocumentViewModel>>(200)]
public async Task<IActionResult> Get([FromQuery] SimpleDocQueryRequest request)
{
var query = new SimpleDocQuery() { SerialId = request.SerialId };
var query = new SimpleDocQuery()
{
SerialId = request.SerialId
};
var simpleDocumentDto = await this._mediator.Send(query);
var simpleDocumentViewModel = new SimpleDocumentViewModel
{
SerialId = simpleDocumentDto.SerialId, Description = simpleDocumentDto.Description, DocumentNum = simpleDocumentDto.DocumentNum
SerialId = simpleDocumentDto.SerialId,
Description = simpleDocumentDto.Description,
DocumentNum = simpleDocumentDto.DocumentNum
};
return this.Ok(simpleDocumentViewModel);
}
Expand All @@ -74,7 +79,11 @@ public async Task<IActionResult> GetExceptionResponse()
[ProducesResponseType<ApiResponse<int>>(200)]
public async Task<IActionResult> Post([FromBody] NewSimpleDocumentRequest request)
{
var inputSimpleDocumentCommand = new InputSimpleDocumentCommand { DocumentNum = request.DocumentNum, Description = request.Description };
var inputSimpleDocumentCommand = new InputSimpleDocumentCommand
{
DocumentNum = request.DocumentNum,
Description = request.Description
};
var send = await this._mediator.Send(inputSimpleDocumentCommand);
return this.Ok(send);
}
Expand All @@ -89,7 +98,11 @@ public async Task<IActionResult> Post([FromBody] NewSimpleDocumentRequest reques
[ProducesResponseType<ApiResponse<bool>>(200)]
public async Task<IActionResult> Post([FromBody] UpdateSimpleDocumentDescriptionRequest request)
{
var command = new UpdateSimpleDocumentDescriptionCommand { SerialId = request.SerialId, Description = request.Description };
var command = new UpdateSimpleDocumentDescriptionCommand
{
SerialId = request.SerialId,
Description = request.Description
};
var send = await this._mediator.Send(command);
return this.Ok(send);
}
Expand Down

0 comments on commit 7488633

Please sign in to comment.