Esempio n. 1
0
        public async Task <object> Get(string signature, string timestamp, string nonce,
                                       string echostr, [FromServices] IKeyValuesEntityService keyValueService)
        {
            if (signature == null || timestamp == null || nonce == null)
            {
                throw new Exception();
            }

            var token = await keyValueService.GetValue(ServerKeys.WxValidateToken.Key);

            if (string.IsNullOrWhiteSpace(token))
            {
                throw new Exception();
            }

            if (!CheckSignature(signature, token, timestamp, nonce))
            {
                throw new Exception();
            }

            if (echostr != null)
            {
                return(echostr);
            }

            throw new NotImplementedException();
        }
Esempio n. 2
0
 public FilesService(IConfiguration configuration,
                     IFilesEntityService service,
                     ITagsEntityService tagsService,
                     IFileContentService contentService,
                     ILoginUserService userService,
                     IKeyValuesEntityService keyValueService,
                     IFileQueryCompileService queryCompiler,
                     IDistributedCache cache)
 {
     _resourcesGroup  = configuration.GetValue <string>("File:Resources");
     _cachesGroup     = configuration.GetValue <string>("File:Caches");
     _service         = service;
     _tagsService     = tagsService;
     _contentService  = contentService;
     _queryCompiler   = queryCompiler;
     _userService     = userService;
     _keyValueService = keyValueService;
     _cache           = cache;
 }
Esempio n. 3
0
 public KeyValuesService(IKeyValuesEntityService service, ILoginUserService userService)
 {
     _service     = service;
     _userService = userService;
 }