diff --git a/New_College.Api/Controllers/Front/CustomerController.cs b/New_College.Api/Controllers/Front/CustomerController.cs index 1795ab2..a616f2e 100644 --- a/New_College.Api/Controllers/Front/CustomerController.cs +++ b/New_College.Api/Controllers/Front/CustomerController.cs @@ -15,6 +15,7 @@ using New_College.Model; using New_College.Model.Models; using New_College.Model.Request; using New_College.Model.ViewModels; +using New_College.Repository; namespace New_College.Api.Controllers.Front { @@ -27,12 +28,14 @@ namespace New_College.Api.Controllers.Front private readonly ID_UserSettingBaseServices _userSetting; private readonly ICasdoorUserServices _casdoorUserServices; private readonly ID_FansDistributionServices _fansDistributionServices; - public CustomerController(IV_CustomerInfoServices IV_CustomerInfoServices, ID_UserSettingBaseServices userSetting, ICasdoorUserServices casdoorUserServices, ID_FansDistributionServices fansDistributionServices) + private readonly IQuestionNaireRepository _naireRepository; + public CustomerController(IV_CustomerInfoServices IV_CustomerInfoServices, ID_UserSettingBaseServices userSetting, ICasdoorUserServices casdoorUserServices, ID_FansDistributionServices fansDistributionServices, IQuestionNaireRepository questionNaireRepository) { _services = IV_CustomerInfoServices; _userSetting = userSetting; _casdoorUserServices = casdoorUserServices; _fansDistributionServices = fansDistributionServices; + _naireRepository = questionNaireRepository; } @@ -105,11 +108,12 @@ namespace New_College.Api.Controllers.Front } else { - await _services.Add(new V_CustomerInfo() { - - + await _services.Add(new V_CustomerInfo() + { + + + - }); } } @@ -282,7 +286,7 @@ namespace New_College.Api.Controllers.Front var count = (await _fansDistributionServices.Query(e => e.SaleId == saleId)).Count();//判断邀请人数是否满足三个人 if (count >= 3) { - + await _services.UpdateIsVip(saleId); } return true; @@ -498,5 +502,35 @@ namespace New_College.Api.Controllers.Front { return await _services.GetCustomerInfoById(query); } + + + + + /// + /// 问卷保存 + /// + /// + /// + [HttpPost] + public async Task> QuestionNaireSave([FromBody] QuestionNaireDto dto) + { + var count = await _naireRepository.Add(new QuestionNaire() + { + Id = dto.id, + CreateTime = DateTime.Now, + infoList = dto.infoList, + IsDelete = false, + ModifyTime = DateTime.Now, + OrderSort = 0 + }); + return new MessageModel() + { + response = count > 0, + success = true, + msg = "", + status = 200 + }; + } + } } diff --git a/New_College.Model/Models/QuestionNaire.cs b/New_College.Model/Models/QuestionNaire.cs new file mode 100644 index 0000000..cb9a8ad --- /dev/null +++ b/New_College.Model/Models/QuestionNaire.cs @@ -0,0 +1,29 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace New_College.Model.Models +{ + + /// + /// + /// + public class QuestionNaire : EntityModel + { + + /// + /// + /// + [SugarColumn(IsNullable = false, IsPrimaryKey = true, IsIdentity = true)] + public int Id { get; set; } + + /// + /// 学校名称 + /// + [SugarColumn(Length = int.MaxValue)] + public string infoList { get; set; } + } +} diff --git a/New_College.Model/ViewModels/UserSettingBaseRequest.cs b/New_College.Model/ViewModels/UserSettingBaseRequest.cs index c468f55..bed9f95 100644 --- a/New_College.Model/ViewModels/UserSettingBaseRequest.cs +++ b/New_College.Model/ViewModels/UserSettingBaseRequest.cs @@ -22,6 +22,25 @@ namespace New_College.Model.ViewModels } + + /// + /// + /// + public class QuestionNaireDto + { + + /// + /// + /// + public int id { get; set; } + + /// + /// + /// + public string infoList { get; set; } + + } + public class UserBaseSettingDto { public int CustomerId { get; set; } diff --git a/New_College.Repository/BASE/IQuestionNaireRepository.cs b/New_College.Repository/BASE/IQuestionNaireRepository.cs new file mode 100644 index 0000000..f39cf3f --- /dev/null +++ b/New_College.Repository/BASE/IQuestionNaireRepository.cs @@ -0,0 +1,14 @@ +using New_College.IRepository.Base; +using New_College.Model.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace New_College.Repository +{ + public interface IQuestionNaireRepository : IBaseRepository + { + } +} diff --git a/New_College.Repository/BASE/QuestionNaireRepository.cs b/New_College.Repository/BASE/QuestionNaireRepository.cs new file mode 100644 index 0000000..a1ca814 --- /dev/null +++ b/New_College.Repository/BASE/QuestionNaireRepository.cs @@ -0,0 +1,19 @@ +using New_College.IRepository; +using New_College.IRepository.UnitOfWork; +using New_College.Model.Models; +using New_College.Repository.Base; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace New_College.Repository +{ + public class QuestionNaireRepository : BaseRepository, IQuestionNaireRepository + { + public QuestionNaireRepository(IUnitOfWork unitOfWork) : base(unitOfWork) + { + } + } +}