mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-07-16 09:38:49 +02:00
34 lines
708 B
Go
34 lines
708 B
Go
package grpc
|
|
|
|
import (
|
|
"context"
|
|
"github.com/pocketbase/pocketbase"
|
|
pb "htwkalender/common/genproto/modules"
|
|
"htwkalender/data-manager/service/db"
|
|
)
|
|
|
|
type FeedServiceHandler struct {
|
|
app *pocketbase.PocketBase
|
|
pb.UnimplementedFeedServiceServer
|
|
}
|
|
|
|
func (s *FeedServiceHandler) GetFeed(ctx context.Context, in *pb.GetFeedRequest) (*pb.GetFeedResponse, error) {
|
|
|
|
s.app.Logger().Info(
|
|
"Protobuf - GetFeed",
|
|
"uuid", in.Id,
|
|
)
|
|
|
|
// get feed from database by UUID
|
|
feed, err := db.FindFeedByToken(s.app, in.Id)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
// Implement your logic here to fetch feed data based on the UUID
|
|
// Example response
|
|
return &pb.GetFeedResponse{
|
|
Feed: feedToProto(feed),
|
|
}, nil
|
|
}
|