模型表接口添加ModelResourcesPath

This commit is contained in:
曾艳 2024-06-25 18:17:49 +08:00
parent 9e2697419a
commit ce551906a7
4 changed files with 20 additions and 1 deletions

View File

@ -497,6 +497,10 @@ namespace Competition.Mysql.DAL
{
model.RegistryName = row["RegistryName"].ToString();
}
if (row["ModelResourcesPath"] != null)
{
model.ModelResourcesPath = row["ModelResourcesPath"].ToString();
}
}
return model;
}

View File

@ -68,5 +68,10 @@ namespace Competition.Mysql.Other
/// 注册表名称
/// </summary>
public string RegistryName { get; set; }
/// <summary>
/// 软件名称路径
/// </summary>
public string ModelResourcesPath { get; set; }
}
}

View File

@ -56,7 +56,10 @@ namespace CompetitionAPI.Controllers.version
{
return Json(Tool.GetJsonWithCode(APICode.Fail, "模型包资源不存在,请先上传模型包资源"));
}
if (string.IsNullOrWhiteSpace(req.ModelResourcesPath))
{
return Json(Tool.GetJsonWithCode(APICode.Fail, "软件名称路径不能为空"));
}
var model = bll.GetModelList(string.Format(" MONITOR_ID='{0}' ", req.EnterpriseCode)).FirstOrDefault(); ;
if (model == null)
{
@ -71,6 +74,7 @@ namespace CompetitionAPI.Controllers.version
model.ModelResources = req.ModelResources;
model.UpdateTime = DateTime.Now;
model.RegistryName = req.RegistryName;
model.ModelResourcesPath = req.ModelResourcesPath;
if (bll.Add(model))
{
return Json(Tool.GetJsonWithCode(APICode.Success, "编辑成功!"));
@ -91,6 +95,7 @@ namespace CompetitionAPI.Controllers.version
model.ModelResources = req.ModelResources;
model.UpdateTime = DateTime.Now;
model.RegistryName = req.RegistryName;
model.ModelResourcesPath = req.ModelResourcesPath;
if (bll.Update(model))
{
if (req.ModelResources != old_model_resources)

View File

@ -37,6 +37,11 @@
/// </summary>
public string ModelResources { get; set; }
/// <summary>
/// 软件名称路径
/// </summary>
public string ModelResourcesPath { get; set; }
/// <summary>
/// 注册表名称
/// </summary>