|
|
@@ -21,6 +21,7 @@ import com.goafanti.common.model.Achievement;
|
|
|
import com.goafanti.common.model.AchievementInterest;
|
|
|
import com.goafanti.common.model.Demand;
|
|
|
import com.goafanti.common.model.DemandInterest;
|
|
|
+import com.goafanti.common.model.User;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.demand.service.DemandInterestService;
|
|
|
import com.goafanti.demand.service.DemandService;
|
|
|
@@ -80,6 +81,10 @@ public class PortalInterestApiController extends CertifyApiController{
|
|
|
@RequestMapping(value = "/demandCancelInterest", method = RequestMethod.POST)
|
|
|
public Result demandCancelInterest(String id) {
|
|
|
Result res = new Result();
|
|
|
+ if(!(TokenManager.getToken() instanceof User)){
|
|
|
+ res.getError().add(buildError(ErrorConstants.NON_LOGIN));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
if (StringUtils.isBlank(id)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
|
|
|
return res;
|
|
|
@@ -94,6 +99,10 @@ public class PortalInterestApiController extends CertifyApiController{
|
|
|
@RequestMapping(value = "/demandInterest", method = RequestMethod.POST)
|
|
|
public Result demandInterest(String id) {
|
|
|
Result res = new Result();
|
|
|
+ if(!(TokenManager.getToken() instanceof User)){
|
|
|
+ res.getError().add(buildError(ErrorConstants.NON_LOGIN));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
if (StringUtils.isBlank(id)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
|
|
|
return res;
|
|
|
@@ -122,6 +131,10 @@ public class PortalInterestApiController extends CertifyApiController{
|
|
|
@RequestMapping(value = "/achievementCancelInterest", method = RequestMethod.POST)
|
|
|
public Result achievementCancelInterest(String id) {
|
|
|
Result res = new Result();
|
|
|
+ if(!(TokenManager.getToken() instanceof User)){
|
|
|
+ res.getError().add(buildError(ErrorConstants.NON_LOGIN));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
if (StringUtils.isBlank(id)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
|
|
|
return res;
|
|
|
@@ -136,6 +149,10 @@ public class PortalInterestApiController extends CertifyApiController{
|
|
|
@RequestMapping(value = "/achievementInterest", method = RequestMethod.POST)
|
|
|
public Result achievementInterest(String id) {
|
|
|
Result res = new Result();
|
|
|
+ if(!(TokenManager.getToken() instanceof User)){
|
|
|
+ res.getError().add(buildError(ErrorConstants.NON_LOGIN));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
|
|
|
if (StringUtils.isBlank(id)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "科技成果ID"));
|