|
|
@@ -11,6 +11,7 @@ import com.kede.common.bo.Result;
|
|
|
import com.kede.common.constant.ErrorConstants;
|
|
|
import com.kede.common.controller.BaseController;
|
|
|
import com.kede.common.model.WechatShare;
|
|
|
+import com.kede.wechat.bo.WechatShareBo;
|
|
|
import com.kede.wechat.service.WeChatShareService;
|
|
|
|
|
|
@RestController
|
|
|
@@ -34,6 +35,14 @@ public class weChatShareApiController extends BaseController{
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"分类或者标题","分类或者标题"));
|
|
|
return res;
|
|
|
}
|
|
|
+ if (in.getType()>0) {
|
|
|
+ WechatShareBo use=(WechatShareBo) weChatShareService.openDetails(in.getType(), in.getPid());
|
|
|
+ if (use!=null) {
|
|
|
+ String str=new StringBuffer().append("分类").append(in.getType()).append("已存在").toString();
|
|
|
+ res.getError().add(buildError(str,str));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ }
|
|
|
return res.data(weChatShareService.add(in));
|
|
|
}
|
|
|
|
|
|
@@ -49,6 +58,14 @@ public class weChatShareApiController extends BaseController{
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"分类或者标题","分类或者标题"));
|
|
|
return res;
|
|
|
}
|
|
|
+ if (in.getType()>0) {
|
|
|
+ WechatShareBo use=(WechatShareBo) weChatShareService.openDetails(in.getType(), in.getPid());
|
|
|
+ if (use!=null&&use.getId()!=in.getId()) {
|
|
|
+ String str=new StringBuffer().append("分类").append(in.getType()).append("已存在").toString();
|
|
|
+ res.getError().add(buildError(str,str));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ }
|
|
|
return res.data(weChatShareService.update(in));
|
|
|
}
|
|
|
|