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 : 소셜링 취소하기 #67

Merged
merged 5 commits into from
Aug 5, 2024
Merged

Conversation

SonMyeongJin
Copy link
Contributor

요약 (Summary)

  • 소셜링 취소하기 구현입니다
  • 요청한 멤버와 소셜링 id를 기반으로 참가중인 소셜링 을 찾고
    해당 소셜링에서 참조하고있는 멤버소셜링 에서 해당 멤버의 state를 delete로 변경합니다
    request -> socialring -> memberSocialring -> member_state -> Delete

🔑 변경 사항 (Key Changes)

📝 리뷰 요구사항 (To Reviewers)

  • 멤버 소셜링의 state값이 delete로 잘 바뀌는지

확인 방법

코드를 실행시키고,mysql workbench에서 다음 쿼리문을 실행시켜주세요.
member 중 첫번째 멤버를 리뷰자 정보로 수정해주세요.

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 socialring(socialring_cost,socialring_date,total_recruits,activity_region_id,created_at,
exercise_id,facility_id,modified_at,comment,comment_simple,socialring_img,socialring_name,gender,level,status) VALUES
(0, '2024-07-31',10,1,'2024-06-30 12:00:00.000000',1,1,'2024-06-30 12:30:00.000000', '소셜링 설명1', '소셜링 한줄설명1','소셜링 이미지1', '소셜링1','F', 'A','ACTIVE');

insert INTO socialring(socialring_cost,socialring_date,total_recruits,activity_region_id,created_at,
exercise_id,facility_id,modified_at,comment,comment_simple,socialring_img,socialring_name,gender,level,status) VALUES
(1000, '2024-07-31',8,1,'2024-06-30 12:00:00.000000',2,1,'2024-06-30 12:30:00.000000', '소셜링 설명2', '소셜링 한줄설명2','소셜링 이미지2', '소셜링2','F', 'S','ACTIVE');

insert INTO member_socialring(created_at,member_id,modified_at,socialring_id,role,status) values
('2024-06-30 12:00:00.000000',1,'2024-06-30 12:30:00.000000',1,'CAPTAIN','ACTIVE'), -- 첫 번째 소셜링, 첫 번째 멤버
('2024-06-30 12:00:00.000000',3,'2024-06-30 12:30:00.000000',1,'CREW','ACTIVE'), -- 첫 번째 소셜링, 세 번째 멤버
('2024-06-30 12:00:00.000000',2,'2024-06-30 12:30:00.000000',2,'CREW','ACTIVE'), -- 두 번째 소셜링, 두 번째 멤버
('2024-06-30 12:00:00.000000',3,'2024-06-30 12:30:00.000000',2,'CREW','ACTIVE'); -- 두 번째 소셜링, 세 번째 멤버

patch방식으로
http://localhost:8080/socialring/cancel?socialringId=1
으로 요청을 보냅니다.

DB에서 memberSocialring 에서 해당 멤버의 state가 delete로 바뀌면 성공입니다.

@SonMyeongJin SonMyeongJin linked an issue Aug 3, 2024 that may be closed by this pull request
@SonMyeongJin SonMyeongJin changed the title 17 be 소셜링 취소하기 Feat : 소셜링 취소하기 Aug 3, 2024
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.

일단 코드가 너무 깔끔합니다!! 그리고 예외처리도 3가지 전부 postman 으로 확인했습니다!!
한가지 말씀드릴건 CAPTAIN 인 사람은 소셜링 취소를 할 수 없어야할 것 같습니다! 왜냐하면 캡틴이 취소를 해버리면.. 그 캡틴 권한을 가져갈 사람이 필요해집니다! 캡틴이 나가버리면 그 소셜링에 대한 수정, 삭제가 하나도 이뤄질 수 없으니까요! 요 부분만 수정해주시면 다른 건 아무 문제 없을 것 같습니다!! 너무 수고하셨어요☺️

@jsilver01
Copy link
Member

앗 그리고 application.yml 이 로컬 호스트라서 배포된 주소로 수정해서 push 한번 했습니다!!

@SonMyeongJin
Copy link
Contributor Author

SonMyeongJin commented Aug 4, 2024

요청하신대로 모임장은 소셜링취소 접근할수없도록 수정하였습니다 !

스크린샷 2024-08-04 오후 9 11 08

baseExecption부분에 8004번 예외 관련 추가한게 지금 희진님이 작업중인 부분이랑 겹쳐서 충돌날것같습니다 !
희진님꺼 소셜링 관련 merge다 끝나시면 마지막에 제가 충돌보고 수정해서 머지하겠습니다!

@SonMyeongJin SonMyeongJin self-assigned this Aug 4, 2024
@SonMyeongJin SonMyeongJin merged commit 69c9d35 into develop Aug 5, 2024
@SonMyeongJin SonMyeongJin deleted the 17-be-소셜링-취소하기 branch August 5, 2024 09:46
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] 소셜링 취소하기
2 participants