feat(apiv2): group stubs, authentication middleware, /systems/:id endpoint
This commit is contained in:
66
PluralKit.API/Controllers/v2/GroupControllerV2.cs
Normal file
66
PluralKit.API/Controllers/v2/GroupControllerV2.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PluralKit.Core;
|
||||
|
||||
namespace PluralKit.API
|
||||
{
|
||||
[ApiController]
|
||||
[ApiVersion("2.0")]
|
||||
[Route("v{version:apiVersion}")]
|
||||
public class GroupControllerV2: PKControllerBase
|
||||
{
|
||||
public GroupControllerV2(IServiceProvider svc) : base(svc) { }
|
||||
|
||||
[HttpGet("systems/{system_id}/groups")]
|
||||
public async Task<IActionResult> GetSystemGroups(string system_id)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
|
||||
[HttpPost("groups")]
|
||||
public async Task<IActionResult> GroupCreate(string group_id)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
|
||||
[HttpGet("groups/{group_id}")]
|
||||
public async Task<IActionResult> GroupGet(string group_id)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
|
||||
[HttpPatch("groups/{group_id}")]
|
||||
public async Task<IActionResult> GroupPatch(string group_id)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
|
||||
[HttpDelete("groups/{group_id}")]
|
||||
public async Task<IActionResult> GroupDelete(string group_id)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
90
PluralKit.API/Controllers/v2/GroupMemberControllerV2.cs
Normal file
90
PluralKit.API/Controllers/v2/GroupMemberControllerV2.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace PluralKit.API
|
||||
{
|
||||
[ApiController]
|
||||
[ApiVersion("2.0")]
|
||||
[Route("v{version:apiVersion}")]
|
||||
public class GroupMemberControllerV2: PKControllerBase
|
||||
{
|
||||
public GroupMemberControllerV2(IServiceProvider svc) : base(svc) { }
|
||||
|
||||
[HttpGet("groups/{group_id}/members")]
|
||||
public async Task<IActionResult> GetGroupMembers(string group_id)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
|
||||
[HttpGet("members/{member_id}/groups")]
|
||||
public async Task<IActionResult> GetMemberGroups(string member_id)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
|
||||
[HttpPut("groups/{group_id}/members/{member_id}")]
|
||||
public async Task<IActionResult> GroupMemberPut(string group_id, string member_id)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
|
||||
[HttpPut("groups/{group_id}/members")]
|
||||
public async Task<IActionResult> GroupMembersPut(string group_id, [FromBody] JArray members)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
|
||||
[HttpDelete("groups/{group_id}/members/{member_id}")]
|
||||
public async Task<IActionResult> GroupMemberDelete(string group_id, string member_id)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
|
||||
[HttpDelete("groups/{group_id}/members")]
|
||||
public async Task<IActionResult> GroupMembersDelete(string group_id, [FromBody] JArray members)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
|
||||
[HttpPut("members/{member_id}/groups")]
|
||||
public async Task<IActionResult> MemberGroupsPut(string member_id, [FromBody] JArray groups)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
|
||||
[HttpDelete("members/{member_id}/groups")]
|
||||
public async Task<IActionResult> MemberGroupsDelete(string member_id, [FromBody] JArray groups)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -16,13 +16,12 @@ namespace PluralKit.API
|
||||
{
|
||||
public SystemControllerV2(IServiceProvider svc) : base(svc) { }
|
||||
|
||||
[HttpGet("{system}")]
|
||||
public async Task<IActionResult> SystemGet(string system)
|
||||
[HttpGet("{systemRef}")]
|
||||
public async Task<IActionResult> SystemGet(string systemRef)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
var system = await ResolveSystem(systemRef);
|
||||
if (system == null) return NotFound();
|
||||
else return Ok(system.ToJson(LookupContextFor(system)));
|
||||
}
|
||||
|
||||
[HttpPatch("{system}")]
|
||||
|
Reference in New Issue
Block a user