using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using XF.Utility.UnifyResponse;

namespace Identity.Host.Apis
{
    [AllowAnonymous]
    [ApiController]
    [Produces("application/json")]
    [Route("api/v1/[controller]")]

    public class TestController : ControllerBase
    {
        [HttpGet("time")]
        public async Task<ApiResponse<string>> Time()
        {
            var data = DateTime.Now.ToString("F");
            return new ApiResponse<string>
            {
                Result = data
            };
        }

        [HttpPost("time1")]
        public async Task<ApiResponse<string>> Time(int t)
        {
            var data = DateTime.Now.ToString("F");
            return new ApiResponse<string>
            {
                Result = $"{data} - {t}"
            };
        }
    }
}
