小编Nir*_*mal的帖子

InfluxDB - 基于标签在 where 子句中包含多个值

我正在尝试根据标签值查询数据。是否可以在 where 子句中包含多个查询。我在 SQL 中找不到类似于 IN 运算符的运算符。

select * from students where rollNumber='1' limit 10

student 是测量值,rollNumber 是一个标签。我想在查询中包含多个 rollNumber 值。

有什么建议可以解决问题吗?

influxdb

7
推荐指数
1
解决办法
5957
查看次数

Angular 2 CLI-部署到github用户页面显示自述页面

我已经通过angular CLI将angular 2项目部署到了​​github用户页面。我尝试了从angular 2 cli页面开始的步骤。但是,当我尝试访问github url时,它会显示自述文件的内容。用户页面和用户页面/ baseUrl都执行相同的操作。

我使用的路由在本地环境中有效。我不确定是否应该修改生产环境变量或baseUrl。

链接到存储库:https : //github.com/nirmalks/nirmalks.github.io

github-pages angular-cli angular

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

Spring Boot Kotlin API 为所有端点返回 404 响应

我将 Spring Boot 与 Kotlin 结合使用。其余控制器为所有端点返回 404 错误。在启动日志中,控制器中的端点不存在。任何端点都会返回相同的 404 响应。

这些是我尝试过的步骤,

  1. 尝试清除缓存/目标
  2. 将所有类移至单个目录中
  3. 尝试添加 ComponentScan 注释,但不被接受。
  4. 我正在使用 cmd 行来运行该项目
  5. 运行 java -jar $jarfile 时看到的输出相同
  6. 检查注释 Repository , Service , RestController

控制器:

package com.example.controller

import org.springframework.web.bind.annotation.RestController
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.http.HttpStatus
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.PutMapping
import org.springframework.web.bind.annotation.DeleteMapping
import org.springframework.web.bind.annotation.RequestBody

import Cricketer
import CricketerRepository
import CricketerService
import org.springframework.web.bind.annotation.RequestMapping

@RestController
@RequestMapping("/api")
class CricketerController(private val cricketerService: CricketerService , private val cricketerRepository: CricketerRepository){

    @GetMapping("/cricketers/{id}")
    fun getCricketer(@PathVariable("id") id: Long):ResponseEntity<Cricketer>  {
        val cricketer = …
Run Code Online (Sandbox Code Playgroud)

java kotlin spring-boot

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

NoSuchBeanDefinitionException:没有“org.springframework.boot.web.reactive.error.ErrorAttributes”类型的合格 bean 可用:

我正在按照https://www.baeldung.com/spring-webflux-errors教程来处理 Spring Webflux 项目中的错误。

package com.example.demo.exception;

import org.springframework.boot.autoconfigure.web.ResourceProperties;
import org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler;
import org.springframework.boot.web.reactive.error.ErrorAttributes;
import org.springframework.context.ApplicationContext;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.codec.ServerCodecConfigurer;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.BodyInserters;
import org.springframework.web.reactive.function.server.*;
import reactor.core.publisher.Mono;

import java.util.Map;

@Component
@Order(-2)
public class ExceptionWebHandler extends AbstractErrorWebExceptionHandler {

    public ExceptionWebHandler(ErrorAttributes errorAttributes,
                               ApplicationContext applicationContext,
                               ServerCodecConfigurer serverCodecConfigurer) {
        super(errorAttributes, new ResourceProperties(), applicationContext);
        super.setMessageWriters(serverCodecConfigurer.getWriters());
        super.setMessageReaders(serverCodecConfigurer.getReaders());
    }
    @Override
    protected RouterFunction<ServerResponse> getRoutingFunction(final ErrorAttributes errorAttributes) {
        return RouterFunctions.route(RequestPredicates.all(), this::renderErrorResponse);
    }

    private Mono<ServerResponse> renderErrorResponse(ServerRequest serverRequest) {
        Map<String,Object> errorAttributes = getErrorAttributes(serverRequest, false);
        return ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR) …
Run Code Online (Sandbox Code Playgroud)

java spring-boot spring-webflux

4
推荐指数
1
解决办法
7505
查看次数