-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MARP-612 Storing number of downloads version
- Loading branch information
1 parent
6dc7bff
commit fdd4875
Showing
11 changed files
with
198 additions
and
11 deletions.
There are no files selected for viewing
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
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
24 changes: 24 additions & 0 deletions
24
marketplace-service/src/main/java/com/axonivy/market/model/DesignerInstallation.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.axonivy.market.model; | ||
|
||
import com.axonivy.market.entity.MavenArtifactModel; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.apache.commons.lang3.builder.EqualsBuilder; | ||
import org.apache.commons.lang3.builder.HashCodeBuilder; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class DesignerInstallation { | ||
@Schema(description = "Ivy designer version", example = "11.4.0") | ||
private String designerVersion; | ||
private int numberOfDownloads; | ||
} |
16 changes: 16 additions & 0 deletions
16
...ce/src/main/java/com/axonivy/market/repository/ProductDesignerInstallationRepository.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.axonivy.market.repository; | ||
|
||
import com.axonivy.market.entity.Feedback; | ||
import com.axonivy.market.entity.Product; | ||
import com.axonivy.market.entity.ProductDesignerInstallation; | ||
import org.springframework.data.mongodb.repository.MongoRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
|
||
@Repository | ||
public interface ProductDesignerInstallationRepository extends MongoRepository<ProductDesignerInstallation, String>, | ||
CustomProductRepository { | ||
|
||
List<ProductDesignerInstallation> findByProductId(String productId); | ||
} |
15 changes: 15 additions & 0 deletions
15
...-service/src/main/java/com/axonivy/market/service/ProductDesignerInstallationService.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.axonivy.market.service; | ||
|
||
import com.axonivy.market.entity.Product; | ||
import com.axonivy.market.entity.ProductDesignerInstallation; | ||
import com.axonivy.market.exceptions.model.InvalidParamException; | ||
import com.axonivy.market.model.DesignerInstallation; | ||
import com.axonivy.market.model.ProductCustomSortRequest; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
|
||
import java.util.List; | ||
|
||
public interface ProductDesignerInstallationService { | ||
List<DesignerInstallation> findByProductId(String productId); | ||
} |
33 changes: 33 additions & 0 deletions
33
...src/main/java/com/axonivy/market/service/impl/ProductDesignerInstallationServiceImpl.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.axonivy.market.service.impl; | ||
|
||
import com.axonivy.market.entity.ProductDesignerInstallation; | ||
import com.axonivy.market.model.DesignerInstallation; | ||
import com.axonivy.market.repository.ProductDesignerInstallationRepository; | ||
import com.axonivy.market.service.ProductDesignerInstallationService; | ||
import lombok.extern.log4j.Log4j2; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Log4j2 | ||
@Service | ||
public class ProductDesignerInstallationServiceImpl implements ProductDesignerInstallationService { | ||
|
||
private final ProductDesignerInstallationRepository productDesignerInstallationRepository; | ||
|
||
public ProductDesignerInstallationServiceImpl(ProductDesignerInstallationRepository productDesignerInstallationRepository) { | ||
this.productDesignerInstallationRepository = productDesignerInstallationRepository; | ||
} | ||
|
||
@Override | ||
public List<DesignerInstallation> findByProductId(String productId) { | ||
List<DesignerInstallation> designerInstallations = new ArrayList<>(); | ||
List<ProductDesignerInstallation> productDesignerInstallations = productDesignerInstallationRepository.findByProductId(productId); | ||
for(ProductDesignerInstallation productDesignerInstallation: productDesignerInstallations) { | ||
DesignerInstallation designerInstallation = new DesignerInstallation(productDesignerInstallation.getDesignerVersion(), productDesignerInstallation.getInstallationCount()); | ||
designerInstallations.add(designerInstallation); | ||
} | ||
return designerInstallations; | ||
} | ||
} |
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
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
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
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
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