package com.yifu.cloud.plus.v1.yifu.common.dapr.util;

import com.alibaba.fastjson.JSON;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprEkpProperties;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;

import java.util.List;

/**
 * @Author huyc
 * @Date 2024-02-28
 * @Description
 * @Version 1.0
 */
@Log4j2
@EnableConfigurationProperties(DaprEkpProperties.class)
public class EkpDaprUtils {

	@Autowired
	private DaprEkpProperties daprProperties;

	/**
	 * @Author huyc
	 * @Description 更新结算信息
	 * @Date 16:18 2024/02/28
	 * @Param
	 * @return
	 **/
	public R<EkpSocialPushInfoVo> pushSocialInfoToEkp(List<EkpPushSocialParam> unPushList) {
		return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/ekpSocialPush/inner/pushSocialInfoToEkp", JSON.toJSONString(unPushList), EkpSocialPushInfoVo.class, SecurityConstants.FROM_IN);
	}
}
