|
|
|
|
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;
|
|
|
|
|
using GDZZ.Core.Service;
|
|
|
|
|
|
|
|
|
|
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("/FeedBack/page")]
|
|
|
|
|
public async Task<dynamic> QueryNoticePageList([FromQuery] NoticeInput input)
|
|
|
|
|
{
|
|
|
|
|
var notices = await _rep.AsQueryable()
|
|
|
|
|
.ToPagedListAsync(input.PageNo, input.PageSize);
|
|
|
|
|
return notices.XnPagedResult();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取意见反馈
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("Mini/GetFeedBackList")]
|
|
|
|
|
public async Task<dynamic> GetFeedBackList()
|
|
|
|
|
{
|
|
|
|
|
return await _rep.AsQueryable()
|
|
|
|
|
.Filter("TenantId", true)
|
|
|
|
|
.Where(x => x.CreatedUserId == UserManager.UserId).ToListAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 添加意见反馈
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="backInput"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("Mini/AddFeedBack")]
|
|
|
|
|
public async Task AddFeedBack(FeedBackInput backInput)
|
|
|
|
|
{
|
|
|
|
|
var entity = backInput.Adapt<FeedBack>();
|
|
|
|
|
await _rep.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 添加意见反馈
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="backInput"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("Mini/UpFeedBack")]
|
|
|
|
|
public async Task UpFeedBack(FeedBackInput backInput)
|
|
|
|
|
{
|
|
|
|
|
var entity = backInput.Adapt<FeedBack>();
|
|
|
|
|
await _rep.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|