init
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,20 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const authController = require('../controllers/authController');
|
||||
|
||||
// 인증 미들웨어
|
||||
const authMiddleware = require('../middleware/auth');
|
||||
|
||||
// 로그인
|
||||
router.post('/login', authController.login);
|
||||
|
||||
// 현재 사용자 정보 가져오기
|
||||
router.get('/me', authMiddleware, authController.getCurrentUser);
|
||||
|
||||
// 회원가입
|
||||
router.post('/register', authController.register);
|
||||
|
||||
// 프로필 업데이트
|
||||
router.put('/profile', authMiddleware, authController.updateProfile);
|
||||
|
||||
module.exports = router;
|
||||
@@ -0,0 +1,61 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const jwt = require('jsonwebtoken');
|
||||
const clubController = require('../controllers/clubController');
|
||||
const { authenticateJWT } = require('../middleware/authMiddleware');
|
||||
|
||||
// 모든 클럽 조회
|
||||
router.get('/', clubController.getAllClubs);
|
||||
|
||||
// 특정 클럽 조회
|
||||
router.post('/', authenticateJWT, clubController.getClubById);
|
||||
|
||||
// 클럽 정보 업데이트
|
||||
router.put('/', authenticateJWT, clubController.updateClub);
|
||||
|
||||
// 클럽 삭제
|
||||
router.delete('/', authenticateJWT, clubController.deleteClub);
|
||||
|
||||
// 사용자 클럽 목록 조회
|
||||
router.post('/user', authenticateJWT, clubController.getUserClubs);
|
||||
|
||||
// 클럽 회원 통계 조회
|
||||
router.post('/members/stats', authenticateJWT, clubController.getMemberStats);
|
||||
|
||||
// 클럽 회원 목록 조회
|
||||
router.post('/members', authenticateJWT, clubController.getClubMembers);
|
||||
|
||||
// 클럽 회원 추가
|
||||
router.post('/members/add', authenticateJWT, clubController.addClubMember);
|
||||
|
||||
// 클럽 회원 수정
|
||||
router.post('/members/update', authenticateJWT, clubController.updateClubMember);
|
||||
|
||||
// 클럽 회원 삭제
|
||||
router.post('/members/delete', authenticateJWT, clubController.deleteClubMember);
|
||||
|
||||
// 다음 모임 정보 조회
|
||||
router.post('/meetings/next', authenticateJWT, clubController.getNextMeeting);
|
||||
|
||||
// 최근 모임 정보 조회
|
||||
router.post('/meetings/last', authenticateJWT, clubController.getLastMeeting);
|
||||
|
||||
// 최근 정기 모임 목록 조회
|
||||
router.post('/meetings/recent', authenticateJWT, clubController.getRecentMeetings);
|
||||
|
||||
// 점수 통계 조회
|
||||
router.post('/scores/stats', authenticateJWT, clubController.getScoreStats);
|
||||
|
||||
// 상위 회원 목록 조회
|
||||
router.post('/members/top', authenticateJWT, clubController.getTopMembers);
|
||||
|
||||
// 새 클럽 생성
|
||||
router.post('/create', authenticateJWT, clubController.createClub);
|
||||
|
||||
// 클럽 통계 조회
|
||||
router.post('/statistics', authenticateJWT, clubController.getStatistics);
|
||||
|
||||
// 클럽 기능 관리
|
||||
router.put('/features', authenticateJWT, clubController.manageClubFeatures);
|
||||
|
||||
module.exports = router;
|
||||
@@ -0,0 +1,29 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const eventController = require('../controllers/eventController');
|
||||
const { authenticateJWT } = require('../middleware/authMiddleware');
|
||||
|
||||
// 이벤트 기본 CRUD
|
||||
router.post('/', authenticateJWT, eventController.getAllEvents);
|
||||
router.get('/:id', authenticateJWT, eventController.getEventById);
|
||||
router.post('/create', authenticateJWT, eventController.createEvent);
|
||||
router.put('/:id', authenticateJWT, eventController.updateEvent);
|
||||
router.delete('/:id', authenticateJWT, eventController.deleteEvent);
|
||||
|
||||
// 이벤트 참가자 관리
|
||||
router.post('/:id/participants/list', authenticateJWT, eventController.getEventParticipants);
|
||||
router.post('/:id/participants', authenticateJWT, eventController.addEventParticipant);
|
||||
router.put('/:id/participants', authenticateJWT, eventController.updateEventParticipant);
|
||||
router.delete('/:id/participants', authenticateJWT, eventController.deleteEventParticipant);
|
||||
|
||||
// 이벤트 점수 관리
|
||||
router.get('/:id/scores', authenticateJWT, eventController.getEventScores);
|
||||
router.post('/:id/scores', authenticateJWT, eventController.addEventScore);
|
||||
router.put('/:id/scores/:scoreId', authenticateJWT, eventController.updateEventScore);
|
||||
router.delete('/:id/scores/:scoreId', authenticateJWT, eventController.deleteEventScore);
|
||||
router.delete('/:id/participants/:participantId/scores', authenticateJWT, eventController.deleteParticipantScores);
|
||||
|
||||
// 사용자별 이벤트 관리
|
||||
router.get('/user/events', authenticateJWT, eventController.getUserEvents);
|
||||
|
||||
module.exports = router;
|
||||
@@ -0,0 +1,15 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const featureController = require('../controllers/featureController');
|
||||
const { authenticateJWT } = require('../middleware/authMiddleware');
|
||||
|
||||
// 기본 기능 관리
|
||||
router.get('/', authenticateJWT, featureController.getFeatures);
|
||||
|
||||
// 기능 구매 관련 API
|
||||
router.get('/available', authenticateJWT, featureController.getAvailableFeatures);
|
||||
router.get('/active', authenticateJWT, featureController.getActiveFeatures);
|
||||
router.get('/payments', authenticateJWT, featureController.getFeaturePayments);
|
||||
router.post('/purchase', authenticateJWT, featureController.purchaseFeature);
|
||||
|
||||
module.exports = router;
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* 메뉴 라우트
|
||||
* 사용자 역할과 클럽의 구독/기능 상태에 따른 메뉴 아이템을 제공하는 API
|
||||
*/
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const { authenticateJWT } = require('../middleware/authMiddleware');
|
||||
const menuController = require('../controllers/menuController');
|
||||
|
||||
// 사용자의 접근 가능한 메뉴 목록 조회
|
||||
router.post('/', authenticateJWT, menuController.getUserMenus);
|
||||
|
||||
module.exports = router;
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* 알림 라우트
|
||||
* 사용자 알림 관련 API
|
||||
*/
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const notificationController = require('../controllers/notificationController');
|
||||
const { check } = require('express-validator');
|
||||
const { authenticateJWT } = require('../middleware/authMiddleware');
|
||||
|
||||
// 사용자 알림 목록 가져오기
|
||||
router.get('/', authenticateJWT, notificationController.getUserNotifications);
|
||||
|
||||
// 알림 읽음 표시
|
||||
router.put('/:notificationId/read', authenticateJWT, notificationController.markAsRead);
|
||||
|
||||
// 모든 알림 읽음 표시
|
||||
router.put('/read-all', authenticateJWT, notificationController.markAllAsRead);
|
||||
|
||||
// 알림 삭제
|
||||
router.delete('/:notificationId', authenticateJWT, notificationController.deleteNotification);
|
||||
|
||||
// 알림 생성 (관리자 전용)
|
||||
router.post('/',
|
||||
authenticateJWT,
|
||||
[
|
||||
check('userId', '사용자 ID가 필요합니다.').not().isEmpty(),
|
||||
check('title', '알림 제목이 필요합니다.').not().isEmpty(),
|
||||
check('message', '알림 내용이 필요합니다.').not().isEmpty()
|
||||
],
|
||||
notificationController.createNotification
|
||||
);
|
||||
|
||||
module.exports = router;
|
||||
@@ -0,0 +1,19 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const subscriptionController = require('../controllers/subscriptionController');
|
||||
const authMiddleware = require('../middleware/auth');
|
||||
// 구독 목록 조회
|
||||
router.get('/', authMiddleware, subscriptionController.getClubSubscriptions);
|
||||
|
||||
// 구독 플랜 관리 (관리자 전용)
|
||||
router.get('/plans', authMiddleware, subscriptionController.getSubscriptionPlans);
|
||||
router.post('/plans', authMiddleware, subscriptionController.createSubscriptionPlan);
|
||||
router.put('/plans/:id', authMiddleware, subscriptionController.updateSubscriptionPlan);
|
||||
router.delete('/plans/:id', authMiddleware, subscriptionController.deleteSubscriptionPlan);
|
||||
router.get('/plans/:planId/subscriptions', authMiddleware, subscriptionController.getPlanSubscriptions);
|
||||
|
||||
// 클럽 구독 관리
|
||||
router.post('/subscribe', authMiddleware, subscriptionController.subscribeClub);
|
||||
router.get('/clubs/:clubId', authMiddleware, subscriptionController.getClubSubscription);
|
||||
|
||||
module.exports = router;
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* 사용자 라우트
|
||||
* 사용자 관련 API 엔드포인트 정의
|
||||
*/
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const { getCurrentUser } = require('../controllers/authController');
|
||||
const { getAllUsers, getUser, updateUser } = require('../controllers/userController');
|
||||
const { authenticateJWT } = require('../middleware/authMiddleware');
|
||||
|
||||
// 전체 사용자 목록 조회
|
||||
router.get('/all', authenticateJWT, getAllUsers);
|
||||
|
||||
// 사용자 프로필 조회
|
||||
router.get('/profile', authenticateJWT, getCurrentUser);
|
||||
|
||||
// 단일 사용자 정보 조회
|
||||
router.get('/:id', authenticateJWT, getUser);
|
||||
|
||||
// 사용자 정보 수정
|
||||
router.put('/:id', authenticateJWT, updateUser);
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user