增加任务接口配置相关信息

master
douhandong 6 months ago
parent 7d1327f411
commit bcc51ebab1

@ -0,0 +1,47 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
using NPOI.SS.UserModel;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 任务API配置
/// </summary>
[SugarTable("task_api_info")]
[Description("任务主表")]
public class TaskAPIInfo : TaskManageDbEntity
{
/// <summary>
/// API名称
/// </summary>
public string APIName { get; set; }
/// <summary>
/// 请求地址
/// </summary>
public string URL { get; set; }
/// <summary>
/// 请求方式
/// </summary>
public string RequestMethod { get; set; }
/// <summary>
/// 请求key
/// </summary>
public string Key { get; set; }
/// <summary>
/// 请求密钥
/// </summary>
public string SecretKey { get; set; }
/// <summary>
/// 平台代码
/// </summary>
public string SYSTEM_CODE { get; set; }
/// <summary>
/// 平台名称
/// </summary>
public string SYSTEM_NAME { get; set; }
}
}

@ -0,0 +1,31 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
using NPOI.SS.UserModel;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 任务租户流程配置
/// </summary>
[SugarTable("task_flow_tenant")]
[Description("租户任务流程配置 ")]
public class TaskFlowTenant : TaskManageDbEntity
{
/// <summary>
/// 任务APIID
/// </summary>
public string TaskApiId { get; set; }
/// <summary>
/// 平台代码
/// </summary>
public string SYSTEM_CODE { get; set; }
/// <summary>
/// 平台名称
/// </summary>
public string SYSTEM_NAME { get; set; }
}
}

@ -0,0 +1,80 @@
using Myshipping.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class TaskAPIBase
{
/// <summary>
/// API名称
/// </summary>
public string APIName { get; set; }
/// <summary>
/// 请求地址
/// </summary>
public string URL { get; set; }
/// <summary>
/// 请求方式
/// </summary>
public string RequestMethod { get; set; }
/// <summary>
/// 请求key
/// </summary>
public string Key { get; set; }
/// <summary>
/// 请求密钥
/// </summary>
public string SecretKey { get; set; }
/// <summary>
/// 平台代码
/// </summary>
public string SYSTEM_CODE { get; set; }
/// <summary>
/// 平台名称
/// </summary>
public string SYSTEM_NAME { get; set; }
}
public class TaskAPIInput:PageInputBase
{
}
public class AddTaskAPIInput : TaskAPIBase
{
}
public class DeleteTaskAPIInput
{
/// <summary>
/// 主键
/// </summary>
public string PK_ID { get; set; }
}
public class UpdateTaskAPIInput: TaskAPIBase
{
/// <summary>
/// 主键
/// </summary>
public string PK_ID { get; set; }
}
public class GetTaskApiInfoInput
{
/// <summary>
/// 主键
/// </summary>
public string PK_ID { get; set; }
}
}

@ -0,0 +1,72 @@
using Myshipping.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class TaskFlowTenantBase
{
/// <summary>
/// 任务APIId
/// </summary>
public string TaskApiId { get; set; }
/// <summary>
/// 平台代码
/// </summary>
public string SYSTEM_CODE { get; set; }
/// <summary>
/// 平台名称
/// </summary>
public string SYSTEM_NAME { get; set; }
}
public class TaskFlowTenantInput : PageInputBase
{
/// <summary>
/// 任务APIId
/// </summary>
public string TaskApiId { get; set; }
}
public class AddTaskFlowTenantInput : TaskFlowTenantBase
{
}
public class DeleteTaskFlowTenantInput
{
/// <summary>
/// 主键
/// </summary>
public string PK_ID { get; set; }
}
public class UpdateTaskFlowTenantInput : TaskFlowTenantBase
{
/// <summary>
/// 主键
/// </summary>
public string PK_ID { get; set; }
}
public class GetTaskFlowTenantInfoInput
{
/// <summary>
/// 主键
/// </summary>
public string PK_ID { get; set; }
}
}

