rails_wechat 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +20 -165
- data/README.md +28 -20
- data/app/apis/wechat/access_token_expired_error.rb +3 -0
- data/app/apis/wechat/api/base/datacube.rb +14 -0
- data/app/apis/wechat/api/base/sns.rb +36 -0
- data/app/apis/wechat/api/base.rb +40 -0
- data/app/apis/wechat/api/platform/component.rb +54 -0
- data/app/apis/wechat/api/platform.rb +15 -0
- data/app/apis/wechat/api/program/wxa.rb +21 -0
- data/app/apis/wechat/api/program/wxaapi.rb +31 -0
- data/app/apis/wechat/api/program.rb +11 -0
- data/app/apis/wechat/api/public/base.rb +73 -0
- data/app/apis/wechat/api/public/material.rb +54 -0
- data/app/apis/wechat/api/public/menu.rb +43 -0
- data/app/apis/wechat/api/public/mp.rb +11 -0
- data/app/apis/wechat/api/public/user.rb +73 -0
- data/app/apis/wechat/api/public.rb +12 -0
- data/app/apis/wechat/api/work/agent.rb +26 -0
- data/app/apis/wechat/api/work/menu.rb +47 -0
- data/app/apis/wechat/api/work/user.rb +116 -0
- data/app/apis/wechat/api/work.rb +14 -0
- data/app/apis/wechat/api.rb +7 -0
- data/app/apis/wechat/app_not_found.rb +3 -0
- data/app/apis/wechat/cipher.rb +82 -0
- data/app/apis/wechat/http_client.rb +80 -0
- data/app/apis/wechat/invalid_credential_error.rb +3 -0
- data/app/apis/wechat/message/base.rb +17 -0
- data/app/apis/wechat/message/mass/public.rb +40 -0
- data/app/apis/wechat/message/mass/work.rb +84 -0
- data/app/apis/wechat/message/mass.rb +22 -0
- data/app/apis/wechat/message.rb +7 -0
- data/app/apis/wechat/response_error.rb +10 -0
- data/app/apis/wechat/signature.rb +32 -0
- data/app/apis/wechat/wechat_error.rb +3 -0
- data/app/controllers/wechat/admin/accounts_controller.rb +25 -0
- data/app/controllers/wechat/admin/apps_controller.rb +66 -0
- data/app/controllers/wechat/admin/base_controller.rb +7 -1
- data/app/controllers/wechat/admin/extractors_controller.rb +49 -0
- data/app/controllers/wechat/admin/menus_controller.rb +69 -0
- data/app/controllers/wechat/admin/news_reply_items_controller.rb +16 -0
- data/app/controllers/wechat/admin/notices_controller.rb +40 -0
- data/app/controllers/wechat/admin/registers_controller.rb +82 -0
- data/app/controllers/wechat/admin/replies_controller.rb +55 -0
- data/app/controllers/wechat/admin/requests_controller.rb +23 -0
- data/app/controllers/wechat/admin/responses_controller.rb +66 -0
- data/app/controllers/wechat/admin/tags_controller.rb +43 -0
- data/app/controllers/wechat/admin/templates_controller.rb +48 -0
- data/app/controllers/wechat/admin/wechat_users_controller.rb +31 -0
- data/app/controllers/wechat/apps_controller.rb +62 -0
- data/app/controllers/wechat/base_controller.rb +5 -0
- data/app/controllers/wechat/controller/application.rb +78 -0
- data/app/controllers/wechat/my/base_controller.rb +4 -0
- data/app/controllers/wechat/my/medias_controller.rb +56 -0
- data/app/controllers/wechat/my/registers_controller.rb +74 -0
- data/app/controllers/wechat/my/subscribes_controller.rb +18 -0
- data/app/controllers/wechat/my/users_controller.rb +18 -0
- data/app/controllers/wechat/my/wechat_users_controller.rb +37 -0
- data/app/controllers/wechat/panel/agencies_controller.rb +26 -0
- data/app/controllers/wechat/panel/apps_controller.rb +50 -0
- data/app/controllers/wechat/panel/base_controller.rb +3 -2
- data/app/controllers/wechat/panel/menus_controller.rb +60 -0
- data/app/controllers/wechat/panel/platforms_controller.rb +38 -0
- data/app/controllers/wechat/panel/template_configs_controller.rb +39 -0
- data/app/controllers/wechat/platforms_controller.rb +60 -0
- data/app/controllers/wechat/program_users_controller.rb +86 -0
- data/app/controllers/wechat/share/apps_controller.rb +21 -0
- data/app/controllers/wechat/share/base_controller.rb +10 -0
- data/app/controllers/wechat/share/menus_controller.rb +93 -0
- data/app/controllers/wechat/share/scenes_controller.rb +62 -0
- data/app/controllers/wechat/share/wechat_users_controller.rb +57 -0
- data/app/controllers/wechat/wechat_controller.rb +39 -0
- data/app/controllers/wechat/wechats_controller.rb +41 -19
- data/app/jobs/wechat/agency_job.rb +9 -0
- data/app/jobs/wechat/annunciate_job.rb +10 -0
- data/app/jobs/wechat/file_reply_upload_job.rb +10 -0
- data/app/jobs/wechat/media_job.rb +10 -0
- data/app/jobs/wechat/notice_send_job.rb +10 -0
- data/app/jobs/wechat/qrcode_job.rb +10 -0
- data/app/jobs/wechat/tag_job.rb +10 -0
- data/app/jobs/wechat/user_info_job.rb +11 -0
- data/app/jobs/wechat/user_job.rb +11 -0
- data/app/jobs/wechat/user_tag_job.rb +11 -0
- data/app/jobs/wechat/user_tag_remove_job.rb +11 -0
- data/app/mailboxes/application_mailbox.rb +3 -0
- data/app/mailboxes/wechat_mailbox.rb +17 -0
- data/app/models/app/wechat/mobile_app.rb +5 -0
- data/app/models/app/wechat/program_app.rb +5 -0
- data/app/models/app/wechat/public_app.rb +5 -0
- data/app/models/app/wechat/read_app.rb +5 -0
- data/app/models/app/wechat/work_app.rb +5 -0
- data/app/models/menu/wechat/click_menu.rb +5 -0
- data/app/models/menu/wechat/mini_program_menu.rb +5 -0
- data/app/models/menu/wechat/parent_menu.rb +5 -0
- data/app/models/menu/wechat/scan_push_menu.rb +5 -0
- data/app/models/menu/wechat/scan_wait_menu.rb +5 -0
- data/app/models/menu/wechat/view_menu.rb +5 -0
- data/app/models/notice/wechat/program_notice.rb +5 -0
- data/app/models/notice/wechat/public_notice.rb +5 -0
- data/app/models/oauth_user/wechat/program_user.rb +5 -0
- data/app/models/oauth_user/wechat/wechat_user.rb +5 -0
- data/app/models/reply/wechat/image_reply.rb +5 -0
- data/app/models/reply/wechat/music_reply.rb +5 -0
- data/app/models/reply/wechat/news_reply.rb +5 -0
- data/app/models/reply/wechat/success_reply.rb +5 -0
- data/app/models/reply/wechat/text_reply.rb +5 -0
- data/app/models/reply/wechat/video_reply.rb +5 -0
- data/app/models/reply/wechat/voice_reply.rb +5 -0
- data/app/models/request/wechat/click_request.rb +5 -0
- data/app/models/request/wechat/image_request.rb +5 -0
- data/app/models/request/wechat/link_request.rb +5 -0
- data/app/models/request/wechat/location_request.rb +5 -0
- data/app/models/request/wechat/scan_request.rb +5 -0
- data/app/models/request/wechat/short_video_request.rb +4 -0
- data/app/models/request/wechat/subscribe_request.rb +5 -0
- data/app/models/request/wechat/text_request.rb +5 -0
- data/app/models/request/wechat/unsubscribe_request.rb +5 -0
- data/app/models/request/wechat/video_request.rb +5 -0
- data/app/models/request/wechat/view_request.rb +5 -0
- data/app/models/request/wechat/voice_request.rb +5 -0
- data/app/models/service/wechat/image_service.rb +5 -0
- data/app/models/service/wechat/mpnews_service.rb +5 -0
- data/app/models/service/wechat/msgmenu_service.rb +5 -0
- data/app/models/service/wechat/news_service.rb +5 -0
- data/app/models/service/wechat/text_service.rb +5 -0
- data/app/models/service/wechat/video_service.rb +5 -0
- data/app/models/service/wechat/voice_service.rb +5 -0
- data/app/models/template_config/wechat/template_program.rb +5 -0
- data/app/models/template_config/wechat/template_public.rb +5 -0
- data/app/models/wechat/agency.rb +6 -0
- data/app/models/wechat/app.rb +6 -0
- data/app/models/wechat/application_record.rb +5 -0
- data/app/models/wechat/auth.rb +5 -0
- data/app/models/wechat/ext/effective.rb +10 -0
- data/app/models/wechat/ext/organ.rb +14 -0
- data/app/models/wechat/ext/subscribed.rb +14 -0
- data/app/models/wechat/ext/user.rb +21 -0
- data/app/models/wechat/ext/user_tag.rb +38 -0
- data/app/models/wechat/extraction.rb +5 -0
- data/app/models/wechat/extractor.rb +5 -0
- data/app/models/wechat/hook.rb +5 -0
- data/app/models/wechat/media.rb +5 -0
- data/app/models/wechat/menu.rb +5 -0
- data/app/models/wechat/model/account.rb +23 -0
- data/app/models/wechat/model/agency.rb +70 -0
- data/app/models/wechat/model/annunciate.rb +32 -0
- data/app/models/wechat/model/app/mobile_app.rb +11 -0
- data/app/models/wechat/model/app/program_app.rb +18 -0
- data/app/models/wechat/model/app/public_app.rb +46 -0
- data/app/models/wechat/model/app/read_app.rb +24 -0
- data/app/models/wechat/model/app/work_app.rb +33 -0
- data/app/models/wechat/model/app.rb +198 -0
- data/app/models/wechat/model/app_sync.rb +35 -0
- data/app/models/wechat/model/auth.rb +35 -0
- data/app/models/wechat/model/extraction.rb +21 -0
- data/app/models/wechat/model/extractor.rb +77 -0
- data/app/models/wechat/model/hook.rb +13 -0
- data/app/models/wechat/model/media.rb +33 -0
- data/app/models/wechat/model/menu/click_menu.rb +18 -0
- data/app/models/wechat/model/menu/mini_program_menu.rb +20 -0
- data/app/models/wechat/model/menu/parent_menu.rb +17 -0
- data/app/models/wechat/model/menu/scan_push_menu.rb +18 -0
- data/app/models/wechat/model/menu/scan_wait_menu.rb +18 -0
- data/app/models/wechat/model/menu/view_menu.rb +37 -0
- data/app/models/wechat/model/menu.rb +28 -0
- data/app/models/wechat/model/news_reply_item.rb +29 -0
- data/app/models/wechat/model/notice/program_notice.rb +19 -0
- data/app/models/wechat/model/notice/public_notice.rb +25 -0
- data/app/models/wechat/model/notice.rb +56 -0
- data/app/models/wechat/model/oauth_user/program_user.rb +29 -0
- data/app/models/wechat/model/oauth_user/wechat_user.rb +109 -0
- data/app/models/wechat/model/platform.rb +87 -0
- data/app/models/wechat/model/post.rb +34 -0
- data/app/models/wechat/model/receive.rb +120 -0
- data/app/models/wechat/model/register.rb +137 -0
- data/app/models/wechat/model/reply/image_reply.rb +41 -0
- data/app/models/wechat/model/reply/music_reply.rb +20 -0
- data/app/models/wechat/model/reply/news_reply.rb +24 -0
- data/app/models/wechat/model/reply/success_reply.rb +9 -0
- data/app/models/wechat/model/reply/text_reply.rb +14 -0
- data/app/models/wechat/model/reply/video_reply.rb +20 -0
- data/app/models/wechat/model/reply/voice_reply.rb +16 -0
- data/app/models/wechat/model/reply.rb +39 -0
- data/app/models/wechat/model/request/click_request.rb +25 -0
- data/app/models/wechat/model/request/image_request.rb +9 -0
- data/app/models/wechat/model/request/link_request.rb +9 -0
- data/app/models/wechat/model/request/location_request.rb +9 -0
- data/app/models/wechat/model/request/scan_request.rb +17 -0
- data/app/models/wechat/model/request/subscribe_request.rb +10 -0
- data/app/models/wechat/model/request/text_request.rb +20 -0
- data/app/models/wechat/model/request/unsubscribe_request.rb +4 -0
- data/app/models/wechat/model/request/video_request.rb +9 -0
- data/app/models/wechat/model/request/view_request.rb +4 -0
- data/app/models/wechat/model/request/voice_request.rb +9 -0
- data/app/models/wechat/model/request.rb +168 -0
- data/app/models/wechat/model/response.rb +41 -0
- data/app/models/wechat/model/scene.rb +101 -0
- data/app/models/wechat/model/scene_menu.rb +12 -0
- data/app/models/wechat/model/service/image_service.rb +18 -0
- data/app/models/wechat/model/service/mpnews_service.rb +10 -0
- data/app/models/wechat/model/service/msgmenu_service.rb +10 -0
- data/app/models/wechat/model/service/news_service.rb +10 -0
- data/app/models/wechat/model/service/text_service.rb +18 -0
- data/app/models/wechat/model/service/video_service.rb +10 -0
- data/app/models/wechat/model/service/voice_service.rb +10 -0
- data/app/models/wechat/model/service.rb +42 -0
- data/app/models/wechat/model/subscribe.rb +20 -0
- data/app/models/wechat/model/tag.rb +56 -0
- data/app/models/wechat/model/template.rb +82 -0
- data/app/models/wechat/model/template_config/template_program.rb +31 -0
- data/app/models/wechat/model/template_config/template_public.rb +37 -0
- data/app/models/wechat/model/template_config.rb +44 -0
- data/app/models/wechat/model/template_key_word.rb +20 -0
- data/app/models/wechat/model/ticket.rb +28 -0
- data/app/models/wechat/model/user_tag.rb +42 -0
- data/app/models/wechat/model/user_tagged.rb +22 -0
- data/app/models/wechat/model/wechat_message_tag.rb +11 -0
- data/app/models/wechat/news_reply_item.rb +5 -0
- data/app/models/wechat/notice.rb +5 -0
- data/app/models/wechat/platform.rb +5 -0
- data/app/models/wechat/receive.rb +5 -0
- data/app/models/wechat/reply.rb +5 -0
- data/app/models/wechat/request.rb +5 -0
- data/app/models/wechat/response.rb +5 -0
- data/app/models/wechat/scene.rb +5 -0
- data/app/models/wechat/scene_menu.rb +5 -0
- data/app/models/wechat/service.rb +5 -0
- data/app/models/wechat/subscribe.rb +5 -0
- data/app/models/wechat/tag.rb +5 -0
- data/app/models/wechat/template.rb +5 -0
- data/app/models/wechat/template_config.rb +5 -0
- data/app/models/wechat/template_key_word.rb +5 -0
- data/app/models/wechat/ticket.rb +5 -0
- data/app/models/wechat/user_tag.rb +5 -0
- data/app/models/wechat.rb +11 -0
- data/app/views/admin/_wechat_nav.html.erb +11 -0
- data/app/views/application/wechat_require_login.json.jbuilder +2 -0
- data/app/views/my/_wechat_nav.html+phone.erb +10 -0
- data/app/views/my/_wechat_nav.html.erb +4 -0
- data/app/views/panel/_wechat_nav.html.erb +13 -0
- data/app/{assets/config/rails_wechat_manifest.js → views/wechat/admin/accounts/qrcode.json.jbuilder} +0 -0
- data/app/views/wechat/admin/accounts/qrcode.turbo_stream.erb +3 -0
- data/app/views/wechat/admin/apps/_cert_form.html.erb +4 -0
- data/app/views/wechat/admin/apps/_edit_form.html.erb +4 -0
- data/app/views/wechat/admin/apps/_filter_form.html.erb +9 -0
- data/app/views/wechat/admin/apps/_form.html.erb +6 -0
- data/app/views/wechat/admin/apps/_index_tbody.html.erb +61 -0
- data/app/views/wechat/admin/apps/_index_thead.html.erb +7 -0
- data/app/views/wechat/admin/apps/_index_tr.html.erb +22 -0
- data/app/views/wechat/admin/apps/_info.html.erb +20 -0
- data/app/views/wechat/admin/apps/_new_form.html.erb +4 -0
- data/app/views/wechat/admin/apps/_pay_form.html.erb +7 -0
- data/app/views/wechat/admin/apps/_qy_form.html.erb +4 -0
- data/app/views/wechat/admin/apps/_show.json.jbuilder +1 -0
- data/app/views/wechat/admin/apps/_show_table.html.erb +36 -0
- data/app/views/wechat/admin/apps/_wechat_app.json.jbuilder +18 -0
- data/app/views/wechat/admin/apps/edit_cert.html.erb +3 -0
- data/app/views/wechat/admin/apps/index.html.erb +5 -0
- data/app/views/wechat/admin/apps/index.json.jbuilder +1 -0
- data/app/views/wechat/admin/apps/info.html.erb +3 -0
- data/app/views/wechat/admin/base/_nav.html.erb +3 -0
- data/app/views/wechat/admin/base/_wechat_nav_user.html.erb +18 -0
- data/app/views/wechat/admin/extractors/_breadcrumb.html.erb +8 -0
- data/app/views/wechat/admin/extractors/_edit_form.html.erb +4 -0
- data/app/views/wechat/admin/extractors/_filter_form.html.erb +9 -0
- data/app/views/wechat/admin/extractors/_form.html.erb +21 -0
- data/app/views/wechat/admin/extractors/_index_tbody.html.erb +24 -0
- data/app/views/wechat/admin/extractors/_index_thead.html.erb +17 -0
- data/app/views/wechat/admin/extractors/_new_form.html.erb +4 -0
- data/app/views/wechat/admin/extractors/_show_table.html.erb +32 -0
- data/app/views/wechat/admin/extractors/index.html.erb +5 -0
- data/app/views/wechat/admin/menus/_breadcrumb.html.erb +9 -0
- data/app/views/wechat/admin/menus/_button.html.erb +9 -0
- data/app/views/wechat/admin/menus/_edit_form.html.erb +6 -0
- data/app/views/wechat/admin/menus/_edit_parent_form.html.erb +5 -0
- data/app/views/wechat/admin/menus/_filter_form.html.erb +8 -0
- data/app/views/wechat/admin/menus/_form.html.erb +7 -0
- data/app/views/wechat/admin/menus/_index_tbody.html.erb +16 -0
- data/app/views/wechat/admin/menus/_index_thead.html.erb +9 -0
- data/app/views/wechat/admin/menus/_index_tr.html.erb +24 -0
- data/app/views/wechat/admin/menus/_new_form.html.erb +6 -0
- data/app/views/wechat/admin/menus/_new_parent_form.html.erb +7 -0
- data/app/views/wechat/admin/menus/_show_table.html.erb +20 -0
- data/app/views/wechat/admin/menus/edit_parent.html.erb +3 -0
- data/app/views/wechat/admin/menus/index.html.erb +4 -0
- data/app/views/wechat/admin/menus/new_parent.html.erb +3 -0
- data/app/views/wechat/admin/menus/sync.turbo_stream.erb +3 -0
- data/app/views/wechat/admin/notices/_edit_form.html.erb +7 -0
- data/app/views/wechat/admin/notices/_filter_form.html.erb +9 -0
- data/app/views/wechat/admin/notices/_form.html.erb +3 -0
- data/app/views/wechat/admin/notices/_index_tbody.erb +3 -0
- data/app/views/wechat/admin/notices/_index_thead.html.erb +3 -0
- data/app/views/wechat/admin/notices/_new_form.html.erb +5 -0
- data/app/views/wechat/admin/notices/_show_table.html.erb +8 -0
- data/app/views/wechat/admin/notices/index.html.erb +5 -0
- data/app/views/wechat/admin/registers/_app_form.html.erb +5 -0
- data/app/views/wechat/admin/registers/_assign_form.html.erb +6 -0
- data/app/views/wechat/admin/registers/_bind_form.html.erb +5 -0
- data/app/views/wechat/admin/registers/_button.html.erb +3 -0
- data/app/views/wechat/admin/registers/_edit_form.html.erb +4 -0
- data/app/views/wechat/admin/registers/_filter_form.html.erb +10 -0
- data/app/views/wechat/admin/registers/_form.html.erb +5 -0
- data/app/views/wechat/admin/registers/_index_tbody.html.erb +37 -0
- data/app/views/wechat/admin/registers/_index_thead.html.erb +23 -0
- data/app/views/wechat/admin/registers/_index_tr.html.erb +25 -0
- data/app/views/wechat/admin/registers/_new_form.html.erb +4 -0
- data/app/views/wechat/admin/registers/_qrcode_form.html.erb +5 -0
- data/app/views/wechat/admin/registers/_show_table.html.erb +32 -0
- data/app/views/wechat/admin/registers/edit_app.turbo_stream.erb +3 -0
- data/app/views/wechat/admin/registers/edit_assign.turbo_stream.erb +3 -0
- data/app/views/wechat/admin/registers/edit_bind.turbo_stream.erb +3 -0
- data/app/views/wechat/admin/registers/edit_qrcode.turbo_stream.erb +3 -0
- data/app/views/wechat/admin/registers/index.html.erb +5 -0
- data/app/views/wechat/admin/replies/_breadcrumb.html.erb +7 -0
- data/app/views/wechat/admin/replies/_edit_form.html.erb +4 -0
- data/app/views/wechat/admin/replies/_filter_form.html.erb +9 -0
- data/app/views/wechat/admin/replies/_filter_table.html.erb +11 -0
- data/app/views/wechat/admin/replies/_form.html.erb +3 -0
- data/app/views/wechat/admin/replies/_image_form.html.erb +1 -0
- data/app/views/wechat/admin/replies/_index_tbody.html.erb +29 -0
- data/app/views/wechat/admin/replies/_index_thead.html.erb +3 -0
- data/app/views/wechat/admin/replies/_new_form.html.erb +4 -0
- data/app/views/wechat/admin/replies/_news_form.html.erb +6 -0
- data/app/views/wechat/admin/replies/_show_table.html.erb +12 -0
- data/app/views/wechat/admin/replies/_text_form.html.erb +1 -0
- data/app/views/wechat/admin/replies/add.html.erb +11 -0
- data/app/views/wechat/admin/replies/build.turbo_stream.erb +7 -0
- data/app/views/wechat/admin/replies/index.html.erb +5 -0
- data/app/views/wechat/admin/replies/index.js +12 -0
- data/app/views/wechat/admin/requests/_breadcrumb.html.erb +7 -0
- data/app/views/wechat/admin/requests/_button.html.erb +3 -0
- data/app/views/wechat/admin/requests/_filter_form.html.erb +10 -0
- data/app/views/wechat/admin/requests/_filter_table.html.erb +11 -0
- data/app/views/wechat/admin/requests/_index_tbody.html.erb +21 -0
- data/app/views/wechat/admin/requests/_index_thead.html.erb +6 -0
- data/app/views/wechat/admin/requests/_index_tr.html.erb +13 -0
- data/app/views/wechat/admin/requests/_show_table.html.erb +18 -0
- data/app/views/wechat/admin/requests/index.html.erb +5 -0
- data/app/views/wechat/admin/responses/_breadcrumb.html.erb +7 -0
- data/app/views/wechat/admin/responses/_edit_form.html.erb +4 -0
- data/app/views/wechat/admin/responses/_filter_form.html.erb +9 -0
- data/app/views/wechat/admin/responses/_filter_table.html.erb +11 -0
- data/app/views/wechat/admin/responses/_form.html.erb +4 -0
- data/app/views/wechat/admin/responses/_index_tbody.html.erb +27 -0
- data/app/views/wechat/admin/responses/_index_thead.html.erb +14 -0
- data/app/views/wechat/admin/responses/_index_tr.html.erb +19 -0
- data/app/views/wechat/admin/responses/_new_form.html.erb +4 -0
- data/app/views/wechat/admin/responses/_reply_body.html.erb +4 -0
- data/app/views/wechat/admin/responses/_reply_form.html.erb +5 -0
- data/app/views/wechat/admin/responses/_show/_breadcrumb.html.erb +8 -0
- data/app/views/wechat/admin/responses/_show_table.html.erb +35 -0
- data/app/views/wechat/admin/responses/edit_reply.html.erb +3 -0
- data/app/views/wechat/admin/responses/filter_reply.turbo_stream.erb +1 -0
- data/app/views/wechat/admin/responses/index.html.erb +5 -0
- data/app/views/wechat/admin/responses/show.html.erb +4 -0
- data/app/views/wechat/admin/tags/_button.html.erb +6 -0
- data/app/views/wechat/admin/tags/_edit_form.html.erb +4 -0
- data/app/views/wechat/admin/tags/_filter_form.html.erb +9 -0
- data/app/views/wechat/admin/tags/_form.html.erb +2 -0
- data/app/views/wechat/admin/tags/_index_tbody.html.erb +4 -0
- data/app/views/wechat/admin/tags/_index_thead.html.erb +5 -0
- data/app/views/wechat/admin/tags/_index_tr.html.erb +16 -0
- data/app/views/wechat/admin/tags/_new_form.html.erb +4 -0
- data/app/views/wechat/admin/tags/_show_table.html.erb +12 -0
- data/app/views/wechat/admin/tags/index.html.erb +6 -0
- data/app/views/wechat/admin/tags/sync.turbo_stream.erb +3 -0
- data/app/views/wechat/admin/templates/_breadcrumb.html.erb +7 -0
- data/app/views/wechat/admin/templates/_button.html.erb +5 -0
- data/app/views/wechat/admin/templates/_edit_form.html.erb +4 -0
- data/app/views/wechat/admin/templates/_filter_form.html.erb +9 -0
- data/app/views/wechat/admin/templates/_form.html.erb +6 -0
- data/app/views/wechat/admin/templates/_index_tbody.html.erb +13 -0
- data/app/views/wechat/admin/templates/_index_template_config.html.erb +16 -0
- data/app/views/wechat/admin/templates/_index_thead.html.erb +9 -0
- data/app/views/wechat/admin/templates/_new_form.html.erb +4 -0
- data/app/views/wechat/admin/templates/_show_table.html.erb +20 -0
- data/app/views/wechat/admin/templates/index.html.erb +5 -0
- data/app/views/wechat/admin/wechat_users/_edit_form.html.erb +5 -0
- data/app/views/wechat/admin/wechat_users/_filter_form.html.erb +9 -0
- data/app/views/wechat/admin/wechat_users/_index_tbody.html.erb +16 -0
- data/app/views/wechat/admin/wechat_users/_index_thead.html.erb +13 -0
- data/app/views/wechat/admin/wechat_users/_show_table.html.erb +20 -0
- data/app/views/wechat/admin/wechat_users/index.html.erb +7 -0
- data/app/views/wechat/apps/login.html.erb +1 -0
- data/app/views/wechat/my/medias/_edit_form.html.erb +4 -0
- data/app/views/wechat/my/medias/_filter_form.html.erb +9 -0
- data/app/views/wechat/my/medias/_form.html.erb +6 -0
- data/app/views/wechat/my/medias/_index_tbody.html.erb +5 -0
- data/app/views/wechat/my/medias/_index_thead.html.erb +6 -0
- data/app/views/wechat/my/medias/_new_form.html.erb +4 -0
- data/app/views/wechat/my/medias/_show_table.html.erb +20 -0
- data/app/views/wechat/my/medias/create.turbo_stream.erb +0 -0
- data/app/views/wechat/my/medias/index.html.erb +5 -0
- data/app/views/wechat/my/registers/_edit_form.html.erb +4 -0
- data/app/views/wechat/my/registers/_filter_form.html.erb +9 -0
- data/app/views/wechat/my/registers/_form.html+phone.erb +11 -0
- data/app/views/wechat/my/registers/_form.html.erb +4 -0
- data/app/views/wechat/my/registers/_new_form.html+phone.erb +4 -0
- data/app/views/wechat/my/registers/_new_form.html.erb +4 -0
- data/app/views/wechat/my/registers/_show_table.html.erb +8 -0
- data/app/views/wechat/my/registers/_wechat_register.html.erb +32 -0
- data/app/views/wechat/my/registers/_wechat_register_done.html.erb +29 -0
- data/app/views/wechat/my/registers/edit_code.html.erb +12 -0
- data/app/views/wechat/my/registers/index.html+phone.erb +16 -0
- data/app/views/wechat/my/registers/index.html.erb +36 -0
- data/app/views/wechat/my/registers/new.html.erb +1 -0
- data/app/views/wechat/my/subscribes/_filter_form.html.erb +7 -0
- data/app/views/wechat/my/subscribes/_form.html.erb +7 -0
- data/app/views/wechat/my/subscribes/_show_table.html.erb +12 -0
- data/app/views/wechat/my/subscribes/index.html.erb +40 -0
- data/app/views/wechat/my/users/invite_qrcode.html+phone.erb +35 -0
- data/app/views/wechat/my/users/invite_qrcode.html.erb +6 -0
- data/app/views/wechat/my/users/requests.html+phone.erb +53 -0
- data/app/views/wechat/panel/agencies/_breadcrumb.html.erb +6 -0
- data/app/views/wechat/panel/agencies/_button.html.erb +0 -0
- data/app/views/wechat/panel/agencies/_edit_form.html.erb +4 -0
- data/app/views/wechat/panel/agencies/_filter_form.html.erb +9 -0
- data/app/views/wechat/panel/agencies/_form.html.erb +6 -0
- data/app/views/wechat/panel/agencies/_index_tbody.html.erb +17 -0
- data/app/views/wechat/panel/agencies/_index_thead.html.erb +15 -0
- data/app/views/wechat/panel/agencies/_show_table.html.erb +20 -0
- data/app/views/wechat/panel/agencies/index.html.erb +5 -0
- data/app/views/wechat/panel/apps/_edit_form.html.erb +4 -0
- data/app/views/wechat/panel/apps/_filter_form.html.erb +9 -0
- data/app/views/wechat/panel/apps/_form.html.erb +17 -0
- data/app/views/wechat/panel/apps/_index_tbody.html.erb +52 -0
- data/app/views/wechat/panel/apps/_index_thead.html.erb +6 -0
- data/app/views/wechat/panel/apps/_index_tr.html.erb +16 -0
- data/app/views/wechat/panel/apps/_new_form.html.erb +4 -0
- data/app/views/wechat/panel/apps/_show.json.jbuilder +1 -0
- data/app/views/wechat/panel/apps/_show_table.html.erb +36 -0
- data/app/views/wechat/panel/apps/_wechat_app.json.jbuilder +18 -0
- data/app/views/wechat/panel/apps/edit_cert.html.erb +3 -0
- data/app/views/wechat/panel/apps/index.html.erb +5 -0
- data/app/views/wechat/panel/apps/index.json.jbuilder +1 -0
- data/app/views/wechat/panel/base/_nav.html.erb +3 -0
- data/app/views/wechat/panel/menus/_breadcrumb.html.erb +5 -0
- data/app/views/wechat/panel/menus/_button.html.erb +6 -0
- data/app/views/wechat/panel/menus/_edit_form.html.erb +6 -0
- data/app/views/wechat/panel/menus/_edit_parent_form.html.erb +5 -0
- data/app/views/wechat/panel/menus/_filter_form.html.erb +8 -0
- data/app/views/wechat/panel/menus/_form.html.erb +7 -0
- data/app/views/wechat/panel/menus/_index_tbody.html.erb +15 -0
- data/app/views/wechat/panel/menus/_index_thead.html.erb +8 -0
- data/app/views/wechat/panel/menus/_index_tr.html.erb +22 -0
- data/app/views/wechat/panel/menus/_new_form.html.erb +5 -0
- data/app/views/wechat/panel/menus/_new_parent_form.html.erb +7 -0
- data/app/views/wechat/panel/menus/_show_table.html.erb +20 -0
- data/app/views/wechat/panel/menus/edit_parent.turbo_stream.erb +1 -0
- data/app/views/wechat/panel/menus/index.html.erb +5 -0
- data/app/views/wechat/panel/menus/new_parent.html.erb +3 -0
- data/app/views/wechat/panel/platforms/_edit_form.html.erb +4 -0
- data/app/views/wechat/panel/platforms/_filter_form.html.erb +9 -0
- data/app/views/wechat/panel/platforms/_form.html.erb +7 -0
- data/app/views/wechat/panel/platforms/_index_tbody.html.erb +12 -0
- data/app/views/wechat/panel/platforms/_index_thead.html.erb +13 -0
- data/app/views/wechat/panel/platforms/_index_tr.html.erb +22 -0
- data/app/views/wechat/panel/platforms/_new_form.html.erb +4 -0
- data/app/views/wechat/panel/platforms/_show_table.html.erb +32 -0
- data/app/views/wechat/panel/platforms/index.html.erb +5 -0
- data/app/views/wechat/panel/template_configs/_edit_form.html.erb +10 -0
- data/app/views/wechat/panel/template_configs/_filter.html.erb +9 -0
- data/app/views/wechat/panel/template_configs/_index_tbody.html.erb +10 -0
- data/app/views/wechat/panel/template_configs/_index_thead.html.erb +11 -0
- data/app/views/wechat/panel/template_configs/_item_form.html.erb +6 -0
- data/app/views/wechat/panel/template_configs/_new_form.html.erb +7 -0
- data/app/views/wechat/panel/template_configs/_show_table.html.erb +28 -0
- data/app/views/wechat/panel/template_configs/index.html.erb +5 -0
- data/app/views/wechat/platforms/callback.html.erb +0 -0
- data/app/views/wechat/program_users/mobile_err.json.jbuilder +2 -0
- data/app/views/wechat/share/apps/_button.html.erb +0 -0
- data/app/views/wechat/share/apps/_filter_form.html.erb +9 -0
- data/app/views/wechat/share/apps/_form.html.erb +17 -0
- data/app/views/wechat/share/apps/_index_tbody.html.erb +27 -0
- data/app/views/wechat/share/apps/_index_thead.html.erb +5 -0
- data/app/views/wechat/share/apps/_index_tr.html.erb +10 -0
- data/app/views/wechat/share/apps/_show.json.jbuilder +1 -0
- data/app/views/wechat/share/apps/_show_table.html.erb +36 -0
- data/app/views/wechat/share/apps/_wechat_app.json.jbuilder +18 -0
- data/app/views/wechat/share/apps/index.html.erb +5 -0
- data/app/views/wechat/share/apps/index.json.jbuilder +1 -0
- data/app/views/wechat/share/base/_nav.html.erb +3 -0
- data/app/views/wechat/share/menus/_breadcrumb.html.erb +9 -0
- data/app/views/wechat/share/menus/_button.html.erb +9 -0
- data/app/views/wechat/share/menus/_edit_form.html.erb +6 -0
- data/app/views/wechat/share/menus/_edit_parent_form.html.erb +5 -0
- data/app/views/wechat/share/menus/_filter_form.html.erb +8 -0
- data/app/views/wechat/share/menus/_form.html.erb +10 -0
- data/app/views/wechat/share/menus/_index_tbody.html.erb +20 -0
- data/app/views/wechat/share/menus/_index_thead.html.erb +9 -0
- data/app/views/wechat/share/menus/_index_tr.html.erb +25 -0
- data/app/views/wechat/share/menus/_new_form.html.erb +5 -0
- data/app/views/wechat/share/menus/_new_parent_form.html.erb +7 -0
- data/app/views/wechat/share/menus/_show_table.html.erb +20 -0
- data/app/views/wechat/share/menus/edit_parent.turbo_stream.erb +1 -0
- data/app/views/wechat/share/menus/index.html.erb +4 -0
- data/app/views/wechat/share/menus/new_parent.html.erb +3 -0
- data/app/views/wechat/share/menus/sync.turbo_stream.erb +3 -0
- data/app/views/wechat/share/scenes/_breadcrumb.html.erb +7 -0
- data/app/views/wechat/share/scenes/_edit_form.html.erb +4 -0
- data/app/views/wechat/share/scenes/_filter_form.html.erb +9 -0
- data/app/views/wechat/share/scenes/_form.html.erb +3 -0
- data/app/views/wechat/share/scenes/_index_tbody.html.erb +9 -0
- data/app/views/wechat/share/scenes/_index_thead.html.erb +7 -0
- data/app/views/wechat/share/scenes/_index_tr.html.erb +25 -0
- data/app/views/wechat/share/scenes/_new_form.html.erb +4 -0
- data/app/views/wechat/share/scenes/_show_table.html.erb +10 -0
- data/app/views/wechat/share/scenes/index.html.erb +5 -0
- data/app/views/wechat/share/scenes/sync.turbo_stream.erb +3 -0
- data/app/views/wechat/share/wechat_users/_breadcrumb.html.erb +9 -0
- data/app/views/wechat/share/wechat_users/_button.html.erb +0 -0
- data/app/views/wechat/share/wechat_users/_edit_form.html.erb +4 -0
- data/app/views/wechat/share/wechat_users/_filter_form.html.erb +9 -0
- data/app/views/wechat/share/wechat_users/_index_tbody.html.erb +11 -0
- data/app/views/wechat/share/wechat_users/_index_thead.html.erb +12 -0
- data/app/views/wechat/share/wechat_users/_index_tr.html.erb +13 -0
- data/app/views/wechat/share/wechat_users/_show_table.html.erb +20 -0
- data/app/views/wechat/share/wechat_users/index.html.erb +5 -0
- data/app/views/wechat/share/wechat_users/try_match.turbo_stream.erb +3 -0
- data/app/views/wechat/wechat/login.html.erb +9 -0
- data/config/locales/en.controller.yml +28 -0
- data/config/locales/en.enum.yml +30 -0
- data/config/locales/zh.attributes.yml +66 -0
- data/config/locales/zh.controller.yml +79 -0
- data/config/locales/zh.enum.yml +65 -0
- data/config/routes.rb +142 -11
- data/lib/omniauth/strategies/wechat.rb +74 -0
- data/lib/omniauth/strategies/wechat_qiye.rb +82 -0
- data/lib/omniauth/strategies/wechat_qr.rb +21 -0
- data/lib/rails_wechat/config.rb +88 -0
- data/lib/rails_wechat/engine.rb +38 -0
- data/lib/rails_wechat/helpers.rb +32 -0
- data/lib/rails_wechat.rb +14 -3
- metadata +549 -44
- data/app/controllers/wechat/admin/wechat_configs_controller.rb +0 -86
- data/app/controllers/wechat/panel/wechat_configs_controller.rb +0 -62
- data/app/models/rails_wechat/organ.rb +0 -11
- data/app/models/wechat_config.rb +0 -44
- data/app/models/wechat_session.rb +0 -16
- data/app/views/wechat/admin/wechat_configs/_filter.html.erb +0 -8
- data/app/views/wechat/admin/wechat_configs/_form.html.erb +0 -21
- data/app/views/wechat/admin/wechat_configs/_show_table.html.erb +0 -80
- data/app/views/wechat/admin/wechat_configs/_wechat_config.json.jbuilder +0 -21
- data/app/views/wechat/admin/wechat_configs/edit.html.erb +0 -9
- data/app/views/wechat/admin/wechat_configs/edit.js.erb +0 -3
- data/app/views/wechat/admin/wechat_configs/index.html.erb +0 -84
- data/app/views/wechat/admin/wechat_configs/index.json.jbuilder +0 -1
- data/app/views/wechat/admin/wechat_configs/new.html.erb +0 -9
- data/app/views/wechat/admin/wechat_configs/new.js.erb +0 -3
- data/app/views/wechat/admin/wechat_configs/show.html.erb +0 -7
- data/app/views/wechat/admin/wechat_configs/show.js.erb +0 -3
- data/app/views/wechat/admin/wechat_configs/show.json.jbuilder +0 -1
- data/app/views/wechat/panel/wechat_configs/_filter.html.erb +0 -8
- data/app/views/wechat/panel/wechat_configs/_form.html.erb +0 -21
- data/app/views/wechat/panel/wechat_configs/_show_table.html.erb +0 -80
- data/app/views/wechat/panel/wechat_configs/_wechat_config.json.jbuilder +0 -21
- data/app/views/wechat/panel/wechat_configs/edit.html.erb +0 -9
- data/app/views/wechat/panel/wechat_configs/edit.js.erb +0 -3
- data/app/views/wechat/panel/wechat_configs/index.html.erb +0 -84
- data/app/views/wechat/panel/wechat_configs/index.json.jbuilder +0 -1
- data/app/views/wechat/panel/wechat_configs/new.html.erb +0 -9
- data/app/views/wechat/panel/wechat_configs/new.js.erb +0 -3
- data/app/views/wechat/panel/wechat_configs/show.html.erb +0 -7
- data/app/views/wechat/panel/wechat_configs/show.js.erb +0 -3
- data/app/views/wechat/panel/wechat_configs/show.json.jbuilder +0 -1
- data/lib/tasks/rails_wechat_tasks.rake +0 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb5dc5c123e370fc9df6aa2f03e3fd2e355b2de056068a3b1e1f024de72f67e1
|
|
4
|
+
data.tar.gz: f65253d5f0262f894244b54b58855e24dca8cc15324251fb61a4a7dd8eccc7f5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 635043ed780b4fdc0a3cd2f8519eef57326dffca8cc85e75c97050c00e378322b6d779807e0c00f83cdd190412b6908a8778858f8f59ac09b0b6e50ebb04dab7
|
|
7
|
+
data.tar.gz: e1793cc252e7679fdae54f22d1504624548afdd5c2ea0a1c876b048a0fcb4e399c5e73a32911b76a146fa5985ede9dc2b80a46a49e75b20a69b8f46a5793505d
|
data/LICENSE
CHANGED
|
@@ -1,165 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
An "Application" is any work that makes use of an interface provided
|
|
23
|
-
by the Library, but which is not otherwise based on the Library.
|
|
24
|
-
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
-
of using an interface provided by the Library.
|
|
26
|
-
|
|
27
|
-
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
-
Application with the Library. The particular version of the Library
|
|
29
|
-
with which the Combined Work was made is also called the "Linked
|
|
30
|
-
Version".
|
|
31
|
-
|
|
32
|
-
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
-
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
-
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
-
based on the Application, and not on the Linked Version.
|
|
36
|
-
|
|
37
|
-
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
-
object code and/or source code for the Application, including any data
|
|
39
|
-
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
-
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
-
|
|
42
|
-
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
-
|
|
44
|
-
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
-
without being bound by section 3 of the GNU GPL.
|
|
46
|
-
|
|
47
|
-
2. Conveying Modified Versions.
|
|
48
|
-
|
|
49
|
-
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
-
facility refers to a function or data to be supplied by an Application
|
|
51
|
-
that uses the facility (other than as an argument passed when the
|
|
52
|
-
facility is invoked), then you may convey a copy of the modified
|
|
53
|
-
version:
|
|
54
|
-
|
|
55
|
-
a) under this License, provided that you make a good faith effort to
|
|
56
|
-
ensure that, in the event an Application does not supply the
|
|
57
|
-
function or data, the facility still operates, and performs
|
|
58
|
-
whatever part of its purpose remains meaningful, or
|
|
59
|
-
|
|
60
|
-
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
-
this License applicable to that copy.
|
|
62
|
-
|
|
63
|
-
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
-
|
|
65
|
-
The object code form of an Application may incorporate material from
|
|
66
|
-
a header file that is part of the Library. You may convey such object
|
|
67
|
-
code under terms of your choice, provided that, if the incorporated
|
|
68
|
-
material is not limited to numerical parameters, data structure
|
|
69
|
-
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
-
(ten or fewer lines in length), you do both of the following:
|
|
71
|
-
|
|
72
|
-
a) Give prominent notice with each copy of the object code that the
|
|
73
|
-
Library is used in it and that the Library and its use are
|
|
74
|
-
covered by this License.
|
|
75
|
-
|
|
76
|
-
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
-
document.
|
|
78
|
-
|
|
79
|
-
4. Combined Works.
|
|
80
|
-
|
|
81
|
-
You may convey a Combined Work under terms of your choice that,
|
|
82
|
-
taken together, effectively do not restrict modification of the
|
|
83
|
-
portions of the Library contained in the Combined Work and reverse
|
|
84
|
-
engineering for debugging such modifications, if you also do each of
|
|
85
|
-
the following:
|
|
86
|
-
|
|
87
|
-
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
-
the Library is used in it and that the Library and its use are
|
|
89
|
-
covered by this License.
|
|
90
|
-
|
|
91
|
-
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
-
document.
|
|
93
|
-
|
|
94
|
-
c) For a Combined Work that displays copyright notices during
|
|
95
|
-
execution, include the copyright notice for the Library among
|
|
96
|
-
these notices, as well as a reference directing the user to the
|
|
97
|
-
copies of the GNU GPL and this license document.
|
|
98
|
-
|
|
99
|
-
d) Do one of the following:
|
|
100
|
-
|
|
101
|
-
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
-
License, and the Corresponding Application Code in a form
|
|
103
|
-
suitable for, and under terms that permit, the user to
|
|
104
|
-
recombine or relink the Application with a modified version of
|
|
105
|
-
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
-
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
-
Corresponding Source.
|
|
108
|
-
|
|
109
|
-
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
-
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
-
a copy of the Library already present on the user's computer
|
|
112
|
-
system, and (b) will operate properly with a modified version
|
|
113
|
-
of the Library that is interface-compatible with the Linked
|
|
114
|
-
Version.
|
|
115
|
-
|
|
116
|
-
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
-
be required to provide such information under section 6 of the
|
|
118
|
-
GNU GPL, and only to the extent that such information is
|
|
119
|
-
necessary to install and execute a modified version of the
|
|
120
|
-
Combined Work produced by recombining or relinking the
|
|
121
|
-
Application with a modified version of the Linked Version. (If
|
|
122
|
-
you use option 4d0, the Installation Information must accompany
|
|
123
|
-
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
-
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
-
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
-
for conveying Corresponding Source.)
|
|
127
|
-
|
|
128
|
-
5. Combined Libraries.
|
|
129
|
-
|
|
130
|
-
You may place library facilities that are a work based on the
|
|
131
|
-
Library side by side in a single library together with other library
|
|
132
|
-
facilities that are not Applications and are not covered by this
|
|
133
|
-
License, and convey such a combined library under terms of your
|
|
134
|
-
choice, if you do both of the following:
|
|
135
|
-
|
|
136
|
-
a) Accompany the combined library with a copy of the same work based
|
|
137
|
-
on the Library, uncombined with any other library facilities,
|
|
138
|
-
conveyed under the terms of this License.
|
|
139
|
-
|
|
140
|
-
b) Give prominent notice with the combined library that part of it
|
|
141
|
-
is a work based on the Library, and explaining where to find the
|
|
142
|
-
accompanying uncombined form of the same work.
|
|
143
|
-
|
|
144
|
-
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
-
|
|
146
|
-
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
-
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
-
versions will be similar in spirit to the present version, but may
|
|
149
|
-
differ in detail to address new problems or concerns.
|
|
150
|
-
|
|
151
|
-
Each version is given a distinguishing version number. If the
|
|
152
|
-
Library as you received it specifies that a certain numbered version
|
|
153
|
-
of the GNU Lesser General Public License "or any later version"
|
|
154
|
-
applies to it, you have the option of following the terms and
|
|
155
|
-
conditions either of that published version or of any later version
|
|
156
|
-
published by the Free Software Foundation. If the Library as you
|
|
157
|
-
received it does not specify a version number of the GNU Lesser
|
|
158
|
-
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
-
General Public License ever published by the Free Software Foundation.
|
|
160
|
-
|
|
161
|
-
If the Library as you received it specifies that a proxy can decide
|
|
162
|
-
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
-
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
-
permanent authorization for you to choose that version for the
|
|
165
|
-
Library.
|
|
1
|
+
Copyright (c) 2019-Present Mingyuan Qin <mingyuan0715@foxmail.com>
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,28 +1,36 @@
|
|
|
1
1
|
# RailsWechat
|
|
2
|
-
Short description and motivation.
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
[](https://github.com/work-design/rails_wechat/actions/workflows/test.yml)
|
|
4
|
+
[](https://github.com/work-design/rails_wechat/actions/workflows/cd.yml)
|
|
5
|
+
[](https://github.com/work-design/rails_wechat/actions/workflows/gempush.yml)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
Add this line to your application's Gemfile:
|
|
7
|
+
微信公众平台及微信开放平台集大成者。
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
## 特性
|
|
10
|
+
* 支持微信公众号,企业微信,微信小程序,微信开放平台几乎所有已开放功能;
|
|
11
|
+
* 为 SaaS 而生,支持多账号:
|
|
12
|
+
* 微信公众号多账号;
|
|
13
|
+
* 微信支付多账号;
|
|
14
|
+
* 微信第三方平台多账号;
|
|
15
|
+
* Oauth2 授权多账号,就算是未经过认证的个人微信号,通过自动推送链接绑定账号依然可以实现 oauth2 登陆的效果;
|
|
16
|
+
* 所有数据均自动存储至数据库;
|
|
17
|
+
* 全程在线 UI 配置,即时生效;
|
|
18
|
+
* 注释清晰,添加对文档的引用;
|
|
13
19
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
## 功能
|
|
21
|
+
* 精准消息推送,推送消息给你想推送的人群;
|
|
22
|
+
* 灵活强大的在线自动回复配置系统;
|
|
23
|
+
* config 配置, 参见[示例](lib/rails_wechat/config.rb);
|
|
24
|
+
* 数据库配置;
|
|
25
|
+
* 可对用户在微信公众号的留言做自动解析;
|
|
18
26
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
## 使用
|
|
28
|
+
* 调用api
|
|
29
|
+
```ruby
|
|
30
|
+
# 或 app = Wechat::App.find params[:id]
|
|
31
|
+
app = Wechat::App.take
|
|
32
|
+
app.api.msg_sec_check('test data')
|
|
22
33
|
```
|
|
23
34
|
|
|
24
|
-
##
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## License
|
|
28
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
35
|
+
## 许可证
|
|
36
|
+
许可证采用 [MIT](https://opensource.org/licenses/MIT)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Wechat::Api
|
|
2
|
+
module Base::Datacube
|
|
3
|
+
BASE = 'https://api.weixin.qq.com/datacube/'
|
|
4
|
+
|
|
5
|
+
def getusersummary(begin_date, end_date)
|
|
6
|
+
post 'getusersummary', begin_date: begin_date, end_date: end_date, base: BASE
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def getusercumulate(begin_date, end_date)
|
|
10
|
+
post 'getusercumulate', begin_date: begin_date, end_date: end_date, base: BASE
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module Wechat::Api
|
|
2
|
+
module Base::Sns
|
|
3
|
+
BASE = 'https://api.weixin.qq.com/sns/'
|
|
4
|
+
|
|
5
|
+
def web_access_token(code)
|
|
6
|
+
params = {
|
|
7
|
+
appid: access_token.appid,
|
|
8
|
+
secret: access_token.secret,
|
|
9
|
+
code: code,
|
|
10
|
+
grant_type: 'authorization_code'
|
|
11
|
+
}
|
|
12
|
+
get 'oauth2/access_token', params: params, base: BASE
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def web_auth_access_token(web_access_token, openid)
|
|
16
|
+
get 'auth', params: { access_token: web_access_token, openid: openid }, base: BASE
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def web_userinfo(web_access_token, openid, lang = 'zh_CN')
|
|
20
|
+
get 'userinfo', params: { access_token: web_access_token, openid: openid, lang: lang }, base: BASE
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html
|
|
24
|
+
def jscode2session(code)
|
|
25
|
+
params = {
|
|
26
|
+
appid: app.appid,
|
|
27
|
+
secret: app.secret,
|
|
28
|
+
js_code: code,
|
|
29
|
+
grant_type: 'authorization_code'
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get 'jscode2session', params: params, base: BASE
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wechat::Api
|
|
4
|
+
class Base
|
|
5
|
+
attr_reader :app, :client
|
|
6
|
+
|
|
7
|
+
def initialize(app)
|
|
8
|
+
@app = app
|
|
9
|
+
@client = Wechat::HttpClient.new
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def get(path, params: {}, headers: {}, base: nil, as: nil)
|
|
13
|
+
with_access_token(params) do |with_token_params|
|
|
14
|
+
@client.get path, headers: headers, params: with_token_params, base: base, as: as
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def post(path, params: {}, headers: {}, base: nil, **payload)
|
|
19
|
+
with_access_token(params) do |with_token_params|
|
|
20
|
+
@client.post path, payload.to_json, headers: headers, params: with_token_params, base: base
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def post_file(path, file, params: {}, headers: {}, base: nil)
|
|
25
|
+
with_access_token(params) do |with_token_params|
|
|
26
|
+
@client.post_file path, file, headers: headers, params: with_token_params, base: base
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
protected
|
|
31
|
+
def with_access_token(params = {}, tries = 2)
|
|
32
|
+
app.refresh_access_token unless app.access_token_valid?
|
|
33
|
+
yield params.merge!(access_token: app.access_token)
|
|
34
|
+
rescue Wechat::AccessTokenExpiredError
|
|
35
|
+
app.refresh_access_token
|
|
36
|
+
retry unless (tries -= 1).zero?
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
module Wechat::Api
|
|
2
|
+
module Platform::Component
|
|
3
|
+
BASE = 'https://api.weixin.qq.com/cgi-bin/component/'
|
|
4
|
+
|
|
5
|
+
def create_preauthcode
|
|
6
|
+
body = {
|
|
7
|
+
component_appid: app.appid
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
post 'api_create_preauthcode', **body, base: BASE
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def query_auth(auth_code)
|
|
14
|
+
body = {
|
|
15
|
+
component_appid: app.appid,
|
|
16
|
+
authorization_code: auth_code
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
r = post 'api_query_auth', **body, base: BASE
|
|
20
|
+
r['authorization_info']
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def authorizer_token(appid, refresh_token)
|
|
24
|
+
body = {
|
|
25
|
+
component_appid: app.appid,
|
|
26
|
+
authorizer_appid: appid,
|
|
27
|
+
authorizer_refresh_token: refresh_token
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
post 'api_authorizer_token', **body, base: BASE
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def get_authorizer_info(appid)
|
|
34
|
+
body = {
|
|
35
|
+
component_appid: app.appid,
|
|
36
|
+
authorizer_appid: appid
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
r = post 'api_get_authorizer_info', **body, base: BASE
|
|
40
|
+
r['authorizer_info']
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def component_token
|
|
44
|
+
body = {
|
|
45
|
+
component_appid: app.appid,
|
|
46
|
+
component_appsecret: app.secret,
|
|
47
|
+
component_verify_ticket: app.verify_ticket
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
client.post 'api_component_token', body.to_json, base: BASE # use client without access token
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Wechat::Api
|
|
2
|
+
class Platform < Wechat::Api::Base
|
|
3
|
+
include Component
|
|
4
|
+
|
|
5
|
+
protected
|
|
6
|
+
def with_access_token(params = {}, tries = 2)
|
|
7
|
+
app.refresh_access_token unless app.access_token_valid?
|
|
8
|
+
yield params.merge!(component_access_token: app.access_token)
|
|
9
|
+
rescue Wechat::AccessTokenExpiredError
|
|
10
|
+
app.refresh_access_token
|
|
11
|
+
retry unless (tries -= 1).zero?
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Wechat::Api
|
|
2
|
+
module Program::Wxa
|
|
3
|
+
BASE = 'https://api.weixin.qq.com/wxa/'
|
|
4
|
+
|
|
5
|
+
# https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/sec-check/security.msgSecCheck.html
|
|
6
|
+
def msg_sec_check(content)
|
|
7
|
+
post 'msg_sec_check', content: content, base: BASE
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def get_wxacode(path, width = 430)
|
|
11
|
+
post 'getwxacode', path: path, width: width, base: BASE
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def get_wxacode_unlimit(scene, **options)
|
|
15
|
+
p = { scene: scene, **options }
|
|
16
|
+
|
|
17
|
+
post 'getwxacodeunlimit', **p, base: BASE
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
end
|