32 lines
683 B
C#
32 lines
683 B
C#
using Diary.Component.Entries.Service;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Diary.Component.Entries
|
|
{
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
public class EntriesController:ControllerBase
|
|
{
|
|
private readonly IEntryService _entryService;
|
|
|
|
public EntriesController(IEntryService entryService)
|
|
{
|
|
_entryService = entryService ?? throw new ArgumentNullException(nameof(entryService));
|
|
}
|
|
|
|
|
|
|
|
[HttpPost]
|
|
public async Task<EntryResource> CreateEntryAsync(CreateEntryResource create)
|
|
{
|
|
return await _entryService.CreateAsync(create);
|
|
}
|
|
|
|
}
|
|
}
|