This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
201fa58
commit 9e6df84
Showing
7 changed files
with
72 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System.Collections.Generic; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Tweety.Models; | ||
using TweetyCore.Utils; | ||
|
||
namespace TweetyCore.Controllers | ||
{ | ||
[Route("api/v1/tweety")] | ||
[ApiController] | ||
public class ApiController : ControllerBase | ||
{ | ||
[HttpPost("find")] | ||
public IActionResult Index([FromBody] Tags requestBody) | ||
{ | ||
if (ModelState.IsValid) | ||
{ | ||
TwitterConnect twitterConnect = new TwitterConnect(); | ||
var result = twitterConnect.ProcessTag(requestBody); | ||
|
||
if (result.Count > 0) | ||
{ | ||
return Ok(new | ||
{ | ||
status = 200, | ||
message = "Success", | ||
result | ||
}); | ||
} | ||
else | ||
{ | ||
return Ok(new { | ||
status = 200, | ||
message = "Empty Result", | ||
result = new List<string>() | ||
}); | ||
}; | ||
|
||
} | ||
return BadRequest(); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Tweety.Models; | ||
|
||
namespace TweetyCore.Models | ||
{ | ||
public class TweetResponse | ||
{ | ||
public int Count { get; set; } | ||
public TweetResult Data { get; set; } | ||
} | ||
} |
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