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(); }
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; }
public KeyValuesService(IKeyValuesEntityService service, ILoginUserService userService) { _service = service; _userService = userService; }