upload parking lot controller implement#6
Open
LucasCyw wants to merge 15 commits intoTWA-AFS-202310-GROUP-4:mainfrom
Open
upload parking lot controller implement#6LucasCyw wants to merge 15 commits intoTWA-AFS-202310-GROUP-4:mainfrom
LucasCyw wants to merge 15 commits intoTWA-AFS-202310-GROUP-4:mainfrom
Conversation
added 12 commits
November 8, 2023 13:27
JCLTW
reviewed
Nov 8, 2023
| @@ -0,0 +1,26 @@ | |||
| URL: parkinglots | |||
| { | ||
| [ApiController] | ||
| [Route("[controller]")] | ||
| public class ParkingLotController : ControllerBase |
| } | ||
|
|
||
| [HttpGet] | ||
| public async Task<ActionResult<List<ParkingLot>>> GetPartialAsync(int? pageSize = 10, int? pageIndex = 0) |
| } | ||
|
|
||
| [HttpPatch("{id}")] | ||
| public async Task<ActionResult<ParkingLot>> UpdatebyIdAsync(string id, [FromBody] JsonPatchDocument<ParkingLotDto> patchDoc) |
|
|
||
| public partial class Program { } | ||
|
|
||
| public static class MyJPIF |
|
|
||
| public async Task<ParkingLot> AddAsync(ParkingLotDto data) | ||
| { | ||
| if (data.Capacity < 10) |
|
|
||
| public async Task<ParkingLot> UpdateByIdAsync(string id, ParkingLotDto parkingLotDto) | ||
| { | ||
| if (parkingLotDto.Capacity < 10) throw new InvalidCapacityException(); |
|
|
||
| public async Task<List<ParkingLot>> GetParkingLotPartial(int pageSize, int pageIndex) | ||
| { | ||
| var parkingLots = _parkingLotCollection.Find(_ => true).ToList(); |
XDL27
reviewed
Nov 9, 2023
XDL27
left a comment
There was a problem hiding this comment.
Well:
- baby step commit
- name uniqueness check added
- use Patch update information
- Input check convers
| capacity: 10, | ||
| location: "hh" | ||
| } | ||
| """ No newline at end of file |
| { | ||
| if (data.Capacity < 10) throw new InvalidCapacityException(); | ||
|
|
||
| var checkName = _parkingLotRepository.GetParkingLotByName(data.Name); |
|
|
||
| public async Task<ParkingLot> UpdateByIdAsync(string id, ParkingLotDto parkingLotDto) | ||
| { | ||
| if (parkingLotDto.Capacity != 0 && parkingLotDto.Capacity < 10) throw new InvalidCapacityException(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.