-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@olenagerasimova thanks, all corrected |
There was a problem hiding this 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
@g4s8 please check/merge |
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.