package com.persagy.revit.controllers.modelEntity

import com.persagy.revit.models.request.BaseGraphRequest
import com.persagy.revit.services.endpoint.BaseGraphService
import com.persagy.service.models.responses.SBaseResponse
import io.swagger.v3.oas.annotations.tags.Tag
import io.swagger.v3.oas.annotations.Operation
import org.slf4j.LoggerFactory
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 jxing
 */
@Tag(name = "获取底图接口")
@RestController
@RequestMapping("/base-graph")
class BaseGraphController {
    companion object {
        // 日志
        private val logger = LoggerFactory.getLogger(BeaconController::class.java)
    } // Companion object

    /**
     * 查询底图
     *
     * @param   request     查询请求
     * @return  查询结果应答信息
     */
    @Operation(summary = "查询底图", description =  "")
    @PostMapping(value = ["/query"])
    fun query(@RequestBody request: BaseGraphRequest): SBaseResponse {
        return BaseGraphService.composeBaseGraph(request)
    } // Function query()


    //    if (response.result == SResponseType.success) {
//        val bgRequest = BaseGraphRequest()
//        bgRequest.modelId = request.currentModelId
//        val bg = baseGraph.query(bgRequest)
//        if (bg.result == SResponseType.success) {
//            // 上传文件
//            return response
//        }else{
//            return SBaseResponse(SResponseType.failure,"获取底图失败")
//        }
//    }
}