mirror of https://github.com/abpframework/abp.git
committed by
GitHub
13 changed files with 132 additions and 19 deletions
@ -1,11 +1,12 @@ |
|||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
using System.Net.Http; |
using System.Net.Http; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Http.Modeling; |
||||
|
|
||||
namespace Volo.Abp.Http.Client.ClientProxying |
namespace Volo.Abp.Http.Client.ClientProxying |
||||
{ |
{ |
||||
public interface IObjectToFormData<in TValue> |
public interface IObjectToFormData<in TValue> |
||||
{ |
{ |
||||
Task<List<KeyValuePair<string, HttpContent>>> ConvertAsync(TValue value); |
Task<List<KeyValuePair<string, HttpContent>>> ConvertAsync(ActionApiDescriptionModel actionApiDescription, ParameterApiDescriptionModel parameterApiDescription, TValue value); |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,10 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Http.Modeling; |
||||
|
|
||||
|
namespace Volo.Abp.Http.Client.ClientProxying |
||||
|
{ |
||||
|
public interface IObjectToPath<in TValue> |
||||
|
{ |
||||
|
Task<string> ConvertAsync(ActionApiDescriptionModel actionApiDescription, ParameterApiDescriptionModel parameterApiDescription, TValue value); |
||||
|
} |
||||
|
} |
||||
@ -1,9 +1,10 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Http.Modeling; |
||||
|
|
||||
namespace Volo.Abp.Http.Client.ClientProxying |
namespace Volo.Abp.Http.Client.ClientProxying |
||||
{ |
{ |
||||
public interface IObjectToQueryString<in TValue> |
public interface IObjectToQueryString<in TValue> |
||||
{ |
{ |
||||
Task<string> ConvertAsync(TValue value); |
Task<string> ConvertAsync(ActionApiDescriptionModel actionApiDescription, ParameterApiDescriptionModel parameterApiDescription, TValue value); |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,23 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.Http.Client.ClientProxying; |
||||
|
using Volo.Abp.Http.Modeling; |
||||
|
|
||||
|
namespace Volo.Abp.Http.DynamicProxying; |
||||
|
|
||||
|
public class TestObjectToPath : IObjectToPath<int>, ITransientDependency |
||||
|
{ |
||||
|
public Task<string> ConvertAsync(ActionApiDescriptionModel actionApiDescription, ParameterApiDescriptionModel parameterApiDescription, int value) |
||||
|
{ |
||||
|
if (actionApiDescription.Name == nameof(IRegularTestController.GetObjectandCountAsync)) |
||||
|
{ |
||||
|
if (value <= 0) |
||||
|
{ |
||||
|
value = 888; |
||||
|
} |
||||
|
return Task.FromResult(value.ToString()); |
||||
|
} |
||||
|
|
||||
|
return Task.FromResult<string>(null); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue