jianghaiqing 2 years ago
commit 9736272e8b

@ -9285,16 +9285,9 @@
<param name="input"></param> <param name="input"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Myshipping.Core.Service.DjyApiAuthService.Add(Myshipping.Core.Service.AddDjyApiAuthInput)"> <member name="M:Myshipping.Core.Service.DjyApiAuthService.Save(Myshipping.Core.Service.SaveDjyApiAuthInput)">
<summary> <summary>
增加接口授权 保存授权
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyApiAuthService.Update(Myshipping.Core.Service.UpdateDjyApiAuthInput)">
<summary>
更新接口授权
</summary> </summary>
<param name="input"></param> <param name="input"></param>
<returns></returns> <returns></returns>
@ -9408,11 +9401,6 @@
有效截止日期 有效截止日期
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Core.Service.DjyApiAuthInput.IsDisable">
<summary>
禁用标志
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyApiAuthInput.TenantId"> <member name="P:Myshipping.Core.Service.DjyApiAuthInput.TenantId">
<summary> <summary>
租户Id 租户Id
@ -9438,17 +9426,12 @@
用户姓名 用户姓名
</summary> </summary>
</member> </member>
<member name="T:Myshipping.Core.Service.AddDjyApiAuthInput"> <member name="T:Myshipping.Core.Service.SaveDjyApiAuthInput">
<summary>
接口授权新增输入参数
</summary>
</member>
<member name="T:Myshipping.Core.Service.UpdateDjyApiAuthInput">
<summary> <summary>
接口授权修改输入参数 接口授权修改保存参数
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Core.Service.UpdateDjyApiAuthInput.Id"> <member name="P:Myshipping.Core.Service.SaveDjyApiAuthInput.Id">
<summary> <summary>
主键Id 主键Id
</summary> </summary>
@ -9468,11 +9451,6 @@
接口授权查询输入参数 接口授权查询输入参数
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.Id">
<summary>
主键Id
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.ApiCode"> <member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.ApiCode">
<summary> <summary>
接口代码 接口代码
@ -9483,46 +9461,16 @@
接口名称 接口名称
</summary> </summary>
</member> </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"> <member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.IsDisable">
<summary> <summary>
禁用标志 禁用标志
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.TenantId">
<summary>
租户Id
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.TenantName"> <member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.TenantName">
<summary> <summary>
租户名称 租户名称
</summary> </summary>
</member> </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"> <member name="P:Myshipping.Core.Service.QueryDjyApiAuthInput.UserName">
<summary> <summary>
用户姓名 用户姓名

@ -14,7 +14,7 @@ namespace Myshipping.Core.Service
/// <summary> /// <summary>
/// 接口授权服务 /// 接口授权服务
/// </summary> /// </summary>
[ApiDescriptionSettings("Application",Name = "DjyApiAuth", Order = 1)] [ApiDescriptionSettings(Name = "DjyApiAuth", Order = 1)]
public class DjyApiAuthService : IDjyApiAuthService, IDynamicApiController, ITransient public class DjyApiAuthService : IDjyApiAuthService, IDynamicApiController, ITransient
{ {
private readonly SqlSugarRepository<DjyApiAuth> _rep; private readonly SqlSugarRepository<DjyApiAuth> _rep;
@ -37,37 +37,34 @@ namespace Myshipping.Core.Service
var entities = await _rep.AsQueryable() var entities = await _rep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.ApiCode), u => u.ApiCode == input.ApiCode) .WhereIF(!string.IsNullOrWhiteSpace(input.ApiCode), u => u.ApiCode == input.ApiCode)
.WhereIF(!string.IsNullOrWhiteSpace(input.ApiName), u => u.ApiName == input.ApiName) .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.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(!string.IsNullOrWhiteSpace(input.UserName), u => u.UserName == input.UserName)
.WhereIF(input.IsDisable.HasValue, u => u.IsDisable == input.IsDisable.Value)
.ToPagedListAsync(input.PageNo, input.PageSize); .ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult(); return entities.XnPagedResult();
} }
/// <summary> /// <summary>
/// 增加接口授权 /// 保存授权
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("/DjyApiAuth/add")] [HttpPost("/DjyApiAuth/sava")]
public async Task Add(AddDjyApiAuthInput input) public async Task<long> Save(SaveDjyApiAuthInput input)
{ {
var entity = input.Adapt<DjyApiAuth>(); DjyApiAuth entity = null;
await _rep.InsertAsync(entity); if (input.Id > 0)
} {
entity = input.Adapt<DjyApiAuth>();
/// <summary> await _rep.InsertAsync(entity);
/// 更新接口授权 }
/// </summary> else
/// <param name="input"></param> {
/// <returns></returns> entity = _rep.AsQueryable().Filter(null, true).First(x => x.Id == input.Id);
[HttpPost("/DjyApiAuth/edit")] input.Adapt(entity);
public async Task Update(UpdateDjyApiAuthInput input) await _rep.UpdateAsync(entity);
{ }
var entity = input.Adapt<DjyApiAuth>(); return entity.Id;
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns:true).ExecuteCommandAsync();
} }
/// <summary> /// <summary>

