Add ports and service for product affinity functionality
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
package com.example.productaffinity.domain.port.incomming;
|
||||
|
||||
import com.example.productaffinity.domain.model.Product;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
// Input Port for resolving similar products to a requested product
|
||||
public interface GetAffinityProductsUC {
|
||||
Mono<List<Product>> getAffinityProducts(String productId);
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package com.example.productaffinity.domain.port.outcoming;
|
||||
|
||||
public class AffinityProductsIdsPort {
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.example.productaffinity.domain.port.outcoming;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public interface ProductDetailsPort {
|
||||
Mono<Collection<String>> findAffinityProductIds(String productId);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.example.productaffinity.domain.service;
|
||||
|
||||
import com.example.productaffinity.domain.model.Product;
|
||||
import com.example.productaffinity.domain.port.incomming.GetAffinityProductsUC;
|
||||
import org.springframework.stereotype.Service;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SimilarProductsService implements GetAffinityProductsUC {
|
||||
|
||||
public SimilarProductsService() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<List<Product>> getAffinityProducts(String productId) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user