fix: some api bug

This commit is contained in:
wwweww
2026-03-31 22:12:06 +08:00
parent c5ff4f0216
commit e7970ac25f
219 changed files with 16195 additions and 2126 deletions
@@ -5,6 +5,9 @@ package user
import (
"context"
"errors"
"juwan-backend/app/users/rpc/usercenter"
"juwan-backend/common/utils/contextj"
"juwan-backend/app/users/api/internal/svc"
"juwan-backend/app/users/api/internal/types"
@@ -29,6 +32,18 @@ func NewUnfollowUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Unfo
func (l *UnfollowUserLogic) UnfollowUser(req *types.UnfollowUserReq) (resp *types.EmptyResp, err error) {
// todo: add your logic here and delete this line
userId, err := contextj.UserIDFrom(l.ctx)
if err != nil {
return nil, errors.New("unauthorized")
}
return
_, err = l.svcCtx.UserRpc.DelUserFollows(l.ctx, &usercenter.DelUserFollowsReq{
Id: req.Id,
UserId: userId,
})
if err != nil {
logx.Errorf("del user follow err: %v", err)
return nil, errors.New("unfollow user failed")
}
return &types.EmptyResp{}, nil
}