|
|
@@ -265,7 +265,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
/**
|
|
|
* 关注功能
|
|
|
*/
|
|
|
- @RequestMapping(value = "/interestAdd", method = RequestMethod.GET)
|
|
|
+ @RequestMapping(value = "/interestAdd", method = RequestMethod.POST)
|
|
|
public Result Addinterest( Integer type,String objectId,String interest) {
|
|
|
Result res = new Result();
|
|
|
if (null==type) {
|
|
|
@@ -412,11 +412,6 @@ public class AppUserController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
- if (null == ia.getCooperationMode()) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到合作方式", "合作方式"));
|
|
|
- return res;
|
|
|
- }
|
|
|
for (int i = 0; i < keywords.length; i++) {
|
|
|
if (AFTConstants.KEYWORDLENTH < keywords[i].length()) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "关键词长度"));
|
|
|
@@ -434,23 +429,24 @@ public class AppUserController extends CertifyApiController {
|
|
|
String keyword1,String keyword2,String keyword3,
|
|
|
String validityPeriodFormattedDate) {
|
|
|
Result res = new Result();
|
|
|
- /*String[] keywords ;
|
|
|
- if (StringUtils.isNotEmpty(keyword3)) {
|
|
|
- keywords=new String[]{keyword1,keyword2};
|
|
|
- }else if (StringUtils.isNotEmpty(keyword2)) {
|
|
|
- keywords=new String[]{keyword1};
|
|
|
- }else {
|
|
|
- keywords=new String[]{keyword1,keyword2,keyword3};
|
|
|
+ List<String> keyword=new ArrayList<>();
|
|
|
+ if (!StringUtils.isBlank(keyword1)) {
|
|
|
+ keyword.add(keyword1);
|
|
|
+ }
|
|
|
+ if (!StringUtils.isBlank(keyword2)) {
|
|
|
+ keyword.add(keyword2);
|
|
|
}
|
|
|
- if (null!=keywords) {
|
|
|
- demand.setKeyword(StringUtils.join(keywords,","));
|
|
|
- }*/
|
|
|
+ if (!StringUtils.isBlank(keyword3)) {
|
|
|
+ keyword.add(keyword3);
|
|
|
+ }
|
|
|
+ String[] keywords = keyword.toArray(new String[keyword.size()]);
|
|
|
+ demand.setKeyword(StringUtils.join(keywords,","));
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
DemandFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
return res;
|
|
|
}
|
|
|
- res = disposeDemand(res, demand, null);
|
|
|
+ res = disposeDemand(res, demand, keywords);
|
|
|
if (!res.getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -459,7 +455,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
if (null == demand.getUrgentMoney()) {
|
|
|
d.setUrgentMoney(demand.getUrgentMoney());
|
|
|
}
|
|
|
- res.setData(demandService.saveAppUserDemand(d, validityPeriodFormattedDate, null));
|
|
|
+ res.setData(demandService.saveAppUserDemand(d, validityPeriodFormattedDate, keywords));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -469,7 +465,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- /*if (StringUtils.isBlank(demand.getKeyword())) {
|
|
|
+ if (StringUtils.isBlank(demand.getKeyword())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
|
|
|
return res;
|
|
|
}
|
|
|
@@ -477,7 +473,7 @@ public class AppUserController extends CertifyApiController {
|
|
|
if (null == keywords || keywords.length < 1) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
|
|
|
return res;
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
if (null == demand.getIndustryCategoryA()) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到行业类别", "行业类别"));
|