@ -0,0 +1,128 @@
using Furion;
using Furion.DependencyInjection;
using Furion.DynamicApiController;
using Furion.FriendlyException;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Myshipping.Core.Service;
using Myshipping.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Myshipping.Application.Entity;
using Myshipping.Application.Service.Fee.Dto;
using Mapster;
using Furion.DistributedIDGenerator;
namespace Myshipping.Application.Service.TaskManagePlat
{
/// <summary>
/// 任务API配置
/// </summary>
[ApiDescriptionSettings("Application", Name = "TaskAPI", Order = 10)]
public class TaskAPIService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<TaskAPIInfo> _rep;
public TaskAPIService(SqlSugarRepository<TaskAPIInfo> rep)
{
_rep = rep;
}
/// <summary>
/// 分页查询任务API配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<TaskAPIInfo>> Page(TaskAPIInput input)
{
var query = _rep.AsQueryable()
.Select(u => new TaskAPIInfo
{
PK_ID = u.PK_ID,
APIName = u.APIName,
URL = u.URL,
RequestMethod = u.RequestMethod,
Key = u.Key,
SecretKey = u.SecretKey,
SYSTEM_CODE = u.SYSTEM_CODE,
SYSTEM_NAME = u.SYSTEM_NAME
});
return await query.ToPagedListAsync(input.PageNo, input.PageSize);
}
/// <summary>
/// 增加任务API配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Add")]
public async Task Add(AddTaskAPIInput input)
{
var entity = input.Adapt<TaskAPIInfo>();
entity.PK_ID = IDGen.NextID().ToString();
await _rep.InsertAsync(entity);
}
/// <summary>
/// 删除任务API配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Delete")]
public async Task Delete(DeleteTaskAPIInput input)
{
var entity = await _rep.FirstOrDefaultAsync(u => u.PK_ID == input.PK_ID) ?? throw Oops.Oh("数据不存在");
entity.IsDeleted = true;
await _rep.UpdateAsync(entity);
}
/// <summary>
/// 更新任务API配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Update")]
public async Task Update(UpdateTaskAPIInput input)
{
var entity = input.Adapt<TaskAPIInfo>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
/// <summary>
/// 获取任务API配置详情
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Detail")]
public async Task<TaskAPIInfo> Get(GetTaskApiInfoInput input)
{
return await _rep.FirstOrDefaultAsync(u => u.PK_ID == input.PK_ID);
}
/// <summary>
/// 获取任务API配置列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet]
[ApiDescriptionSettings(Name = "List")]
public async Task<List<TaskAPIInfo>> List([FromQuery] TaskAPIInput input)
{
return await _rep.AsQueryable().Select<TaskAPIInfo>().ToListAsync();
}
}
}

@ -0,0 +1,118 @@
using Furion.DependencyInjection;
using Furion.DistributedIDGenerator;
using Furion.DynamicApiController;
using Furion.FriendlyException;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using Myshipping.Application.Entity;
using Myshipping.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application.Service.TaskManagePlat
{
/// <summary>
/// 租户任务流程配置
/// </summary>
[ApiDescriptionSettings("Application", Name = "TaskFlowTenant", Order = 10)]
public class TaskFlowTenantService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<TaskFlowTenant> _rep;
public TaskFlowTenantService(SqlSugarRepository<TaskFlowTenant> rep)
{
_rep = rep;
}
/// <summary>
/// 分页查询租户任务流程配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<TaskFlowTenant>> Page(TaskFlowTenantInput input)
{
var query = _rep.AsQueryable()
.Select(u => new TaskFlowTenant
{
PK_ID = u.PK_ID,
TaskApiId = u.TaskApiId,
SYSTEM_CODE = u.SYSTEM_CODE,
SYSTEM_NAME = u.SYSTEM_NAME
});
return await query.ToPagedListAsync(input.PageNo, input.PageSize);
}
/// <summary>
/// 增加租户任务流程配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Add")]
public async Task Add(AddTaskFlowTenantInput input)
{
var entity = input.Adapt<TaskFlowTenant>();
entity.PK_ID = IDGen.NextID().ToString();
await _rep.InsertAsync(entity);
}
/// <summary>
/// 删除租户任务流程配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Delete")]
public async Task Delete(DeleteTaskFlowTenantInput input)
{
var entity = await _rep.FirstOrDefaultAsync(u => u.PK_ID == input.PK_ID) ?? throw Oops.Oh("数据不存在");
entity.IsDeleted = true;
await _rep.UpdateAsync(entity);
}
/// <summary>
/// 更新租户任务流程配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Update")]
public async Task Update(UpdateTaskFlowTenantInput input)
{
var entity = input.Adapt<TaskFlowTenant>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
/// <summary>
/// 获取租户任务流程配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Detail")]
public async Task<TaskFlowTenant> Get(GetTaskFlowTenantInfoInput input)
{
return await _rep.FirstOrDefaultAsync(u => u.PK_ID == input.PK_ID);
}
/// <summary>
/// 获取租户任务流程配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet]
[ApiDescriptionSettings(Name = "List")]
public async Task<List<TaskFlowTenant>> List([FromQuery] TaskFlowTenantInput input)
{
return await _rep.AsQueryable().Select<TaskFlowTenant>().ToListAsync();
}
}
}

@ -2230,6 +2230,11 @@
排序
</summary>
</member>
<member name="P:Myshipping.Core.Entity.DjyCustomerParam.MultiSelect">
<summary>
是否多选
</summary>
</member>
<member name="T:Myshipping.Core.Entity.DjyCustomerParamItem">
<summary>
客户参数定义
@ -11656,6 +11661,11 @@
排序
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyCustomerParamDto.MultiSelect">
<summary>
是否多选
</summary>
</member>
<member name="T:Myshipping.Core.Service.DjyCustomerParamListOutput">
<summary>
列表输出

Loading…
Cancel
Save