Skip to content

Commit 7804202

Browse files
Add List of shortened link handler
1 parent 81cac7d commit 7804202

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

docs.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ This command is a record that acts as a data transfer object (DTO) for the neces
2525
### GenerateShortCodeCommandHandler
2626
This class handles the logic for generating a shortened link. It involves several steps:
2727

28-
Validation: It first ensures that the provided URL and other parameters meet specific criteria through the GenerateShortCodeValidator.
29-
Short Code Generation: If no custom back half is provided, it generates a unique short code for the URL using the IShortCodeGenerator service.
30-
Link Creation: It creates a new Link entity with the provided details and the generated or provided short code.
31-
Database Insertion: The new link entity is added to the database.
32-
Caching: The newly created link is cached using the ICacheProvider service, with the expiration date set accordingly.
33-
Response: It returns a Result<LinksDto> object, which includes details of the created link, such as the short code, original URL, and expiration date.
28+
- Validation: It first ensures that the provided URL and other parameters meet specific criteria through the GenerateShortCodeValidator.
29+
- Short Code Generation: If no custom back half is provided, it generates a unique short code for the URL using the IShortCodeGenerator service.
30+
- Link Creation: It creates a new Link entity with the provided details and the generated or provided short code.
31+
- Database Insertion: The new link entity is added to the database.
32+
- Caching: The newly created link is cached using the ICacheProvider service, with the expiration date set accordingly.
33+
- Response: It returns a Result<LinksDto> object, which includes details of the created link, such as the short code, original URL, and expiration date.
3434
Execution Flow in the Controller
3535
The LinkController class exposes an endpoint that handles the "Shorten" use case. The Shorten method in the controller:
3636

0 commit comments

Comments
 (0)