mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-05 22:20:27 -04:00
Removed NioTSO client and server
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
This commit is contained in:
parent
f12ba1502b
commit
22191ce648
591 changed files with 53264 additions and 3362 deletions
35
server/FSO.Server.Database/DA/Bookmarks/SqlBookmarks.cs
Executable file
35
server/FSO.Server.Database/DA/Bookmarks/SqlBookmarks.cs
Executable file
|
@ -0,0 +1,35 @@
|
|||
using Dapper;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace FSO.Server.Database.DA.Bookmarks
|
||||
{
|
||||
public class SqlBookmarks : AbstractSqlDA, IBookmarks
|
||||
{
|
||||
public SqlBookmarks(ISqlContext context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
public void Create(DbBookmark bookmark)
|
||||
{
|
||||
Context.Connection.Execute("INSERT INTO fso_bookmarks (avatar_id, type, target_id) " +
|
||||
" VALUES (@avatar_id, @type, @target_id)"
|
||||
, bookmark);
|
||||
}
|
||||
|
||||
public bool Delete(DbBookmark bookmark)
|
||||
{
|
||||
return Context.Connection.Execute("DELETE FROM fso_bookmarks WHERE avatar_id = @avatar_id AND type = @type AND target_id = @target_id", bookmark) > 0;
|
||||
}
|
||||
|
||||
public List<DbBookmark> GetByAvatarId(uint avatar_id)
|
||||
{
|
||||
return Context.Connection.Query<DbBookmark>("SELECT * FROM fso_bookmarks WHERE avatar_id = @avatar_id", new { avatar_id = avatar_id }).ToList();
|
||||
}
|
||||
|
||||
public List<uint> GetAvatarIgnore(uint avatar_id)
|
||||
{
|
||||
return Context.Connection.Query<uint>("SELECT target_id FROM fso_bookmarks WHERE avatar_id = @avatar_id AND type = 5", new { avatar_id = avatar_id }).ToList();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue