diff --git a/New_College.Api/Controllers/Back/D_PlanMajorDescController.cs b/New_College.Api/Controllers/Back/D_PlanMajorDescController.cs index b1367ca..1b4c8e8 100644 --- a/New_College.Api/Controllers/Back/D_PlanMajorDescController.cs +++ b/New_College.Api/Controllers/Back/D_PlanMajorDescController.cs @@ -12,6 +12,9 @@ using Org.BouncyCastle.Asn1.Ocsp; using New_College.IRepository.UnitOfWork; using System.Collections.Generic; using Newtonsoft.Json; +using New_College.Common.HttpContextUser; +using Microsoft.AspNetCore.Http; +using New_College.AuthHelper.OverWrite; namespace New_College.Api.Controllers { @@ -28,15 +31,18 @@ namespace New_College.Api.Controllers private readonly IU_VolunteerTableServices _VolunteerTableServices; private readonly IU_VolunteerTableDetailServices _VolunteerTableDetailServices; private readonly IUnitOfWork _unitOfWork; + private readonly ID_UserSettingBaseServices d_UserSetting; + private readonly IHttpContextAccessor _accessor; public D_PlanMajorDescController(ID_PlanMajorDescServices D_PlanMajorDescServices, ID_PlanMajorDescProServices d_PlanMajorDescProServices, - IU_VolunteerTableServices volunteerTableServices, IU_VolunteerTableDetailServices volunteerTableDetailServices, IUnitOfWork unitOfWork) + IU_VolunteerTableServices volunteerTableServices, IU_VolunteerTableDetailServices volunteerTableDetailServices, IUnitOfWork unitOfWork, ID_UserSettingBaseServices d_UserSetting, IHttpContextAccessor accessor) { _d_PlanMajorDescServices = D_PlanMajorDescServices; _d_PlanMajorDescProServices = d_PlanMajorDescProServices; _VolunteerTableServices = volunteerTableServices; _VolunteerTableDetailServices = volunteerTableDetailServices; _unitOfWork = unitOfWork; - + this.d_UserSetting = d_UserSetting; + _accessor = accessor; } @@ -67,7 +73,7 @@ namespace New_College.Api.Controllers response = perviewdto, success = true }; - } + } /// /// 查询扩缩招院校招生计划详情 @@ -199,7 +205,9 @@ namespace New_College.Api.Controllers response = response }; } - + var token = _accessor.HttpContext.Request.Headers["Authorization"].ObjToString().Replace("Bearer ", ""); + long customerId = JwtHelper.SerializeJwt(token).Uid; + await this.d_UserSetting.UpdateSingleCustomerSetting(new UserBaseSettingUpdateDTO() { UType = 1, CustomerId = customerId }); return new MessageModel>() { msg = "获取成功", @@ -388,6 +396,9 @@ namespace New_College.Api.Controllers }; } + var token = _accessor.HttpContext.Request.Headers["Authorization"].ObjToString().Replace("Bearer ", ""); + long customerId = JwtHelper.SerializeJwt(token).Uid; + await this.d_UserSetting.UpdateSingleCustomerSetting(new UserBaseSettingUpdateDTO() { UType = 1, CustomerId = customerId }); return new MessageModel>() { msg = "获取成功", diff --git a/New_College.Model/ViewModels/UserSettingBaseRequest.cs b/New_College.Model/ViewModels/UserSettingBaseRequest.cs index e8acf40..28d4764 100644 --- a/New_College.Model/ViewModels/UserSettingBaseRequest.cs +++ b/New_College.Model/ViewModels/UserSettingBaseRequest.cs @@ -14,7 +14,7 @@ namespace New_College.Model.ViewModels public class UserBaseSettingUpdateDTO { - public int CustomerId { get; set; } + public long CustomerId { get; set; } /// /// 0分数修改次数|1查询次数 ///