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,63 @@
using AutoMapper;
using ConstructorApp.BusinessLayer.Abstract;
using ConstructorApp.DtoLayer.CompanyInfoDto;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ConstructorAppApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class CompanyInfoController : ControllerBase
{
private readonly ICompanyInfoService _companyInfoService;
private readonly IMapper _mapper;
public CompanyInfoController(ICompanyInfoService companyInfoService, IMapper mapper)
{
_companyInfoService = companyInfoService;
_mapper = mapper;
}
[HttpGet]
public IActionResult CompanyInfoList()
{
var value = _companyInfoService.TGetListAll();
var result = _mapper.Map<List<ResultCompanyInfoDto>>(value);
return Ok(result);
}
[HttpDelete("{id}")]
public IActionResult DeleteCompanyInfo(int id)
{
var value = _companyInfoService.TGetByID(id);
if (value != null)
{
_companyInfoService.TDelete(value);
return Ok("Hakkımızda Bilgisi Silindi");
}
return NotFound("Hakkımızda Bilgisi Bulunamadı");
}
[HttpPut]
public IActionResult UpdateCompanyInfo(UpdateCompanyInfoDto updateCompanyInfoDto)
{
var value = _mapper.Map<CompanyInfo>(updateCompanyInfoDto);
_companyInfoService.TUpdate(value);
return Ok("Hakkımızda Alanı Güncellendi");
}
[HttpGet("{id}")]
public IActionResult GetCompanyInfo(int id)
{
var value = _companyInfoService.TGetByID(id);
if (value != null)
{
var result = _mapper.Map<ResultCompanyInfoDto>(value);
return Ok(result);
}
return NotFound("Hakkımızda Bilgisi Bulunamadı");
}
}
}

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ı");
}
}
}

View File

@@ -0,0 +1,102 @@
using AutoMapper;
using ConstructorApp.BusinessLayer.Abstract;
using ConstructorApp.DtoLayer.ContactUsDto;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ConstructorAppApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ContactUsController : ControllerBase
{
private readonly IContactUsService _contactUsService;
private readonly IMapper _mapper;
public ContactUsController(IContactUsService contactUsService, IMapper mapper)
{
_contactUsService = contactUsService;
_mapper = mapper;
}
[HttpGet]
public IActionResult ContactUsList()
{
var value = _contactUsService.TGetListAll();
var result = _mapper.Map<List<ResultContactUsDto>>(value);
return Ok(result);
}
[HttpPost]
public async Task<IActionResult> CreateContactUsAsync(CreateContactUsDto createContactUsDto)
{
if (ModelState.IsValid)
{
ContactUs contactus = new ContactUs()
{
NameSurname = createContactUsDto.NameSurname,
Mail = createContactUsDto.Mail,
Phone = createContactUsDto.Phone,
MessageContent = createContactUsDto.MessageContent,
Date = DateTime.Now,
Status = false
};
_contactUsService.TAdd(contactus);
return Ok(new { message = "İletişim Bilgisi Başarılı Bir Şekilde Eklendi" });
}
return BadRequest(ModelState);
}
[HttpDelete("{id}")]
public IActionResult DeleteContactUs(int id)
{
var value = _contactUsService.TGetByID(id);
if (value != null)
{
_contactUsService.TDelete(value);
return Ok("İletişim Bilgisi Silindi");
}
return NotFound("İletişim Bilgisi Bulunamadı");
}
[HttpPut]
public IActionResult UpdateContactUs(UpdateContactUsDto updateContactUsDto)
{
var value = _mapper.Map<ContactUs>(updateContactUsDto);
_contactUsService.TUpdate(value);
return Ok("İletişim Alanı Güncellendi");
}
[HttpGet("{id}")]
public IActionResult GetContactUs(int id)
{
var value = _contactUsService.TGetByID(id);
if (value != null)
{
var result = _mapper.Map<ResultContactUsDto>(value);
return Ok(result);
}
return NotFound("İletişim Bilgisi Bulunamadı");
}
[HttpGet("CountAll")]
public IActionResult CountAll()
{
return Ok(_contactUsService.TCountAll());
}
[HttpGet("CountByStatusPending")]
public IActionResult CountByStatusPending()
{
return Ok(_contactUsService.TCountByStatusPending());
}
[HttpGet("MarkAsRead/{id}")]
public IActionResult MarkAsRead(int id)
{
_contactUsService.TMarkAsRead(id);
return Ok("Gelen Mesaj Okundu");
}
}
}

