From fc719393a30ed41f0b89bd93bb5f24bab19ad94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Sat, 7 Oct 2023 09:13:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=9B=B4=E6=96=B0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Front/FrontSelectionController.cs | 8 ++++---- New_College.Api/New_College.Model.xml | 5 +++++ New_College.Model/Models/SubjectSelection.cs | 4 ++++ New_College.Model/Request/SelectionServiceRequest.cs | 4 ++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/New_College.Api/Controllers/Front/FrontSelectionController.cs b/New_College.Api/Controllers/Front/FrontSelectionController.cs index b69bf06..e9f0e45 100644 --- a/New_College.Api/Controllers/Front/FrontSelectionController.cs +++ b/New_College.Api/Controllers/Front/FrontSelectionController.cs @@ -44,11 +44,11 @@ namespace New_College.Api.Controllers.Front { try { - var universityitems = JsonConvert.DeserializeObject>(request.UniversityName); - var majorsitems = JsonConvert.DeserializeObject>(request.MajorName); Expression> exp = Expressionable.Create() //创建表达式 - .AndIF(!string.IsNullOrEmpty(request.UniversityName), w => universityitems.Contains(w.UniversityName)) - .AndIF(!string.IsNullOrEmpty(request.MajorName), w => majorsitems.Contains(w.MajorName)) + .AndIF(!string.IsNullOrEmpty(request.UniversityName), w => JsonConvert.DeserializeObject>(request.UniversityName).Contains(w.UniversityName)) + .AndIF(!string.IsNullOrEmpty(request.MajorName), w => JsonConvert.DeserializeObject>(request.MajorName).Contains(w.MajorName)) + .AndIF(!string.IsNullOrWhiteSpace(request.Location), w => w.Equals(request.Location)) + .AndIF(request.Years > 0, w => w.Year == request.Years) .ToExpression();//注意 这一句 不能少 var subjectlist = await _selectionServices.QueryPage(exp, request.PageIndex, request.PageSize); diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml index 446acd1..61328d4 100644 --- a/New_College.Api/New_College.Model.xml +++ b/New_College.Api/New_College.Model.xml @@ -1562,6 +1562,11 @@ + + + 招生年份 + + 省市区 diff --git a/New_College.Model/Models/SubjectSelection.cs b/New_College.Model/Models/SubjectSelection.cs index f24f9d6..0b43a86 100644 --- a/New_College.Model/Models/SubjectSelection.cs +++ b/New_College.Model/Models/SubjectSelection.cs @@ -31,6 +31,10 @@ namespace New_College.Model.Models public string AcademicYear { get; set; } + /// + /// 招生年份 + /// + public int Year { get; set; } public string Province { get; set; } } } \ No newline at end of file diff --git a/New_College.Model/Request/SelectionServiceRequest.cs b/New_College.Model/Request/SelectionServiceRequest.cs index 37d0376..9cd7489 100644 --- a/New_College.Model/Request/SelectionServiceRequest.cs +++ b/New_College.Model/Request/SelectionServiceRequest.cs @@ -11,5 +11,9 @@ namespace New_College.Model.Request public string MajorName { get; set; } + public string Location { get; set; } + + public int Years { get; set; } + } }