|
|
|
@@ -53,6 +53,29 @@ public class TtCouponController extends BaseController { |
|
|
|
return new ResultData(ttCouponService.detail(id)); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("是否收藏") |
|
|
|
@GetMapping("/iscollect") |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
public ResultData iscollect(@RequestParam Long id) { |
|
|
|
logger.debug("[" + getIpAddr() + "] TtCouponController::iscollect"); |
|
|
|
if (id == null) { |
|
|
|
return new ResultData(ResultData.ERROR, "缺少id"); |
|
|
|
} |
|
|
|
Long memberId; |
|
|
|
try { |
|
|
|
memberId = getMemberId(); |
|
|
|
} catch (MallinkException e) { |
|
|
|
return new ResultData(e.getErrorCode(), e.getMessage()); |
|
|
|
} |
|
|
|
int count = ttCouponService.getcollect(memberId,id); |
|
|
|
if(count > 0){ |
|
|
|
return new ResultData(true); |
|
|
|
}else{ |
|
|
|
return new ResultData(false); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("收藏") |
|
|
|
@GetMapping("/collectCoupon") |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
@@ -93,6 +116,28 @@ public class TtCouponController extends BaseController { |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("是否关注") |
|
|
|
@GetMapping("/isfollow") |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
public ResultData isfollow(@RequestParam Long id) { |
|
|
|
logger.debug("[" + getIpAddr() + "] TtCouponController::isfollow"); |
|
|
|
if (id == null) { |
|
|
|
return new ResultData(ResultData.ERROR, "缺少id"); |
|
|
|
} |
|
|
|
Long memberId; |
|
|
|
try { |
|
|
|
memberId = getMemberId(); |
|
|
|
} catch (MallinkException e) { |
|
|
|
return new ResultData(e.getErrorCode(), e.getMessage()); |
|
|
|
} |
|
|
|
int count = ttCouponService.getfollow(memberId,id); |
|
|
|
if(count > 0){ |
|
|
|
return new ResultData(true); |
|
|
|
}else{ |
|
|
|
return new ResultData(false); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("关注") |
|
|
|
@GetMapping("/followMerchant") |
|
|
|
|