package cn.sagacloud.server.algorithm.controllers.modelFile

import cn.sagacloud.server.algorithm.models.modelFile.ModelFile
import cn.sagacloud.server.algorithm.models.monitor.ModelMonitor
import cn.sagacloud.server.algorithm.services.BaseDataService
import com.sybotan.service.SPageContext
import com.sybotan.service.models.requests.SQueryRequest
import com.sybotan.service.models.requests.SUpdateRequest
import com.sybotan.service.models.responses.SBaseResponse
import com.sybotan.service.models.responses.SQueryResponse
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
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
import java.lang.StringBuilder

/**
 *
 *
 * @author jxing
 */
@Api(tags = ["楼层模型接口"])
@RestController
@RequestMapping("/model-monitor")
class ModelMonitorController {
    companion object {
        // 日志
        private val logger = LoggerFactory.getLogger(FloorModelController::class.java)
    } // Companion object

    val dataService = BaseDataService


    /**
     * 查询监控记录
     *
     * @param   request     查询请求
     * @return  查询结果应答信息
     */
    @ApiOperation(value = "查询监控记录", notes = "")
    @PostMapping(value = ["/query"])
    fun query(@RequestBody request: SQueryRequest): SQueryResponse<ModelMonitor> {
        return dataService.modelMonitorService.pageQuery(request)
    } // Function query()

    /**
     * 更新监控记录
     *
     * @param   request     更新请求
     * @return  更新结果应答信息
     */
    @ApiOperation(value = "更新监控记录", notes = "")
    @PostMapping(value = ["/update"])
    fun update(@RequestBody request: SUpdateRequest<ModelMonitor>): SBaseResponse {
        return dataService.modelMonitorService.updateList(request)
    } // Function update()
}