mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 15:25:19 +00:00
21
location/subscriber/subscriber.go
Normal file
21
location/subscriber/subscriber.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package subscriber
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"github.com/micro/services/location/domain"
|
||||
proto "github.com/micro/services/location/proto"
|
||||
)
|
||||
|
||||
var (
|
||||
Topic = "location"
|
||||
)
|
||||
|
||||
type Location struct{}
|
||||
|
||||
func (g *Location) Handle(ctx context.Context, e *proto.Entity) error {
|
||||
log.Printf("Saving entity ID %s", e.Id)
|
||||
domain.Save(domain.ProtoToEntity(e))
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user