This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
@Slf4j | |
public class BookService extends BaseService<Book> { | |
private BookRepository repository; | |
@Autowired | |
public BookService(BookRepository repository) { | |
this.repository = repository; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
@Slf4j | |
public class BaseService<E extends GenericEntity> { | |
@Autowired | |
protected HazlecastService hazlecastService; | |
public Mono<E> findCacheValue(String cacheName, List<String> keys, Mono<E> fallBackMono) { | |
return CacheMono |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
@Slf4j | |
public class HazelcastService { | |
@Getter | |
private HazelcastInstance hzInstance; | |
@PostConstruct | |
private void init() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependencies> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-webflux</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.projectlombok</groupId> | |
<artifactId>lombok</artifactId> | |
<version>1.18.6</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.google.firebase</groupId> | |
<artifactId>firebase-admin</artifactId> | |
<version>6.11.0</version> | |
</dependency> | |
<dependency> | |
<groupId>org.projectlombok</groupId> | |
<artifactId>lombok</artifactId> | |
<version>1.18.6</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
@Slf4j | |
public class NotificationService { | |
@Autowired | |
private Config config; | |
private EmitterProcessor<Notification> emitterSource = EmitterProcessor.create(); | |
private Flux<Notification> fluxNotification = emitterSource.publish().autoConnect(); | |
@PostConstruct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
firebase: | |
pkey: '{ | |
"type": "", | |
"project_id": "", | |
"private_key_id": "" | |
"private_key": "", | |
"client_email": "", | |
"client_id": "", | |
"auth_uri": "", | |
"token_uri": "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BaseController<E extends BaseEntity> { | |
@Autowired | |
private BaseService<E> baseService; | |
@PostMapping("/save") | |
public Mono<E> save(Authentication auth, | |
@RequestBody E entity) { | |
return baseService.save(getTenant(auth),entity); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
@Slf4j | |
public class BaseService<E extends BaseEntity> { | |
@Autowired | |
protected GenericRepository<E> generalRepo; | |
public Mono<E> findEnitity(String entityId, String tenantId) { | |
return generalRepo.findFirstByIdAndTenantId(entityId,tenantId); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Repository | |
public interface GenericRepository<E extends BaseEntity> extends ReactiveCrudRepository<E, String> { | |
Mono<Void> deleteByIdAndTenantId(String id, String tenantId); | |
Mono<E> findFirstByIdAndTenantId(String id, String tenantId); | |
} |
NewerOlder