You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.8 KiB
63 lines
1.8 KiB
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System.Threading.Tasks;
|
|
using Znyc.Admin.AspNetCore.Controllers;
|
|
using Znyc.Admin.AspNetCore.Entitys;
|
|
using Znyc.Admin.Commons.Entitys;
|
|
using Znyc.Admin.Security.Dtos;
|
|
using Znyc.Admin.Security.Entitys;
|
|
using Znyc.Admin.Security.IServices;
|
|
using Znyc.Admin.WebApi.Attributes;
|
|
|
|
namespace Znyc.Admin.WebApi.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 定时调度
|
|
/// </summary>
|
|
[Quartz]
|
|
[Route("api/Security/[controller]")]
|
|
[AllowAnonymous]
|
|
public class QuartzController : AreaApiController<Api, ApiOutputDto, ApiInputDto,
|
|
IApiService, long>
|
|
{
|
|
private readonly IStatisticalService _statisticalService;
|
|
|
|
/// <summary>
|
|
/// 构造函数
|
|
/// </summary>
|
|
/// <param name="service"></param>
|
|
/// <param name="statisticalService"></param>
|
|
public QuartzController(IApiService service,
|
|
IStatisticalService statisticalService) : base(service)
|
|
{
|
|
_service = service;
|
|
_statisticalService = statisticalService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加统计数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet("InsertAsync")]
|
|
[AllowAnonymous]
|
|
|
|
//[FunctionAuthorize("Add")]
|
|
public async Task<IActionResult> AddAsync()
|
|
{
|
|
CommonResult result = new CommonResult();
|
|
result = await _statisticalService.InsertAsync();
|
|
if (result.Success)
|
|
{
|
|
result.ErrCode = ErrCode.successCode;
|
|
result.ErrMsg = ErrCode.err0;
|
|
}
|
|
else
|
|
{
|
|
result.ErrMsg = ErrCode.err43002;
|
|
result.ErrCode = "43002";
|
|
}
|
|
|
|
return ToJsonContent(result);
|
|
}
|
|
}
|
|
}
|
|
|