|
@ -39,3 +39,36 @@ func Get(dbname, id string, url ...string) (map[string]string, error) { |
|
|
return data, err |
|
|
return data, err |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* uuid获取商品sku信息 |
|
|
|
|
|
* 2021/08/20 |
|
|
|
|
|
* GZ |
|
|
|
|
|
*/ |
|
|
|
|
|
func GetByUuid(dbname, uuid string, url ...string) (map[string]string, error) { |
|
|
|
|
|
|
|
|
|
|
|
conn, err := rpc_server_conn(url...) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
defer conn.Close() |
|
|
|
|
|
|
|
|
|
|
|
req := &GetUuidRequest{proto.String(dbname), proto.String(uuid), nil} |
|
|
|
|
|
|
|
|
|
|
|
res := &GetResponse{} |
|
|
|
|
|
|
|
|
|
|
|
err = conn.GetByUuid(req, res) |
|
|
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
value := res.GetValue() |
|
|
|
|
|
|
|
|
|
|
|
var data map[string]string |
|
|
|
|
|
|
|
|
|
|
|
err = json.Unmarshal(value, &data) |
|
|
|
|
|
|
|
|
|
|
|
return data, err |
|
|
|
|
|
|
|
|
|
|
|
} |