working prototype

This commit is contained in:
A.Unger
2020-01-31 14:35:50 +01:00
parent 587a6a1a02
commit 6b4c3f2098
4 changed files with 64 additions and 34 deletions
+9 -4
View File
@@ -36,10 +36,15 @@ func (s Service) Set(c context.Context, req *proto.Record, res *proto.Record) er
// Get implements the SettingsServiceHandler interface generated on accounts.pb.micro.go
func (s Service) Get(c context.Context, req *proto.Query, res *proto.Record) error {
res.Payload = &proto.Payload{
Phoenix: &proto.Phoenix{
Theme: "light",
},
st := store.New()
contents, err := st.Read(req.Key)
if err != nil {
// TODO deal with this
}
r := &proto.Payload{}
json.Unmarshal(contents[0].Value, r)
res.Payload = r
return nil
}