请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

优惠券是什么时候加入redis缓存的

老师,优惠券是在哪加入缓存的,商户系统还是用户系统?看课程介绍上面的架构图,优惠券投放后有个优惠券token保存,这个在代码中哪块怎么体现出来的

正在回答 回答被采纳积分+3

1回答

张勤一 2018-09-13 22:57:06

这个在投放的时候就已经完成了,可以看看投放优惠券那里

0 回复 有任何疑惑可以回复我~
  • 提问者 一白_yibai #1
    public Response dropPassTemplate(PassTemplate template) {
            Response response = new Response();
            //校验优惠券码的有效性
            ErrorCode errorCode = template.validate(merchantsDao);
            if(errorCode != ErrorCode.SUCCESS){
                response.setErrorCode(errorCode.getCode());
                response.setErrorMsg(errorCode.getDesc());
            }else{
                String passTemplate = JSON.toJSONString(template);
                kafkaTemplate.send(
                        Constants.TEMPLATE_TOPIC,
                        Constants.TEMPLATE_TOPIC,
                        passTemplate);
                log.info("DropPassTemplates: {}", passTemplate);
            }
            return response;
        }
    这段投放的代码里只是下发到kafka,没写入redis啊
    回复 有任何疑惑可以回复我~ 2018-09-13 23:13:01
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号