From c0ce4cba38e516acf6f9aca47df35d8987df5047 Mon Sep 17 00:00:00 2001 From: tanglong <842690096@qq.com> Date: Tue, 17 Jun 2025 11:33:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E6=A0=A1=E9=A2=84=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WeChatApplet/Context/SmartSportsContext.cs | 1 + .../Controllers/ClientSideController.cs | 12 +++ .../Services/Impl/ClientSideService.cs | 24 ++++++ .../Services/Interface/IClientSideService.cs | 8 ++ .../Y_SchoolAccountApplication.cs | 83 +++++++++++++++++++ WeChatApplet/Startup.cs | 14 ++-- .../ClientSide/SchoolAccountApplicationDto.cs | 41 +++++++++ 7 files changed, 176 insertions(+), 7 deletions(-) create mode 100644 WeChatApplet/SmartSportsEntitys/Y_SchoolAccountApplication.cs create mode 100644 YD_WeChatApplet.Commons/Dto/ClientSide/SchoolAccountApplicationDto.cs diff --git a/WeChatApplet/Context/SmartSportsContext.cs b/WeChatApplet/Context/SmartSportsContext.cs index f566b1a..0e83d9c 100644 --- a/WeChatApplet/Context/SmartSportsContext.cs +++ b/WeChatApplet/Context/SmartSportsContext.cs @@ -43,6 +43,7 @@ namespace YD_WeChatApplet.Context public DbSet CurricularTaxonomy { get; set; } public DbSet Curricular { get; set; } public DbSet StadiumVisiting { get; set; } + public DbSet SchoolAccountApplication { get; set; } } } diff --git a/WeChatApplet/Controllers/ClientSideController.cs b/WeChatApplet/Controllers/ClientSideController.cs index cfbeca1..065c0e3 100644 --- a/WeChatApplet/Controllers/ClientSideController.cs +++ b/WeChatApplet/Controllers/ClientSideController.cs @@ -363,5 +363,17 @@ namespace YD_WeChatApplet.Api.Controllers var res = await _clientSideService.CetCheckInRecord(dto); return res; } + + /// + /// 学校账号预约 + /// + /// + /// + [HttpPost("SchoolAccountApplication")] + public async Task SchoolAccountApplication([FromBody] SchoolAccountApplicationDto dto) + { + await _clientSideService.SchoolAccountApplication(dto); + return Ok("预约成功"); + } } } \ No newline at end of file diff --git a/WeChatApplet/Services/Impl/ClientSideService.cs b/WeChatApplet/Services/Impl/ClientSideService.cs index 749955d..4f38e22 100644 --- a/WeChatApplet/Services/Impl/ClientSideService.cs +++ b/WeChatApplet/Services/Impl/ClientSideService.cs @@ -1270,5 +1270,29 @@ namespace YD_WeChatApplet.Api.Services.Impl return dailyRecords; } + + /// + /// 学校账号预约 + /// + /// + /// + public async Task SchoolAccountApplication(SchoolAccountApplicationDto dto) + { + var timeNow = DateTime.Now; + var entity = new Y_SchoolAccountApplication() + { + SchoolName = dto.SchoolName, + SchoolAddress = dto.SchoolAddress, + PhoneNo = dto.PhoneNo, + UserName = dto.UserName, + Remarks = dto.Remarks, + Status = 1, + VisitingTime = timeNow, + UpdateTime = timeNow + }; + + await _sportsContext.SchoolAccountApplication.AddAsync(entity); + await _sportsContext.SaveChangesAsync(); + } } } diff --git a/WeChatApplet/Services/Interface/IClientSideService.cs b/WeChatApplet/Services/Interface/IClientSideService.cs index c6ced6d..5d9dccb 100644 --- a/WeChatApplet/Services/Interface/IClientSideService.cs +++ b/WeChatApplet/Services/Interface/IClientSideService.cs @@ -212,5 +212,13 @@ namespace YD_WeChatApplet.Services /// /// Task> CetCheckInRecord(CetCheckInRecordDto dto); + + /// + /// 学校账号预约 + /// + /// + /// + + Task SchoolAccountApplication(SchoolAccountApplicationDto dto); } } diff --git a/WeChatApplet/SmartSportsEntitys/Y_SchoolAccountApplication.cs b/WeChatApplet/SmartSportsEntitys/Y_SchoolAccountApplication.cs new file mode 100644 index 0000000..e246039 --- /dev/null +++ b/WeChatApplet/SmartSportsEntitys/Y_SchoolAccountApplication.cs @@ -0,0 +1,83 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using YD_WeChatApplet.Api.Entitys; + +namespace YD_WeChatApplet.Api.SmartSportsEntitys +{ + [Table("Y_SchoolAccountApplication")] + public class Y_SchoolAccountApplication + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Display(Description = "主键Id")] + [Comment("Id")] + public int Id { get; set; } + + /// + ///学校名称 + /// + [Display(Name = "学校名称")] + [Comment("学校名称")] + [Column(TypeName = "nvarchar(100)")] + public string SchoolName { get; set; } + + /// + ///学校地址 + /// + [Display(Name = "学校地址")] + [Comment("学校地址")] + [Column(TypeName = "nvarchar(1000)")] + public string SchoolAddress { get; set; } + + /// + /// 用户姓名 + /// + [Display(Name = "用户姓名")] + [Comment("用户姓名")] + [Column(TypeName = "nvarchar(2000)")] + public string UserName { get; set; } + + /// + /// 联系电话 + /// + [Display(Name = "联系电话")] + [Comment("联系电话")] + [Column(TypeName = "nvarchar(11)")] + public string PhoneNo { get; set; } + + /// + /// 状态[1:未处理/2:已处理] + /// + [Display(Name = "状态")] + [Comment("状态")] + [Column(TypeName = "int)")] + public int Status { get; set; } + + /// + ///来访时间 + /// + [Display(Name = "来访时间")] + [Comment("来访时间")] + [Column(TypeName = "datetime")] + public DateTime? VisitingTime { get; set; } + + /// + ///最后修改时间 + /// + [Display(Name = "最后修改时间")] + [Comment("最后修改时间")] + [Column(TypeName = "datetime")] + public DateTime? UpdateTime { get; set; } + + /// + ///备注 + /// + [Display(Name = "备注")] + [Comment("备注")] + [Column(TypeName = "text")] + public string Remarks { get; set; } + } +} diff --git a/WeChatApplet/Startup.cs b/WeChatApplet/Startup.cs index c2ea668..2bb5f87 100644 --- a/WeChatApplet/Startup.cs +++ b/WeChatApplet/Startup.cs @@ -279,13 +279,13 @@ namespace YD_WeChatApplet //配置HttpContext app.UseStaticHttpContext(); - //app.UseSwagger(); - //app.UseSwaggerUI(c => - //{ - // //2个下拉框选项 选择对应的文档 - // c.SwaggerEndpoint("/swagger/v1/swagger.json", "YD_WeChatApplet.Api"); - // c.RoutePrefix = ""; - //}); + app.UseSwagger(); + app.UseSwaggerUI(c => + { + //2个下拉框选项 选择对应的文档 + c.SwaggerEndpoint("/swagger/v1/swagger.json", "YD_WeChatApplet.Api"); + c.RoutePrefix = ""; + }); app.UseRouting(); app.UseCors(); diff --git a/YD_WeChatApplet.Commons/Dto/ClientSide/SchoolAccountApplicationDto.cs b/YD_WeChatApplet.Commons/Dto/ClientSide/SchoolAccountApplicationDto.cs new file mode 100644 index 0000000..d1856e6 --- /dev/null +++ b/YD_WeChatApplet.Commons/Dto/ClientSide/SchoolAccountApplicationDto.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace YD_WeChatApplet.Commons.Dto.ClientSide +{ + /// + /// 学校账号预约 + /// + public class SchoolAccountApplicationDto + { + /// + ///学校名称 + /// + public string SchoolName { get; set; } + + /// + ///学校地址 + /// + public string SchoolAddress { get; set; } + + /// + /// 用户姓名 + /// + public string UserName { get; set; } + + /// + /// 联系电话 + /// + public string PhoneNo { get; set; } + + /// + ///备注 + /// + public string Remarks { get; set; } + } +}