TestController.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Components\AsyncResponse;
  4. use App\Components\ErrorPush;
  5. use App\ErrorTemp;
  6. use App\Feature;
  7. use App\MaterialBox;
  8. use App\MaterialBoxModel;
  9. use App\Owner;
  10. use App\OwnerFeeDetail;
  11. use App\OwnerPriceOperation;
  12. use App\RejectedBill;
  13. use App\Services\ForeignHaiRoboticsService;
  14. use App\Station;
  15. use App\StationTask;
  16. use App\StationTaskMaterialBox;
  17. use App\TaskTransaction;
  18. use App\Unit;
  19. use App\Waybill;
  20. use Illuminate\Database\Eloquent\Collection;
  21. use Illuminate\Http\Request;
  22. use Illuminate\Support\Facades\Auth;
  23. use Illuminate\Support\Facades\Cache;
  24. use Illuminate\Support\Facades\Cookie;
  25. use Illuminate\Support\Facades\DB;
  26. use Illuminate\Support\Facades\Http;
  27. class TestController extends Controller
  28. {
  29. use AsyncResponse,ErrorPush;
  30. const ASNREFERENCE_2 = 'ASNREFERENCE2';
  31. private $data = [];
  32. public function __construct()
  33. {
  34. $this->data["active_test"] = "active";
  35. }
  36. public function method(Request $request, $method)
  37. {
  38. return call_user_func([$this, $method], $request);
  39. }
  40. public function lightUp()
  41. {
  42. app("CacheShelfService")->lightUp('HAIB1-02-02','3','0');
  43. }
  44. public function lightOff()
  45. {
  46. $params = [
  47. "areaCode" => "1004",
  48. 'locCode' => "HAIB1-02-02",
  49. 'PTLAction' => 0,
  50. ];
  51. $response = Http::post(config('api.haiq.storage.light'), $params);
  52. return json_decode($response->body());
  53. }
  54. private $key = "CACHE_SHELF_AVAILABLE";
  55. public function test()
  56. {
  57. $a = new Collection(["a","b"]);
  58. dd($a->filter(function ($b){
  59. if ($b=="a")return true;
  60. else return false;
  61. }));
  62. }
  63. }