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

Commit f92ef493 authored by GaoHu's avatar GaoHu

exit 助力失败文案提示

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