using Microsoft.AspNetCore.Mvc; namespace zero.Api.Endpoints.Translations; public class TranslationsController : ZeroApiEntityStoreController { public TranslationsController(ITranslationStore store) : base(store) { } [HttpGet("empty")] [ZeroAuthorize(TranslationPermissions.Create)] public virtual Task> Empty(string flavor = null) => EmptyModel(flavor); [HttpGet("{id}")] [ZeroAuthorize(TranslationPermissions.Read)] public virtual Task> Get(string id, string changeVector = null) => GetModel(id, changeVector); [HttpGet("")] [ZeroAuthorize(TranslationPermissions.Read)] public virtual Task> Get([FromQuery] ListQuery query) { query.SearchFor(x => x.Key, x => x.Value); return GetModelsByIndex(query); } [HttpPost("")] [ZeroAuthorize(TranslationPermissions.Create)] public virtual Task> Create(Translation saveModel) => CreateModel(saveModel); [HttpPut("{id}")] [ZeroAuthorize(TranslationPermissions.Update)] public virtual Task> Update(string id, Translation updateModel, [FromQuery] string changeToken = null) => UpdateModel(id, updateModel, changeToken); [HttpDelete("{id}")] [ZeroAuthorize(TranslationPermissions.Delete)] public virtual Task> Delete(string id) => DeleteModel(id); }