|
|
@@ -10,6 +10,7 @@ using System.Linq;
|
|
|
using Common;
|
|
|
using Custom;
|
|
|
using Tasks;
|
|
|
+using Infrastructure;
|
|
|
|
|
|
|
|
|
namespace Services
|
|
|
@@ -98,15 +99,18 @@ namespace Services
|
|
|
/// <returns>生成</returns>
|
|
|
public string makeDatabaseField([FromBody] MakeDatabaseFieldDto param, DatabaseTable table, TokenModel loginUser)
|
|
|
{
|
|
|
- string tableName = table.tableName;
|
|
|
List<int> fieldIds = param.id.ToList();
|
|
|
List<DatabaseField> fields = GetList(m => fieldIds.Contains(m.id));
|
|
|
+ int tableId = fields.Count > 0 ? fields[0].tableId : 0;
|
|
|
+ var _DatabaseTableService = App.GetService<IDatabaseTableService>();
|
|
|
+ table = _DatabaseTableService.GetFirst(m => m.id == tableId) ?? new DatabaseTable();
|
|
|
+ string tableName = table.tableName;
|
|
|
|
|
|
Dictionary<string, object> pushData = new Dictionary<string, object>();pushData.Add("since", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
pushData.Add("author", loginUser.username);
|
|
|
+ pushData.Add("databaseField", fields);
|
|
|
pushData.Add("opType", "add");
|
|
|
pushData.Add("tableName", tableName);
|
|
|
- pushData.Add("databaseField", fields);
|
|
|
pushData.Add("fileName", Function.MD5_16(string.Join(",", param.id)));
|
|
|
return MakeHelper.Make(pushData, "dbField", "dbField", loginUser);
|
|
|
}
|