GithubHelp home page GithubHelp logo

wanmeixiaoyuan2001 / php-moguding-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shiqing-31013/php-moguding-sdk

0.0 0.0 0.0 72 KB

🍄蘑菇丁/工学云 SDK

License: MIT License

PHP 100.00%

php-moguding-sdk's Introduction

🍄蘑菇丁 SDK

Total Downloads Latest Stable Version Latest Unstable Version License StyleCI Test

🍄蘑菇丁自动签到|打卡组件

交流

交流群 ID: 253228619

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 按钮,我们共同维护此项目。

Project supported by JetBrains

Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.

JetBrains

php-moguding-sdk's People

Contributors

laradocs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.