From ebbc43d37b2f78e09a58f760670c14256cf5e4a9 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Fri, 6 Jan 2023 14:22:17 +0800 Subject: [PATCH] =?UTF-8?q?API=E6=8E=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Myshipping.Application.xml | 7 +- .../BookingPrintTemplateService.cs | 9 +- .../Dto/BookingPrintTemplateInput.cs | 7 +- Myshipping.Core/Entity/DJY/DjyApiAuth.cs | 55 +++ Myshipping.Core/Myshipping.Core.xml | 375 ++++++++++++++++++ .../Service/DjyApiAuth/DjyApiAuthService.cs | 107 +++++ .../Service/DjyApiAuth/Dto/DjyApiAuthDto.cs | 72 ++++ .../Service/DjyApiAuth/Dto/DjyApiAuthInput.cs | 168 ++++++++ .../DjyApiAuth/Dto/DjyApiAuthOutput.cs | 71 ++++ .../Service/DjyApiAuth/IDjyApiAuthService.cs | 18 + 10 files changed, 883 insertions(+), 6 deletions(-) create mode 100644 Myshipping.Core/Entity/DJY/DjyApiAuth.cs create mode 100644 Myshipping.Core/Service/DjyApiAuth/DjyApiAuthService.cs create mode 100644 Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthDto.cs create mode 100644 Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthInput.cs create mode 100644 Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthOutput.cs create mode 100644 Myshipping.Core/Service/DjyApiAuth/IDjyApiAuthService.cs diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index ceaea011..67450e77 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -9705,7 +9705,7 @@ - 类型:FastReport、Excel模板等 + 类型:FastReport、Excel模板等(FastReport或10代表FastReport,ExcelTemplate或20代表Excel模板) @@ -9783,6 +9783,11 @@ 分类名称 + + + 类型:FastReport、Excel模板等(FastReport或10代表FastReport,ExcelTemplate或20代表Excel模板) + + 订舱模板服务 diff --git a/Myshipping.Application/Service/BookingPrintTemplate/BookingPrintTemplateService.cs b/Myshipping.Application/Service/BookingPrintTemplate/BookingPrintTemplateService.cs index 94fe132f..7b7c7a00 100644 --- a/Myshipping.Application/Service/BookingPrintTemplate/BookingPrintTemplateService.cs +++ b/Myshipping.Application/Service/BookingPrintTemplate/BookingPrintTemplateService.cs @@ -63,6 +63,7 @@ namespace Myshipping.Application .WhereIF(!string.IsNullOrWhiteSpace(input.DisplayName), u => u.DisplayName.Contains(input.DisplayName.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.CateCode), u => u.CateCode.Contains(input.CateCode.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.CateName), u => u.CateName.Contains(input.CateName.Trim())) + .WhereIF(!string.IsNullOrWhiteSpace(input.Type), u => u.Type == input.Type) .ToPagedListAsync(input.PageNo, input.PageSize); return entities.XnPagedResult(); } @@ -410,10 +411,10 @@ namespace Myshipping.Application FilePath = t.FilePath, FileName = t.FileName, TenantName = t.TenantName, - DisplayName=t.DisplayName, - CateCode=t.CateCode, - CateName=t.CateName, - Type=t.Type, + DisplayName = t.DisplayName, + CateCode = t.CateCode, + CateName = t.CateName, + Type = t.Type, UserName = "", }).ToListAsync(); foreach (var item in list) diff --git a/Myshipping.Application/Service/BookingPrintTemplate/Dto/BookingPrintTemplateInput.cs b/Myshipping.Application/Service/BookingPrintTemplate/Dto/BookingPrintTemplateInput.cs index bb0be0b9..1858cde2 100644 --- a/Myshipping.Application/Service/BookingPrintTemplate/Dto/BookingPrintTemplateInput.cs +++ b/Myshipping.Application/Service/BookingPrintTemplate/Dto/BookingPrintTemplateInput.cs @@ -54,7 +54,7 @@ namespace Myshipping.Application public virtual string CateName { get; set; } /// - /// 类型:FastReport、Excel模板等 + /// 类型:FastReport、Excel模板等(FastReport或10代表FastReport,ExcelTemplate或20代表Excel模板) /// public virtual BookingPrintTemplateType Type { get; set; } @@ -149,5 +149,10 @@ namespace Myshipping.Application public virtual string CateName { get; set; } + /// + /// 类型:FastReport、Excel模板等(FastReport或10代表FastReport,ExcelTemplate或20代表Excel模板) + /// + public virtual string Type { get; set; } + } } diff --git a/Myshipping.Core/Entity/DJY/DjyApiAuth.cs b/Myshipping.Core/Entity/DJY/DjyApiAuth.cs new file mode 100644 index 00000000..180dfe80 --- /dev/null +++ b/Myshipping.Core/Entity/DJY/DjyApiAuth.cs @@ -0,0 +1,55 @@ +using System; +using SqlSugar; +using System.ComponentModel; +using Myshipping.Core.Entity; +namespace Myshipping.Core.Entity +{ + /// + /// 接口授权 + /// + [SugarTable("djy_api_auth")] + [Description("接口授权")] + public class DjyApiAuth : DBEntityTenant + { + /// + /// 接口代码 + /// + public string ApiCode { get; set; } + /// + /// 接口名称 + /// + public string ApiName { get; set; } + /// + /// 接口KEY + /// + public string ApiKey { get; set; } + /// + /// 接口秘钥 + /// + public string ApiSecret { get; set; } + /// + /// 有效截止日期 + /// + public DateTime? ExpireDate { get; set; } + /// + /// 禁用标志 + /// + public bool IsDisable { get; set; } + /// + /// 租户名称 + /// + public string TenantName { get; set; } + /// + /// 用户ID + /// + public long? UserId { get; set; } + /// + /// 用户代码 + /// + public string UserCode { get; set; } + /// + /// 用户姓名 + /// + public string UserName { get; set; } + } +} \ No newline at end of file diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 0af807b4..ed345f9f 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -1594,6 +1594,61 @@ 主键Id + + + 接口授权 + + + + + 接口代码 + + + + + 接口名称 + + + + + 接口KEY + + + + + 接口秘钥 + + + + + 有效截止日期 + + + + + 禁用标志 + + + + + 租户名称 + + + + + 用户ID + + + + + 用户代码 + + + + + 用户姓名 + + @@ -9218,6 +9273,326 @@ + + + 接口授权服务 + + + + + 分页查询接口授权 + + + + + + + 增加接口授权 + + + + + + + 更新接口授权 + + + + + + + 删除接口授权 + + + + + + + 获取接口授权 + + + + + + + 接口授权输出参数 + + + + + 主键Id + + + + + 接口代码 + + + + + 接口名称 + + + + + 接口KEY + + + + + 接口秘钥 + + + + + 有效截止日期 + + + + + 禁用标志 + + + + + 租户Id + + + + + 租户名称 + + + + + 用户ID + + + + + 用户代码 + + + + + 用户姓名 + + + + + 接口授权输入参数 + + + + + 接口代码 + + + + + 接口名称 + + + + + 接口KEY + + + + + 接口秘钥 + + + + + 有效截止日期 + + + + + 禁用标志 + + + + + 租户Id + + + + + 租户名称 + + + + + 用户ID + + + + + 用户代码 + + + + + 用户姓名 + + + + + 接口授权新增输入参数 + + + + + 接口授权修改输入参数 + + + + + 主键Id + + + + + 接口授权获取(删除)输入参数 + + + + + 主键Id + + + + + 接口授权查询输入参数 + + + + + 主键Id + + + + + 接口代码 + + + + + 接口名称 + + + + + 接口KEY + + + + + 接口秘钥 + + + + + 有效截止日期 + + + + + 禁用标志 + + + + + 租户Id + + + + + 租户名称 + + + + + 用户ID + + + + + 用户代码 + + + + + 用户姓名 + + + + + 接口授权输出参数 + + + + + 主键Id + + + + + 接口代码 + + + + + 接口名称 + + + + + 接口KEY + + + + + 接口秘钥 + + + + + 有效截止日期 + + + + + 禁用标志 + + + + + 租户Id + + + + + 租户名称 + + + + + 用户ID + + + + + 用户代码 + + + + + 用户姓名 + + 客户服务 diff --git a/Myshipping.Core/Service/DjyApiAuth/DjyApiAuthService.cs b/Myshipping.Core/Service/DjyApiAuth/DjyApiAuthService.cs new file mode 100644 index 00000000..c9390ce9 --- /dev/null +++ b/Myshipping.Core/Service/DjyApiAuth/DjyApiAuthService.cs @@ -0,0 +1,107 @@ +using Myshipping.Core; +using Furion.DependencyInjection; +using Furion.DynamicApiController; +using Mapster; +using Microsoft.AspNetCore.Mvc; +using SqlSugar; +using System.Linq; +using System.Threading.Tasks; +using Myshipping.Core.Entity; +using Microsoft.Extensions.Logging; + +namespace Myshipping.Core.Service +{ + /// + /// 接口授权服务 + /// + [ApiDescriptionSettings("Application",Name = "DjyApiAuth", Order = 1)] + public class DjyApiAuthService : IDjyApiAuthService, IDynamicApiController, ITransient + { + private readonly SqlSugarRepository _rep; + private readonly ILogger _logger; + + public DjyApiAuthService(SqlSugarRepository rep, ILogger logger) + { + _rep = rep; + _logger = logger; + } + + /// + /// 分页查询接口授权 + /// + /// + /// + [HttpGet("/DjyApiAuth/page")] + public async Task Page([FromQuery] QueryDjyApiAuthInput input) + { + var entities = await _rep.AsQueryable() + .WhereIF(!string.IsNullOrWhiteSpace(input.ApiCode), u => u.ApiCode == input.ApiCode) + .WhereIF(!string.IsNullOrWhiteSpace(input.ApiName), u => u.ApiName == input.ApiName) + .WhereIF(!string.IsNullOrWhiteSpace(input.ApiKey), u => u.ApiKey == input.ApiKey) + .WhereIF(!string.IsNullOrWhiteSpace(input.ApiSecret), u => u.ApiSecret == input.ApiSecret) + .WhereIF(!string.IsNullOrWhiteSpace(input.TenantName), u => u.TenantName == input.TenantName) + .WhereIF(!string.IsNullOrWhiteSpace(input.UserCode), u => u.UserCode == input.UserCode) + .WhereIF(!string.IsNullOrWhiteSpace(input.UserName), u => u.UserName == input.UserName) + .ToPagedListAsync(input.PageNo, input.PageSize); + return entities.XnPagedResult(); + } + + /// + /// 增加接口授权 + /// + /// + /// + [HttpPost("/DjyApiAuth/add")] + public async Task Add(AddDjyApiAuthInput input) + { + var entity = input.Adapt(); + await _rep.InsertAsync(entity); + } + + /// + /// 更新接口授权 + /// + /// + /// + [HttpPost("/DjyApiAuth/edit")] + public async Task Update(UpdateDjyApiAuthInput input) + { + var entity = input.Adapt(); + await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns:true).ExecuteCommandAsync(); + } + + /// + /// 删除接口授权 + /// + /// + /// + [HttpPost("/DjyApiAuth/delete")] + public async Task Delete(GetDjyApiAuthInput input) + { + var entity = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id); + await _rep.DeleteAsync(entity); + } + + /// + /// 获取接口授权 + /// + /// + /// + [HttpGet("/DjyApiAuth/detail")] + public async Task Get([FromQuery] GetDjyApiAuthInput input) + { + return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id); + } + + ///// + ///// 获取接口授权列表 + ///// + ///// + ///// + //[HttpGet("/DjyApiAuth/list")] + //public async Task List([FromQuery] QueryDjyApiAuthInput input) + //{ + // return await _rep.ToListAsync(); + //} + } +} diff --git a/Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthDto.cs b/Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthDto.cs new file mode 100644 index 00000000..9ef56fd1 --- /dev/null +++ b/Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthDto.cs @@ -0,0 +1,72 @@ +using System; +using Myshipping.Core; + +namespace Myshipping.Core.Service +{ + /// + /// 接口授权输出参数 + /// + public class DjyApiAuthDto + { + /// + /// 主键Id + /// + public long? Id { get; set; } + + /// + /// 接口代码 + /// + public string ApiCode { get; set; } + + /// + /// 接口名称 + /// + public string ApiName { get; set; } + + /// + /// 接口KEY + /// + public string ApiKey { get; set; } + + /// + /// 接口秘钥 + /// + public string ApiSecret { get; set; } + + /// + /// 有效截止日期 + /// + public DateTime? ExpireDate { get; set; } + + /// + /// 禁用标志 + /// + public bool? IsDisable { get; set; } + + /// + /// 租户Id + /// + public long? TenantId { get; set; } + + /// + /// 租户名称 + /// + public string TenantName { get; set; } + + /// + /// 用户ID + /// + public long? UserId { get; set; } + + /// + /// 用户代码 + /// + public string UserCode { get; set; } + + /// + /// 用户姓名 + /// + public string UserName { get; set; } + + } +} diff --git a/Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthInput.cs b/Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthInput.cs new file mode 100644 index 00000000..2cfcca1e --- /dev/null +++ b/Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthInput.cs @@ -0,0 +1,168 @@ +using Myshipping.Core; +using System; +using System.ComponentModel.DataAnnotations; + +namespace Myshipping.Core.Service +{ + /// + /// 接口授权输入参数 + /// + public class DjyApiAuthInput + { + /// + /// 接口代码 + /// + public virtual string ApiCode { get; set; } + + /// + /// 接口名称 + /// + public virtual string ApiName { get; set; } + + /// + /// 接口KEY + /// + public virtual string ApiKey { get; set; } + + /// + /// 接口秘钥 + /// + public virtual string ApiSecret { get; set; } + + /// + /// 有效截止日期 + /// + public virtual DateTime ExpireDate { get; set; } + + /// + /// 禁用标志 + /// + public virtual bool IsDisable { get; set; } + + /// + /// 租户Id + /// + public virtual long TenantId { get; set; } + + /// + /// 租户名称 + /// + public virtual string TenantName { get; set; } + + /// + /// 用户ID + /// + public virtual long UserId { get; set; } + + /// + /// 用户代码 + /// + public virtual string UserCode { get; set; } + + /// + /// 用户姓名 + /// + public virtual string UserName { get; set; } + + } + + /// + /// 接口授权新增输入参数 + /// + public class AddDjyApiAuthInput : DjyApiAuthInput + { + } + + /// + /// 接口授权修改输入参数 + /// + public class UpdateDjyApiAuthInput : DjyApiAuthInput + { + /// + /// 主键Id + /// + [Required(ErrorMessage = "主键Id不能为空")] + public long Id { get; set; } + + } + + /// + /// 接口授权获取(删除)输入参数 + /// + public class GetDjyApiAuthInput + { + /// + /// 主键Id + /// + [Required(ErrorMessage = "主键Id不能为空")] + public long Id { get; set; } + + } + + /// + /// 接口授权查询输入参数 + /// + public class QueryDjyApiAuthInput : PageInputBase + { + /// + /// 主键Id + /// + public virtual long Id { get; set; } + + /// + /// 接口代码 + /// + public virtual string ApiCode { get; set; } + + /// + /// 接口名称 + /// + public virtual string ApiName { get; set; } + + /// + /// 接口KEY + /// + public virtual string ApiKey { get; set; } + + /// + /// 接口秘钥 + /// + public virtual string ApiSecret { get; set; } + + /// + /// 有效截止日期 + /// + public virtual DateTime ExpireDate { get; set; } + + /// + /// 禁用标志 + /// + public virtual bool IsDisable { get; set; } + + /// + /// 租户Id + /// + public virtual long TenantId { get; set; } + + /// + /// 租户名称 + /// + public virtual string TenantName { get; set; } + + /// + /// 用户ID + /// + public virtual long UserId { get; set; } + + /// + /// 用户代码 + /// + public virtual string UserCode { get; set; } + + /// + /// 用户姓名 + /// + public virtual string UserName { get; set; } + + } +} diff --git a/Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthOutput.cs b/Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthOutput.cs new file mode 100644 index 00000000..e0cc3532 --- /dev/null +++ b/Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthOutput.cs @@ -0,0 +1,71 @@ +using System; + +namespace Myshipping.Core.Service +{ + /// + /// 接口授权输出参数 + /// + public class DjyApiAuthOutput + { + /// + /// 主键Id + /// + public long Id { get; set; } + + /// + /// 接口代码 + /// + public string ApiCode { get; set; } + + /// + /// 接口名称 + /// + public string ApiName { get; set; } + + /// + /// 接口KEY + /// + public string ApiKey { get; set; } + + /// + /// 接口秘钥 + /// + public string ApiSecret { get; set; } + + /// + /// 有效截止日期 + /// + public DateTime ExpireDate { get; set; } + + /// + /// 禁用标志 + /// + public bool IsDisable { get; set; } + + /// + /// 租户Id + /// + public long TenantId { get; set; } + + /// + /// 租户名称 + /// + public string TenantName { get; set; } + + /// + /// 用户ID + /// + public long UserId { get; set; } + + /// + /// 用户代码 + /// + public string UserCode { get; set; } + + /// + /// 用户姓名 + /// + public string UserName { get; set; } + + } +} diff --git a/Myshipping.Core/Service/DjyApiAuth/IDjyApiAuthService.cs b/Myshipping.Core/Service/DjyApiAuth/IDjyApiAuthService.cs new file mode 100644 index 00000000..1d5d469c --- /dev/null +++ b/Myshipping.Core/Service/DjyApiAuth/IDjyApiAuthService.cs @@ -0,0 +1,18 @@ +using Myshipping.Core; +using Microsoft.AspNetCore.Mvc; +using System.Threading.Tasks; +using Myshipping.Application.Entity; +using Myshipping.Core.Entity; + +namespace Myshipping.Core.Service +{ + public interface IDjyApiAuthService + { + Task Page([FromQuery] QueryDjyApiAuthInput input); + Task Add(AddDjyApiAuthInput input); + Task Update(UpdateDjyApiAuthInput input); + Task Delete(GetDjyApiAuthInput input); + Task Get([FromQuery] GetDjyApiAuthInput input); + //Task List([FromQuery] QueryDjyApiAuthInput input); + } +} \ No newline at end of file