package com.xisc.pm.api.controller.v1;


import com.xisc.pm.api.dto.InterfaceReceiveDTO;
import com.xisc.pm.app.service.InterfaceReceiveService;
import io.choerodon.swagger.annotation.Permission;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.hzero.core.util.Results;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * fileName: InterfaceReceiveController
 * description: 二级数据接收接口
 * history:
 *
 * @author 张建元 jianyuan.zhang@hand-china.com
 * @version 1.0.0
 * @since 2024-08-27 15:57
 */
@RestController("interfaceReceiveController.v1")
@RequestMapping("/v1/{organizationId}/equipment")
@Api(tags = "二级接口")
public class InterfaceReceiveController {

    @Autowired
    private InterfaceReceiveService interfaceReceiveService;

    @ApiOperation(value = "二级接口")
    @Permission(permissionLogin = true)
    @PostMapping()
    public ResponseEntity<Void> receiveInterface(@PathVariable Long organizationId, @RequestBody InterfaceReceiveDTO dto) {
        interfaceReceiveService.receiveInterface(organizationId, dto);
        return Results.success();
    }
}
