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

feat: add Spring Boot service #48

Merged
merged 2 commits into from
Jan 19, 2022
Merged

Conversation

genryxy
Copy link
Contributor

@genryxy genryxy commented Jan 17, 2022

Part of #47
Create a simple Spring Boot service for uploading and downloading files. This service will be used lased to compare performance with Artipie realization.

@genryxy genryxy requested review from a team and olenagerasimova and removed request for a team January 17, 2022 19:21
Copy link
Member

@olenagerasimova olenagerasimova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@genryxy thanks, please, check my comments

import org.springframework.web.multipart.MultipartFile;

@RestController
public class FileController {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will happen if runtime exception is thrown while saving/getting file? 500 status will be returned?


@PostMapping("upload")
@ResponseStatus(HttpStatus.CREATED)
public ResponseEntity<String> uploadFile(@RequestParam("file") MultipartFile file) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why multipart? in our files adapter files are uploaded not as multipart body, file binary body is the body of the request...

import org.springframework.web.multipart.MultipartFile;

@RestController
public class FileController {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, I'd suggest to add

  • unit tests for the FileService and controller
  • qulice to check codestyle

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to add qulice check style if the main purpose of this application is only benchmark?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say yes, it's even more important for benchmarks to be properly written and perfectly readable as in the case of mistake the results can be not valid... It's my opinion, however, ask Kirill if you have doubts.

@genryxy
Copy link
Contributor Author

genryxy commented Jan 18, 2022

@olenagerasimova thanks, all corrected

Copy link
Member

@olenagerasimova olenagerasimova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@genryxy thanks, looks good to me

@genryxy
Copy link
Contributor Author

genryxy commented Jan 18, 2022

@g4s8 please check/merge

@genryxy genryxy requested a review from g4s8 January 18, 2022 15:37
@g4s8 g4s8 merged commit 2998927 into artipie:master Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants