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

Commit f92ef493 authored by GaoHu's avatar GaoHu

exit 助力失败文案提示

parent 02beec69
...@@ -40,7 +40,7 @@ public interface IGoblinGoodsAnticipateService { ...@@ -40,7 +40,7 @@ public interface IGoblinGoodsAnticipateService {
* @param sid 分享id * @param sid 分享id
* @return Boolean * @return Boolean
*/ */
ResponseDto<Boolean> help(String sid); ResponseDto<String> help(String sid);
/** /**
* 获取当前助力信息 * 获取当前助力信息
...@@ -56,4 +56,5 @@ public interface IGoblinGoodsAnticipateService { ...@@ -56,4 +56,5 @@ public interface IGoblinGoodsAnticipateService {
*/ */
ResponseDto<String> getTurnOnHelp(String skuId); ResponseDto<String> getTurnOnHelp(String skuId);
ResponseDto<Boolean> helpSid(String sid);
} }
...@@ -64,10 +64,19 @@ public class GoblinGoodsAnticipateController { ...@@ -64,10 +64,19 @@ public class GoblinGoodsAnticipateController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "sid", value = "创建分享生成的sid"), @ApiImplicitParam(type = "query", dataType = "String", name = "sid", value = "创建分享生成的sid"),
}) })
public ResponseDto<Boolean> help(@RequestParam(name = "sid") String sid) { public ResponseDto<String> help(@RequestParam(name = "sid") String sid) {
return goblinGoodsAnticipateService.help(sid); return goblinGoodsAnticipateService.help(sid);
} }
@ApiOperation("查询用户是否助力该分享")
@GetMapping("helpSid")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "sid", value = "创建分享生成的sid"),
})
public ResponseDto<Boolean> helpSid(@RequestParam(name = "sid") String sid) {
return goblinGoodsAnticipateService.helpSid(sid);
}
@ApiOperation("获取当前助力信息") @ApiOperation("获取当前助力信息")
@PostMapping("getHelpValue") @PostMapping("getHelpValue")
@ApiImplicitParams({ @ApiImplicitParams({
...@@ -82,7 +91,7 @@ public class GoblinGoodsAnticipateController { ...@@ -82,7 +91,7 @@ public class GoblinGoodsAnticipateController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "skuId", value = "skuId"), @ApiImplicitParam(type = "query", dataType = "String", name = "skuId", value = "skuId"),
}) })
public ResponseDto<String> getTurnOnHelp(@RequestParam(name = "skuId") String skuId){ public ResponseDto<String> getTurnOnHelp(@RequestParam(name = "skuId") String skuId) {
return goblinGoodsAnticipateService.getTurnOnHelp(skuId); return goblinGoodsAnticipateService.getTurnOnHelp(skuId);
} }
......
...@@ -66,10 +66,10 @@ public class GoblinGoodsAnticipateMgController { ...@@ -66,10 +66,10 @@ public class GoblinGoodsAnticipateMgController {
// return goblinGoodsAnticipateMgService.delete(skuId); // return goblinGoodsAnticipateMgService.delete(skuId);
// } // }
@ApiOperation("更具sku获取信息") // @ApiOperation("更具sku获取信息")
@GetMapping("/getAnticipateValueBySkuId") // @GetMapping("/getAnticipateValueBySkuId")
public AnticipateValueVo getAnticipateValueBySkuId(@RequestParam(name = "skuId") String skuId){ // public AnticipateValueVo getAnticipateValueBySkuId(@RequestParam(name = "skuId") String skuId){
return goblinGoodsAnticipateMgService.getAnticipateValueBySkuId(skuId,1); // return goblinGoodsAnticipateMgService.getAnticipateValueBySkuId(skuId,1);
} // }
} }
...@@ -195,24 +195,24 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -195,24 +195,24 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
} }
@Override @Override
public ResponseDto<Boolean> help(String sid) { public ResponseDto<String> help(String sid) {
//查询是否可以预约 //查询是否可以预约
GoblinGoodsAnticipateShareVo shareVo = goblinRedisUtils.getShareVo(sid); GoblinGoodsAnticipateShareVo shareVo = goblinRedisUtils.getShareVo(sid);
if (shareVo == null) { if (shareVo == null) {
return ResponseDto.failure("分享不存在,!"); return ResponseDto.failure("203","分享不存在!");
} }
Integer integer = GoblinAnticipateUtils.setState(shareVo.getAboutStartDate(), shareVo.getAboutEndDate()); Integer integer = GoblinAnticipateUtils.setState(shareVo.getAboutStartDate(), shareVo.getAboutEndDate());
if (integer != null && !integer.equals(1)) { if (integer != null && !integer.equals(1)) {
return ResponseDto.failure("预约未开始或已结束!"); return ResponseDto.failure("204","助力已结束!");
} }
//获取uid //获取uid
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
// if (shareVo.getUid().equals(uid)){ if (shareVo.getUid().equals(uid)){
// return ResponseDto.failure("助力失败,本人不能为本人助力!"); return ResponseDto.failure("201","助力失败,本人不能为本人助力!");
// } }
//查询mongodb 是否助力过该分享 //查询mongodb 是否助力过该分享
// GoblinGoodsAnticipateHelpVo goodsAnticipateHelpVo = goblinMongoUtils.getHelpVo(sid, uid); // GoblinGoodsAnticipateHelpVo goodsAnticipateHelpVo = goblinMongoUtils.getHelpVo(sid, uid);
...@@ -257,10 +257,11 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -257,10 +257,11 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//主力人数达到可预约条件 //主力人数达到可预约条件
uidAboutBySkuId(shareVo.getSkuId(),shareVo.getUid()); uidAboutBySkuId(shareVo.getSkuId(),shareVo.getUid());
} }
return ResponseDto.success(true); return ResponseDto.success();
}else {
log.debug("help() false ------> sid:{}",sid);
return ResponseDto.failure("202","重复助力!");
} }
log.debug("help() false ------> sid:{}",sid);
return ResponseDto.success(false);
} }
@Override @Override
...@@ -281,6 +282,16 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -281,6 +282,16 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
return ResponseDto.success(goblinRedisUtils.getShare(skuId, uid)); return ResponseDto.success(goblinRedisUtils.getShare(skuId, uid));
} }
@Override
public ResponseDto<Boolean> helpSid(String sid) {
String uid = CurrentUtil.getCurrentUid();
Integer help = goblinRedisUtils.getHelpByUidAndSid(uid, sid);
if (help == null){
return ResponseDto.success(false);
}
return ResponseDto.success(true);
}
public void sendRedis(String sqlKey, LinkedList<Object[]> sqlData) { public void sendRedis(String sqlKey, LinkedList<Object[]> sqlData) {
LinkedList<String> sql = CollectionUtil.linkedListString(); LinkedList<String> sql = CollectionUtil.linkedListString();
sql.add(SqlMapping.get(sqlKey)); sql.add(SqlMapping.get(sqlKey));
......
...@@ -241,7 +241,6 @@ public class GoblinRedisUtils { ...@@ -241,7 +241,6 @@ public class GoblinRedisUtils {
GoblinGoodsAnticipateShareVo shareVo = getShareVo(sid); GoblinGoodsAnticipateShareVo shareVo = getShareVo(sid);
Integer helpPeople = shareVo.getHelpPeople(); Integer helpPeople = shareVo.getHelpPeople();
shareVo.setHelpPeople(helpPeople != null ? helpPeople += 1 : 1); shareVo.setHelpPeople(helpPeople != null ? helpPeople += 1 : 1);
Integer helpByUidAndSid = getHelpSidAddHelp(sid);
setShareVo(shareVo); setShareVo(shareVo);
} }
......
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