Common.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\constant\ApplyConstant;
  4. use app\common\constant\CommonConstant;
  5. use app\common\constant\ContractConstant;
  6. use app\common\constant\EvectionConstant;
  7. use app\common\constant\LeaveConstant;
  8. use app\common\constant\MaintainConstant;
  9. use app\common\constant\OfferConstant;
  10. use hg\apidoc\annotation as Apidoc;
  11. /**
  12. * @Apidoc\Title("公用")
  13. * @Apidoc\Group("api")
  14. * @Apidoc\Sort("0")
  15. */
  16. class Common extends Base
  17. {
  18. public function initialize()
  19. {
  20. parent::initialize();
  21. }
  22. /**
  23. * 模块列表
  24. *
  25. * @Apidoc\Method("POST")
  26. */
  27. public function get_module_list()
  28. {
  29. $this->success('模块列表', get_one_two_array(CommonConstant::get_module_list(), 'id', 'name'));
  30. }
  31. /**
  32. * 缓急程度列表
  33. *
  34. * @Apidoc\Method("POST")
  35. */
  36. public function get_degree_list()
  37. {
  38. $this->success('缓急程度列表', get_one_two_array(OfferConstant::get_degree_list(), 'id', 'name'));
  39. }
  40. /**
  41. * 采购类型列表
  42. *
  43. * @Apidoc\Method("POST")
  44. */
  45. public function get_apply_type_list()
  46. {
  47. $this->success('采购类型列表', get_one_two_array(ApplyConstant::get_type_list(), 'id', 'name'));
  48. }
  49. /**
  50. * 采购支付方式列表
  51. *
  52. * @Apidoc\Method("POST")
  53. */
  54. public function get_apply_pay_type_list()
  55. {
  56. $this->success('采购支付方式列表', get_one_two_array(ApplyConstant::get_pay_type_list(), 'id', 'name'));
  57. }
  58. /**
  59. * 呈批类型列表
  60. *
  61. * @Apidoc\Method("POST")
  62. */
  63. public function get_offer_type_list()
  64. {
  65. $this->success('呈批类型列表', get_one_two_array(OfferConstant::get_type_list(), 'id', 'name'));
  66. }
  67. /**
  68. * 出差类型列表
  69. *
  70. * @Apidoc\Method("POST")
  71. */
  72. public function get_evection_type_list()
  73. {
  74. $this->success('出差类型列表', get_one_two_array(EvectionConstant::get_type_list(), 'id', 'name'));
  75. }
  76. /**
  77. * 请假类型列表
  78. *
  79. * @Apidoc\Method("POST")
  80. */
  81. public function get_leave_type_list()
  82. {
  83. $this->success('请假类型列表', get_one_two_array(LeaveConstant::get_type_list(), 'id', 'name'));
  84. }
  85. /**
  86. * 维修类型列表
  87. *
  88. * @Apidoc\Method("POST")
  89. */
  90. public function get_maintain_type_list()
  91. {
  92. $this->success('维修类型列表', get_one_two_array(MaintainConstant::get_type_list(), 'id', 'name'));
  93. }
  94. /**
  95. * 合同类型列表
  96. *
  97. * @Apidoc\Method("POST")
  98. */
  99. public function get_contract_type_list()
  100. {
  101. $this->success('合同类型列表', get_one_two_array(ContractConstant::get_type_list(), 'id', 'name'));
  102. }
  103. }