apidoc.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. return [
  3. // 文档标题
  4. 'title' => 'API接口文档',
  5. // 文档描述
  6. 'desc' => '',
  7. // 默认请求类型
  8. 'default_method'=>'GET',
  9. // 允许跨域访问
  10. 'allowCrossDomain'=>false,
  11. // 设置可选版本
  12. 'apps' => [
  13. [
  14. 'title'=>'前台api接口',
  15. 'path'=>'app\data\controller',
  16. 'folder'=>'data',
  17. 'items'=>[
  18. [
  19. 'title'=>'V1.0',
  20. 'path'=>'app\data\controller\api',
  21. 'folder'=>'api','controllers'=>[
  22. \app\data\controller\api\Index::class,
  23. \app\data\controller\api\Login::class,
  24. \app\data\controller\api\Area::class,
  25. \app\data\controller\api\PostageType::class,
  26. \app\data\controller\api\Weather::class,
  27. \app\data\controller\api\User::class,
  28. \app\data\controller\api\Goods::class,
  29. \app\data\controller\api\Order::class,
  30. \app\data\controller\api\auth\Center::class,
  31. \app\data\controller\api\auth\TeachingKnowledge::class,
  32. \app\data\controller\api\auth\BestKnowledge::class,
  33. \app\data\controller\api\auth\DemandLabor::class,
  34. \app\data\controller\api\auth\PoolTalent::class,
  35. \app\data\controller\api\auth\ShipEngineMaintenance::class,
  36. \app\data\controller\api\business\Goods::class,
  37. \app\data\controller\api\business\Login::class,
  38. \app\data\controller\api\business\Order::class,
  39. \app\data\controller\api\business\Purchase::class,
  40. \app\data\controller\api\business\User::class,
  41. \app\data\controller\api\Xw::class,
  42. \app\data\controller\api\ResCenter::class,
  43. \app\data\controller\api\Bidding::class,
  44. \app\data\controller\api\auth\Purchase::class,
  45. \app\data\controller\api\auth\UserPurchase::class,
  46. \app\data\controller\api\ShipYard::class,
  47. \app\data\controller\api\Data::class,
  48. \app\data\controller\api\Notice::class,
  49. ]
  50. ]
  51. ],
  52. ]
  53. ],
  54. // 自动生成url规则
  55. 'auto_url' => [
  56. // 字母规则
  57. 'letter_rule' => "lcfirst",
  58. // 多级路由分隔符
  59. 'multistage_route_separator' =>"."
  60. ],
  61. // 指定公共注释定义的文件地址
  62. 'definitions' => "app\common\controller\Definitions",
  63. // 缓存配置
  64. 'cache' => [
  65. // 是否开启缓存
  66. 'enable' => false,
  67. ],
  68. // 权限认证配置
  69. 'auth' => [
  70. // 是否启用密码验证
  71. 'enable' => false,
  72. // 全局访问密码
  73. 'password' => "123456",
  74. // 密码加密盐
  75. 'secret_key' => "apidoc#hg_code",
  76. // 有效期
  77. 'expire' => 24*60*60
  78. ],
  79. // 统一的请求Header
  80. 'headers'=>[],
  81. // 统一的请求参数Parameters
  82. 'parameters'=>[],
  83. // 统一的请求响应体
  84. 'responses'=>[
  85. ['name'=>'code','desc'=>'代码','type'=>'int'],
  86. ['name'=>'message','desc'=>'业务信息','type'=>'string'],
  87. ['name'=>'data','desc'=>'业务数据','main'=>true,'type'=>'object'],
  88. ],
  89. // md文档
  90. 'docs' => [],
  91. ];