1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System.Threading.Tasks;
- using GxPress.Auth;
- using GxPress.Common.Page;
- using GxPress.Repository.Interface;
- using GxPress.Request.App.ChatRecord;
- using GxPress.Result.App.ChatRecord;
- using Microsoft.AspNetCore.Authorization;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.Extensions.Logging;
- namespace GxPress.Api.AppControllers
- {
-
-
-
- [Route("api/app/chat-record")]
- [ApiController]
- [Authorize]
- public class ChatRecordController : ControllerBase
- {
- private readonly ILogger<AppVersionController> _logger;
- private readonly IChatRecordRepository _chatRecordRepository;
- private readonly ILoginContext _loginContext;
- public ChatRecordController(ILogger<AppVersionController> logger, IChatRecordRepository chatRecordRepository,ILoginContext loginContext)
- {
- _logger = logger;
- _chatRecordRepository = chatRecordRepository;
- _loginContext = loginContext;
- }
-
-
-
-
-
- [HttpPost("add")]
- public async Task<bool> Insert(ChatRecordInRequest request)
- {
- request.SendUserId = _loginContext.AccountId;
- return await _chatRecordRepository.InsertAsync(request);
- }
-
-
-
-
-
- [HttpPost("history")]
- public async Task<PagedList<ChatRecordSearchHistoryResult>> SearchChatRecordHistoryAsync(ChatRecordSearchHistoryRequest request)
- {
- request.UserId = _loginContext.AccountId;
- return await _chatRecordRepository.SearchChatRecordHistoryAsync(request);
- }
- }
- }
|