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;
using System.Collections.Generic;
using System;
namespace GDZZ.Application
{
///
/// 意见反馈服务
///
[ApiDescriptionSettings("Application",Name = "FeedBack", Order = 1)]
public class FeedBackService : IFeedBackService, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository _rep;
public FeedBackService(SqlSugarRepository rep)
{
_rep = rep;
}
///
/// 获取意见反馈
///
///
///
[HttpGet("MiniResume/FeedBack/list")]
public async Task GetList()
{
return await _rep.AsQueryable()
.Filter("TenantId", true)
.Where(x => x.CreatedUserId == UserManager.UserId).ToListAsync();
}
///
/// 获取意见反馈
///
///
///
[HttpPost("MiniResume/FeedBack/Add")]
public async Task Add(FeedBackInput backInput)
{
backInput.TenantId =long.Parse(UserManager.TenantID);
var entity = backInput.Adapt();
await _rep.InsertAsync(entity);
}
}
}