@ -32,12 +32,7 @@ namespace Myshipping.Core.Service
/// <summary> /// <summary>
/// 有效截止日期 /// 有效截止日期
/// </summary> /// </summary>
public virtual DateTime ExpireDate { get; set; } public virtual DateTime? ExpireDate { get; set; }
/// <summary>
/// 禁用标志
/// </summary>
public virtual bool IsDisable { get; set; }
/// <summary> /// <summary>
/// 租户Id /// 租户Id
@ -67,16 +62,9 @@ namespace Myshipping.Core.Service
} }
/// <summary> /// <summary>
/// 接口授权新增输入参数 /// 接口授权修改保存参数
/// </summary> /// </summary>
public class AddDjyApiAuthInput : DjyApiAuthInput public class SaveDjyApiAuthInput : DjyApiAuthInput
{
}
/// <summary>
/// 接口授权修改输入参数
/// </summary>
public class UpdateDjyApiAuthInput : DjyApiAuthInput
{ {
/// <summary> /// <summary>
/// 主键Id /// 主键Id
@ -103,12 +91,7 @@ namespace Myshipping.Core.Service
/// 接口授权查询输入参数 /// 接口授权查询输入参数
/// </summary> /// </summary>
public class QueryDjyApiAuthInput : PageInputBase public class QueryDjyApiAuthInput : PageInputBase
{ {
/// <summary>
/// 主键Id
/// </summary>
public virtual long Id { get; set; }
/// <summary> /// <summary>
/// 接口代码 /// 接口代码
/// </summary> /// </summary>
@ -119,46 +102,16 @@ namespace Myshipping.Core.Service
/// </summary> /// </summary>
public virtual string ApiName { get; set; } 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>
/// 禁用标志 /// 禁用标志
/// </summary> /// </summary>
public virtual bool IsDisable { get; set; } public virtual bool? IsDisable { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public virtual long TenantId { get; set; }
/// <summary> /// <summary>
/// 租户名称 /// 租户名称
/// </summary> /// </summary>
public virtual string TenantName { get; set; } 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>
/// 用户姓名 /// 用户姓名
/// </summary> /// </summary>

@ -9,8 +9,7 @@ namespace Myshipping.Core.Service
public interface IDjyApiAuthService public interface IDjyApiAuthService
{ {
Task<dynamic> Page([FromQuery] QueryDjyApiAuthInput input); Task<dynamic> Page([FromQuery] QueryDjyApiAuthInput input);
Task Add(AddDjyApiAuthInput input); Task<long> Save(SaveDjyApiAuthInput input);
Task Update(UpdateDjyApiAuthInput input);
Task Delete(GetDjyApiAuthInput input); Task Delete(GetDjyApiAuthInput input);
Task<DjyApiAuth> Get([FromQuery] GetDjyApiAuthInput input); Task<DjyApiAuth> Get([FromQuery] GetDjyApiAuthInput input);
//Task<dynamic> List([FromQuery] QueryDjyApiAuthInput input); //Task<dynamic> List([FromQuery] QueryDjyApiAuthInput input);

Loading…
Cancel
Save