diff --git a/Magic.Application/Entity/JobhuntMessage.cs b/Magic.Application/Entity/JobhuntMessage.cs
new file mode 100644
index 0000000..f5a65ea
--- /dev/null
+++ b/Magic.Application/Entity/JobhuntMessage.cs
@@ -0,0 +1,47 @@
+using System;
+using SqlSugar;
+using System.ComponentModel;
+using Magic.Core.Entity;
+namespace Magic.Application.Entity
+{
+ ///
+ /// 求职信息
+ ///
+ [SugarTable("jobhunt_message")]
+ [Description("求职信息")]
+ public class JobhuntMessage : DEntityBase
+ {
+ ///
+ /// 租户Id
+ ///
+ public long TenantId { get; set; }
+ ///
+ /// 求职详情
+ ///
+ public string PositionInfo { get; set; }
+ ///
+ /// 求职标题
+ ///
+ public string Title { get; set; }
+ ///
+ /// 求职状态
+ ///
+ public int Status { get; set; }
+ ///
+ /// 经验
+ ///
+ public int Experience { get; set; }
+ ///
+ /// 标签
+ ///
+ public string Tag { get; set; }
+ ///
+ /// 省份
+ ///
+ public int ProvinceId { get; set; }
+ ///
+ /// 城市
+ ///
+ public int CityId { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Magic.Application/Entity/RecruitMessage.cs b/Magic.Application/Entity/RecruitMessage.cs
new file mode 100644
index 0000000..55eddd9
--- /dev/null
+++ b/Magic.Application/Entity/RecruitMessage.cs
@@ -0,0 +1,63 @@
+using System;
+using SqlSugar;
+using System.ComponentModel;
+using Magic.Core.Entity;
+namespace Magic.Application.Entity
+{
+ ///
+ /// 招聘消息
+ ///
+ [SugarTable("recruit_message")]
+ [Description("招聘消息")]
+ public class RecruitMessage : DEntityBase
+ {
+ ///
+ /// 租户Id
+ ///
+ public long TenantId { get; set; }
+ ///
+ /// 职位详情
+ ///
+ public string PositionInfo { get; set; }
+ ///
+ /// 标题
+ ///
+ public string Title { get; set; }
+ ///
+ /// 状态
+ ///
+ public int Status { get; set; }
+ ///
+ /// 省份
+ ///
+ public int ProvinceId { get; set; }
+ ///
+ /// 城市
+ ///
+ public int CityId { get; set; }
+ ///
+ /// 区
+ ///
+ public int AreaId { get; set; }
+ ///
+ /// 详细地址
+ ///
+ public int Address { get; set; }
+ ///
+ /// 联系电话
+ ///
+ public string Phone { get; set; }
+ ///
+ /// 标签
+ ///
+ public string Tag { get; set; }
+ ///
+ /// 学历
+ ///
+ public int Education { get; set; }
+ ///
+ /// 经验
+ ///
+ public int Experience { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Magic.Application/Entity/SysArea.cs b/Magic.Application/Entity/SysArea.cs
new file mode 100644
index 0000000..8da7543
--- /dev/null
+++ b/Magic.Application/Entity/SysArea.cs
@@ -0,0 +1,24 @@
+using System;
+using SqlSugar;
+using System.ComponentModel;
+using Magic.Core.Entity;
+namespace Magic.Application.Entity
+{
+ ///
+ /// 系统地区数据
+ ///
+ [SugarTable("sys_area")]
+ [Description("系统地区数据")]
+ public class SysArea : AutoIncrementEntity
+ {
+
+ ///
+ /// 父级ID
+ ///
+ public Int16 parent_id { get; set; }
+ ///
+ /// 地区名
+ ///
+ public string name { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Magic.Application/Magic.Application.csproj b/Magic.Application/Magic.Application.csproj
new file mode 100644
index 0000000..91a5fc4
--- /dev/null
+++ b/Magic.Application/Magic.Application.csproj
@@ -0,0 +1,29 @@
+
+
+
+ net7.0
+ 1701;1702;1591
+ Magic.Application.xml
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Magic.Application/Magic.Application.xml b/Magic.Application/Magic.Application.xml
new file mode 100644
index 0000000..3f6f27c
--- /dev/null
+++ b/Magic.Application/Magic.Application.xml
@@ -0,0 +1,133 @@
+
+
+
+ Magic.Application
+
+
+
+
+ 求职信息
+
+
+
+
+ 租户Id
+
+
+
+
+ 求职详情
+
+
+
+
+ 求职标题
+
+
+
+
+ 求职状态
+
+
+
+
+ 经验
+
+
+
+
+ 标签
+
+
+
+
+ 省份
+
+
+
+
+ 城市
+
+
+
+
+ 招聘消息
+
+
+
+
+ 租户Id
+
+
+
+
+ 职位详情
+
+
+
+
+ 标题
+
+
+
+
+ 状态
+
+
+
+
+ 省份
+
+
+
+
+ 城市
+
+
+
+
+ 区
+
+
+
+
+ 详细地址
+
+
+
+
+ 联系电话
+
+
+
+
+ 标签
+
+
+
+
+ 学历
+
+
+
+
+ 经验
+
+
+
+
+ 系统地区数据
+
+
+
+
+ 父级ID
+
+
+
+
+ 地区名
+
+
+
+
diff --git a/Magic.Application/README.md b/Magic.Application/README.md
new file mode 100644
index 0000000..11a79cd
--- /dev/null
+++ b/Magic.Application/README.md
@@ -0,0 +1,3 @@
+1、原则上服务应该放在Application层次,考虑将咱自己的业务层直接写在Application里面好些,后续升级后,咱大家直接升级就行了,减少冲突!
+2、系统默认ORM为EF Core,如果觉得不趁手,可以自行更换
+3、在此应用层默认集成了SqlSugar,其他ORM类同,可以多个ORM并行开发,熟悉哪个用哪个
diff --git a/Magic.Application/Service/Test/ITestService.cs b/Magic.Application/Service/Test/ITestService.cs
new file mode 100644
index 0000000..d842f76
--- /dev/null
+++ b/Magic.Application/Service/Test/ITestService.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Magic.Application.Service;
+
+public interface ITestService
+{
+ Task TestChangeDatabase();
+}
diff --git a/Magic.Application/Service/Test/TestService.cs b/Magic.Application/Service/Test/TestService.cs
new file mode 100644
index 0000000..ba57fa6
--- /dev/null
+++ b/Magic.Application/Service/Test/TestService.cs
@@ -0,0 +1,80 @@
+using Furion.DependencyInjection;
+using Furion.DynamicApiController;
+using Furion.FriendlyException;
+using Furion.JsonSerialization;
+using Furion.Logging.Extensions;
+using Magic.Core;
+using Magic.Core.Entity;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace Magic.Application.Service;
+
+[ApiDescriptionSettings("Application",Name = "Test", Order = 1)]
+public class TestService : ITestService, IDynamicApiController, ITransient
+{
+ private readonly SqlSugarRepository _userRep;
+
+ public TestService(SqlSugarRepository userRep)
+ {
+ _userRep=userRep;
+ }
+
+ [AllowAnonymous]
+ public void TestDatabaseChange() {
+ Type[] types = new Type[] { typeof(SysUser) };
+ var diffString = _userRep.Context.CodeFirst.GetDifferenceTables(types).ToDiffList();
+ Console.Write(diffString);
+ }
+
+
+ [HttpGet("/test/TestChangeDatabase")]
+ [AllowAnonymous]
+ public async Task TestChangeDatabase()
+ {
+ var user = await _userRep.ToListAsync();
+
+ _userRep.CurrentBeginTran();
+ _userRep.CurrentCommitTran();
+
+ }
+
+ [AllowAnonymous]
+ public async Task JsonSerializerTest(string json) {
+ string us = UserManager.Account;
+ var sq = JsonSerializer.Deserialize(json);
+ var ss= Newtonsoft.Json.JsonConvert.DeserializeObject(json);
+ var s = JSON.Deserialize(json);
+ return s;
+ }
+
+ [LoggingMonitor]
+ public void TestLog()
+ {
+ throw Oops.Bah($"业务异常{DateTime.Now}");
+
+ }
+ [AllowAnonymous]
+ public void TestLog2()
+ {
+ Student student = null;
+ student.FirstName = "hahah";
+
+ }
+
+ [NonUnify]
+ public void TestLogInfo()
+ {
+ $"info日志{DateTime.Now}".LogInformation();
+ }
+
+}
+
+public class Student {
+ public string FirstName { get; set; }
+
+ public int RealAge { get; set; }
+}
\ No newline at end of file
diff --git a/Magic.Application/Startup.cs b/Magic.Application/Startup.cs
new file mode 100644
index 0000000..e32791e
--- /dev/null
+++ b/Magic.Application/Startup.cs
@@ -0,0 +1,12 @@
+using Furion;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Magic.Application;
+
+public class Startup : AppStartup
+{
+ public void ConfigureServices(IServiceCollection services)
+ {
+
+ }
+}
diff --git a/Magic.Application/applicationsettings.json b/Magic.Application/applicationsettings.json
new file mode 100644
index 0000000..19682d9
--- /dev/null
+++ b/Magic.Application/applicationsettings.json
@@ -0,0 +1,3 @@
+{
+
+}
\ No newline at end of file
diff --git a/Magic.CodeFirst/Magic.CodeFirst.csproj b/Magic.CodeFirst/Magic.CodeFirst.csproj
new file mode 100644
index 0000000..6bb0c8e
--- /dev/null
+++ b/Magic.CodeFirst/Magic.CodeFirst.csproj
@@ -0,0 +1,14 @@
+
+
+
+ Exe
+ net7.0
+ enable
+ enable
+
+
+
+
+
+
+
diff --git a/Magic.CodeFirst/Program.cs b/Magic.CodeFirst/Program.cs
new file mode 100644
index 0000000..59eba81
--- /dev/null
+++ b/Magic.CodeFirst/Program.cs
@@ -0,0 +1,223 @@
+// See https://aka.ms/new-console-template for more information
+
+
+
+
+using Magic.CodeFirst;
+using Magic.Core;
+using Magic.Core.Entity;
+using Microsoft.Extensions.Configuration;
+using SqlSugar;
+using System.Collections;
+using System.Data;
+using System.Reflection;
+using System.Text;
+
+
+
+
+var assembles = new string[] { "Magic.FlowCenter.dll", "Magic.Core.dll" };
+//首先创建数据库
+CreateDatabase();
+//初始化表结构
+InitDatabase(assembles);
+//插入种子数据
+InsertData();
+Console.WriteLine("数据库迁移成功");
+Console.ReadLine();
+
+
+static void CreateDatabase() {
+ var conn = SqlSugarHelper.GetSetting();
+ SqlSugarHelper.Db().GetConnectionScope(conn.DefaultDbNumber).DbMaintenance.CreateDatabase();
+ foreach (var item in conn.DbConfigs)
+ {
+ if (item.DbType != SqlSugar.DbType.Oracle.ToString())
+ SqlSugarHelper.Db().GetConnectionScope(item.DbNumber).DbMaintenance.CreateDatabase();
+ }
+}
+
+
+static void InitDatabase(string[] assembles) {
+ var conn = SqlSugarHelper.GetSetting();
+ var configIds = new List();
+ configIds.Add(conn.DefaultDbNumber);
+ foreach (var item in conn.DbConfigs)
+ {
+ configIds.Add(item.DbNumber);
+ }
+
+ foreach (var item in assembles)
+ {
+ Type[] types = Assembly
+ .LoadFrom(item)//如果 .dll报错,可以换成 xxx.exe 有些生成的是exe
+ .GetTypes()
+ .Where(m => m.GetCustomAttribute() != null && m.Name != "FlcFlowinstanceOutput")
+ .ToArray();
+
+ foreach (Type type in types) {
+ if (type.GetCustomAttribute() == null)
+ {
+ SqlSugarHelper.Db().CodeFirst.InitTables(type);
+ }
+ else {
+ SqlSugarHelper.Db().GetConnectionScope(type.GetCustomAttribute().configId).CodeFirst.InitTables(type);
+ }
+ }
+
+ //SqlSugarHelper.Db().CodeFirst.InitTables(types);
+
+ Console.WriteLine($"数据库{item}创建成功");
+ }
+
+
+
+}
+
+
+static void CreateSeedData(string[] assembles)
+{
+ foreach (var item in assembles)
+ {
+ Type[] types = Assembly
+ .LoadFrom(item)//如果 .dll报错,可以换成 xxx.exe 有些生成的是exe
+ .GetTypes()
+ .Where(m => m.GetCustomAttribute() != null && m.Name != "FlcFlowinstanceOutput")
+ .ToArray();
+
+ //Get type of Worker
+ SelectTable worker = new SelectTable();
+
+ //Get type of Worker
+ Type workerType = typeof(SelectTable);
+
+ //Get Generic Method
+ MethodInfo staticDoWorkMethod = workerType.GetMethod("GetAll");
+
+ //Invoke StaticDoWork
+ foreach (Type curType in types)
+ {
+ if (curType.IsClass && !curType.IsAbstract)
+ {
+ MethodInfo curMethod = staticDoWorkMethod.MakeGenericMethod(curType);
+ var list = curMethod.Invoke(null, null);
+ if (list == null) continue;
+ var path = Path.Combine(@"D:\Workspace\admin-net-sqlsugar\backend\Magic.CodeFirst\SeedData", $"{curType.Name}SeedData.cs");
+
+
+ if (File.Exists(path))
+ File.Delete(path);
+
+ FileStream fs = new FileStream(path, FileMode.CreateNew, FileAccess.ReadWrite);
+ StreamWriter sw = new StreamWriter(fs);
+ StringBuilder sb = new StringBuilder($@"using Magic.Core;
+using Magic.Core.Entity;
+
+namespace Magic.CodeFirst;
+
+public class {curType.Name}SeedData : ISeedData , ISqlSugarEntitySeedData<{curType.Name}>
+{{ public IEnumerable<{curType.Name}> HasData()
+ {{ string json = @""");
+ sb.AppendLine(JsonUtil.ToJsonString(list).Replace(@"""", @""""""));
+ sb.AppendLine(@""";");
+
+ sb.AppendLine($@" List<{curType.Name}> list = JsonUtil.ToObject>(json);
+
+ return list;");
+ sb.AppendLine(@"}}");
+ sw.Write(sb.ToString());
+ sw.Flush();
+ sw.Close();
+
+ };
+ }
+ }
+
+
+}
+
+
+
+
+
+static void InsertData()
+{
+ var baseType = typeof(ISeedData);
+ var path = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory;
+ var referencedAssemblies = System.IO.Directory.GetFiles(path, "Magic.CodeFirst.dll").Select(Assembly.LoadFrom).ToArray();
+ var seedDataTypes = referencedAssemblies
+ .SelectMany(a => a.DefinedTypes)
+ .Select(type => type.AsType())
+ .Where(x => x != baseType && baseType.IsAssignableFrom(x)).ToArray();
+
+ foreach (var seedType in seedDataTypes)
+ {
+ var instance = Activator.CreateInstance(seedType);
+
+ var hasDataMethod = seedType.GetMethod("HasData");
+ var seedData = ((IEnumerable)hasDataMethod?.Invoke(instance, null))?.Cast