API授权

optimize
wanghaomei 2 years ago
parent fc5a99825b
commit ebbc43d37b

@ -9705,7 +9705,7 @@
</member>
<member name="P:Myshipping.Application.BookingPrintTemplateInput.Type">
<summary>
类型FastReport、Excel模板等
类型FastReport、Excel模板等FastReport或10代表FastReportExcelTemplate或20代表Excel模板
</summary>
</member>
<member name="T:Myshipping.Application.AddBookingPrintTemplateInput">
@ -9783,6 +9783,11 @@
分类名称
</summary>
</member>
<member name="P:Myshipping.Application.QueryBookingPrintTemplateInput.Type">
<summary>
类型FastReport、Excel模板等FastReport或10代表FastReportExcelTemplate或20代表Excel模板
</summary>
</member>
<member name="T:Myshipping.Application.BookingTemplateService">
<summary>
订舱模板服务

@ -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();
}

@ -54,7 +54,7 @@ namespace Myshipping.Application
public virtual string CateName { get; set; }
/// <summary>
/// 类型FastReport、Excel模板等
/// 类型FastReport、Excel模板等FastReport或10代表FastReportExcelTemplate或20代表Excel模板
/// </summary>
public virtual BookingPrintTemplateType Type { get; set; }
@ -149,5 +149,10 @@ namespace Myshipping.Application
public virtual string CateName { get; set; }
/// <summary>
/// 类型FastReport、Excel模板等FastReport或10代表FastReportExcelTemplate或20代表Excel模板
/// </summary>
public virtual string Type { get; set; }
}
}

