Exemplo n.º 1
0
        public async Task <IActionResult> DeleteContent([FromQuery] uint id, [FromQuery] int page)
        {
            var res = await _contentRepository.DeleteContentAsync(_userManager.GetUserId(User), id);

            if (!res)
            {
                return(GoMessageView("删除失败"));
            }
            return(GoMessageView("删除成功"));
        }
Exemplo n.º 2
0
    public async Task DeleteContentAsync(
        string path,
        CancellationToken cancellationToken = default)
    {
        await ContentRepository.DeleteContentAsync(
            path, cancellationToken);

        await DistributedCache.RemoveAsync(
            $"{CacheKeyPrefix}{path}",
            cancellationToken);
    }
Exemplo n.º 3
0
        public async Task <IActionResult> DeleteContent(uint cid)
        {
            var res = await _contentRepository.DeleteContentAsync(this.GetAuthorization(), cid);

            return(Json(res));
        }