32 lines
		
	
	
		
			833 B
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			32 lines
		
	
	
		
			833 B
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using langguanApi.Model.Dto.SystemConfigurationDto;
							 | 
						|||
| 
								 | 
							
								using langguanApi.Service;
							 | 
						|||
| 
								 | 
							
								using Microsoft.AspNetCore.Mvc;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace langguanApi.Controllers
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    /// <summary>
							 | 
						|||
| 
								 | 
							
								    /// 角色
							 | 
						|||
| 
								 | 
							
								    /// </summary>
							 | 
						|||
| 
								 | 
							
								    [Route("api/[controller]")]
							 | 
						|||
| 
								 | 
							
								    [ApiController]
							 | 
						|||
| 
								 | 
							
								    public class RoleController : ControllerBase
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        private RoleService _roleService;
							 | 
						|||
| 
								 | 
							
								        public RoleController(RoleService roleService)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            _roleService = roleService;
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        ///新增角色
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="input"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        [HttpPost("AddRole")]
							 | 
						|||
| 
								 | 
							
								        public async Task<IActionResult> AddRole([FromBody] RoleDto input)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            var result = await _roleService.AddRole(input);
							 | 
						|||
| 
								 | 
							
								            return Ok(result);
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |