// Copyright 2015 gRPC authors. // // Licensed under the Apache License, Version 2.0 (the “License”); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an “AS IS” BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License.
syntax = “proto3”;
option java_multiple_files = true; option java_package = “io.grpc.examples.helloworld”; option java_outer_classname = “HelloWorldProto”; option objc_class_prefix = “HLW”;
package atyun;
// The greeting service definition. service wechat {
// Sends a greeting rpc SayHello (HelloRequest) returns (HelloReply) { } // get wechat-subscription access_token rpc GetSubscriptionAccessToken (GetAccesstokenRequest) returns (GetAccesstokenReply) { } // send wechat-subscription message rpc SendWechatSubscriptionMessage (SendWechatMessageRequest) returns (SendWechatMessageReply) { } // wechat oauth rpc WechatOauth (WechatOauthRequest) returns (WechatOauthReply) { } // wechat login rpc WechatLogin (WechatLoginRequest) returns (WechatLoginReply) { } rpc GetWechatPayCodeUrl (WechatPayRequest) returns (WechatPayReply) { }
}
// The request message containing the user's name. message HelloRequest {
string name = 1;
}
// The response message containing the greetings message HelloReply {
Status status = 1;
}
message Status {
string message = 1; string code = 2;
}
// appid && secret_key message GetAccesstokenRequest {
string app_id = 1; string secret_key = 2;
}
message GetAccesstokenReply {
Status status = 1; string access_token = 2;
}
// send message to wechat-subscription users message SendWechatMessageRequest {
string template_id = 1; Keyword first = 2; Keyword keyword1 = 3; Keyword keyword2 = 4; Keyword keyword3 = 5; Keyword keyword4 = 6; Keyword remark = 7; string token = 8; string direct_url = 10; string open_id = 11;
}
message SendWechatMessageReply {
string errcode = 1; Status status = 2;
}
message Keyword {
string value = 1;
}
// WechatOauth
message WechatOauthRequest {
string uri = 1; string origin = 2; string appid = 7; string secret_key = 8;
}
message WechatOauthReply {
string sns_url = 1; Status status = 2;
}
message WechatLoginRequest {
string appid = 1; string secret_key = 7; string code = 8;
}
message WechatLoginReply {
string openid = 1; string image_url = 2; Status status = 3;
}
message WechatPayRequest {
string appid = 1; string mch_id = 2; string body = 3; string out_trade_no = 4; string total_fee = 5; string spbill_create_ip = 6; string notify_url = 7; string trade_type = 8; string product_id = 9; string key = 10;
} message WechatPayReply {
string code_url = 1; Status status = 2;
}