slowwildserverserver.go 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. // Code generated by goctl. DO NOT EDIT.
  2. // Source: slowwild.proto
  3. package server
  4. import (
  5. "context"
  6. "slowwild/internal/svc"
  7. "git.banshen.xyz/huangguangrong/slow_wild_protobuff/slowwild/slowwildserver"
  8. "slowwild/internal/logic"
  9. )
  10. type SlowWildServerServer struct {
  11. svcCtx *svc.ServiceContext
  12. slowwildserver.UnimplementedSlowWildServerServer
  13. }
  14. func NewSlowWildServerServer(svcCtx *svc.ServiceContext) *SlowWildServerServer {
  15. return &SlowWildServerServer{
  16. svcCtx: svcCtx,
  17. }
  18. }
  19. // 用户登录
  20. func (s *SlowWildServerServer) Login(ctx context.Context, in *slowwildserver.LoginReq) (*slowwildserver.LoginAndRegisterRsp, error) {
  21. l := logic.NewLoginLogic(ctx, s.svcCtx)
  22. return l.Login(in)
  23. }
  24. // 用户注册
  25. func (s *SlowWildServerServer) Register(ctx context.Context, in *slowwildserver.RegisterReq) (*slowwildserver.LoginAndRegisterRsp, error) {
  26. l := logic.NewRegisterLogic(ctx, s.svcCtx)
  27. return l.Register(in)
  28. }
  29. // 获取用户信息
  30. func (s *SlowWildServerServer) GetUserInfo(ctx context.Context, in *slowwildserver.GetUserInfoReq) (*slowwildserver.GetUserInfoResp, error) {
  31. l := logic.NewGetUserInfoLogic(ctx, s.svcCtx)
  32. return l.GetUserInfo(in)
  33. }
  34. // 查询用户信息
  35. func (s *SlowWildServerServer) FindUser(ctx context.Context, in *slowwildserver.FindUserReq) (*slowwildserver.FindUserResp, error) {
  36. l := logic.NewFindUserLogic(ctx, s.svcCtx)
  37. return l.FindUser(in)
  38. }
  39. // 关注用户
  40. func (s *SlowWildServerServer) UserFollow(ctx context.Context, in *slowwildserver.FollowUserReq) (*slowwildserver.FollowUserRes, error) {
  41. l := logic.NewUserFollowLogic(ctx, s.svcCtx)
  42. return l.UserFollow(in)
  43. }
  44. // 取消关注用户
  45. func (s *SlowWildServerServer) UnUserFollow(ctx context.Context, in *slowwildserver.UnFollowUserReq) (*slowwildserver.UnFollowUserRes, error) {
  46. l := logic.NewUnUserFollowLogic(ctx, s.svcCtx)
  47. return l.UnUserFollow(in)
  48. }
  49. // 获取我得粉丝
  50. func (s *SlowWildServerServer) GetFans(ctx context.Context, in *slowwildserver.GetFollowingReq) (*slowwildserver.GetFollowingRes, error) {
  51. l := logic.NewGetFansLogic(ctx, s.svcCtx)
  52. return l.GetFans(in)
  53. }
  54. // 查询我的关注
  55. func (s *SlowWildServerServer) GetFollows(ctx context.Context, in *slowwildserver.GetFollowingReq) (*slowwildserver.GetFollowingRes, error) {
  56. l := logic.NewGetFollowsLogic(ctx, s.svcCtx)
  57. return l.GetFollows(in)
  58. }
  59. // 查询用户的详细信息
  60. func (s *SlowWildServerServer) GetUserProfile(ctx context.Context, in *slowwildserver.GetUserProfileReq) (*slowwildserver.GetUserProfileRes, error) {
  61. l := logic.NewGetUserProfileLogic(ctx, s.svcCtx)
  62. return l.GetUserProfile(in)
  63. }
  64. // 搜索用户名称
  65. func (s *SlowWildServerServer) SearchUsername(ctx context.Context, in *slowwildserver.SearchUsernameReq) (*slowwildserver.SearchUsernameRes, error) {
  66. l := logic.NewSearchUsernameLogic(ctx, s.svcCtx)
  67. return l.SearchUsername(in)
  68. }
  69. // 发布帖子
  70. func (s *SlowWildServerServer) CreatePost(ctx context.Context, in *slowwildserver.CreatePostReq) (*slowwildserver.CreatePostRsp, error) {
  71. l := logic.NewCreatePostLogic(ctx, s.svcCtx)
  72. return l.CreatePost(in)
  73. }
  74. // 获取话题列表
  75. func (s *SlowWildServerServer) GetTagList(ctx context.Context, in *slowwildserver.GetTagListReq) (*slowwildserver.GetTagListRsp, error) {
  76. l := logic.NewGetTagListLogic(ctx, s.svcCtx)
  77. return l.GetTagList(in)
  78. }
  79. // 获取话题详情
  80. func (s *SlowWildServerServer) GetTag(ctx context.Context, in *slowwildserver.GetTagReq) (*slowwildserver.GetTagRsp, error) {
  81. l := logic.NewGetTagLogic(ctx, s.svcCtx)
  82. return l.GetTag(in)
  83. }
  84. // 获取帖子列表
  85. func (s *SlowWildServerServer) GetPostList(ctx context.Context, in *slowwildserver.GetPostListReq) (*slowwildserver.GetPostListRsp, error) {
  86. l := logic.NewGetPostListLogic(ctx, s.svcCtx)
  87. return l.GetPostList(in)
  88. }
  89. // 获取帖子详情
  90. func (s *SlowWildServerServer) GetPost(ctx context.Context, in *slowwildserver.GetPostReq) (*slowwildserver.GetPostRsp, error) {
  91. l := logic.NewGetPostLogic(ctx, s.svcCtx)
  92. return l.GetPost(in)
  93. }
  94. // 点赞帖子
  95. func (s *SlowWildServerServer) PostUpvote(ctx context.Context, in *slowwildserver.PostUpvoteReq) (*slowwildserver.PostUpvoteRsp, error) {
  96. l := logic.NewPostUpvoteLogic(ctx, s.svcCtx)
  97. return l.PostUpvote(in)
  98. }
  99. // 分享帖子
  100. func (s *SlowWildServerServer) PostShare(ctx context.Context, in *slowwildserver.PostShareReq) (*slowwildserver.PostShareRsp, error) {
  101. l := logic.NewPostShareLogic(ctx, s.svcCtx)
  102. return l.PostShare(in)
  103. }
  104. // 收藏帖子
  105. func (s *SlowWildServerServer) PostCollection(ctx context.Context, in *slowwildserver.PostCollectionReq) (*slowwildserver.PostCollectionRsp, error) {
  106. l := logic.NewPostCollectionLogic(ctx, s.svcCtx)
  107. return l.PostCollection(in)
  108. }
  109. // 发布评论
  110. func (s *SlowWildServerServer) PostComment(ctx context.Context, in *slowwildserver.PostCommentReq) (*slowwildserver.PostCommentRsp, error) {
  111. l := logic.NewPostCommentLogic(ctx, s.svcCtx)
  112. return l.PostComment(in)
  113. }
  114. // 发布回复
  115. func (s *SlowWildServerServer) PostReply(ctx context.Context, in *slowwildserver.PostReplyReq) (*slowwildserver.PostReplyRsp, error) {
  116. l := logic.NewPostReplyLogic(ctx, s.svcCtx)
  117. return l.PostReply(in)
  118. }
  119. // 获取评论列表
  120. func (s *SlowWildServerServer) GetPostCommentList(ctx context.Context, in *slowwildserver.GetPostCommentListReq) (*slowwildserver.GetPostCommentListRsp, error) {
  121. l := logic.NewGetPostCommentListLogic(ctx, s.svcCtx)
  122. return l.GetPostCommentList(in)
  123. }
  124. // 获取回复列表
  125. func (s *SlowWildServerServer) GetReplyList(ctx context.Context, in *slowwildserver.GetReplyListReq) (*slowwildserver.GetReplyListRsp, error) {
  126. l := logic.NewGetReplyListLogic(ctx, s.svcCtx)
  127. return l.GetReplyList(in)
  128. }
  129. // 评论点赞
  130. func (s *SlowWildServerServer) PostCommentUpvote(ctx context.Context, in *slowwildserver.PostCommentUpvoteReq) (*slowwildserver.PostCommentUpvoteRsp, error) {
  131. l := logic.NewPostCommentUpvoteLogic(ctx, s.svcCtx)
  132. return l.PostCommentUpvote(in)
  133. }
  134. // 删除帖子
  135. func (s *SlowWildServerServer) PostDelete(ctx context.Context, in *slowwildserver.PostDeleteReq) (*slowwildserver.PostDeleteRsp, error) {
  136. l := logic.NewPostDeleteLogic(ctx, s.svcCtx)
  137. return l.PostDelete(in)
  138. }
  139. // 删除回复/评论
  140. func (s *SlowWildServerServer) CommentDelete(ctx context.Context, in *slowwildserver.CommentDeleteReq) (*slowwildserver.CommentDeleteRsp, error) {
  141. l := logic.NewCommentDeleteLogic(ctx, s.svcCtx)
  142. return l.CommentDelete(in)
  143. }
  144. // 获取用户发布的帖子
  145. func (s *SlowWildServerServer) GetUserPostList(ctx context.Context, in *slowwildserver.GetUserPostListReq) (*slowwildserver.GetUserPostListRsp, error) {
  146. l := logic.NewGetUserPostListLogic(ctx, s.svcCtx)
  147. return l.GetUserPostList(in)
  148. }
  149. // 获取用户收藏的帖子
  150. func (s *SlowWildServerServer) GetUserPostCollectionList(ctx context.Context, in *slowwildserver.GetUserPostCollectionListReq) (*slowwildserver.GetUserPostCollectionListRsp, error) {
  151. l := logic.NewGetUserPostCollectionListLogic(ctx, s.svcCtx)
  152. return l.GetUserPostCollectionList(in)
  153. }
  154. // 获取用户点赞过的帖子
  155. func (s *SlowWildServerServer) GetUserPostLikeList(ctx context.Context, in *slowwildserver.GetUserPostLikeListReq) (*slowwildserver.GetUserPostLikeListRsp, error) {
  156. l := logic.NewGetUserPostLikeListLogic(ctx, s.svcCtx)
  157. return l.GetUserPostLikeList(in)
  158. }