using GDZZ.Core;
using Furion.DependencyInjection;
using Furion.DynamicApiController;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using System.Linq;
using System.Threading.Tasks;
using GDZZ.Application.Entity;
namespace GDZZ.Application
{
///
/// 公司属性服务
///
[ApiDescriptionSettings("Application",Name = "Company", Order = 1)]
public class CompanyService : ICompanyService, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository _rep;
public CompanyService(SqlSugarRepository rep)
{
_rep = rep;
}
///
/// 更新公司属性
///
///
///
[HttpPost("/Mini/Company/edit")]
public async Task Update(UpdateCompanyInput input)
{
var entity = input.Adapt();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
///
/// 获取公司属性
///
///
///
[HttpGet("/Mini/CompanyDetail")]
public async Task Get([FromQuery] QueryeCompanyInput input)
{
//获取公司相关的招聘信息
return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
}
}
}