-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feat/user #1
Conversation
router.go
Outdated
@@ -47,9 +47,13 @@ func registerRouter(r *gin.Engine) { | |||
userGroup := needAuthGroup.Group("/user") | |||
userGroup.GET("", handler.GetUserListHandler) | |||
userGroup.GET("/suggest", handler.GetSuggestedUserHandler) | |||
userGroup.GET("/me", handler.GetCurrentUserHandler) | |||
userGroup.GET("/:userID", handler.GetUserDetailHandler) | |||
userGroup.GET("/me", handler.GetCurrentUserSummaryHandler) |
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.
me感觉可以去掉,统一用 /:userID
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.
前端个人页面的概览部分其他用户是否被允许访问?对应GetCurrentUserSummaryHandler
有这些数据:
export type UserSummaryProps = {
review_count: number;
like_receive: number;
tip_receive: number;
following_course_count: number;
};
如果允许的话我就改一下,或者加个鉴权?
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.
我暂时设置为了不允许访问,加了鉴权
export type UserDetailProps = {
id: number;
username: string;
avatar: string;
bio: string;
};
允许访问
export type UserProfileProps = {
id: number;
user_id: number;
username: string;
bio: string;
email: string;
avatar: string;
role: string;
department: string;
major: string;
grade: string;
}
不允许访问
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.
需要鉴权的,本人和第三方视角的内容是不一样的。先这样吧,后面再调。
别的没啥问题了,rebase 一下 main 然后过 ci 吧 |
…onverter functions
…rGroup in route.go
…ion for filter in \service\user.go
…ailHandler and GetUserViewsHandler in \handler\user.go which are partially declared in commit bcba52e
… according to jcourse_v2_frontend model.ts
…feature to repository/user.go
- Renamed routes in userGroup - Added a new '/user' route in adminGroup for displaying the user list - Refined user-related handlers to improve readability - Implemented authentication checks across user-related endpoints
…UserSummaryDTO func which caused cycle import
…function parameter in repository/user.go from value to reference
Reorganized the user routes, implemented most of the handlers(except watch/unwatch feature) related to the user feature, revised user DTO models according to the frontend model fields and expanded the functionality of repository/user.go