View File

@@ -0,0 +1,63 @@
using AutoMapper;
using ConstructorApp.BusinessLayer.Abstract;
using ConstructorApp.DtoLayer.FooterDto;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ConstructorAppApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class FooterController : ControllerBase
{
private readonly IFooterService _footerService;
private readonly IMapper _mapper;
public FooterController(IFooterService footerService, IMapper mapper)
{
_footerService = footerService;
_mapper = mapper;
}
[HttpGet]
public IActionResult FooterList()
{
var value = _footerService.TGetListAll();
var result = _mapper.Map<List<ResultFooterDto>>(value);
return Ok(result);
}
[HttpDelete("{id}")]
public IActionResult DeleteFooter(int id)
{
var value = _footerService.TGetByID(id);
if (value != null)
{
_footerService.TDelete(value);
return Ok("Footer Bilgisi Silindi");
}
return NotFound("Footer Bilgisi Bulunamadı");
}
[HttpPut]
public IActionResult UpdateFooter(UpdateFooterDto updateFooterDto)
{
var value = _mapper.Map<Footer>(updateFooterDto);
_footerService.TUpdate(value);
return Ok("Footer Alanı Güncellendi");
}
[HttpGet("{id}")]
public IActionResult GetFooter(int id)
{
var value = _footerService.TGetByID(id);
if (value != null)
{
var result = _mapper.Map<ResultFooterDto>(value);
return Ok(result);
}
return NotFound("Footer Bilgisi Bulunamadı");
}
}
}

View File

@@ -0,0 +1,70 @@
using AutoMapper;
using ConstructorApp.BusinessLayer.Abstract;
using ConstructorApp.DtoLayer.HomeBannerDto;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ConstructorAppApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class HomeBannerController : ControllerBase
{
private readonly IHomeBannerService _homeBannerService;
private readonly IMapper _mapper;
public HomeBannerController(IHomeBannerService homeBannerService, IMapper mapper)
{
_homeBannerService = homeBannerService;
_mapper = mapper;
}
[HttpGet]
public IActionResult HomeBannerList()
{
var value = _homeBannerService.TGetListAll();
var result = _mapper.Map<List<ResultHomeBannerDto>>(value);
return Ok(result);
}
[HttpPost]
public IActionResult CreateHomeBanner(CreateHomeBannerDto createHomeBannerDto)
{
var value = _mapper.Map<HomeBanner>(createHomeBannerDto);
_homeBannerService.TAdd(value);
return Ok("Banner Bilgisi Eklendi");
}
[HttpDelete("{id}")]
public IActionResult DeleteHomeBanner(int id)
{
var value = _homeBannerService.TGetByID(id);
if (value != null)
{
_homeBannerService.TDelete(value);
return Ok("Banner Bilgisi Silindi");
}
return NotFound("Banner Bilgisi Bulunamadı");
}
[HttpPut]
public IActionResult UpdateHomeBanner(UpdateHomeBannerDto updateHomeBannerDto)
{
var value = _mapper.Map<HomeBanner>(updateHomeBannerDto);
_homeBannerService.TUpdate(value);
return Ok("Banner Alanı Güncellendi");
}
[HttpGet("{id}")]
public IActionResult GetHomeBanner(int id)
{
var value = _homeBannerService.TGetByID(id);
if (value != null)
{
var result = _mapper.Map<ResultHomeBannerDto>(value);
return Ok(result);
}
return NotFound("Banner Bilgisi Bulunamadı");
}
}
}

View File

