74 lines
3.1 KiB
C#
74 lines
3.1 KiB
C#
using Marco.Pms.DataAccess.Data;
|
|
using Marco.Pms.Model.Authentication;
|
|
using Marco.Pms.Model.Dtos.Forum;
|
|
using Marco.Pms.Model.Dtos.Util;
|
|
using Marco.Pms.Model.Industries;
|
|
using Marco.Pms.Model.Utilities;
|
|
using MarcoBMS.Services.Helpers;
|
|
using MarcoBMS.Services.Service;
|
|
using Microsoft.AspNetCore.Identity;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Marco.Pms.Services.Controllers
|
|
{
|
|
[ApiController]
|
|
[Route("api/[controller]")]
|
|
public class ForumController : ControllerBase
|
|
{
|
|
private readonly UserManager<IdentityUser> _userManager;
|
|
private readonly ApplicationDbContext _context;
|
|
private readonly JwtSettings _jwtSettings;
|
|
private readonly RefreshTokenService _refreshTokenService;
|
|
private readonly IEmailSender _emailSender;
|
|
private readonly IConfiguration _configuration;
|
|
private readonly EmployeeHelper _employeeHelper;
|
|
//string tenentId = "1";
|
|
public ForumController(UserManager<IdentityUser> userManager, ApplicationDbContext context, JwtSettings jwtSettings, RefreshTokenService refreshTokenService,
|
|
IEmailSender emailSender, IConfiguration configuration, EmployeeHelper employeeHelper)
|
|
{
|
|
_userManager = userManager;
|
|
_jwtSettings = jwtSettings;
|
|
_refreshTokenService = refreshTokenService;
|
|
_emailSender = emailSender;
|
|
_configuration = configuration;
|
|
_employeeHelper = employeeHelper;
|
|
_context = context;
|
|
}
|
|
|
|
[HttpPost("tickets")]
|
|
public async Task<IActionResult> CreateNewTicket([FromBody] CreateTicketDto createTicketDto)
|
|
{
|
|
return NotFound(ApiResponse<object>.ErrorResponse("Industry not found.", "Industry not found.", 404));
|
|
}
|
|
|
|
[HttpPost("tickets/{id}/comment")]
|
|
public async Task<IActionResult> AddComment([FromBody] AddCommentDto addCommentDto)
|
|
{
|
|
return NotFound(ApiResponse<object>.ErrorResponse("Industry not found.", "Industry not found.", 404));
|
|
}
|
|
|
|
[HttpPost("tickets/{id}/attachments")]
|
|
public async Task<IActionResult> UploadAttachments([FromBody] ForumAttachmentDto forumAttachmentDto)
|
|
{
|
|
return NotFound(ApiResponse<object>.ErrorResponse("Industry not found.", "Industry not found.", 404));
|
|
}
|
|
|
|
[HttpPatch("tickets/{id}/status")]
|
|
public async Task<IActionResult> UpdateTicketStatus([FromBody] InquiryDto inquiryDto)
|
|
{
|
|
return NotFound(ApiResponse<object>.ErrorResponse("Industry not found.", "Industry not found.", 404));
|
|
}
|
|
[HttpGet("tickets/{id}")]
|
|
public async Task<IActionResult> GetTicketDetail(Guid id)
|
|
{
|
|
return NotFound(ApiResponse<object>.ErrorResponse("Industry not found.", "Industry not found.", 404));
|
|
}
|
|
|
|
[HttpGet("tickets")]
|
|
public async Task<IActionResult> ListTickets([FromBody] InquiryDto inquiryDto)
|
|
{
|
|
return NotFound(ApiResponse<object>.ErrorResponse("Industry not found.", "Industry not found.", 404));
|
|
}
|
|
}
|
|
}
|