package com.fs.qwHookApi.service.impl;

import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.fs.common.core.domain.R;
import com.fs.qwHookApi.param.QwHookSendMsgParam;
import com.fs.qwHookApi.service.QwHookApiService;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class QwHookApiServiceImpl implements QwHookApiService {
    private static final org.slf4j.Logger log = LoggerFactory.getLogger(QwHookApiServiceImpl.class);
    String baseUrl="http://127.0.0.1:8989";


    @Override
    public R sendMsg(QwHookSendMsgParam param) {

        String result = HttpRequest.post(baseUrl+"/wxwork").header("Content-Type", "application/json;charset=UTF-8").body(String.valueOf(JSONUtil.toJsonStr(param))).execute().body();
       return R.ok(result);
    }

    @Override
    public R loginStatus() {
        return null;
    }

    @Override
    public R login() {
        return null;
    }

    @Override
    public R LogOut() {
        return null;
    }

    @Override
    public R code(String code) {
        return null;
    }


}