@@ -0,0 +1,118 @@
using AutoMapper;
using ConstructorApp.BusinessLayer.Abstract;
using ConstructorApp.DtoLayer.ProjectDto;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ConstructorAppApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ProjectController : ControllerBase
{
private readonly IProjectService _projectService;
private readonly IMapper _mapper;
public ProjectController(IProjectService projectService, IMapper mapper)
{
_projectService = projectService;
_mapper = mapper;
}
[HttpGet]
public IActionResult ProjectList()
{
var value = _projectService.TGetListAll();
var result = _mapper.Map<List<ResultProjectDto>>(value);
return Ok(result);
}
[HttpPost]
public IActionResult CreateProject(CreateProjectDto createProjectDto)
{
var value = _mapper.Map<Project>(createProjectDto);
_projectService.TAdd(value);
return Ok("Proje Bilgisi Eklendi");
}
[HttpDelete("{id}")]
public IActionResult DeleteProject(int id)
{
var value = _projectService.TGetByID(id);
if (value != null)
{
_projectService.TDelete(value);
return Ok("Proje Bilgisi Silindi");
}
return NotFound("Proje Bilgisi Bulunamadı");
}
[HttpPut]
public IActionResult UpdateProject(UpdateProjectDto updateProjectDto)
{
var value = _mapper.Map<Project>(updateProjectDto);
_projectService.TUpdate(value);
return Ok("Proje Alanı Güncellendi");
}
[HttpGet("{id}")]
public IActionResult GetProject(int id)
{
var value = _projectService.TGetByID(id);
if (value != null)
{
var result = _mapper.Map<ResultProjectDto>(value);
return Ok(result);
}
return NotFound("Proe Bilgisi Bulunamadı");
}
[HttpGet("ProjectStatusActive/{id}")]
public IActionResult ProjectStatusActive(int id)
{
_projectService.TProjectStatusActive(id);
return Ok("Proje Aktif Hale Getirildi");
}
[HttpGet("ProjectStatusPassive/{id}")]
public IActionResult ProjectStatusPassive(int id)
{
_projectService.TProjectStatusPassive(id);
return Ok("Proje Pasif Hale Getirildi");
}
[HttpGet("CountAll")]
public IActionResult CountAll()
{
return Ok(_projectService.TCountAll());
}
[HttpGet("GetBySlug/{slug}")]
public IActionResult GetBySlug(string slug)
{
var project = _projectService.TGetProjectWithImagesBySlug(slug);
if (project == null)
return NotFound();
var dto = new ResultProjectDto
{
ProjectID = project.ProjectID,
Title = project.Title,
CoverUrl = project.CoverUrl,
Date = project.Date,
Location = project.Location,
ShortDescription = project.ShortDescription,
LongDescription = project.LongDescription,
GoogleMapIFrame = project.GoogleMapIFrame,
VideoUrl = project.VideoUrl,
FloorPlanUrl = project.FloorPlanUrl,
IsActive = project.IsActive,
Slug = project.Slug,
ImageUrls = project.ProjectGallery?.Select(g => g.ImageUrl!).ToList()
};
return Ok(dto);
}
}
}

View File

@@ -0,0 +1,77 @@
using AutoMapper;
using ConstructorApp.BusinessLayer.Abstract;
using ConstructorApp.DtoLayer.ProjectGalleryDto;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ConstructorAppApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ProjectGalleryController : ControllerBase
{
private readonly IProjectGalleryService _projectGalleryService;
private readonly IMapper _mapper;
public ProjectGalleryController(IProjectGalleryService projectGalleryService, IMapper mapper)
{
_projectGalleryService = projectGalleryService;
_mapper = mapper;
}
[HttpGet]
public IActionResult ProjectGalleryList()
{
var value = _projectGalleryService.TGetListAll();
var result = _mapper.Map<List<ResultProjectGalleryDto>>(value);
return Ok(result);
}
[HttpPost]
public IActionResult CreateProjectGallery(CreateProjectGalleryDto createProjectGalleryDto)
{
var value = _mapper.Map<ProjectGallery>(createProjectGalleryDto);
_projectGalleryService.TAdd(value);
return Ok("Galeri Bilgisi Eklendi");
}
[HttpDelete("{id}")]
public IActionResult DeleteProjectGallery(int id)
{
var value = _projectGalleryService.TGetByID(id);
if (value != null)
{
_projectGalleryService.TDelete(value);
return Ok("Galeri Bilgisi Silindi");
}
return NotFound("Galeri Bilgisi Bulunamadı");
}
[HttpPut]
public IActionResult UpdateProjectGallery(UpdateProjectGalleryDto updateProjectGalleryDto)
{
var value = _mapper.Map<ProjectGallery>(updateProjectGalleryDto);
_projectGalleryService.TUpdate(value);
return Ok("Galeri Alanı Güncellendi");
}
[HttpGet("{id}")]
public IActionResult GetProjectGallery(int id)
{
var value = _projectGalleryService.TGetByID(id);
if (value != null)
{
var result = _mapper.Map<ResultProjectGalleryDto>(value);
return Ok(result);
}
return NotFound("Galeri Bilgisi Bulunamadı");
}
[HttpGet("GetByProjectId/{projectId}")]
public IActionResult GetImagesByProjectId(int projectId)
{
var images = _projectGalleryService.TGetImagesByProjectId(projectId);
return Ok(images);
}
}
}

