* Presta.csproj: A first class
* AssemblyInfo.cs: initial commit * NpgsqlCircleProvider.cs: circle members are now stored in bd upon their user's name * InputCircle.cs: fixes the new CircleManager interface usage * Yavsc.sln: Adds the `Presta` project * CircleController.cs: * Authorize some Http methods * Lists circles as circles * style.css: Fixes the missing "hidden" css class * AccountController.cs: using the new Circle provider interface * BlogsController.cs: * using the new Circle provider interface * do not test blog entry collections in order to group them by a unique user name or title, it's too bad, instead, keep user's request id as guide to model and view. * YavscHelpers.cs: Adds a Circle Html formatter * Circles.aspx: List of circles is now given as a list of `Circle` objects * instdbws.sql: fixes the db in order to store user names in circle member's records. * BlogEntryCollection.cs: ConcernsAUniqueTitle and ConcernsAUniqueUser are now Obsoletes * UUTBlogEntryCollection.cs: Drops a useless ctor * CircleProvider.cs: The `CircleManager` now delivers the user's circle as a `Circle` object collection.
This commit is contained in:
parent
3fa55acf2e
commit
bdbda2a21f
21 changed files with 322 additions and 82 deletions
|
|
@ -60,7 +60,8 @@ namespace Yavsc.ApiControllers
|
|||
/// Create the specified circle.
|
||||
/// </summary>
|
||||
/// <param name="model">Model.</param>
|
||||
[Authorize]
|
||||
[Authorize,
|
||||
AcceptVerbs ("POST")]
|
||||
public long Create(NewCircle model)
|
||||
{
|
||||
string user = Membership.GetUser ().UserName;
|
||||
|
|
@ -72,7 +73,8 @@ namespace Yavsc.ApiControllers
|
|||
/// </summary>
|
||||
/// <param name="id">Circle Identifier.</param>
|
||||
/// <param name="username">username.</param>
|
||||
[Authorize]
|
||||
[Authorize,
|
||||
AcceptVerbs ("POST")]
|
||||
public void Add(long id, string username)
|
||||
{
|
||||
checkIsOwner (CircleManager.DefaultProvider.Get (id));
|
||||
|
|
@ -84,7 +86,9 @@ namespace Yavsc.ApiControllers
|
|||
/// Delete the circle specified by id.
|
||||
/// </summary>
|
||||
/// <param name="id">Identifier.</param>
|
||||
[Authorize] public void Delete(long id)
|
||||
[Authorize,
|
||||
AcceptVerbs ("GET")]
|
||||
public void Delete(long id)
|
||||
{
|
||||
checkIsOwner (CircleManager.DefaultProvider.Get(id));
|
||||
CircleManager.DefaultProvider.Delete (id);
|
||||
|
|
@ -101,7 +105,8 @@ namespace Yavsc.ApiControllers
|
|||
/// Get the circle specified id.
|
||||
/// </summary>
|
||||
/// <param name="id">Identifier.</param>
|
||||
[Authorize]
|
||||
[Authorize,
|
||||
AcceptVerbs ("GET")]
|
||||
public Circle Get(long id)
|
||||
{
|
||||
var c = CircleManager.DefaultProvider.Get (id);
|
||||
|
|
@ -112,8 +117,9 @@ namespace Yavsc.ApiControllers
|
|||
/// <summary>
|
||||
/// List the circles
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public IEnumerable<ListItem> List()
|
||||
[Authorize,
|
||||
AcceptVerbs ("GET")]
|
||||
public IEnumerable<Circle> List()
|
||||
{
|
||||
string user = Membership.GetUser ().UserName;
|
||||
return CircleManager.DefaultProvider.List (user);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue