using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ZKLT.Hadoop.Model
{
///
/// 命令函数
///
public class HDP_CommandAction
{
///
/// 当前日期
///
public const string DATENOW = "DATE_NOW()";
///
/// 唯一码
///
public const string UUID = "UUID()";
///
/// 转换命令
///
/// 命令
/// 参数
/// 命令
public static string ConvertCommand(string command, Dictionary param)
{
//日期转换
command = command.Replace(DATENOW,@$"'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'");
command = command.Replace(UUID, @$"'{Guid.NewGuid().ToString()}'");
return command;
}
///
/// 判断是否方法
///
/// 方法
/// 是否包含
public static bool IsAction(string action)
{
var _Result = false;
if (action == DATENOW) {
return true;
}
if(action == UUID)
{
return true;
}
return _Result;
}
}
}