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.
100 lines
3.4 KiB
100 lines
3.4 KiB
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 = "JobhuntMessage", Order = 1)]
|
|
public class JobhuntMessageService : IJobhuntMessageService, IDynamicApiController, ITransient
|
|
{
|
|
private readonly SqlSugarRepository<JobhuntMessage> _rep;
|
|
|
|
public JobhuntMessageService(SqlSugarRepository<JobhuntMessage> rep)
|
|
{
|
|
_rep = rep;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 分页查询求职信息
|
|
/// </summary>
|
|
/// <param name="input"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("/JobhuntMessage/page")]
|
|
public async Task<dynamic> Page([FromQuery] JobhuntMessageInput input)
|
|
{
|
|
var entities = await _rep.AsQueryable()
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PositionInfo), u => u.PositionInfo == input.PositionInfo)
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Title), u => u.Title == input.Title)
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Tag), u => u.Tag == input.Tag)
|
|
.ToPagedListAsync(input.PageNo, input.PageSize);
|
|
return entities.XnPagedResult();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 增加求职信息
|
|
/// </summary>
|
|
/// <param name="input"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("/JobhuntMessage/add")]
|
|
public async Task Add(AddJobhuntMessageInput input)
|
|
{
|
|
var entity = input.Adapt<JobhuntMessage>();
|
|
await _rep.InsertAsync(entity);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除求职信息
|
|
/// </summary>
|
|
/// <param name="input"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("/JobhuntMessage/delete")]
|
|
public async Task Delete(DeleteJobhuntMessageInput input)
|
|
{
|
|
var entity = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
|
|
await _rep.DeleteAsync(entity);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新求职信息
|
|
/// </summary>
|
|
/// <param name="input"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("/JobhuntMessage/edit")]
|
|
public async Task Update(UpdateJobhuntMessageInput input)
|
|
{
|
|
var entity = input.Adapt<JobhuntMessage>();
|
|
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns:true).ExecuteCommandAsync();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取求职信息
|
|
/// </summary>
|
|
/// <param name="input"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("/JobhuntMessage/detail")]
|
|
public async Task<JobhuntMessage> Get([FromQuery] QueryeJobhuntMessageInput input)
|
|
{
|
|
return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取求职信息列表
|
|
/// </summary>
|
|
/// <param name="input"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("/JobhuntMessage/list")]
|
|
public async Task<dynamic> List([FromQuery] JobhuntMessageInput input)
|
|
{
|
|
return await _rep.ToListAsync();
|
|
}
|
|
}
|
|
}
|