Skip to content

Commit

Permalink
update documention
Browse files Browse the repository at this point in the history
  • Loading branch information
ntqdinh-axonivy committed Jul 30, 2024
1 parent bc2429f commit fbc3234
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public FeedbackController(FeedbackService feedbackService, JwtService jwtService
}

@GetMapping(PRODUCT_BY_ID)
@Operation(summary = "Find feedbacks by product id with lazy loading.", description = "Get all user feedback by product id (from meta.json) with lazy loading.")
@Operation(summary = "Find feedbacks by product id with lazy loading", description = "Get all user feedback by product id (from meta.json) with lazy loading")
@PageableAsQueryParam
public ResponseEntity<PagedModel<FeedbackModel>> findFeedbacks(@PathVariable(ID)
@Parameter(description = "Product id (from meta.json)", example = "portal", in = ParameterIn.PATH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,20 @@ public ProductController(ProductService productService, GitHubService gitHubServ
}

@GetMapping()
@PageableAsQueryParam
@Operation(summary = "Find all products", description = "Be default system will finds product by type as 'all'")
@Operation(summary = "Find all products", description = "Be default system will finds product by type as 'all'", parameters = {
@Parameter(name = "page", description = "Page number to retrieve", in = ParameterIn.QUERY, example = "0", required = true),
@Parameter(name = "size", description = "Number of items per page", in = ParameterIn.QUERY, example = "20", required = true),
@Parameter(name = "sort", description = "Sorting criteria in the format: property(popularity|alphabetically|recent),(asc|desc)", in = ParameterIn.QUERY, example = "popularity,asc", required = true)
})
public ResponseEntity<PagedModel<ProductModel>> findProducts(@RequestParam(name = TYPE)
@Parameter(description = "Type of product.", in = ParameterIn.QUERY,
schema = @Schema(type = "string", allowableValues = {"all", "connectors", "utilities", "solutions", "demos"}))
String type,
@RequestParam(required = false, name = KEYWORD)
@Parameter(description = "Keyword that exist in product's name or short description.", example = "connector", in = ParameterIn.QUERY)
@Parameter(description = "Keyword that exist in product's name or short description", example = "connector", in = ParameterIn.QUERY)
String keyword,
@RequestParam(name = LANGUAGE)
@Parameter(description = "Language of product short description.", in = ParameterIn.QUERY,
@Parameter(description = "Language of product short description", in = ParameterIn.QUERY,
schema = @Schema(allowableValues = {"en", "de"}))
String language,
@ParameterObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public ProductDetailsController(VersionService versionService, ProductService pr
}

@GetMapping(BY_ID_AND_TAG)
@Operation(summary = "Find product detail by product id and release tag.", description = "get product detail by it product id and release tag.")
@Operation(summary = "Find product detail by product id and release tag.", description = "get product detail by it product id and release tag")
public ResponseEntity<ProductDetailModel> findProductDetailsByVersion(@PathVariable(ID)
@Parameter(description = "Product id (from meta.json)", example = "adobe-acrobat-connector", in = ParameterIn.PATH)
String id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@ public class FeedbackModel extends RepresentationModel<FeedbackModel> {
@Schema(description = "3rd party login provider", example = "GitHub")
private String userProvider;

@Schema(description = "Product id (from meta.json)", example = "portal", nullable = false)
@Schema(description = "Product id (from meta.json)", example = "portal")
@NotBlank(message = "Product id cannot be blank")
private String productId;

@Schema(description = "User's feedback content", example = "Pretty cool connector.", nullable = false)
@Schema(description = "User's feedback content", example = "Pretty cool connector.")
@NotBlank(message = "Content cannot be blank")
@Size(max = 5, message = "Content length must be up to 250 characters")
private String content;

@Schema(description = "User's rating point of target product", example = "5", nullable = false, minimum = "1", maximum = "5")
@Schema(description = "User's rating point of target product", example = "5", minimum = "1", maximum = "5")
@Min(value = 1, message = "Rating should not be less than 1")
@Max(value = 5, message = "Rating should not be greater than 5")
private Integer rating;

@Schema(description = "Feedback/rating creating timestamp", example = "2024-06-24T00:00:00.000Z", nullable = false)
@Schema(description = "Feedback/rating creating timestamp", example = "2024-06-24T00:00:00.000Z")
private Date createdAt;

@Schema(description = "Latest feedback/rating updating timestamp", example = "2024-06-24T00:00:00.000Z", nullable = false)
@Schema(description = "Latest feedback/rating updating timestamp", example = "2024-06-24T00:00:00.000Z")
private Date updatedAt;

@Override
Expand Down

0 comments on commit fbc3234

Please sign in to comment.