package com.usky.vpp.controller.un;

import com.usky.vpp.service.VppUnDnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 运管平台 DN 侧被动接口（UN 调用 DN）
 * 路径与服务名一致，如 /TokenRequest、/Poll
 */
@RestController
public class UnDnController {

    @Autowired
    private VppUnDnService vppUnDnService;

    @PostMapping("/TokenRequest")
    public Map<String, Object> tokenRequest(@RequestBody(required = false) Map<String, Object> body) {
        return vppUnDnService.tokenRequest(body);
    }

    @PostMapping("/CreateRegistrationRequest")
    public Map<String, Object> createRegistration(@RequestBody(required = false) Map<String, Object> body) {
        return vppUnDnService.createRegistration(body);
    }

    @PostMapping("/RegisterReportRequest")
    public Map<String, Object> registerReport(@RequestBody(required = false) Map<String, Object> body) {
        return vppUnDnService.registerReport(body);
    }

    @PostMapping("/MomentDataReportRequest")
    public Map<String, Object> momentDataReport(@RequestBody(required = false) Map<String, Object> body) {
        return vppUnDnService.momentDataReport(body);
    }

    @PostMapping("/IntervalDataReportRequest")
    public Map<String, Object> intervalDataReport(@RequestBody(required = false) Map<String, Object> body) {
        return vppUnDnService.intervalDataReport(body);
    }

    @PostMapping("/Poll")
    public Map<String, Object> poll(@RequestBody(required = false) Map<String, Object> body) {
        return vppUnDnService.poll(body);
    }

    @PostMapping("/DistributeEventRequest")
    public Map<String, Object> distributeEvent(@RequestBody(required = false) Map<String, Object> body) {
        return vppUnDnService.distributeEvent(body);
    }

    @PostMapping("/CreateOptRequest")
    public Map<String, Object> createOpt(@RequestBody(required = false) Map<String, Object> body) {
        return vppUnDnService.createOpt(body);
    }

    @PostMapping("/CreateCqRequest")
    public Map<String, Object> createCq(@RequestBody(required = false) Map<String, Object> body) {
        return vppUnDnService.createCq(body);
    }

    @PostMapping("/CreateEventResponse")
    public Map<String, Object> createEventResponse(@RequestBody(required = false) Map<String, Object> body) {
        return vppUnDnService.createEventResponse(body);
    }
}
