package com.izouma.nineth.listener;

import com.izouma.nineth.service.ActivityCollectionService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;

@Service
@Slf4j
@AllArgsConstructor
@RocketMQMessageListener(
        consumerGroup = "${general.update-activity-stock-group}",
        topic = "${general.update-activity-stock-topic}",
        consumeMode = ConsumeMode.ORDERLY)
@ConditionalOnProperty(value = "general.notify-server", havingValue = "false", matchIfMissing = true)
public class UpdateActivityStockListener implements RocketMQListener<Long> {

    private ActivityCollectionService activityCollectionService;

    // TODO: 2022/4/25  暂时废弃
    @Override
    public void onMessage(Long id) {
//        activityCollectionService.syncStock(id);
    }
}
