laradocs / moguding
蘑菇丁 SDK
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 20 065
Dependents: 0
Suggesters: 0
Security: 0
Stars: 18
Watchers: 1
Forks: 10
Open Issues: 0
Requires
- php: >=8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.4
Requires (Dev)
- mockery/mockery: ^1.4
- phpunit/phpunit: ^9.5
README
🍄蘑菇丁自动签到|打卡组件
PHP 版本
PHP 需要 8.0 或以上版本
安装
composer require laradocs/moguding
更新
composer update laradocs/moguding
用法
获取用户信息
use Laradocs\Moguding\Moguding; use Laradocs\Moguding\Params\LoginParam; use Laradocs\Moguding\Params\Login; $moguding = new Moguding(); $user = $mogiding->getUserProfile(new LoginParam( new Login('操作系统(android/ios)', '手机号码', '密码') )); var_dump($user); // 见 返回示例
返回示例(重要数据):
[ "token" => 'xxxxxx', "userId" => '用户ID', "userType" => 'student', . . . ]
获取计划列表
use Laradocs\Moguding\Moguding; use Laradocs\Moguding\Params\UserParam; use Laradocs\Moguding\Params\User; $moguding = new Moguding(); $plans = $moguding->getPlanList(new UserParam( new User($user['token'], $user['userId'], $user['userType']) )); var_dump($plans); // 见 返回示例
返回示例(重要数据):
[ [ "planId" => "xxxxxx", . . . ] ]
获取打卡信息
📍 不知道自己所在的经纬度点击👉 经纬度查询 - 坐标拾取系统
use Laradocs\Moguding\Moguding; use Laradocs\Moguding\Params\SaveParam; use Laradocs\Moguding\Params\Save; use Laradocs\Moguding\Params\User; use Laradocs\Moguding\Params\Address; $moguding = new Moguding(); $save = $moguding->getSaveInfo(new SaveParam( new Save( new User($user['token'], $user['userId'], $user['userType']), new Address('所在省份', '所在城市(直辖市的同学传 null 就行)', '详细地址', '经度', '纬度', '所在国家(默认:中国)'), $plans[0]['planId'], '操作系统(android/ios)', '打卡类型(START/END)', // START: 上班 END: 下班 '备注(非必填)' ) )) var_dump($save); // 见 返回示例
返回示例(重要数据):
[
"createTime" => "2022-01-15 07:08:49",
"attendanceId" => "xxxxxxxxxxxxxxxxxxx",
.
.
.
]
通知推送
Server 酱
在使用此功能之前,你需要去 Server 酱 注册账号,然后获取 SendKey。
use Laradocs\Moguding\Plugins\ServerChan; $message = new ServerChan('SendKey'); $message->title('推送标题') // 必须 ->desp('推送正文') // 非必须 ->channel(['推送通道']) // 非必须 ->send(); // 发送通知
协作
如果您想参与此项目,请点击右上角的 Fork
按钮,我们共同维护此项目。