package com.skr.mdm.api.system.controller;

import com.skr.mdm.api.system.service.SystemCleanService;
import com.skr.mdm.bean.qo.system.SystemCleanQO;
import com.skr.mdm.bean.vo.system.SysCleanVO;
import com.skr.mdm.result.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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 javax.validation.Valid;

/**
 * @author nfq
 * @date 2023-03-13 14:14
 */
@RequestMapping("system/clean")
@RestController
@Api(tags = "系统清理")
@Validated
public class SystemCleanController {

    @Autowired
    private SystemCleanService systemCleanService;

    @ApiOperation(value = "系统清理参数获取", response = SysCleanVO.class)
    @PostMapping("info")
    public ResponseResult getSystemParam() {
        return systemCleanService.getSystemCleanParam();
    }

    @ApiOperation("系统清理参数配置")
    @PostMapping("config")
    public ResponseResult updateParam(@Valid @RequestBody SystemCleanQO systemCleanQO) {
        return systemCleanService.systemCleanConfig(systemCleanQO);
    }
}
