package com.wms_main.controller.wms;

import com.wms_main.model.dto.request.wms.BaseWmsRequest;
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
import com.wms_main.service.controller.ISystemControllerService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 系统控制类
 */
@RestController
@ResponseBody
@CrossOrigin
@RequiredArgsConstructor
@RequestMapping("/wms/system")
public class SystemController {
    private final ISystemControllerService systemControllerService;// 系统控制类服务

    /**
     * 重启系统
     * @param baseWmsRequest 请求
     * @return 响应结果
     */
    @PostMapping("/restartSystem")
    public BaseWmsApiResponse restartSystem(@RequestBody BaseWmsRequest baseWmsRequest) {
        return systemControllerService.restartSystem(baseWmsRequest);
    }

    /**
     * 重载配置
     * @param baseWmsRequest 请求
     * @return 响应结果
     */
    @PostMapping("/reloadConfig")
    public BaseWmsApiResponse reloadConfig(@RequestBody BaseWmsRequest baseWmsRequest) {
        return systemControllerService.reloadConfig(baseWmsRequest);
    }
}
