package com.fs.app.controller;


import com.alibaba.fastjson.JSON;
import com.fs.ad.service.IAdHtmlClickLogService;
import com.fs.common.core.domain.R;
import com.fs.course.domain.FsCourseWatchLog;
import com.fs.qw.domain.QwExternalContact;
import com.fs.qw.domain.QwUser;
import com.fs.qw.service.IQwExternalContactService;
import com.fs.qw.service.impl.QwExternalContactServiceImpl;
import com.fs.qwApi.param.QwExternalContactRemarkParam;
import com.fs.qwApi.service.QwApiService;
import com.fs.voice.utils.StringUtil;
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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


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


    @PostMapping("/testSend")
    public R testSend(@RequestBody FsCourseWatchLog watchLog){


        try {
            rocketMQTemplate.syncSend("course-finish-notes", JSON.toJSONString(watchLog));
        }catch (Exception e){
            log.error("添加完课打备注失败",e);
        }

        return R.ok();
    }

}
