using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using MiniExcelLibs;
using ZR.Infrastructure.IPTools;
using ZR.Model.Dto;
using ZR.Model.System;
using ZR.Service.Business.IBusinessService;
using ZR.ServiceCore.Resources;
namespace ZR.Admin.WebApi.Controllers
{
///
/// 公共模块
///
[Route("[controller]/[action]")]
[ApiExplorerSettings(GroupName = "sys")]
public class CommonController : BaseController
{
private OptionsSetting OptionsSetting;
private NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
private IWebHostEnvironment WebHostEnvironment;
private ISysFileService SysFileService;
private readonly IStringLocalizer _localizer;
///
/// 礼品小程序接口
///
private readonly IGiftConfigService _GiftConfigService;
///
///
///
///
///
///
///
public CommonController(
IStringLocalizer stringLocalizer,
IOptions options,
IWebHostEnvironment webHostEnvironment,
ISysFileService fileService,
IGiftConfigService GiftConfigService)
{
WebHostEnvironment = webHostEnvironment;
SysFileService = fileService;
OptionsSetting = options.Value;
_localizer = stringLocalizer;
_GiftConfigService = GiftConfigService;
}
///
/// home
///
///
[Route("/")]
[HttpGet]
[AllowAnonymous]
public IActionResult Index()
{
var hello = _localizer["hello"].Value;
return Ok($"请求成功!=>" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
}
///
/// home
///
///
[Route("/config")]
[HttpGet]
[AllowAnonymous]
public async Task