1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Mead
- * Date: 2019/9/3
- * Time: 8:05 PM
- */
- namespace App\Servers;
- use App\Models\CacheLogTraitModel;
- class BoxSettingServer extends BaseServer
- {
- use CacheLogTraitModel;
- public function main($body)
- {
- $data = $this->decode($body);
- $this->cacheLog($data['msg_id'], $data['setting']);
- self::log($data, 'BoxSettingServer', self::$LOG_MAJOR);
- return false;
- }
- /**
- * 解析装载的数据
- * @param $body
- * @return array
- * User: Mead
- */
- private function decode($body)
- {
- list($setting, $msg) = explode(BikeControl::SPLIT_TAG, implode('', $body));
- // $msg = $this->decodeMsgId($msg);
- $setting = $this->decodeSetting($setting);
- return [
- 'setting' => $setting,
- 'msg_id' => $msg,
- ];
- }
- }
|