Add project files.

This commit is contained in:
2025-05-01 15:18:30 +03:00
parent e058ab8015
commit 774d695414
3094 changed files with 1336814 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
using AutoMapper;
using ConstructorApp.BusinessLayer.Abstract;
using ConstructorApp.DtoLayer.CompanyInfoVideoDto;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ConstructorAppApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class CompanyInfoVideoController : ControllerBase
{
private readonly ICompanyInfoVideoService _companyInfoVideoService;
private readonly IMapper _mapper;
public CompanyInfoVideoController(ICompanyInfoVideoService companyInfoVideoService, IMapper mapper)
{
_companyInfoVideoService = companyInfoVideoService;
_mapper = mapper;
}
[HttpGet]
public IActionResult CompanyInfoVideoList()
{
var value = _companyInfoVideoService.TGetListAll();
var result = _mapper.Map<List<ResultCompanyInfoVideoDto>>(value);
return Ok(result);
}
[HttpDelete("{id}")]
public IActionResult DeleteCompanyInfoVideo(int id)
{
var value = _companyInfoVideoService.TGetByID(id);
if (value != null)
{
_companyInfoVideoService.TDelete(value);
return Ok("Hakkımızda Video Bilgisi Silindi");
}
return NotFound("Hakkımızda Video Bilgisi Bulunamadı");
}
[HttpPut]
public IActionResult UpdateCompanyInfoVideo(UpdateCompanyInfoVideoDto updateCompanyInfoVideoDto)
{
var value = _mapper.Map<CompanyInfoVideo>(updateCompanyInfoVideoDto);
_companyInfoVideoService.TUpdate(value);
return Ok("Hakkımızda Video Güncellendi");
}
[HttpGet("{id}")]
public IActionResult GetCompanyInfoVideo(int id)
{
var value = _companyInfoVideoService.TGetByID(id);
if (value != null)
{
var result = _mapper.Map<ResultCompanyInfoVideoDto>(value);
return Ok(result);
}
return NotFound("Hakkımızda Video Bilgisi Bulunamadı");
}
}
}