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

request service and endpoints #14

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

request service and endpoints #14

wants to merge 21 commits into from

Conversation

agyen
Copy link
Collaborator

@agyen agyen commented Feb 24, 2020

No description provided.

@agyen agyen requested a review from sammoorhouse February 24, 2020 16:10
Copy link
Collaborator

@sammoorhouse sammoorhouse left a 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 = ?",
Copy link
Collaborator

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?

@agyen agyen requested a review from sammoorhouse February 24, 2020 17:39
Copy link
Collaborator

@sammoorhouse sammoorhouse left a 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;
Copy link
Collaborator

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...

Copy link
Collaborator Author

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")
Copy link
Collaborator

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...

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