我正在学习 Terraform 和 AWS,但在创建资源时遇到了麻烦aws_security_group。
我从Terraform 文档复制了此资源的示例,然后配置了我的数据(我想通过 SSH 访问我的 EC2 资源。我知道这不是一个好的做法,但我只是在学习,我会测试后销毁)
\nresource "aws_security_group" "allow_tls_ssh" {\n name = "allow_tls"\n description = "Allow TLS inbound traffic"\n vpc_id = aws_vpc.vpc.id\n\n ingress = [\n {\n description = "TLS from VPC"\n from_port = 443\n to_port = 443\n protocol = "tcp"\n cidr_blocks = [aws_vpc.vpc.cidr_block]\n ipv6_cidr_blocks = [aws_vpc.vpc.ipv6_cidr_block]\n prefix_list_ids = []\n security_groups = []\n self = false\n },\n {\n description = "SSH from VPC"\n from_port = 22\n to_port = 22\n protocol = …Run Code Online (Sandbox Code Playgroud) ng build我在运行命令时遇到问题npm run。我有以下场景:
当我在本地环境中构建项目时,我运行ng build --configuration=development并且一切正常。
另一方面,当我构建 Docker 映像时,我使用运行命令,npm rum ng build --configuration=$VAR但未传递参数,结果也不是预期的。
虽然我认为没有必要,但我的 Dockerfile 如下
\n\n# STAGE 1: Build\n##############################################################################\n\n# Image\nFROM node:10-alpine as builder\nMAINTAINER joseantonio@gogroup.es\n\n# BUILD ARGS\nARG ENVIROMENT\n\n# Installing GIT & Bash\nRUN apk add --no-cache git\n\n## Storing node modules on a separate layer will prevent unnecessary npm installs at each build\nCOPY package.json package-lock.json ./\nRUN npm ci\nRUN mkdir /pancho-ui\nRUN mv ./node_modules ./pancho-ui\nWORKDIR /pancho-ui\nCOPY . .\n\n## Build the angular …Run Code Online (Sandbox Code Playgroud) 我在装有 macOS High Sierra (10.13.3) 的 MacBook Pro 中使用 SoapUI 5.4.0。
该应用程序运行速度非常慢(尤其是图形),有时它会挂起,我需要强制重启。
有人能帮我吗?
我正在为REST API开发Angular Client。
我的api公开如下网址:
https://server.com/users/detail/3
Run Code Online (Sandbox Code Playgroud)
其中3是参数。
我尝试使用Angular Client生成路径变量,但无法执行。我尝试
getUser(username: string) {
const options = {
params: new HttpParams().set('username', username)
};
return this.http.get<User>('detail/{username}', options); }
Run Code Online (Sandbox Code Playgroud)
但是结果不正确。有人能帮我吗?
编辑
在尝试解决方案后,它仍然无法正常工作。如果
getUser(username: string) {
const options = {
params: new HttpParams().set('username', username)
};
const resource = 'detail/' + username;
return this.http.get<any>(resource); }
Run Code Online (Sandbox Code Playgroud)
这个解决方案似乎我太可怜了,Angular HttpClient有这个解决方案吗?
我是新手,使用Angular HttpClient(也写英文)
我有一个问题,我正在尝试使用POST方法发送HTTP请求,以便协商OAuth令牌阻塞,但是angular发送OPTIONS请求:
服务:
login(username: string, password: string) {
const body = `username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}&grant_type=password`;
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Basic ' + btoa(TOKEN_AUTH_USERNAME + ':' + TOKEN_AUTH_PASSWORD)
})
};
return this.http.post<string>(AuthenticationService.AUTH_TOKEN, body, httpOptions);
Run Code Online (Sandbox Code Playgroud)
结果:
对于我的后端,我使用的是Spring Security,并且添加了一个过滤器以允许CORS:
@Bean
public FilterRegistrationBean corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
config.addAllowedOrigin("*");
config.addAllowedHeader("*");
config.addAllowedMethod("*");
source.registerCorsConfiguration("/**", config);
FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
bean.setOrder(0);
return bean;
}
Run Code Online (Sandbox Code Playgroud) spring-security oauth-2.0 spring-security-oauth2 angular angular5
我在使用 Mapstruct 时遇到问题。
我正在使用@Mapper带有@AfterMapping内部注释的界面,如下所示:
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface ConfiguracionReautorizacionMapper {
ConfiguracionReautorizacionDTO toConfiguracionReautorizacionDTO(final ConfiguracionReautorizacion configuracionReautorizacion);
ConfiguracionReautorizacion toConfiguracionReautorizacion(final ConfiguracionReautorizacionDTO configuracionReautorizacionDTO);
@AfterMapping
default void fillServiciosAsociados(@MappingTarget final ConfiguracionReautorizacionDTO configuracionReautorizacionDTO, final ConfiguracionReautorizacion configuracionReautorizacion) {
configuracionReautorizacionDTO.setTieneRolesOServiciosAsociados(!(CollectionUtils.isEmpty(configuracionReautorizacion.getRolesAplicacionEdesk()) && CollectionUtils.isEmpty(configuracionReautorizacion.getRolesAplicacionEdesk())));
}
}
Run Code Online (Sandbox Code Playgroud)
映射器工作正常,但@AfterMapping从未调用该方法。我阅读了其他帖子,其中显示了使用abstract class而不是interface.
abstract class使用@AfterMapping注释是强制性的吗?
我在使用Spring Boot + My Batis Spring Boot创建测试时遇到问题我为我的映射器创建了几个U. Test.对于插入,我使用@SelectKey注释来获取序列的下一个值.当Spring回滚时,事务不会回滚序列,并在每个应用程序启动时递增它.
FE.
@RunWith(SpringRunner.class)
@ActiveProfiles(profiles = "local")
@SpringBootTest
@Slf4j
@Transactional
public class MultimediaMapperTest {
@Autowired
private MultimediaMapper multimediaMapper;
@Autowired
private IEmpresasService empresasService;
@Test
public void insertArchivo() {
Multimedia archivo = Multimedia.builder()
.tiposEntidad(TiposEntidad.EMP)
.idEntidad(1)
.awsKey("KEY_AMAZON_WEB_SERVICES")
.nomFichero("fichero.txt")
.mime("application/pdf")
.observaciones("prueba observaciones")
.build();
multimediaMapper.insertArchivos(archivo);
log.debug("Fin de la inserción de {}", archivo);
assertThat(archivo.getIdArchivo(), is(notNullValue()));
}
Run Code Online (Sandbox Code Playgroud)
日志:
首先开始:
[INFO ] 2018-04-23 21:44:16,369 [] o.s.c.s.DefaultLifecycleProcessor - Starting beans in phase 2147483647 [INFO ] 2018-04-23 21:44:16,369 [] s.d.s.w.p.DocumentationPluginsBootstrapper - Context …
我有一个像这样的a-list
\n(setf *books* \'(\n ( \n (:title \'Titulo 1)\n (:autor (quote Autor 1) )\n ) \n (\n (:title \'T\xc3\xadtulo 2)\n (:autor (quote Autor 2) )\n )\n ; (...) \n))\nRun Code Online (Sandbox Code Playgroud)\n我需要创建一个根据书名查找书籍的函数。阅读文档后我尝试:
\n(defun string-include (string1 string2)\n (let* ((string1 (string string1)) (length1 (length string1)))\n (if (zerop length1)\n nil \n (labels ((sub (s)\n (cond\n ((> length1 (length s)) nil)\n ((string= string1 s :end2 (length string1)) string1)\n (t (sub (subseq s 1))))))\n (sub (string string2)))))\n)\n(\n defun buscar (books text)\n (remove-if-not \n (lambda …Run Code Online (Sandbox Code Playgroud) angular ×3
angular5 ×2
angular-cli ×1
common-lisp ×1
docker ×1
dockerfile ×1
java ×1
jdbc ×1
lisp ×1
mapstruct ×1
mybatis ×1
npm ×1
oauth-2.0 ×1
rest ×1
soapui ×1
spring ×1
spring-boot ×1
terraform ×1