Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13-0013] Code Assessment for Scott Winters #44

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[13-0013] - cleanup whoooops
scottmwinters committed Mar 31, 2023
commit 4b767fbe0dcf257c372806c08b3c447e2998c35c
88 changes: 0 additions & 88 deletions src/main/java/com/bravo/user/controller/PaymentController.java
Original file line number Diff line number Diff line change
@@ -22,15 +22,6 @@ public PaymentController(UserValidator userValidator, PaymentService paymentServ
this.userValidator = userValidator;
this.paymentService = paymentService;
}

/*
public List<AddressDto> retrieve(final @PathVariable String userId) {
userValidator.validateId(userId);
return addressService.retrieveByUserId(userId);
}
*/

//private final PaymentService paymentService;
@GetMapping(value = "/retrieve/{userId}")
@ResponseBody
public List<PaymentDto> retrieve(final @PathVariable String userId) {
@@ -40,82 +31,3 @@ public List<PaymentDto> retrieve(final @PathVariable String userId) {


}


/*
@RequestMapping(value = "/user")
@SwaggerController
public class UserController {

private final UserService userService;
private final UserValidator userValidator;

public UserController(UserService userService, UserValidator userValidator) {
this.userService = userService;
this.userValidator = userValidator;
}

@PostMapping(value = "/create")
@ResponseBody
public UserReadDto create(final @RequestBody UserSaveDto request, final BindingResult errors)
throws BindException {
userValidator.validate(Crud.CREATE, request, errors);
return userService.create(request);
}

@GetMapping(value = "/retrieve")
@ResponseBody
public List<UserReadDto> retrieve(
final @RequestParam(required = false) String id,
final @RequestParam(required = false) String name,
final @RequestParam(required = false) Integer page,
final @RequestParam(required = false) Integer size,
final HttpServletResponse httpResponse
) {
if(id != null){
userValidator.validateId(id);
return Collections.singletonList(userService.retrieve(id));
}
else if(name != null){
userValidator.validateName(ValidatorUtil.removeControlCharacters(name));
final PageRequest pageRequest = PageUtil.createPageRequest(page, size);
return userService.retrieveByName(name, pageRequest, httpResponse);
}
else {
throw new BadRequestException("'id' or 'name' is required!");
}
}

@PostMapping(value = "/retrieve")
@ResponseBody
public List<UserReadDto> retrieve(
final @RequestBody UserFilter filter,
final @RequestParam(required = false) Integer page,
final @RequestParam(required = false) Integer size,
final HttpServletResponse httpResponse
) {
final PageRequest pageRequest = PageUtil.createPageRequest(page, size);
return userService.retrieve(filter, pageRequest, httpResponse);
}

@PatchMapping(value = "/update/{id}")
@ResponseBody
public UserReadDto update(
final @PathVariable String id,
final @RequestBody UserSaveDto request,
final BindingResult errors
) throws BindException {
userValidator.validateId(id);
userValidator.validate(Crud.UPDATE, request, errors);
return userService.update(id, request);
}

@DeleteMapping(value = "/delete/{id}")
@ResponseBody
public boolean delete(final @PathVariable String id) {
userValidator.validateId(id);
return userService.delete(id);
}
}

*/