Browse Source

数量加减方法

master v0.7.1
guzeng 3 years ago
parent
commit
74208f60e1
2 changed files with 27 additions and 6 deletions
  1. +21
    -4
      redis.pb.go
  2. +6
    -2
      redis.proto

+ 21
- 4
redis.pb.go View File

@ -30,6 +30,7 @@ It has these top-level messages:
LRangeRequest
LLenRequest
AddRequest
AddResponse
*/
package redisrpc
@ -499,6 +500,22 @@ func (m *AddRequest) GetValue() int64 {
return 0
}
type AddResponse struct {
Ret *int64 `protobuf:"varint,1,opt,name=ret" json:"ret,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *AddResponse) Reset() { *m = AddResponse{} }
func (m *AddResponse) String() string { return proto.CompactTextString(m) }
func (*AddResponse) ProtoMessage() {}
func (m *AddResponse) GetRet() int64 {
if m != nil && m.Ret != nil {
return *m.Ret
}
return 0
}
func init() {
}
@ -524,8 +541,8 @@ type RedisService interface {
LRange(in *LRangeRequest, out *HGetListResponse) error
LLen(in *LLenRequest, out *LSetResponse) error
ReduceStock(in *SetRequest, out *SetResponse) error
Incrby(in *AddRequest, out *SetResponse) error
Decrby(in *AddRequest, out *SetResponse) error
Incrby(in *AddRequest, out *AddResponse) error
Decrby(in *AddRequest, out *AddResponse) error
}
// AcceptRedisServiceClient accepts connections on the listener and serves requests
@ -660,10 +677,10 @@ func (c *RedisServiceClient) LLen(in *LLenRequest, out *LSetResponse) error {
func (c *RedisServiceClient) ReduceStock(in *SetRequest, out *SetResponse) error {
return c.Call("RedisService.ReduceStock", in, out)
}
func (c *RedisServiceClient) Incrby(in *AddRequest, out *SetResponse) error {
func (c *RedisServiceClient) Incrby(in *AddRequest, out *AddResponse) error {
return c.Call("RedisService.Incrby", in, out)
}
func (c *RedisServiceClient) Decrby(in *AddRequest, out *SetResponse) error {
func (c *RedisServiceClient) Decrby(in *AddRequest, out *AddResponse) error {
return c.Call("RedisService.Decrby", in, out)
}


+ 6
- 2
redis.proto View File

@ -108,6 +108,10 @@ message AddRequest {
string key = 1;
int64 value = 2;
}
message AddResponse {
int64 ret = 1;
}
// rpc方法
service RedisService {
rpc Get (GetRequest) returns (GetStringResponse); // 使key查询
@ -131,6 +135,6 @@ service RedisService {
rpc LRange(LRangeRequest) returns (HGetListResponse); //
rpc LLen(LLenRequest) returns (LSetResponse); //
rpc ReduceStock(SetRequest) returns(SetResponse);//
rpc Incrby(AddRequest) returns(SetResponse);//
rpc Decrby(AddRequest) returns(SetResponse);//
rpc Incrby(AddRequest) returns(AddResponse);//
rpc Decrby(AddRequest) returns(AddResponse);//
}

Loading…
Cancel
Save