TestController.cs 802 B

12345678910111213141516171819202122232425262728
  1. using System.Threading.Tasks;
  2. using GxPress.Auth;
  3. using GxPress.Service.Interface.Doc;
  4. using Microsoft.AspNetCore.Authorization;
  5. using Microsoft.AspNetCore.Mvc;
  6. namespace GxPress.Api.AppControllers
  7. {
  8. [Route("api/app/test")]
  9. [ApiController]
  10. [Authorize]
  11. public class TestController : ControllerBase
  12. {
  13. private readonly IDocService docService;
  14. private readonly ILoginContext _loginContext;
  15. public TestController(IDocService docService, ILoginContext loginContext)
  16. {
  17. this.docService = docService;
  18. _loginContext = loginContext;
  19. }
  20. [HttpGet("{id}")]
  21. public async Task<bool> MakeDoc(int id)
  22. {
  23. await docService.MakeDoc(id, _loginContext.AccountId);
  24. return true;
  25. }
  26. }
  27. }