-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
181 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
API/ASSISTENTE.Infrastructure.Firecrawl/Contracts/PageDetails.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using CSharpFunctionalExtensions; | ||
|
||
namespace ASSISTENTE.Infrastructure.Firecrawl.Contracts; | ||
|
||
public class PageDetails | ||
{ | ||
private PageDetails(string url, string title, string content, string links) | ||
{ | ||
Url = url; | ||
Title = title; | ||
Content = content; | ||
Links = links; | ||
} | ||
|
||
public string Url { get; } | ||
public string Title { get; } | ||
public string Content { get; } | ||
public string Links { get; } | ||
|
||
public static Result<PageDetails> Create(string? url, string? title, string? content, string? links) | ||
{ | ||
if (string.IsNullOrEmpty(url)) | ||
return Result.Failure<PageDetails>("Url is required."); | ||
|
||
if (string.IsNullOrEmpty(title)) | ||
return Result.Failure<PageDetails>("Title is required."); | ||
|
||
if (string.IsNullOrEmpty(content)) | ||
return Result.Failure<PageDetails>("Content is required."); | ||
|
||
if (string.IsNullOrEmpty(links)) | ||
return Result.Failure<PageDetails>("Links are required."); | ||
|
||
return new PageDetails(url, title, content, links); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters