slowwildserverserver.go 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Code generated by goctl. DO NOT EDIT.
  2. // Source: slowwild.proto
  3. package server
  4. import (
  5. "context"
  6. "git.banshen.xyz/huangguangrong/slow_wild_protobuff/slowwild/slowwildserver"
  7. "slowwild/internal/logic"
  8. "slowwild/internal/svc"
  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. }