搜索好友接口优化

This commit is contained in:
2025-12-14 15:19:24 +08:00
parent b189251a6f
commit 4f2b0bb213
3 changed files with 423 additions and 0 deletions

View File

@@ -224,6 +224,7 @@ func main() {
service.InitAttachmentService(db) // 附件服务(文件上传、管理)
service.InitLoginLogService(db) // 登录日志服务(记录登录历史)
service.InitMomentService(db) // 朋友圈服务(动态、点赞、评论)
service.InitSearchService(db) // 搜索服务(聚合搜索)
// 步骤5: 启动TURN服务器用于WebRTC音视频通话
go turnserver.Start()
@@ -329,6 +330,9 @@ func main() {
authGroup := apiGroup.Group("")
authGroup.Use(middleware.JWTAuthMiddleware()) // 使用JWT认证中间件
{
// 聚合搜索
authGroup.GET("/search", api.GlobalSearchHandler)
// 用户管理
authGroup.GET("/user/my-info", api.GetMyInfoHandler)
authGroup.GET("/user/list", api.GetUserListHandler)