-
Notifications
You must be signed in to change notification settings - Fork 0
enroll user #11
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
yeojinhwang
wants to merge
1
commit into
review/java
Choose a base branch
from
ISSUES-1
base: review/java
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
enroll user #11
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions
4
src/main/java/com/example/javaweb/controller/ContentController.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,4 @@ | ||
| package com.example.javaweb.controller; | ||
|
|
||
| public class ContentController { | ||
| } |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/example/javaweb/controller/DeleteController.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,4 @@ | ||
| package com.example.javaweb.controller; | ||
|
|
||
| public class DeleteController { | ||
| } |
15 changes: 0 additions & 15 deletions
15
src/main/java/com/example/javaweb/controller/HealthController.java
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
src/main/java/com/example/javaweb/controller/PostController.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,15 @@ | ||
| package com.example.javaweb.controller; | ||
|
|
||
|
|
||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PostMapping; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @RestController | ||
| public class PostController { | ||
|
|
||
| @PostMapping("/") | ||
| public String WritePost(char title, char writer, String content){ | ||
| return "Hello, world"; | ||
| } | ||
| } | ||
14 changes: 14 additions & 0 deletions
14
src/main/java/com/example/javaweb/controller/UserController.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,14 @@ | ||
| package com.example.javaweb.controller; | ||
|
|
||
| import model.User; | ||
| import org.springframework.web.bind.annotation.PostMapping; | ||
| import org.springframework.web.bind.annotation.RequestParam; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @RestController | ||
| public class UserController { | ||
| @PostMapping("/join") | ||
| public User createUser(@RequestParam String name, @RequestParam String email, @RequestParam String gender) { | ||
| return new User(name, email, gender); | ||
| } | ||
| } |
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,71 @@ | ||
| package model; | ||
|
|
||
| import java.util.Date; | ||
|
|
||
| public class Post { | ||
|
Member
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. Getter Setter 직접 구현하신거 좋은 것 같습니다ㅎㅎ |
||
| private Long postId; | ||
|
|
||
| private String title; | ||
| private String content; | ||
| private Date created_at; | ||
|
Member
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. 자바의 경우 snake_case는 잘 쓰지않고 camelCase를 이용합니다 |
||
| private Date updated_at; | ||
|
|
||
| private Long userId; | ||
|
|
||
| public Post(Long postId, String title, String content, Date created_at, Date updated_at, Long userId) { | ||
| this.postId = postId; | ||
| this.title = title; | ||
| this.content = content; | ||
| this.created_at = created_at; | ||
| this.updated_at = updated_at; | ||
| this.userId = userId; | ||
| } | ||
|
|
||
| public Long getPostId() { | ||
| return postId; | ||
| } | ||
|
|
||
| public void setPostId(Long postId) { | ||
| this.postId = postId; | ||
| } | ||
|
|
||
| public String getTitle() { | ||
| return title; | ||
| } | ||
|
|
||
| public void setTitle(String title) { | ||
| this.title = title; | ||
| } | ||
|
|
||
| public String getContent() { | ||
| return content; | ||
| } | ||
|
|
||
| public void setContent(String content) { | ||
| this.content = content; | ||
| } | ||
|
|
||
| public Date getCreated_at() { | ||
| return created_at; | ||
| } | ||
|
|
||
| public void setCreated_at(Date created_at) { | ||
| this.created_at = created_at; | ||
| } | ||
|
|
||
| public Date getUpdated_at() { | ||
| return updated_at; | ||
| } | ||
|
|
||
| public void setUpdated_at(Date updated_at) { | ||
| this.updated_at = updated_at; | ||
| } | ||
|
|
||
| public Long getUserId() { | ||
| return userId; | ||
| } | ||
|
|
||
| public void setUserId(Long userId) { | ||
| this.userId = userId; | ||
| } | ||
| } | ||
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,39 @@ | ||
| package model; | ||
|
|
||
| import java.util.ArrayList; | ||
|
|
||
| public class User { | ||
| private String name; | ||
| private String email; | ||
| private String gender; | ||
|
|
||
| public User(String name, String email, String gender) { | ||
| this.name = name; | ||
| this.email = email; | ||
| this.gender = gender; | ||
| } | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| public void setName(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| public String getEmail() { | ||
| return email; | ||
| } | ||
|
|
||
| public void setEmail(String email) { | ||
| this.email = email; | ||
| } | ||
|
|
||
| public String getGender() { | ||
| return gender; | ||
| } | ||
|
|
||
| public void setGender(String gender) { | ||
| this.gender = gender; | ||
| } | ||
| } |
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.
참고로 java의 char형은 한글자만 입력가능합니다. String을 사용하는 것이 좋아보입니다.