feat(training): 新增培训考证报名与静态资源访问
This commit is contained in:
@@ -4,6 +4,7 @@ import { HandlerHealthProfile } from "../handler/health_profile.js";
|
||||
import { HandlerResource } from "../handler/resource.js";
|
||||
import { HandlerEmployee } from "../handler/employee.js";
|
||||
import { HandlerAIMedia } from "../handler/ai_media.js";
|
||||
import { HandlerTrainingApplication } from "../handler/training_application.js";
|
||||
import ResponseUtil from "../utils/responseUtil.js";
|
||||
import { getUserByToken } from "../utils/user_service.js";
|
||||
import { isAdmin } from "../utils/permissions.js";
|
||||
@@ -77,6 +78,7 @@ function registerRoutes(app) {
|
||||
const handlerResource = new HandlerResource();
|
||||
const handlerEmployee = new HandlerEmployee();
|
||||
const handlerAIMedia = new HandlerAIMedia();
|
||||
const handlerTrainingApplication = new HandlerTrainingApplication();
|
||||
|
||||
// 敏感数据路由需要登录后访问
|
||||
router.get("/escort-record/my", requireAuth, handlerEscortRecord.getMyRecords.bind(handlerEscortRecord));
|
||||
@@ -96,6 +98,13 @@ function registerRoutes(app) {
|
||||
router.put("/health-profile/mine/:id", requireAuth, updateLimit, handlerHealthProfile.updateMyProfile.bind(handlerHealthProfile));
|
||||
router.delete("/health-profile/mine/:id", requireAuth, deleteLimit, handlerHealthProfile.deleteMyProfile.bind(handlerHealthProfile));
|
||||
|
||||
// 陪诊师培训考证报名:C 端只能给自己报名,userId 取自 token;
|
||||
// 写接口与下单共用 createLimit,避免重复提交刷出多条报名
|
||||
router.post("/training-application", requireAuth, createLimit, handlerTrainingApplication.createApplication.bind(handlerTrainingApplication));
|
||||
router.get("/training-application/mine", requireAuth, handlerTrainingApplication.getMyApplication.bind(handlerTrainingApplication));
|
||||
// 管理端报名列表必须管理员
|
||||
router.get("/training-application", requireAuth, requireAdmin, handlerTrainingApplication.getApplications.bind(handlerTrainingApplication));
|
||||
|
||||
// 以下为管理端档案接口(C 端一律走 /mine),必须管理员
|
||||
router.get("/health-profile", requireAuth, requireAdmin, handlerHealthProfile.getProfiles.bind(handlerHealthProfile));
|
||||
router.get("/health-profile/:id", requireAuth, requireAdmin, handlerHealthProfile.getProfileById.bind(handlerHealthProfile));
|
||||
|
||||
Reference in New Issue
Block a user