diff --git a/.editorconfig b/.editorconfig index 7711e94..c4b81ef 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,3 +2,86 @@ # IDE0005: Using 指令是不需要的。 dotnet_diagnostic.IDE0005.severity = warning +csharp_using_directive_placement = outside_namespace:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:silent +csharp_style_namespace_declarations = block_scoped:silent +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_prefer_primary_constructors = true:suggestion +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent +csharp_indent_labels = one_less_than_current + +[*.{cs,vb}] +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_object_initializer = true:suggestion +dotnet_style_prefer_collection_expression = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion +dotnet_style_operator_placement_when_wrapping = beginning_of_line +tab_width = 4 +indent_size = 4 +end_of_line = crlf diff --git a/New_College.AdminMvc/New_College.AdminMvc.csproj b/New_College.AdminMvc/New_College.AdminMvc.csproj index 92605c5..e948168 100644 --- a/New_College.AdminMvc/New_College.AdminMvc.csproj +++ b/New_College.AdminMvc/New_College.AdminMvc.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net6.0 diff --git a/New_College.Api/Controllers/Front/LibraryController.cs b/New_College.Api/Controllers/Front/LibraryController.cs index 6794914..6425f01 100644 --- a/New_College.Api/Controllers/Front/LibraryController.cs +++ b/New_College.Api/Controllers/Front/LibraryController.cs @@ -399,6 +399,25 @@ namespace New_College.Api.Controllers.Front }; } + + /// + /// PC版本院校排名 + /// + /// + /// + [HttpGet] + public async Task>> GetPcUniversityRank([FromQuery] UniversityRankQuery query) + { + var result = await iD_LongIdMapServices.GetPcUniversityRank(query); + return new MessageModel>() + { + success = result.Count > 0, + msg = result.Count > 0 ? "获取成功" : "获取失败", + response = result + }; + } + + /// /// 专业搜索 /// diff --git a/New_College.Api/Dockerfile b/New_College.Api/Dockerfile index 37e0a50..a11cb72 100644 --- a/New_College.Api/Dockerfile +++ b/New_College.Api/Dockerfile @@ -1,4 +1,4 @@ -FROM swr.cn-south-1.myhuaweicloud.com/mcr/aspnet:3.1-alpine +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo 'Asia/Shanghai' >/etc/timezone diff --git a/New_College.Api/Dockerfile.original b/New_College.Api/Dockerfile.original new file mode 100644 index 0000000..37e0a50 --- /dev/null +++ b/New_College.Api/Dockerfile.original @@ -0,0 +1,36 @@ +FROM swr.cn-south-1.myhuaweicloud.com/mcr/aspnet:3.1-alpine +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' >/etc/timezone + +#RUN apk add --no-cache ca-certificates python3 bash openssh git openssl-dev uwsgi uwsgi-python3 +#RUN apk add --no-cache --virtual .build-deps python3-dev gcc musl-dev libffi-dev make \ + #&& pip3 install --no-cache-dir --trusted-host mirrors.aliyun.com -i http://mirrors.aliyun.com/pypi/simple/ \ + #pymysql==0.8.1 \ + #Flask==1.0.2 \ + #Flask-RESTful==0.3.6 \ + #Flask-Script==2.0.6 \ + #Flask-SQLAlchemy==2.3.2 \ + #Flask-WTF==0.14.2 \ + #SQLAlchemy==1.2.7 \ + #simplejson==3.16.0 \ + #six==1.11.0 \ + #celery==4.2.1 \ + #xlrd==1.1.0 \ + #xlwt==1.3.0 \ + #msgpack==0.5.0 \ + #&& apk del .build-deps +# +#RUN git clone https://github.com/Supervisor/supervisor.git \ + #&& cd supervisor \ + #&& python3 setup.py install \ + #&& cd .. \ + #&& rm -rf supervisor \ + #&& cd /etc/ \ + #&& echo_supervisord_conf > supervisord.conf \ + #&& echo '[include]' >> supervisord.conf \ + #&& echo 'files = /code/supervisor/*.ini' >> supervisord.conf \ + #&& supervisord -c /etc/supervisord.conf +WORKDIR /app +COPY . . +EXPOSE 8083 +ENTRYPOINT ["dotnet", "New_College.Api.dll","-b","0.0.0.0"] \ No newline at end of file diff --git a/New_College.Api/New_College.Api.csproj b/New_College.Api/New_College.Api.csproj index 07755ee..ece8e5e 100644 --- a/New_College.Api/New_College.Api.csproj +++ b/New_College.Api/New_College.Api.csproj @@ -4,7 +4,7 @@ Exe - netcoreapp3.1 + net6.0 OutOfProcess Linux @@ -52,7 +52,9 @@ - + + + diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml index 50c9bd7..669963f 100644 --- a/New_College.Api/New_College.Model.xml +++ b/New_College.Api/New_College.Model.xml @@ -4410,6 +4410,16 @@ 院校类型 (0,校友会 1,武书连 2,软科 3,QS 4,U.S.News) + + + 院校名称 + + + + + 院校类别 + + vip卡类型id @@ -5740,6 +5750,46 @@ 排名 最新 + + + 院校名称 + + + + + 是否985 + + + + + 是否211 + + + + + 是否双一流 + + + + + 学校logo + + + + + 省市区名称 + + + + + 学科层次 + + + + + 排名 最新 + + 录取概率分析结果 diff --git a/New_College.Api/New_College.xml b/New_College.Api/New_College.xml index e3c3c51..3b3878c 100644 --- a/New_College.Api/New_College.xml +++ b/New_College.Api/New_College.xml @@ -418,6 +418,13 @@ + + + PC版本院校排名 + + + + 专业搜索 diff --git a/New_College.Api/appsettings.json b/New_College.Api/appsettings.json index 5a5fb8d..37c2ef4 100644 --- a/New_College.Api/appsettings.json +++ b/New_College.Api/appsettings.json @@ -26,7 +26,7 @@ "Name": "New_College" } }, - "urls": "http://*:8082", // IIS 部署,注释掉 + "urls": "http://*:8083", // IIS 部署,注释掉 "AllowedHosts": "*", "AppSettings": { "RedisCachingAOP": { diff --git a/New_College.Common/New_College.Common.csproj b/New_College.Common/New_College.Common.csproj index eee5eca..05bc63c 100644 --- a/New_College.Common/New_College.Common.csproj +++ b/New_College.Common/New_College.Common.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net6.0 @@ -15,12 +15,13 @@ - - - - + + + + + - + diff --git a/New_College.Extensions/New_College.Extensions.csproj b/New_College.Extensions/New_College.Extensions.csproj index aac1783..273682d 100644 --- a/New_College.Extensions/New_College.Extensions.csproj +++ b/New_College.Extensions/New_College.Extensions.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net6.0 @@ -12,9 +12,7 @@ - - - + diff --git a/New_College.FrameWork/New_College.FrameWork.csproj b/New_College.FrameWork/New_College.FrameWork.csproj index 1f44dc1..aff874c 100644 --- a/New_College.FrameWork/New_College.FrameWork.csproj +++ b/New_College.FrameWork/New_College.FrameWork.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net6.0 diff --git a/New_College.IServices/ID_LongIdMapServices.cs b/New_College.IServices/ID_LongIdMapServices.cs index a61e000..da78fd1 100644 --- a/New_College.IServices/ID_LongIdMapServices.cs +++ b/New_College.IServices/ID_LongIdMapServices.cs @@ -71,6 +71,9 @@ namespace New_College.IServices Task> GetUniversityRank(UniversityRankQuery query); + Task> GetPcUniversityRank(UniversityRankQuery query); + + /// /// 专业搜索 /// diff --git a/New_College.IServices/New_College.IServices.csproj b/New_College.IServices/New_College.IServices.csproj index fdf3dd7..8a0013f 100644 --- a/New_College.IServices/New_College.IServices.csproj +++ b/New_College.IServices/New_College.IServices.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net6.0 diff --git a/New_College.Model/New_College.Model.csproj b/New_College.Model/New_College.Model.csproj index f429710..3b2303a 100644 --- a/New_College.Model/New_College.Model.csproj +++ b/New_College.Model/New_College.Model.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net6.0 diff --git a/New_College.Model/ViewModels/Query/UniversityQuery.cs b/New_College.Model/ViewModels/Query/UniversityQuery.cs index 160115d..abd73dc 100644 --- a/New_College.Model/ViewModels/Query/UniversityQuery.cs +++ b/New_College.Model/ViewModels/Query/UniversityQuery.cs @@ -53,6 +53,17 @@ namespace New_College.Model.ViewModels /// 院校类型 (0,校友会 1,武书连 2,软科 3,QS 4,U.S.News) /// public int Type { get; set; } + + /// + /// 院校名称 + /// + public string Name { get; set; } + + /// + /// 院校类别 + /// + public int? SubjectType { get; set;} + } public class UniversityIdQuery : BasePageRequest diff --git a/New_College.Model/ViewModels/Result/UniversityResult.cs b/New_College.Model/ViewModels/Result/UniversityResult.cs index 2bf4523..577ef1d 100644 --- a/New_College.Model/ViewModels/Result/UniversityResult.cs +++ b/New_College.Model/ViewModels/Result/UniversityResult.cs @@ -214,6 +214,53 @@ namespace New_College.Model.ViewModels } + + public class UniversityPcRankList + { + /// + /// 院校名称 + /// + public string Name { get; set; } + + /// + /// 是否985 + /// + public bool? Nhef { get; set; } + /// + /// 是否211 + /// + public bool? Sff { get; set; } + /// + /// 是否双一流 + /// + public bool? Syl { get; set; } + /// + /// 学校logo + /// + public string Logo { get; set; } + + + /// + /// 省市区名称 + /// + public string AreaName { get; set; } + + /// + /// 学科层次 + /// + public int? SubjectLevel { get; set; } + + /// + /// 排名 最新 + /// + public int Sort { get; set; } + + } + + + + + /// /// 录取概率分析结果 /// diff --git a/New_College.Repository/BASE/D_UniversityRankRepository.cs b/New_College.Repository/BASE/D_UniversityRankRepository.cs index d50da16..754b13e 100644 --- a/New_College.Repository/BASE/D_UniversityRankRepository.cs +++ b/New_College.Repository/BASE/D_UniversityRankRepository.cs @@ -1,17 +1,45 @@ -using New_College.IRepository; +using Essensoft.AspNetCore.Payment.Alipay.Domain; +using New_College.IRepository; using New_College.IRepository.UnitOfWork; using New_College.Model.Models; +using New_College.Model.ViewModels; using New_College.Repository.Base; +using NPOI.SS.Formula.Functions; +using SqlSugar; +using System.Collections.Generic; +using System.Threading.Tasks; namespace New_College.Repository { - /// - /// D_UniversityRankRepository - /// + /// + /// D_UniversityRankRepository + /// public class D_UniversityRankRepository : BaseRepository, ID_UniversityRankRepository { public D_UniversityRankRepository(IUnitOfWork unitOfWork) : base(unitOfWork) { } + + public async Task> GetPcUniversityRank(UniversityRankQuery query) + { + + var response = await this.Db.Queryable((rank, u) => new object[] { JoinType.Left, rank.UniversityName == u.Name }) + .Where((rank, u) => rank.UniversityType == query.Type) + .WhereIF(!string.IsNullOrWhiteSpace(query.Name), (rank, u) => SqlFunc.Contains(rank.UniversityName, query.Name)) + .WhereIF(query.SubjectType.HasValue, (rank, u) => u.Subject_Level == query.SubjectType) + .OrderBy((rank, u) => rank.Rank, OrderByType.Asc) + .Select((rank, u) => new UniversityPcRankList + { + AreaName = u.Area_Name, + Logo = u.Logo, + Name = u.Name, + Syl = u.Syl == 1 ? true : false, + Nhef = u.Nhef == 1 ? true : false, + Sff = u.Sff == 1 ? true : false, + Sort = rank.Rank, + SubjectLevel = u.Subject_Level, + }).ToListAsync(); + return response; + } } } \ No newline at end of file diff --git a/New_College.Repository/BASE/ID_UniversityRankRepository.cs b/New_College.Repository/BASE/ID_UniversityRankRepository.cs index 82de41c..e129938 100644 --- a/New_College.Repository/BASE/ID_UniversityRankRepository.cs +++ b/New_College.Repository/BASE/ID_UniversityRankRepository.cs @@ -1,5 +1,8 @@ using New_College.IRepository.Base; using New_College.Model.Models; +using New_College.Model.ViewModels; +using System.Collections.Generic; +using System.Threading.Tasks; namespace New_College.IRepository { @@ -8,5 +11,8 @@ namespace New_College.IRepository /// public interface ID_UniversityRankRepository : IBaseRepository { + + Task> GetPcUniversityRank(UniversityRankQuery query); + } } \ No newline at end of file diff --git a/New_College.Repository/New_College.Repository.csproj b/New_College.Repository/New_College.Repository.csproj index 4fdeaa4..2b8513d 100644 --- a/New_College.Repository/New_College.Repository.csproj +++ b/New_College.Repository/New_College.Repository.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net6.0 diff --git a/New_College.Services/D_LongIdMapServices.cs b/New_College.Services/D_LongIdMapServices.cs index 6ff80f2..d43fb69 100644 --- a/New_College.Services/D_LongIdMapServices.cs +++ b/New_College.Services/D_LongIdMapServices.cs @@ -20,6 +20,9 @@ using System.Text; using SqlSugar; using System.Linq.Expressions; using Org.BouncyCastle.Asn1.Ocsp; +using Essensoft.AspNetCore.Payment.Alipay.Domain; +using StackExchange.Redis; +using New_College.Repository; namespace New_College.Services { @@ -799,6 +802,18 @@ namespace New_College.Services return info.OrderBy(x => x.OrderSort).Select(x => new UniversityRankList() { Name = x.UniversityName, Sort = x.Rank }).ToList(); } + + /// + /// + /// + /// + /// + public async Task> GetPcUniversityRank(UniversityRankQuery query) + { + return await d_UniversityRankRepository.GetPcUniversityRank(query); + } + + /// /// 专业搜索 /// @@ -1719,6 +1734,7 @@ namespace New_College.Services return true; } + diff --git a/New_College.Services/New_College.Services.csproj b/New_College.Services/New_College.Services.csproj index 3b893ab..c002964 100644 --- a/New_College.Services/New_College.Services.csproj +++ b/New_College.Services/New_College.Services.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net6.0 diff --git a/New_College.Tasks/New_College.Tasks.csproj b/New_College.Tasks/New_College.Tasks.csproj index 16f34ee..9bf2dfe 100644 --- a/New_College.Tasks/New_College.Tasks.csproj +++ b/New_College.Tasks/New_College.Tasks.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net6.0