dreamcat/ctl-param-generator-4-laravel
最新稳定版本:v1.2.0
Composer 安装命令:
composer require dreamcat/ctl-param-generator-4-laravel
包简介
控制器参数生成的laravel适配器
README 文档
README
介绍
通过注解的形式直接生成控制器参数
安装
composer require dreamcat/ctl-param-generator-4-laravel
使用方法
加入 provider
\DreamCat\ControllerParamGen4Laravel\Provider\CtlParamGenProvider
配置定义
配置文件放在 config/controllerParamGenerator.php
| 配置路径 | 类型 | 含义 | 默认值 |
|---|---|---|---|
| arrayConverter.createNewProperty | bool | 生成参数时是否创建对象原本不存在的属性 | false |
| arrayConverter.tryWithoutConstructor | bool | 如果参数的类无法调用构造函数时是否尝试执行不调用构造函数创建对象 | false |
| arrayConverter.tryCallSetter | bool | 如果属性有set方法是否尝试调用 | true |
| arrayConverter.tryConstructWithParam | bool | 如果构造函数仅有一个必填参数,尝试在构造函数只有一个参数时调用构造函数 | true |
| arrayConverter.propertyAnalysis | string | 属性分析器的bean名类名,必须实现接口 \Dreamcat\PropertyAnalysis\PropertyAnalysisInterface 才有效 | null |
| bodyDecoders | string[] | 特定content-type的消息解码器,必须实现接口 \DreamCat\ControllerParamGen\HttpBodyDecodeInterface | null |
| specParams | Map<string, string> | 特殊类的构造器,键是类名,值是对应的bean,必须实现接口 \DreamCat\ControllerParamGen\ParamCreateInterface | null |
| jsonCoder.transMode | 0 / 1 / 2 | 1 表示会自动将对象的驼峰风格与参数的下划线风格互相映射, 2 表示会自动将对象的下划线风格与参数的驼峰风格互相映射 | 0 |
| jsonCoder.ignoreUndefine | bool | 对响应对象中未赋值的字段是否不做输出 | true |
统计信息
- 总下载量: 997
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-18