-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added API to get country wise skill usage data #811
Added API to get country wise skill usage data #811
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please squash the commits. Thanks :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve conflicts.
80bd77e
@saurabhjn76 @dynamitechetan @DravitLochan @madhavrathi I think it can be merged now. Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check inline comments
src/ai/susi/mind/SusiCognition.java
Outdated
if (languageName.has(skill_name)) { | ||
JSONArray countryWiseUsageData = languageName.getJSONArray(skill_name); | ||
Boolean countryExists = false; | ||
for (int i = 0; i<countryWiseUsageData.length(); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add space before and after <
src/ai/susi/mind/SusiCognition.java
Outdated
Boolean countryExists = false; | ||
for (int i = 0; i<countryWiseUsageData.length(); i++) { | ||
JSONObject countryUsage = countryWiseUsageData.getJSONObject(i); | ||
if (countryUsage.get("country_code").equals(countryCode)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add space before {
src/ai/susi/mind/SusiCognition.java
Outdated
JSONObject countryUsage = new JSONObject(); | ||
countryUsage.put("country_code", countryCode); | ||
countryUsage.put("country_name", countryName); | ||
countryUsage.put("count", "1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use String here, instead use integer
src/ai/susi/mind/SusiCognition.java
Outdated
countryWiseUsageData.put(countryUsage); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra new lines
src/ai/susi/mind/SusiCognition.java
Outdated
modelName.put(group_name, groupName); | ||
skillUsage.put(model_name, modelName, true); | ||
return; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra new lines
src/ai/susi/mind/SusiCognition.java
Outdated
JSONObject countryUsage = new JSONObject(); | ||
countryUsage.put("country_code", countryCode); | ||
countryUsage.put("country_name", countryName); | ||
countryUsage.put("count", "1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use integer for count
if (modelName.has(group_name)) { | ||
JSONObject groupName = modelName.getJSONObject(group_name); | ||
if (groupName.has(language_name)) { | ||
JSONObject languageName = groupName.getJSONObject(language_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra space after JSONObject
src/ai/susi/mind/SusiCognition.java
Outdated
} | ||
} | ||
|
||
if (!countryExists) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is getting redundant here. You can directly use the block that is present outside the if
sections. I would suggest you to take a look at FiveStarRateSkillService.java
for reference.
Also, squash the commits. |
please resolve conflicts |
@Orbiter Resolved the merge conflicts. Please review. |
@mariobehling @Orbiter @saurabhjn76 @dynamitechetan @DravitLochan @madhavrathi @sudheesh001 Please review. Done the required changes. |
Fixes
Country wise skill usage analytics #810
Changes:
Endpoint :
/cms/getCountryWiseSkillUsage.json
Parameters :
Screenshots for the change:
countryWiseSkillUsage.json
Sample API call :
/cms/getCountryWiseSkillUsage.json?model=general&group=Knowledge&language=en&skill=ceo
API response