Skip to content

Commit

Permalink
MARP-394 MP api to fetch all artifacts and search (#21)
Browse files Browse the repository at this point in the history
* Add name for param
* Rename app name
* Add param name
* Remove required for pageable
* New Gh token
  • Loading branch information
nqhoan-axonivy authored Jun 25, 2024
1 parent 81dbbc7 commit fe0ab13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,23 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Update MongoDB in application.properties
- name: Update configuration
env:
APP_PROPERTIES_FILE: 'src/main/resources/application.properties'
GITHUB_TOKEN_FILE: 'src/main/resources/github.token'
MONGODB_HOST: ${{ secrets.MONGODB_HOST }}
MONGODB_DATABASE: ${{ secrets.MONGODB_DATABASE }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
sed -i "s/^spring.data.mongodb.host=.*$/spring.data.mongodb.host=$MONGODB_HOST/" src/main/resources/application.properties
sed -i "s/^spring.data.mongodb.database=.*$/spring.data.mongodb.database=$MONGODB_DATABASE/" src/main/resources/application.properties
sed -i "s/^spring.data.mongodb.host=.*$/spring.data.mongodb.host=$MONGODB_HOST/" $APP_PROPERTIES_FILE
sed -i "s/^spring.data.mongodb.database=.*$/spring.data.mongodb.database=$MONGODB_DATABASE/" $APP_PROPERTIES_FILE
sed -i '1d;$d' $GITHUB_TOKEN_FILE && echo $GH_TOKEN > $GITHUB_TOKEN_FILE
- name: Build with Maven
run: mvn clean package -DskipTests
- name: Prepare deployment directory
run: mkdir -p deployment && cp target/*.war deployment/
- name: Copy WAR to Tomcat server
run: sudo cp deployment/*.war /opt/tomcat/webapps/marketplace-server.war
run: sudo cp deployment/*.war /opt/tomcat/webapps/marketplace-service.war
- name: Restart Tomcat server
run: |
sudo systemctl stop tomcat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ public ProductController(ProductService service, ProductModelAssembler assembler

@Operation(summary = "Find all products", description = "Be default system will finds product by type as 'all'")
@GetMapping()
public ResponseEntity<PagedModel<ProductModel>> findProducts(@RequestParam(required = true) String type,
@RequestParam(required = false) String keyword, Pageable pageable) {
public ResponseEntity<PagedModel<ProductModel>> findProducts(
@RequestParam(required = true, name = "type") String type,
@RequestParam(required = false, name = "keyword") String keyword, Pageable pageable) {
Page<Product> results = service.findProducts(type, keyword, pageable);
if (results.isEmpty()) {
return generateEmptyPagedModel();
Expand Down

0 comments on commit fe0ab13

Please sign in to comment.