feat: 添加通知微服务,支持站内通知已读状态
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"juwan-backend/app/notification/rpc/internal/svc"
|
||||
"juwan-backend/app/notification/rpc/pb"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type DelNotificationsLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewDelNotificationsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DelNotificationsLogic {
|
||||
return &DelNotificationsLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DelNotificationsLogic) DelNotifications(in *pb.DelNotificationsReq) (*pb.DelNotificationsResp, error) {
|
||||
err := l.svcCtx.NotificationModelRW.Notifications.DeleteOneID(in.GetId()).Exec(l.ctx)
|
||||
if err != nil {
|
||||
logx.Errorf("delNotifications err: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.DelNotificationsResp{}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user