
package com.tmerclub.cloud.group.listener;

import com.tmerclub.cloud.common.rocketmq.config.RocketMqConstant;
import com.tmerclub.cloud.group.bo.GroupOpenNotifyBO;
import com.tmerclub.cloud.group.service.GroupOrderService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


/**
 * 参团or开团 订单更新
 * @author TRACK
 */
@Component
@RocketMQMessageListener(topic = RocketMqConstant.GROUP_ORDER_OPEN_AND_JOIN_GROUP_TOPIC, consumerGroup = RocketMqConstant.GROUP_ORDER_OPEN_AND_JOIN_GROUP_TOPIC)
public class GroupOrderOpenAndJoinListener implements RocketMQListener<GroupOpenNotifyBO> {

    @Autowired
    private GroupOrderService groupOrderService;

    @Override
    public void onMessage(GroupOpenNotifyBO groupOpenNotifyBO) {
        groupOrderService.updateToPaySuccess(groupOpenNotifyBO.getOrderId(), groupOpenNotifyBO.getIdentityType(), groupOpenNotifyBO.getGroupTeamId());
    }
}
