Backend - Service Station: expose the 「临时公告」 chain end-to-end (V042 table/service existed but had ZERO endpoints -> both admin and miniapp could never reach it): 5 operator endpoints (list/create/update/publish/archive) + 1 user-facing read endpoint. - Fix privilege escalation: create/update were guarded only by the class-level service_location.view, making V015's service_location.manage a never-used dead permission -> read-only roles could edit stations. Permissions moved to method level. - Add ServiceLocationOperatorController to OperatorEndpointPermissionCoverageTest (it was NOT scanned, which is why the escalation stayed invisible). - Add create/update validation (address NOT NULL + status CHECK only blew up on PG). - Banner: validation failures threw bare RuntimeException -> 500; now VALIDATION_ERROR -> 400. Add deleted_at IS NULL to both home queries (soft-deleted banners stayed live). - Content: operator list/detail split (admin «publish» was a dead end because it reused the published-only public API); category deactivate/reactivate; article body on edit. - Service Program: operator member list now includes pending (approval reachable); active-only public visibility (draft leak); memberCount/pendingCount aggregation; withdraw/removeMember; reuse row on re-apply (UNIQUE(program_id,user_id) crash). - MeController: add the missing GET /me/service-history route. Schema / guards - schema-h2.sql: add service_location_announcements (+ chk_announcement_status) and content_categories (+ uk_content_category_code, chk_category_status); move both into REQUIRED_IN_TEST_SCHEMA. MigrationValidationTest baseline 41 -> 42. - V11PermissionMatrixContractTest now scans ALL migrations instead of hardcoding V015+V029. - New: ServiceLocationAnnouncementPhase19IntegrationTest (24), ServiceLocationControllerPermissionContractTest (5), ServiceLocationAnnouncementConstraintParityTest (5, prod DDL <-> test schema <-> backend whitelist <-> admin labels). Frontend - admin-web: ServiceStationView gains announcement management (statuses, create/edit, publish/archive with confirm, expiry); write buttons gated by service_location.manage. - miniapp: U50 renders the 临时公告 block via new serviceStationService; page no longer talks to utils/api directly; announcement failure degrades to [] instead of erroring. - ui-tests: U37 four-group + U50 announcement contracts; /home assertion retargeted to the service layer. Verification - Negative verification: 3 injected defects (drop soft-delete filter / drop test-schema CHECK / downgrade write endpoint to view) -> 4 named tests fail precisely, no collateral failures; restored, NEG-VAL residue = 0. - Backend full regression: 602 tests, 0 failures, 0 errors, 3 skipped (baseline 420). - admin-web: vue-tsc --noEmit EXIT=0, vite build EXIT=0. Miniapp: tsc --noEmit EXIT=0. - ui-tests 14/14 PASS.
50 lines
1.8 KiB
JavaScript
50 lines
1.8 KiB
JavaScript
/**
|
||
* services 层聚合入口(规范 §130-131)
|
||
*
|
||
* 页面与 Store 统一从这里导入业务服务,不直接 require utils/api,
|
||
* 也不直接 require 各子服务模块——便于后续替换实现或加日志埋点。
|
||
*
|
||
* 用法:
|
||
* const { authService, matchService } = require('../services');
|
||
* await authService.wechatLogin({ code });
|
||
*/
|
||
const authService = require('./authService');
|
||
const userService = require('./userService');
|
||
const profileService = require('./profileService');
|
||
const verificationService = require('./verificationService');
|
||
const recommendationService = require('./recommendationService');
|
||
const matchService = require('./matchService');
|
||
const messageService = require('./messageService');
|
||
const activityService = require('./activityService');
|
||
const matchmakerService = require('./matchmakerService');
|
||
const safetyService = require('./safetyService');
|
||
const appealService = require('./appealService');
|
||
const appConfigService = require('./appConfigService');
|
||
// Phase 19:公益服务链路(服务预约 / 专项服务 / 内容 / 服务记录)
|
||
const serviceAppointmentService = require('./serviceAppointmentService');
|
||
const serviceProgramService = require('./serviceProgramService');
|
||
const contentService = require('./contentService');
|
||
const serviceHistoryService = require('./serviceHistoryService');
|
||
// Phase 19:服务站(U50)—— 临时公告只读接入
|
||
const serviceStationService = require('./serviceStationService');
|
||
|
||
module.exports = {
|
||
authService,
|
||
userService,
|
||
profileService,
|
||
verificationService,
|
||
recommendationService,
|
||
matchService,
|
||
messageService,
|
||
activityService,
|
||
matchmakerService,
|
||
safetyService,
|
||
appealService,
|
||
appConfigService,
|
||
serviceAppointmentService,
|
||
serviceProgramService,
|
||
contentService,
|
||
serviceHistoryService,
|
||
serviceStationService,
|
||
};
|