
package com.tmerclub.cloud.user.listener;

import com.tmerclub.cloud.common.rocketmq.config.RocketMqConstant;
import com.tmerclub.cloud.user.service.UserExtensionService;
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;

/**
 * @author tmerclub
 */
@Component
@RocketMQMessageListener(topic = RocketMqConstant.SEND_NOTIFY_TO_USER_EXTENSION_TOPIC, consumerGroup = RocketMqConstant.SEND_NOTIFY_TO_USER_EXTENSION_TOPIC)
public class UserGrowthConsumer implements RocketMQListener<Long> {

    @Autowired
    private UserExtensionService userExtensionService;

    @Override
    public void onMessage(Long orderId) {
        userExtensionService.updateScoreAndGrowth(orderId);
    }

}
