123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- using Admin.Core.Common.Input;
- using Admin.Core.Common.Output;
- using Admin.Core.Model.Admin;
- using Admin.Core.Service.Admin.Api;
- using Admin.Core.Service.Admin.Api.Input;
- using Microsoft.AspNetCore.Mvc;
- using System.Threading.Tasks;
- namespace Admin.Core.Controllers.Admin
- {
-
-
-
- public class ApiController : AreaController
- {
- private readonly IApiService _apiService;
- public ApiController(IApiService apiService)
- {
- _apiService = apiService;
- }
-
-
-
-
-
- [HttpGet]
- public async Task<IResponseOutput> Get(long id)
- {
- return await _apiService.GetAsync(id);
- }
-
-
-
-
-
- [HttpGet]
- public async Task<IResponseOutput> GetList(string key)
- {
- return await _apiService.ListAsync(key);
- }
-
-
-
-
-
- [HttpPost]
- public async Task<IResponseOutput> GetPage(PageInput<ApiEntity> model)
- {
- return await _apiService.PageAsync(model);
- }
-
-
-
-
-
- [HttpPost]
- public async Task<IResponseOutput> Add(ApiAddInput input)
- {
- return await _apiService.AddAsync(input);
- }
-
-
-
-
-
- [HttpPut]
- public async Task<IResponseOutput> Update(ApiUpdateInput input)
- {
- return await _apiService.UpdateAsync(input);
- }
-
-
-
-
-
- [HttpDelete]
- public async Task<IResponseOutput> SoftDelete(long id)
- {
- return await _apiService.SoftDeleteAsync(id);
- }
-
-
-
-
-
- [HttpPut]
- public async Task<IResponseOutput> BatchSoftDelete(long[] ids)
- {
- return await _apiService.BatchSoftDeleteAsync(ids);
- }
-
-
-
-
-
-
-
- [HttpPost]
- public async Task<IResponseOutput> Sync(ApiSyncInput input)
- {
- return await _apiService.SyncAsync(input);
- }
- }
- }
|