Skip to content

create -interfaces-and-controller-signatures.#55

Open
VaniThapar wants to merge 1 commit intomainfrom
create-service-interface-and-controller-signatures
Open

create -interfaces-and-controller-signatures.#55
VaniThapar wants to merge 1 commit intomainfrom
create-service-interface-and-controller-signatures

Conversation

@VaniThapar
Copy link
Owner

Created interfaces and controller signatures for BorrowRequest, Transaction and User

import java.util.List;

public class TransactionController extends BaseController{

Copy link
Collaborator

@SURABHI2003 SURABHI2003 Mar 15, 2024

Choose a reason for hiding this comment

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

Remove semi-colons

return null;
}

ResponseEntity<Void> updateEMIDefaults() throws ServiceException {
Copy link
Collaborator

@SURABHI2003 SURABHI2003 Mar 15, 2024

Choose a reason for hiding this comment

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

Make return type ResponseEntity<Boolean>

return null;
}

ResponseEntity<Void> updateBorrowRequestStatus(@RequestBody Status status) throws ServiceException {
Copy link
Collaborator

@SURABHI2003 SURABHI2003 Mar 15, 2024

Choose a reason for hiding this comment

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

Make return type ResponseEntity<Boolean>

return null;
}

ResponseEntity<Void> createBorrowRequest(@RequestBody BorrowRequest borrowRequest) throws ServiceException {
Copy link
Collaborator

@SURABHI2003 SURABHI2003 Mar 15, 2024

Choose a reason for hiding this comment

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

Make return type ResponseEntity<Boolean>




ResponseEntity<List<User>> getAllUsers() throws ServiceException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Throw controller exception




ResponseEntity<List<User>> getAllUsers() throws ServiceException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add comments for administration purposes

return null;
}

ResponseEntity<User> getUserById(String userId) throws ServiceException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rename to getUserForUserId

import java.util.List;

public class BorrowRequestController extends BaseController{
} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use proper annotations for Parameters and Request Body

return null;
};

ResponseEntity<List<Transaction>> getTransactionsBetween(@PathVariable String senderId, @PathVariable String receiverId) throws ControllerException
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rename this to a better name

return null;
};

ResponseEntity<List<Transaction>> getTransactionsByDate(@PathVariable LocalDate date) throws ControllerException
Copy link
Collaborator

Choose a reason for hiding this comment

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

getTransactionsBetweenDate(start,end)

return null;
}

ResponseEntity<Void> deleteUser(String userId) throws ServiceException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make return type ResponseEntity<Boolean>

@RequestMapping("/user")
public class UserController extends BaseController{
public class UserController {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Add Param and RequestBody Annotations

return null;
}

ResponseEntity<Void> updateEMIDefaults() throws ServiceException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove updateEMIdefaults and updateBorrowRequestStatus

@RequestMapping("/borrow-request")
import java.util.List;

public class BorrowRequestController extends BaseController{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make the methods throw ControllerException, not ServiceException

@RequestMapping("/user")
public class UserController extends BaseController{
public class UserController {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Make the methods throw ControllerException, not ServiceException

@RequestMapping("/user")
public class UserController extends BaseController{
public class UserController {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Make this class extend BaseController

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