<commit_before>﻿using Aritter.Application.DTO.SecurityModule.Authentication;
using Aritter.Application.DTO.SecurityModule.Users;
using Aritter.Application.Seedwork.Services.SecurityModule;
using Aritter.Infra.Crosscutting.Security;
using Aritter.Infra.Web.Security;
using System.Threading.Tasks;
using System.Web.Http;

namespace Aritter.API.Controllers
{
    [RoutePrefix("api/v1")]
    public class UsersController : DefaultApiController
    {
        private IUserAppService userAppService;

        public UsersController(IUserAppService userAppService)
        {
            this.userAppService = userAppService;
        }

        [HttpGet]
        [Route("users/{id:int}")]
        [Authorization("Users", Rule.Read)]
        public async Task<IHttpActionResult> GetById(int id)
        {
            return await Task.Run(() => Success(new UserDto()));
        }

        [HttpGet]
        [Route("users/{username}")]
        [Authorization("Users", Rule.Read)]
        public async Task<IHttpActionResult> GetByUsername(string username)
        {
            return await Task.Run(() => Success(new UserDto()));
        }

        [HttpGet]
        [Route("users/{id:int}/profile")]
        [Authorization("Users", Rule.Read)]
        public async Task<IHttpActionResult> GetProfile(int id)
        {
            return await Task.Run(() => Success((UserDto)null));
        }

        [HttpPost]
        [Route("users")]
        [Authorization("Users", Rule.Write)]
        public async Task<IHttpActionResult> Post([FromBody]AddUserDto user)
        {
            return await Task.Run(() => Success(userAppService.CreateUser(user)));
        }
    }
}<commit_msg>fix UsersControllers<commit_after>﻿using Aritter.Application.DTO.SecurityModule.Authentication;
using Aritter.Application.DTO.SecurityModule.Users;
using Aritter.Application.Seedwork.Services.SecurityModule;
using Aritter.Infra.Crosscutting.Security;
using Aritter.Infra.Web.Security;
using System.Threading.Tasks;
using System.Web.Http;

namespace Aritter.API.Controllers
{
    [RoutePrefix("api/v1")]
    public class UsersController : DefaultApiController
    {
        private IUserAppService userAppService;

        public UsersController(IUserAppService userAppService)
        {
            this.userAppService = userAppService;
        }

        [HttpGet]
        [Route("users/{id:int}")]
        [Authorization("Security", Rule.Read)]
        public async Task<IHttpActionResult> GetById(int id)
        {
            return await Task.Run(() => Success(new UserDto()));
        }

        [HttpGet]
        [Route("users/{username}")]
        [Authorization("Security", Rule.Read)]
        public async Task<IHttpActionResult> GetByUsername(string username)
        {
            return await Task.Run(() => Success(new UserDto()));
        }

        [HttpGet]
        [Route("users/{id:int}/profile")]
        [Authorization("Security", Rule.Read)]
        public async Task<IHttpActionResult> GetProfile(int id)
        {
            return await Task.Run(() => Success((UserDto)null));
        }

        [HttpPost]
        [Route("users")]
        [Authorization("Security", Rule.Write)]
        public async Task<IHttpActionResult> Post([FromBody]AddUserDto user)
        {
            return await Task.Run(() => Success(userAppService.CreateUser(user)));
        }
    }
}
{'fraction_non_alphanumeric': 0.12236412236412236, 'fraction_numerical': 0.000594000594000594, 'mean_word_length': 2.7589285714285716, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4663076', 'n_tokens_mistral': 928, 'n_tokens_neox': 939, 'n_words': 167}