From cfca3b7adf76a18fb98f8e365bdd5b8cecf2711c Mon Sep 17 00:00:00 2001 From: zeseb Date: Tue, 18 Mar 2014 16:45:41 +0100 Subject: [PATCH] BugFix: Can't follow a company. --- .../social/linkedin/api/impl/CompanyTemplate.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/spring-social-linkedin/src/main/java/org/springframework/social/linkedin/api/impl/CompanyTemplate.java b/spring-social-linkedin/src/main/java/org/springframework/social/linkedin/api/impl/CompanyTemplate.java index d4f7854d..295809b1 100644 --- a/spring-social-linkedin/src/main/java/org/springframework/social/linkedin/api/impl/CompanyTemplate.java +++ b/spring-social-linkedin/src/main/java/org/springframework/social/linkedin/api/impl/CompanyTemplate.java @@ -16,7 +16,9 @@ package org.springframework.social.linkedin.api.impl; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.springframework.social.linkedin.api.Companies; import org.springframework.social.linkedin.api.Company; @@ -95,11 +97,13 @@ public List getSuggestionsToFollow() { } public void startFollowingCompany(int id) { - restOperations.postForLocation(COMPANY_FOLLOW_START_STOP_URL, Collections.singletonMap("id", id)); + MapidMap = new HashMap(); + idMap.put("id", id); + restOperations.postForLocation(COMPANY_FOLLOW_START_URL, idMap); } public void stopFollowingCompany(int id) { - restOperations.delete(COMPANY_FOLLOW_START_STOP_URL, id); + restOperations.delete(COMPANY_FOLLOW_STOP_URL, id); } public Products getProducts(int companyId, int start, int count) { @@ -111,7 +115,8 @@ public Products getProducts(int companyId, int start, int count) { public static final String COMPANY_URL = BASE_URL + "companies{id}:" + COMPANY_FIELDS + "?{filter}"; public static final String COMPANY_SEARCH_URL = BASE_URL + "company-search:(companies:" + COMPANY_FIELDS + ")?keywords={keywords}"; public static final String COMPANY_FOLLOW_URL = BASE_URL + "people/~/following/companies:" + COMPANY_FIELDS; - public static final String COMPANY_FOLLOW_START_STOP_URL = BASE_URL + "people/~/following/companies/id={id}"; + public static final String COMPANY_FOLLOW_START_URL = BASE_URL + "people/~/following/companies"; + public static final String COMPANY_FOLLOW_STOP_URL = COMPANY_FOLLOW_START_URL + "/id={id}"; public static final String COMPANY_SUGGESTIONS_TO_FOLLOW = BASE_URL + "people/~/suggestions/to-follow/companies:" + COMPANY_FIELDS; public static final String PRODUCT_FIELDS="(id,name,type,creation-timestamp,logo-url,description,features,video:(title,url),product-deal:(title,url,text),sales-persons,num-recommendations,recommendations:(recommender,id,product-id,text,reply,timestamp,likes:(timestamp,person)),product-category,website-url,disclaimer)";