api-server-setup #1

Merged
derek merged 37 commits from api-server-setup into main 2025-07-15 21:17:25 -07:00
2 changed files with 51 additions and 0 deletions
Showing only changes of commit 055ca16b6c - Show all commits
+2
View File
@@ -11,6 +11,8 @@ Server:
Need to timeout email reset tokens:
Need to impliment Reset / Delte JobListingContorller
Client:
@@ -0,0 +1,49 @@
using Microsoft.AspNetCore.Mvc;
using BoredCareers.Services.DatabaseService;
using BoredCareers.Entities;
using System.Web.Http;
namespace BoredCareers.Controllers {
[ApiController]
[Route("api/joblisting/")]
public class JobListingController : MistoxControllerBase {
public JobListingController(DatabaseService db) : base(db) {}
[Route("getlistings")]
[HttpPost]
public async Task<IActionResult> GetJobListings([FromForm] int page) {
if (isLoggedIn()) {
JobListing[] jobListings = await _databaseService.GetJobListingPage(page, 25); // 10 items per page
return Ok(jobListings);
}
return NotFound();
}
[Route("getlisting")]
[HttpPost]
public async Task<IActionResult> GetJobListing([FromForm] int JobListingID) {
JobListing? jobListing = await _databaseService.GetJobListing(JobListingID);
if (jobListing == null) {
return Ok(jobListing);
}
return NotFound();
}
[Route("set")]
[HttpPost]
public async Task<IActionResult> SetJobListing([FromBody] Resume resume) {
await Task.Delay(1);
return Ok();
}
[Route("delete")]
[HttpPost]
public async Task<IActionResult> DeleteJobListing([FromForm] int ResumeID) {
await Task.Delay(1);
return Ok();
}
}
}