package com.cpop.oam.business.controller.callback;

import com.cpop.core.annontation.SimpleSignatureCheck;
import com.cpop.core.base.R;
import com.cpop.oam.business.bo.CloudUnionCallbackBo;
import com.cpop.oam.framework.enums.CloudCallbackEnums;
import com.cpop.oam.framework.strategy.cloud.CloudCallbackStrategy;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
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;

/**
 * @author DB
 * @version 1.0.0
 * @since 2024-01-16 11:28
 */
@Api(tags = "云回调controller")
@RestController
@RequestMapping("/cloudCallback")
@Deprecated
public class CallBackCloudCallbackController {

    /**
     * 云联合回调
     * @author DB
     * @since 2024/1/16
     * @param callback 回调参数
     * @return R<Void>
     */
    //@SimpleSignatureCheck
    @ApiOperation("云联合回调")
    @PostMapping("/cloudUnionCallback")
    public R<Void> cloudUnionCallback(@RequestBody @Validated CloudUnionCallbackBo callback) {
        CloudCallbackStrategy cloudCallbackStrategy = CloudCallbackEnums.valueOf(callback.getCallbackEnum()).getCloudCallbackStrategy();
        cloudCallbackStrategy.callback(callback);
        return R.ok();
    }

}
