feat: 添加通知微服务,支持站内通知已读状态

This commit is contained in:
zetaloop
2026-04-24 12:44:59 +08:00
parent 95f2f10f9f
commit b557bfcc2e
52 changed files with 7035 additions and 30 deletions
@@ -0,0 +1,71 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.10.1
// Source: notification.proto
package notificationservice
import (
"context"
"juwan-backend/app/notification/rpc/pb"
"github.com/zeromicro/go-zero/zrpc"
"google.golang.org/grpc"
)
type (
AddNotificationsReq = pb.AddNotificationsReq
AddNotificationsResp = pb.AddNotificationsResp
DelNotificationsReq = pb.DelNotificationsReq
DelNotificationsResp = pb.DelNotificationsResp
GetNotificationsByIdReq = pb.GetNotificationsByIdReq
GetNotificationsByIdResp = pb.GetNotificationsByIdResp
Notifications = pb.Notifications
SearchNotificationsReq = pb.SearchNotificationsReq
SearchNotificationsResp = pb.SearchNotificationsResp
UpdateNotificationsReq = pb.UpdateNotificationsReq
UpdateNotificationsResp = pb.UpdateNotificationsResp
NotificationService interface {
AddNotifications(ctx context.Context, in *AddNotificationsReq, opts ...grpc.CallOption) (*AddNotificationsResp, error)
UpdateNotifications(ctx context.Context, in *UpdateNotificationsReq, opts ...grpc.CallOption) (*UpdateNotificationsResp, error)
DelNotifications(ctx context.Context, in *DelNotificationsReq, opts ...grpc.CallOption) (*DelNotificationsResp, error)
GetNotificationsById(ctx context.Context, in *GetNotificationsByIdReq, opts ...grpc.CallOption) (*GetNotificationsByIdResp, error)
SearchNotifications(ctx context.Context, in *SearchNotificationsReq, opts ...grpc.CallOption) (*SearchNotificationsResp, error)
}
defaultNotificationService struct {
cli zrpc.Client
}
)
func NewNotificationService(cli zrpc.Client) NotificationService {
return &defaultNotificationService{
cli: cli,
}
}
func (m *defaultNotificationService) AddNotifications(ctx context.Context, in *AddNotificationsReq, opts ...grpc.CallOption) (*AddNotificationsResp, error) {
client := pb.NewNotificationServiceClient(m.cli.Conn())
return client.AddNotifications(ctx, in, opts...)
}
func (m *defaultNotificationService) UpdateNotifications(ctx context.Context, in *UpdateNotificationsReq, opts ...grpc.CallOption) (*UpdateNotificationsResp, error) {
client := pb.NewNotificationServiceClient(m.cli.Conn())
return client.UpdateNotifications(ctx, in, opts...)
}
func (m *defaultNotificationService) DelNotifications(ctx context.Context, in *DelNotificationsReq, opts ...grpc.CallOption) (*DelNotificationsResp, error) {
client := pb.NewNotificationServiceClient(m.cli.Conn())
return client.DelNotifications(ctx, in, opts...)
}
func (m *defaultNotificationService) GetNotificationsById(ctx context.Context, in *GetNotificationsByIdReq, opts ...grpc.CallOption) (*GetNotificationsByIdResp, error) {
client := pb.NewNotificationServiceClient(m.cli.Conn())
return client.GetNotificationsById(ctx, in, opts...)
}
func (m *defaultNotificationService) SearchNotifications(ctx context.Context, in *SearchNotificationsReq, opts ...grpc.CallOption) (*SearchNotificationsResp, error) {
client := pb.NewNotificationServiceClient(m.cli.Conn())
return client.SearchNotifications(ctx, in, opts...)
}