View File

@@ -0,0 +1,76 @@
using AutoMapper;
using ConstructorApp.BusinessLayer.Abstract;
using ConstructorApp.DtoLayer.ReferenceDto;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ConstructorAppApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ReferenceController : ControllerBase
{
private readonly IReferenceService _referenceService;
private readonly IMapper _mapper;
public ReferenceController(IReferenceService referenceService, IMapper mapper)
{
_referenceService = referenceService;
_mapper = mapper;
}
[HttpGet]
public IActionResult ReferenceList()
{
var value = _referenceService.TGetListAll();
var result = _mapper.Map<List<ResultReferenceDto>>(value);
return Ok(result);
}
[HttpPost]
public IActionResult CreateReference(CreateReferenceDto createReferenceDto)
{
var value = _mapper.Map<Reference>(createReferenceDto);
_referenceService.TAdd(value);
return Ok("Referans Bilgisi Eklendi");
}
[HttpDelete("{id}")]
public IActionResult DeleteReference(int id)
{
var value = _referenceService.TGetByID(id);
if (value != null)
{
_referenceService.TDelete(value);
return Ok("Referans Bilgisi Silindi");
}
return NotFound("Referans Bilgisi Bulunamadı");
}
[HttpPut]
public IActionResult UpdateReference(UpdateReferenceDto updateReferenceDto)
{
var value = _mapper.Map<Reference>(updateReferenceDto);
_referenceService.TUpdate(value);
return Ok("Referans Alanı Güncellendi");
}
[HttpGet("{id}")]
public IActionResult GetReference(int id)
{
var value = _referenceService.TGetByID(id);
if (value != null)
{
var result = _mapper.Map<ResultReferenceDto>(value);
return Ok(result);
}
return NotFound("Referans Bilgisi Bulunamadı");
}
[HttpGet("CountAll")]
public IActionResult CountAll()
{
return Ok(_referenceService.TCountAll());
}
}
}

View File

@@ -0,0 +1,77 @@
using AutoMapper;
using ConstructorApp.BusinessLayer.Abstract;
using ConstructorApp.DtoLayer.ServiceDto;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ConstructorAppApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ServiceController : ControllerBase
{
private readonly IServiceService _serviceService;
private readonly IMapper _mapper;
public ServiceController(IServiceService serviceService, IMapper mapper)
{
_serviceService = serviceService;
_mapper = mapper;
}
[HttpGet]
public IActionResult ServiceList()
{
var value = _serviceService.TGetListAll();
var result = _mapper.Map<List<ResultServiceDto>>(value);
return Ok(result);
}
[HttpDelete("{id}")]
public IActionResult DeleteService(int id)
{
var value = _serviceService.TGetByID(id);
if (value != null)
{
_serviceService.TDelete(value);
return Ok("Hizmet Bilgisi Silindi");
}
return NotFound("Hizmet Bilgisi Bulunamadı");
}
[HttpPut]
public IActionResult UpdateService(UpdateServiceDto updateServiceDto)
{
var value = _mapper.Map<Service>(updateServiceDto);
_serviceService.TUpdate(value);
return Ok("Hizmet Alanı Güncellendi");
}
[HttpGet("{id}")]
public IActionResult GetService(int id)
{
var value = _serviceService.TGetByID(id);
if (value != null)
{
var result = _mapper.Map<ResultServiceDto>(value);
return Ok(result);
}
return NotFound("Hizmet Bilgisi Bulunamadı");
}
[HttpGet("ServiceStatusActive/{id}")]
public IActionResult ServiceStatusActive(int id)
{
_serviceService.TServiceStatusActive(id);
return Ok("Servis Aktif Hale Getirildi");
}
[HttpGet("ServiceStatusPassive/{id}")]
public IActionResult ServiceStatusPassive(int id)
{
_serviceService.TServiceStatusPassive(id);
return Ok("Servis Pasif Hale Getirildi");
}
}
}

