|
|
@@ -30,7 +30,7 @@ namespace Tasks
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void DoQueue(string content)
|
|
|
+ public string DoQueue(string content, bool push = true)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
@@ -53,7 +53,7 @@ namespace Tasks
|
|
|
// string templateString = Function.ReadInstance("Template/" + modePath + ".json");
|
|
|
var templateService = App.GetRequiredService<IMakeTemplateService>();
|
|
|
var template = templateService.GetFirst(m => m.templateName == modePath);
|
|
|
- if(template == null) return;
|
|
|
+ if(template == null) return "";
|
|
|
string templateString = template.templateContent;
|
|
|
templateString = HttpUtility.UrlDecode(templateString);
|
|
|
//解析模板内容
|
|
|
@@ -77,9 +77,9 @@ namespace Tasks
|
|
|
fileName = Util.Maker.replaceKeyToValue(jsonObj["data"], fileName);
|
|
|
Function.WritePage(path, fileName, resultString);
|
|
|
string startPath = Function.getPath(path + fileName);
|
|
|
- OssHelper.Instance.Upload(startPath);
|
|
|
if(serviceId > 0 && projectId > 0)
|
|
|
{
|
|
|
+ OssHelper.Instance.Upload(startPath);
|
|
|
addFile(projectId, serviceId, int.Parse(Function.CheckInt(userId)), versionNo, fileName, path + fileName, path + fileName, fileType, javaVersion, "java");
|
|
|
}
|
|
|
//生成数据入库
|
|
|
@@ -107,14 +107,21 @@ namespace Tasks
|
|
|
item.updateBy = attach["createBy"].ToString();
|
|
|
makeDataService.Update(item);
|
|
|
}
|
|
|
- RabbitMQClient.Instance.Push("MakeCallBackQueue", content + "#cut#" + resultString);
|
|
|
+ if(push)
|
|
|
+ {
|
|
|
+ RabbitMQClient.Instance.Push("MakeCallBackQueue", content + "#cut#" + resultString);
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return content + "#cut#" + resultString;
|
|
|
+ }
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex, "生成异常");
|
|
|
+ return "";
|
|
|
}
|
|
|
- //MQ回调解析的结果
|
|
|
- // RabbitMQClient.Instance.Push("MakeSqlCallBackQueue", requestId + "#cut#" + attach + "#cut#" + resultString);
|
|
|
}
|
|
|
|
|
|
//生成代码版本
|