All Projects → codingheping → hyperf-v2-demo

codingheping / hyperf-v2-demo

Licence: MIT license
Hyperf Demo(easywechat,chat)

Programming Languages

PHP
23972 projects - #3 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to hyperf-v2-demo

Hyperf
🚀 A coroutine framework that focuses on hyperspeed and flexibility. Building microservice or middleware with ease.
Stars: ✭ 4,206 (+22036.84%)
Mutual labels:  swoole, hyperf
MineAdmin
🎉🌈🔥MineAdmin是基于Hyperf框架 和 Vue3+Vite3 开发的前后端分离权限管理系统,自适应多终端。特色:crud生成 + json配置化开发一把梭
Stars: ✭ 142 (+647.37%)
Mutual labels:  swoole, hyperf
gotask
⚡️ A lightning speed replacement for Swoole TaskWorker in Go
Stars: ✭ 164 (+763.16%)
Mutual labels:  swoole, hyperf
thrift2-hbase
thrift2-hbase component for Hyperf.
Stars: ✭ 14 (-26.32%)
Mutual labels:  swoole, hyperf
HyperVue
🚀 基于 Hyperf + Vue + ElementUI 前后端分离的通用型管理后台
Stars: ✭ 23 (+21.05%)
Mutual labels:  swoole, hyperf
leevel
🚀The Leevel Framework To Rebuild QueryPHP.
Stars: ✭ 35 (+84.21%)
Mutual labels:  swoole
skeleton
基于Swoole的轻量、高效、全异步开源框架。
Stars: ✭ 71 (+273.68%)
Mutual labels:  swoole
awesome-swoole
💎 A curated list of awesome things related to Swoole.
Stars: ✭ 129 (+578.95%)
Mutual labels:  swoole
swoole
Swoole Api references
Stars: ✭ 14 (-26.32%)
Mutual labels:  swoole
request-callback
➰ Swoole request callback for PSR compliant handlers.
Stars: ✭ 22 (+15.79%)
Mutual labels:  swoole
vertica-swoole-adapter
Provides a DB layer for Swoole-based applications to communicate to HP Vertica databases.
Stars: ✭ 14 (-26.32%)
Mutual labels:  swoole
framework
🦋The PHP Framework For Code Poem As Free As Wind.
Stars: ✭ 65 (+242.11%)
Mutual labels:  swoole
homebrew-extensions
🍻 Homebrew tap for PHP extensions
Stars: ✭ 264 (+1289.47%)
Mutual labels:  swoole
static-php-cli
Build single static PHP binary in linux, build with PHP project together, with Swoole and other popular extensions included.
Stars: ✭ 129 (+578.95%)
Mutual labels:  swoole
ultraman
奥特曼
Stars: ✭ 45 (+136.84%)
Mutual labels:  swoole
docs
Lawoole documentation
Stars: ✭ 12 (-36.84%)
Mutual labels:  swoole
RidPT
A Private Tracker System
Stars: ✭ 102 (+436.84%)
Mutual labels:  swoole
ext-postgresql
🐘 Coroutine-based client for PostgreSQL
Stars: ✭ 62 (+226.32%)
Mutual labels:  swoole
app
Buggregator is a beautiful, lightweight debug server build on Laravel that helps you catch your smpt, sentry, var-dump, monolog, ray outputs. It runs without installation on multiple platforms.
Stars: ✭ 259 (+1263.16%)
Mutual labels:  swoole
kafka-swoole
☝️Implement all kafka protocols, providing 'HighLevel' and 'LowLevel' client apis respectively, and utilize swoole to realize collaboration and flexibly extend consumers' client, which is the first php-kafka client to support multiple compression forms
Stars: ✭ 33 (+73.68%)
Mutual labels:  swoole

Php Version Swoole Version Hyperf Version

项目会及时更新了

介绍

此框架是基于Swoole4.5+Hyperf2.0开发的Easywechat的一些案例,所有的服务都是基于jsonrpc来调度,jsonrpc服务注册进consul服务管理中心.可以支持多个小程序,目前暂时完成了微信小程序登录授权,集成了微信支付和获取二维码的操作。服务提供重试机制,链路追踪和服务监控。可以根据配置合理配置重试机制。

TODO

