Discuz! Board

 找回密碼
 立即註冊
搜索
熱搜: 活動 交友 discuz
查看: 2|回復: 0

This section covers the topic in more depth

[複製鏈接]

2

主題

2

帖子

8

積分

新手上路

Rank: 1

積分
8
發表於 2023-12-27 16:10:19 | 顯示全部樓層 |閱讀模式
Chapter 1 of this series.  so you can read it to understand the concepts better. Generate a new resource To generate a new resource run the following command Copy You will see some prompts. Answer the corresponding question User Rest Yes Now you should find a new module in the directory which contains all the boilerplate files for the endpoints. Inside the file you will see definitions of different routes also known as route handlers. The business logic to handle each request is encapsulated in files. If you open the generated page you should get See below for the automatically generated user endpoint added to the module. To access inside the module you have to add it as an import. Add the following to replication You can now inject it inside and use it to access the database. To do this add a constructor as shown below Copy define the entity and class just like you would define a class for the entities in the presentation layer.

Define the class in the file as follows Copy the dec photo editing servies orator to make the property pairs visible. Note that you didn't add a decorator to the field. This is because the field is sensitive and you don't want to expose it in . Note that omitting the decorator only hides the property from the document. The attribute remains visible in the response body. You'll deal with this issue in a later section. Data transfer objects are objects that define how data is sent over a network. You need implementations and classes to define the data sent to the user when creating and updating respectively. The class defined in the file is copied as follows and the validation decorator is used to validate the data sent to it. Chapter 2 of this series covers verification in more detail.



The definition of is automatically inferred from the definition and therefore does not require an explicit definition. Define the class responsible for modifying and getting data from the database and providing it to you using the and methods you will implement in this class. The replication definition class is responsible for handling requests and responses to the endpoint. It will be used to access the database to define the response body and to define the request body. The controller consists of different route handlers. You will implement five route handlers in this class which correspond to the five endpoints. Update the implementation of these route handlers as shown below. Copy the updated controller and use decorators to group the endpoints under tags. It also uses and decorators to define the response body for each



回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

Archiver|手機版|自動贊助|GameHost抗攻擊論壇

GMT+8, 2025-4-16 03:03 , Processed in 0.031430 second(s), 18 queries .

抗攻擊 by GameHost X3.4

© 2001-2017 Comsenz Inc.

快速回復 返回頂部 返回列表
一粒米 | 中興米 | 論壇美工 | 設計 抗ddos | 天堂私服 | ddos | ddos | 防ddos | 防禦ddos | 防ddos主機 | 天堂美工 | 設計 防ddos主機 | 抗ddos主機 | 抗ddos | 抗ddos主機 | 抗攻擊論壇 | 天堂自動贊助 | 免費論壇 | 天堂私服 | 天堂123 | 台南清潔 | 天堂 | 天堂私服 | 免費論壇申請 | 抗ddos | 虛擬主機 | 實體主機 | vps | 網域註冊 | 抗攻擊遊戲主機 | ddos |