提交 | 用户 | 时间
|
1ac2bc
|
1 |
package cn.stylefeng.guns.gen.modular.model; |
懒 |
2 |
|
|
3 |
import cn.stylefeng.guns.base.db.model.TableFieldInfo; |
|
4 |
import cn.stylefeng.guns.gen.core.enums.InputTypeEnum; |
|
5 |
import com.baomidou.mybatisplus.generator.config.po.TableField; |
|
6 |
import lombok.Data; |
|
7 |
|
|
8 |
import java.util.List; |
|
9 |
import java.util.Map; |
|
10 |
|
|
11 |
/** |
|
12 |
* 字段详情配置 |
|
13 |
* |
|
14 |
* @author fengshuonan |
|
15 |
* @date 2020-01-19-5:19 下午 |
|
16 |
*/ |
|
17 |
@Data |
|
18 |
public class FieldConfig extends TableFieldInfo { |
|
19 |
|
|
20 |
/** |
|
21 |
* 字段是否为查询条件 |
|
22 |
*/ |
|
23 |
private Boolean queryConditionFlag = false; |
|
24 |
|
|
25 |
/** |
|
26 |
* 代码生成后,字段的input框样式,可参考 |
|
27 |
*/ |
|
28 |
public Integer inputType = InputTypeEnum.TEXT.getType(); |
|
29 |
|
|
30 |
/** |
|
31 |
* 代码生成后,字段的input框样式,可参考 |
|
32 |
*/ |
|
33 |
public List<Map<String, Object>> inputTypeList = InputTypeEnum.getInputs(); |
|
34 |
|
|
35 |
/** |
|
36 |
* 最终返回时候以inputType这个值为准 |
|
37 |
* |
|
38 |
* @author fengshuonan |
|
39 |
* @Date 2020/1/19 6:18 下午 |
|
40 |
*/ |
|
41 |
public List<Map<String, Object>> getInputTypeList() { |
|
42 |
return InputTypeEnum.getInputs(InputTypeEnum.valueOfType(this.inputType)); |
|
43 |
} |
|
44 |
|
|
45 |
/** |
|
46 |
* 从TableField抽取属性 |
|
47 |
* |
|
48 |
* @author fengshuonan |
|
49 |
* @Date 2020/1/27 1:22 下午 |
|
50 |
*/ |
|
51 |
public static FieldConfig getFromTableField(TableField tableField) { |
|
52 |
FieldConfig fieldConfig = new FieldConfig(); |
|
53 |
fieldConfig.setCamelFieldName(tableField.getPropertyName()); |
|
54 |
fieldConfig.setColumnComment(tableField.getComment()); |
|
55 |
fieldConfig.setColumnName(tableField.getName()); |
|
56 |
return fieldConfig; |
|
57 |
|
|
58 |
} |
|
59 |
|
|
60 |
} |