记得上下班打卡 | git大法好,push需谨慎

Commit 755bfc72 authored by 胡佳晨's avatar 胡佳晨

修改接口

parent 022a0cc5
...@@ -15,4 +15,6 @@ public class GoblinInsertZhengzaiParam { ...@@ -15,4 +15,6 @@ public class GoblinInsertZhengzaiParam {
private String storeId; private String storeId;
@ApiModelProperty(required = true, value = "显示时间") @ApiModelProperty(required = true, value = "显示时间")
private String showTime; private String showTime;
@ApiModelProperty(required = true, value = "是否删除[0-否|1-是]")
private Integer delTag;
} }
...@@ -113,20 +113,11 @@ public class GoblinSelfZhengzaiController extends BaseController { ...@@ -113,20 +113,11 @@ public class GoblinSelfZhengzaiController extends BaseController {
return goblinZhengzaiMarketService.zhengzaiStore(params); return goblinZhengzaiMarketService.zhengzaiStore(params);
} }
@PostMapping("zhengzai/store/insert") @PostMapping("zhengzai/store/update")
@ApiOperation("活动详情-正在下单-配置店铺") @ApiOperation("活动详情-正在下单-修改店铺")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({ public ResponseDto<Boolean> purchasingStoreUpdate(@RequestBody List<GoblinInsertZhengzaiParam> params) {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"), return goblinZhengzaiMarketService.zhengzaiStore(params);
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "showTime", value = "显示时间", example = "0"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integet", name = "delTag", value = "是否删除[0-否|1-是]", example = "0"),
})
public ResponseDto<Boolean> purchasingStore(@RequestParam("marketId") @Valid String marketId,
@RequestParam("storeId") @Valid String storeId,
@RequestParam("showTime") @Valid String showTime,
@RequestParam("delTag") @Valid Integer delTag) {
return goblinZhengzaiMarketService.zhengzaiStore(marketId, storeId, showTime, delTag);
} }
......
...@@ -102,11 +102,9 @@ public interface IGoblinZhengzaiMarketService { ...@@ -102,11 +102,9 @@ public interface IGoblinZhengzaiMarketService {
/** /**
* 编辑正在下单 可参与活动店铺 * 编辑正在下单 可参与活动店铺
* *
* @param marketId
* @param storeId
* @return * @return
*/ */
ResponseDto<Boolean> zhengzaiStore(String marketId, String storeId, String showTime, Integer delTag); ResponseDto<Boolean> zhengzaiStoreUpdate(List<GoblinInsertZhengzaiParam> params);
/** /**
* 查看详情(参加活动的商品列表) * 查看详情(参加活动的商品列表)
......
...@@ -217,32 +217,38 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -217,32 +217,38 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
} }
@Override @Override
public ResponseDto<Boolean> zhengzaiStore(String marketId, String storeId, String showTime, Integer delTag) { public ResponseDto<Boolean> zhengzaiStoreUpdate(List<GoblinInsertZhengzaiParam> params) {
if (delTag == 0) { for (GoblinInsertZhengzaiParam item:params) {
GoblinMarketingZhengzaiRelation entity = GoblinMarketingZhengzaiRelation.getNew(); int delTag = item.getDelTag();
entity.setShowTime(LocalDateTime.parse(showTime, DTF_YMD_HMS)); String showTime = item.getShowTime();
entity.setUpdatedAt(LocalDateTime.now()); String marketId = item.getMarketId();
//mysql String storeId = item.getStoreId();
goblinMarketingZhengzaiRelationMapper.update(entity, Wrappers.lambdaUpdate(GoblinMarketingZhengzaiRelation.getNew()).eq(GoblinMarketingZhengzaiRelation::getSelfMarketId, marketId).eq(GoblinMarketingZhengzaiRelation::getStoreId, storeId)); if (delTag == 0) {
//mongo GoblinMarketingZhengzaiRelation entity = GoblinMarketingZhengzaiRelation.getNew();
GoblinMarketingZhengzaiRelationVo vo = GoblinMarketingZhengzaiRelationVo.getNew(); entity.setShowTime(LocalDateTime.parse(showTime, DTF_YMD_HMS));
BeanUtils.copyProperties(entity, vo); entity.setUpdatedAt(LocalDateTime.now());
vo.setShowTime(showTime); //mysql
goblinMongoUtils.updateZhengzaiRelation(marketId, storeId, vo); goblinMarketingZhengzaiRelationMapper.update(entity, Wrappers.lambdaUpdate(GoblinMarketingZhengzaiRelation.getNew()).eq(GoblinMarketingZhengzaiRelation::getSelfMarketId, marketId).eq(GoblinMarketingZhengzaiRelation::getStoreId, storeId));
//redis //mongo
goblinRedisUtils.setZhengzaiRelation(marketId, vo); GoblinMarketingZhengzaiRelationVo vo = GoblinMarketingZhengzaiRelationVo.getNew();
goblinRedisUtils.addStoreSelfRelation(marketId, storeId); BeanUtils.copyProperties(entity, vo);
} else if (delTag == 1) { vo.setShowTime(showTime);
GoblinMarketingZhengzaiRelation entity = GoblinMarketingZhengzaiRelation.getNew(); goblinMongoUtils.updateZhengzaiRelation(marketId, storeId, vo);
entity.setDelTag(1); //redis
entity.setUpdatedAt(LocalDateTime.now()); goblinRedisUtils.setZhengzaiRelation(marketId, vo);
//mysql goblinRedisUtils.addStoreSelfRelation(marketId, storeId);
goblinMarketingZhengzaiRelationMapper.update(entity, Wrappers.lambdaUpdate(GoblinMarketingZhengzaiRelation.getNew()).eq(GoblinMarketingZhengzaiRelation::getSelfMarketId, marketId).eq(GoblinMarketingZhengzaiRelation::getStoreId, storeId)); } else if (delTag == 1) {
//mongo GoblinMarketingZhengzaiRelation entity = GoblinMarketingZhengzaiRelation.getNew();
goblinMongoUtils.delZhengzaiRelation(marketId, storeId); entity.setDelTag(1);
//redis entity.setUpdatedAt(LocalDateTime.now());
goblinRedisUtils.delZhengzaiRelation(marketId, storeId); //mysql
goblinRedisUtils.delStoreSelfRelation(marketId, storeId); goblinMarketingZhengzaiRelationMapper.update(entity, Wrappers.lambdaUpdate(GoblinMarketingZhengzaiRelation.getNew()).eq(GoblinMarketingZhengzaiRelation::getSelfMarketId, marketId).eq(GoblinMarketingZhengzaiRelation::getStoreId, storeId));
//mongo
goblinMongoUtils.delZhengzaiRelation(marketId, storeId);
//redis
goblinRedisUtils.delZhengzaiRelation(marketId, storeId);
goblinRedisUtils.delStoreSelfRelation(marketId, storeId);
}
} }
return ResponseDto.success(); return ResponseDto.success();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment