//[WebGet(UriTemplate = "info/industry", ResponseFormat = WebMessageFormat.Json)] public string[] QueryInfoByAllIndustry(string type) { if (type.Equals("L")) { return(BizApi.QueryAllLocation()); } else { return(BizApi.QueryAllIndustry()); } }
public static void GenerateAll(string path, string tag) { tag = "20150415"; path = @"G:\github\StockAnalyzer\web\"; string temp = path + @"temp\"; if (!Directory.Exists(temp)) { Directory.CreateDirectory(temp); } string[] old_list = Constant.ANALYZE_TIME.Split('-'); string[] type_list = { "CYB", "ZXB", "ZB", "XPG" }; string[] industry_list = BizApi.QueryAllIndustry(); string[] location_list = BizApi.QueryAllLocation(); foreach (string old in old_list) { foreach (string type in type_list) { string haha = Generate(Constant.ANALYZE_LEVEL.ToString(), tag, old, Constant.DAYS_BEFORE.ToString(), "", "", type); string template = Common.FileUtil.ReadFile(path + "analyzetemplate.html"); template = template.Replace("PLACEHOLDER", haha); string filename = string.Format("analyze_{0}_{1}.html", old, type); Common.FileUtil.WriteFile(temp + filename, template); Console.WriteLine(); } foreach (string industry in industry_list) { string haha = Generate(Constant.ANALYZE_LEVEL.ToString(), tag, old, Constant.DAYS_BEFORE.ToString(), industry, "", ""); string template = Common.FileUtil.ReadFile(path + "analyzetemplate.html"); template = template.Replace("PLACEHOLDER", haha); string filename = string.Format("analyze_{0}_{1}.html", old, industry); Common.FileUtil.WriteFile(temp + filename, template); Console.WriteLine(); } foreach (string location in location_list) { string haha = Generate(Constant.ANALYZE_LEVEL.ToString(), tag, old, Constant.DAYS_BEFORE.ToString(), "", location, ""); string template = Common.FileUtil.ReadFile(path + "analyzetemplate.html"); template = template.Replace("PLACEHOLDER", haha); string filename = string.Format("analyze_{0}_{1}.html", old, location); Common.FileUtil.WriteFile(temp + filename, template); Console.WriteLine(); } } }
public static void GenerateAll(string path, string tag) { //tag = "20150415"; //path = @"G:\github\StockAnalyzer\web\"; string[] old_list = Constant.ANALYZE_TIME.Split('-'); string[] type_list = { "XPG", "ALL", "CYB", "ZXB", "ZB" }; string[] industry_list = BizApi.QueryAllIndustry(); string[] location_list = BizApi.QueryAllLocation(); GenerateSingle(path, tag, old_list, type_list, industry_list, location_list); //string filename = ""; //foreach (string old in old_list) //{ // foreach (string type in type_list) // { // try // { // filename = string.Format("analyze_{0}_{1}.html", old, type); // if (File.Exists(temp + filename)) File.Delete(temp + filename); // string haha = Exec(Constant.ANALYZE_LEVEL.ToString(), tag, old, Constant.DAYS_BEFORE.ToString(), "", "", type); // string template = Common.FileUtil.ReadFile(path + "analyzetemplate.html"); // template = template.Replace("PLACEHOLDER", haha); // Common.FileUtil.WriteFile(temp + filename, template); // Console.WriteLine(filename + " generate"); // } // catch // { // Console.WriteLine(filename + " fail"); // } // } // foreach (string industry in industry_list) // { // try // { // filename = string.Format("analyze_{0}_{1}.html", old, industry); // if (File.Exists(temp + filename)) File.Delete(temp + filename); // string haha = Exec(Constant.ANALYZE_LEVEL.ToString(), tag, old, Constant.DAYS_BEFORE.ToString(), industry, "", ""); // string template = Common.FileUtil.ReadFile(path + "analyzetemplate.html"); // template = template.Replace("PLACEHOLDER", haha); // Common.FileUtil.WriteFile(temp + filename, template); // Console.WriteLine(filename + "generate"); // } // catch // { // Console.WriteLine(filename + " fail"); // } // } // foreach (string location in location_list) // { // try // { // filename = string.Format("analyze_{0}_{1}.html", old, location); // if (File.Exists(temp + filename)) File.Delete(temp + filename); // string haha = Exec(Constant.ANALYZE_LEVEL.ToString(), tag, old, Constant.DAYS_BEFORE.ToString(), "", location, ""); // string template = Common.FileUtil.ReadFile(path + "analyzetemplate.html"); // template = template.Replace("PLACEHOLDER", haha); // Common.FileUtil.WriteFile(temp + filename, template); // Console.WriteLine(filename + "generate"); // } // catch // { // Console.WriteLine(filename + " fail"); // } // } //} }