package com.tofly.xrtygis.controller.sig;

import com.tofly.common.core.entity.ResultRespone;
import com.tofly.xrtygis.custom.util.CallAPIUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 森鑫炬对接接口
 * @author BZ-DJJ
 */
@RestController
@RequestMapping("/sxjDocking")
@Api(tags="森鑫炬对接接口")
public class SXJDockingController {

    @PostMapping("/send" )
    @ApiOperation(value = "接口调用")
    public ResultRespone<Map> getSign(@RequestBody  Dto dto) {
        try {
            return ResultRespone.success(CallAPIUtil.callAPIUtil(dto.object,dto.url));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return ResultRespone.failed();
    }

    static class Dto{
        private Object object;
        private String url;

        public Object getObject() {
            return object;
        }

        public void setObject(Object object) {
            this.object = object;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }
    }
}
