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