package com.gic.haoban.manage.web.controller.moment;

import com.alibaba.fastjson.JSONObject;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.api.service.moment.QwMomentApiService;
import com.gic.search.engine.api.service.dynamic.ESDataDynamicOperationApiService;
import com.gic.web.common.utils.DataApiUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 企微朋友圈
 */
@RestController
@RequestMapping("/qw-moment")
public class QwMomentDataController {

    private static Logger logger = LogManager.getLogger(QwMomentDataController.class);

    /**
     * 概览
     */
    @RequestMapping("data_qw_moment_plan_overview")
    @ResponseBody
    public RestResponse<Object> rewardLevel(Long planId) {
        WebLoginDTO user = AuthWebRequestUtil.getLoginUser();
        String enterpriseId = user.getEnterpriseId();
        JSONObject json = new JSONObject();
        json.put("planId", planId) ;
        json.put("enterpriseId",enterpriseId) ;
        Map<String, Object> res = DataApiUtils.http(json.toJSONString(), "data_qw_moment_plan_overview");
        JSONObject data = DataApiUtils.getPageOne(res);
        return RestResponse.successResult(data);
    }

}
