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 : 실시간 기능 API서버에서 분리 #53

Merged
merged 5 commits into from
Sep 23, 2024

Conversation

Mouon
Copy link
Member

@Mouon Mouon commented Sep 20, 2024

요약 (Summary)

  • 기존 STOMP관련 파일을 삭제하였습니다.
  • 기존 데이터, 이슈 등의 실시간 기능을 stomp에서 socketIo로 대체하였습니다.

🔑 변경 사항 (Key Changes)

  • BroadCaster 구현 : 실시간 통신관련 로직을 해당 클래스로 옮김
  • DataController : uploadData에서 BroadCaster 이용하도록 수정
  • WebhookController : handleGithubWebhook 메서드에서 BroadCaster 이용하도록 수정

📝 리뷰 요구사항 (To Reviewers)

  • node에서 이벤트 수신이 되는지

확인 방법

이래 환경변수 등록 (스프링에!)

SOCKET_SERVER_URL: https://localhost:3000/api/broadcast

위 주소는 배포용 주소로 깃허브 시크릿에 등록해야함

아래 쿼리문 수행

use linkode;
INSERT INTO avatar (created_at, modified_at, avatar_img, status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', 'img1.png', 'ACTIVE');
INSERT INTO avatar (created_at, modified_at, avatar_img, status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', 'img2.png', 'ACTIVE');

INSERT INTO color (created_at, modified_at, hex_code, status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', '헥스코드1', 'ACTIVE');
INSERT INTO color (created_at, modified_at, hex_code, status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', '헥스코드2', 'ACTIVE');
INSERT INTO color (created_at, modified_at, hex_code, status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', '헥스코드3', 'ACTIVE');
INSERT INTO color (created_at, modified_at, hex_code, status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', '헥스코드4', 'ACTIVE');
INSERT INTO color (created_at, modified_at, hex_code, status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', '헥스코드5', 'ACTIVE');
INSERT INTO color (created_at, modified_at, hex_code, status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', '헥스코드6', 'ACTIVE');
INSERT INTO color (created_at, modified_at, hex_code, status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', '헥스코드7', 'ACTIVE');


INSERT INTO member (created_at, modified_at, avatar_id, github_id, nickname, color_id,status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', 1, 'jsilver01','두바이쩡', 4, 'ACTIVE');
INSERT INTO member (created_at, modified_at, avatar_id, github_id, nickname, color_id,status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', 2, 'Mouon','두바이', 3, 'ACTIVE');
INSERT INTO member (created_at, modified_at, avatar_id, github_id, nickname, color_id,status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', 1, 'Mouon2','두바이클론', 5, 'ACTIVE');
INSERT INTO member (created_at, modified_at, avatar_id, github_id, nickname, color_id,status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', 1, 'Mouon3','두바이클론2', 2, 'ACTIVE');

INSERT INTO member (created_at, modified_at, avatar_id, github_id, nickname, color_id,status) VALUES
('2024-06-30 12:00:00.000000', '2024-06-30 12:30:00.000000', 2, 'Mouon4','두바이클론3', 1, 'ACTIVE');

INSERT INTO studyroom (created_at, modified_at, studyroom_name, studyroom_profile, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', '맴버 1의 스터디룸', 'Profile for New Studyroom', 'ACTIVE');
INSERT INTO studyroom (created_at, modified_at, studyroom_name, studyroom_profile, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', '맴버 2의 스터디룸', 'Profile for New Studyroom', 'ACTIVE');
INSERT INTO studyroom (created_at, modified_at, studyroom_name, studyroom_profile, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', '맴버 3의 스터디룸', 'Profile for New Studyroom', 'ACTIVE');
INSERT INTO studyroom (created_at, modified_at, studyroom_name, studyroom_profile, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', '맴버 1의 스터디룸', 'Profile for New Studyroom', 'ACTIVE');


INSERT INTO member_studyroom (created_at, modified_at, member_id, studyroom_id, role, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', 1, 1, 'CAPTAIN', 'ACTIVE');

INSERT INTO member_studyroom (created_at, modified_at, member_id, studyroom_id, role, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', 3, 1, 'CREW', 'ACTIVE');
INSERT INTO member_studyroom (created_at, modified_at, member_id, studyroom_id, role, status) VALUES

('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', 2, 2, 'CAPTAIN', 'ACTIVE');
INSERT INTO member_studyroom (created_at, modified_at, member_id, studyroom_id, role, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', 1, 2, 'CREW', 'ACTIVE');
INSERT INTO member_studyroom (created_at, modified_at, member_id, studyroom_id, role, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', 3, 2, 'CREW', 'ACTIVE');
INSERT INTO member_studyroom (created_at, modified_at, member_id, studyroom_id, role, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', 4, 2, 'CREW', 'ACTIVE');
INSERT INTO member_studyroom (created_at, modified_at, member_id, studyroom_id, role, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', 5, 2, 'CREW', 'ACTIVE');

INSERT INTO member_studyroom (created_at, modified_at, member_id, studyroom_id, role, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', 3, 3, 'CAPTAIN', 'ACTIVE');
INSERT INTO member_studyroom (created_at, modified_at, member_id, studyroom_id, role, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', 1, 3, 'CREW', 'ACTIVE');
INSERT INTO member_studyroom (created_at, modified_at, member_id, studyroom_id, role, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', 2, 3, 'CREW', 'ACTIVE');

INSERT INTO member_studyroom (created_at, modified_at, member_id, studyroom_id, role, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', 3, 4, 'CAPTAIN', 'ACTIVE');
INSERT INTO member_studyroom (created_at, modified_at, member_id, studyroom_id, role, status) VALUES
('2024-07-04 12:00:00.000000', '2024-07-04 12:00:00.000000', 2, 4, 'CREW', 'ACTIVE');


INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 1', 'IMG', 'http://example.com/data1', 'ACTIVE', 1, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 2', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 3', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 4', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 5', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 6', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 4', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 5', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 6', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 4', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 5', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 6', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 14', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 5', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 6', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 7', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 8', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 9', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);

INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id) VALUES
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'Data Name 2', 'IMG', 'http://example.com/data2', 'ACTIVE', 2, 2);
INSERT INTO data (created_at, modified_at, data_name, data_type, data_url, status, member_id, studyroom_id, og_title, og_description, og_image, og_url, og_type)
VALUES 
('2024-07-05 12:00:00.000000', '2024-07-05 12:30:00.000000', 'https://moon-kotlin.tistory.com/', 'LINK', 'https://moon-kotlin.tistory.com/', 'ACTIVE', 2, 2, 
 '문코딩', 'Konkuk.Univ\n학교공부,대외활동,생활코딩,유튜브 등을 정리하는 블로그', 'https://img1.daumcdn.net/thumb/R800x0/?scode=mtistory2&fname=https%3A%2F%2Ftistory1.daumcdn.net%2Ftistory%2F6227485%2Fattach%2F0b61e4246979423fa227c9be9840eeb3', null, 'website');

INSERT INTO github_issue (title, body, url, state, status,studyroom_id)
VALUES 
('Issue 1', 'This is the first issue body.', 'https://github.com/linkode/repo/issues/1', 'open', 'ACTIVE', 1),
('Issue 2', 'This is the second issue body.', 'https://github.com/linkode/repo/issues/2', 'closed', 'ACTIVE', 2),
('Issue 3', 'This is the third issue body.', 'https://github.com/linkode/repo/issues/3', 'open', 'ACTIVE', 2),
('Issue 4', 'This is the fourth issue body.', 'https://github.com/linkode/repo/issues/4', 'open', 'ACTIVE', 2);

node 서버 키고 아래주소 연결

https://localhost:3000?studyroomId=2&memberId=1&appInfo=test1

아래 이벤트 리스닝

fileUploaded

아래 주소로 [POST]요청

http://localhost:8080/studyroom/data/upload

아래 같은 응답 오는지 확인.

스크린샷 2024-09-20 오후 3 51 23

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.

옆에서 코드 잘 동작하는 것 직접 확인하였습니다!! 신기하네용 수고하셨슴다~

@jsilver01 jsilver01 merged commit 044987f into develop Sep 23, 2024
@jsilver01 jsilver01 deleted the LINKODE-47-실시간이벤트연결 branch September 23, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Make Feat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants