Skip to content

Commit

Permalink
fix: shelter pix key
Browse files Browse the repository at this point in the history
Signed-off-by: MatheusVict <matheusvictorhenrique@gmail.com>
  • Loading branch information
MatheusVict committed Nov 3, 2023
1 parent 1672a3f commit 35f1647
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 15 deletions.
4 changes: 0 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/com/pet/foundation/pataamiga/config/Beans.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@
@Configuration
public class Beans {

@Bean
public CacheManager cacheManager(RedisConnectionFactory factory) {
Duration expiration = Duration.ofSeconds(60);
RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig()
.entryTtl(expiration)
.disableCachingNullValues();

return RedisCacheManager.builder(factory).cacheDefaults(config).build();
}

public SecurityScheme createAPIKeyScheme() {
return new SecurityScheme()
.type(SecurityScheme.Type.HTTP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class SecurityConfigurations {
@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(Arrays.asList("http://localhost:3000", "*"));
configuration.setAllowedOrigins(Arrays.asList("http://localhost:3000"));
configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
configuration.setAllowedHeaders(Arrays.asList("Authorization", "Content-Type", "Accept", "Origin", "Access-Control-Request-Method", "Access-Control-Request-Headers"));
configuration.setExposedHeaders(Arrays.asList("Access-Control-Allow-Origin", "Access-Control-Allow-Credentials", "Authorization"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public class Shelter {
@Embedded
private Contact contact = new Contact();

@Column(length = 500)
private String pixKey;

@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id")
@JsonIgnore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,9 @@ public abstract class ShelterDTO {
@NotNull(message = "Contact is mandatory")
protected Contact contact = new Contact();

@Schema(description = "Pix key from shelter", example = "shelter@email.com")
protected String pixKey;

@Schema(description = "Adoption Police", example = "We don't allow cows")
protected String adoptionPolice;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.pet.foundation.pataamiga.requests;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ChatMessage {
private String content;
private String sender;
private String recipient;
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void setUp() {
"profilePicture",
"banner",
null,
null,
owners,
Date.from(Instant.now()),
Date.from(Instant.now())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public static Shelter returnValidShelter() {
.profilePicture("picture")
.banner("banner")
.contact(null)
.pixKey(null)
.location("location")
.adoptionPolice("adoption police")
.owners(List.of(UserCreator.returnValidUser()))
Expand Down

0 comments on commit 35f1647

Please sign in to comment.