diff --git a/.gitignore b/.gitignore index c50e1c7..2c5d926 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ package-lock.json App_Data/ *.patch Configure.Secrets.cs +.env # User-specific files *.suo diff --git a/MyApp.ServiceInterface/JobServices.cs b/MyApp.ServiceInterface/JobServices.cs new file mode 100644 index 0000000..2e047e0 --- /dev/null +++ b/MyApp.ServiceInterface/JobServices.cs @@ -0,0 +1,35 @@ +using MyApp.Data; +using MyApp.ServiceModel; +using ServiceStack; +using ServiceStack.OrmLite; + +namespace MyApp.ServiceInterface; + +public class JobServices(QuestionsProvider QuestionsProvider) : Service +{ + public async Task Get(CheckPostJobs request) + { + // Place holder for the actual implementation + var post = Db.Single(x => x.Id == 105372); + JobIdCount++; + var questionFile = await QuestionsProvider.GetQuestionAsync(post.Id); + var question = await questionFile.GetQuestionAsync(); + + var result = new List + { + new PostJob + { + JobId = JobIdCount, + Body = question?.Post.Body, + Tags = post.Tags, + Title = post.Title, + PostId = post.Id + } + }; + + return new CheckPostJobsResponse { Results = result }; + } + + // For testing purposes + public static int JobIdCount; +} \ No newline at end of file