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($"{hello}看到这里页面说明你已经成功启动了本项目:)\n\n" +
"如果觉得项目有用,打赏作者喝杯咖啡作为奖励\n☛☛http://www.izhaorui.cn/vip\n");
}
///
/// home
///
///
[Route("/config")]
[HttpGet]
[AllowAnonymous]
public async Task