package com.weaver.seconddev.chapanda.feishu.esb;

import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.seconddev.chapanda.feishu.util.Esb2FeishuCalendarPrimaryUtil;
import com.weaver.seconddev.chapanda.feishu.util.Esb2FeishuProfilePictureUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service("Esb2FeishuCalendarsPrimaryAction")
public class Esb2FeishuCalendarsPrimaryAction implements EsbServerlessRpcRemoteInterface {
    private final static Logger log = LoggerFactory.getLogger(Esb2FeishuCalendarsPrimaryAction.class);

    @Autowired
    Esb2FeishuCalendarPrimaryUtil esb2FeishuCalendarPrimaryUtil;

    @Override
    public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {

        log.error("Esb2FeishuCalendarsPrimaryAction start");
        String calendarId = esb2FeishuCalendarPrimaryUtil.queryUserCalendarPrimary();
        Map<String, Object> actionMap = new HashMap<String, Object>();
        actionMap.put("code",200);
        actionMap.put("msg","Esb2FeishuCalendarsPrimaryAction");
        actionMap.put("calendarId",calendarId);

        return WeaResult.success(actionMap);
    }

}
