1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using System.Collections.Generic;
- using System.Threading.Tasks;
- using GxPress.Entity;
- using GxPress.Repository.Interface;
- using GxPress.Request.RoleGroup;
- using GxPress.Result.RoleGroup;
- using Microsoft.AspNetCore.Authorization;
- using Microsoft.AspNetCore.Mvc;
- namespace GxPress.Api.AdminControllers
- {
-
-
-
- [Route("api/admin/roleGroup")]
- [ApiController]
- [Authorize]
- public class AdminRoleGroupController : ControllerBase
- {
- private readonly IRoleGroupRepository _roleGroupRepository;
- public AdminRoleGroupController(IRoleGroupRepository roleGroupRepository)
- {
- _roleGroupRepository = roleGroupRepository;
- }
-
-
-
-
-
- [HttpPost]
- public async Task<RoleGroup> Add([FromBody] RoleGroupAddRequest request)
- {
- return await _roleGroupRepository.AddAsync(request);
- }
-
-
-
-
-
-
- [HttpPut("{id}")]
- public async Task<bool> Update(int id, [FromBody]RoleGroupAddRequest request)
- {
- return await _roleGroupRepository.UpdateAsync(id, request);
- }
-
-
-
-
- [HttpGet("list")]
- public async Task<List<RoleGroupDetailResult>> GetList()
- {
- return await _roleGroupRepository.GetDetailListAsync();
- }
-
-
-
-
-
- [HttpDelete("id")]
- public async Task<bool> Delete(int id)
- {
- return await _roleGroupRepository.DeleteAsync(id);
- }
- }
- }
|