package com.yuchen.saas.park.service.controller.repair;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yuchen.saas.park.api.dto.repair.SaasMatterRepairSetDto;
import com.yuchen.saas.park.api.vo.repair.SaasMatterRepairSetVo;
import com.yuchen.saas.park.service.service.repair.ISaasMatterRepairSetService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 报事报修基础设置表 前端控制器
 * </p>
 *
 * @author caiwq
 * @since 2024-04-23
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/matterRepairSet")
public class SaasMatterRepairSetController {

    private final ISaasMatterRepairSetService baseService;

    /**
     * 添加报事报修基础设置
     * @param matterRepairSetDto 报事报修基础设置Dto
     * @return TRUE/FALSE
     */
    @PostMapping("/add")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "添加报事报修基础设置", notes = "添加报事报修基础设置")
    public R<Boolean> add(@RequestBody @Validated SaasMatterRepairSetDto matterRepairSetDto) {
        return R.data(baseService.add(matterRepairSetDto));
    }

    /**
     * 报事报修基础设置详情
     * @return 消息详情Vo
     */
    @GetMapping("/getDetail")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "报事报修基础设置详情", notes = "报事报修基础设置详情")
    public R<SaasMatterRepairSetVo> getDetail() {
        return R.data(baseService.getDetail());
    }

}
