Skip to content
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

Feat : 참여중인 크루 #75

Merged
merged 10 commits into from
Aug 5, 2024
Merged

Feat : 참여중인 크루 #75

merged 10 commits into from
Aug 5, 2024

Conversation

SonMyeongJin
Copy link
Contributor

요약 (Summary)

  • 요청한 멤버의 참여중인 크루의 정보를 반환합니다

기본 구조 :
멤버 -> 멤버크루 -> 크루 -> 필요한정보 DTO에 담아서 반환

뽑아낸 크루 전체를 리스트로 반환하니까 오류가 나서 필요한 정보만 DTO로 만들어서 리스트로 반환하는 방식을 선택했습니다.

크루이름 , 크루이미지, 크루 한줄설명 이외에 반환하면 좋을만한게 있을까요 ?

🔑 변경 사항 (Key Changes)

  • GetJoinCrewResponse : 크루에서 필요한 정보만 뽑아내서 마지막에 반환하는 DTO입니다.
  • CrewService , CrewController : // 참여중인 크루조회 // 로 구현했습니다

📝 리뷰 요구사항 (To Reviewers)

  • 크루정보가 리스트로 잘 반환되는지

확인 방법

코드 실행후 해당 DB 쿼리문 실행시킵니다. ( 첫번째 멤버는 본인으로 바꿔주세요)

크루 참여중인거 확인하는거

use likelion12;

INSERT INTO exercise (created_at, modified_at,exercise_name, status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', '축구', 'ACTIVE');
INSERT INTO exercise (created_at, modified_at,exercise_name, status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', '배구', 'ACTIVE');

INSERT INTO member (created_at, modified_at, email, member_img, member_name, gender,exercise_id,status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', '[email protected]', '프로필 이미지', '손명진', 'F', 1,'ACTIVE'); 
INSERT INTO member (created_at, modified_at, email, member_img, member_name, gender,exercise_id,status) VALUES
('2024-07-30 12:00:00.000000', '2024-07-30 12:30:00.000000', '[email protected]', '프로필 이미지', '강의진', 'F', 1,'ACTIVE');
INSERT INTO member (created_at, modified_at, email, member_img, member_name, gender,exercise_id,status) VALUES
('2024-07-30 12:00:00.000000', '2024-07-30 12:30:00.000000', 'kanghuijin123@gmail.com', '프로필 이미지', '강', 'F', 2,'ACTIVE');

INSERT INTO activity_region (created_at, modified_at, activity_region_name,status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', '광진구','ACTIVE');
INSERT INTO activity_region (created_at, modified_at, activity_region_name,status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', '서초구','ACTIVE');

INSERT INTO facility (created_at, modified_at, facility_name, facility_city,facility_dong,facility_gu, facility_phone, status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', '광진구 체육관', '서울시','화양동','광진구' ,'000-0000','ACTIVE');

INSERT INTO crew (
    crew_cost, total_recruits, activity_region_id, created_at, crew_id,
    exercise_id, facility_id, modified_at, comment, comment_simple,
    crew_img, crew_name, gender, level, status
) VALUES
(
    100, 20, 1, NOW(), 1,
    1, 1, NOW(), 'This is a detailed comment for Crew A', 'Short comment A',
    'crew_img_a.jpg', 'Crew A', 'M', 'A', 'ACTIVE'
),
(
    150, 25, 2, NOW(), 2,
    2, 1, NOW(), 'This is a detailed comment for Crew B', 'Short comment B',
    'crew_img_b.jpg', 'Crew B', 'F', 'B', 'ACTIVE'
),
(
    200, 30, 1, NOW(), 3,
    1, 1, NOW(), 'This is a detailed comment for Crew C', 'Short comment C',
    'crew_img_c.jpg', 'Crew C', 'U', 'C', 'ACTIVE'
);

INSERT INTO member_crew (
    member_id, crew_id, role, created_at, member_crew_id, modified_at, status
) VALUES
(
    1, 1, 'CAPTAIN', NOW(), 1, NOW(), 'ACTIVE'
),
(
    2, 1, 'CREW', NOW(), 2, NOW(), 'ACTIVE'
),
(
    3, 2, 'CREW', NOW(), 3, NOW(), 'ACTIVE'
),
(
    1, 2, 'CREW', NOW(), 4, NOW(), 'ACTIVE'
),
(
    2, 3, 'CAPTAIN', NOW(), 5, NOW(), 'ACTIVE'
),
(
    3, 3, 'CREW', NOW(), 6, NOW(), 'ACTIVE'
);



auth에 토큰을 넣고 Get방식으로 요청합니다.
http://localhost:8080/crew/join

다음과 같이 리스트로 반환되면 성공입니다.
스크린샷 2024-08-05 오전 1 20 06

@SonMyeongJin SonMyeongJin self-assigned this Aug 4, 2024
private List<MemberCrew> memberCrewList;
private String crewName;
private String crewImg;
private String commentSimple;
Copy link
Member

@hd0rable hd0rable Aug 4, 2024

Choose a reason for hiding this comment

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

image

피그마 보시면
활동지역 이름, 운동이름, 참가자수준도 추가로 필요할것같습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

감사합니다 ! 응답에 추가하였습니다 !

@hd0rable hd0rable changed the title 72 be 참여중인 크루 Feat : 참여중인 크루 Aug 4, 2024
@SonMyeongJin SonMyeongJin linked an issue Aug 5, 2024 that may be closed by this pull request
Copy link
Member

@jsilver01 jsilver01 left a comment

Choose a reason for hiding this comment

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

정상작동 확인하였씁니다! 수고하셨어요!!
Uploading 스크린샷 2024-08-06 오전 1.07.17.png…

@jsilver01 jsilver01 merged commit 00e3397 into develop Aug 5, 2024
@jsilver01 jsilver01 deleted the 72-be-참여중인-크루 branch August 5, 2024 16:07
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.

[BE] 참여중인 크루조회
3 participants