BaseBikeControl.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. /**
  3. *
  4. *
  5. * @category xxx
  6. * @package PSR
  7. * @subpackage Documentation\API
  8. * @author xxx <xxx@xxx.com>
  9. * @license GPL https://xxx.com
  10. * @link https://xxx.com
  11. * @ctime: 2020/6/8 14:08
  12. */
  13. namespace App\Handlers;
  14. class BaseBikeControl
  15. {
  16. protected static $bikeControl;
  17. protected static $box_no;
  18. public function __construct($box_no)
  19. {
  20. self::$box_no = $box_no;
  21. if(strlen($box_no) < 10){
  22. self::$bikeControl = new BikeControl();
  23. }else{
  24. self::$bikeControl = new \App\Handlers\Weikemu\BikeControl();
  25. }
  26. }
  27. public static function openLock(){
  28. return self::$bikeControl::openLock(self::$box_no);
  29. }
  30. public static function closeLock(){
  31. return self::$bikeControl::closeLock(self::$box_no);
  32. }
  33. public static function temporaryCloseLock(){
  34. return self::$bikeControl::temporaryCloseLock(self::$box_no);
  35. }
  36. public static function temporaryOpnLock(){
  37. return self::$bikeControl::temporaryOpnLock(self::$box_no);
  38. }
  39. public static function bellBike(){
  40. return self::$bikeControl::bellBike(self::$box_no);
  41. }
  42. public static function nowBikeLocation(){
  43. return self::$bikeControl::nowBikeLocation(self::$box_no);
  44. }
  45. public static function openBatteryLock(){
  46. return self::$bikeControl::openBatteryLock(self::$box_no);
  47. }
  48. public static function outAreaLoseElectric(){
  49. return self::$bikeControl::outAreaLoseElectric(self::$box_no);
  50. }
  51. public static function outAreaGetElectric(){
  52. return self::$bikeControl::outAreaGetElectric(self::$box_no);
  53. }
  54. public static function rebootBox(){
  55. return self::$bikeControl::rebootBox(self::$box_no);
  56. }
  57. public static function nowBikeBatteryMSG(){
  58. return self::$bikeControl::nowBikeBatteryMSG(self::$box_no);
  59. }
  60. }