Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Bug fixes and refactors due to database changes #12

Merged
merged 25 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
cb85b94
Fixed Creation of Reactant_Product
AmazingBrandonL Apr 9, 2024
a5d67aa
Merge branch 'main' into Additional-Routes-for-Front-End
ecyr20 Apr 9, 2024
e51a0ab
Fixed Reactant Product List
ecyr20 Apr 9, 2024
131ac97
Fixed create reactant product list
ecyr20 Apr 9, 2024
b0b7b8b
Fixed Deleting Reactant Product list
ecyr20 Apr 9, 2024
9fce627
Fixed OpenAtmos unit brackets
ecyr20 Apr 9, 2024
f4d208e
Fixed empty brackets for OpenAtmos
ecyr20 Apr 9, 2024
22195be
Fixed reaction in OpenAtmos JSON
ecyr20 Apr 9, 2024
fe05c52
Initial YAML Config
ecyr20 Apr 11, 2024
232777b
Changed Families to go directly to Tag Mechanism
ecyr20 Apr 11, 2024
a7876d2
Changed database
AmazingBrandonL Apr 12, 2024
62a4ad6
Added a Reaction route to give back the reaction string
ecyr20 Apr 13, 2024
5b0d2f4
Changed Reaction String to give back <none>
ecyr20 Apr 13, 2024
0393f93
Changed Get Reaction to give back a reaction string with it
ecyr20 Apr 14, 2024
e485fca
Changed the other Reaction Gets to give back reaction string
ecyr20 Apr 14, 2024
f097bc2
Changed Update route for Reactant Product List
ecyr20 Apr 15, 2024
ce96327
Forgot to save a model change
ecyr20 Apr 16, 2024
583d058
Added new PropertyType Route
ecyr20 Apr 16, 2024
3c2b20f
Update Versioning of Properties
AmazingBrandonL Apr 17, 2024
495910a
Renaming the tag Mechanism
AmazingBrandonL Apr 17, 2024
69930b2
Delete checks for Fam and TagMech
BrianWinner Apr 18, 2024
685ca68
Removed unused files and Changed FamilyMechList to FamilyTagMechList
ecyr20 Apr 19, 2024
7eed7f2
Added deletion checks for GETs
ecyr20 Apr 19, 2024
fcef5e7
Forgot 2 GETs in the last push
ecyr20 Apr 19, 2024
4b934d8
Fixed Database Name
AmazingBrandonL Apr 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Controllers/FamilyController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task<IReadOnlyList<Family>> Get()

