feat(single): change string to proto.KeyBase

This commit is contained in:
HuangJiaLuo 2021-10-06 20:39:38 +08:00
parent f17cab2016
commit 97833ed150
1 changed files with 6 additions and 6 deletions

View File

@ -13,7 +13,7 @@ func (s *serverSingle) Set(
) (*proto.SetResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
return s.dao.Set(req.Key.Key, req.Val)
return s.dao.Set(req.Key, req.Val)
})
lruEvent := event.NewEvent(lru.OptionEventName)
@ -35,7 +35,7 @@ func (s *serverSingle) Get(
req *proto.GetRequest,
) (*proto.GetResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
return s.dao.Get(req.Key.Key)
return s.dao.Get(req.Key)
})
lruEvent := event.NewEvent(lru.OptionEventName)
@ -56,7 +56,7 @@ func (s serverSingle) Add(
req *proto.AddRequest,
) (*proto.AddResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
return s.dao.Add(req.Key.Key, req.Renewal)
return s.dao.Add(req.Key, req.Renewal)
})
lruEvent := event.NewEvent(lru.OptionEventName)
@ -77,7 +77,7 @@ func (s *serverSingle) Reduce(
req *proto.ReduceRequest,
) (*proto.ReduceResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
return s.dao.Add(req.Key.Key, req.Renewal)
return s.dao.Add(req.Key, req.Renewal)
})
lruEvent := event.NewEvent(lru.OptionEventName)
@ -98,7 +98,7 @@ func (s *serverSingle) Setbit(
req *proto.SetbitRequest,
) (*proto.SetbitResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
return nil, s.dao.Setbit(req.Key.Key, req.Val, req.Offer)
return nil, s.dao.Setbit(req.Key, req.Val, req.Offer)
})
lruEvent := event.NewEvent(lru.OptionEventName)
@ -117,7 +117,7 @@ func (s *serverSingle) Getbit(
req *proto.GetbitRequest,
) (*proto.GetbitResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
return s.dao.GetBit(req.Key.Key, req.Offer)
return s.dao.GetBit(req.Key, req.Offer)
})
lruEvent := event.NewEvent(lru.OptionEventName)