当前位置:网站首页>Universal crud interface

Universal crud interface

2022-07-06 02:35:00 Front end pww

 If   There are two templates   Functions are to add, delete, modify and check   Interfaces are similar operations   You can use the shared interface 

Implement different interfaces , Realize the function of adding, deleting, modifying and querying in different database models

adopt params Parameters refer to the database model :(rest Is the prefix of the interface , Prevent interface naming conflicts )

  You need to declare in advance that the router can get the parent class pramas Parameters :

  Third party libraries used :( Used to process string conversion to class name )

  Import database model , It can be processed through middleware : Route (:resoure) The parameters are converted into the corresponding database model and mounted in req in (req.Model)

The path of the front-end access interface is :

categories As params Parameters , Pass it to the back end app.use(), That is to say req.params.resoure

 

  The path of back-end routing processing is ;

 

原网站

版权声明
本文为[Front end pww]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140014130400.html