// POST api/Family/create
[HttpPost("create")]
public async Task<Guid> Create([FromBody] string name)
public async Task<Family> Create([FromBody] string name)
{
return await familyService.CreateFamilyAsync(name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,40 @@ namespace Chemistry_Cafe_API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class FamilyMechListController : ControllerBase
public class FamilyTagMechListController : ControllerBase
{
private FamilyMechListService familyMechListService;
private FamilyTagMechListService familyMechListService;

//Injects sql data source setup in Program.cs
public FamilyMechListController([FromServices] MySqlDataSource db)
public FamilyTagMechListController([FromServices] MySqlDataSource db)
{
this.familyMechListService = new FamilyMechListService(db);
this.familyMechListService = new FamilyTagMechListService(db);
}

// GET: api/FamilyMechList/all
[HttpGet("all")]
public async Task<IReadOnlyList<FamilyMechList>> Get()
public async Task<IReadOnlyList<FamilyTagMechList>> Get()
{
return await familyMechListService.GetFamilyMechListsAsync();
}

// GET api/FamilyMechList/5
[HttpGet("{uuid}")]
public async Task<FamilyMechList?> Get(Guid uuid)
public async Task<FamilyTagMechList?> Get(Guid uuid)
{
return await familyMechListService.GetFamilyMechListAsync(uuid);
}

// POST api/FamilyMechList/create
[HttpPost("create")]
public async Task<Guid> Create([FromBody] FamilyMechList newFamilyMechList)
public async Task<Guid> Create([FromBody] FamilyTagMechList newFamilyMechList)
{
return await familyMechListService.CreateFamilyMechListAsync(newFamilyMechList);
}

// PUT api/FamilyMechList/5
[HttpPut("update")]
public async Task Put([FromBody] FamilyMechList newFamilyMechList)
public async Task Put([FromBody] FamilyTagMechList newFamilyMechList)
{
await familyMechListService.UpdateFamilyMechListAsync(newFamilyMechList);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,40 @@ namespace Chemistry_Cafe_API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class FamilyMechListVersionController : ControllerBase
public class FamilyTagMechListVersionController : ControllerBase
{
private FamilyMechListVersionService familyMechListVersionService;
private FamilyTagMechListVersionService familyMechListVersionService;

//Injects sql data source setup in Program.cs
public FamilyMechListVersionController([FromServices] MySqlDataSource db)
public FamilyTagMechListVersionController([FromServices] MySqlDataSource db)
{
this.familyMechListVersionService = new FamilyMechListVersionService(db);
this.familyMechListVersionService = new FamilyTagMechListVersionService(db);
}

// GET: api/FamilyMechListVersion/all
[HttpGet("all")]
public async Task<IReadOnlyList<FamilyMechListVersion>> Get()
public async Task<IReadOnlyList<FamilyTagMechListVersion>> Get()
{
return await familyMechListVersionService.GetFamilyMechListVersionsAsync();
}

// GET api/FamilyMechListVersion/5
[HttpGet("{uuid}")]
public async Task<FamilyMechListVersion?> Get(Guid uuid)
public async Task<FamilyTagMechListVersion?> Get(Guid uuid)
{
return await familyMechListVersionService.GetFamilyMechListVersionAsync(uuid);
}

// POST api/FamilyMechListVersion/create
[HttpPost("create")]
public async Task<Guid> Create([FromBody] FamilyMechListVersion newFamilyMechListVersion)
public async Task<Guid> Create([FromBody] FamilyTagMechListVersion newFamilyMechListVersion)
{
return await familyMechListVersionService.CreateFamilyMechListVersionAsync(newFamilyMechListVersion);
}

// PUT api/FamilyMechListVersion/5
[HttpPut("update")]
public async Task Put([FromBody] FamilyMechListVersion newFamilyMechListVersion)
public async Task Put([FromBody] FamilyTagMechListVersion newFamilyMechListVersion)
{
await familyMechListVersionService.UpdateFamilyMechListVersionAsync(newFamilyMechListVersion);
}
Expand Down
57 changes: 0 additions & 57 deletions Controllers/MechTagMechListController.cs

This file was deleted.

57 changes: 0 additions & 57 deletions Controllers/MechTagMechListVersionController.cs

This file was deleted.

65 changes: 0 additions & 65 deletions Controllers/MechanismController.cs

This file was deleted.

11 changes: 9 additions & 2 deletions Controllers/OpenAtmosController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ public OpenAtmosController([FromServices] MySqlDataSource db)

// GET: api/OpenAtmos/JSON
[HttpGet("JSON/{tag_mechanism_uuid}")]
public async Task<string> Get(Guid tag_mechanism_uuid)
public async Task<string> GetJSON(Guid tag_mechanism_uuid)
{
return await openAtmosService.Get(tag_mechanism_uuid);
return await openAtmosService.GetJSON(tag_mechanism_uuid);
}

// GET: api/OpenAtmos/YAML
[HttpGet("YAML/{tag_mechanism_uuid}")]
public async Task<string> GetYAML(Guid tag_mechanism_uuid)
{
return await openAtmosService.GetYAML(tag_mechanism_uuid);
}

}
Expand Down
7 changes: 7 additions & 0 deletions Controllers/PropertyTypeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ public async Task<IReadOnlyList<PropertyType>> Get()
return await propertyTypeService.GetPropertyTypeAsync(uuid);
}

// GET: api/PropertyType/Validation/uuid
[HttpGet("Validation/{validation}")]
public async Task<IReadOnlyList<PropertyType>> GetValidation(string validation)
{
return await propertyTypeService.GetPropertyTypeValidationAsync(validation);
}

// POST api/PropertyType/create
[HttpPost("create")]
public async Task<Guid> Create([FromBody] PropertyType propertyType)
Expand Down
10 changes: 5 additions & 5 deletions Controllers/ReactantProductListController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ public async Task Create([FromBody] ReactantProductList reactantProduct)

// PUT api/ReactantProductList/5
[HttpPut("update")]
public async Task Put([FromBody] ReactantProductList userpreferences)
public async Task Put([FromBody] ReactantProductList reactantProductList)
{
await userpreferencesService.UpdateReactantProductListAsync(userpreferences);
await userpreferencesService.UpdateReactantProductListAsync(reactantProductList);
}

// DELETE api/ReactantProductList/delete/5
[HttpDelete("delete/{uuid}")]
public async Task Delete(Guid uuid)
// DELETE api/ReactantProductList/delete Body [reaction_product_uuid, species_uuid]
[HttpDelete("delete")]
public async Task Delete([FromBody]DeleteReactantProductList uuid)
{
await userpreferencesService.DeleteReactantProductListAsync(uuid);
}
Expand Down
7 changes: 7 additions & 0 deletions Controllers/ReactionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ public async Task<IReadOnlyList<Reaction>> Get()
return await reactionService.GetReactionAsync(uuid);
}

// GET api/Reaction/String/5
[HttpGet("String/{uuid}")]
public async Task<String?> GetString(Guid uuid)
{
return await reactionService.GetReactionStringAsync(uuid);
}

// GET api/Reaction/TagMechanism/5
[HttpGet("TagMechanism/{tag_mechanism_uuid}")]
public async Task<IReadOnlyList<Reaction>> GetTags(Guid tag_mechanism_uuid)
Expand Down
Loading
Loading