forked from project-redbud/FunGame-Core
修改SQLHelper
This commit is contained in:
parent
c82eafb294
commit
ba270100fe
44
FunGame.Core/Api/Data/SQLHelper.cs
Normal file
44
FunGame.Core/Api/Data/SQLHelper.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Milimoe.FunGame.Core.Interface.Base;
|
||||||
|
using Milimoe.FunGame.Core.Library.Common.Network;
|
||||||
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Api.Data
|
||||||
|
{
|
||||||
|
public class SQLHelper : ISQLHelper
|
||||||
|
{
|
||||||
|
public string Script { get; set; } = "";
|
||||||
|
|
||||||
|
public EntityType EntityType { get; private set; } = EntityType.Empty;
|
||||||
|
|
||||||
|
public object Entity { get; private set; } = General.EntityInstance;
|
||||||
|
|
||||||
|
public SQLResult Result { get; private set; } = SQLResult.Success;
|
||||||
|
|
||||||
|
public SQLServerInfo ServerInfo { get; private set; } = new SQLServerInfo();
|
||||||
|
|
||||||
|
public int UpdateRows { get; private set; } = 0;
|
||||||
|
|
||||||
|
public SQLHelper Instance { get; private set; } = new SQLHelper();
|
||||||
|
|
||||||
|
public static SQLHelper GetHelper(EntityType type)
|
||||||
|
{
|
||||||
|
return new SQLHelper(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SQLHelper(EntityType type)
|
||||||
|
{
|
||||||
|
this.EntityType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
private SQLHelper()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,94 +0,0 @@
|
|||||||
using Milimoe.FunGame.Core.Interface.Base;
|
|
||||||
using Milimoe.FunGame.Core.Library.Constant;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Data;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Api.Proxy
|
|
||||||
{
|
|
||||||
public class SQLProxy : ISQLProxy
|
|
||||||
{
|
|
||||||
public ProxyResult Execute()
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ProxyResult Execute(object[]? objs = null)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ProxyResult Execute(StringBuilder script)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int ExecuteRow()
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int ExecuteRow(object[]? objs = null)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int ExecuteRow(StringBuilder script)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataSet GetData(EntityType type, object[]? objs = null)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataSet GetData(object[]? objs = null)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataSet GetData(StringBuilder script)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataRow GetDataRow(EntityType type, object[]? objs = null)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataRow GetDataRow(DataSet set, object[]? objs = null)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataRow GetDataRow(DataTable table, object[]? objs = null)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataRow GetDataRow(StringBuilder script)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataTable GetDataTable(EntityType type, object[]? objs = null)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataTable GetDataTable(object[]? objs = null)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataTable GetDataTable(StringBuilder script)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|||||||
19
FunGame.Core/Interface/Base/ISQLHelper.cs
Normal file
19
FunGame.Core/Interface/Base/ISQLHelper.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Interface.Base
|
||||||
|
{
|
||||||
|
public interface ISQLHelper
|
||||||
|
{
|
||||||
|
public string Script { get; set; }
|
||||||
|
public EntityType EntityType { get; }
|
||||||
|
public object Entity { get; }
|
||||||
|
public SQLResult Result { get; }
|
||||||
|
int UpdateRows { get; }
|
||||||
|
public Library.Common.Network.SQLServerInfo ServerInfo { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,29 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Milimoe.FunGame.Core.Library.Constant;
|
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Interface.Base
|
|
||||||
{
|
|
||||||
public interface ISQLProxy
|
|
||||||
{
|
|
||||||
public ProxyResult Execute();
|
|
||||||
public ProxyResult Execute(object[]? objs = null);
|
|
||||||
public ProxyResult Execute(StringBuilder script);
|
|
||||||
public int ExecuteRow();
|
|
||||||
public int ExecuteRow(object[]? objs = null);
|
|
||||||
public int ExecuteRow(StringBuilder script);
|
|
||||||
public System.Data.DataSet GetData(EntityType type, object[]? objs = null);
|
|
||||||
public System.Data.DataSet GetData(object[]? objs = null);
|
|
||||||
public System.Data.DataSet GetData(StringBuilder script);
|
|
||||||
public System.Data.DataTable GetDataTable(EntityType type, object[]? objs = null);
|
|
||||||
public System.Data.DataTable GetDataTable(object[]? objs = null);
|
|
||||||
public System.Data.DataTable GetDataTable(StringBuilder script);
|
|
||||||
public System.Data.DataRow GetDataRow(EntityType type, object[]? objs = null);
|
|
||||||
public System.Data.DataRow GetDataRow(System.Data.DataSet set, object[]? objs = null);
|
|
||||||
public System.Data.DataRow GetDataRow(System.Data.DataTable table, object[]? objs = null);
|
|
||||||
public System.Data.DataRow GetDataRow(StringBuilder script);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -9,24 +9,18 @@ namespace Milimoe.FunGame.Core.Interface.Base
|
|||||||
{
|
{
|
||||||
internal interface ISQLService
|
internal interface ISQLService
|
||||||
{
|
{
|
||||||
internal ProxyResult Execute();
|
internal SQLResult Execute();
|
||||||
internal ProxyResult Execute(object[]? objs = null);
|
internal SQLResult Execute(StringBuilder sql);
|
||||||
internal ProxyResult Execute(StringBuilder script);
|
internal SQLResult Execute(string sql);
|
||||||
internal int UpdateRow(object[]? objs = null);
|
internal int Update(StringBuilder sql, ref SQLResult result);
|
||||||
internal int UpdateRow(StringBuilder script);
|
internal int Remove(StringBuilder sql, ref SQLResult result);
|
||||||
internal int DeleteRow(object[]? objs = null);
|
internal int Add(StringBuilder sql, ref SQLResult result);
|
||||||
internal int DeleteRow(StringBuilder script);
|
internal int Update(string sql, ref SQLResult result);
|
||||||
internal int AddRow(object[]? objs = null);
|
internal int Remove(string sql, ref SQLResult result);
|
||||||
internal int AddRow(StringBuilder script);
|
internal int Add(string sql, ref SQLResult result);
|
||||||
internal System.Data.DataSet GetData(EntityType type, object[]? objs = null);
|
internal object Query(EntityType type, StringBuilder sql);
|
||||||
internal System.Data.DataSet GetData(object[]? objs = null);
|
internal T Query<T>(StringBuilder sql);
|
||||||
internal System.Data.DataSet GetData(StringBuilder script);
|
internal object Query(EntityType type, string sql);
|
||||||
internal System.Data.DataTable GetDataTable(EntityType type, object[]? objs = null);
|
internal T Query<T>(string sql);
|
||||||
internal System.Data.DataTable GetDataTable(object[]? objs);
|
|
||||||
internal System.Data.DataTable GetDataTable(StringBuilder script);
|
|
||||||
internal System.Data.DataRow GetDataRow(EntityType type, object[]? objs = null);
|
|
||||||
internal System.Data.DataRow GetDataRow(System.Data.DataSet set, object[]? objs = null);
|
|
||||||
internal System.Data.DataRow GetDataRow(System.Data.DataTable table, object[]? objs = null);
|
|
||||||
internal System.Data.DataRow GetDataRow(StringBuilder script);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,8 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Library.Common.Network
|
namespace Milimoe.FunGame.Core.Library.Common.Network
|
||||||
{
|
{
|
||||||
public class SQLConnection
|
public class SQLServerInfo
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,10 +37,12 @@ namespace Milimoe.FunGame.Core.Library.Constant
|
|||||||
FindServerFailed
|
FindServerFailed
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ProxyResult
|
public enum SQLResult
|
||||||
{
|
{
|
||||||
Success,
|
Success,
|
||||||
Fail,
|
Fail,
|
||||||
NotFound
|
NotFound,
|
||||||
|
SQLError,
|
||||||
|
IsExist
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,97 +11,67 @@ namespace Milimoe.FunGame.Core.Service
|
|||||||
{
|
{
|
||||||
internal class SQLManager : ISQLService
|
internal class SQLManager : ISQLService
|
||||||
{
|
{
|
||||||
int ISQLService.AddRow(object[]? objs)
|
int ISQLService.Add(StringBuilder sql, ref SQLResult result)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
int ISQLService.AddRow(StringBuilder script)
|
int ISQLService.Add(string sql, ref SQLResult result)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
int ISQLService.DeleteRow(object[]? objs)
|
SQLResult ISQLService.Execute()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
int ISQLService.DeleteRow(StringBuilder script)
|
SQLResult ISQLService.Execute(StringBuilder sql)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyResult ISQLService.Execute()
|
SQLResult ISQLService.Execute(string sql)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyResult ISQLService.Execute(object[]? objs)
|
object ISQLService.Query(EntityType type, StringBuilder sql)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyResult ISQLService.Execute(StringBuilder script)
|
T ISQLService.Query<T>(StringBuilder sql)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
DataSet ISQLService.GetData(EntityType type, object[]? objs)
|
object ISQLService.Query(EntityType type, string sql)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
DataSet ISQLService.GetData(object[]? objs)
|
T ISQLService.Query<T>(string sql)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
DataSet ISQLService.GetData(StringBuilder script)
|
int ISQLService.Remove(StringBuilder sql, ref SQLResult result)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
DataRow ISQLService.GetDataRow(EntityType type, object[]? objs)
|
int ISQLService.Remove(string sql, ref SQLResult result)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
DataRow ISQLService.GetDataRow(DataSet set, object[]? objs)
|
int ISQLService.Update(StringBuilder sql, ref SQLResult result)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
DataRow ISQLService.GetDataRow(DataTable table, object[]? objs)
|
int ISQLService.Update(string sql, ref SQLResult result)
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
DataRow ISQLService.GetDataRow(StringBuilder script)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
DataTable ISQLService.GetDataTable(EntityType type, object[]? objs)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
DataTable ISQLService.GetDataTable(object[]? objs)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
DataTable ISQLService.GetDataTable(StringBuilder script)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
int ISQLService.UpdateRow(object[]? objs)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
int ISQLService.UpdateRow(StringBuilder script)
|
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user