package com.fs.store.service.impl;

import com.fs.store.dto.ClientCredGrantReqDTO;
import com.fs.store.dto.MiniGramSubsMsgResultDTO;
import com.fs.store.dto.TemplateMessageSendRequestDTO;
import com.fs.store.dto.WeXinAccessTokenDTO;
import com.fs.store.service.IWechatMiniProgrService;
import com.fs.store.utils.MiniProgramHttp;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@RequiredArgsConstructor
@Service
@Slf4j
public class IWechatMiniProgrServiceImpl implements IWechatMiniProgrService {

    private final MiniProgramHttp miniProgramHttp;

    @Override
    public WeXinAccessTokenDTO getStableToken(ClientCredGrantReqDTO param) {
        return miniProgramHttp.getStableAccessToken(param);
    }

    @Override
    public MiniGramSubsMsgResultDTO sendSubscribeMsg(String accessToken,TemplateMessageSendRequestDTO param) {
        return miniProgramHttp.sendSubscribeMessage(accessToken,param);
    }
}
