From 880025aa16de483a2dca1f29e61656c8fdecf6c2 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Fri, 6 Jan 2023 14:52:05 +0800 Subject: [PATCH] =?UTF-8?q?API=E6=8E=88=E6=9D=83=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Myshipping.Application.xml | 95 +++++++++++++++---- Myshipping.Core/Myshipping.Core.xml | 62 +----------- .../Service/DjyApiAuth/DjyApiAuthService.cs | 39 ++++---- .../Service/DjyApiAuth/Dto/DjyApiAuthInput.cs | 57 +---------- .../Service/DjyApiAuth/IDjyApiAuthService.cs | 3 +- 5 files changed, 106 insertions(+), 150 deletions(-) diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index 67450e77..9cd8a635 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -3327,6 +3327,16 @@ 付款方 + + + 品名代码 + + + + + 品名 + + 租户名称 @@ -8483,6 +8493,16 @@ EDI扩展信息 + + + 品名代码 + + + + + 品名 + + 订舱主表输入参数 @@ -9967,32 +9987,32 @@ 测试1 - + 创建时间 - + 更新时间 - + 创建者Id - + 创建者名称 - + 修改者Id - + 修改者名称 @@ -10012,32 +10032,32 @@ 品名分类名称 - + 创建时间 - + 更新时间 - + 创建者Id - + 创建者名称 - + 修改者Id - + 修改者名称 @@ -10084,32 +10104,32 @@ 红酒 - + 创建时间 - + 更新时间 - + 创建者Id - + 创建者名称 - + 修改者Id - + 修改者名称 @@ -11806,6 +11826,31 @@ + + + 提单纸计算 + + + + + 顺序号 + + + + + 主单号 + + + + + DRAFT页数 + + + + + 提单用纸数 + + 我的任务查询 @@ -12728,6 +12773,13 @@ 任务主键数组 返回结果 + + + 提单纸页数计算 + + 任务主键数组 + 返回结果 + 任务管理 @@ -12823,5 +12875,12 @@ 任务主键数组 返回结果 + + + 提单纸页数计算 + + 任务主键数组 + 返回结果 + diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 001c0415..539b294e 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -9285,16 +9285,9 @@ - + - 增加接口授权 - - - - - - - 更新接口授权 + 保存授权 @@ -9408,11 +9401,6 @@ 有效截止日期 - - - 禁用标志 - - 租户Id @@ -9438,17 +9426,12 @@ 用户姓名 - - - 接口授权新增输入参数 - - - + - 接口授权修改输入参数 + 接口授权修改保存参数 - + 主键Id @@ -9468,11 +9451,6 @@ 接口授权查询输入参数 - - - 主键Id - - 接口代码 @@ -9483,46 +9461,16 @@ 接口名称 - - - 接口KEY - - - - - 接口秘钥 - - - - - 有效截止日期 - - 禁用标志 - - - 租户Id - - 租户名称 - - - 用户ID - - - - - 用户代码 - - 用户姓名 diff --git a/Myshipping.Core/Service/DjyApiAuth/DjyApiAuthService.cs b/Myshipping.Core/Service/DjyApiAuth/DjyApiAuthService.cs index c9390ce9..f2a5c522 100644 --- a/Myshipping.Core/Service/DjyApiAuth/DjyApiAuthService.cs +++ b/Myshipping.Core/Service/DjyApiAuth/DjyApiAuthService.cs @@ -14,7 +14,7 @@ namespace Myshipping.Core.Service /// /// 接口授权服务 /// - [ApiDescriptionSettings("Application",Name = "DjyApiAuth", Order = 1)] + [ApiDescriptionSettings(Name = "DjyApiAuth", Order = 1)] public class DjyApiAuthService : IDjyApiAuthService, IDynamicApiController, ITransient { private readonly SqlSugarRepository _rep; @@ -37,37 +37,34 @@ namespace Myshipping.Core.Service 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) + .WhereIF(input.IsDisable.HasValue, u => u.IsDisable == input.IsDisable.Value) .ToPagedListAsync(input.PageNo, input.PageSize); return entities.XnPagedResult(); } /// - /// 增加接口授权 + /// 保存授权 /// /// /// - [HttpPost("/DjyApiAuth/add")] - public async Task Add(AddDjyApiAuthInput input) + [HttpPost("/DjyApiAuth/sava")] + public async Task Save(SaveDjyApiAuthInput 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(); + DjyApiAuth entity = null; + if (input.Id > 0) + { + entity = input.Adapt(); + await _rep.InsertAsync(entity); + } + else + { + entity = _rep.AsQueryable().Filter(null, true).First(x => x.Id == input.Id); + input.Adapt(entity); + await _rep.UpdateAsync(entity); + } + return entity.Id; } /// diff --git a/Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthInput.cs b/Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthInput.cs index 2cfcca1e..cc0331f7 100644 --- a/Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthInput.cs +++ b/Myshipping.Core/Service/DjyApiAuth/Dto/DjyApiAuthInput.cs @@ -32,12 +32,7 @@ namespace Myshipping.Core.Service /// /// 有效截止日期 /// - public virtual DateTime ExpireDate { get; set; } - - /// - /// 禁用标志 - /// - public virtual bool IsDisable { get; set; } + public virtual DateTime? ExpireDate { get; set; } /// /// 租户Id @@ -67,16 +62,9 @@ namespace Myshipping.Core.Service } /// - /// 接口授权新增输入参数 + /// 接口授权修改保存参数 /// - public class AddDjyApiAuthInput : DjyApiAuthInput - { - } - - /// - /// 接口授权修改输入参数 - /// - public class UpdateDjyApiAuthInput : DjyApiAuthInput + public class SaveDjyApiAuthInput : DjyApiAuthInput { /// /// 主键Id @@ -103,12 +91,7 @@ namespace Myshipping.Core.Service /// 接口授权查询输入参数 /// public class QueryDjyApiAuthInput : PageInputBase - { - /// - /// 主键Id - /// - public virtual long Id { get; set; } - + { /// /// 接口代码 /// @@ -119,46 +102,16 @@ namespace Myshipping.Core.Service /// 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 bool? IsDisable { get; set; } /// /// 租户名称 /// public virtual string TenantName { get; set; } - /// - /// 用户ID - /// - public virtual long UserId { get; set; } - - /// - /// 用户代码 - /// - public virtual string UserCode { get; set; } - /// /// 用户姓名 /// diff --git a/Myshipping.Core/Service/DjyApiAuth/IDjyApiAuthService.cs b/Myshipping.Core/Service/DjyApiAuth/IDjyApiAuthService.cs index 1d5d469c..0599b248 100644 --- a/Myshipping.Core/Service/DjyApiAuth/IDjyApiAuthService.cs +++ b/Myshipping.Core/Service/DjyApiAuth/IDjyApiAuthService.cs @@ -9,8 +9,7 @@ namespace Myshipping.Core.Service public interface IDjyApiAuthService { Task Page([FromQuery] QueryDjyApiAuthInput input); - Task Add(AddDjyApiAuthInput input); - Task Update(UpdateDjyApiAuthInput input); + Task Save(SaveDjyApiAuthInput input); Task Delete(GetDjyApiAuthInput input); Task Get([FromQuery] GetDjyApiAuthInput input); //Task List([FromQuery] QueryDjyApiAuthInput input);