Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 4, 2025

PR-30 PR-30 PR-30 Powered by Pull Request Badge

  • Analyze the PR [refactor] simplify controllers with independent Base, User, Session & Activity Log services idea2app/REST-Node-ts#20 to understand the changes
  • Understand the current HOP-service codebase structure
  • Create the service layer (source/service/ folder) with:
    • ActivityLog.ts - Move logging logic from controller to service
    • Base.ts - Generic base service class for CRUD operations
    • Session.ts - Session handling (sign, encrypt, signUp, checkJWT)
    • User.ts - Extended user service class
    • index.ts - Re-export all services
  • Update source/utility.ts - Update searchConditionOf return type
  • Update source/model/index.ts - Add invalidWhereValuesBehavior option
  • Update source/index.ts - Use sessionService for auth checking
  • Refactor source/controller/ActivityLog.ts - Remove static log methods
  • Refactor source/controller/User.ts - Use services instead of static methods
  • Refactor source/controller/OAuth.ts - Use services instead of static methods
  • Simplify controllers with UserServiceWithLog:
    • Announcement, Award, AwardAssignment, Enrollment, Evaluation
    • GitTemplate, Hackathon, Organizer, PlatformAdmin, Staff
    • Survey, Team, TeamMember, TeamWork
  • Build verified successfully
  • Run code review and address feedback
Original prompt

照抄 idea2app/REST-Node-ts#20 的代码,来简化整个项目的实现。

Human changes

  1. [refactor] move Static methods of controllers to services
  2. [optimize] simplify DB Store accessing
  3. [optimize] clean Empty fields of Query filters
  4. [optimize] upgrade to Koa Router 15, Git utility 0.3 & other latest Upstream packages
  5. [remove] Render.com configuration

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link

coderabbitai bot commented Dec 4, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@TechQuery TechQuery added the feature New feature or request label Dec 4, 2025
Based on idea2app/REST-Node-ts#20:
- Add source/service/ folder with ActivityLog, Base, Session, User services
- Move static methods from controllers to services
- Update all controllers to use activityLogService
- Update index.ts to use sessionService.checkJWT
- Update model/index.ts with invalidWhereValuesBehavior option
- Update utility.ts searchConditionOf return type

Co-authored-by: TechQuery <[email protected]>
Copilot AI changed the title [WIP] Simplify the overall project implementation refactor: simplify project with independent service layer Dec 4, 2025
Copilot AI requested a review from TechQuery December 4, 2025 21:46
Copy link
Member

@TechQuery TechQuery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot 除了 User controller,大多数 controller 都可以用 UserServiceWithLog 简化。

Updated the following controllers to use UserServiceWithLog:
- Announcement, Award, AwardAssignment, Enrollment, Evaluation
- GitTemplate, Hackathon, Organizer, PlatformAdmin, Staff
- Survey, Team, TeamMember, TeamWork

This eliminates direct activityLogService calls by leveraging the
built-in logging in UserServiceWithLog.createOne/editOne/deleteOne.

Co-authored-by: TechQuery <[email protected]>
Copy link
Contributor Author

Copilot AI commented Dec 4, 2025

@copilot 除了 User controller,大多数 controller 都可以用 UserServiceWithLog 简化。

已完成!在 30fc748 中,将以下控制器改为使用 UserServiceWithLog 来简化实现:

  • Announcement, Award, AwardAssignment, Enrollment, Evaluation
  • GitTemplate, Hackathon, Organizer, PlatformAdmin, Staff
  • Survey, Team, TeamMember, TeamWork

每个控制器现在都实例化一个 service = new UserServiceWithLog(EntityClass, searchKeys) 并使用其 createOneeditOnedeleteOnegetListgetOne 方法,自动处理活动日志记录。

…pstream packages

[remove] Render.com configuration
[optimize] clean Empty fields of Query filters
@TechQuery TechQuery marked this pull request as ready for review December 6, 2025 15:28
@TechQuery TechQuery changed the title refactor: simplify project with independent service layer [refactor] simplify controllers with independent Service layer Dec 6, 2025
@TechQuery TechQuery merged commit 4ea721f into master Dec 6, 2025
3 checks passed
@TechQuery TechQuery deleted the copilot/simplify-project-implementation branch December 6, 2025 20:51
@github-project-automation github-project-automation bot moved this from Backlog to Done in 黑客松开放平台 v3 Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants