package com.goldenwater.slgc.controller.proxy;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.goldenwater.common.core.controller.BaseController;
import com.goldenwater.common.core.domain.AjaxResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

@Tag(name = "25. 风情管理")
@RestController
@RequestMapping("/slgc/wind")
public class WindController extends BaseController {

    private static final String YJZH = "http://10.8.4.171:816/YJZH.asmx";

    @Operation(summary = "25.01 查询当日风浪数据")
    @GetMapping("/list")
    public AjaxResult list(@RequestParam(defaultValue = "") String date) {
        return success(ProxyHelper.fetchSoapXmlToJson(YJZH + "/SELECT_QXFL?st=" + date));
    }

    @Operation(summary = "25.02 查询单站风浪序列")
    @GetMapping("/station")
    public AjaxResult station(String stcd, String st, String et) {
        return success(ProxyHelper.fetchSoapXmlToJson(YJZH + "/SELECT_FLSTCD?stcd=" + (stcd != null ? stcd : "")
                + "&st=" + (st != null ? st : "") + "&et=" + (et != null ? et : "")));
    }
}
