增加函数UUID调用

pull/1/head
潘建东 9 months ago
parent 0af6aef31a
commit c7a66ded83

@ -40,25 +40,25 @@ namespace ZKLT.Hadoop.API
app.UseCors("all"); app.UseCors("all");
#endregion #endregion
app.UseHadoop((c) =>
{
c.Host = "127.0.0.1";
c.Account = "root";
c.PassWord = "root";
c.Key = "devdb";
c.Port = 3306;
});
//app.UseHadoop((c) => //app.UseHadoop((c) =>
//{ //{
// c.Host = "172.17.0.1"; // c.Host = "127.0.0.1";
// c.Account = "root"; // c.Account = "root";
// c.PassWord = "root"; // c.PassWord = "root";
// c.Key = "testdb"; // c.Key = "devdb";
// c.Port = 4000; // c.Port = 3306;
//}); //});
app.UseHadoop((c) =>
{
c.Host = "172.17.0.1";
c.Account = "root";
c.PassWord = "root";
c.Key = "testdb";
c.Port = 4000;
});
//app.UseHadoop((c) => //app.UseHadoop((c) =>
//{ //{
// c.Host = "118.195.165.218"; // c.Host = "118.195.165.218";

@ -16,6 +16,11 @@ namespace ZKLT.Hadoop.Model
/// </summary> /// </summary>
public const string DATENOW = "DATE_NOW()"; public const string DATENOW = "DATE_NOW()";
/// <summary>
/// 唯一码
/// </summary>
public const string UUID = "UUID()";
/// <summary> /// <summary>
/// 转换命令 /// 转换命令
/// </summary> /// </summary>
@ -24,8 +29,10 @@ namespace ZKLT.Hadoop.Model
/// <returns>命令</returns> /// <returns>命令</returns>
public static string ConvertCommand(string command, Dictionary<string, object> param) public static string ConvertCommand(string command, Dictionary<string, object> param)
{ {
//日期转换
command = command.Replace(DATENOW,@$"'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'"); command = command.Replace(DATENOW,@$"'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'");
command = command.Replace(UUID, @$"'{Guid.NewGuid().ToString()}'");
return command; return command;
} }
@ -42,6 +49,11 @@ namespace ZKLT.Hadoop.Model
return true; return true;
} }
if(action == UUID)
{
return true;
}
return _Result; return _Result;
} }
} }

Loading…
Cancel
Save