-
Can refer to
- com.xiaomi.thain.component.std.MailComponent
- com.xiaomi.thain.component.std.HttpComponent
-
Use annotations: com.xiaomi.thain.component.annotation.ThainComponent
- group: The group to which the component belongs, such as std, xdata, etc., used to distinguish components
- name: the component name, such as: http
- defineJson
- component-defined json
- This json is used for field validation, front-end component display, etc.
-
json definition
-
Format:
/** * https://app.quicktype.io/#l=schema This site generates json * * Component front-end schema * */ Export type ComponentDefineJson = Array<{ /** * Key passed to the backend */ Property: string; /** * Required or not, false or not written is not required */ Required?: boolean; /** * Enter the identifier in front of the box, do not write the default property */ Label?: string; Input: | { Id: 'line' | 'textarea' | 'sql' | 'shell' | 'richText'; } | { Id: 'select'; Options: Array<{ /** * the value of the attribute */ Id: string; /** * The candidate in the drop-down box is not written with id instead */ Name?: string; }>; }; }>;
-
-
java class design
- Define the property in json in the java class, and the runtime will automatically inject according to the information filled in by the user.
- You can define a property of type com.xiaomi.thain.component.tools.ComponentTools
- ComponentTools has many features in this interface
-
ComponentTools interface
- com.xiaomi.thain.component.tools.ComponentTools See comments