View File

@@ -0,0 +1,70 @@
using AutoMapper;
using ConstructorApp.BusinessLayer.Abstract;
using ConstructorApp.DtoLayer.SliderDto;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ConstructorAppApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class SliderController : ControllerBase
{
private readonly ISliderService _sliderService;
private readonly IMapper _mapper;
public SliderController(ISliderService sliderService, IMapper mapper)
{
_sliderService = sliderService;
_mapper = mapper;
}
[HttpGet]
public IActionResult SliderList()
{
var value = _sliderService.TGetListAll();
var result = _mapper.Map<List<ResultSliderDto>>(value);
return Ok(result);
}
[HttpPost]
public IActionResult CreateSlider(CreateSliderDto createSliderDto)
{
var value = _mapper.Map<Slider>(createSliderDto);
_sliderService.TAdd(value);
return Ok("Slider Bilgisi Eklendi");
}
[HttpDelete("{id}")]
public IActionResult DeleteSlider(int id)
{
var value = _sliderService.TGetByID(id);
if (value != null)
{
_sliderService.TDelete(value);
return Ok("Slider Bilgisi Silindi");
}
return NotFound("Slider Bilgisi Bulunamadı");
}
[HttpPut]
public IActionResult UpdateSlider(UpdateSliderDto updateSliderDto)
{
var value = _mapper.Map<Slider>(updateSliderDto);
_sliderService.TUpdate(value);
return Ok("Slider Alanı Güncellendi");
}
[HttpGet("{id}")]
public IActionResult GetSlider(int id)
{
var value = _sliderService.TGetByID(id);
if (value != null)
{
var result = _mapper.Map<ResultSliderDto>(value);
return Ok(result);
}
return NotFound("Slider Bilgisi Bulunamadı");
}
}
}

View File

@@ -0,0 +1,70 @@
using AutoMapper;
using ConstructorApp.BusinessLayer.Abstract;
using ConstructorApp.DtoLayer.TeamDto;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ConstructorAppApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class TeamController : ControllerBase
{
private readonly ITeamService _teamService;
private readonly IMapper _mapper;
public TeamController(ITeamService teamService, IMapper mapper)
{
_teamService = teamService;
_mapper = mapper;
}
[HttpGet]
public IActionResult TeamList()
{
var value = _teamService.TGetListAll();
var result = _mapper.Map<List<ResultTeamDto>>(value);
return Ok(result);
}
[HttpPost]
public IActionResult CreateTeam(CreateTeamDto createTeamDto)
{
var value = _mapper.Map<Team>(createTeamDto);
_teamService.TAdd(value);
return Ok("Team Bilgisi Eklendi");
}
[HttpDelete("{id}")]
public IActionResult DeleteTeam(int id)
{
var value = _teamService.TGetByID(id);
if (value != null)
{
_teamService.TDelete(value);
return Ok("Team Bilgisi Silindi");
}
return NotFound("Team Bilgisi Bulunamadı");
}
[HttpPut]
public IActionResult UpdateTeam(UpdateTeamDto updateTeamDto)
{
var value = _mapper.Map<Team>(updateTeamDto);
_teamService.TUpdate(value);
return Ok("Team Alanı Güncellendi");
}
[HttpGet("{id}")]
public IActionResult GetTeam(int id)
{
var value = _teamService.TGetByID(id);
if (value != null)
{
var result = _mapper.Map<ResultTeamDto>(value);
return Ok(result);
}
return NotFound("Team Bilgisi Bulunamadı");
}
}
}

View File