@ -0,0 +1,55 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
namespace Myshipping.Core.Entity
{
/// <summary>
/// 接口授权
/// </summary>
[SugarTable("djy_api_auth")]
[Description("接口授权")]
public class DjyApiAuth : DBEntityTenant
{
/// <summary>
/// 接口代码
/// </summary>
public string ApiCode { get; set; }
/// <summary>
/// 接口名称
/// </summary>
public string ApiName { get; set; }
/// <summary>
/// 接口KEY
/// </summary>
public string ApiKey { get; set; }
/// <summary>
/// 接口秘钥
/// </summary>
public string ApiSecret { get; set; }
/// <summary>
/// 有效截止日期
/// </summary>
public DateTime? ExpireDate { get; set; }
/// <summary>
/// 禁用标志
/// </summary>
public bool IsDisable { get; set; }
/// <summary>
/// 租户名称
/// </summary>
public string TenantName { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public long? UserId { get; set; }
/// <summary>
/// 用户代码
/// </summary>
public string UserCode { get; set; }
/// <summary>
/// 用户姓名
/// </summary>
public string UserName { get; set; }
}
}

@ -1594,6 +1594,61 @@
主键Id
</summary>
</member>
<member name="T:Myshipping.Core.Entity.DjyApiAuth">
<summary>
接口授权
</summary>
</member>
<member name="P:Myshipping.Core.Entity.DjyApiAuth.ApiCode">
<summary>
接口代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.DjyApiAuth.ApiName">
<summary>
接口名称
</summary>
</member>
<member name="P:Myshipping.Core.Entity.DjyApiAuth.ApiKey">
<summary>
接口KEY
</summary>
</member>
<member name="P:Myshipping.Core.Entity.DjyApiAuth.ApiSecret">
<summary>
接口秘钥
</summary>
</member>
<member name="P:Myshipping.Core.Entity.DjyApiAuth.ExpireDate">
<summary>
有效截止日期
</summary>
</member>
<member name="P:Myshipping.Core.Entity.DjyApiAuth.IsDisable">
<summary>
禁用标志
</summary>
</member>
<member name="P:Myshipping.Core.Entity.DjyApiAuth.TenantName">
<summary>
租户名称
</summary>
</member>
<member name="P:Myshipping.Core.Entity.DjyApiAuth.UserId">
<summary>
用户ID
</summary>
</member>
<member name="P:Myshipping.Core.Entity.DjyApiAuth.UserCode">
<summary>
用户代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.DjyApiAuth.UserName">
<summary>
用户姓名
</summary>
</member>
<member name="T:Myshipping.Core.Entity.DjyCustomer">
<summary>
@ -9218,6 +9273,326 @@
</summary>
<returns></returns>
</member>
<member name="T:Myshipping.Core.Service.DjyApiAuthService">
<summary>
接口授权服务
</summary>
</member>
<member name="M:Myshipping.Core.Service.DjyApiAuthService.Page(Myshipping.Core.Service.QueryDjyApiAuthInput)">
<summary>
分页查询接口授权
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyApiAuthService.Add(Myshipping.Core.Service.AddDjyApiAuthInput)">
<summary>
增加接口授权
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyApiAuthService.Update(Myshipping.Core.Service.UpdateDjyApiAuthInput)">
<summary>
更新接口授权
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyApiAuthService.Delete(Myshipping.Core.Service.GetDjyApiAuthInput)">
<summary>
删除接口授权
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyApiAuthService.Get(Myshipping.Core.Service.GetDjyApiAuthInput)">
<summary>
获取接口授权
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:Myshipping.Core.Service.DjyApiAuthDto">
<summary>
接口授权输出参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthDto.Id">
<summary>
主键Id
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthDto.ApiCode">
<summary>
接口代码
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthDto.ApiName">
<summary>
接口名称
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthDto.ApiKey">
<summary>
接口KEY
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthDto.ApiSecret">
<summary>
接口秘钥
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthDto.ExpireDate">
<summary>
有效截止日期
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthDto.IsDisable">
<summary>
禁用标志
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthDto.TenantId">
<summary>
租户Id
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthDto.TenantName">
<summary>
租户名称
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthDto.UserId">
<summary>
用户ID
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthDto.UserCode">
<summary>
用户代码
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthDto.UserName">
<summary>
用户姓名
</summary>
</member>
<member name="T:Myshipping.Core.Service.DjyApiAuthInput">
<summary>
接口授权输入参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthInput.ApiCode">
<summary>
接口代码
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthInput.ApiName">
<summary>
接口名称
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthInput.ApiKey">
<summary>
接口KEY
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthInput.ApiSecret">
<summary>
接口秘钥
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthInput.ExpireDate">
<summary>
有效截止日期
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthInput.IsDisable">
<summary>
禁用标志
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthInput.TenantId">
<summary>
租户Id
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthInput.TenantName">
<summary>
租户名称
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthInput.UserId">
<summary>
用户ID
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthInput.UserCode">
<summary>
用户代码
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthInput.UserName">
<summary>
用户姓名
</summary>
</member>
<member name="T:Myshipping.Core.Service.AddDjyApiAuthInput">
<summary>
接口授权新增输入参数
</summary>
</member>
<member name="T:Myshipping.Core.Service.UpdateDjyApiAuthInput">
<summary>
接口授权修改输入参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.UpdateDjyApiAuthInput.Id">
<summary>
主键Id
</summary>
</member>
<member name="T:Myshipping.Core.Service.GetDjyApiAuthInput">
<summary>
接口授权获取(删除)输入参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.GetDjyApiAuthInput.Id">
<summary>
主键Id
</summary>
</member>
<member name="T:Myshipping.Core.Service.QueryDjyApiAuthInput">
<summary>
接口授权查询输入参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.Id">
<summary>
主键Id
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.ApiCode">
<summary>
接口代码
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.ApiName">
<summary>
接口名称
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.ApiKey">
<summary>
接口KEY
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.ApiSecret">
<summary>
接口秘钥
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.ExpireDate">
<summary>
有效截止日期
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.IsDisable">
<summary>
禁用标志
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.TenantId">
<summary>
租户Id
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.TenantName">
<summary>
租户名称
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.UserId">
<summary>
用户ID
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.UserCode">
<summary>
用户代码
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.UserName">
<summary>
用户姓名
</summary>
</member>
<member name="T:Myshipping.Core.Service.DjyApiAuthOutput">
<summary>
接口授权输出参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthOutput.Id">
<summary>
主键Id
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthOutput.ApiCode">
<summary>
接口代码
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthOutput.ApiName">
<summary>
接口名称
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthOutput.ApiKey">
<summary>
接口KEY
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthOutput.ApiSecret">
<summary>
接口秘钥
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthOutput.ExpireDate">
<summary>
有效截止日期
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthOutput.IsDisable">
<summary>
禁用标志
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthOutput.TenantId">
<summary>
租户Id
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthOutput.TenantName">
<summary>
租户名称
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthOutput.UserId">
<summary>
用户ID
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthOutput.UserCode">
<summary>
用户代码
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthOutput.UserName">
<summary>
用户姓名
</summary>
</member>
<member name="T:Myshipping.Core.Service.DjyCustomerService">
<summary>
客户服务

@ -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
{
/// <summary>
/// 接口授权服务
/// </summary>
[ApiDescriptionSettings("Application",Name = "DjyApiAuth", Order = 1)]
public class DjyApiAuthService : IDjyApiAuthService, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<DjyApiAuth> _rep;
private readonly ILogger<DjyApiAuth> _logger;
public DjyApiAuthService(SqlSugarRepository<DjyApiAuth> rep, ILogger<DjyApiAuth> logger)
{
_rep = rep;
_logger = logger;
}
/// <summary>
/// 分页查询接口授权
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/DjyApiAuth/page")]
public async Task<dynamic> 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();
}
/// <summary>
/// 增加接口授权
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyApiAuth/add")]
public async Task Add(AddDjyApiAuthInput input)
{
var entity = input.Adapt<DjyApiAuth>();
await _rep.InsertAsync(entity);
}
/// <summary>
/// 更新接口授权
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyApiAuth/edit")]
public async Task Update(UpdateDjyApiAuthInput input)
{
var entity = input.Adapt<DjyApiAuth>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns:true).ExecuteCommandAsync();
}
/// <summary>
/// 删除接口授权
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyApiAuth/delete")]
public async Task Delete(GetDjyApiAuthInput input)
{
var entity = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
await _rep.DeleteAsync(entity);
}
/// <summary>
/// 获取接口授权
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/DjyApiAuth/detail")]
public async Task<DjyApiAuth> Get([FromQuery] GetDjyApiAuthInput input)
{
return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
}
///// <summary>
///// 获取接口授权列表
///// </summary>
///// <param name="input"></param>
///// <returns></returns>
//[HttpGet("/DjyApiAuth/list")]
//public async Task<dynamic> List([FromQuery] QueryDjyApiAuthInput input)
//{
// return await _rep.ToListAsync();
//}
}
}

