Skip to content

Commit

Permalink
Merge pull request #93 from visenze/feature/ctl
Browse files Browse the repository at this point in the history
[API-8655] Add item_count to CTL set-based response
  • Loading branch information
thehung111 authored Sep 28, 2022
2 parents 278e621 + 780e278 commit fe0b111
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 13 deletions.
6 changes: 1 addition & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ pipeline {
agent {
label "${params.AGENT_LABEL ?: 'build'}"
}

environment {
ANDROID_HOME = tool(name: 'android-sdk-tools', type: 'com.cloudbees.jenkins.plugins.customtools.CustomTool')
}


parameters {
string(name: 'AGENT_LABEL', defaultValue: 'build')
booleanParam(name: 'BINTRAY_PUBLISH', defaultValue: false)
Expand Down
4 changes: 2 additions & 2 deletions doc/ProductSearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ With the release of ViSenze's Catalog system, ViSearch Android SDK will now incl
- Aggregate search results on a product level instead of image level
- Consistent data type in API response with Catalog’s schema

> Current stable version: 2.2.3
> Current stable version: 2.2.4
> Minimum Android SDK Version: API 9, Android 2.3
Expand Down Expand Up @@ -64,7 +64,7 @@ allprojects {
include the dependency in your project using gradle:
```gradle
implementation 'com.github.visenze:visenze-tracking-android:0.2.1'
implementation 'com.github.visenze:visearch-sdk-android:2.2.3'
implementation 'com.github.visenze:visearch-sdk-android:2.2.4'
```

### 1.3 Add User Permissions
Expand Down
4 changes: 2 additions & 2 deletions doc/ViSearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ViSearch is an API that provides accurate, reliable and scalable image search. V

The ViSearch Android SDK is an open source software to provide easy integration of ViSearch Search API with your Android mobile applications. It provides three search methods based on the ViSearch Search API - pre-indexed search, color search and upload search. For source code and references, please visit the [Github Repository](https://github.com/visenze/visearch-sdk-android).

>Current stable version: 2.2.3
>Current stable version: 2.2.4
>Minimum Android SDK Version: API 9, Android 2.3
Expand Down Expand Up @@ -80,7 +80,7 @@ allprojects {
include the dependency in your project using gradle:
```gradle
implementation 'com.github.visenze:visenze-tracking-android:0.2.1'
implementation 'com.github.visenze:visearch-sdk-android:2.2.3'
implementation 'com.github.visenze:visearch-sdk-android:2.2.4'
```

### 1.3 Add User Permissions
Expand Down
4 changes: 2 additions & 2 deletions visearch-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ plugins {

def versionMajor = 2
def versionMinor = 2
def versionPatch = 3
version = '2.2.3'
def versionPatch = 4
version = '2.2.4'

android {
compileSdkVersion 29
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public class SetInfo {
@SerializedName("set_score")
private double setScore;

@SerializedName("item_count")
private int itemCount;

public String getSetId() {
return setId;
}
Expand All @@ -25,4 +28,12 @@ public double getSetScore() {
public void setSetScore(double setScore) {
this.setScore = setScore;
}

public int getItemCount() {
return itemCount;
}

public void setItemCount(int itemCount) {
this.itemCount = itemCount;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -639,11 +639,13 @@ public void testCtlSetBasedResponse() {
"\"set_info\": [\n" +
" {\n" +
" \"set_id\": \"set1\",\n" +
" \"set_score\": 1000\n" +
" \"set_score\": 1000,\n" +
" \"item_count\": 5\n" +
" },\n" +
" {\n" +
" \"set_id\": \"set2\",\n" +
" \"set_score\": 900\n" +
" \"set_score\": 900,\n" +
" \"item_count\": 2\n" +
" }\n" +
" ]," +
" \"strategy\": {\n" +
Expand Down Expand Up @@ -676,9 +678,11 @@ public void onSearchResult(ProductResponse response, ErrorData error) {

assertEquals("set1", setInfoList.get(0).getSetId());
assertTrue(1000 == setInfoList.get(0).getSetScore());
assertTrue(5 == setInfoList.get(0).getItemCount());

assertEquals("set2", setInfoList.get(1).getSetId());
assertTrue(900 == setInfoList.get(1).getSetScore());
assertTrue(2 == setInfoList.get(1).getItemCount());

}
});
Expand Down

0 comments on commit fe0b111

Please sign in to comment.