Skip to content

Commit c9b7f45

Browse files
Add Endpoints documents.
1 parent a610714 commit c9b7f45

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

docs.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,48 @@ The Circuit Breaker automatically attempts to close the circuit after a specifie
7676

7777
In the RedisCacheProvider class, Polly's Circuit Breaker policies are configured for different cache operations (Set, Remove, Get). These policies define the conditions under which the circuit should open (e.g., on a RedisConnectionException) and the duration for which the circuit remains open before allowing another attempt. This approach enhances the reliability and stability of cache operations within the SwiftLink application, especially in scenarios where the Redis cache might be temporarily inaccessible or unreliable.
7878

79-
## Endpoints
79+
## Endpoints
80+
https://github.com/mohammadkarimi/swiftlink/blob/main/src/SwiftLink.Presentation/Controllers/V1/LinkController.cs
81+
https://github.com/mohammadkarimi/swiftlink/blob/main/src/SwiftLink.Presentation/Controllers/V1/SubscriberController.cs
82+
83+
Based on the provided information from the LinkController and SubscriberController within the SwiftLink.Presentation/Controllers/V1 directory, here is a list of the endpoints in the SwiftLink project and a description of each:
84+
85+
### LinkController Endpoints
86+
### POST /Shorten
87+
Description: This endpoint is used to create a shortened URL. It accepts a GenerateShortCodeCommand object in the request body, which likely includes the original URL and possibly other metadata for generating the short code.
88+
Use Case: When a user wants to shorten a URL.
89+
90+
### GET /{shortCode}
91+
Description: This endpoint is responsible for redirecting a user to the original URL associated with the given short code. It may also accept a password query parameter if the link is protected.
92+
Use Case: When a user visits a shortened URL.
93+
94+
### GET /List
95+
Description: Lists all the shortened links based on the criteria provided in the ListOfLinksQuery object.
96+
Use Case: To retrieve a list of shortened links, possibly for administrative or user dashboard purposes.
97+
98+
### GET /Count
99+
Description: Returns a count of visits to shortened links based on the CountVisitShortenLinkQuery object.
100+
Use Case: To get analytics or metrics on the usage of shortened links.
101+
102+
### PUT /Update
103+
Description: Updates an existing shortened link. It accepts an UpdateLinkCommand object, which likely includes the ID of the link to update and the new details.
104+
Use Case: When a user needs to modify the details of an existing shortened link.
105+
106+
### DELETE /Disable/{id}
107+
Description: Disables a shortened link based on the provided ID.
108+
Use Case: To disable or "soft delete" a shortened link, making it inaccessible to users.
109+
110+
### GET /GetByGroupName
111+
Description: Retrieves shortened links by a group name specified in the GetLinkByGroupNameQuery object.
112+
Use Case: Useful for organizing and retrieving links that are grouped under a specific category or tag.
113+
114+
### GET /Inquery
115+
Description: Inquires about the availability or status of a back half (the part of the URL after the domain) based on the InquiryBackHalfQuery object.
116+
Use Case: Before creating a custom back half for a shortened link, this can check if the desired back half is available.
117+
118+
## SubscriberController Endpoints
119+
### POST /Add
120+
Description: Adds a new subscriber to the system. It accepts an AddSubscriberCommand object, which likely includes subscriber details such as email.
121+
Use Case: When a new user subscribes to the service, possibly for updates or newsletters.
122+
123+
Each endpoint serves a specific function within the SwiftLink application, ranging from URL shortening and redirection to subscriber management and analytics.

0 commit comments

Comments
 (0)