apidoc.php 2.3 KB

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