EsConnect.php 658 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\controller;
  3. use think\facade\Db;
  4. use think\annotation\Route;
  5. use think\annotation\route\Middleware;
  6. use hg\apidoc\annotation as Apidoc;
  7. /**
  8. * @Apidoc\Title("ElaticSearch")
  9. * @Apidoc\Group("ElaticSearch")
  10. * @Apidoc\Sort (10)
  11. */
  12. class EsConnect extends \app\BaseController
  13. {
  14. /**
  15. * @Apidoc\Title("saveEs")
  16. * @Apidoc\Tag("saveEs")
  17. * @Apidoc\Method ("GET")
  18. * @Apidoc\Author ("ihavoc")
  19. * @Route("saveEs",method="GET")
  20. * @Middleware({"jwt"})
  21. */
  22. public function saveEs(){
  23. $res=Db::connect("elasticsearch")->name('enterprises')->select();
  24. return $this->JsonSucess($res);
  25. }
  26. }