-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/#168 로그인api 반환 값 변경 #169
The head ref may contain hidden characters: "Feature/#168-\uB85C\uADF8\uC778API_\uBC18\uD658_\uAC12_\uBCC0\uACBD"
Changes from 3 commits
dab244f
ef94e4a
b3bc65b
6e9943b
c369fc7
52e327d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ public record SignInResponse( | |
String token | ||
) { | ||
|
||
public static SignInResponse of(Member member, String role, Boolean isModerator, String token) { | ||
return new SignInResponse(member.getId(), member.getName(), member.getEmail(), role, isModerator, token); | ||
public static SignInResponse of(Member member, long member_id, String role, Boolean isModerator, String token) { | ||
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. 사소한거긴 한데 객체로 다룰 수 있는 Long 타입을 사용해주시면 좋을 것 같습니다! |
||
return new SignInResponse(member_id, member.getName(), member.getEmail(), role, isModerator, token); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package sw_css.member.domain.repository; | ||
|
||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import sw_css.member.domain.FacultyMember; | ||
|
||
public interface FacultyMemberRepository extends JpaRepository<FacultyMember, Long> { | ||
boolean existsByMemberId(Long memberId); | ||
|
||
Optional<FacultyMember> findByMemberId(Long memberId); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package sw_css.member.domain.repository; | ||
|
||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import sw_css.member.domain.StudentMember; | ||
|
||
public interface StudentMemberRepository extends JpaRepository<StudentMember, Long> { | ||
boolean existsById(Number studentId); | ||
|
||
boolean existsByMemberId(Number memberId); | ||
|
||
Optional<StudentMember> findByMemberId(Number memberId); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,14 +9,13 @@ drop table if exists sw_css.milestone_history; | |
|
||
create table member | ||
( | ||
id bigint auto_increment primary key, | ||
email varchar(255) not null, | ||
name varchar(255) not null, | ||
password varchar(255) not null, | ||
phone_number varchar(255) not null, | ||
is_authorized boolean not null, | ||
is_deleted boolean not null, | ||
created_at datetime(6) not null default current_timestamp(6) | ||
id bigint auto_increment primary key, | ||
email varchar(255) not null, | ||
name varchar(255) not null, | ||
password varchar(255) not null, | ||
phone_number varchar(255) not null, | ||
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. is_authorized 값은 필요하지 않은 값인가요??👀 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. 넹. 혹시 다른 일 관련으로 사용처가 있었을까요? |
||
is_deleted boolean not null, | ||
created_at datetime(6) not null default current_timestamp(6) | ||
); | ||
|
||
create table student_member | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
## member(student) | ||
insert into member (email, name, password, phone_number, is_authorized, is_deleted) | ||
insert into member (email, name, password, phone_number, is_deleted) | ||
values ('[email protected]', '송세연', '$2a$10$YyiOL/E5WjKrZPkB6eQSK.PwZtAO.z3JimFbq/Ky3u3rFf3XTGrWK', '010-0000-0000', | ||
true, false); | ||
|
||
insert into student_member (id, member_id, major_id, minor_id, double_major_id, career, career_detail) | ||
values (202055558, 1, 1, null, null, 'EMPLOYMENT_COMPANY', 'IT 기업 개발자'); | ||
|
||
insert into member (email, name, password, phone_number, is_authorized, is_deleted) | ||
insert into member (email, name, password, phone_number, is_deleted) | ||
values ('[email protected]', '이다은', '$2a$10$YyiOL/E5WjKrZPkB6eQSK.PwZtAO.z3JimFbq/Ky3u3rFf3XTGrWK', '010-0000-0000', | ||
true, false); | ||
|
||
insert into student_member (id, member_id, major_id, minor_id, double_major_id, career, career_detail) | ||
values (202055555, 2, 1, null, null, 'GRADUATE_SCHOOL', 'IT 기업 개발자'); | ||
|
||
insert into member (email, name, password, phone_number, is_authorized, is_deleted) | ||
insert into member (email, name, password, phone_number, is_deleted) | ||
values ('[email protected]', '김하윤', '$2a$10$YyiOL/E5WjKrZPkB6eQSK.PwZtAO.z3JimFbq/Ky3u3rFf3XTGrWK', '010-0000-0000', | ||
true, false); | ||
|
||
|
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.
이 부분에서 if문을 사용하지 않고 할 수 있는 방법이 있을까요?
코드가 약간 더러운 느낌이라서요...
아는 방법있으면 알려주세용!
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.
고민을 해봤는데 지금 구조상 지금 방법이 최선인 것 같습니다!