apidoc.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. return [
  3. // 文档标题
  4. 'title' => 'API接口文档',
  5. // 文档描述
  6. 'desc' => '',
  7. // 默认请求类型
  8. 'default_method'=>'GET',
  9. // 允许跨域访问
  10. 'allowCrossDomain'=>false,
  11. // 设置可选版本
  12. 'apps' => [],
  13. // 自动生成url规则
  14. 'auto_url' => [
  15. // 字母规则
  16. 'letter_rule' => "lcfirst",
  17. // 多级路由分隔符
  18. 'multistage_route_separator' =>"."
  19. ],
  20. // 指定公共注释定义的文件地址
  21. 'definitions' => "app\common\controller\Definitions",
  22. // 缓存配置
  23. 'cache' => [
  24. // 是否开启缓存
  25. 'enable' => false,
  26. ],
  27. // 权限认证配置
  28. 'auth' => [
  29. // 是否启用密码验证
  30. 'enable' => false,
  31. // 全局访问密码
  32. 'password' => "123456",
  33. // 密码加密盐
  34. 'secret_key' => "apidoc#hg_code",
  35. // 有效期
  36. 'expire' => 24*60*60
  37. ],
  38. // 统一的请求Header
  39. 'headers'=>[],
  40. // 统一的请求参数Parameters
  41. 'parameters'=>[],
  42. // 统一的请求响应体
  43. 'responses'=>[
  44. ['name'=>'code','desc'=>'代码','type'=>'int'],
  45. ['name'=>'message','desc'=>'业务信息','type'=>'string'],
  46. ['name'=>'data','desc'=>'业务数据','main'=>true,'type'=>'object'],
  47. ],
  48. // md文档
  49. 'docs' => [],
  50. ];