From 2d2dd55cc032cc437317d44507fed36ddaada7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Tue, 9 Nov 2021 19:51:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=BB=9Amain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + .../WarmupESIndexWorker.cs | 9 +- .../Yi.Framework.Interface/IGoodsService.cs | 15 -- .../Yi.Framework.Interface/ISearchService.cs | 13 -- .../Yi.Framework.Interface/T4Iservice.cs | 54 ------ .../Yi.Framework.Model/Models/brand.cs | 25 --- .../Yi.Framework.Model/Models/category.cs | 30 ---- .../Yi.Framework.Model/Models/order.cs | 53 ------ Yi.Framework/Yi.Framework.Model/Models/sku.cs | 33 ---- .../Yi.Framework.Model/Models/spec_group.cs | 19 -- .../Yi.Framework.Model/Models/spec_param.cs | 29 ---- Yi.Framework/Yi.Framework.Model/Models/spu.cs | 35 ---- .../Yi.Framework.Model/Models/spu_detail.cs | 23 --- .../Yi.Framework.Model/Models/stock.cs | 21 --- .../Yi.Framework.Model/Search/Goods.cs | 31 ---- .../Yi.Framework.Model/Search/SearchResult.cs | 31 ---- .../Yi.Framework.Model/T4DataContext.cs | 9 - .../Yi.Framework.Service/GoodsService.cs | 19 -- .../Yi.Framework.Service/SearchService.cs | 65 ------- .../Yi.Framework.Service/T4Service.cs | 162 ------------------ 20 files changed, 6 insertions(+), 672 deletions(-) delete mode 100644 Yi.Framework/Yi.Framework.Interface/IGoodsService.cs delete mode 100644 Yi.Framework/Yi.Framework.Interface/ISearchService.cs delete mode 100644 Yi.Framework/Yi.Framework.Model/Models/brand.cs delete mode 100644 Yi.Framework/Yi.Framework.Model/Models/category.cs delete mode 100644 Yi.Framework/Yi.Framework.Model/Models/order.cs delete mode 100644 Yi.Framework/Yi.Framework.Model/Models/sku.cs delete mode 100644 Yi.Framework/Yi.Framework.Model/Models/spec_group.cs delete mode 100644 Yi.Framework/Yi.Framework.Model/Models/spec_param.cs delete mode 100644 Yi.Framework/Yi.Framework.Model/Models/spu.cs delete mode 100644 Yi.Framework/Yi.Framework.Model/Models/spu_detail.cs delete mode 100644 Yi.Framework/Yi.Framework.Model/Models/stock.cs delete mode 100644 Yi.Framework/Yi.Framework.Model/Search/Goods.cs delete mode 100644 Yi.Framework/Yi.Framework.Model/Search/SearchResult.cs delete mode 100644 Yi.Framework/Yi.Framework.Service/GoodsService.cs delete mode 100644 Yi.Framework/Yi.Framework.Service/SearchService.cs diff --git a/.gitignore b/.gitignore index 0f25f6e5..e2eb2d0d 100644 --- a/.gitignore +++ b/.gitignore @@ -338,4 +338,6 @@ ASALocalRun/ # BeatPulse healthcheck temp database healthchecksdb + +appsettings.json *.json diff --git a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/WarmupESIndexWorker.cs b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/WarmupESIndexWorker.cs index 895134dd..8c57cb58 100644 --- a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/WarmupESIndexWorker.cs +++ b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/WarmupESIndexWorker.cs @@ -27,15 +27,14 @@ namespace Yi.Framework.ElasticSearchProcessor private readonly ElasticSearchInvoker _elasticSearchInvoker; private readonly IOptionsMonitor _ElasticSearchOptions = null; - private readonly ISearchService _searchService; - public WarmupESIndexWorker(ILogger logger, RabbitMQInvoker rabbitMQInvoker, IConfiguration configuration, ElasticSearchInvoker elasticSearchInvoker, IOptionsMonitor optionsMonitor, ISearchService searchService) + + public WarmupESIndexWorker(ILogger logger, RabbitMQInvoker rabbitMQInvoker, IConfiguration configuration, ElasticSearchInvoker elasticSearchInvoker, IOptionsMonitor optionsMonitor) { 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) @@ -48,14 +47,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._searchService.ImpDataBySpu(); + //this._searchService.ImpDataBySpu(); //【触发es数据导入服务】 this._logger.LogInformation($"{nameof(WarmupESIndexWorker)}.InitAll succeed"); return true; diff --git a/Yi.Framework/Yi.Framework.Interface/IGoodsService.cs b/Yi.Framework/Yi.Framework.Interface/IGoodsService.cs deleted file mode 100644 index b3bcbe76..00000000 --- a/Yi.Framework/Yi.Framework.Interface/IGoodsService.cs +++ /dev/null @@ -1,15 +0,0 @@ -锘縰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 deleted file mode 100644 index 4d503167..00000000 --- a/Yi.Framework/Yi.Framework.Interface/ISearchService.cs +++ /dev/null @@ -1,13 +0,0 @@ -锘縰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 12171726..bf91c56d 100644 --- a/Yi.Framework/Yi.Framework.Interface/T4Iservice.cs +++ b/Yi.Framework/Yi.Framework.Interface/T4Iservice.cs @@ -8,18 +8,6 @@ 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); @@ -32,54 +20,12 @@ 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/Models/brand.cs b/Yi.Framework/Yi.Framework.Model/Models/brand.cs deleted file mode 100644 index 8b0165a5..00000000 --- a/Yi.Framework/Yi.Framework.Model/Models/brand.cs +++ /dev/null @@ -1,25 +0,0 @@ -锘縰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 deleted file mode 100644 index de7f973f..00000000 --- a/Yi.Framework/Yi.Framework.Model/Models/category.cs +++ /dev/null @@ -1,30 +0,0 @@ -锘縰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 deleted file mode 100644 index 1c5d6c3f..00000000 --- a/Yi.Framework/Yi.Framework.Model/Models/order.cs +++ /dev/null @@ -1,53 +0,0 @@ -锘縰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 deleted file mode 100644 index 30e98722..00000000 --- a/Yi.Framework/Yi.Framework.Model/Models/sku.cs +++ /dev/null @@ -1,33 +0,0 @@ -锘縰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 deleted file mode 100644 index fecdc5d0..00000000 --- a/Yi.Framework/Yi.Framework.Model/Models/spec_group.cs +++ /dev/null @@ -1,19 +0,0 @@ -锘縰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 deleted file mode 100644 index 8671f7f7..00000000 --- a/Yi.Framework/Yi.Framework.Model/Models/spec_param.cs +++ /dev/null @@ -1,29 +0,0 @@ -锘縰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 deleted file mode 100644 index 3fb9db83..00000000 --- a/Yi.Framework/Yi.Framework.Model/Models/spu.cs +++ /dev/null @@ -1,35 +0,0 @@ -锘縰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 deleted file mode 100644 index 451735b7..00000000 --- a/Yi.Framework/Yi.Framework.Model/Models/spu_detail.cs +++ /dev/null @@ -1,23 +0,0 @@ -锘縰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 deleted file mode 100644 index 6078e543..00000000 --- a/Yi.Framework/Yi.Framework.Model/Models/stock.cs +++ /dev/null @@ -1,21 +0,0 @@ -锘縰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 deleted file mode 100644 index 35a905c7..00000000 --- a/Yi.Framework/Yi.Framework.Model/Search/Goods.cs +++ /dev/null @@ -1,31 +0,0 @@ -锘縰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 deleted file mode 100644 index 18043165..00000000 --- a/Yi.Framework/Yi.Framework.Model/Search/SearchResult.cs +++ /dev/null @@ -1,31 +0,0 @@ -锘縰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 2306e630..071e4b24 100644 --- a/Yi.Framework/Yi.Framework.Model/T4DataContext.cs +++ b/Yi.Framework/Yi.Framework.Model/T4DataContext.cs @@ -8,18 +8,9 @@ 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.Service/GoodsService.cs b/Yi.Framework/Yi.Framework.Service/GoodsService.cs deleted file mode 100644 index 381972d6..00000000 --- a/Yi.Framework/Yi.Framework.Service/GoodsService.cs +++ /dev/null @@ -1,19 +0,0 @@ -锘縰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/SearchService.cs b/Yi.Framework/Yi.Framework.Service/SearchService.cs deleted file mode 100644 index bdb5a686..00000000 --- a/Yi.Framework/Yi.Framework.Service/SearchService.cs +++ /dev/null @@ -1,65 +0,0 @@ -锘縰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 1059740c..1b59d0eb 100644 --- a/Yi.Framework/Yi.Framework.Service/T4Service.cs +++ b/Yi.Framework/Yi.Framework.Service/T4Service.cs @@ -11,42 +11,6 @@ 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){ } @@ -83,24 +47,6 @@ 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){ } @@ -119,114 +65,6 @@ 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){ }