添加codeFirst功能

This commit is contained in:
陈淳
2022-10-18 18:01:16 +08:00
parent dab4a092d9
commit ab8cdd88b9
25 changed files with 161 additions and 121 deletions

View File

@@ -272,7 +272,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
public Result SeedDb()
{
var rep = _iUserService._repository;
return Result.Success().SetStatus(DbSeedExtend.Invoer(rep._Db));
return Result.Success().SetStatus(DbSeedExtend.DataInvoer(rep._Db));
}
/// <summary>

View File

@@ -43,9 +43,6 @@
<None Update="public.pem">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="yi-sqlsugar-dev.db">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@@ -1,5 +1,5 @@
{
"StartUrl": "http://localohost:19001",
"StartUrl": "http://*:19001",
"Logging": {
"LogLevel": {
"Default": "Information",
@@ -12,10 +12,13 @@
"SqlLog_Enable": false,
"Consul_Enabled": false,
"DbCodeFirst_Enabled": false,
"DbSeed_Enabled": false,
"Apollo_Enabled": false,
"HealthCheck_Enabled": false,
"RabbitMQ_Enabled": false,
"Redis_Enabled": false,
"RedisSeed_Enabled": false,
"Kafka_Enabled": false,
"ElasticSeach_Enabled": false,
"MutiDB_Enabled": false,
@@ -23,19 +26,16 @@
"CAP_Enabled": false,
"CAPDashboard_Enabled": false,
"DbSeed_Enabled": true,
"RedisSeed_Enabled": false,
"Cors_Enabled": true,
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
"DbSelect": "Sqlite",
"DbConn": {
"WriteUrl": "DataSource=yi-sqlsugar-dev.db",
//"WriteUrl": "server=119.91.207.67;port=3306;database=yi-sqlsugar-dev;user id=root;password=Qz52013142020.",
//"WriteUrl": "[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"ReadUrl": [
"server=119.91.207.67;port=3306;database=yi-sqlsugar-dev;user id=root;password=Qz52013142020.",
"server=119.91.207.67;port=3306;database=yi-sqlsugar-dev;user id=root;password=Qz52013142020.",
"server=119.91.207.67;port=3306;database=yi-sqlsugar-dev;user id=root;password=Qz52013142020."
"server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]"
]
},
"JwtAuthorize": {
@@ -44,39 +44,39 @@
"PolicyName": "permission",
"DefaultScheme": "Bearer",
"IsHttps": false,
"Expiration": 30,
"Expiration": 300,
"ReExpiration": 3000
},
"RedisConnOptions": {
"Host": "118.195.191.41",
"Host": "[xxxx]",
"Prot": 6379,
"DB": 1,
"Password": "Qz52013142020."
"Password": "[xxxx]"
},
"RabbitConn": {
"HostName": "118.195.191.41",
"UserName": "cc",
"Password": "cc",
"HostName": "[xxxx]",
"UserName": "[xxxx]",
"Password": "[xxxx]",
"Port": 5672
},
"ElasticSeachConn": {
"Url": "https://es-4zakkyyn.public.tencentelasticsearch.com:9200",
"IndexName": "yies",
"UserName": "elastic",
"PassWord": "Qz52013142020."
"Url": "[xxxx]",
"IndexName": "[xxxx]",
"UserName": "[xxxx]",
"PassWord": "[xxxx]"
},
"KafkaOptions": {
"BrokerList": "192.168.3.230:9092",
"TopicName": "kafkalog"
"BrokerList": "[xxxx]",
"TopicName": "[xxxx]"
},
"ConsulClientOption": {
"IP": "118.195.191.41",
"Port": "8500",
"Datacenter": "dc1"
"IP": "[xxxx]",
"Port": "[xxxx]",
"Datacenter": "[xxxx]"
},
"ConsulRegisterOption": {
"IP": "118.195.191.41",
"Port": "19005",
"IP": "[xxxx]",
"Port": "19001",
"GroupName": "ApiMicroservice",
"HealthCheckUrl": "/Health",
"Interval": 10,
@@ -85,10 +85,10 @@
"Tag": "13"
},
"SMS": {
"ID": "LTAI5tJvjPaXCyyPMfXLNbVA",
"Secret": "fLQv7jjj57fUKLFK8REeAQPFVDjUYn",
"Sign": "JiftCC",
"Template": "SMS_221640732"
"ID": "[xxxx]",
"Secret": "[xxxx]",
"Sign": "[xxxx]",
"Template": "[xxxx]"
},
"IPLibraryServiceUrl": "http://gRPCIPLibraryService"
}

View File

@@ -12,6 +12,7 @@
"SqlLog_Enable": false,
"Consul_Enabled": false,
"DbCodeFirst_Enabled": false,
"DbSeed_Enabled": false,
"Apollo_Enabled": false,
"HealthCheck_Enabled": false,
@@ -27,23 +28,24 @@
"Cors_Enabled": true,
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
"DbSelect": "Mysql",
"Pan": {
"ZipPath": "D:/AppWeb/test/zip"
},
"DbSelect": "Sqlite",
"DbConn": {
"WriteUrl": "server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"WriteUrl": "DataSource=yi-sqlsugar-dev.db",
//"WriteUrl": "[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"ReadUrl": [
"server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]"
]
},
"JWTTokenOptions": {
"Audience": "http://localhost:7000",
"Issuer": "http://localhost:7000",
"SecurityKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI2a2EJ7m872v0afyoSDJT2o1+SitIeJSWtLJU8/Wz2m7gStexajkeD+Lka6DSTy8gt9UwfgVQo6uKjVLG5Ex7PiGOODVqAEghBuS7JzIYU5RvI543nNDAPfnJsas96mSA7L/mD7RTE2drj6hf3oZjJpMPZUQI/B1Qjb5H3K3PNwIDAQAB"
"JwtAuthorize": {
"Issuer": "cc",
"Audience": "cc",
"PolicyName": "permission",
"DefaultScheme": "Bearer",
"IsHttps": false,
"Expiration": 300,
"ReExpiration": 3000
},
"RedisConnOptions": {
"Host": "[xxxx]",

View File

@@ -12,6 +12,7 @@
"SqlLog_Enable": false,
"Consul_Enabled": false,
"DbCodeFirst_Enabled": false,
"DbSeed_Enabled": false,
"Apollo_Enabled": false,
"HealthCheck_Enabled": false,