atyun-protocal 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +51 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +9 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +6 -0
- data/ampedxx-wechat-protocal-0.1.5.gem +0 -0
- data/bin/console +17 -0
- data/bin/setup +8 -0
- data/lib/alipay_pb.rb +43 -0
- data/lib/alipay_services_pb.rb +23 -0
- data/lib/notification_pb.rb +56 -0
- data/lib/notification_services_pb.rb +28 -0
- data/lib/protocals/alipay.proto +50 -0
- data/lib/protocals/notification.proto +73 -0
- data/lib/protocals/wechat.proto +142 -0
- data/lib/wechat/protocal.rb +7 -0
- data/lib/wechat/protocal/version.rb +5 -0
- data/lib/wechat_pb.rb +97 -0
- data/lib/wechat_services_pb.rb +48 -0
- data/wechat-protocal.gemspec +27 -0
- metadata +109 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bac64d259d213db1588fb70441b8e2b247f5e955
|
4
|
+
data.tar.gz: b00ca45d715826521c32bd95e3b3f943ab0cbf35
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 40f3cfb622c3126f4e23f59d9911d3e0845eb22c70cc588ee12303e82e747c985f760bebd3c9a126a9c15fa3673f0e7e11db4a1061c6036b0daa12e7ede3f875
|
7
|
+
data.tar.gz: ea7d2d479e0a186cc53a1e8d723f5502381d5730cd85f7318f35cc21be9a5c730657c8176e5f84bc8efcd3a30ac8e77b4b5568c14a2e020b3c0a510b90438e88
|
data/.gitignore
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
9
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
10
|
+
#
|
11
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
12
|
+
# or operating system, you probably want to add a global ignore instead:
|
13
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
14
|
+
|
15
|
+
# Ignore bundler config.
|
16
|
+
/.bundle
|
17
|
+
|
18
|
+
# Ignore the default SQLite database.
|
19
|
+
/db/*.sqlite3
|
20
|
+
/db/*.sqlite3-journal
|
21
|
+
|
22
|
+
# Ignore all logfiles and tempfiles.
|
23
|
+
/log/*
|
24
|
+
/tmp/*
|
25
|
+
!/log/.keep
|
26
|
+
!/tmp/.keep
|
27
|
+
|
28
|
+
# Ignore Byebug command history file.
|
29
|
+
.byebug_history
|
30
|
+
|
31
|
+
.idea/
|
32
|
+
.Ds_Store
|
33
|
+
Gemfile.lock
|
34
|
+
config/database.yml
|
35
|
+
config/redis.yml
|
36
|
+
config/host.yml
|
37
|
+
config/carrierwave.yml
|
38
|
+
npm-debug.log
|
39
|
+
vendor/cache/*
|
40
|
+
public/assets.tgz
|
41
|
+
assets.tgz
|
42
|
+
public/assets/*
|
43
|
+
public/uploads/*
|
44
|
+
dump.rdb
|
45
|
+
id_rsa
|
46
|
+
jk-api-deployment.yaml
|
47
|
+
deployment.yaml
|
48
|
+
|
49
|
+
# rspec failure tracking
|
50
|
+
.rspec_status
|
51
|
+
ampedxx-wechat-protocal-0.1.0.gem
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at 351711778@qq.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 icepoint0
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Wechat::Protocal
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/wechat/protocal`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'wechat-protocal'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install wechat-protocal
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/wechat-protocal. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
+
|
41
|
+
## Code of Conduct
|
42
|
+
|
43
|
+
Everyone interacting in the Wechat::Protocal project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/wechat-protocal/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
Binary file
|
data/bin/console
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "wechat/protocal"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
15
|
+
|
16
|
+
#cmd
|
17
|
+
# grpc_tools_ruby_protoc -I ./lib/protocals --ruby_out=./lib --grpc_out=lib lib/protocals/*
|
data/bin/setup
ADDED
data/lib/alipay_pb.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: alipay.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_message "atyun.GetAlipayUrlRequest" do
|
8
|
+
optional :app_id, :string, 1
|
9
|
+
optional :app_private_key, :string, 2
|
10
|
+
optional :alipay_public_key, :string, 3
|
11
|
+
optional :out_trade_no, :string, 4
|
12
|
+
optional :total_amount, :string, 5
|
13
|
+
optional :subject, :string, 6
|
14
|
+
optional :return_url, :string, 7
|
15
|
+
optional :notify_url, :string, 8
|
16
|
+
optional :qr_pay_mode, :string, 9
|
17
|
+
optional :body, :string, 10
|
18
|
+
end
|
19
|
+
add_message "atyun.GetAlipayReply" do
|
20
|
+
optional :pay_url, :string, 1
|
21
|
+
optional :status, :message, 2, "atyun.AlipayStatus"
|
22
|
+
end
|
23
|
+
add_message "atyun.AlipayStatus" do
|
24
|
+
optional :code, :string, 1
|
25
|
+
optional :message, :string, 2
|
26
|
+
end
|
27
|
+
add_message "atyun.CheckSignRequest" do
|
28
|
+
optional :params_json, :string, 1
|
29
|
+
optional :public_key, :string, 2
|
30
|
+
end
|
31
|
+
add_message "atyun.CheckSignReply" do
|
32
|
+
optional :result, :string, 1
|
33
|
+
optional :status, :message, 2, "atyun.AlipayStatus"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
module Atyun
|
38
|
+
GetAlipayUrlRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.GetAlipayUrlRequest").msgclass
|
39
|
+
GetAlipayReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.GetAlipayReply").msgclass
|
40
|
+
AlipayStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.AlipayStatus").msgclass
|
41
|
+
CheckSignRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.CheckSignRequest").msgclass
|
42
|
+
CheckSignReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.CheckSignReply").msgclass
|
43
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: alipay.proto for package 'atyun'
|
3
|
+
|
4
|
+
require 'grpc'
|
5
|
+
require 'alipay_pb'
|
6
|
+
|
7
|
+
module Atyun
|
8
|
+
module Alipay
|
9
|
+
class Service
|
10
|
+
|
11
|
+
include GRPC::GenericService
|
12
|
+
|
13
|
+
self.marshal_class_method = :encode
|
14
|
+
self.unmarshal_class_method = :decode
|
15
|
+
self.service_name = 'atyun.alipay'
|
16
|
+
|
17
|
+
rpc :GetAlipayUrl, GetAlipayUrlRequest, GetAlipayReply
|
18
|
+
rpc :CheckSign, CheckSignRequest, CheckSignReply
|
19
|
+
end
|
20
|
+
|
21
|
+
Stub = Service.rpc_stub_class
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: notification.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_message "atyun.AliSmsRequest" do
|
8
|
+
optional :access_key_secret, :string, 1
|
9
|
+
optional :access_key_id, :string, 2
|
10
|
+
optional :sign_name, :string, 3
|
11
|
+
optional :phone, :string, 4
|
12
|
+
optional :template_code, :string, 5
|
13
|
+
optional :content, :string, 6
|
14
|
+
end
|
15
|
+
add_message "atyun.AliSmsReply" do
|
16
|
+
optional :status, :message, 1, "atyun.NotificationStatus"
|
17
|
+
end
|
18
|
+
add_message "atyun.NotificationStatus" do
|
19
|
+
optional :code, :string, 1
|
20
|
+
optional :message, :string, 2
|
21
|
+
end
|
22
|
+
add_message "atyun.SendCloudEmailRequest" do
|
23
|
+
optional :to, :string, 1
|
24
|
+
optional :api_user, :string, 2
|
25
|
+
optional :api_key, :string, 3
|
26
|
+
optional :from, :string, 4
|
27
|
+
optional :from_name, :string, 5
|
28
|
+
optional :subject, :string, 6
|
29
|
+
optional :html, :string, 7
|
30
|
+
end
|
31
|
+
add_message "atyun.SendCloudEmailReply" do
|
32
|
+
optional :status, :message, 1, "atyun.NotificationStatus"
|
33
|
+
end
|
34
|
+
add_message "atyun.SendCloudSmsRequest" do
|
35
|
+
optional :url, :string, 1
|
36
|
+
optional :u, :string, 2
|
37
|
+
optional :p, :string, 3
|
38
|
+
optional :phone, :string, 4
|
39
|
+
optional :content, :string, 5
|
40
|
+
optional :template_id, :string, 6
|
41
|
+
optional :msg_type, :string, 7
|
42
|
+
end
|
43
|
+
add_message "atyun.SendCloudSmsReply" do
|
44
|
+
optional :status, :message, 1, "atyun.NotificationStatus"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
module Atyun
|
49
|
+
AliSmsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.AliSmsRequest").msgclass
|
50
|
+
AliSmsReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.AliSmsReply").msgclass
|
51
|
+
NotificationStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.NotificationStatus").msgclass
|
52
|
+
SendCloudEmailRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.SendCloudEmailRequest").msgclass
|
53
|
+
SendCloudEmailReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.SendCloudEmailReply").msgclass
|
54
|
+
SendCloudSmsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.SendCloudSmsRequest").msgclass
|
55
|
+
SendCloudSmsReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.SendCloudSmsReply").msgclass
|
56
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: notification.proto for package 'atyun'
|
3
|
+
|
4
|
+
require 'grpc'
|
5
|
+
require 'notification_pb'
|
6
|
+
|
7
|
+
module Atyun
|
8
|
+
module Notification
|
9
|
+
# 短信和邮件服务
|
10
|
+
class Service
|
11
|
+
|
12
|
+
include GRPC::GenericService
|
13
|
+
|
14
|
+
self.marshal_class_method = :encode
|
15
|
+
self.unmarshal_class_method = :decode
|
16
|
+
self.service_name = 'atyun.notification'
|
17
|
+
|
18
|
+
# 阿里云短信
|
19
|
+
rpc :SendAliSms, AliSmsRequest, AliSmsReply
|
20
|
+
# sendcloud 短信
|
21
|
+
rpc :SendSendCloudSms, SendCloudSmsRequest, SendCloudSmsReply
|
22
|
+
# sendcloud 邮件
|
23
|
+
rpc :SendSendCloudEmail, SendCloudEmailRequest, SendCloudEmailReply
|
24
|
+
end
|
25
|
+
|
26
|
+
Stub = Service.rpc_stub_class
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
syntax = "proto3";
|
2
|
+
|
3
|
+
option java_multiple_files = true;
|
4
|
+
option java_package = "io.grpc.examples.helloworld";
|
5
|
+
option java_outer_classname = "HelloWorldProto";
|
6
|
+
option objc_class_prefix = "HLW";
|
7
|
+
|
8
|
+
package atyun;
|
9
|
+
|
10
|
+
service alipay {
|
11
|
+
rpc GetAlipayUrl (GetAlipayUrlRequest) returns (GetAlipayReply){
|
12
|
+
}
|
13
|
+
|
14
|
+
rpc CheckSign (CheckSignRequest) returns (CheckSignReply){
|
15
|
+
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
message GetAlipayUrlRequest{
|
20
|
+
string app_id = 1;
|
21
|
+
string app_private_key = 2;
|
22
|
+
string alipay_public_key = 3;
|
23
|
+
string out_trade_no = 4;
|
24
|
+
string total_amount = 5;
|
25
|
+
string subject = 6;
|
26
|
+
string return_url = 7;
|
27
|
+
string notify_url = 8;
|
28
|
+
string qr_pay_mode = 9;
|
29
|
+
string body = 10;
|
30
|
+
}
|
31
|
+
|
32
|
+
message GetAlipayReply{
|
33
|
+
string pay_url = 1;
|
34
|
+
AlipayStatus status = 2;
|
35
|
+
}
|
36
|
+
|
37
|
+
message AlipayStatus {
|
38
|
+
string code = 1;
|
39
|
+
string message = 2;
|
40
|
+
}
|
41
|
+
|
42
|
+
message CheckSignRequest{
|
43
|
+
string params_json = 1;
|
44
|
+
string public_key = 2;
|
45
|
+
}
|
46
|
+
|
47
|
+
message CheckSignReply{
|
48
|
+
string result = 1;
|
49
|
+
AlipayStatus status = 2;
|
50
|
+
}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
syntax = "proto3";
|
2
|
+
|
3
|
+
option java_multiple_files = true;
|
4
|
+
option java_package = "io.grpc.examples.helloworld";
|
5
|
+
option java_outer_classname = "HelloWorldProto";
|
6
|
+
option objc_class_prefix = "HLW";
|
7
|
+
|
8
|
+
package atyun;
|
9
|
+
|
10
|
+
// 短信和邮件服务
|
11
|
+
service notification {
|
12
|
+
|
13
|
+
//阿里云短信
|
14
|
+
rpc SendAliSms (AliSmsRequest) returns (AliSmsReply){
|
15
|
+
}
|
16
|
+
|
17
|
+
//sendcloud 短信
|
18
|
+
rpc SendSendCloudSms (SendCloudSmsRequest) returns (SendCloudSmsReply){
|
19
|
+
|
20
|
+
}
|
21
|
+
|
22
|
+
//sendcloud 邮件
|
23
|
+
rpc SendSendCloudEmail (SendCloudEmailRequest) returns (SendCloudEmailReply) {
|
24
|
+
|
25
|
+
}
|
26
|
+
|
27
|
+
}
|
28
|
+
|
29
|
+
message AliSmsRequest {
|
30
|
+
string access_key_secret = 1;
|
31
|
+
string access_key_id = 2;
|
32
|
+
string sign_name = 3;
|
33
|
+
string phone = 4;
|
34
|
+
string template_code = 5;
|
35
|
+
string content = 6;
|
36
|
+
}
|
37
|
+
|
38
|
+
message AliSmsReply {
|
39
|
+
NotificationStatus status = 1;
|
40
|
+
}
|
41
|
+
|
42
|
+
message NotificationStatus{
|
43
|
+
string code = 1;
|
44
|
+
string message = 2;
|
45
|
+
}
|
46
|
+
|
47
|
+
message SendCloudEmailRequest{
|
48
|
+
string to = 1;
|
49
|
+
string api_user = 2;
|
50
|
+
string api_key = 3;
|
51
|
+
string from = 4;
|
52
|
+
string from_name = 5;
|
53
|
+
string subject = 6;
|
54
|
+
string html = 7;
|
55
|
+
}
|
56
|
+
|
57
|
+
message SendCloudEmailReply{
|
58
|
+
NotificationStatus status = 1;
|
59
|
+
}
|
60
|
+
|
61
|
+
message SendCloudSmsRequest{
|
62
|
+
string url = 1;
|
63
|
+
string u = 2;
|
64
|
+
string p = 3;
|
65
|
+
string phone = 4;
|
66
|
+
string content = 5;
|
67
|
+
string template_id = 6;
|
68
|
+
string msg_type = 7;
|
69
|
+
}
|
70
|
+
|
71
|
+
message SendCloudSmsReply{
|
72
|
+
NotificationStatus status = 1;
|
73
|
+
}
|
@@ -0,0 +1,142 @@
|
|
1
|
+
// Copyright 2015 gRPC authors.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
syntax = "proto3";
|
16
|
+
|
17
|
+
option java_multiple_files = true;
|
18
|
+
option java_package = "io.grpc.examples.helloworld";
|
19
|
+
option java_outer_classname = "HelloWorldProto";
|
20
|
+
option objc_class_prefix = "HLW";
|
21
|
+
|
22
|
+
package atyun;
|
23
|
+
|
24
|
+
// The greeting service definition.
|
25
|
+
service wechat {
|
26
|
+
// Sends a greeting
|
27
|
+
rpc SayHello (HelloRequest) returns (HelloReply) {
|
28
|
+
}
|
29
|
+
|
30
|
+
// get wechat-subscription access_token
|
31
|
+
rpc GetSubscriptionAccessToken (GetAccesstokenRequest) returns (GetAccesstokenReply) {
|
32
|
+
}
|
33
|
+
|
34
|
+
// send wechat-subscription message
|
35
|
+
rpc SendWechatSubscriptionMessage (SendWechatMessageRequest) returns (SendWechatMessageReply) {
|
36
|
+
}
|
37
|
+
|
38
|
+
// wechat oauth
|
39
|
+
rpc WechatOauth (WechatOauthRequest) returns (WechatOauthReply) {
|
40
|
+
}
|
41
|
+
|
42
|
+
// wechat login
|
43
|
+
rpc WechatLogin (WechatLoginRequest) returns (WechatLoginReply) {
|
44
|
+
}
|
45
|
+
|
46
|
+
rpc GetWechatPayCodeUrl (WechatPayRequest) returns (WechatPayReply) {
|
47
|
+
|
48
|
+
}
|
49
|
+
|
50
|
+
}
|
51
|
+
|
52
|
+
// The request message containing the user's name.
|
53
|
+
message HelloRequest {
|
54
|
+
string name = 1;
|
55
|
+
}
|
56
|
+
|
57
|
+
// The response message containing the greetings
|
58
|
+
message HelloReply {
|
59
|
+
Status status = 1;
|
60
|
+
}
|
61
|
+
|
62
|
+
message Status {
|
63
|
+
string message = 1;
|
64
|
+
string code = 2;
|
65
|
+
}
|
66
|
+
|
67
|
+
// appid && secret_key
|
68
|
+
message GetAccesstokenRequest {
|
69
|
+
string app_id = 1;
|
70
|
+
string secret_key = 2;
|
71
|
+
}
|
72
|
+
|
73
|
+
message GetAccesstokenReply {
|
74
|
+
Status status = 1;
|
75
|
+
string access_token = 2;
|
76
|
+
}
|
77
|
+
|
78
|
+
// send message to wechat-subscription users
|
79
|
+
message SendWechatMessageRequest {
|
80
|
+
string template_id = 1;
|
81
|
+
Keyword first = 2;
|
82
|
+
Keyword keyword1 = 3;
|
83
|
+
Keyword keyword2 = 4;
|
84
|
+
Keyword keyword3 = 5;
|
85
|
+
Keyword keyword4 = 6;
|
86
|
+
Keyword remark = 7;
|
87
|
+
string token = 8;
|
88
|
+
string direct_url = 10;
|
89
|
+
string open_id = 11;
|
90
|
+
}
|
91
|
+
|
92
|
+
message SendWechatMessageReply {
|
93
|
+
string errcode = 1;
|
94
|
+
Status status = 2;
|
95
|
+
}
|
96
|
+
|
97
|
+
message Keyword {
|
98
|
+
string value = 1;
|
99
|
+
}
|
100
|
+
|
101
|
+
// WechatOauth
|
102
|
+
|
103
|
+
message WechatOauthRequest {
|
104
|
+
string uri = 1;
|
105
|
+
string origin = 2;
|
106
|
+
string appid = 7;
|
107
|
+
string secret_key = 8;
|
108
|
+
}
|
109
|
+
|
110
|
+
message WechatOauthReply {
|
111
|
+
string sns_url = 1;
|
112
|
+
Status status = 2;
|
113
|
+
}
|
114
|
+
|
115
|
+
message WechatLoginRequest {
|
116
|
+
string appid = 1;
|
117
|
+
string secret_key = 7;
|
118
|
+
string code = 8;
|
119
|
+
}
|
120
|
+
|
121
|
+
message WechatLoginReply {
|
122
|
+
string openid = 1;
|
123
|
+
string image_url = 2;
|
124
|
+
Status status = 3;
|
125
|
+
}
|
126
|
+
|
127
|
+
message WechatPayRequest {
|
128
|
+
string appid = 1;
|
129
|
+
string mch_id = 2;
|
130
|
+
string body = 3;
|
131
|
+
string out_trade_no = 4;
|
132
|
+
string total_fee = 5;
|
133
|
+
string spbill_create_ip = 6;
|
134
|
+
string notify_url = 7;
|
135
|
+
string trade_type = 8;
|
136
|
+
string product_id = 9;
|
137
|
+
string key = 10;
|
138
|
+
}
|
139
|
+
message WechatPayReply {
|
140
|
+
string code_url = 1;
|
141
|
+
Status status = 2;
|
142
|
+
}
|
data/lib/wechat_pb.rb
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: wechat.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_message "atyun.HelloRequest" do
|
8
|
+
optional :name, :string, 1
|
9
|
+
end
|
10
|
+
add_message "atyun.HelloReply" do
|
11
|
+
optional :status, :message, 1, "atyun.Status"
|
12
|
+
end
|
13
|
+
add_message "atyun.Status" do
|
14
|
+
optional :message, :string, 1
|
15
|
+
optional :code, :string, 2
|
16
|
+
end
|
17
|
+
add_message "atyun.GetAccesstokenRequest" do
|
18
|
+
optional :app_id, :string, 1
|
19
|
+
optional :secret_key, :string, 2
|
20
|
+
end
|
21
|
+
add_message "atyun.GetAccesstokenReply" do
|
22
|
+
optional :status, :message, 1, "atyun.Status"
|
23
|
+
optional :access_token, :string, 2
|
24
|
+
end
|
25
|
+
add_message "atyun.SendWechatMessageRequest" do
|
26
|
+
optional :template_id, :string, 1
|
27
|
+
optional :first, :message, 2, "atyun.Keyword"
|
28
|
+
optional :keyword1, :message, 3, "atyun.Keyword"
|
29
|
+
optional :keyword2, :message, 4, "atyun.Keyword"
|
30
|
+
optional :keyword3, :message, 5, "atyun.Keyword"
|
31
|
+
optional :keyword4, :message, 6, "atyun.Keyword"
|
32
|
+
optional :remark, :message, 7, "atyun.Keyword"
|
33
|
+
optional :token, :string, 8
|
34
|
+
optional :direct_url, :string, 10
|
35
|
+
optional :open_id, :string, 11
|
36
|
+
end
|
37
|
+
add_message "atyun.SendWechatMessageReply" do
|
38
|
+
optional :errcode, :string, 1
|
39
|
+
optional :status, :message, 2, "atyun.Status"
|
40
|
+
end
|
41
|
+
add_message "atyun.Keyword" do
|
42
|
+
optional :value, :string, 1
|
43
|
+
end
|
44
|
+
add_message "atyun.WechatOauthRequest" do
|
45
|
+
optional :uri, :string, 1
|
46
|
+
optional :origin, :string, 2
|
47
|
+
optional :appid, :string, 7
|
48
|
+
optional :secret_key, :string, 8
|
49
|
+
end
|
50
|
+
add_message "atyun.WechatOauthReply" do
|
51
|
+
optional :sns_url, :string, 1
|
52
|
+
optional :status, :message, 2, "atyun.Status"
|
53
|
+
end
|
54
|
+
add_message "atyun.WechatLoginRequest" do
|
55
|
+
optional :appid, :string, 1
|
56
|
+
optional :secret_key, :string, 7
|
57
|
+
optional :code, :string, 8
|
58
|
+
end
|
59
|
+
add_message "atyun.WechatLoginReply" do
|
60
|
+
optional :openid, :string, 1
|
61
|
+
optional :image_url, :string, 2
|
62
|
+
optional :status, :message, 3, "atyun.Status"
|
63
|
+
end
|
64
|
+
add_message "atyun.WechatPayRequest" do
|
65
|
+
optional :appid, :string, 1
|
66
|
+
optional :mch_id, :string, 2
|
67
|
+
optional :body, :string, 3
|
68
|
+
optional :out_trade_no, :string, 4
|
69
|
+
optional :total_fee, :string, 5
|
70
|
+
optional :spbill_create_ip, :string, 6
|
71
|
+
optional :notify_url, :string, 7
|
72
|
+
optional :trade_type, :string, 8
|
73
|
+
optional :product_id, :string, 9
|
74
|
+
optional :key, :string, 10
|
75
|
+
end
|
76
|
+
add_message "atyun.WechatPayReply" do
|
77
|
+
optional :code_url, :string, 1
|
78
|
+
optional :status, :message, 2, "atyun.Status"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
module Atyun
|
83
|
+
HelloRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.HelloRequest").msgclass
|
84
|
+
HelloReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.HelloReply").msgclass
|
85
|
+
Status = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.Status").msgclass
|
86
|
+
GetAccesstokenRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.GetAccesstokenRequest").msgclass
|
87
|
+
GetAccesstokenReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.GetAccesstokenReply").msgclass
|
88
|
+
SendWechatMessageRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.SendWechatMessageRequest").msgclass
|
89
|
+
SendWechatMessageReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.SendWechatMessageReply").msgclass
|
90
|
+
Keyword = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.Keyword").msgclass
|
91
|
+
WechatOauthRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.WechatOauthRequest").msgclass
|
92
|
+
WechatOauthReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.WechatOauthReply").msgclass
|
93
|
+
WechatLoginRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.WechatLoginRequest").msgclass
|
94
|
+
WechatLoginReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.WechatLoginReply").msgclass
|
95
|
+
WechatPayRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.WechatPayRequest").msgclass
|
96
|
+
WechatPayReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("atyun.WechatPayReply").msgclass
|
97
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: wechat.proto for package 'atyun'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2015 gRPC authors.
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'grpc'
|
20
|
+
require 'wechat_pb'
|
21
|
+
|
22
|
+
module Atyun
|
23
|
+
module Wechat
|
24
|
+
# The greeting service definition.
|
25
|
+
class Service
|
26
|
+
|
27
|
+
include GRPC::GenericService
|
28
|
+
|
29
|
+
self.marshal_class_method = :encode
|
30
|
+
self.unmarshal_class_method = :decode
|
31
|
+
self.service_name = 'atyun.wechat'
|
32
|
+
|
33
|
+
# Sends a greeting
|
34
|
+
rpc :SayHello, HelloRequest, HelloReply
|
35
|
+
# get wechat-subscription access_token
|
36
|
+
rpc :GetSubscriptionAccessToken, GetAccesstokenRequest, GetAccesstokenReply
|
37
|
+
# send wechat-subscription message
|
38
|
+
rpc :SendWechatSubscriptionMessage, SendWechatMessageRequest, SendWechatMessageReply
|
39
|
+
# wechat oauth
|
40
|
+
rpc :WechatOauth, WechatOauthRequest, WechatOauthReply
|
41
|
+
# wechat login
|
42
|
+
rpc :WechatLogin, WechatLoginRequest, WechatLoginReply
|
43
|
+
rpc :GetWechatPayCodeUrl, WechatPayRequest, WechatPayReply
|
44
|
+
end
|
45
|
+
|
46
|
+
Stub = Service.rpc_stub_class
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "wechat/protocal/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "atyun-protocal"
|
7
|
+
spec.version = Wechat::Protocal::VERSION
|
8
|
+
spec.authors = ["icepoint0"]
|
9
|
+
spec.email = ["351711778@qq.com"]
|
10
|
+
|
11
|
+
spec.summary ="a"
|
12
|
+
spec.description ="a"
|
13
|
+
spec.homepage = "https://repo.scm.atyun.com.cn/atyun-mosp/wechat-protocal"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: atyun-protocal
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.6
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- icepoint0
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-07-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: a
|
56
|
+
email:
|
57
|
+
- 351711778@qq.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
|
+
- CODE_OF_CONDUCT.md
|
66
|
+
- Gemfile
|
67
|
+
- LICENSE.txt
|
68
|
+
- README.md
|
69
|
+
- Rakefile
|
70
|
+
- ampedxx-wechat-protocal-0.1.5.gem
|
71
|
+
- bin/console
|
72
|
+
- bin/setup
|
73
|
+
- lib/alipay_pb.rb
|
74
|
+
- lib/alipay_services_pb.rb
|
75
|
+
- lib/notification_pb.rb
|
76
|
+
- lib/notification_services_pb.rb
|
77
|
+
- lib/protocals/alipay.proto
|
78
|
+
- lib/protocals/notification.proto
|
79
|
+
- lib/protocals/wechat.proto
|
80
|
+
- lib/wechat/protocal.rb
|
81
|
+
- lib/wechat/protocal/version.rb
|
82
|
+
- lib/wechat_pb.rb
|
83
|
+
- lib/wechat_services_pb.rb
|
84
|
+
- wechat-protocal.gemspec
|
85
|
+
homepage: https://repo.scm.atyun.com.cn/atyun-mosp/wechat-protocal
|
86
|
+
licenses:
|
87
|
+
- MIT
|
88
|
+
metadata: {}
|
89
|
+
post_install_message:
|
90
|
+
rdoc_options: []
|
91
|
+
require_paths:
|
92
|
+
- lib
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
requirements: []
|
104
|
+
rubyforge_project:
|
105
|
+
rubygems_version: 2.6.12
|
106
|
+
signing_key:
|
107
|
+
specification_version: 4
|
108
|
+
summary: a
|
109
|
+
test_files: []
|