|
|
@@ -0,0 +1,48 @@
|
|
|
+package com.kede.wechat.controller;
|
|
|
+
|
|
|
+
|
|
|
+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.WeChatLiveTelecastApiService;
|
|
|
+import com.kede.wechat.service.WeChatShareService;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping(value = "/api/admin/weChatShare")
|
|
|
+public class WeChatLiveTelecastApiController extends BaseController{
|
|
|
+
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private WeChatLiveTelecastApiService weChatLiveTelecastApiService;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增分享信息
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/add", method = RequestMethod.POST)
|
|
|
+ public Result add(WechatShare in) {
|
|
|
+ Result res=new Result();
|
|
|
+ if (in.getType()==null||in.getTitle()==null) {
|
|
|
+ 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));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|