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 : 소셜링 검색 구현 #76

Merged
merged 5 commits into from
Aug 5, 2024
Merged

Conversation

jsilver01
Copy link
Member

요약 (Summary)

  • 소셜링 검색을 하기 위한 api 작업입니다.
  • 쿼리파람으로 키워드, 날짜(LocalDate), 활동지역들을 null 포함해서 입력받습니다. 필요한 정보들만 쿼리파람으로 전달해주시면 됩니다.

🔑 변경 사항 (Key Changes)

  • GetSocialringSearchResponse dto 작성 : 카드 하나씩 보여줄 수 있는 소셜링 정보를 담는 리스폰스 dto 입니다. 결국엔 리스트로 반환합니다.
  • 컨트롤러와 서비스에 각각 searchSocialrings 메소드 작성하여 구현하였습니다.

📝 리뷰 요구사항 (To Reviewers)

  • postman 이 잘 반환되는지
  • 쿼리파람을 누락해서 보내더라도 잘 반환되는지

확인 방법

❗️application.yml 에서 리다이렉트 주소를 localhost 로 바꾼 후에 소셜로그인 진행해주세요

use likelion12;

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

-- member 데이터 삽입
INSERT INTO member (created_at, modified_at, email, member_img, member_name, gender, exercise_id, status) VALUES
('2024-06-30 12:00:00', '2024-06-30 12:30:00', '[email protected]', '프로필 이미지', '김정은', 'M', 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', '2024-07-30 12:30:00', '[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', '2024-07-30 12:30:00', '[email protected]', '프로필 이미지', '', 'F', 2, 'ACTIVE');

-- activity_region 데이터 삽입
INSERT INTO activity_region (created_at, modified_at, activity_region_name, status) VALUES
('2024-06-30 12:00:00', '2024-06-30 12:30:00', '광진구', 'ACTIVE');
INSERT INTO activity_region (created_at, modified_at, activity_region_name, status) VALUES
('2024-06-30 12:00:00', '2024-06-30 12:30:00', '서초구', 'ACTIVE');
INSERT INTO activity_region (created_at, modified_at, activity_region_name, status) VALUES
('2024-06-30 12:00:00', '2024-06-30 12:30:00', '마포구', 'ACTIVE');


-- facility 데이터 삽입
INSERT INTO facility (created_at, modified_at, facility_name, facility_city, facility_gu, facility_phone, status) VALUES
('2024-06-30 12:00:00', '2024-06-30 12:30:00', '광진구 체육관', '서울시', '광진구', '000-0000', 'ACTIVE');

-- socialring 데이터 삽입
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-08-11', 10, 1, '2024-06-30 12:00:00', 1, 1, '2024-06-30 12:30:00', '건대컴공', '소셜링 한줄설명1', '소셜링 이미지1', '멋사 AI', '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-09-12', 8, 1, '2024-06-30 12:00:00', 2, 1, '2024-06-30 12:30:00', '멋사 백엔드', '소셜링 한줄설명2', '소셜링 이미지2', '멋사 풀스텍', 'F', 'S', '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', 5, 1, '2024-06-30 12:00:00', 2, 1, '2024-06-30 12:30:00', '멋사', '소셜링 한줄설명3', '소셜링 이미지3', '멋사 프론트', 'F', 'S', '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', 5, 1, '2024-06-30 12:00:00', 2, 1, '2024-06-30 12:30:00', '멋사', '소셜링 한줄설명3', '소셜링 이미지3', '멋사 백엔드', 'F', 'S', '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', 5, 1, '2024-06-30 12:00:00', 2, 1, '2024-06-30 12:30:00', '멋사', '소셜링 한줄설명3', '소셜링 이미지3', '멋사', 'F', 'S', '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-21', 10, 1, '2024-06-30 12:00:00', 1, 1, '2024-06-30 12:30:00', '건대컴공', '소셜링 한줄설명1', '소셜링 이미지1', '멋사 AI 튜터 양성', '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-25', 8, 1, '2024-06-30 12:00:00', 2, 1, '2024-06-30 12:30:00', '멋사 백엔드', '소셜링 한줄설명2', '소셜링 이미지2', '멋사 풀스텍', 'F', 'S', '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-28', 5, 1, '2024-06-30 12:00:00', 2, 1, '2024-06-30 12:30:00', '멋사', '소셜링 한줄설명3', '소셜링 이미지3', '멋사 프론트', 'F', 'S', '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-30', 5, 1, '2024-06-30 12:00:00', 2, 1, '2024-06-30 12:30:00', '멋사', '소셜링 한줄설명3', '소셜링 이미지3', '백엔드 멋사', 'F', 'S', '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', 5, 1, '2024-06-30 12:00:00', 2, 1, '2024-06-30 12:30:00', '멋사', '소셜링 한줄설명3', '소셜링 이미지3', '멋사 해커톤', 'F', 'S', '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', 1, 1, '2024-06-30 12:30:00', '건대컴공', '소셜링 한줄설명1', '소셜링 이미지1', '현대 AI', '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-06-30', 8, 1, '2024-06-30 12:00:00', 2, 1, '2024-06-30 12:30:00', '멋사 백엔드', '소셜링 한줄설명2', '소셜링 이미지2', '우아한 테크코스 풀스텍', 'F', 'S', '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-10-31', 5, 1, '2024-06-30 12:00:00', 2, 1, '2024-06-30 12:30:00', '멋사', '소셜링 한줄설명3', '소셜링 이미지3', '프론트 멋사 정복', 'F', 'S', '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-10-01', 5, 1, '2024-06-30 12:00:00', 2, 1, '2024-06-27 12:30:00', '멋사', '소셜링 한줄설명3', '소셜링 이미지3', '2025 백엔드 멋사 알아보자', 'F', 'S', '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-11-11', 5, 2, '2024-06-30 12:00:00', 2, 1, '2024-06-29 12:30:00', '멋사', '소셜링 한줄설명3', '소셜링 이미지3', '해커톤 전야제 멋사 12기', 'F', 'S', '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-12-24', 5, 2, '2024-06-30 12:00:00', 2, 1, '2024-06-30 12:30:00', '멋사', '소셜링 한줄설명3', '소셜링 이미지3', '멋사 12기 썸머 해커톤', 'F', 'S', '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-12-25', 5, 3, '2024-06-30 12:00:00', 2, 1, '2024-06-30 12:30:00', '멋사', '추운겨울에도 봄은온다! 스프링 부트!', '소셜링 이미지3', '김영한과 함께하는 크리스마스의 봄', 'F', 'S', '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-12-31', 5, 3, '2024-06-30 12:00:00', 2, 1, '2024-06-30 12:30:00', '멋사', '연말대응 같이 해봐요!', '소셜링 이미지3', '강남언니 백엔드 개발자는 어떻게 개발할까?', 'F', 'S', 'ACTIVE');

-- member_socialring 데이터 삽입
INSERT INTO member_socialring (created_at, member_id, modified_at, socialring_id, role, status) VALUES
('2024-06-30 12:00:00', 1, '2024-06-30 12:30:00', 1, 'CAPTAIN', 'ACTIVE'), -- 첫 번째 소셜링, 첫 번째 멤버
('2024-06-30 12:00:00', 3, '2024-06-30 12:30:00', 1, 'CREW', 'ACTIVE'), -- 첫 번째 소셜링, 세 번째 멤버
('2024-06-30 12:00:00', 2, '2024-06-30 12:30:00', 2, 'CAPTAIN', 'ACTIVE'), -- 두 번째 소셜링, 두 번째 멤버
('2024-06-30 12:00:00', 3, '2024-06-30 12:30:00', 2, 'CREW', 'ACTIVE'), -- 두 번째 소셜링, 세 번째 멤버
('2024-06-30 12:00:00', 1, '2024-06-30 12:30:00', 3, 'CAPTAIN', 'ACTIVE'); -- 세 번째 소셜링, 첫 번째 멤버

INSERT INTO Crew (crew_name, crew_img, total_recruits, crew_cost, comment_simple, comment, gender, level, activity_region_id, facility_id, exercise_id, status, created_at)
VALUES
    ('Marathon Enthusiasts', 'marathon.jpg', 50, 100, 'Run together', 'Join us for weekly marathon training sessions.', 'M', 'S', 1, 1, 1, 'ACTIVE', NOW()),
    ('Yoga Masters', 'yoga.jpg', 30, 50, 'Peace and flexibility', 'Achieve peace and flexibility with our yoga sessions.', 'F', 'S', 1, 1, 1, 'ACTIVE', NOW()),
    ('Cycling Pros', 'cycling.jpg', 40, 75, 'Pedal power', 'Experience the joy of cycling with fellow enthusiasts.', 'M', 'S', 1, 1, 1, 'ACTIVE', NOW()),
    ('Swim Squad', 'swimming.jpg', 25, 60, 'Dive in', 'Improve your swimming skills with expert coaching.', 'M', 'S', 1, 1, 1, 'ACTIVE', NOW()),
    ('Hiking Heroes', 'hiking.jpg', 20, 0, 'Nature trails', 'Explore the best hiking trails every weekend.', 'F', 'S', 1, 1, 1, 'ACTIVE', NOW());

위의 쿼리문을 실행시켜주세요!
그 다음 포스트맨에서 헤더에 토큰을 포함하여 아래의 주소로 GET 요청 보내주세요

http://localhost:8080/socialring/search?keyWord=멋사&socialringDate=2024-06-10&activityRegionName=광진구
스크린샷 2024-08-05 오후 5 36 32 다음과 같이 뜨면 성공입니다~~

@jsilver01 jsilver01 linked an issue Aug 5, 2024 that may be closed by this pull request
@SonMyeongJin SonMyeongJin merged commit 7a12ce4 into develop Aug 5, 2024
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