-
Notifications
You must be signed in to change notification settings - Fork 9
WIP: Soft Delete all Domains - implemented on Person for API #60
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
Open
eeolivas
wants to merge
10
commits into
1701-jan09-java:master
Choose a base branch
from
eeolivas:feat/softDeletes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c6bfcb2
altered sql to include soft del bools
eeolivas 1284ead
sql modified for soft del
eeolivas c8eabac
changed domains
eeolivas 8e23e5a
changed isDeleted to isActive
eeolivas 6251d7f
fixed overflow issue with batch domain
eeolivas 0edcb5c
soft delete person complete
eeolivas 2728ba7
Merge pull request #2 from 1701-jan09-java/master
eeolivas 639ba2f
Merge branch 'master' into feat/softDeletes
eeolivas 21d11ee
admin controller for hard delete person
eeolivas 042a02a
fixed admin person delete
eeolivas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
src/main/java/com/revature/controllers/AdminController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package com.revature.controllers; | ||
|
|
||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.CrossOrigin; | ||
| import org.springframework.web.bind.annotation.PathVariable; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RequestMethod; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| import com.revature.services.PersonLogic; | ||
|
|
||
| @CrossOrigin | ||
| @RestController | ||
| @RequestMapping(value = "/api/v1/admin/") | ||
| public class AdminController { | ||
|
|
||
|
|
||
| @Autowired | ||
| private PersonLogic personLogic; | ||
|
|
||
|
|
||
| @RequestMapping(method = RequestMethod.DELETE, value = "persons/{personId}") | ||
| public ResponseEntity<String> deletePerson(@PathVariable Integer personId){ | ||
| return ResponseEntity.ok(personLogic.deletePersonAdmin(personId)); | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,12 +22,16 @@ public class EvalComment implements Serializable { | |
| @JoinColumn(name="ec_eid") | ||
| private Eval eval; | ||
|
|
||
| @Column(name="ec_is_active") | ||
| private boolean isActive; | ||
|
|
||
| public EvalComment(){} | ||
|
|
||
| public EvalComment(String commentText, Eval eval) { | ||
| public EvalComment(String commentText, Eval eval, boolean isActive) { | ||
| super(); | ||
| this.commentText = commentText; | ||
| this.eval = eval; | ||
| this.isActive=isActive; | ||
| } | ||
|
|
||
| public Integer getId() { | ||
|
|
@@ -54,14 +58,22 @@ public Eval getEval() { | |
| public void setEval(Eval eval) { | ||
| this.eval = eval; | ||
| } | ||
|
|
||
| public boolean isActive() { | ||
| return isActive; | ||
| } | ||
|
|
||
| public void setisActive(boolean isActive) { | ||
| this.isActive = isActive; | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| final int prime = 31; | ||
| int result = 1; | ||
| result = prime * result + ((commentText == null) ? 0 : commentText.hashCode()); | ||
| // result = prime * result + ((eval == null) ? 0 : eval.hashCode()); | ||
| result = prime * result + ((id == null) ? 0 : id.hashCode()); | ||
| result = prime * result + (isActive ? 1231 : 1237); | ||
| return result; | ||
| } | ||
|
|
||
|
|
@@ -79,21 +91,19 @@ public boolean equals(Object obj) { | |
| return false; | ||
| } else if (!commentText.equals(other.commentText)) | ||
| return false; | ||
| if (eval == null) { | ||
| if (other.eval != null) | ||
| return false; | ||
| } else if (!eval.equals(other.eval)) | ||
| return false; | ||
| if (id == null) { | ||
| if (other.id != null) | ||
| return false; | ||
| } else if (!id.equals(other.id)) | ||
| return false; | ||
| if (isActive != other.isActive) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| return false; | ||
| return true; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "EvalComment [id=" + id + ", commentText=" + commentText + "]"; | ||
| return "EvalComment [id=" + id + ", commentText=" + commentText + ", isActive=" + isActive + "]"; | ||
| } | ||
|
|
||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


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.