package com.fs.company.controller.common;

import com.alibaba.fastjson.JSON;
import com.fs.ad.enums.AdUploadType;
import com.fs.common.annotation.DataSource;
import com.fs.common.core.domain.R;
import com.fs.common.enums.DataSourceType;
import com.fs.his.utils.qrcode.QRCodeUtils;
import com.fs.qw.vo.AdUploadVo;
import com.fs.sop.service.IQwSopTempContentService;
import com.fs.sop.service.IQwSopTempDayService;
import com.fs.sop.service.IQwSopTempRulesService;
import com.fs.sop.service.IQwSopTempService;
import com.google.zxing.WriterException;
import lombok.AllArgsConstructor;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

@RestController
@AllArgsConstructor
public class Test {

    private final IQwSopTempService qwSopTempService;
    private final IQwSopTempRulesService qwSopTempRulesService;
    private final IQwSopTempDayService qwSopTempDayService;
    private final IQwSopTempContentService qwSopTempContentService;
    private final RocketMQTemplate rocketMQTemplate;
    @GetMapping("test")
    @DataSource(DataSourceType.SOP)
    public void fileDownload(){
        rocketMQTemplate.syncSend("ad-upload", JSON.toJSONString(AdUploadVo.builder().state("测试").type(AdUploadType.ADD_WX).build()));
    }

}
