|
|
|
|
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
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 公司属性服务
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ApiDescriptionSettings("Application",Name = "Company", Order = 1)]
|
|
|
|
|
public class CompanyService : ICompanyService, IDynamicApiController, ITransient
|
|
|
|
|
{
|
|
|
|
|
private readonly SqlSugarRepository<Company> _rep;
|
|
|
|
|
|
|
|
|
|
public CompanyService(SqlSugarRepository<Company> rep)
|
|
|
|
|
{
|
|
|
|
|
_rep = rep;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 分页查询套餐管理
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/Mini/Company/page")]
|
|
|
|
|
public async Task<dynamic> Page([FromQuery] CompanyInput input)
|
|
|
|
|
{
|
|
|
|
|
var entities = await _rep.AsQueryable()
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchValue), u => u.Name.Contains(input.SearchValue.Trim()))
|
|
|
|
|
.Select((u) => new MiniResumeOutput()
|
|
|
|
|
{
|
|
|
|
|
CompanyID = u.Id,
|
|
|
|
|
CompanyName = u.Name,
|
|
|
|
|
Logo = u.logo,
|
|
|
|
|
Id = u.Id,
|
|
|
|
|
Info = u.Info,
|
|
|
|
|
Title = u.Name,
|
|
|
|
|
Time = u.CreatedTime.Value.ToString("yyyy/MM/dd"),
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
.ToPagedListAsync(input.PageNo, input.PageSize);
|
|
|
|
|
return entities.XnPagedResult();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 更新公司属性
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/Mini/Company/edit")]
|
|
|
|
|
public async Task Update(UpdateCompanyInput input)
|
|
|
|
|
{
|
|
|
|
|
var entity = input.Adapt<Company>();
|
|
|
|
|
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取公司属性
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/Mini/CompanyDetail")]
|
|
|
|
|
public async Task<Company> Get([FromQuery] QueryeCompanyInput input)
|
|
|
|
|
{
|
|
|
|
|
//获取公司相关的招聘信息
|
|
|
|
|
|
|
|
|
|
return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|