-
Notifications
You must be signed in to change notification settings - Fork 7
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
request service and endpoints #14
base: master
Are you sure you want to change the base?
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.
great!
@GetMapping("/api/v1/request/requester/{id}") | ||
public List<RequestTO> getRequestByRequesterId(@PathVariable("id") Integer id) { | ||
return this.jdbcTemplate.query( | ||
"select * from requests where requester_id = ?", |
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.
don't do select *. What happens if someone comes along later and inserts or removes a column?
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.
it's great - basically just remember that reviewers and maintainers will have been working on other projects - so the word "request" means lots of different things in different contexts - so maybe use "holiday request" to clear it up?
public class RequestController { | ||
|
||
@Autowired | ||
JdbcTemplate jdbcTemplate; |
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.
are you using a DAO for this? The controller uses the DAO, the DAO uses the JdbcTemplate.
This is fine if you're not using a DAO...
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.
we're not using DAO
JdbcTemplate jdbcTemplate; | ||
|
||
@CrossOrigin | ||
@ApiOperation("Make a request") |
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.
a what request? all of these services are requests...
No description provided.