From cf386707bc2394e04a6731a007746c457cc90fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Fri, 19 Jan 2024 10:06:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9Evip=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=9B=B8=E5=AF=B9=E5=BA=94=E6=9D=83=E9=99=90=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Back/VipCardController.cs | 54 +++++++++++++++++-- New_College.Api/New_College.Model.xml | 30 +++++++++++ New_College.Api/New_College.xml | 13 +++++ .../ViewModels/Result/VipPowerRolesViews.cs | 52 ++++++++++++++++++ 4 files changed, 146 insertions(+), 3 deletions(-) create mode 100644 New_College.Model/ViewModels/Result/VipPowerRolesViews.cs diff --git a/New_College.Api/Controllers/Back/VipCardController.cs b/New_College.Api/Controllers/Back/VipCardController.cs index ad19718..c67c4fc 100644 --- a/New_College.Api/Controllers/Back/VipCardController.cs +++ b/New_College.Api/Controllers/Back/VipCardController.cs @@ -19,12 +19,15 @@ namespace New_College.Api.Controllers.Back private readonly IV_VipCardInfoServices iV_VipCardInfoServices; private readonly IV_VipCardTypeServices iV_VipCardTypeServices; private readonly IV_OrderInfoServices iV_OrderInfoServices; - public VipCardController(IV_VipCardInfoServices IV_VipCardInfoServices, IV_VipCardTypeServices IV_VipCardTypeServices, IV_OrderInfoServices IV_OrderInfoServices) + private readonly IV_CustomerInfoServices _CustomerInfoServices; + + public VipCardController(IV_VipCardInfoServices IV_VipCardInfoServices, IV_VipCardTypeServices IV_VipCardTypeServices, IV_OrderInfoServices IV_OrderInfoServices, IV_CustomerInfoServices customerInfoServices) { iV_VipCardInfoServices = IV_VipCardInfoServices; iV_VipCardTypeServices = IV_VipCardTypeServices; - iV_OrderInfoServices= IV_OrderInfoServices; - } + iV_OrderInfoServices = IV_OrderInfoServices; + _CustomerInfoServices = customerInfoServices; + } /// /// 生成卡信息 /// @@ -98,5 +101,50 @@ namespace New_College.Api.Controllers.Back { return await iV_VipCardTypeServices.GetVipCardType(); } + + + + /// + /// 根据用户是否为Vip获取相应权限 + /// + /// + /// + [HttpGet] + public async Task CheckRoles([FromQuery] IdQuery query) + { + var response = new VipPowerRolesViewsDTO(); + var custom = await _CustomerInfoServices.Query(c => c.Id == query.CustomerId); + if (custom.Any()) + { + response.IsVip = custom.FirstOrDefault().IsVIP; + response.pcRole = new PCRole() + { + ScoreCount = 10, + SearchCount = 99999 + }; + response.minProRole = new MinProRole() + { + ScoreCount = 10, + SearchCount = 99999 + }; + } + else + { + response.IsVip = false; + response.pcRole = new PCRole() + { + ScoreCount = 1, + SearchCount = 10 + }; + response.minProRole = new MinProRole() + { + ScoreCount = 1, + SearchCount = 10 + }; + + } + return response; + } + } } diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml index afc3edf..84d09fe 100644 --- a/New_College.Api/New_College.Model.xml +++ b/New_College.Api/New_College.Model.xml @@ -6775,6 +6775,36 @@ 到期时间 + + + pc端权限 + + + + + 小程序权限 + + + + + 成绩更改次数 + + + + + 模块查看次数 + + + + + 成绩更改次数 + + + + + 模块查看次数 + + 志愿填报推荐一级懒人专用 diff --git a/New_College.Api/New_College.xml b/New_College.Api/New_College.xml index 3e0920b..d9ed6bc 100644 --- a/New_College.Api/New_College.xml +++ b/New_College.Api/New_College.xml @@ -108,6 +108,13 @@ + + + 根据用户是否为Vip获取相应权限 + + + + 服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下 @@ -211,6 +218,12 @@ 服务器接口,因为是模板生成,所以首字母是大写的,自己可以重构下 + + + 账号注销 + + 传入OpenId + 获取微信openid diff --git a/New_College.Model/ViewModels/Result/VipPowerRolesViews.cs b/New_College.Model/ViewModels/Result/VipPowerRolesViews.cs new file mode 100644 index 0000000..53146bf --- /dev/null +++ b/New_College.Model/ViewModels/Result/VipPowerRolesViews.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace New_College.Model.ViewModels +{ + public class VipPowerRolesViewsDTO + { + public bool IsVip { get; set; } + /// + /// pc端权限 + /// + public PCRole pcRole { get; set; } + + /// + /// 小程序权限 + /// + public MinProRole minProRole { get; set; } + + } + + public class PCRole + { + /// + /// 成绩更改次数 + /// + public int ScoreCount { get; set; } + + /// + /// 模块查看次数 + /// + public int SearchCount { get; set; } + + } + + public class MinProRole + { + /// + /// 成绩更改次数 + /// + public int ScoreCount { get; set; } + + /// + /// 模块查看次数 + /// + public int SearchCount { get; set; } + + } + +}