小编For*_*man的帖子

JSON.net反序列化对象嵌套数据

我正在使用SwiftType Elastic Search + C#并遇到反序列化响应的问题,原因是SwiftType将所有字段作为具有raw属性的对象返回为对象(https://swiftype.com/documentation/app-search/api / search),例如:

{
  "meta": {
    "warnings": [],
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 2,
      "size": 10
    },
    "request_id": "6887a53f701a59574a0f3a7012e01aa8"
  },
  "results": [
    {
      "phone": {
        "raw": 3148304280.0
      },
      "accounts_balance_ach": {
        "raw": 27068128.71
      },
      "accounts_balance_pending": {
        "raw": "46809195.64"
      },
      "email": {
        "raw": "Brisa34@hotmail.com"
      },
      "accounts_count": {
        "raw": 6.0
      },
      "id": {
        "raw": "c98808a2-d7d6-4444-834d-2fe4f6858f6b"
      },
      "display_name": {
        "raw": "The Johnstons"
      },
      "type": {
        "raw": "Couple"
      },
      "advisor_email": {
        "raw": "Cornelius_Schiller14@hotmail.com"
      },
      "created_at": …
Run Code Online (Sandbox Code Playgroud)

c# json json.net elasticsearch app-search

8
推荐指数
2
解决办法
2505
查看次数

在iphone上的bootstrap响应式设计中的页面宽度

我有一个自举响应式设计,适用于各种浏览器,但iPhone的页面宽度有限.我已经添加了视口元标记:

<meta name ="viewport"content ="width = device-width,initial-scale = 1,maximum-scale = 1">

它似乎没有帮助.该网站在这里:http://themenuengine.com.任何建议将不胜感激!

css iphone responsive-design twitter-bootstrap

6
推荐指数
1
解决办法
9609
查看次数

Angular Storybook 组件是两个模块错误的一部分

我正在使用 Storybook 测试一些共享组件上的 UI,并遇到一个错误,似乎 Storybook 正在将组件加载到 DynamicModule 中,导致以下错误:

Type DigFinderComponent is part of the declarations of 2 modules: DigFinderModule and DynamicModule! Please consider moving DigFinderComponent to a higher module that imports DigFinderModule and DynamicModule. You can also create a new NgModule that exports and includes DigFinderComponent then import that NgModule in DigFinderModule and DynamicModule.
Run Code Online (Sandbox Code Playgroud)

DigFinder 组件绝对只在其模块中声明:

Type DigFinderComponent is part of the declarations of 2 modules: DigFinderModule and DynamicModule! Please consider moving DigFinderComponent to a higher module that imports DigFinderModule …
Run Code Online (Sandbox Code Playgroud)

typescript angular storybook

6
推荐指数
2
解决办法
3725
查看次数

C# / OSX 与内存数据库

我正在 Mac 上开发基于 C# 的 API,当我尝试按照本教程在启动/配置功能中访问 DbContext 时,.net 崩溃: https: //stormpath.com/blog/tutorial-entity-framework-core-in -内存数据库-asp-net-core

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddCors();
        services.AddDbContext<ApiContext>(opt => opt.UseInMemoryDatabase());
        services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

        // configure strongly typed settings objects
        var appSettingsSection = Configuration.GetSection("AppSettings");
        services.Configure<AppSettings>(appSettingsSection);

        // configure jwt authentication
        var appSettings = appSettingsSection.Get<AppSettings>();
        var key = Encoding.ASCII.GetBytes(appSettings.Secret);
        services.AddAuthentication(x =>
        {
            x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
            x.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
        })
        .AddJwtBearer(x =>
        {
            x.RequireHttpsMetadata = false;
            x.SaveToken = true;
            x.TokenValidationParameters = new TokenValidationParameters
            {
                ValidateIssuerSigningKey = true,
                IssuerSigningKey = new SymmetricSecurityKey(key),
                ValidateIssuer = false,
                ValidateAudience …
Run Code Online (Sandbox Code Playgroud)

c# dbcontext entity-framework-core

5
推荐指数
1
解决办法
372
查看次数

是否有响应代码可将 Google Cloud 任务标记为永久失败,以便它不会重试?

我有一个 Firebase HTTPS 函数,可以发送定时消息并由 Google Cloud Tasks 触发。

根据 Cloud Tasks 文档,任何超出 200 范围的响应代码都将被视为失败,并将触发重试。

此功能需要扩展到每日数百万条消息,因此我们需要避免重试永久失败的消息(用户选择退出等)。

注意:这在此示例中尤其重要,因为每个任务都需要在处理之前查找最新信息,从而为每次尝试添加 2-10 个 Firestore 读取。我们无法在有效负载中发送此信息,因为它可能在消息排队和处理之间发生变化。

使用云任务 API 删除任务很容易,但我想知道是否有任何 HTTP 响应代码(或标头)可以将这些任务标记为永久失败(例如 400 错误请求)并且不重试它们。

google-cloud-functions google-cloud-firestore google-cloud-tasks

2
推荐指数
1
解决办法
2047
查看次数