小编mr.*_*uin的帖子

错误“术语‘flutterfire’未被识别为 cmdlet、函数、脚本文件或可操作程序的名称”

我正在尝试在我的根项目中安装 flutterfire_cli,所以我输入了以下命令:

FirebaseFirestore firestore = FirebaseFirestore.instance;
Run Code Online (Sandbox Code Playgroud)

之后,这是控制台会话(PowerShell):

FirebaseFirestore firestore = FirebaseFirestore.instance;
Run Code Online (Sandbox Code Playgroud)

输出:

cd C:\Users\PC\Desktop\eventually
dart pub global activate flutterfire_cli
Run Code Online (Sandbox Code Playgroud)

为了修复该警告,我将C:\Users\PC\AppData\Local\Pub\Cache\bin添加到系统变量环境中的Path环境变量中。(但这不起作用,我仍然收到警告)

接下来,我尝试使用以下命令生成firebase_options.dart文件,如文档所述:

Package flutterfire_cli is currently active at version 0.1.1+2.
Resolving dependencies...
The package flutterfire_cli is already activated at newest available version.
To recompile executables, first run `global deactivate flutterfire_cli`.
Installed executable flutterfire.
Warning: Pub installs executables into C:\Users\PC\AppData\Local\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory …
Run Code Online (Sandbox Code Playgroud)

firebase firebase-tools flutter

91
推荐指数
8
解决办法
17万
查看次数

Gitlab CI/CD 执行存储库中存在的脚本文件

我有以下项目:

在此输入图像描述

在文件 .gitlab-ci.yml 中,我有一个在不同行中运行的脚本:

deploy-uat:
  <<: *job_definition
  image: myimage 
  stage: publish
  script:
    - if [[ $START_DATE == "" ]]; then echo "START_DATE is empty"; exit 1; fi;
    - ssh -o StrictHostKeyChecking=no $USER@$SERVER 'kinit ad1frdqscuat@DATAUAT.EDHV2 -kt /etc/security/keytabs/ad1frdqscuat.keytab'
    - ssh -o StrictHostKeyChecking=no $USER@$SERVER 'rm -rf /opt/application/UAT/1FR/DQSC/contracts/'
    - ssh -o StrictHostKeyChecking=no $USER@$SERVER 'mkdir /opt/application/UAT/1FR/DQSC/contracts/'
    - ssh -o StrictHostKeyChecking=no $USER@$SERVER 'rm -rf /opt/application/UAT/1FR/DQSC/jar/'
    - ssh -o StrictHostKeyChecking=no $USER@$SERVER 'mkdir /opt/application/UAT/1FR/DQSC/jar/'
    - scp $JAR_PATH $USER@$SERVER:/opt/application/UAT/1FR/DQSC/jar/
    - scp $CONTRACT_PATH $USER@$SERVER:/opt/application/UAT/1FR/DQSC/contracts/
    - ssh -o StrictHostKeyChecking=no $USER@$SERVER 'chmod …
Run Code Online (Sandbox Code Playgroud)

sh gitlab gitlab-ci

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

Spring引导不加载log4j2.xml

我正在尝试在我的 spring boot 应用程序中添加 log4j2 框架,并且我正在使用 spring AOP 将日志记录问题与我的逻辑业务隔离开来。不幸的是,当我尝试记录我的消息时,log4j2 不起作用,它使用 spring 默认日志记录。

这是我尝试记录消息的 Logging 方面类:LoggingAspect.java

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
import org.springframework.util.StopWatch;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Aspect
@Component
public class LoggingAspect {
    @Around("com.obs.dqsc.api.config.AspectConfig.businessService() || com.obs.dqsc.api.config.AspectConfig.repositoryOperations()")
    public Object logMethod(final ProceedingJoinPoint joinPoint)
            throws Throwable {
        final Class<?> targetClass = joinPoint.getTarget().getClass();
        final Logger logger = LoggerFactory.getLogger(targetClass);

        try {
            final String className = targetClass.getSimpleName();
            logger.debug(getPreMessage(joinPoint, className));

            final StopWatch stopWatch = new StopWatch();
            stopWatch.start();

            final Object retVal = joinPoint.proceed();
            stopWatch.stop(); …
Run Code Online (Sandbox Code Playgroud)

java spring-aop maven log4j2 spring-boot

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

spring boot自定义验证器注释不适用于参数

我创建了一个新注释来验证控制器上的参数:

@Constraint(validatedBy = ValueValidator.class)
@Target( { ElementType.PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
public @interface ValidValue {
    String message() default "Invalid value";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
Run Code Online (Sandbox Code Playgroud)

这是我的验证器:

public class ValueValidator implements ConstraintValidator<ValidValue, String> {
    @Override
    public void initialize(ValidValue constraintAnnotation) {
        ConstraintValidator.super.initialize(constraintAnnotation);
    }

    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        if (s.contains("hello")) {
            throw new IllegalArgumentException("hello is not valid");
        }
        return true;
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我的控制器:

@GetMapping(value = "/extraction-date", produces = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "Find  customers by extraction …
Run Code Online (Sandbox Code Playgroud)

java validation spring hibernate-validator spring-boot

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