This commit is contained in:
crusader 2019-07-17 21:07:59 +09:00
parent 06200f712b
commit e10599a50c
15 changed files with 312 additions and 332 deletions

1
.gitignore vendored
View File

@ -195,4 +195,3 @@ local.properties
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

11
.vscode/settings.json vendored
View File

@ -1,3 +1,14 @@
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.autoClosingBrackets": "languageDefined",
"editor.trimAutoWhitespace": true,
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
"git.ignoreLimitWarning": true,
"prettier.singleQuote": true,
"debug.node.autoAttach": "on",
"java.configuration.updateBuildConfiguration": "automatic"
}

View File

@ -4,11 +4,11 @@ import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.NOT_FOUND)
public class ResourceNotFoundException extends Exception{
public class ResourceNotFoundException extends Exception {
private static final long serialVersionUID = 1L;
public ResourceNotFoundException(String message){
public ResourceNotFoundException(String message) {
super(message);
}
}

View File

@ -15,7 +15,6 @@ import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/v1")
public class MemberController {
@ -53,8 +52,7 @@ public class MemberController {
}
@DeleteMapping("/members/{id}")
public Map<String, Boolean> deleteMember(@PathVariable(value = "id") Long memberId)
throws ResourceNotFoundException {
public Map<String, Boolean> deleteMember(@PathVariable(value = "id") Long memberId) throws ResourceNotFoundException {
Member member = memberRepository.findById(memberId)
.orElseThrow(() -> new ResourceNotFoundException("Member not found for this id :: " + memberId));

View File

@ -32,7 +32,9 @@ public class Member {
private String extraVars;
private long listOrder;
public Member() {}
public Member() {
}
@Id
@Column(name = "member_srl", nullable = false)
public long getMemberSrl() {
@ -275,38 +277,30 @@ public class Member {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Member xeMember = (Member) o;
return memberSrl == xeMember.memberSrl &&
listOrder == xeMember.listOrder &&
Objects.equals(userId, xeMember.userId) &&
Objects.equals(emailAddress, xeMember.emailAddress) &&
Objects.equals(password, xeMember.password) &&
Objects.equals(emailId, xeMember.emailId) &&
Objects.equals(emailHost, xeMember.emailHost) &&
Objects.equals(userName, xeMember.userName) &&
Objects.equals(nickName, xeMember.nickName) &&
Objects.equals(findAccountQuestion, xeMember.findAccountQuestion) &&
Objects.equals(findAccountAnswer, xeMember.findAccountAnswer) &&
Objects.equals(homepage, xeMember.homepage) &&
Objects.equals(blog, xeMember.blog) &&
Objects.equals(birthday, xeMember.birthday) &&
Objects.equals(allowMailing, xeMember.allowMailing) &&
Objects.equals(allowMessage, xeMember.allowMessage) &&
Objects.equals(denied, xeMember.denied) &&
Objects.equals(limitDate, xeMember.limitDate) &&
Objects.equals(regdate, xeMember.regdate) &&
Objects.equals(lastLogin, xeMember.lastLogin) &&
Objects.equals(changePasswordDate, xeMember.changePasswordDate) &&
Objects.equals(isAdmin, xeMember.isAdmin) &&
Objects.equals(description, xeMember.description) &&
Objects.equals(extraVars, xeMember.extraVars);
return memberSrl == xeMember.memberSrl && listOrder == xeMember.listOrder && Objects.equals(userId, xeMember.userId)
&& Objects.equals(emailAddress, xeMember.emailAddress) && Objects.equals(password, xeMember.password)
&& Objects.equals(emailId, xeMember.emailId) && Objects.equals(emailHost, xeMember.emailHost)
&& Objects.equals(userName, xeMember.userName) && Objects.equals(nickName, xeMember.nickName)
&& Objects.equals(findAccountQuestion, xeMember.findAccountQuestion)
&& Objects.equals(findAccountAnswer, xeMember.findAccountAnswer) && Objects.equals(homepage, xeMember.homepage)
&& Objects.equals(blog, xeMember.blog) && Objects.equals(birthday, xeMember.birthday)
&& Objects.equals(allowMailing, xeMember.allowMailing) && Objects.equals(allowMessage, xeMember.allowMessage)
&& Objects.equals(denied, xeMember.denied) && Objects.equals(limitDate, xeMember.limitDate)
&& Objects.equals(regdate, xeMember.regdate) && Objects.equals(lastLogin, xeMember.lastLogin)
&& Objects.equals(changePasswordDate, xeMember.changePasswordDate) && Objects.equals(isAdmin, xeMember.isAdmin)
&& Objects.equals(description, xeMember.description) && Objects.equals(extraVars, xeMember.extraVars);
}
@Override
public int hashCode() {
return Objects.hash(memberSrl, userId, emailAddress, password, emailId, emailHost, userName, nickName, findAccountQuestion, findAccountAnswer, homepage, blog, birthday, allowMailing, allowMessage, denied, limitDate, regdate, lastLogin, changePasswordDate, isAdmin, description, extraVars, listOrder);
return Objects.hash(memberSrl, userId, emailAddress, password, emailId, emailHost, userName, nickName,
findAccountQuestion, findAccountAnswer, homepage, blog, birthday, allowMailing, allowMessage, denied, limitDate,
regdate, lastLogin, changePasswordDate, isAdmin, description, extraVars, listOrder);
}
}

View File

@ -1,18 +0,0 @@
spring.datasource.url=jdbc:postgresql://localhost:54320/postgres
spring.datasource.username=postgres
spring.datasource.password=root
spring.jpa.show-sql=true
## Hibernate Properties
# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto=update
spring.jpa.database=postgresql
logging.level.root=info
logging.pattern.console=%d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger.%M - %msg%n
server.port=8282

View File

@ -1,4 +0,0 @@
/home/crusader/Projects/git.loafle.net/outsourcing/totopia/totopia-rest/src/main/java/com/loafle/totopia/member/controller/MemberController.java
/home/crusader/Projects/git.loafle.net/outsourcing/totopia/totopia-rest/src/main/java/com/loafle/totopia/member/dao/MemberRepository.java
/home/crusader/Projects/git.loafle.net/outsourcing/totopia/totopia-rest/src/main/java/com/loafle/totopia/Application.java
/home/crusader/Projects/git.loafle.net/outsourcing/totopia/totopia-rest/src/main/java/com/loafle/totopia/member/model/Member.java