@@ -0,0 +1,90 @@
using AutoMapper;
using ConstructorApp.BusinessLayer.Abstract;
using ConstructorApp.DtoLayer.TestimonialDto;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ConstructorAppApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class TestimonialController : ControllerBase
{
private readonly ITestimonialService _testimonialService;
private readonly IMapper _mapper;
public TestimonialController(ITestimonialService testimonialService, IMapper mapper)
{
_testimonialService = testimonialService;
_mapper = mapper;
}
[HttpGet]
public IActionResult TestimonialList()
{
var value = _testimonialService.TGetListAll();
var result = _mapper.Map<List<ResultTestimonialDto>>(value);
return Ok(result);
}
[HttpPost]
public IActionResult CreateTestimonial(CreateTestimonialDto createTestimonialDto)
{
var value = _mapper.Map<Testimonial>(createTestimonialDto);
_testimonialService.TAdd(value);
return Ok("Yorum Bilgisi Eklendi");
}
[HttpDelete("{id}")]
public IActionResult DeleteTestimonial(int id)
{
var value = _testimonialService.TGetByID(id);
if (value != null)
{
_testimonialService.TDelete(value);
return Ok("Yorum Bilgisi Silindi");
}
return NotFound("Yorum Bilgisi Bulunamadı");
}
[HttpPut]
public IActionResult UpdateTestimonial(UpdateTestimonialDto updateTestimonialDto)
{
var value = _mapper.Map<Testimonial>(updateTestimonialDto);
_testimonialService.TUpdate(value);
return Ok("Yorum Alanı Güncellendi");
}
[HttpGet("{id}")]
public IActionResult GetTestimonial(int id)
{
var value = _testimonialService.TGetByID(id);
if (value != null)
{
var result = _mapper.Map<ResultTestimonialDto>(value);
return Ok(result);
}
return NotFound("Yorum Bilgisi Bulunamadı");
}
[HttpGet("TestimonialStatusActive/{id}")]
public IActionResult TestimonialStatusActive(int id)
{
_testimonialService.TTestimonialStatusActive(id);
return Ok("Ürün Kategorisi Aktif Hale Getirildi");
}
[HttpGet("TestimonialStatusPassive/{id}")]
public IActionResult TestimonialStatusPassive(int id)
{
_testimonialService.TTestimonialStatusPassive(id);
return Ok("Ürün Kategorisi Pasif Hale Getirildi");
}
[HttpGet("CountAll")]
public IActionResult CountAll()
{
return Ok(_testimonialService.TCountAll());
}
}
}

View File

@@ -0,0 +1,77 @@
using AutoMapper;
using ConstructorApp.BusinessLayer.Abstract;
using ConstructorApp.DtoLayer.WorkProcessDto;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ConstructorAppApi.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class WorkProcessController : ControllerBase
{
private readonly IWorkProcessService _workProcessService;
private readonly IMapper _mapper;
public WorkProcessController(IWorkProcessService workProcessService, IMapper mapper)
{
_workProcessService = workProcessService;
_mapper = mapper;
}
[HttpGet]
public IActionResult WorkProcessList()
{
var value = _workProcessService.TGetListAll();
var result = _mapper.Map<List<ResultWorkProcessDto>>(value);
return Ok(result);
}
[HttpDelete("{id}")]
public IActionResult DeleteWorkProcess(int id)
{
var value = _workProcessService.TGetByID(id);
if (value != null)
{
_workProcessService.TDelete(value);
return Ok("Çalışma Şekli Bilgisi Silindi");
}
return NotFound("Çalışma Şekli Bilgisi Bulunamadı");
}
[HttpPut]
public IActionResult UpdateWorkProcess(UpdateWorkProcessDto updateWorkProcessDto)
{
var value = _mapper.Map<WorkProcess>(updateWorkProcessDto);
_workProcessService.TUpdate(value);
return Ok("Çalışma Şekli Bilgisi Güncellendi");
}
[HttpGet("{id}")]
public IActionResult GetWorkProcess(int id)
{
var value = _workProcessService.TGetByID(id);
if (value != null)
{
var result = _mapper.Map<ResultWorkProcessDto>(value);
return Ok(result);
}
return NotFound("Çalışma Şekli Bilgisi Bulunamadı");
}
[HttpGet("ServiceStatusActive/{id}")]
public IActionResult ServiceStatusActive(int id)
{
_workProcessService.TServiceStatusActive(id);
return Ok("Çalışma Şekli Aktif Hale Getirildi");
}
[HttpGet("ServiceStatusPassive/{id}")]
public IActionResult ServiceStatusPassive(int id)
{
_workProcessService.TServiceStatusPassive(id);
return Ok("Çalışma Şekli Pasif Hale Getirildi");
}
}
}