apidoc.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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\Login::class,
  23. \app\data\controller\api\Area::class,
  24. \app\data\controller\api\Weather::class,
  25. \app\data\controller\api\User::class,
  26. \app\data\controller\api\Goods::class,
  27. \app\data\controller\api\Order::class,
  28. \app\data\controller\api\auth\Address::class,
  29. ]
  30. ]
  31. ],
  32. ]
  33. ],
  34. // 自动生成url规则
  35. 'auto_url' => [
  36. // 字母规则
  37. 'letter_rule' => "lcfirst",
  38. // 多级路由分隔符
  39. 'multistage_route_separator' =>"."
  40. ],
  41. // 指定公共注释定义的文件地址
  42. 'definitions' => "app\common\controller\Definitions",
  43. // 缓存配置
  44. 'cache' => [
  45. // 是否开启缓存
  46. 'enable' => false,
  47. ],
  48. // 权限认证配置
  49. 'auth' => [
  50. // 是否启用密码验证
  51. 'enable' => false,
  52. // 全局访问密码
  53. 'password' => "123456",
  54. // 密码加密盐
  55. 'secret_key' => "apidoc#hg_code",
  56. // 有效期
  57. 'expire' => 24*60*60
  58. ],
  59. // 统一的请求Header
  60. 'headers'=>[],
  61. // 统一的请求参数Parameters
  62. 'parameters'=>[],
  63. // 统一的请求响应体
  64. 'responses'=>[
  65. ['name'=>'code','desc'=>'代码','type'=>'int'],
  66. ['name'=>'message','desc'=>'业务信息','type'=>'string'],
  67. ['name'=>'data','desc'=>'业务数据','main'=>true,'type'=>'object'],
  68. ],
  69. // md文档
  70. 'docs' => [],
  71. ];