apidoc.php 1.6 KB

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