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.

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