Passport/pkg/internal/grpc/events.go

20 lines
469 B
Go
Raw Normal View History

package grpc
import (
"context"
"git.solsynth.dev/hydrogen/dealer/pkg/proto"
"git.solsynth.dev/hydrogen/passport/pkg/internal/services"
)
func (v *Server) RecordEvent(ctx context.Context, request *proto.RecordEventRequest) (*proto.RecordEventResponse, error) {
2024-10-14 14:23:51 +00:00
services.AddEvent(
uint(request.GetUserId()),
request.GetAction(),
request.GetTarget(),
request.GetIp(),
request.GetUserAgent(),
)
return &proto.RecordEventResponse{IsSuccess: true}, nil
}