OacallbackController.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Oacallback.php UTF-8
  4. *
  5. *
  6. * @date : 2017/6/16 10:08
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : guxiannong <gxn@huosdk.com>
  10. * @version : HUOOA 1.0
  11. */
  12. namespace api\oa\controller;
  13. class OacallbackController extends OaController {
  14. function _initialize() {
  15. parent::_initialize();
  16. }
  17. /**
  18. * 检测func参数
  19. *
  20. * @return $this
  21. */
  22. public function checkFunc() {
  23. if (empty($this->param['func'])) {
  24. return $this->oa_class->hs_api_responce('409', 'func参数错误');
  25. }
  26. }
  27. public function index() {
  28. $this->checkFunc();
  29. if ($this->param['func'] == 'GM_FOSTER' || $this->param['func'] == 'GM_FIRST') {
  30. $this->param['func'] = 'OaFirstFoster';
  31. }
  32. self::init($this->param['func'].'Controller');
  33. }
  34. public static function init($payway) {
  35. $_class = false !== strpos($payway, '\\') ? $payway : '\\api\\oa\\controller\\'.ucwords($payway);
  36. // 记录初始化信息
  37. return new $_class();
  38. }
  39. }