using System.Threading.Tasks;
using GxPress.Auth;
using GxPress.Service.Interface.Doc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace GxPress.Api.AppControllers
{
    [Route("api/app/test")]
    [ApiController]
    [Authorize]
    public class TestController : ControllerBase
    {
        private readonly IDocService docService;
        private readonly ILoginContext _loginContext;
        public TestController(IDocService docService, ILoginContext loginContext)
        {
            this.docService = docService;
            _loginContext = loginContext;
        }
        [HttpGet("{id}")]
        public async Task<bool> MakeDoc(int id)
        {
            await docService.MakeDoc(id, _loginContext.AccountId);
            return true;
        }
    }
}