|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace Common
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 数据库类型
|
|
|
|
|
/// </summary>
|
|
|
|
|
public enum YsDataType {
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
MySql = 0,
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
SqlServer = 1,
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
PostgreSQL = 2,
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
Oracle = 3,
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
Sqlite = 4,
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
OdbcOracle = 5,
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
OdbcSqlServer = 6,
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
OdbcMySql = 7,
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
OdbcPostgreSQL = 8,
|
|
|
|
|
//
|
|
|
|
|
// 摘要:
|
|
|
|
|
// 通用的 Odbc 实现,只能做基本的 Crud 操作
|
|
|
|
|
// 不支持实体结构迁移、不支持分页(只能 Take 查询)
|
|
|
|
|
// 通用实现为了让用户自己适配更多的数据库,比如连接 mssql 2000、db2 等数据库
|
|
|
|
|
// 默认适配 SqlServer,可以继承后重新适配 FreeSql.Odbc.Default.OdbcAdapter,最好去看下代码
|
|
|
|
|
// 适配新的 OdbcAdapter,请在 FreeSqlBuilder.Build 之后调用 IFreeSql.SetOdbcAdapter 方法设置
|
|
|
|
|
Odbc = 9,
|
|
|
|
|
//
|
|
|
|
|
// 摘要:
|
|
|
|
|
// 武汉达梦数据库有限公司,基于 Odbc 的实现
|
|
|
|
|
OdbcDameng = 10,
|
|
|
|
|
//
|
|
|
|
|
// 摘要:
|
|
|
|
|
// Microsoft Office Access 是由微软发布的关联式数据库管理系统
|
|
|
|
|
MsAccess = 11,
|
|
|
|
|
//
|
|
|
|
|
// 摘要:
|
|
|
|
|
// 武汉达梦数据库有限公司,基于 DmProvider.dll 的实现
|
|
|
|
|
Dameng = 12,
|
|
|
|
|
//
|
|
|
|
|
// 摘要:
|
|
|
|
|
// 北京人大金仓信息技术股份有限公司,基于 Odbc 的实现
|
|
|
|
|
OdbcKingbaseES = 13,
|
|
|
|
|
//
|
|
|
|
|
// 摘要:
|
|
|
|
|
// 天津神舟通用数据技术有限公司,基于 System.Data.OscarClient.dll 的实现
|
|
|
|
|
ShenTong = 14,
|
|
|
|
|
//
|
|
|
|
|
// 摘要:
|
|
|
|
|
// 北京人大金仓信息技术股份有限公司,基于 Kdbndp.dll 的实现
|
|
|
|
|
KingbaseES = 15,
|
|
|
|
|
//
|
|
|
|
|
// 摘要:
|
|
|
|
|
// Firebird 是一个跨平台的关系数据库,能作为多用户环境下的数据库服务器运行,也提供嵌入式数据库的实现
|
|
|
|
|
Firebird = 16,
|
|
|
|
|
//
|
|
|
|
|
// 摘要:
|
|
|
|
|
// 自定义适配器,访问任何数据库
|
|
|
|
|
// 注意:该类型不提供 DbFirst/CodeFirst 功能
|
|
|
|
|
Custom = 17
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 排序枚举
|
|
|
|
|
/// </summary>
|
|
|
|
|
public enum DbOrderEnum {
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 正序排序
|
|
|
|
|
/// </summary>
|
|
|
|
|
[EnumText("正序排序")]
|
|
|
|
|
Asc =0,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 倒序排序
|
|
|
|
|
/// </summary>
|
|
|
|
|
[EnumText("倒序排序")]
|
|
|
|
|
Desc =1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum HttpCodeEnum
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 请求(或处理)成功
|
|
|
|
|
/// </summary>
|
|
|
|
|
[EnumText("请求(或处理)成功")]
|
|
|
|
|
Status = 200, //请求(或处理)成功
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 内部请求出错
|
|
|
|
|
/// </summary>
|
|
|
|
|
[EnumText("内部请求出错")]
|
|
|
|
|
Error = 500, //内部请求出错
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 未授权标识
|
|
|
|
|
/// </summary>
|
|
|
|
|
[EnumText("未授权标识")]
|
|
|
|
|
Unauthorized = 401,//未授权标识
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 请求参数不完整或不正确
|
|
|
|
|
/// </summary>
|
|
|
|
|
[EnumText("请求参数不完整或不正确")]
|
|
|
|
|
ParameterError = 400,//请求参数不完整或不正确
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 请求TOKEN失效
|
|
|
|
|
/// </summary>
|
|
|
|
|
[EnumText("请求TOKEN失效")]
|
|
|
|
|
TokenInvalid = 403,//请求TOKEN失效
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// HTTP请求类型不合法
|
|
|
|
|
/// </summary>
|
|
|
|
|
[EnumText("HTTP请求类型不合法")]
|
|
|
|
|
HttpMehtodError = 405,//HTTP请求类型不合法
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// HTTP请求不合法,请求参数可能被篡改
|
|
|
|
|
/// </summary>
|
|
|
|
|
[EnumText("HTTP请求不合法,请求参数可能被篡改")]
|
|
|
|
|
HttpRequestError = 406,//HTTP请求不合法
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 该URL已经失效
|
|
|
|
|
/// </summary>
|
|
|
|
|
[EnumText("该URL已经失效")]
|
|
|
|
|
URLExpireError = 407,//HTTP请求不合法
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|