12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using System.Collections.Generic;
- using System.Threading.Tasks;
- using GxPress.Repository.Interface;
- using GxPress.Request.Role;
- using GxPress.Result.Role;
- using Microsoft.AspNetCore.Authorization;
- using Microsoft.AspNetCore.Mvc;
- namespace GxPress.Api.AdminControllers
- {
-
-
-
- [Route("api/admin/role")]
- [ApiController]
- [Authorize]
- public class AdminRoleController : ControllerBase
- {
- private readonly IRoleRepository _roleRepository;
- public AdminRoleController(IRoleRepository roleRepository)
- {
- _roleRepository = roleRepository;
- }
-
-
-
-
-
- [HttpPost]
- public async Task<RoleDetailResult> Add(RoleAddRequest request)
- {
- return await _roleRepository.AddAsync(request);
- }
-
-
-
-
-
- [HttpDelete("{id}")]
- public async Task<bool> Delete(int id)
- {
- return await _roleRepository.DeleteAsync(id);
- }
-
-
-
-
-
-
- [HttpPut("{id}")]
- public async Task<bool> Update(int id, [FromBody]RoleAddRequest request)
- {
- return await _roleRepository.UpdateAsync(id, request);
- }
-
-
-
-
-
- [HttpGet("{id}")]
- public async Task<RoleDetailResult> GetDetail(int id)
- {
- return await _roleRepository.GetDetailAsync(id);
- }
-
-
-
-
-
- [HttpGet("list")]
- public async Task<List<RoleDetailResult>> GetList(int groupId)
- {
- return await _roleRepository.GetDetailListAsync(groupId);
- }
- }
- }
|