@ -0,0 +1,72 @@
using System;
using Myshipping.Core;
namespace Myshipping.Core.Service
{
/// <summary>
/// 接口授权输出参数
/// </summary>
public class DjyApiAuthDto
{
/// <summary>
/// 主键Id
/// </summary>
public long? Id { get; set; }
/// <summary>
/// 接口代码
/// </summary>
public string ApiCode { get; set; }
/// <summary>
/// 接口名称
/// </summary>
public string ApiName { get; set; }
/// <summary>
/// 接口KEY
/// </summary>
public string ApiKey { get; set; }
/// <summary>
/// 接口秘钥
/// </summary>
public string ApiSecret { get; set; }
/// <summary>
/// 有效截止日期
/// </summary>
public DateTime? ExpireDate { get; set; }
/// <summary>
/// 禁用标志
/// </summary>
public bool? IsDisable { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public long? TenantId { get; set; }
/// <summary>
/// 租户名称
/// </summary>
public string TenantName { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public long? UserId { get; set; }
/// <summary>
/// 用户代码
/// </summary>
public string UserCode { get; set; }
/// <summary>
/// 用户姓名
/// </summary>
public string UserName { get; set; }
}
}

@ -0,0 +1,168 @@
using Myshipping.Core;
using System;
using System.ComponentModel.DataAnnotations;
namespace Myshipping.Core.Service
{
/// <summary>
/// 接口授权输入参数
/// </summary>
public class DjyApiAuthInput
{
/// <summary>
/// 接口代码
/// </summary>
public virtual string ApiCode { get; set; }
/// <summary>
/// 接口名称
/// </summary>
public virtual string ApiName { get; set; }
/// <summary>
/// 接口KEY
/// </summary>
public virtual string ApiKey { get; set; }
/// <summary>
/// 接口秘钥
/// </summary>
public virtual string ApiSecret { get; set; }
/// <summary>
/// 有效截止日期
/// </summary>
public virtual DateTime ExpireDate { get; set; }
/// <summary>
/// 禁用标志
/// </summary>
public virtual bool IsDisable { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public virtual long TenantId { get; set; }
/// <summary>
/// 租户名称
/// </summary>
public virtual string TenantName { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public virtual long UserId { get; set; }
/// <summary>
/// 用户代码
/// </summary>
public virtual string UserCode { get; set; }
/// <summary>
/// 用户姓名
/// </summary>
public virtual string UserName { get; set; }
}
/// <summary>
/// 接口授权新增输入参数
/// </summary>
public class AddDjyApiAuthInput : DjyApiAuthInput
{
}
/// <summary>
/// 接口授权修改输入参数
/// </summary>
public class UpdateDjyApiAuthInput : DjyApiAuthInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
/// <summary>
/// 接口授权获取(删除)输入参数
/// </summary>
public class GetDjyApiAuthInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
/// <summary>
/// 接口授权查询输入参数
/// </summary>
public class QueryDjyApiAuthInput : PageInputBase
{
/// <summary>
/// 主键Id
/// </summary>
public virtual long Id { get; set; }
/// <summary>
/// 接口代码
/// </summary>
public virtual string ApiCode { get; set; }
/// <summary>
/// 接口名称
/// </summary>
public virtual string ApiName { get; set; }
/// <summary>
/// 接口KEY
/// </summary>
public virtual string ApiKey { get; set; }
/// <summary>
/// 接口秘钥
/// </summary>
public virtual string ApiSecret { get; set; }
/// <summary>
/// 有效截止日期
/// </summary>
public virtual DateTime ExpireDate { get; set; }
/// <summary>
/// 禁用标志
/// </summary>
public virtual bool IsDisable { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public virtual long TenantId { get; set; }
/// <summary>
/// 租户名称
/// </summary>
public virtual string TenantName { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public virtual long UserId { get; set; }
/// <summary>
/// 用户代码
/// </summary>
public virtual string UserCode { get; set; }
/// <summary>
/// 用户姓名
/// </summary>
public virtual string UserName { get; set; }
}
}

@ -0,0 +1,71 @@
using System;
namespace Myshipping.Core.Service
{
/// <summary>
/// 接口授权输出参数
/// </summary>
public class DjyApiAuthOutput
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 接口代码
/// </summary>
public string ApiCode { get; set; }
/// <summary>
/// 接口名称
/// </summary>
public string ApiName { get; set; }
/// <summary>
/// 接口KEY
/// </summary>
public string ApiKey { get; set; }
/// <summary>
/// 接口秘钥
/// </summary>
public string ApiSecret { get; set; }
/// <summary>
/// 有效截止日期
/// </summary>
public DateTime ExpireDate { get; set; }
/// <summary>
/// 禁用标志
/// </summary>
public bool IsDisable { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public long TenantId { get; set; }
/// <summary>
/// 租户名称
/// </summary>
public string TenantName { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public long UserId { get; set; }
/// <summary>
/// 用户代码
/// </summary>
public string UserCode { get; set; }
/// <summary>
/// 用户姓名
/// </summary>
public string UserName { get; set; }
}
}

@ -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<dynamic> Page([FromQuery] QueryDjyApiAuthInput input);
Task Add(AddDjyApiAuthInput input);
Task Update(UpdateDjyApiAuthInput input);
Task Delete(GetDjyApiAuthInput input);
Task<DjyApiAuth> Get([FromQuery] GetDjyApiAuthInput input);
//Task<dynamic> List([FromQuery] QueryDjyApiAuthInput input);
}
}
Loading…
Cancel
Save