diff --git a/.gitignore b/.gitignore index 6239ddfa..0f25f6e5 100644 --- a/.gitignore +++ b/.gitignore @@ -338,5 +338,4 @@ ASALocalRun/ # BeatPulse healthcheck temp database healthchecksdb -Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db-shm *.json diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.Development.json b/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.Development.json deleted file mode 100644 index 8983e0fc..00000000 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - } -} diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json b/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json deleted file mode 100644 index 91088903..00000000 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "AllowedHosts": "*", - - "Consul_Enabled": false, - "DbSeed_Enabled": true, - "Apollo_Enabled": false, - "HealthCheck_Enabled": false, - "Cors_Enabled": true, - "RabbitMQ_Enabled": true, - "Redis_Enabled": true, - "RedisSeed_Enabled": true, - "Kafka_Enabled": false, - "ElasticSeach_Enabled": false, - "MutiDB_Enabled": false, - "SMS_Enabled": true, - "DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ], - "DbSelect": "Mysql", - - "DbConn": { - "WriteUrl": "server=118.195.191.41;port=3306;database=YIDB;user id=root;password=Qz52013142020.", - "ReadUrl": [ - "server=118.195.191.41;port=3306;database=YIDB;user id=root;password=Qz52013142020.", - "server=118.195.191.41;port=3306;database=YIDB;user id=root;password=Qz52013142020.", - "server=118.195.191.41;port=3306;database=YIDB;user id=root;password=Qz52013142020." - ] - }, - "Apollo": { - "AppId": "Yi.Framework.ApiMicroservice", - "Env": "DEV", - "MetaServer": "http://192.168.2.168:8080", - "ConfigServer": [ "http://192.168.2.168:8080" ] - }, - "JWTTokenOptions": { - "Audience": "http://localhost:7000", - "Issuer": "http://localhost:7000", - "SecurityKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI2a2EJ7m872v0afyoSDJT2o1+SitIeJSWtLJU8/Wz2m7gStexajkeD+Lka6DSTy8gt9UwfgVQo6uKjVLG5Ex7PiGOODVqAEghBuS7JzIYU5RvI543nNDAPfnJsas96mSA7L/mD7RTE2drj6hf3oZjJpMPZUQI/B1Qjb5H3K3PNwIDAQAB" - }, - "RedisConnOptions": { - "Host": "118.195.191.41", - "Prot": 6379, - "DB": 1, - "Password": "Qz52013142020." - }, - "RabbitConn": { - "HostName": "118.195.191.41", - "UserName": "cc", - "Password": "cc", - "Port": 5672 - }, - "ElasticSeachConn": { - "Url": "", - "IndexName": "" - }, - "KafkaOptions": { - "BrokerList": "192.168.3.230:9092", - "TopicName": "kafkalog" - }, - "ConsulClientOption": { - "IP": "118.195.191.41", - "Port": "8500", - "Datacenter": "dc1" - }, - "ConsulRegisterOption": { - "IP": "183.216.18.15", - "Port": "44329", - "GroupName": "ApiMicroservice", - "HealthCheckUrl": "/Health", - "Interval": 10, - "Timeout": 5, - "DeregisterCriticalServiceAfter": 60, - "Tag": "13" - }, - "SMS": { - "ID": "LTAI5tJvjPaXCyyPMfXLNbVA", - "Secret": "fLQv7jjj57fUKLFK8REeAQPFVDjUYn", - "Sign": "JiftCC", - "Template": "SMS_221640732" - }, - "IPLibraryServiceUrl": "http://gRPCIPLibraryService" -} \ No newline at end of file diff --git a/Yi.Framework/Yi.Framework.AuthenticationCenter/Controllers/WeatherForecastController.cs b/Yi.Framework/Yi.Framework.AuthenticationCenter/Controllers/WeatherForecastController.cs index 182d709b..3eeeea74 100644 --- a/Yi.Framework/Yi.Framework.AuthenticationCenter/Controllers/WeatherForecastController.cs +++ b/Yi.Framework/Yi.Framework.AuthenticationCenter/Controllers/WeatherForecastController.cs @@ -22,18 +22,5 @@ namespace Yi.Framework.AuthenticationCenter.Controllers { _logger = logger; } - - [HttpGet] - public IEnumerable Get() - { - var rng = new Random(); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateTime.Now.AddDays(index), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }) - .ToArray(); - } } } diff --git a/Yi.Framework/Yi.Framework.AuthenticationCenter/WeatherForecast.cs b/Yi.Framework/Yi.Framework.AuthenticationCenter/WeatherForecast.cs deleted file mode 100644 index 520fb1b1..00000000 --- a/Yi.Framework/Yi.Framework.AuthenticationCenter/WeatherForecast.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Yi.Framework.AuthenticationCenter -{ - public class WeatherForecast - { - public DateTime Date { get; set; } - - public int TemperatureC { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - - public string Summary { get; set; } - } -} diff --git a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/InitESIndexWorker.cs b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/InitESIndexWorker.cs index 161e40c5..f18a0372 100644 --- a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/InitESIndexWorker.cs +++ b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/InitESIndexWorker.cs @@ -49,16 +49,16 @@ namespace Yi.Framework.ElasticSearchProcessor //【判断增删改,es进行相应的操作】 //switch (spuCQRSQueueModel.CQRSType) //{ - //case (int)SPUCQRSQueueModelType.Insert: - //case (int)SPUCQRSQueueModelType.Update: - // { - // Goods goods = this._ISearchService.GetGoodsBySpuId(spuCQRSQueueModel.SpuId); - // this._IElasticSearchService.InsertOrUpdata(goods); - // break; - // } - //case (int)SPUCQRSQueueModelType.Delete: - // this._IElasticSearchService.Delete(spuCQRSQueueModel.SpuId.ToString()); - // break; + // case (int)SPUCQRSQueueModelType.Insert: + // case (int)SPUCQRSQueueModelType.Update: + // { + // Goods goods = this._ISearchService.GetGoodsBySpuId(spuCQRSQueueModel.SpuId); + // this._IElasticSearchService.InsertOrUpdata(goods); + // break; + // } + // case (int)SPUCQRSQueueModelType.Delete: + // this._IElasticSearchService.Delete(spuCQRSQueueModel.SpuId.ToString()); + // break; // default: // throw new Exception("wrong spuCQRSQueueModel.CQRSType"); //} diff --git a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/WarmupESIndexWorker.cs b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/WarmupESIndexWorker.cs index a4d5550a..895134dd 100644 --- a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/WarmupESIndexWorker.cs +++ b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/WarmupESIndexWorker.cs @@ -13,7 +13,9 @@ using System.Threading; using System.Threading.Tasks; using Yi.Framework.Common.IOCOptions; using Yi.Framework.Common.Models; +using Yi.Framework.Common.QueueModel; using Yi.Framework.Core; +using Yi.Framework.Interface; namespace Yi.Framework.ElasticSearchProcessor { @@ -25,13 +27,15 @@ namespace Yi.Framework.ElasticSearchProcessor private readonly ElasticSearchInvoker _elasticSearchInvoker; private readonly IOptionsMonitor _ElasticSearchOptions = null; - public WarmupESIndexWorker(ILogger logger, RabbitMQInvoker rabbitMQInvoker, IConfiguration configuration, ElasticSearchInvoker elasticSearchInvoker, IOptionsMonitor optionsMonitor) + private readonly ISearchService _searchService; + public WarmupESIndexWorker(ILogger logger, RabbitMQInvoker rabbitMQInvoker, IConfiguration configuration, ElasticSearchInvoker elasticSearchInvoker, IOptionsMonitor optionsMonitor, ISearchService searchService) { this._logger = logger; this._RabbitMQInvoker = rabbitMQInvoker; this._configuration = configuration; this._elasticSearchInvoker = elasticSearchInvoker; this._ElasticSearchOptions = optionsMonitor; + this._searchService=searchService; } protected override async Task ExecuteAsync(CancellationToken stoppingToken) @@ -44,14 +48,14 @@ namespace Yi.Framework.ElasticSearchProcessor HttpClient _HttpClient = new HttpClient(); this._RabbitMQInvoker.RegistReciveAction(rabbitMQConsumerModel, message => { - //SKUWarmupQueueModel skuWarmupQueueModel = JsonConvert.DeserializeObject(message); + SKUWarmupQueueModel skuWarmupQueueModel = JsonConvert.DeserializeObject(message); //【得到消息队列模型】 #region 先删除Index---新建Index---再建立全部数据索引 { try { this._elasticSearchInvoker.DropIndex(this._ElasticSearchOptions.CurrentValue.IndexName); - //this._ISearchService.ImpDataBySpu(); + this._searchService.ImpDataBySpu(); //【触发es数据导入服务】 this._logger.LogInformation($"{nameof(WarmupESIndexWorker)}.InitAll succeed"); return true; diff --git a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/Yi.Framework.ElasticSearchProcessor.csproj b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/Yi.Framework.ElasticSearchProcessor.csproj index f208d303..93993039 100644 --- a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/Yi.Framework.ElasticSearchProcessor.csproj +++ b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/Yi.Framework.ElasticSearchProcessor.csproj @@ -4,4 +4,33 @@ net5.0 + + + + + + + + PreserveNewest + true + PreserveNewest + + + PreserveNewest + true + PreserveNewest + + + + + + + + + + + + + + diff --git a/Yi.Framework/Yi.Framework.Interface/IGoodsService.cs b/Yi.Framework/Yi.Framework.Interface/IGoodsService.cs new file mode 100644 index 00000000..b3bcbe76 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Interface/IGoodsService.cs @@ -0,0 +1,15 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Model.Models; +using Yi.Framework.Model.Search; + +namespace Yi.Framework.Interface +{ + public interface IGoodsService + { + PageResult QuerySpuByPage(int page, int rows, string key, bool? saleable); + } +} diff --git a/Yi.Framework/Yi.Framework.Interface/ISearchService.cs b/Yi.Framework/Yi.Framework.Interface/ISearchService.cs new file mode 100644 index 00000000..4d503167 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Interface/ISearchService.cs @@ -0,0 +1,13 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Interface +{ + public interface ISearchService + { + void ImpDataBySpu(); + } +} diff --git a/Yi.Framework/Yi.Framework.Interface/T4Iservice.cs b/Yi.Framework/Yi.Framework.Interface/T4Iservice.cs index bf91c56d..12171726 100644 --- a/Yi.Framework/Yi.Framework.Interface/T4Iservice.cs +++ b/Yi.Framework/Yi.Framework.Interface/T4Iservice.cs @@ -8,6 +8,18 @@ using Yi.Framework.Model.Models; namespace Yi.Framework.Interface { + public partial interface IBrandService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + + public partial interface ICategoryService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + public partial interface IMenuService:IBaseService { Task DelListByUpdateAsync(List _ids); @@ -20,12 +32,54 @@ namespace Yi.Framework.Interface Task> GetAllEntitiesTrueAsync(); } + public partial interface IOrderService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + public partial interface IRoleService:IBaseService { Task DelListByUpdateAsync(List _ids); Task> GetAllEntitiesTrueAsync(); } + public partial interface ISkuService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + + public partial interface ISpec_groupService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + + public partial interface ISpec_paramService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + + public partial interface ISpuService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + + public partial interface ISpu_detailService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + + public partial interface IStockService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + public partial interface IUserService:IBaseService { Task DelListByUpdateAsync(List _ids); diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.Designer.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.Designer.cs new file mode 100644 index 00000000..98620124 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.Designer.cs @@ -0,0 +1,219 @@ +锘// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Yi.Framework.Model; + +namespace Yi.Framework.Model.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("20211106080544_ec1")] + partial class ec1 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 64) + .HasAnnotation("ProductVersion", "5.0.11"); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_show") + .HasColumnType("int"); + + b.Property("is_top") + .HasColumnType("int"); + + b.Property("menu_name") + .HasColumnType("longtext"); + + b.Property("menuid") + .HasColumnType("int"); + + b.Property("mouldid") + .HasColumnType("int"); + + b.Property("roleid") + .HasColumnType("int"); + + b.Property("router") + .HasColumnType("longtext"); + + b.Property("sort") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("menuid"); + + b.HasIndex("mouldid"); + + b.HasIndex("roleid"); + + b.ToTable("menu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.mould", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("mould_name") + .HasColumnType("longtext"); + + b.Property("url") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("mould"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("introduce") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("role_name") + .HasColumnType("longtext"); + + b.Property("userid") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("userid"); + + b.ToTable("role"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("address") + .HasColumnType("longtext"); + + b.Property("age") + .HasColumnType("int"); + + b.Property("email") + .HasColumnType("longtext"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("introduction") + .HasColumnType("longtext"); + + b.Property("ip") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("nick") + .HasColumnType("longtext"); + + b.Property("password") + .HasColumnType("longtext"); + + b.Property("phone") + .HasColumnType("int"); + + b.Property("username") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("user"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.visit", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("num") + .HasColumnType("int"); + + b.Property("time") + .HasColumnType("datetime(6)"); + + b.HasKey("id"); + + b.ToTable("visit"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.HasOne("Yi.Framework.Model.Models.menu", null) + .WithMany("children") + .HasForeignKey("menuid"); + + b.HasOne("Yi.Framework.Model.Models.mould", "mould") + .WithMany() + .HasForeignKey("mouldid"); + + b.HasOne("Yi.Framework.Model.Models.role", null) + .WithMany("menus") + .HasForeignKey("roleid"); + + b.Navigation("mould"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => + { + b.HasOne("Yi.Framework.Model.Models.user", null) + .WithMany("roles") + .HasForeignKey("userid"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.Navigation("children"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => + { + b.Navigation("menus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => + { + b.Navigation("roles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.cs new file mode 100644 index 00000000..baaf79d9 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.cs @@ -0,0 +1,17 @@ +锘縰sing Microsoft.EntityFrameworkCore.Migrations; + +namespace Yi.Framework.Model.Migrations +{ + public partial class ec1 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.Designer.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.Designer.cs new file mode 100644 index 00000000..6d9fb503 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.Designer.cs @@ -0,0 +1,732 @@ +锘// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Yi.Framework.Model; + +namespace Yi.Framework.Model.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("20211106080646_ec2")] + partial class ec2 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 64) + .HasAnnotation("ProductVersion", "5.0.11"); + + modelBuilder.Entity("Yi.Framework.Model.Models.brand", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("image") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("letter") + .HasColumnType("longtext"); + + b.Property("name") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("brand"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.brand_category", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("brandId") + .HasColumnType("int"); + + b.Property("categoryId") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("brandId"); + + b.HasIndex("categoryId"); + + b.ToTable("brand_category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_parent") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext"); + + b.Property("sort") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_show") + .HasColumnType("int"); + + b.Property("is_top") + .HasColumnType("int"); + + b.Property("menu_name") + .HasColumnType("longtext"); + + b.Property("menuid") + .HasColumnType("int"); + + b.Property("mouldid") + .HasColumnType("int"); + + b.Property("roleid") + .HasColumnType("int"); + + b.Property("router") + .HasColumnType("longtext"); + + b.Property("sort") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("menuid"); + + b.HasIndex("mouldid"); + + b.HasIndex("roleid"); + + b.ToTable("menu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.mould", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("mould_name") + .HasColumnType("longtext"); + + b.Property("url") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("mould"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.order", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("actual_pay") + .HasColumnType("int"); + + b.Property("buyer_message") + .HasColumnType("longtext"); + + b.Property("buyer_nick") + .HasColumnType("longtext"); + + b.Property("buyer_rate") + .HasColumnType("int"); + + b.Property("creat_time") + .HasColumnType("datetime(6)"); + + b.Property("invoice_type") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("payment_type") + .HasColumnType("int"); + + b.Property("post_fee") + .HasColumnType("int"); + + b.Property("promotion_ids") + .HasColumnType("longtext"); + + b.Property("receiver") + .HasColumnType("longtext"); + + b.Property("receiver_address") + .HasColumnType("longtext"); + + b.Property("receiver_city") + .HasColumnType("longtext"); + + b.Property("receiver_district") + .HasColumnType("longtext"); + + b.Property("receiver_mobile") + .HasColumnType("longtext"); + + b.Property("receiver_state") + .HasColumnType("longtext"); + + b.Property("receiver_zip") + .HasColumnType("longtext"); + + b.Property("shipping_code") + .HasColumnType("longtext"); + + b.Property("shipping_name") + .HasColumnType("longtext"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("source_type") + .HasColumnType("int"); + + b.Property("total_pay") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("order"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("introduce") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("role_name") + .HasColumnType("longtext"); + + b.Property("userid") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("userid"); + + b.ToTable("role"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)"); + + b.Property("enable") + .HasColumnType("int"); + + b.Property("images") + .HasColumnType("longtext"); + + b.Property("indexes") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)"); + + b.Property("own_spec") + .HasColumnType("longtext"); + + b.Property("price") + .HasColumnType("int"); + + b.Property("spuid") + .HasColumnType("int"); + + b.Property("title") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.HasIndex("spuid"); + + b.ToTable("sku"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("spec_group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("generic") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext"); + + b.Property("numeric") + .HasColumnType("int"); + + b.Property("searching") + .HasColumnType("int"); + + b.Property("segments") + .HasColumnType("longtext"); + + b.Property("spec_Groupid") + .HasColumnType("int"); + + b.Property("unit") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.HasIndex("spec_Groupid"); + + b.ToTable("spec_param"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("brandid") + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)"); + + b.Property("saleable") + .HasColumnType("int"); + + b.Property("spu_Detailid") + .HasColumnType("int"); + + b.Property("sub_title") + .HasColumnType("longtext"); + + b.Property("title") + .HasColumnType("longtext"); + + b.Property("valid") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("brandid"); + + b.HasIndex("spu_Detailid"); + + b.ToTable("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu_detail", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("after_service") + .HasColumnType("longtext"); + + b.Property("description") + .HasColumnType("longtext"); + + b.Property("generic_spec") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("packing_list") + .HasColumnType("longtext"); + + b.Property("special_spec") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("spu_detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("seckill_stock") + .HasColumnType("int"); + + b.Property("seckill_total") + .HasColumnType("int"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("stock_count") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("stock"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("address") + .HasColumnType("longtext"); + + b.Property("age") + .HasColumnType("int"); + + b.Property("email") + .HasColumnType("longtext"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("introduction") + .HasColumnType("longtext"); + + b.Property("ip") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("nick") + .HasColumnType("longtext"); + + b.Property("password") + .HasColumnType("longtext"); + + b.Property("phone") + .HasColumnType("int"); + + b.Property("username") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("user"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.visit", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("num") + .HasColumnType("int"); + + b.Property("time") + .HasColumnType("datetime(6)"); + + b.HasKey("id"); + + b.ToTable("visit"); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.Property("categoriesid") + .HasColumnType("int"); + + b.Property("spusid") + .HasColumnType("int"); + + b.HasKey("categoriesid", "spusid"); + + b.HasIndex("spusid"); + + b.ToTable("categoryspu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.brand_category", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", "brand") + .WithMany("categories") + .HasForeignKey("brandId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("brands") + .HasForeignKey("categoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("brand"); + + b.Navigation("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany("chidrens") + .HasForeignKey("categoryid"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.HasOne("Yi.Framework.Model.Models.menu", null) + .WithMany("children") + .HasForeignKey("menuid"); + + b.HasOne("Yi.Framework.Model.Models.mould", "mould") + .WithMany() + .HasForeignKey("mouldid"); + + b.HasOne("Yi.Framework.Model.Models.role", null) + .WithMany("menus") + .HasForeignKey("roleid"); + + b.Navigation("mould"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.order", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", null) + .WithMany("orders") + .HasForeignKey("skuid"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => + { + b.HasOne("Yi.Framework.Model.Models.user", null) + .WithMany("roles") + .HasForeignKey("userid"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.HasOne("Yi.Framework.Model.Models.spu", "spu") + .WithMany("skus") + .HasForeignKey("spuid"); + + b.Navigation("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Groups") + .HasForeignKey("categoryid"); + + b.Navigation("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Params") + .HasForeignKey("categoryid"); + + b.HasOne("Yi.Framework.Model.Models.spec_group", "spec_Group") + .WithMany("spec_Params") + .HasForeignKey("spec_Groupid"); + + b.Navigation("category"); + + b.Navigation("spec_Group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", "brand") + .WithMany("spus") + .HasForeignKey("brandid"); + + b.HasOne("Yi.Framework.Model.Models.spu_detail", "spu_Detail") + .WithMany() + .HasForeignKey("spu_Detailid"); + + b.Navigation("brand"); + + b.Navigation("spu_Detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", "sku") + .WithMany() + .HasForeignKey("skuid"); + + b.Navigation("sku"); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany() + .HasForeignKey("categoriesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.spu", null) + .WithMany() + .HasForeignKey("spusid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.brand", b => + { + b.Navigation("categories"); + + b.Navigation("spus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Navigation("brands"); + + b.Navigation("chidrens"); + + b.Navigation("spec_Groups"); + + b.Navigation("spec_Params"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.Navigation("children"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => + { + b.Navigation("menus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.Navigation("orders"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Navigation("spec_Params"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Navigation("skus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => + { + b.Navigation("roles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.cs new file mode 100644 index 00000000..6ffc7373 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.cs @@ -0,0 +1,436 @@ +锘縰sing System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Yi.Framework.Model.Migrations +{ + public partial class ec2 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "brand", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + image = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + letter = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_brand", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "category", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + sort = table.Column(type: "int", nullable: false), + is_parent = table.Column(type: "int", nullable: false), + categoryid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_category", x => x.id); + table.ForeignKey( + name: "FK_category_category_categoryid", + column: x => x.categoryid, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "spu_detail", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + description = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + generic_spec = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + special_spec = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + packing_list = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + after_service = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_spu_detail", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "brand_category", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + brandId = table.Column(type: "int", nullable: false), + categoryId = table.Column(type: "int", nullable: false), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_brand_category", x => x.id); + table.ForeignKey( + name: "FK_brand_category_brand_brandId", + column: x => x.brandId, + principalTable: "brand", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_brand_category_category_categoryId", + column: x => x.categoryId, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "spec_group", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + categoryid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_spec_group", x => x.id); + table.ForeignKey( + name: "FK_spec_group_category_categoryid", + column: x => x.categoryid, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "spu", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + title = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + sub_title = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + saleable = table.Column(type: "int", nullable: false), + valid = table.Column(type: "int", nullable: false), + crate_time = table.Column(type: "datetime(6)", nullable: false), + last_update_time = table.Column(type: "datetime(6)", nullable: false), + brandid = table.Column(type: "int", nullable: true), + spu_Detailid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_spu", x => x.id); + table.ForeignKey( + name: "FK_spu_brand_brandid", + column: x => x.brandid, + principalTable: "brand", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_spu_spu_detail_spu_Detailid", + column: x => x.spu_Detailid, + principalTable: "spu_detail", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "spec_param", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + numeric = table.Column(type: "int", nullable: false), + unit = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + generic = table.Column(type: "int", nullable: false), + searching = table.Column(type: "int", nullable: false), + segments = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + spec_Groupid = table.Column(type: "int", nullable: true), + categoryid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_spec_param", x => x.id); + table.ForeignKey( + name: "FK_spec_param_category_categoryid", + column: x => x.categoryid, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_spec_param_spec_group_spec_Groupid", + column: x => x.spec_Groupid, + principalTable: "spec_group", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "categoryspu", + columns: table => new + { + categoriesid = table.Column(type: "int", nullable: false), + spusid = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_categoryspu", x => new { x.categoriesid, x.spusid }); + table.ForeignKey( + name: "FK_categoryspu_category_categoriesid", + column: x => x.categoriesid, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_categoryspu_spu_spusid", + column: x => x.spusid, + principalTable: "spu", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "sku", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + title = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + images = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + price = table.Column(type: "int", nullable: false), + indexes = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + enable = table.Column(type: "int", nullable: false), + own_spec = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + crate_time = table.Column(type: "datetime(6)", nullable: false), + last_update_time = table.Column(type: "datetime(6)", nullable: false), + spuid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_sku", x => x.id); + table.ForeignKey( + name: "FK_sku_spu_spuid", + column: x => x.spuid, + principalTable: "spu", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "order", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + total_pay = table.Column(type: "int", nullable: false), + actual_pay = table.Column(type: "int", nullable: false), + payment_type = table.Column(type: "int", nullable: false), + post_fee = table.Column(type: "int", nullable: false), + promotion_ids = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + creat_time = table.Column(type: "datetime(6)", nullable: false), + shipping_name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + shipping_code = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + buyer_message = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + buyer_nick = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + buyer_rate = table.Column(type: "int", nullable: false), + receiver_state = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + receiver_city = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + receiver_district = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + receiver_address = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + receiver_mobile = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + receiver_zip = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + receiver = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + invoice_type = table.Column(type: "int", nullable: false), + source_type = table.Column(type: "int", nullable: false), + skuid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_order", x => x.id); + table.ForeignKey( + name: "FK_order_sku_skuid", + column: x => x.skuid, + principalTable: "sku", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "stock", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + seckill_stock = table.Column(type: "int", nullable: false), + seckill_total = table.Column(type: "int", nullable: false), + stock_count = table.Column(type: "int", nullable: false), + skuid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_stock", x => x.id); + table.ForeignKey( + name: "FK_stock_sku_skuid", + column: x => x.skuid, + principalTable: "sku", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_brand_category_brandId", + table: "brand_category", + column: "brandId"); + + migrationBuilder.CreateIndex( + name: "IX_brand_category_categoryId", + table: "brand_category", + column: "categoryId"); + + migrationBuilder.CreateIndex( + name: "IX_category_categoryid", + table: "category", + column: "categoryid"); + + migrationBuilder.CreateIndex( + name: "IX_categoryspu_spusid", + table: "categoryspu", + column: "spusid"); + + migrationBuilder.CreateIndex( + name: "IX_order_skuid", + table: "order", + column: "skuid"); + + migrationBuilder.CreateIndex( + name: "IX_sku_spuid", + table: "sku", + column: "spuid"); + + migrationBuilder.CreateIndex( + name: "IX_spec_group_categoryid", + table: "spec_group", + column: "categoryid"); + + migrationBuilder.CreateIndex( + name: "IX_spec_param_categoryid", + table: "spec_param", + column: "categoryid"); + + migrationBuilder.CreateIndex( + name: "IX_spec_param_spec_Groupid", + table: "spec_param", + column: "spec_Groupid"); + + migrationBuilder.CreateIndex( + name: "IX_spu_brandid", + table: "spu", + column: "brandid"); + + migrationBuilder.CreateIndex( + name: "IX_spu_spu_Detailid", + table: "spu", + column: "spu_Detailid"); + + migrationBuilder.CreateIndex( + name: "IX_stock_skuid", + table: "stock", + column: "skuid"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "brand_category"); + + migrationBuilder.DropTable( + name: "categoryspu"); + + migrationBuilder.DropTable( + name: "order"); + + migrationBuilder.DropTable( + name: "spec_param"); + + migrationBuilder.DropTable( + name: "stock"); + + migrationBuilder.DropTable( + name: "spec_group"); + + migrationBuilder.DropTable( + name: "sku"); + + migrationBuilder.DropTable( + name: "category"); + + migrationBuilder.DropTable( + name: "spu"); + + migrationBuilder.DropTable( + name: "brand"); + + migrationBuilder.DropTable( + name: "spu_detail"); + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.Designer.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.Designer.cs new file mode 100644 index 00000000..8c0467c2 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.Designer.cs @@ -0,0 +1,770 @@ +锘// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Yi.Framework.Model; + +namespace Yi.Framework.Model.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("20211106084427_ec3")] + partial class ec3 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 64) + .HasAnnotation("ProductVersion", "5.0.11"); + + modelBuilder.Entity("Yi.Framework.Model.Models.brand", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("image") + .HasColumnType("longtext") + .HasComment("鍝佺墝鍥剧墖"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("letter") + .HasColumnType("longtext") + .HasComment("鍝佺墝棣栧瓧姣"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("鍝佺墝鍚嶇О"); + + b.HasKey("id"); + + b.ToTable("brand"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_parent") + .HasColumnType("int") + .HasComment("鏄惁鐖剁被鍒"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("绫诲埆鍚嶇О"); + + b.Property("sort") + .HasColumnType("int") + .HasComment("鎺掑簭"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_show") + .HasColumnType("int"); + + b.Property("is_top") + .HasColumnType("int"); + + b.Property("menu_name") + .HasColumnType("longtext"); + + b.Property("menuid") + .HasColumnType("int"); + + b.Property("mouldid") + .HasColumnType("int"); + + b.Property("roleid") + .HasColumnType("int"); + + b.Property("router") + .HasColumnType("longtext"); + + b.Property("sort") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("menuid"); + + b.HasIndex("mouldid"); + + b.HasIndex("roleid"); + + b.ToTable("menu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.mould", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("mould_name") + .HasColumnType("longtext"); + + b.Property("url") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("mould"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.order", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("actual_pay") + .HasColumnType("int") + .HasComment("瀹炰粯閲戦銆傚崟浣:鍒嗐傚:20007锛岃〃绀:200鍏7鍒"); + + b.Property("buyer_message") + .HasColumnType("longtext") + .HasComment("涔板鐣欒█"); + + b.Property("buyer_nick") + .HasColumnType("longtext") + .HasComment("涔板鏄电О"); + + b.Property("buyer_rate") + .HasColumnType("int") + .HasComment("涔板鏄惁宸茬粡璇勪环,0鏈瘎浠凤紝1宸茶瘎浠"); + + b.Property("creat_time") + .HasColumnType("datetime(6)") + .HasComment("璁㈠崟鍒涘缓鏃堕棿"); + + b.Property("invoice_type") + .HasColumnType("int") + .HasComment("鍙戠エ绫诲瀷:0鏃犲彂绁1鏅氬彂绁紝2鐢靛瓙鍙戠エ锛3澧炲肩◣鍙戠エ"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("payment_type") + .HasColumnType("int") + .HasComment("鏀粯绫诲瀷锛1銆佸湪绾挎敮浠橈紝2銆佽揣鍒颁粯娆"); + + b.Property("post_fee") + .HasColumnType("int") + .HasComment("閭垂銆傚崟浣:鍒嗐傚:20007锛岃〃绀:200鍏7鍒"); + + b.Property("promotion_ids") + .HasColumnType("longtext") + .HasComment("promotion_ids"); + + b.Property("receiver") + .HasColumnType("longtext") + .HasComment("鏀惰揣浜"); + + b.Property("receiver_address") + .HasColumnType("longtext") + .HasComment("鏀惰幏鍦板潃锛堣閬撱佷綇鍧绛夎缁嗗湴鍧锛"); + + b.Property("receiver_city") + .HasColumnType("longtext") + .HasComment("鏀惰幏鍦板潃锛堝競锛"); + + b.Property("receiver_district") + .HasColumnType("longtext") + .HasComment("鏀惰幏鍦板潃锛堝尯/鍘匡級"); + + b.Property("receiver_mobile") + .HasColumnType("longtext") + .HasComment("鏀惰揣浜烘墜鏈"); + + b.Property("receiver_state") + .HasColumnType("longtext") + .HasComment("鏀惰幏鍦板潃锛堢渷锛"); + + b.Property("receiver_zip") + .HasColumnType("longtext") + .HasComment("鏀惰揣浜洪偖缂"); + + b.Property("shipping_code") + .HasColumnType("longtext") + .HasComment("鐗╂祦鍗曞彿"); + + b.Property("shipping_name") + .HasColumnType("longtext") + .HasComment("鐗╂祦鍚嶇О"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("source_type") + .HasColumnType("int") + .HasComment("璁㈠崟鏉ユ簮锛1:app绔紝2锛歱c绔紝3锛歁绔紝4锛氬井淇$锛5锛氭墜鏈簈q绔"); + + b.Property("total_pay") + .HasColumnType("int") + .HasComment("鎬婚噾棰濓紝鍗曚綅涓哄垎"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("order"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("introduce") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("role_name") + .HasColumnType("longtext"); + + b.Property("userid") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("userid"); + + b.ToTable("role"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)") + .HasComment("鍒涘缓鏃堕棿"); + + b.Property("enable") + .HasColumnType("int") + .HasComment("鏄惁鏈夋晥锛0鏃犳晥锛1鏈夋晥"); + + b.Property("images") + .HasColumnType("longtext") + .HasComment("鍟嗗搧鐨勫浘鐗囷紝澶氫釜鍥剧墖浠モ,鈥欏垎鍓"); + + b.Property("indexes") + .HasColumnType("longtext") + .HasComment("鐗规湁瑙勬牸灞炴у湪spu灞炴фā鏉夸腑鐨勫搴斾笅鏍囩粍鍚"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)") + .HasComment("鏈鍚庢洿鏂版椂闂"); + + b.Property("own_spec") + .HasColumnType("longtext") + .HasComment("sku鐨勭壒鏈夎鏍煎弬鏁伴敭鍊煎锛宩son鏍煎紡锛屽弽搴忓垪鍖栨椂璇蜂娇鐢╨inkedHashMap锛屼繚璇佹湁搴"); + + b.Property("price") + .HasColumnType("int") + .HasComment("閿鍞环鏍硷紝鍗曚綅涓哄垎"); + + b.Property("spuid") + .HasColumnType("int"); + + b.Property("title") + .HasColumnType("longtext") + .HasComment("鍟嗗搧鏍囬"); + + b.HasKey("id"); + + b.HasIndex("spuid"); + + b.ToTable("sku"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("瑙勬牸缁勫悕绉"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("spec_group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("generic") + .HasColumnType("int") + .HasComment("鏄惁鏄痵ku閫氱敤灞炴э紝true鎴杅alse"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("鍙傛暟鍚"); + + b.Property("numeric") + .HasColumnType("int") + .HasComment("鏄惁鏄暟瀛楃被鍨嬪弬鏁帮紝true鎴杅alse"); + + b.Property("searching") + .HasColumnType("int") + .HasComment("鏄惁鐢ㄤ簬鎼滅储杩囨护锛宼rue鎴杅alse"); + + b.Property("segments") + .HasColumnType("longtext") + .HasComment("鏁板肩被鍨嬪弬鏁帮紝濡傛灉闇瑕佹悳绱紝鍒欐坊鍔犲垎娈甸棿闅斿硷紝濡侰PU棰戠巼闂撮殧锛0.5-1.0"); + + b.Property("spec_Groupid") + .HasColumnType("int"); + + b.Property("unit") + .HasColumnType("longtext") + .HasComment("鏁板瓧绫诲瀷鍙傛暟鐨勫崟浣嶏紝闈炴暟瀛楃被鍨嬪彲浠ヤ负绌"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.HasIndex("spec_Groupid"); + + b.ToTable("spec_param"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("brandid") + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)") + .HasComment("鍒涘缓鏃堕棿"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)") + .HasComment("鏈鍚庢洿鏂版椂闂"); + + b.Property("saleable") + .HasColumnType("int") + .HasComment("鏄惁涓婃灦"); + + b.Property("spu_Detailid") + .HasColumnType("int"); + + b.Property("sub_title") + .HasColumnType("longtext") + .HasComment("瀛愭爣棰"); + + b.Property("title") + .HasColumnType("longtext") + .HasComment("鏍囬"); + + b.Property("valid") + .HasColumnType("int") + .HasComment("鏄惁鏈夋晥"); + + b.HasKey("id"); + + b.HasIndex("brandid"); + + b.HasIndex("spu_Detailid"); + + b.ToTable("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu_detail", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("after_service") + .HasColumnType("longtext") + .HasComment("鍞悗鏈嶅姟"); + + b.Property("description") + .HasColumnType("longtext") + .HasComment("鎻忚堪"); + + b.Property("generic_spec") + .HasColumnType("longtext") + .HasComment("閫氱敤瑙勬牸鍙傛暟鏁版嵁"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("packing_list") + .HasColumnType("longtext") + .HasComment("鍖呰娓呭崟"); + + b.Property("special_spec") + .HasColumnType("longtext") + .HasComment("鐗规湁瑙勬牸鍙傛暟鍙婂彲閫夊间俊鎭紝json鏍煎紡"); + + b.HasKey("id"); + + b.ToTable("spu_detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("seckill_stock") + .HasColumnType("int") + .HasComment("鍙鏉搴撳瓨"); + + b.Property("seckill_total") + .HasColumnType("int") + .HasComment("绉掓潃鎬绘暟閲"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("stock_count") + .HasColumnType("int") + .HasComment("搴撳瓨鏁伴噺"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("stock"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("address") + .HasColumnType("longtext"); + + b.Property("age") + .HasColumnType("int"); + + b.Property("email") + .HasColumnType("longtext"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("introduction") + .HasColumnType("longtext"); + + b.Property("ip") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("nick") + .HasColumnType("longtext"); + + b.Property("password") + .HasColumnType("longtext"); + + b.Property("phone") + .HasColumnType("int"); + + b.Property("username") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("user"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.visit", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("num") + .HasColumnType("int"); + + b.Property("time") + .HasColumnType("datetime(6)"); + + b.HasKey("id"); + + b.ToTable("visit"); + }); + + modelBuilder.Entity("brandcategory", b => + { + b.Property("brandsid") + .HasColumnType("int"); + + b.Property("categoriesid") + .HasColumnType("int"); + + b.HasKey("brandsid", "categoriesid"); + + b.HasIndex("categoriesid"); + + b.ToTable("brandcategory"); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.Property("categoriesid") + .HasColumnType("int"); + + b.Property("spusid") + .HasColumnType("int"); + + b.HasKey("categoriesid", "spusid"); + + b.HasIndex("spusid"); + + b.ToTable("categoryspu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany("chidrens") + .HasForeignKey("categoryid"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.HasOne("Yi.Framework.Model.Models.menu", null) + .WithMany("children") + .HasForeignKey("menuid"); + + b.HasOne("Yi.Framework.Model.Models.mould", "mould") + .WithMany() + .HasForeignKey("mouldid"); + + b.HasOne("Yi.Framework.Model.Models.role", null) + .WithMany("menus") + .HasForeignKey("roleid"); + + b.Navigation("mould"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.order", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", null) + .WithMany("orders") + .HasForeignKey("skuid"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => + { + b.HasOne("Yi.Framework.Model.Models.user", null) + .WithMany("roles") + .HasForeignKey("userid"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.HasOne("Yi.Framework.Model.Models.spu", "spu") + .WithMany("skus") + .HasForeignKey("spuid"); + + b.Navigation("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Groups") + .HasForeignKey("categoryid"); + + b.Navigation("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Params") + .HasForeignKey("categoryid"); + + b.HasOne("Yi.Framework.Model.Models.spec_group", "spec_Group") + .WithMany("spec_Params") + .HasForeignKey("spec_Groupid"); + + b.Navigation("category"); + + b.Navigation("spec_Group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", "brand") + .WithMany("spus") + .HasForeignKey("brandid"); + + b.HasOne("Yi.Framework.Model.Models.spu_detail", "spu_Detail") + .WithMany() + .HasForeignKey("spu_Detailid"); + + b.Navigation("brand"); + + b.Navigation("spu_Detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", "sku") + .WithMany() + .HasForeignKey("skuid"); + + b.Navigation("sku"); + }); + + modelBuilder.Entity("brandcategory", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", null) + .WithMany() + .HasForeignKey("brandsid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany() + .HasForeignKey("categoriesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany() + .HasForeignKey("categoriesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.spu", null) + .WithMany() + .HasForeignKey("spusid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.brand", b => + { + b.Navigation("spus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Navigation("chidrens"); + + b.Navigation("spec_Groups"); + + b.Navigation("spec_Params"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.Navigation("children"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => + { + b.Navigation("menus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.Navigation("orders"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Navigation("spec_Params"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Navigation("skus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => + { + b.Navigation("roles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.cs new file mode 100644 index 00000000..c88a2028 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.cs @@ -0,0 +1,1265 @@ +锘縰sing System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Yi.Framework.Model.Migrations +{ + public partial class ec3 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "brand_category"); + + migrationBuilder.AlterColumn( + name: "stock_count", + table: "stock", + type: "int", + nullable: false, + comment: "搴撳瓨鏁伴噺", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "seckill_total", + table: "stock", + type: "int", + nullable: false, + comment: "绉掓潃鎬绘暟閲", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "seckill_stock", + table: "stock", + type: "int", + nullable: false, + comment: "鍙鏉搴撳瓨", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "special_spec", + table: "spu_detail", + type: "longtext", + nullable: true, + comment: "鐗规湁瑙勬牸鍙傛暟鍙婂彲閫夊间俊鎭紝json鏍煎紡", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "packing_list", + table: "spu_detail", + type: "longtext", + nullable: true, + comment: "鍖呰娓呭崟", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "generic_spec", + table: "spu_detail", + type: "longtext", + nullable: true, + comment: "閫氱敤瑙勬牸鍙傛暟鏁版嵁", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "description", + table: "spu_detail", + type: "longtext", + nullable: true, + comment: "鎻忚堪", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "after_service", + table: "spu_detail", + type: "longtext", + nullable: true, + comment: "鍞悗鏈嶅姟", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "valid", + table: "spu", + type: "int", + nullable: false, + comment: "鏄惁鏈夋晥", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "title", + table: "spu", + type: "longtext", + nullable: true, + comment: "鏍囬", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "sub_title", + table: "spu", + type: "longtext", + nullable: true, + comment: "瀛愭爣棰", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "saleable", + table: "spu", + type: "int", + nullable: false, + comment: "鏄惁涓婃灦", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "last_update_time", + table: "spu", + type: "datetime(6)", + nullable: false, + comment: "鏈鍚庢洿鏂版椂闂", + oldClrType: typeof(DateTime), + oldType: "datetime(6)"); + + migrationBuilder.AlterColumn( + name: "crate_time", + table: "spu", + type: "datetime(6)", + nullable: false, + comment: "鍒涘缓鏃堕棿", + oldClrType: typeof(DateTime), + oldType: "datetime(6)"); + + migrationBuilder.AlterColumn( + name: "unit", + table: "spec_param", + type: "longtext", + nullable: true, + comment: "鏁板瓧绫诲瀷鍙傛暟鐨勫崟浣嶏紝闈炴暟瀛楃被鍨嬪彲浠ヤ负绌", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "segments", + table: "spec_param", + type: "longtext", + nullable: true, + comment: "鏁板肩被鍨嬪弬鏁帮紝濡傛灉闇瑕佹悳绱紝鍒欐坊鍔犲垎娈甸棿闅斿硷紝濡侰PU棰戠巼闂撮殧锛0.5-1.0", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "searching", + table: "spec_param", + type: "int", + nullable: false, + comment: "鏄惁鐢ㄤ簬鎼滅储杩囨护锛宼rue鎴杅alse", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "numeric", + table: "spec_param", + type: "int", + nullable: false, + comment: "鏄惁鏄暟瀛楃被鍨嬪弬鏁帮紝true鎴杅alse", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "name", + table: "spec_param", + type: "longtext", + nullable: true, + comment: "鍙傛暟鍚", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "generic", + table: "spec_param", + type: "int", + nullable: false, + comment: "鏄惁鏄痵ku閫氱敤灞炴э紝true鎴杅alse", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "name", + table: "spec_group", + type: "longtext", + nullable: true, + comment: "瑙勬牸缁勫悕绉", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "title", + table: "sku", + type: "longtext", + nullable: true, + comment: "鍟嗗搧鏍囬", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "price", + table: "sku", + type: "int", + nullable: false, + comment: "閿鍞环鏍硷紝鍗曚綅涓哄垎", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "own_spec", + table: "sku", + type: "longtext", + nullable: true, + comment: "sku鐨勭壒鏈夎鏍煎弬鏁伴敭鍊煎锛宩son鏍煎紡锛屽弽搴忓垪鍖栨椂璇蜂娇鐢╨inkedHashMap锛屼繚璇佹湁搴", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "last_update_time", + table: "sku", + type: "datetime(6)", + nullable: false, + comment: "鏈鍚庢洿鏂版椂闂", + oldClrType: typeof(DateTime), + oldType: "datetime(6)"); + + migrationBuilder.AlterColumn( + name: "indexes", + table: "sku", + type: "longtext", + nullable: true, + comment: "鐗规湁瑙勬牸灞炴у湪spu灞炴фā鏉夸腑鐨勫搴斾笅鏍囩粍鍚", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "images", + table: "sku", + type: "longtext", + nullable: true, + comment: "鍟嗗搧鐨勫浘鐗囷紝澶氫釜鍥剧墖浠モ,鈥欏垎鍓", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "enable", + table: "sku", + type: "int", + nullable: false, + comment: "鏄惁鏈夋晥锛0鏃犳晥锛1鏈夋晥", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "crate_time", + table: "sku", + type: "datetime(6)", + nullable: false, + comment: "鍒涘缓鏃堕棿", + oldClrType: typeof(DateTime), + oldType: "datetime(6)"); + + migrationBuilder.AlterColumn( + name: "total_pay", + table: "order", + type: "int", + nullable: false, + comment: "鎬婚噾棰濓紝鍗曚綅涓哄垎", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "source_type", + table: "order", + type: "int", + nullable: false, + comment: "璁㈠崟鏉ユ簮锛1:app绔紝2锛歱c绔紝3锛歁绔紝4锛氬井淇$锛5锛氭墜鏈簈q绔", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "shipping_name", + table: "order", + type: "longtext", + nullable: true, + comment: "鐗╂祦鍚嶇О", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "shipping_code", + table: "order", + type: "longtext", + nullable: true, + comment: "鐗╂祦鍗曞彿", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_zip", + table: "order", + type: "longtext", + nullable: true, + comment: "鏀惰揣浜洪偖缂", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_state", + table: "order", + type: "longtext", + nullable: true, + comment: "鏀惰幏鍦板潃锛堢渷锛", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_mobile", + table: "order", + type: "longtext", + nullable: true, + comment: "鏀惰揣浜烘墜鏈", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_district", + table: "order", + type: "longtext", + nullable: true, + comment: "鏀惰幏鍦板潃锛堝尯/鍘匡級", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_city", + table: "order", + type: "longtext", + nullable: true, + comment: "鏀惰幏鍦板潃锛堝競锛", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_address", + table: "order", + type: "longtext", + nullable: true, + comment: "鏀惰幏鍦板潃锛堣閬撱佷綇鍧绛夎缁嗗湴鍧锛", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver", + table: "order", + type: "longtext", + nullable: true, + comment: "鏀惰揣浜", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "promotion_ids", + table: "order", + type: "longtext", + nullable: true, + comment: "promotion_ids", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "post_fee", + table: "order", + type: "int", + nullable: false, + comment: "閭垂銆傚崟浣:鍒嗐傚:20007锛岃〃绀:200鍏7鍒", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "payment_type", + table: "order", + type: "int", + nullable: false, + comment: "鏀粯绫诲瀷锛1銆佸湪绾挎敮浠橈紝2銆佽揣鍒颁粯娆", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "invoice_type", + table: "order", + type: "int", + nullable: false, + comment: "鍙戠エ绫诲瀷:0鏃犲彂绁1鏅氬彂绁紝2鐢靛瓙鍙戠エ锛3澧炲肩◣鍙戠エ", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "creat_time", + table: "order", + type: "datetime(6)", + nullable: false, + comment: "璁㈠崟鍒涘缓鏃堕棿", + oldClrType: typeof(DateTime), + oldType: "datetime(6)"); + + migrationBuilder.AlterColumn( + name: "buyer_rate", + table: "order", + type: "int", + nullable: false, + comment: "涔板鏄惁宸茬粡璇勪环,0鏈瘎浠凤紝1宸茶瘎浠", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "buyer_nick", + table: "order", + type: "longtext", + nullable: true, + comment: "涔板鏄电О", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "buyer_message", + table: "order", + type: "longtext", + nullable: true, + comment: "涔板鐣欒█", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "actual_pay", + table: "order", + type: "int", + nullable: false, + comment: "瀹炰粯閲戦銆傚崟浣:鍒嗐傚:20007锛岃〃绀:200鍏7鍒", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "sort", + table: "category", + type: "int", + nullable: false, + comment: "鎺掑簭", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "name", + table: "category", + type: "longtext", + nullable: true, + comment: "绫诲埆鍚嶇О", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "is_parent", + table: "category", + type: "int", + nullable: false, + comment: "鏄惁鐖剁被鍒", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "name", + table: "brand", + type: "longtext", + nullable: true, + comment: "鍝佺墝鍚嶇О", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "letter", + table: "brand", + type: "longtext", + nullable: true, + comment: "鍝佺墝棣栧瓧姣", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "image", + table: "brand", + type: "longtext", + nullable: true, + comment: "鍝佺墝鍥剧墖", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "brandcategory", + columns: table => new + { + brandsid = table.Column(type: "int", nullable: false), + categoriesid = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_brandcategory", x => new { x.brandsid, x.categoriesid }); + table.ForeignKey( + name: "FK_brandcategory_brand_brandsid", + column: x => x.brandsid, + principalTable: "brand", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_brandcategory_category_categoriesid", + column: x => x.categoriesid, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_brandcategory_categoriesid", + table: "brandcategory", + column: "categoriesid"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "brandcategory"); + + migrationBuilder.AlterColumn( + name: "stock_count", + table: "stock", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "搴撳瓨鏁伴噺"); + + migrationBuilder.AlterColumn( + name: "seckill_total", + table: "stock", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "绉掓潃鎬绘暟閲"); + + migrationBuilder.AlterColumn( + name: "seckill_stock", + table: "stock", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "鍙鏉搴撳瓨"); + + migrationBuilder.AlterColumn( + name: "special_spec", + table: "spu_detail", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鐗规湁瑙勬牸鍙傛暟鍙婂彲閫夊间俊鎭紝json鏍煎紡") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "packing_list", + table: "spu_detail", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鍖呰娓呭崟") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "generic_spec", + table: "spu_detail", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "閫氱敤瑙勬牸鍙傛暟鏁版嵁") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "description", + table: "spu_detail", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鎻忚堪") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "after_service", + table: "spu_detail", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鍞悗鏈嶅姟") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "valid", + table: "spu", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "鏄惁鏈夋晥"); + + migrationBuilder.AlterColumn( + name: "title", + table: "spu", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鏍囬") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "sub_title", + table: "spu", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "瀛愭爣棰") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "saleable", + table: "spu", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "鏄惁涓婃灦"); + + migrationBuilder.AlterColumn( + name: "last_update_time", + table: "spu", + type: "datetime(6)", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldComment: "鏈鍚庢洿鏂版椂闂"); + + migrationBuilder.AlterColumn( + name: "crate_time", + table: "spu", + type: "datetime(6)", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldComment: "鍒涘缓鏃堕棿"); + + migrationBuilder.AlterColumn( + name: "unit", + table: "spec_param", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鏁板瓧绫诲瀷鍙傛暟鐨勫崟浣嶏紝闈炴暟瀛楃被鍨嬪彲浠ヤ负绌") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "segments", + table: "spec_param", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鏁板肩被鍨嬪弬鏁帮紝濡傛灉闇瑕佹悳绱紝鍒欐坊鍔犲垎娈甸棿闅斿硷紝濡侰PU棰戠巼闂撮殧锛0.5-1.0") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "searching", + table: "spec_param", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "鏄惁鐢ㄤ簬鎼滅储杩囨护锛宼rue鎴杅alse"); + + migrationBuilder.AlterColumn( + name: "numeric", + table: "spec_param", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "鏄惁鏄暟瀛楃被鍨嬪弬鏁帮紝true鎴杅alse"); + + migrationBuilder.AlterColumn( + name: "name", + table: "spec_param", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鍙傛暟鍚") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "generic", + table: "spec_param", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "鏄惁鏄痵ku閫氱敤灞炴э紝true鎴杅alse"); + + migrationBuilder.AlterColumn( + name: "name", + table: "spec_group", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "瑙勬牸缁勫悕绉") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "title", + table: "sku", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鍟嗗搧鏍囬") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "price", + table: "sku", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "閿鍞环鏍硷紝鍗曚綅涓哄垎"); + + migrationBuilder.AlterColumn( + name: "own_spec", + table: "sku", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "sku鐨勭壒鏈夎鏍煎弬鏁伴敭鍊煎锛宩son鏍煎紡锛屽弽搴忓垪鍖栨椂璇蜂娇鐢╨inkedHashMap锛屼繚璇佹湁搴") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "last_update_time", + table: "sku", + type: "datetime(6)", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldComment: "鏈鍚庢洿鏂版椂闂"); + + migrationBuilder.AlterColumn( + name: "indexes", + table: "sku", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鐗规湁瑙勬牸灞炴у湪spu灞炴фā鏉夸腑鐨勫搴斾笅鏍囩粍鍚") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "images", + table: "sku", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鍟嗗搧鐨勫浘鐗囷紝澶氫釜鍥剧墖浠モ,鈥欏垎鍓") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "enable", + table: "sku", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "鏄惁鏈夋晥锛0鏃犳晥锛1鏈夋晥"); + + migrationBuilder.AlterColumn( + name: "crate_time", + table: "sku", + type: "datetime(6)", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldComment: "鍒涘缓鏃堕棿"); + + migrationBuilder.AlterColumn( + name: "total_pay", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "鎬婚噾棰濓紝鍗曚綅涓哄垎"); + + migrationBuilder.AlterColumn( + name: "source_type", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "璁㈠崟鏉ユ簮锛1:app绔紝2锛歱c绔紝3锛歁绔紝4锛氬井淇$锛5锛氭墜鏈簈q绔"); + + migrationBuilder.AlterColumn( + name: "shipping_name", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鐗╂祦鍚嶇О") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "shipping_code", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鐗╂祦鍗曞彿") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_zip", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鏀惰揣浜洪偖缂") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_state", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鏀惰幏鍦板潃锛堢渷锛") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_mobile", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鏀惰揣浜烘墜鏈") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_district", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鏀惰幏鍦板潃锛堝尯/鍘匡級") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_city", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鏀惰幏鍦板潃锛堝競锛") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_address", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鏀惰幏鍦板潃锛堣閬撱佷綇鍧绛夎缁嗗湴鍧锛") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鏀惰揣浜") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "promotion_ids", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "promotion_ids") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "post_fee", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "閭垂銆傚崟浣:鍒嗐傚:20007锛岃〃绀:200鍏7鍒"); + + migrationBuilder.AlterColumn( + name: "payment_type", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "鏀粯绫诲瀷锛1銆佸湪绾挎敮浠橈紝2銆佽揣鍒颁粯娆"); + + migrationBuilder.AlterColumn( + name: "invoice_type", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "鍙戠エ绫诲瀷:0鏃犲彂绁1鏅氬彂绁紝2鐢靛瓙鍙戠エ锛3澧炲肩◣鍙戠エ"); + + migrationBuilder.AlterColumn( + name: "creat_time", + table: "order", + type: "datetime(6)", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldComment: "璁㈠崟鍒涘缓鏃堕棿"); + + migrationBuilder.AlterColumn( + name: "buyer_rate", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "涔板鏄惁宸茬粡璇勪环,0鏈瘎浠凤紝1宸茶瘎浠"); + + migrationBuilder.AlterColumn( + name: "buyer_nick", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "涔板鏄电О") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "buyer_message", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "涔板鐣欒█") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "actual_pay", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "瀹炰粯閲戦銆傚崟浣:鍒嗐傚:20007锛岃〃绀:200鍏7鍒"); + + migrationBuilder.AlterColumn( + name: "sort", + table: "category", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "鎺掑簭"); + + migrationBuilder.AlterColumn( + name: "name", + table: "category", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "绫诲埆鍚嶇О") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "is_parent", + table: "category", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "鏄惁鐖剁被鍒"); + + migrationBuilder.AlterColumn( + name: "name", + table: "brand", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鍝佺墝鍚嶇О") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "letter", + table: "brand", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鍝佺墝棣栧瓧姣") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "image", + table: "brand", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "鍝佺墝鍥剧墖") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "brand_category", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + brandId = table.Column(type: "int", nullable: false), + categoryId = table.Column(type: "int", nullable: false), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_brand_category", x => x.id); + table.ForeignKey( + name: "FK_brand_category_brand_brandId", + column: x => x.brandId, + principalTable: "brand", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_brand_category_category_categoryId", + column: x => x.categoryId, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_brand_category_brandId", + table: "brand_category", + column: "brandId"); + + migrationBuilder.CreateIndex( + name: "IX_brand_category_categoryId", + table: "brand_category", + column: "categoryId"); + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.Designer.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.Designer.cs new file mode 100644 index 00000000..9c033a51 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.Designer.cs @@ -0,0 +1,799 @@ +锘// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Yi.Framework.Model; + +namespace Yi.Framework.Model.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("20211106110713_ec4")] + partial class ec4 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 64) + .HasAnnotation("ProductVersion", "5.0.11"); + + modelBuilder.Entity("Yi.Framework.Model.Models.brand", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("image") + .HasColumnType("longtext") + .HasComment("鍝佺墝鍥剧墖"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("letter") + .HasColumnType("longtext") + .HasComment("鍝佺墝棣栧瓧姣"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("鍝佺墝鍚嶇О"); + + b.HasKey("id"); + + b.ToTable("brand"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_parent") + .HasColumnType("int") + .HasComment("鏄惁鐖剁被鍒"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("绫诲埆鍚嶇О"); + + b.Property("sort") + .HasColumnType("int") + .HasComment("鎺掑簭"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_show") + .HasColumnType("int"); + + b.Property("is_top") + .HasColumnType("int"); + + b.Property("menu_name") + .HasColumnType("longtext"); + + b.Property("menuid") + .HasColumnType("int"); + + b.Property("mouldid") + .HasColumnType("int"); + + b.Property("router") + .HasColumnType("longtext"); + + b.Property("sort") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("menuid"); + + b.HasIndex("mouldid"); + + b.ToTable("menu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.mould", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("mould_name") + .HasColumnType("longtext"); + + b.Property("url") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("mould"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.order", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("actual_pay") + .HasColumnType("int") + .HasComment("瀹炰粯閲戦銆傚崟浣:鍒嗐傚:20007锛岃〃绀:200鍏7鍒"); + + b.Property("buyer_message") + .HasColumnType("longtext") + .HasComment("涔板鐣欒█"); + + b.Property("buyer_nick") + .HasColumnType("longtext") + .HasComment("涔板鏄电О"); + + b.Property("buyer_rate") + .HasColumnType("int") + .HasComment("涔板鏄惁宸茬粡璇勪环,0鏈瘎浠凤紝1宸茶瘎浠"); + + b.Property("creat_time") + .HasColumnType("datetime(6)") + .HasComment("璁㈠崟鍒涘缓鏃堕棿"); + + b.Property("invoice_type") + .HasColumnType("int") + .HasComment("鍙戠エ绫诲瀷:0鏃犲彂绁1鏅氬彂绁紝2鐢靛瓙鍙戠エ锛3澧炲肩◣鍙戠エ"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("payment_type") + .HasColumnType("int") + .HasComment("鏀粯绫诲瀷锛1銆佸湪绾挎敮浠橈紝2銆佽揣鍒颁粯娆"); + + b.Property("post_fee") + .HasColumnType("int") + .HasComment("閭垂銆傚崟浣:鍒嗐傚:20007锛岃〃绀:200鍏7鍒"); + + b.Property("promotion_ids") + .HasColumnType("longtext") + .HasComment("promotion_ids"); + + b.Property("receiver") + .HasColumnType("longtext") + .HasComment("鏀惰揣浜"); + + b.Property("receiver_address") + .HasColumnType("longtext") + .HasComment("鏀惰幏鍦板潃锛堣閬撱佷綇鍧绛夎缁嗗湴鍧锛"); + + b.Property("receiver_city") + .HasColumnType("longtext") + .HasComment("鏀惰幏鍦板潃锛堝競锛"); + + b.Property("receiver_district") + .HasColumnType("longtext") + .HasComment("鏀惰幏鍦板潃锛堝尯/鍘匡級"); + + b.Property("receiver_mobile") + .HasColumnType("longtext") + .HasComment("鏀惰揣浜烘墜鏈"); + + b.Property("receiver_state") + .HasColumnType("longtext") + .HasComment("鏀惰幏鍦板潃锛堢渷锛"); + + b.Property("receiver_zip") + .HasColumnType("longtext") + .HasComment("鏀惰揣浜洪偖缂"); + + b.Property("shipping_code") + .HasColumnType("longtext") + .HasComment("鐗╂祦鍗曞彿"); + + b.Property("shipping_name") + .HasColumnType("longtext") + .HasComment("鐗╂祦鍚嶇О"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("source_type") + .HasColumnType("int") + .HasComment("璁㈠崟鏉ユ簮锛1:app绔紝2锛歱c绔紝3锛歁绔紝4锛氬井淇$锛5锛氭墜鏈簈q绔"); + + b.Property("total_pay") + .HasColumnType("int") + .HasComment("鎬婚噾棰濓紝鍗曚綅涓哄垎"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("order"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("introduce") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("role_name") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("role"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)") + .HasComment("鍒涘缓鏃堕棿"); + + b.Property("enable") + .HasColumnType("int") + .HasComment("鏄惁鏈夋晥锛0鏃犳晥锛1鏈夋晥"); + + b.Property("images") + .HasColumnType("longtext") + .HasComment("鍟嗗搧鐨勫浘鐗囷紝澶氫釜鍥剧墖浠モ,鈥欏垎鍓"); + + b.Property("indexes") + .HasColumnType("longtext") + .HasComment("鐗规湁瑙勬牸灞炴у湪spu灞炴фā鏉夸腑鐨勫搴斾笅鏍囩粍鍚"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)") + .HasComment("鏈鍚庢洿鏂版椂闂"); + + b.Property("own_spec") + .HasColumnType("longtext") + .HasComment("sku鐨勭壒鏈夎鏍煎弬鏁伴敭鍊煎锛宩son鏍煎紡锛屽弽搴忓垪鍖栨椂璇蜂娇鐢╨inkedHashMap锛屼繚璇佹湁搴"); + + b.Property("price") + .HasColumnType("int") + .HasComment("閿鍞环鏍硷紝鍗曚綅涓哄垎"); + + b.Property("spuid") + .HasColumnType("int"); + + b.Property("title") + .HasColumnType("longtext") + .HasComment("鍟嗗搧鏍囬"); + + b.HasKey("id"); + + b.HasIndex("spuid"); + + b.ToTable("sku"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("瑙勬牸缁勫悕绉"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("spec_group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("generic") + .HasColumnType("int") + .HasComment("鏄惁鏄痵ku閫氱敤灞炴э紝true鎴杅alse"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("鍙傛暟鍚"); + + b.Property("numeric") + .HasColumnType("int") + .HasComment("鏄惁鏄暟瀛楃被鍨嬪弬鏁帮紝true鎴杅alse"); + + b.Property("searching") + .HasColumnType("int") + .HasComment("鏄惁鐢ㄤ簬鎼滅储杩囨护锛宼rue鎴杅alse"); + + b.Property("segments") + .HasColumnType("longtext") + .HasComment("鏁板肩被鍨嬪弬鏁帮紝濡傛灉闇瑕佹悳绱紝鍒欐坊鍔犲垎娈甸棿闅斿硷紝濡侰PU棰戠巼闂撮殧锛0.5-1.0"); + + b.Property("spec_Groupid") + .HasColumnType("int"); + + b.Property("unit") + .HasColumnType("longtext") + .HasComment("鏁板瓧绫诲瀷鍙傛暟鐨勫崟浣嶏紝闈炴暟瀛楃被鍨嬪彲浠ヤ负绌"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.HasIndex("spec_Groupid"); + + b.ToTable("spec_param"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("brandid") + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)") + .HasComment("鍒涘缓鏃堕棿"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)") + .HasComment("鏈鍚庢洿鏂版椂闂"); + + b.Property("saleable") + .HasColumnType("int") + .HasComment("鏄惁涓婃灦"); + + b.Property("spu_Detailid") + .HasColumnType("int"); + + b.Property("sub_title") + .HasColumnType("longtext") + .HasComment("瀛愭爣棰"); + + b.Property("title") + .HasColumnType("longtext") + .HasComment("鏍囬"); + + b.Property("valid") + .HasColumnType("int") + .HasComment("鏄惁鏈夋晥"); + + b.HasKey("id"); + + b.HasIndex("brandid"); + + b.HasIndex("spu_Detailid"); + + b.ToTable("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu_detail", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("after_service") + .HasColumnType("longtext") + .HasComment("鍞悗鏈嶅姟"); + + b.Property("description") + .HasColumnType("longtext") + .HasComment("鎻忚堪"); + + b.Property("generic_spec") + .HasColumnType("longtext") + .HasComment("閫氱敤瑙勬牸鍙傛暟鏁版嵁"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("packing_list") + .HasColumnType("longtext") + .HasComment("鍖呰娓呭崟"); + + b.Property("special_spec") + .HasColumnType("longtext") + .HasComment("鐗规湁瑙勬牸鍙傛暟鍙婂彲閫夊间俊鎭紝json鏍煎紡"); + + b.HasKey("id"); + + b.ToTable("spu_detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("seckill_stock") + .HasColumnType("int") + .HasComment("鍙鏉搴撳瓨"); + + b.Property("seckill_total") + .HasColumnType("int") + .HasComment("绉掓潃鎬绘暟閲"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("stock_count") + .HasColumnType("int") + .HasComment("搴撳瓨鏁伴噺"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("stock"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("address") + .HasColumnType("longtext"); + + b.Property("age") + .HasColumnType("int"); + + b.Property("email") + .HasColumnType("longtext"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("introduction") + .HasColumnType("longtext"); + + b.Property("ip") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("nick") + .HasColumnType("longtext"); + + b.Property("password") + .HasColumnType("longtext"); + + b.Property("phone") + .HasColumnType("longtext"); + + b.Property("username") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("user"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.visit", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("num") + .HasColumnType("int"); + + b.Property("time") + .HasColumnType("datetime(6)"); + + b.HasKey("id"); + + b.ToTable("visit"); + }); + + modelBuilder.Entity("brandcategory", b => + { + b.Property("brandsid") + .HasColumnType("int"); + + b.Property("categoriesid") + .HasColumnType("int"); + + b.HasKey("brandsid", "categoriesid"); + + b.HasIndex("categoriesid"); + + b.ToTable("brandcategory"); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.Property("categoriesid") + .HasColumnType("int"); + + b.Property("spusid") + .HasColumnType("int"); + + b.HasKey("categoriesid", "spusid"); + + b.HasIndex("spusid"); + + b.ToTable("categoryspu"); + }); + + modelBuilder.Entity("menurole", b => + { + b.Property("menusid") + .HasColumnType("int"); + + b.Property("rolesid") + .HasColumnType("int"); + + b.HasKey("menusid", "rolesid"); + + b.HasIndex("rolesid"); + + b.ToTable("menurole"); + }); + + modelBuilder.Entity("roleuser", b => + { + b.Property("rolesid") + .HasColumnType("int"); + + b.Property("usersid") + .HasColumnType("int"); + + b.HasKey("rolesid", "usersid"); + + b.HasIndex("usersid"); + + b.ToTable("roleuser"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany("chidrens") + .HasForeignKey("categoryid"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.HasOne("Yi.Framework.Model.Models.menu", null) + .WithMany("children") + .HasForeignKey("menuid"); + + b.HasOne("Yi.Framework.Model.Models.mould", "mould") + .WithMany() + .HasForeignKey("mouldid"); + + b.Navigation("mould"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.order", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", null) + .WithMany("orders") + .HasForeignKey("skuid"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.HasOne("Yi.Framework.Model.Models.spu", "spu") + .WithMany("skus") + .HasForeignKey("spuid"); + + b.Navigation("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Groups") + .HasForeignKey("categoryid"); + + b.Navigation("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Params") + .HasForeignKey("categoryid"); + + b.HasOne("Yi.Framework.Model.Models.spec_group", "spec_Group") + .WithMany("spec_Params") + .HasForeignKey("spec_Groupid"); + + b.Navigation("category"); + + b.Navigation("spec_Group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", "brand") + .WithMany("spus") + .HasForeignKey("brandid"); + + b.HasOne("Yi.Framework.Model.Models.spu_detail", "spu_Detail") + .WithMany() + .HasForeignKey("spu_Detailid"); + + b.Navigation("brand"); + + b.Navigation("spu_Detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", "sku") + .WithMany() + .HasForeignKey("skuid"); + + b.Navigation("sku"); + }); + + modelBuilder.Entity("brandcategory", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", null) + .WithMany() + .HasForeignKey("brandsid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany() + .HasForeignKey("categoriesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany() + .HasForeignKey("categoriesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.spu", null) + .WithMany() + .HasForeignKey("spusid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("menurole", b => + { + b.HasOne("Yi.Framework.Model.Models.menu", null) + .WithMany() + .HasForeignKey("menusid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.role", null) + .WithMany() + .HasForeignKey("rolesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("roleuser", b => + { + b.HasOne("Yi.Framework.Model.Models.role", null) + .WithMany() + .HasForeignKey("rolesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.user", null) + .WithMany() + .HasForeignKey("usersid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.brand", b => + { + b.Navigation("spus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Navigation("chidrens"); + + b.Navigation("spec_Groups"); + + b.Navigation("spec_Params"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.Navigation("children"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.Navigation("orders"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Navigation("spec_Params"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Navigation("skus"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.cs new file mode 100644 index 00000000..dc279917 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.cs @@ -0,0 +1,161 @@ +锘縰sing Microsoft.EntityFrameworkCore.Migrations; + +namespace Yi.Framework.Model.Migrations +{ + public partial class ec4 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_menu_role_roleid", + table: "menu"); + + migrationBuilder.DropForeignKey( + name: "FK_role_user_userid", + table: "role"); + + migrationBuilder.DropIndex( + name: "IX_role_userid", + table: "role"); + + migrationBuilder.DropIndex( + name: "IX_menu_roleid", + table: "menu"); + + migrationBuilder.DropColumn( + name: "userid", + table: "role"); + + migrationBuilder.DropColumn( + name: "roleid", + table: "menu"); + + migrationBuilder.AlterColumn( + name: "phone", + table: "user", + type: "longtext", + nullable: true, + oldClrType: typeof(int), + oldType: "int", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "menurole", + columns: table => new + { + menusid = table.Column(type: "int", nullable: false), + rolesid = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_menurole", x => new { x.menusid, x.rolesid }); + table.ForeignKey( + name: "FK_menurole_menu_menusid", + column: x => x.menusid, + principalTable: "menu", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_menurole_role_rolesid", + column: x => x.rolesid, + principalTable: "role", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "roleuser", + columns: table => new + { + rolesid = table.Column(type: "int", nullable: false), + usersid = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_roleuser", x => new { x.rolesid, x.usersid }); + table.ForeignKey( + name: "FK_roleuser_role_rolesid", + column: x => x.rolesid, + principalTable: "role", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_roleuser_user_usersid", + column: x => x.usersid, + principalTable: "user", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_menurole_rolesid", + table: "menurole", + column: "rolesid"); + + migrationBuilder.CreateIndex( + name: "IX_roleuser_usersid", + table: "roleuser", + column: "usersid"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "menurole"); + + migrationBuilder.DropTable( + name: "roleuser"); + + migrationBuilder.AlterColumn( + name: "phone", + table: "user", + type: "int", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "userid", + table: "role", + type: "int", + nullable: true); + + migrationBuilder.AddColumn( + name: "roleid", + table: "menu", + type: "int", + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_role_userid", + table: "role", + column: "userid"); + + migrationBuilder.CreateIndex( + name: "IX_menu_roleid", + table: "menu", + column: "roleid"); + + migrationBuilder.AddForeignKey( + name: "FK_menu_role_roleid", + table: "menu", + column: "roleid", + principalTable: "role", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_role_user_userid", + table: "role", + column: "userid", + principalTable: "user", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/DataContextModelSnapshot.cs b/Yi.Framework/Yi.Framework.Model/Migrations/DataContextModelSnapshot.cs index ff1fcee1..7fcf5023 100644 --- a/Yi.Framework/Yi.Framework.Model/Migrations/DataContextModelSnapshot.cs +++ b/Yi.Framework/Yi.Framework.Model/Migrations/DataContextModelSnapshot.cs @@ -17,6 +17,63 @@ namespace Yi.Framework.Model.Migrations .HasAnnotation("Relational:MaxIdentifierLength", 64) .HasAnnotation("ProductVersion", "5.0.11"); + modelBuilder.Entity("Yi.Framework.Model.Models.brand", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("image") + .HasColumnType("longtext") + .HasComment("鍝佺墝鍥剧墖"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("letter") + .HasColumnType("longtext") + .HasComment("鍝佺墝棣栧瓧姣"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("鍝佺墝鍚嶇О"); + + b.HasKey("id"); + + b.ToTable("brand"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_parent") + .HasColumnType("int") + .HasComment("鏄惁鐖剁被鍒"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("绫诲埆鍚嶇О"); + + b.Property("sort") + .HasColumnType("int") + .HasComment("鎺掑簭"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("category"); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => { b.Property("id") @@ -79,6 +136,105 @@ namespace Yi.Framework.Model.Migrations b.ToTable("mould"); }); + modelBuilder.Entity("Yi.Framework.Model.Models.order", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("actual_pay") + .HasColumnType("int") + .HasComment("瀹炰粯閲戦銆傚崟浣:鍒嗐傚:20007锛岃〃绀:200鍏7鍒"); + + b.Property("buyer_message") + .HasColumnType("longtext") + .HasComment("涔板鐣欒█"); + + b.Property("buyer_nick") + .HasColumnType("longtext") + .HasComment("涔板鏄电О"); + + b.Property("buyer_rate") + .HasColumnType("int") + .HasComment("涔板鏄惁宸茬粡璇勪环,0鏈瘎浠凤紝1宸茶瘎浠"); + + b.Property("creat_time") + .HasColumnType("datetime(6)") + .HasComment("璁㈠崟鍒涘缓鏃堕棿"); + + b.Property("invoice_type") + .HasColumnType("int") + .HasComment("鍙戠エ绫诲瀷:0鏃犲彂绁1鏅氬彂绁紝2鐢靛瓙鍙戠エ锛3澧炲肩◣鍙戠エ"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("payment_type") + .HasColumnType("int") + .HasComment("鏀粯绫诲瀷锛1銆佸湪绾挎敮浠橈紝2銆佽揣鍒颁粯娆"); + + b.Property("post_fee") + .HasColumnType("int") + .HasComment("閭垂銆傚崟浣:鍒嗐傚:20007锛岃〃绀:200鍏7鍒"); + + b.Property("promotion_ids") + .HasColumnType("longtext") + .HasComment("promotion_ids"); + + b.Property("receiver") + .HasColumnType("longtext") + .HasComment("鏀惰揣浜"); + + b.Property("receiver_address") + .HasColumnType("longtext") + .HasComment("鏀惰幏鍦板潃锛堣閬撱佷綇鍧绛夎缁嗗湴鍧锛"); + + b.Property("receiver_city") + .HasColumnType("longtext") + .HasComment("鏀惰幏鍦板潃锛堝競锛"); + + b.Property("receiver_district") + .HasColumnType("longtext") + .HasComment("鏀惰幏鍦板潃锛堝尯/鍘匡級"); + + b.Property("receiver_mobile") + .HasColumnType("longtext") + .HasComment("鏀惰揣浜烘墜鏈"); + + b.Property("receiver_state") + .HasColumnType("longtext") + .HasComment("鏀惰幏鍦板潃锛堢渷锛"); + + b.Property("receiver_zip") + .HasColumnType("longtext") + .HasComment("鏀惰揣浜洪偖缂"); + + b.Property("shipping_code") + .HasColumnType("longtext") + .HasComment("鐗╂祦鍗曞彿"); + + b.Property("shipping_name") + .HasColumnType("longtext") + .HasComment("鐗╂祦鍚嶇О"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("source_type") + .HasColumnType("int") + .HasComment("璁㈠崟鏉ユ簮锛1:app绔紝2锛歱c绔紝3锛歁绔紝4锛氬井淇$锛5锛氭墜鏈簈q绔"); + + b.Property("total_pay") + .HasColumnType("int") + .HasComment("鎬婚噾棰濓紝鍗曚綅涓哄垎"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("order"); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => { b.Property("id") @@ -99,6 +255,241 @@ namespace Yi.Framework.Model.Migrations b.ToTable("role"); }); + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)") + .HasComment("鍒涘缓鏃堕棿"); + + b.Property("enable") + .HasColumnType("int") + .HasComment("鏄惁鏈夋晥锛0鏃犳晥锛1鏈夋晥"); + + b.Property("images") + .HasColumnType("longtext") + .HasComment("鍟嗗搧鐨勫浘鐗囷紝澶氫釜鍥剧墖浠モ,鈥欏垎鍓"); + + b.Property("indexes") + .HasColumnType("longtext") + .HasComment("鐗规湁瑙勬牸灞炴у湪spu灞炴фā鏉夸腑鐨勫搴斾笅鏍囩粍鍚"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)") + .HasComment("鏈鍚庢洿鏂版椂闂"); + + b.Property("own_spec") + .HasColumnType("longtext") + .HasComment("sku鐨勭壒鏈夎鏍煎弬鏁伴敭鍊煎锛宩son鏍煎紡锛屽弽搴忓垪鍖栨椂璇蜂娇鐢╨inkedHashMap锛屼繚璇佹湁搴"); + + b.Property("price") + .HasColumnType("int") + .HasComment("閿鍞环鏍硷紝鍗曚綅涓哄垎"); + + b.Property("spuid") + .HasColumnType("int"); + + b.Property("title") + .HasColumnType("longtext") + .HasComment("鍟嗗搧鏍囬"); + + b.HasKey("id"); + + b.HasIndex("spuid"); + + b.ToTable("sku"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("瑙勬牸缁勫悕绉"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("spec_group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("generic") + .HasColumnType("int") + .HasComment("鏄惁鏄痵ku閫氱敤灞炴э紝true鎴杅alse"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("鍙傛暟鍚"); + + b.Property("numeric") + .HasColumnType("int") + .HasComment("鏄惁鏄暟瀛楃被鍨嬪弬鏁帮紝true鎴杅alse"); + + b.Property("searching") + .HasColumnType("int") + .HasComment("鏄惁鐢ㄤ簬鎼滅储杩囨护锛宼rue鎴杅alse"); + + b.Property("segments") + .HasColumnType("longtext") + .HasComment("鏁板肩被鍨嬪弬鏁帮紝濡傛灉闇瑕佹悳绱紝鍒欐坊鍔犲垎娈甸棿闅斿硷紝濡侰PU棰戠巼闂撮殧锛0.5-1.0"); + + b.Property("spec_Groupid") + .HasColumnType("int"); + + b.Property("unit") + .HasColumnType("longtext") + .HasComment("鏁板瓧绫诲瀷鍙傛暟鐨勫崟浣嶏紝闈炴暟瀛楃被鍨嬪彲浠ヤ负绌"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.HasIndex("spec_Groupid"); + + b.ToTable("spec_param"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("brandid") + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)") + .HasComment("鍒涘缓鏃堕棿"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)") + .HasComment("鏈鍚庢洿鏂版椂闂"); + + b.Property("saleable") + .HasColumnType("int") + .HasComment("鏄惁涓婃灦"); + + b.Property("spu_Detailid") + .HasColumnType("int"); + + b.Property("sub_title") + .HasColumnType("longtext") + .HasComment("瀛愭爣棰"); + + b.Property("title") + .HasColumnType("longtext") + .HasComment("鏍囬"); + + b.Property("valid") + .HasColumnType("int") + .HasComment("鏄惁鏈夋晥"); + + b.HasKey("id"); + + b.HasIndex("brandid"); + + b.HasIndex("spu_Detailid"); + + b.ToTable("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu_detail", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("after_service") + .HasColumnType("longtext") + .HasComment("鍞悗鏈嶅姟"); + + b.Property("description") + .HasColumnType("longtext") + .HasComment("鎻忚堪"); + + b.Property("generic_spec") + .HasColumnType("longtext") + .HasComment("閫氱敤瑙勬牸鍙傛暟鏁版嵁"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("packing_list") + .HasColumnType("longtext") + .HasComment("鍖呰娓呭崟"); + + b.Property("special_spec") + .HasColumnType("longtext") + .HasComment("鐗规湁瑙勬牸鍙傛暟鍙婂彲閫夊间俊鎭紝json鏍煎紡"); + + b.HasKey("id"); + + b.ToTable("spu_detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("seckill_stock") + .HasColumnType("int") + .HasComment("鍙鏉搴撳瓨"); + + b.Property("seckill_total") + .HasColumnType("int") + .HasComment("绉掓潃鎬绘暟閲"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("stock_count") + .HasColumnType("int") + .HasComment("搴撳瓨鏁伴噺"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("stock"); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => { b.Property("id") @@ -163,6 +554,36 @@ namespace Yi.Framework.Model.Migrations b.ToTable("visit"); }); + modelBuilder.Entity("brandcategory", b => + { + b.Property("brandsid") + .HasColumnType("int"); + + b.Property("categoriesid") + .HasColumnType("int"); + + b.HasKey("brandsid", "categoriesid"); + + b.HasIndex("categoriesid"); + + b.ToTable("brandcategory"); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.Property("categoriesid") + .HasColumnType("int"); + + b.Property("spusid") + .HasColumnType("int"); + + b.HasKey("categoriesid", "spusid"); + + b.HasIndex("spusid"); + + b.ToTable("categoryspu"); + }); + modelBuilder.Entity("menurole", b => { b.Property("menusid") @@ -193,6 +614,13 @@ namespace Yi.Framework.Model.Migrations b.ToTable("roleuser"); }); + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany("chidrens") + .HasForeignKey("categoryid"); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => { b.HasOne("Yi.Framework.Model.Models.menu", null) @@ -206,6 +634,100 @@ namespace Yi.Framework.Model.Migrations b.Navigation("mould"); }); + modelBuilder.Entity("Yi.Framework.Model.Models.order", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", null) + .WithMany("orders") + .HasForeignKey("skuid"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.HasOne("Yi.Framework.Model.Models.spu", "spu") + .WithMany("skus") + .HasForeignKey("spuid"); + + b.Navigation("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Groups") + .HasForeignKey("categoryid"); + + b.Navigation("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Params") + .HasForeignKey("categoryid"); + + b.HasOne("Yi.Framework.Model.Models.spec_group", "spec_Group") + .WithMany("spec_Params") + .HasForeignKey("spec_Groupid"); + + b.Navigation("category"); + + b.Navigation("spec_Group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", "brand") + .WithMany("spus") + .HasForeignKey("brandid"); + + b.HasOne("Yi.Framework.Model.Models.spu_detail", "spu_Detail") + .WithMany() + .HasForeignKey("spu_Detailid"); + + b.Navigation("brand"); + + b.Navigation("spu_Detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", "sku") + .WithMany() + .HasForeignKey("skuid"); + + b.Navigation("sku"); + }); + + modelBuilder.Entity("brandcategory", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", null) + .WithMany() + .HasForeignKey("brandsid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany() + .HasForeignKey("categoriesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany() + .HasForeignKey("categoriesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.spu", null) + .WithMany() + .HasForeignKey("spusid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("menurole", b => { b.HasOne("Yi.Framework.Model.Models.menu", null) @@ -236,10 +758,39 @@ namespace Yi.Framework.Model.Migrations .IsRequired(); }); + modelBuilder.Entity("Yi.Framework.Model.Models.brand", b => + { + b.Navigation("spus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Navigation("chidrens"); + + b.Navigation("spec_Groups"); + + b.Navigation("spec_Params"); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => { b.Navigation("children"); }); + + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.Navigation("orders"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Navigation("spec_Params"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Navigation("skus"); + }); #pragma warning restore 612, 618 } } diff --git a/Yi.Framework/Yi.Framework.Model/Models/brand.cs b/Yi.Framework/Yi.Framework.Model/Models/brand.cs new file mode 100644 index 00000000..8b0165a5 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/brand.cs @@ -0,0 +1,25 @@ +锘縰sing Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class brand:baseModel + { + [Comment("鍝佺墝鍚嶇О")] + public string name { get; set; } + [Comment("鍝佺墝鍥剧墖")] + public string image { get; set; } + [Comment("鍝佺墝棣栧瓧姣")] + public string letter { get; set; } + [Comment("绫诲埆")] + public List categories { get; set; } + [Comment("spu")] + public List spus { get; set; } + + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/category.cs b/Yi.Framework/Yi.Framework.Model/Models/category.cs new file mode 100644 index 00000000..de7f973f --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/category.cs @@ -0,0 +1,30 @@ +锘縰sing Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class category:baseModel + { + [Comment("绫诲埆鍚嶇О")] + public string name { get; set; } + [Comment("鎺掑簭")] + public int sort { get; set; } + [Comment("鏄惁鐖剁被鍒")] + public int is_parent { get; set; } + [Comment("瀛愮被鍒")] + public List chidrens { get; set; } + [Comment("鍝佺墝")] + public List brands { get; set; } + [Comment("spu")] + public List spus { get; set; } + [Comment("瑙勬牸缁")] + public List spec_Groups { get; set; } + [Comment("瑙勬牸")] + public List spec_Params { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/order.cs b/Yi.Framework/Yi.Framework.Model/Models/order.cs new file mode 100644 index 00000000..1c5d6c3f --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/order.cs @@ -0,0 +1,53 @@ +锘縰sing Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class order : baseModel + { + [Comment("鎬婚噾棰濓紝鍗曚綅涓哄垎")] + public int total_pay { get; set; } + [Comment("瀹炰粯閲戦銆傚崟浣:鍒嗐傚:20007锛岃〃绀:200鍏7鍒")] + public int actual_pay { get; set; } + [Comment("鏀粯绫诲瀷锛1銆佸湪绾挎敮浠橈紝2銆佽揣鍒颁粯娆")] + public int payment_type { get; set; } + [Comment("閭垂銆傚崟浣:鍒嗐傚:20007锛岃〃绀:200鍏7鍒")] + public int post_fee { get; set; } + [Comment("promotion_ids")] + public string promotion_ids { get; set; } + [Comment("璁㈠崟鍒涘缓鏃堕棿")] + public DateTime creat_time { get; set; } + [Comment("鐗╂祦鍚嶇О")] + public string shipping_name { get; set; } + [Comment("鐗╂祦鍗曞彿")] + public string shipping_code { get; set; } + [Comment("涔板鐣欒█")] + public string buyer_message { get; set; } + [Comment("涔板鏄电О")] + public string buyer_nick { get; set; } + [Comment("涔板鏄惁宸茬粡璇勪环,0鏈瘎浠凤紝1宸茶瘎浠")] + public int buyer_rate { get; set; } + [Comment("鏀惰幏鍦板潃锛堢渷锛")] + public string receiver_state { get; set; } + [Comment("鏀惰幏鍦板潃锛堝競锛")] + public string receiver_city { get; set; } + [Comment("鏀惰幏鍦板潃锛堝尯/鍘匡級")] + public string receiver_district { get; set; } + [Comment("鏀惰幏鍦板潃锛堣閬撱佷綇鍧绛夎缁嗗湴鍧锛")] + public string receiver_address { get; set; } + [Comment("鏀惰揣浜烘墜鏈")] + public string receiver_mobile { get; set; } + [Comment("鏀惰揣浜洪偖缂")] + public string receiver_zip { get; set; } + [Comment("鏀惰揣浜")] + public string receiver { get; set; } + [Comment("鍙戠エ绫诲瀷:0鏃犲彂绁1鏅氬彂绁紝2鐢靛瓙鍙戠エ锛3澧炲肩◣鍙戠エ")] + public int invoice_type { get; set; } + [Comment("璁㈠崟鏉ユ簮锛1:app绔紝2锛歱c绔紝3锛歁绔紝4锛氬井淇$锛5锛氭墜鏈簈q绔")] + public int source_type { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/sku.cs b/Yi.Framework/Yi.Framework.Model/Models/sku.cs new file mode 100644 index 00000000..30e98722 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/sku.cs @@ -0,0 +1,33 @@ +锘縰sing Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class sku : baseModel + { + [Comment("鍟嗗搧鏍囬")] + public string title { get; set; } + [Comment("鍟嗗搧鐨勫浘鐗囷紝澶氫釜鍥剧墖浠モ,鈥欏垎鍓")] + public string images { get; set; } + [Comment("閿鍞环鏍硷紝鍗曚綅涓哄垎")] + public int price { get; set; } + [Comment("鐗规湁瑙勬牸灞炴у湪spu灞炴фā鏉夸腑鐨勫搴斾笅鏍囩粍鍚")] + public string indexes { get; set; } + [Comment("鏄惁鏈夋晥锛0鏃犳晥锛1鏈夋晥")] + public int enable { get; set; } + [Comment("sku鐨勭壒鏈夎鏍煎弬鏁伴敭鍊煎锛宩son鏍煎紡锛屽弽搴忓垪鍖栨椂璇蜂娇鐢╨inkedHashMap锛屼繚璇佹湁搴")] + public string own_spec { get; set; } + [Comment("鍒涘缓鏃堕棿")] + public DateTime crate_time { get; set; } + [Comment("鏈鍚庢洿鏂版椂闂")] + public DateTime last_update_time { get; set; } + [Comment("spu")] + public spu spu { get; set; } + [Comment("璁㈠崟")] + public List orders { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/spec_group.cs b/Yi.Framework/Yi.Framework.Model/Models/spec_group.cs new file mode 100644 index 00000000..fecdc5d0 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/spec_group.cs @@ -0,0 +1,19 @@ +锘縰sing Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class spec_group : baseModel + { + [Comment("瑙勬牸缁勫悕绉")] + public string name { get; set; } + [Comment("绫诲埆")] + public category category { get; set; } + [Comment("瑙勬牸")] + public List spec_Params { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/spec_param.cs b/Yi.Framework/Yi.Framework.Model/Models/spec_param.cs new file mode 100644 index 00000000..8671f7f7 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/spec_param.cs @@ -0,0 +1,29 @@ +锘縰sing Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class spec_param:baseModel + { + [Comment("鍙傛暟鍚")] + public string name { get; set; } + [Comment("鏄惁鏄暟瀛楃被鍨嬪弬鏁帮紝true鎴杅alse")] + public int numeric { get; set; } + [Comment("鏁板瓧绫诲瀷鍙傛暟鐨勫崟浣嶏紝闈炴暟瀛楃被鍨嬪彲浠ヤ负绌")] + public string unit { get; set; } + [Comment("鏄惁鏄痵ku閫氱敤灞炴э紝true鎴杅alse")] + public int generic { get; set; } + [Comment("鏄惁鐢ㄤ簬鎼滅储杩囨护锛宼rue鎴杅alse")] + public int searching { get; set; } + [Comment("鏁板肩被鍨嬪弬鏁帮紝濡傛灉闇瑕佹悳绱紝鍒欐坊鍔犲垎娈甸棿闅斿硷紝濡侰PU棰戠巼闂撮殧锛0.5-1.0")] + public string segments { get; set; } + [Comment("瑙勬牸缁")] + public spec_group spec_Group { get; set; } + [Comment("绫诲埆")] + public category category { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/spu.cs b/Yi.Framework/Yi.Framework.Model/Models/spu.cs new file mode 100644 index 00000000..3fb9db83 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/spu.cs @@ -0,0 +1,35 @@ +锘縰sing Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class spu : baseModel + { + [Comment("鏍囬")] + public string title { get; set; } + [Comment("瀛愭爣棰")] + public string sub_title { get; set; } + [Comment("鏄惁涓婃灦")] + public int saleable { get; set; } + [Comment("鏄惁鏈夋晥")] + public int valid { get; set; } + [Comment("鍒涘缓鏃堕棿")] + public DateTime crate_time { get; set; } + [Comment("鏈鍚庢洿鏂版椂闂")] + public DateTime last_update_time { get; set; } + [Comment("绫诲埆")] + public List categories { get; set; } + [Comment("鍝佺墝")] + public brand brand { get; set; } + [Comment("spu璇︽儏")] + public spu_detail spu_Detail { get; set; } + [Comment("skus")] + public List skus { get; set; } + + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/spu_detail.cs b/Yi.Framework/Yi.Framework.Model/Models/spu_detail.cs new file mode 100644 index 00000000..451735b7 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/spu_detail.cs @@ -0,0 +1,23 @@ +锘縰sing Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class spu_detail : baseModel + { + [Comment("鎻忚堪")] + public string description { get; set; } + [Comment("閫氱敤瑙勬牸鍙傛暟鏁版嵁")] + public string generic_spec { get; set; } + [Comment("鐗规湁瑙勬牸鍙傛暟鍙婂彲閫夊间俊鎭紝json鏍煎紡")] + public string special_spec { get; set; } + [Comment("鍖呰娓呭崟")] + public string packing_list { get; set; } + [Comment("鍞悗鏈嶅姟")] + public string after_service { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/stock.cs b/Yi.Framework/Yi.Framework.Model/Models/stock.cs new file mode 100644 index 00000000..6078e543 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/stock.cs @@ -0,0 +1,21 @@ +锘縰sing Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class stock:baseModel + { + [Comment("鍙鏉搴撳瓨")] + public int seckill_stock { get; set; } + [Comment("绉掓潃鎬绘暟閲")] + public int seckill_total { get; set; } + [Comment("搴撳瓨鏁伴噺")] + public int stock_count { get; set; } + [Comment("sku")] + public sku sku { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Search/Goods.cs b/Yi.Framework/Yi.Framework.Model/Search/Goods.cs new file mode 100644 index 00000000..35a905c7 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Search/Goods.cs @@ -0,0 +1,31 @@ +锘縰sing Nest; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Model.Models; + +namespace Yi.Framework.Model.Search +{ + [ElasticsearchType(IdProperty = "id")]//涓婚敭澹版槑锛屼笖涓婚敭蹇呴』鏄睘鎬 + public class Goods + { + public long id { get; set; } + + + public spu spu { get; set; } + public string all; //鎵鏈夐渶瑕佽鎼滅储鐨勪俊鎭紝鍖呮嫭鍝佺墝锛屽垎绫伙紝鏍囬 + public string subtitle; //瀛愭爣棰 + public brand brand; + public category cid1; + public category cid2; + public category cid3; + public DateTime? createTime; + + + public HashSet price = new HashSet(); //鏄墍鏈塻ku鐨勪环鏍奸泦鍚堛傛柟渚挎牴鎹环鏍艰繘琛岀瓫閫夎繃婊 + public List skus; //sku淇℃伅鐨刯son缁撴瀯鏁版嵁 + public Dictionary specs = new Dictionary(); //鍙悳绱㈢殑瑙勬牸鍙傛暟锛宬ey鏄弬鏁板悕锛屽兼槸鍙傛暟鍊 + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Search/SearchResult.cs b/Yi.Framework/Yi.Framework.Model/Search/SearchResult.cs new file mode 100644 index 00000000..18043165 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Search/SearchResult.cs @@ -0,0 +1,31 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Model.Models; + +namespace Yi.Framework.Model.Search +{ + public class SearchResult : PageResult + { + public List brands = new List(); + public List categories = new List(); + //瑙勬牸鍙傛暟杩囨护鏉′欢 + public List> specs = new List>(); + public SearchResult(long total, + int totalPage, + List items, + List categories, + List brands, + List> specs) : base + (total, items) + { + + this.categories = categories; + this.brands = brands; + this.specs = specs; + } + + } +} diff --git a/Yi.Framework/Yi.Framework.Model/T4DataContext.cs b/Yi.Framework/Yi.Framework.Model/T4DataContext.cs index 071e4b24..2306e630 100644 --- a/Yi.Framework/Yi.Framework.Model/T4DataContext.cs +++ b/Yi.Framework/Yi.Framework.Model/T4DataContext.cs @@ -8,9 +8,18 @@ namespace Yi.Framework.Model { public partial class DataContext :DbContext { + public DbSet brand { get; set; } + public DbSet category { get; set; } public DbSet menu { get; set; } public DbSet mould { get; set; } + public DbSet order { get; set; } public DbSet role { get; set; } + public DbSet sku { get; set; } + public DbSet spec_group { get; set; } + public DbSet spec_param { get; set; } + public DbSet spu { get; set; } + public DbSet spu_detail { get; set; } + public DbSet stock { get; set; } public DbSet user { get; set; } public DbSet visit { get; set; } } diff --git a/Yi.Framework/Yi.Framework.Model/Yi - Backup (1).Framework.Model.csproj b/Yi.Framework/Yi.Framework.Model/Yi - Backup (1).Framework.Model.csproj new file mode 100644 index 00000000..a18e350c --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Yi - Backup (1).Framework.Model.csproj @@ -0,0 +1,59 @@ + + + + net5.0 + + + + + True + True + T4DataContext.tt + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + TextTemplatingFileGenerator + T4DaraContext.cs + + + TextTemplatingFileGenerator + T4DataContext.cs + + + + + + + + + + True + True + T4DaraContext.tt + + + True + True + T4DataContext.tt + + + + diff --git a/Yi.Framework/Yi.Framework.Model/Yi.Framework.Model.csproj b/Yi.Framework/Yi.Framework.Model/Yi.Framework.Model.csproj index 20c72c23..a18e350c 100644 --- a/Yi.Framework/Yi.Framework.Model/Yi.Framework.Model.csproj +++ b/Yi.Framework/Yi.Framework.Model/Yi.Framework.Model.csproj @@ -19,6 +19,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Yi.Framework/Yi.Framework.PageDetail/Yi.Framework.PageDetail.csproj b/Yi.Framework/Yi.Framework.PageDetail/Yi.Framework.PageDetail.csproj index 8137388a..464f7f90 100644 --- a/Yi.Framework/Yi.Framework.PageDetail/Yi.Framework.PageDetail.csproj +++ b/Yi.Framework/Yi.Framework.PageDetail/Yi.Framework.PageDetail.csproj @@ -10,16 +10,6 @@ 1701;1702;CS1591 - - - - - - - - - - diff --git a/Yi.Framework/Yi.Framework.Service/GoodsService.cs b/Yi.Framework/Yi.Framework.Service/GoodsService.cs new file mode 100644 index 00000000..381972d6 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Service/GoodsService.cs @@ -0,0 +1,19 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Interface; +using Yi.Framework.Model.Models; +using Yi.Framework.Model.Search; + +namespace Yi.Framework.Service +{ + public class GoodsService : IGoodsService + { + public PageResult QuerySpuByPage(int page, int rows, string key, bool? saleable) + { + throw new NotImplementedException(); + } + } +} diff --git a/Yi.Framework/Yi.Framework.Service/MenuService.cs b/Yi.Framework/Yi.Framework.Service/MenuService.cs index 7c885c35..41f71ca9 100644 --- a/Yi.Framework/Yi.Framework.Service/MenuService.cs +++ b/Yi.Framework/Yi.Framework.Service/MenuService.cs @@ -41,6 +41,7 @@ namespace Yi.Framework.Service return TreeMenuBuild.Sort(TreeMenuBuild.Normal(menu_data)); } + public async Task> GetTopMenusByTopMenuIds(List menuIds) { return await _DbRead.Set().AsNoTracking().Where(u => menuIds.Contains(u.id)).OrderBy(u=>u.sort).ToListAsync(); diff --git a/Yi.Framework/Yi.Framework.Service/SearchService.cs b/Yi.Framework/Yi.Framework.Service/SearchService.cs new file mode 100644 index 00000000..bdb5a686 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Service/SearchService.cs @@ -0,0 +1,65 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Core; +using Yi.Framework.Interface; +using Yi.Framework.Model.Models; +using Yi.Framework.Model.Search; + +namespace Yi.Framework.Service +{ + public class SearchService : ISearchService + { + private IGoodsService _goodsService; + private ElasticSearchInvoker _elasticSearchInvoker ; + public SearchService(IGoodsService goodsService, ElasticSearchInvoker elasticSearchInvoker) + { + _goodsService = goodsService; + _elasticSearchInvoker = elasticSearchInvoker; + } + public void ImpDataBySpu() + { + ImportToEs(); + } + private void ImportToEs() + { + int page = 1; + int size; + int rows = 100; + do + { + List goodsList = new List(); + // 涓婃灦鍟嗗搧 + PageResult result = _goodsService.QuerySpuByPage(page, rows, null, true); + List spus = result.rows; + size = spus.Count; + foreach (var spu in spus) + { + try + { + Goods g = BuildGoods(spu); + // 澶勭悊濂界殑鏁版嵁娣诲姞鍒伴泦鍚堜腑 + goodsList.Add(g); + + } + catch (Exception e) + { + Console.WriteLine(e.Message); + continue;//閮ㄥ垎鏁版嵁涓嶄弗鏍 + } + } + // 瀛樺叆es,鍏堢暀鐫锛屼笉鍐 + _elasticSearchInvoker.Send(goodsList); + page++; + } while (size == 100); + } + + private Goods BuildGoods(spu spu) + { + Goods goods = new Goods(); + return goods; + } + } +} diff --git a/Yi.Framework/Yi.Framework.Service/T4Service.cs b/Yi.Framework/Yi.Framework.Service/T4Service.cs index 1b59d0eb..1059740c 100644 --- a/Yi.Framework/Yi.Framework.Service/T4Service.cs +++ b/Yi.Framework/Yi.Framework.Service/T4Service.cs @@ -11,6 +11,42 @@ using Yi.Framework.Model.ModelFactory; namespace Yi.Framework.Service { + public partial class BrandService:BaseService,IBrandService + { + public BrandService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var brandList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + brandList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(brandList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + + public partial class CategoryService:BaseService,ICategoryService + { + public CategoryService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var categoryList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + categoryList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(categoryList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + public partial class MenuService:BaseService,IMenuService { public MenuService(IDbContextFactory DbFactory):base(DbFactory){ } @@ -47,6 +83,24 @@ namespace Yi.Framework.Service } + public partial class OrderService:BaseService,IOrderService + { + public OrderService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var orderList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + orderList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(orderList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + public partial class RoleService:BaseService,IRoleService { public RoleService(IDbContextFactory DbFactory):base(DbFactory){ } @@ -65,6 +119,114 @@ namespace Yi.Framework.Service } + public partial class SkuService:BaseService,ISkuService + { + public SkuService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var skuList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + skuList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(skuList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + + public partial class Spec_groupService:BaseService,ISpec_groupService + { + public Spec_groupService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var spec_groupList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + spec_groupList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(spec_groupList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + + public partial class Spec_paramService:BaseService,ISpec_paramService + { + public Spec_paramService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var spec_paramList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + spec_paramList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(spec_paramList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + + public partial class SpuService:BaseService,ISpuService + { + public SpuService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var spuList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + spuList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(spuList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + + public partial class Spu_detailService:BaseService,ISpu_detailService + { + public Spu_detailService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var spu_detailList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + spu_detailList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(spu_detailList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + + public partial class StockService:BaseService,IStockService + { + public StockService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var stockList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + stockList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(stockList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + public partial class UserService:BaseService,IUserService { public UserService(IDbContextFactory DbFactory):base(DbFactory){ }