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.
84 lines
2.1 KiB
84 lines
2.1 KiB
4 years ago
|
using Coldairarrow.Business.HuiYan;
|
||
|
using Coldairarrow.Business.MDS;
|
||
|
using Coldairarrow.Entity.DTO;
|
||
|
using Coldairarrow.Entity.HuiYan;
|
||
|
using Coldairarrow.Entity.MDS;
|
||
|
using Coldairarrow.Util;
|
||
|
using Microsoft.AspNetCore.Authorization;
|
||
|
using Microsoft.AspNetCore.Mvc;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq.Expressions;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
namespace Coldairarrow.Api.Controllers.HuiYan
|
||
|
{
|
||
|
[Route("/HuiYan/[controller]/[action]")]
|
||
|
public class pricetasklogController : BaseApiController
|
||
|
{
|
||
|
#region DI
|
||
|
|
||
|
IuserBusiness _iuserBusiness;
|
||
|
public pricetasklogController(IpricetasklogBusiness pricetasklogBus, IuserBusiness iuserBusiness)
|
||
|
{
|
||
|
_iuserBusiness = iuserBusiness;
|
||
|
_pricetasklogBus = pricetasklogBus;
|
||
|
}
|
||
|
|
||
|
IpricetasklogBusiness _pricetasklogBus { get; }
|
||
|
|
||
|
#endregion
|
||
|
|
||
|
#region 获取
|
||
|
|
||
|
[HttpPost]
|
||
|
public async Task<PageResult<pricetasklog>> GetDataList(PageInput<ConditionDTO> input)
|
||
|
{
|
||
|
return await _pricetasklogBus.GetDataListAsync(input);
|
||
|
}
|
||
|
|
||
|
[HttpPost]
|
||
|
public async Task<pricetasklog> GetTheData(IdInputDTO input)
|
||
|
{
|
||
|
return await _pricetasklogBus.GetTheDataAsync(input.id);
|
||
|
}
|
||
|
|
||
|
#endregion
|
||
|
|
||
|
#region 提交
|
||
|
|
||
|
[HttpPost]
|
||
|
public async Task SaveData(pricetasklog data)
|
||
|
{
|
||
|
if (data.Id.IsNullOrEmpty())
|
||
|
{
|
||
|
InitEntity(data);
|
||
|
|
||
|
await _pricetasklogBus.AddDataAsync(data);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
await _pricetasklogBus.UpdateDataAsync(data);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
[HttpPost]
|
||
|
public async Task DeleteData(List<string> ids)
|
||
|
{
|
||
|
await _pricetasklogBus.DeleteDataAsync(ids);
|
||
|
}
|
||
|
|
||
|
#endregion
|
||
|
|
||
|
/// <summary>
|
||
|
/// 发布比价任务
|
||
|
/// </summary>
|
||
|
/// <param name="id"></param>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet, AllowAnonymous]
|
||
|
public AjaxResult AddTask(string id)
|
||
|
{
|
||
|
return _pricetasklogBus.AddTask(id);
|
||
|
}
|
||
|
}
|
||
|
}
|