-
Notifications
You must be signed in to change notification settings - Fork 1
[refactor] simplify controllers with independent Service layer #30
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
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
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]>
TechQuery
left a comment
There was a problem hiding this 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]>
已完成!在 30fc748 中,将以下控制器改为使用
每个控制器现在都实例化一个 |
…pstream packages [remove] Render.com configuration
[optimize] clean Empty fields of Query filters
source/service/folder) with:ActivityLog.ts- Move logging logic from controller to serviceBase.ts- Generic base service class for CRUD operationsSession.ts- Session handling (sign, encrypt, signUp, checkJWT)User.ts- Extended user service classindex.ts- Re-export all servicessource/utility.ts- UpdatesearchConditionOfreturn typesource/model/index.ts- AddinvalidWhereValuesBehavioroptionsource/index.ts- Use sessionService for auth checkingsource/controller/ActivityLog.ts- Remove static log methodssource/controller/User.ts- Use services instead of static methodssource/controller/OAuth.ts- Use services instead of static methodsUserServiceWithLog:Original prompt
Human changes
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.