public MotivoDespidoModuleQueryMovil(ISerializeJsonRequest serializerJson, Func <string, IEncrytRequestProvider> encryptRequestProvider,
                                             ITokenizer tokenizer, IMotivoDespidoRepositoryReadOnly readOnlyRepository)
        {
            Post["/movil/motivosDespido"] = parameters =>
            {
                var movilRequest = this.Bind <MovilRequest>();
                var userId       = tokenizer.Detokenize(movilRequest.token, Context);
                if (userId == null)
                {
                    return(new Response().WithStatusCode(HttpStatusCode.Unauthorized));
                }
                var motivos = readOnlyRepository.getAll();

                var motivosString       = serializerJson.toJson(motivos);
                var respuestaEncryptada = encryptRequestProvider(movilRequest.token).encryptString(motivosString);

                return(respuestaEncryptada);
            };
        }
Esempio n. 2
0
 public CommandUpdateMotivoDespido(IMotivoDespidoRepositoryReadOnly repositoryRead,
                                   IRepositoryCommands <MotivoDespido> repository, Func <IUnitOfWork> unitOfWork) : base(repository, unitOfWork)
 {
     _repositoryRead = repositoryRead;
 }
 public MotivoDespidoModuleQuery(IMotivoDespidoRepositoryReadOnly readOnlyRepository)
 {
     Get["/enterprise/motivoDespido"] = parameters => Response.AsJson(readOnlyRepository.getAll());
 }