当前位置:网站首页>Metadata management - the complete implementation of dynamic form designer in crudapi system

Metadata management - the complete implementation of dynamic form designer in crudapi system

2021-03-01 10:21:43 crudapi

Form design

In the previous article , We introduce some basic functions of form design through a series of cases , Form design plays a very important role , It's also crudapi The core , So this article will introduce some other functions in form design in detail .

Summary

form field column attribute

List English names describe
name English name
caption Chinese name
autoIncrement Is it self growth
description describe
displayOrder Serial number ,UI The order shown in
dataType data type , Like strings 、 Integers, etc
seqId Serial number ID, Used to set the serial number
indexName The index name
indexStorage Index storage , Support BTREE、HASH
indexType Index type , Support PRIMARY, UNIQUE, INDEX, FULLTEXT
length length
precision Precision 、 accurate ( precision ), Represents the number of significant digits in the field
scale scale 、 Range of values , Represents the number of decimal places in the field
nullable Can it be empty
unsigned Whether there is no sign
insertable Is it possible to insert
queryable Whether it can be queried
systemable Whether the system field
updatable Modifiable or not
createdDate Creation time
lastModifiedDate Modification time

Not all of the above attributes are valid at the same time , such as unsigned Only in dataType It works when it's a number , It is ignored when it is a string , Other situations are similar .

System fields

system When you create a form, it will be added by default 5 A system field , They are numbers id, name name, Full-text index fullTextBody, Creation time createdDate And modification time lastModifiedDate, With customer For example , System fields json The contents are as follows :

[{
    "autoIncrement": true,
    "caption": " Number ",
    "createdDate": 1613181300985,
    "dataType": "BIGINT",
    "description": " Primary key ",
    "displayOrder": 0,
    "id": 253,
    "indexType": "PRIMARY",
    "insertable": false,
    "lastModifiedDate": 1613182114133,
    "length": 20,
    "name": "id",
    "nullable": false,
    "queryable": false,
    "systemable": true,
    "unsigned": true,
    "updatable": false
}, {
    "autoIncrement": false,
    "caption": " name ",
    "createdDate": 1613181300985,
    "dataType": "VARCHAR",
    "description": " name ",
    "displayOrder": 1,
    "id": 254,
    "insertable": true,
    "lastModifiedDate": 1613182114133,
    "length": 200,
    "name": "name",
    "nullable": false,
    "queryable": true,
    "systemable": true,
    "unsigned": false,
    "updatable": true
}, {
    "autoIncrement": false,
    "caption": " Full-text index ",
    "createdDate": 1613181300985,
    "dataType": "TEXT",
    "description": " Full-text index ",
    "displayOrder": 2,
    "id": 255,
    "indexName": "ft_fulltext_body",
    "indexType": "FULLTEXT",
    "insertable": false,
    "lastModifiedDate": 1613182114133,
    "name": "fullTextBody",
    "nullable": true,
    "queryable": false,
    "systemable": true,
    "unsigned": false,
    "updatable": false
}, {
    "autoIncrement": false,
    "caption": " Creation time ",
    "createdDate": 1613181300985,
    "dataType": "DATETIME",
    "description": " Creation time ",
    "displayOrder": 3,
    "id": 256,
    "insertable": false,
    "lastModifiedDate": 1613182114133,
    "name": "createdDate",
    "nullable": false,
    "queryable": false,
    "systemable": true,
    "unsigned": false,
    "updatable": false
}]

Uniqueness index

Index types include primary keys 、 The full text 、 Ordinary 、 only , Full text indexing has been introduced before , Ordinary index is mainly to improve query efficiency , Here we mainly introduce the unique index index Customer list mobile Create unique index of mobile field , Mobile phone number cannot be repeated

uqmobile When you add a customer , Enter and add the existing mobile phone number , Prompt for duplicate errors , Consistent with expectations , Unique index can prevent data duplication .

Joint index

If the index has only one field , When setting column properties, directly set . If it's a joint index of multiple fields , It needs to be set up separately . Here you can create two types of common or unique union indexes , Select multiple fields from the drop-down box . unionindex Such as to customer Set up a union index , The final index function is similar to the previous single field index .

The attachment

The attachment type field supports saving attachments , Mainly documents 、 Pictures, etc

url Settings file file Tabular url The link field property is ATTACHMENT

file When entering data , The attachment field can upload files , If it's a picture, you can preview it .

Form design API

Swagger Form design provides API, If the background management provided by default UI Not suitable for , It can be redeveloped , The redesign UI, adopt API Manage forms ,API The documents are as follows :
https://demo.crudapi.cn/swagger-ui.html

api Postman Inquire about customer Table cell data .

Summary

This paper introduces the complete function of form design , Either through UI Configuration to realize , It can also be done through API Secondary development .

attach demo demonstration

This system belongs to the product level zero code platform , Unlike automatic code generators , You don't have to generate Controller、Service、Repository、Entity And so on , The program can be used as soon as it runs , real 0 Code , It can cover basic business independent CRUD RESTful API.

Official website address :https://crudapi.cn
Address of the test :https://demo.crudapi.cn/crudapi/login

版权声明
本文为[crudapi]所创,转载请带上原文链接,感谢
https://chowdera.com/2021/03/20210301102004584m.html

随机推荐