|
|
@ -12,6 +12,7 @@ using System; |
|
|
|
using System.IO; |
|
|
|
using System.Linq; |
|
|
|
using System.Reflection; |
|
|
|
using Yitter.IdGenerator; |
|
|
|
|
|
|
|
namespace JD.API |
|
|
|
{ |
|
|
@ -41,6 +42,9 @@ namespace JD.API |
|
|
|
|
|
|
|
var fsql = new FreeSql.FreeSqlBuilder().UseConnectionString(FreeSql.DataType.MySql, Configuration.GetConnectionString("DB")).Build(); |
|
|
|
services.AddSingleton(typeof(IFreeSql), fsql); |
|
|
|
var idOption = new IdGeneratorOptions(1); |
|
|
|
var idGenerator = new DefaultIdGenerator(idOption); |
|
|
|
services.AddSingleton(typeof(IIdGenerator), idGenerator); |
|
|
|
|
|
|
|
services.AddCors(options => |
|
|
|
{ |
|
|
|