Add more data access services
This commit is contained in:
parent
691e049103
commit
d18dea826e
12 changed files with 333 additions and 45 deletions
9
Start/Server/Data/Services/Interfaces/BookmarkStatus.cs
Normal file
9
Start/Server/Data/Services/Interfaces/BookmarkStatus.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
using System;
|
||||
namespace Start.Server.Data.Services.Interfaces {
|
||||
public enum BookmarkStatus {
|
||||
OK = 1,
|
||||
BookmarkDoesNotExist = 2,
|
||||
OwnerDoesNotMatch = 3,
|
||||
UserDoesNotExist = 4
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Start.Server.Models;
|
||||
|
||||
namespace Start.Server.Data.Services.Interfaces {
|
||||
public interface IBookmarkContainerService {
|
||||
public (BookmarkStatus, BookmarkContainer?) GetBookmarkContainer(string userId,
|
||||
int bookmarkContainerId, bool includeGroups = false, bool includeBookmarks = false);
|
||||
public IList<BookmarkContainer> GetUserBookmarkContainers(string userId,
|
||||
bool includeGroups = false, bool includeBookmarks = false);
|
||||
|
||||
public (BookmarkStatus, BookmarkContainer?) CreateBookmarkContainer(string userId,
|
||||
string title);
|
||||
public (BookmarkStatus, BookmarkContainer?) UpdateBookmarkContainer(string userId,
|
||||
BookmarkContainer bookmarkContainer);
|
||||
public BookmarkStatus DeleteBookmarkContainer(string userId, int bookmarkContainerId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Start.Server.Models;
|
||||
|
||||
namespace Start.Server.Data.Services.Interfaces {
|
||||
public interface IBookmarkGroupService {
|
||||
public (BookmarkStatus, BookmarkGroup?) GetBookmarkGroup(string userId,
|
||||
int bookmarkGroupId, bool includeBookmarks = false);
|
||||
public IList<BookmarkGroup> GetUserBookmarkGroups(string userId,
|
||||
bool includeBookmarks = false);
|
||||
|
||||
public (BookmarkStatus, BookmarkGroup?) CreateBookmarkGroup(string userId, string title,
|
||||
string color, int bookmarkContainerId);
|
||||
public (BookmarkStatus, BookmarkGroup?) UpdateBookmarkGroup(string userId,
|
||||
BookmarkGroup bookmarkGroup);
|
||||
public BookmarkStatus DeleteBookmarkGroup(string userId, int bookmarkGroupId);
|
||||
}
|
||||
}
|
||||
|
|
@ -7,16 +7,9 @@ namespace Start.Server.Data.Services.Interfaces {
|
|||
public (BookmarkStatus, Bookmark?) GetBookmark(string userId, int bookmarkId);
|
||||
public IList<Bookmark> GetUserBookmarks(string userId);
|
||||
|
||||
public Bookmark CreateBookmark(string userId, string title, string url, string? notes,
|
||||
int bookmarkGroupId);
|
||||
public (BookmarkStatus, Bookmark?) CreateBookmark(string userId, string title, string url,
|
||||
string? notes, int bookmarkGroupId);
|
||||
public (BookmarkStatus, Bookmark?) UpdateBookmark(string userId, Bookmark bookmark);
|
||||
public BookmarkStatus DeleteBookmark(string userId, int bookmarkId);
|
||||
}
|
||||
|
||||
public enum BookmarkStatus {
|
||||
OK = 1,
|
||||
BookmarkDoesNotExist = 2,
|
||||
OwnerDoesNotMatch = 3,
|
||||
UserDoesNotExist = 4
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue