From f8ed0a1ee63cad489c67caaf76e9527a06da2947 Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期三, 29 五月 2024 17:01:56 +0800
Subject: [PATCH] no message
---
CoreCms.Net.Web.Admin/Controllers/System/CodeGeneratorController.cs | 45 +++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/CoreCms.Net.Web.Admin/Controllers/System/CodeGeneratorController.cs b/CoreCms.Net.Web.Admin/Controllers/System/CodeGeneratorController.cs
index 8594eab..1d2ba23 100644
--- a/CoreCms.Net.Web.Admin/Controllers/System/CodeGeneratorController.cs
+++ b/CoreCms.Net.Web.Admin/Controllers/System/CodeGeneratorController.cs
@@ -1,7 +1,7 @@
锘�/***********************************************************************
- * Project: CoreCms
+ * Project: baifenBinfa
* ProjectName: 鐧惧垎鍏垫硶绠$悊绯荤粺
- * Web: hhtp://chuanyin.com
+ * Web: http://chuanyin.com
* Author:
* Email:
* CreateTime: 202403/02
@@ -9,17 +9,22 @@
***********************************************************************/
using System;
+using System.CodeDom;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
+using Chuanyin.Attribute;
using CoreCms.Net.Configuration;
+using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices;
using CoreCms.Net.Loging;
+using CoreCms.Net.Model.Entities.Distribution;
using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.Model.ViewModels.UI;
+using CoreCms.Net.Repository.UnitOfWork;
using CoreCms.Net.Utility.Helper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
@@ -42,6 +47,8 @@
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly IMapper _mapper;
+
+
/// <summary>
/// 鏋勯�犲嚱鏁�
@@ -51,6 +58,7 @@
_codeGeneratorServices = codeGeneratorServices;
_mapper = mapper;
_webHostEnvironment = webHostEnvironment;
+
}
@@ -255,6 +263,39 @@
#endregion
+ #region 鐢熸垚鎴栬�呮洿鏂版暟鎹簱
+ /// <summary>
+ /// 鍒涘缓鍜屾洿鏂版暟鎹簱
+ /// </summary>
+ /// <param name="tableName"></param>
+ /// <param name="fileType"></param>
+ /// <returns></returns>
+ [HttpPost]
+ [Description("鍒涘缓鏂拌〃")]
+ public IActionResult CreateAndUpdateDatabase([FromServices] IUnitOfWork work)
+ {
+ var jm = new AdminUiCallBack();
+ try
+ {
+ Type[]? types = AssemblyHelper.DbCodeFirstModes("CoreCms.Net.Model",thisAttribute: typeof(SqlCodeFirstAttribute));
+
+ work.GetDbClient().CodeFirst.InitTables(types??new Type[] { });
+ jm.code = 0;
+
+ jm.msg = "鍒涘缓鎴愬姛";
+ return new JsonResult(jm);
+ }
+ catch (Exception e)
+ {
+ jm.msg = e.Message + ":-----" + e.StackTrace;
+ return new JsonResult(jm);
+
+ }
+
+
+
+ }
+ #endregion
}
}
\ No newline at end of file
--
Gitblit v1.9.1