| @@ -92,6 +92,16 @@ public class WxCampaignController extends BaseController { | |||||
| return wxCampaignService.addForPath(wxCampaign); | return wxCampaignService.addForPath(wxCampaign); | ||||
| } | } | ||||
| @ApiOperation(value = "新增接口-小程序路径", notes = "produceType,produceId,pagePath,pageScene必填") | |||||
| @PostMapping("addByAPPPath") | |||||
| @SystemControllerLog(description = "宣传页-新增") | |||||
| public ResultData addByAPPPath(@RequestBody WxCampaign wxCampaign) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCampaignController::addByAPPPath"); | |||||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | |||||
| wxCampaign.updateTenantInfo(ifParentUpdateAloneTenantInfo()); | |||||
| return wxCampaignService.addByAPPPath(wxCampaign); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| @SystemControllerLog(description = "宣传页-id更新") | @SystemControllerLog(description = "宣传页-id更新") | ||||
| @@ -8,6 +8,7 @@ public enum EnumCampaignType { | |||||
| STABLE(1, "固定格式"), | STABLE(1, "固定格式"), | ||||
| FREE(2, "自由图文"), | FREE(2, "自由图文"), | ||||
| PAGEPATH(3, "小程序路径"), | PAGEPATH(3, "小程序路径"), | ||||
| TAPPPATH(4, "第三方小程序路径"), | |||||
| ; | ; | ||||
| public static EnumCampaignType getEnum(Integer code) { | public static EnumCampaignType getEnum(Integer code) { | ||||
| @@ -66,4 +66,5 @@ public interface WxCampaignService { | |||||
| void printHtmlById(Long id, HttpServletResponse response); | void printHtmlById(Long id, HttpServletResponse response); | ||||
| ResultData addByAPPPath(WxCampaign wxCampaign); | |||||
| } | } | ||||
| @@ -328,5 +328,25 @@ public class WxCampaignServiceImpl implements WxCampaignService { | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public ResultData addByAPPPath(WxCampaign wxCampaign) { | |||||
| if(wxCampaign.getType().equals(EnumCampaignType.TAPPPATH.getCode())) { | |||||
| if (StringUtils.isBlank(wxCampaign.getCoverImg())) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "封面图不能为空"); | |||||
| } | |||||
| } else { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||||
| } | |||||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | |||||
| if (wxCampaign.getId() == null) { | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| wxCampaign.setId(idWorker.nextId()); | |||||
| wxCampaignMapper.insert(wxCampaign); | |||||
| } else { | |||||
| wxCampaignMapper.updateById(wxCampaign); | |||||
| } | |||||
| return new ResultData(Result.SUCCESS,"操作成功"); | |||||
| } | |||||
| } | } | ||||