package com.fs.app.controller;


import com.alibaba.fastjson.JSON;
import com.fs.ad.enums.AdUploadType;
import com.fs.ad.service.IAdHtmlClickLogService;
import com.fs.common.core.domain.R;
import com.fs.company.service.ICompanyWxChatService;
import com.fs.qw.vo.AdUploadVo;
import com.fs.wxUser.service.ICompanyWxUserService;
import io.swagger.annotations.Api;
import jdk.nashorn.internal.ir.annotations.Ignore;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@Api("公共接口")
@RestController
@AllArgsConstructor
@Ignore
@RequestMapping(value="/app/common")
public class CommonController {
    private IAdHtmlClickLogService adHtmlClickLogService;
    private RocketMQTemplate rocketMQTemplate;

    @GetMapping("/testSend")
    public R testSend(String id){
        AdUploadVo build = AdUploadVo.builder().state(id).type(AdUploadType.ADD_WX).build();
        rocketMQTemplate.syncSend("ad-upload", JSON.toJSONString(build));
//        adHtmlClickLogService.upload(id, AdUploadType.ADD_WX, e -> {});
        return R.ok();
    }

}
