package com.tzld.piaoquan.api.controller.wecom.thirdpart;

import com.tzld.piaoquan.api.model.param.wecom.thirdpart.WeComThirdPartyCallBackParam;
import com.tzld.piaoquan.api.service.wecom.thirdparty.WeComThirdPartyCallBackService;
import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/wecom/thirdparty")
public class WeComThirdPartyCallBackController {

    @Autowired
    private WeComThirdPartyCallBackService service;

    @PostMapping("/callback")
    public CommonResponse<String> callback(@RequestBody WeComThirdPartyCallBackParam param) {
        service.handleCallback(param);
        return CommonResponse.success();
    }
}