集成easywechat的所有功能

疑问

可以联系我微信 avatar

联系方式

qq群658446650

启动

composer dump-autoload -o

php bin/hyperf start

API访问

http://127.0.0.1:9501/rpc/session?channel=default&code=   获取会话session
http://127.0.0.1:9501/rpc/phone?  解密手机号
http://127.0.0.1:9501/rpc/getFewQrCode?  获取少量二维码
http://127.0.0.1:9501/rpc/getUnlimitQrCode? 获取多量二维码
http://127.0.0.1:9501/rpc/getQrCode? 获取小程序二维码(自定义尺寸)
http://127.0.0.1:9501/rpc/pay 发起微信支付请求

功能(所有的功能都是基于easywechat文档的API封装的)

  • 小程序登录
  • 小程序码
  • 微信支付

配置

[
    //是否支持多个小程序
    'enable_all'  => env('WECHAT_ENABLE_ALL', false),
    //多个小程序用参数字段接收需要获取对应小程序的配置字段
    'key'         => env('WECHAT_QUERY_KEY', 'channel'),
    //服务重试次数
    'maxattempts' => 2,
    //存储二维码文件路径
    'qrcode_path' => BASE_PATH . '/storage/',
    //重试间隔
    'sleep'       => 20,
    'config'      => [
        //小程序1的配置
        'default'  => [
            'app_id'  => env('WECHAT_MINI_PROGRAM_APPID', ''),
            'secret'  => env('WECHAT_MINI_PROGRAM_SECRET', ''),
            'token'   => env('WECHAT_MINI_PROGRAM_TOKEN', ''),
            'aes_key' => env('WECHAT_MINI_PROGRAM_AES_KEY', '')
        ],
        //小程序2的配置
        'default2' => [
            'app_id'  => env('WECHAT_MINI_PROGRAM_APPID_DEFAULT2', ''),
            'secret'  => env('WECHAT_MINI_PROGRAM_SECRET_DEFAULT2', ''),
            'token'   => env('WECHAT_MINI_PROGRAM_TOKEN_DEFAULT2', ''),
            'aes_key' => env('WECHAT_MINI_PROGRAM_AES_KEY_DEFAULT2', '')
        ]
    ]
];
//支付配置
return [
    'payment'     => [
        'default'  => [
            'sandbox'           => env('WECHAT_PAYMENT_SANDBOX', false),//沙箱测试
            'app_id'            => env('WECHAT_PAYMENT_APPID', ''),//APPID
            'mch_id'            => env('WECHAT_PAYMENT_MCH_ID', ''), //商户ID
            'key'               => env('WECHAT_PAYMENT_KEY', BASE_PATH . '/private/payment/default/apiclient_cert.pem'),
            'cert_path'         => env('WECHAT_PAYMENT_CERT_PATH', BASE_PATH . '/private/payment/default/apiclient_key.pem'),
            'key_path'          => env('WECHAT_PAYMENT_KEY_PATH', ''),
            'notify_url'        => env('WECHAT_PAYMENT_NOTIFY_URL', ''), //支付回调地址
            'refund_notify_url' => env('WECHAT_REFUND_NOTIFY_URL', ''), //退款回调地址
        ],
        'default1' => [
            'sandbox'           => env('WECHAT_PAYMENT_SANDBOX', false),
            'app_id'            => env('WECHAT_PAYMENT_APPID', ''),
            'mch_id'            => env('WECHAT_PAYMENT_MCH_ID', ''),
            'key'               => env('WECHAT_PAYMENT_KEY', BASE_PATH . '/private/payment/default1/apiclient_cert.pem'),
            'cert_path'         => env('WECHAT_PAYMENT_CERT_PATH', BASE_PATH . '/private/payment/default1/apiclient_key.pem'),
            'key_path'          => env('WECHAT_PAYMENT_KEY_PATH', ''),
            'notify_url'        => env('WECHAT_PAYMENT_NOTIFY_URL', ''),
            'refund_notify_url' => env('WECHAT_REFUND_NOTIFY_URL', ''),
        ]
    ],
    //服务重试次数
    'maxattempts' => 3,
    //重试休眠时间
    'sleep'       => 20

];

服务监控

avatar

链路追踪

avatar

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].