package org.springblade.modules.app.web.outapi;

import org.springblade.common.auth.permission.DisableLoginVerify;
import com.wn.common.controller.BaseController;
import com.wn.common.datamodel.ResultDTO;
import org.springblade.modules.app.common.vo.OutApiSyncParamVO;
import org.springblade.modules.app.manager.SyncManager;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
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;

/**
 * <p>
 * 对外同步 前端控制器
 * </p>
 *
 * @author fuxinsheng
 * @since 2021-12-20
 */
@RestController
@RequestMapping("app/sync")
public class SyncContraller extends BaseController {

    @Autowired
    private SyncManager syncManager;

    //@ApiOperation(value = "备案单审批结果通知")
    @PostMapping("/waybill/result")
    @DisableLoginVerify
    public ResponseEntity<ResultDTO<Boolean>> syncWaybillResult(@RequestBody OutApiSyncParamVO syncParamVO) {
        return success(syncManager.syncWaybillResult(syncParamVO));
    }

    //@ApiOperation(value = "检疫站检疫结果通知")
    @PostMapping("/verify/result")
    @DisableLoginVerify
    public ResponseEntity<ResultDTO<Boolean>> syncVerifyResult(@RequestBody OutApiSyncParamVO syncParamVO) {
        return success(syncManager.syncVerifyResult(syncParamVO));
    }

}
