|
@@ -16,14 +16,12 @@ namespace Services
|
|
|
[AppService(ServiceType = typeof(IApiInfoService), ServiceLifetime = LifeTime.Transient)]
|
|
[AppService(ServiceType = typeof(IApiInfoService), ServiceLifetime = LifeTime.Transient)]
|
|
|
public class ApiInfoService : BaseService<ApiInfo>, IApiInfoService
|
|
public class ApiInfoService : BaseService<ApiInfo>, IApiInfoService
|
|
|
{
|
|
{
|
|
|
- private readonly IApiGroupService _ApiGroupService;
|
|
|
|
|
private readonly IDatabaseInfoService _DatabaseInfoService;
|
|
private readonly IDatabaseInfoService _DatabaseInfoService;
|
|
|
private readonly IDatabaseTableService _DatabaseTableService;
|
|
private readonly IDatabaseTableService _DatabaseTableService;
|
|
|
private readonly IDatabaseFieldService _DatabaseFieldService;
|
|
private readonly IDatabaseFieldService _DatabaseFieldService;
|
|
|
|
|
|
|
|
- public ApiInfoService(IApiGroupService ApiGroupService, IDatabaseInfoService DatabaseInfoService, IDatabaseTableService DatabaseTableService, IDatabaseFieldService DatabaseFieldService)
|
|
|
|
|
|
|
+ public ApiInfoService(IDatabaseInfoService DatabaseInfoService, IDatabaseTableService DatabaseTableService, IDatabaseFieldService DatabaseFieldService)
|
|
|
{
|
|
{
|
|
|
- _ApiGroupService = ApiGroupService;
|
|
|
|
|
_DatabaseInfoService = DatabaseInfoService;
|
|
_DatabaseInfoService = DatabaseInfoService;
|
|
|
_DatabaseTableService = DatabaseTableService;
|
|
_DatabaseTableService = DatabaseTableService;
|
|
|
_DatabaseFieldService = DatabaseFieldService;
|
|
_DatabaseFieldService = DatabaseFieldService;
|
|
@@ -74,9 +72,9 @@ namespace Services
|
|
|
/// 克隆接口
|
|
/// 克隆接口
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
/// <param name="param">参数请求体</param>
|
|
/// <param name="param">参数请求体</param>
|
|
|
- public void copyApiInfo([FromBody] CopyApiInfoDto param)
|
|
|
|
|
|
|
+ public void copyApiInfo([FromBody] CopyApiInfoDto param, ApiGroup group)
|
|
|
{
|
|
{
|
|
|
- var group = _ApiGroupService.GetFirst(m => m.id == param.targetGroupId) ?? new ApiGroup();
|
|
|
|
|
|
|
+ // var group = _ApiGroupService.GetFirst(m => m.id == param.targetGroupId) ?? new ApiGroup();
|
|
|
List<int> apiIdList = param.sourceApiId.ToList();
|
|
List<int> apiIdList = param.sourceApiId.ToList();
|
|
|
var sourceApis = GetList(m => apiIdList.Contains(m.id)).ToList();
|
|
var sourceApis = GetList(m => apiIdList.Contains(m.id)).ToList();
|
|
|
foreach(ApiInfo sourceApi in sourceApis)
|
|
foreach(ApiInfo sourceApi in sourceApis)
|
|
@@ -144,7 +142,7 @@ namespace Services
|
|
|
|
|
|
|
|
Add(new ApiInfo()
|
|
Add(new ApiInfo()
|
|
|
{
|
|
{
|
|
|
- serviceId = 0,
|
|
|
|
|
|
|
+ serviceId = database.serverId,
|
|
|
groupId = param.groupId,
|
|
groupId = param.groupId,
|
|
|
tabName = table.tableName,
|
|
tabName = table.tableName,
|
|
|
apiName = table.tableName + (apiKind == 1 ? "列表" : apiKind == 2 ? "详情" : apiKind == 3 ? "添加" : apiKind == 4 ? "修改" : "删除"),
|
|
apiName = table.tableName + (apiKind == 1 ? "列表" : apiKind == 2 ? "详情" : apiKind == 3 ? "添加" : apiKind == 4 ? "修改" : "删除"),
|