56 lines
1.6 KiB
C#
56 lines
1.6 KiB
C#
|
|
|
|
namespace ZhiYi.Core.Api.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 分享管理
|
|
/// </summary>
|
|
[Route("api/[action]")]
|
|
[ApiController]
|
|
public class SharedController : ControllerBase
|
|
{
|
|
private readonly ISharedAppService _sharedAppService;
|
|
|
|
public SharedController(ISharedAppService sharedAppService)
|
|
{
|
|
_sharedAppService = sharedAppService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 创建分享
|
|
/// </summary>
|
|
/// <param name="input"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<AppResponse<string>> CreateAsync([FromBody] SharedCreationDto input)
|
|
=> await _sharedAppService.CreateAsync(input);
|
|
|
|
/// <summary>
|
|
/// 获取个人分享列表
|
|
/// </summary>
|
|
/// <param name="id">分享账号ID</param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public async Task<AppResponse<List<SharedDto>>> GetListAsync([FromQuery]long id)
|
|
=> await _sharedAppService.GetListAsync(id);
|
|
|
|
/// <summary>
|
|
/// 使用分享码
|
|
/// </summary>
|
|
/// <param name="input"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task UseShared([FromBody] UseSharedCodeDto input)
|
|
=> await _sharedAppService.UseShared(input);
|
|
|
|
/// <summary>
|
|
/// 批量删除分享码
|
|
/// </summary>
|
|
/// <param name="input"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task DeleteBatchAsync(SharedDeleteDto input)
|
|
=> await _sharedAppService.DeleteBatchAsync(input);
|
|
}
|
|
}
|