apidoc.php 1.6 KB

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