当前位置:网站首页>Generate crud restful API by configuring zero code without programming
Generate crud restful API by configuring zero code without programming
2022-07-20 09:01:00 【crudapi】
Hello,crudapi!( Hello , Add delete check interface !)
In this paper, through the student object as an example , No programming , By configuration CRUD RESTful API.
Summary
CRUD brief introduction
crud It refers to the increase in the calculation process (Create)、 retrieval (Retrieve)、 to update (Update) And delete (Delete) The initials of a few words .crud It is mainly used to describe the basic operation function of database or persistence layer in software system .
RESTfull API
REST( english :Representational State Transfer, abbreviation REST) Describes an architecture style network system , such as web Applications . It first appeared in 2000 year Roy Fielding In his doctoral thesis ,Roy Fielding yes HTTP One of the main authors of the specification . In the current mainstream of three kinds Web In the service interaction scheme ,REST Compared with SOAP(Simple Object Access protocol, Simple object access protocol ) as well as XML-RPC It's simpler , Both for URL The treatment is still right Payload The coding ,REST They tend to design and implement in a simpler and lighter way . It is worth noting that REST There is no clear standard , It's more like a design style through RESTful API Realization , The specific interface of student operation is as follows
operation | REST ACTION | API |
---|---|---|
Add student | POST | /api/business/students |
Get student details | GET | /api/business/students/id |
Revise students | PATCH | /api/business/students/id |
Delete students | DELETE | /api/business/students/id |
Ask the students | GET | /api/business/students |
Table design
Student field design
Through the background metadata management UI Design student table fields , It mainly includes the name , Student number , Age , Major and other fields
Basic attributes
Object names uniquely identify different objects , Object plural is used for URL Resources in the path , The physical table name is ultimately the table name in the database
Field properties mainly include : name , type , Indexes , length , Precision etc.
More properties
Include : Whether it can be null , The default value is , Can I insert , Can I edit , Whether it can be inquired, etc
database
By looking at mysql database , Student list ca_student Generated
Swagger API file
https://demo.crudapi.cn/swagger-ui.html
Take creation as an example :/api/business/{name}, among name Plural the object name ( Compatible object name )
Business data
adopt post man verification API
Creating students
request URL
https://demo.crudapi.cn/api/business/students
request body
{
"name":" Zhugeliang ",
"stuNo":"10000",
"age":18,
"major":" Computer science and technology "
}
Return value 1 by id
Inquire about id by 1 Details of the students
request URL
https://demo.crudapi.cn/api/business/students/1
return body
{
"id": 1,
"name": " Zhugeliang ",
"createdDate": 1613013249000,
"stuNo": "10000",
"age": 18,
"major": " Computer science and technology "
}
adopt UI operation
Creating students
Get a list of all students
Other operating
And the editor , Delete etc. API similar , see swager Just documents !
Summary
In this paper, through the configuration of the form to achieve RESTful CRUD API, Compared with the traditional way of development as follows :
Realization way | The amount of code | Time | stability |
---|---|---|---|
Traditional development | 1000 Row or so | 2 God / people | 5 individual bug about |
cruapi System | 0 That's ok | 1 minute | Basic for 0 |
in summary , utilize crudapi The system can greatly improve work efficiency and save cost , Make data processing easier !
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
边栏推荐
猜你喜欢
随机推荐
php二位数组 按照里面的某个字段排序
Discuz大气游戏风格模板/仿lol英雄联盟游戏DZ游戏模板GBK
What is online payment?
富文本设置图片大小和字体大小
106 polkadot substrate : 无叉升级
VLQ的介绍
mysql和redis基础知识总结
基于多数据源零代码同时生成多个数据库CRUD增删改查RESTful API接口——MySql,PostgreSql,Oracle,Microsoft SQL Server
PHP怎么根据键值去除数组中的某个元素
Navicat如何修改语言(中文or英文)?
In addition to stripe, what overseas payment interfaces can PayPal use in China
How to apply for wechat H5 payment?
Les paiements groupés répondent aux besoins de toutes les industries pour accéder à divers canaux de paiement
Redis和MYSQL双写一致性分析
文件包含漏洞
机器学习中数据集csv编码格式问题
Vs2019 modify background + height custom font color
如何抓取 app 网站 的数据
MySQL binary solves the case sensitive problem of MySQL data
项目代码编程规范(设计类和方法、变量、for语句格式 、while语句、 switch语句 、封装事务)