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("Mini/GetFeedBackList")] public async Task GetFeedBackList() { return await _rep.AsQueryable() .Filter("TenantId", true) .Where(x => x.CreatedUserId == UserManager.UserId).ToListAsync(); } /// /// 获取意见反馈 /// /// /// [HttpPost("Mini/AddFeedBack")] public async Task AddFeedBack(FeedBackInput backInput) { backInput.TenantId =long.Parse(UserManager.TenantID); var entity = backInput.Adapt(); await _rep.InsertAsync(entity); } } }