package com.yida.data.customForm.controller;

import com.yida.data.common.core.common.ResultBean;
import com.yida.data.customForm.service.CoreCustomFormModelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.xml.transform.Result;

/**
 * 自定义表单模板 Controller
 *
 * @author wjm
 * @date 2021-08-30 15:22:15
 */
@Slf4j
@Validated
@RestController
@RequestMapping("formModel")
@RequiredArgsConstructor
@Api(tags = "后台--表单模板管理")
public class CoreCustomFormModelController {

    private final CoreCustomFormModelService coreCustomFormModelService;

    @GetMapping("/selectFormModel")
    @ApiOperation("查询表单模板")
    public ResultBean selectFormModel(@RequestParam Long id){

        return ResultBean.buildSuccess(coreCustomFormModelService.getById(id));
    }

    @GetMapping("/delFormModel")
    @ApiOperation("删除表单模板")
    public ResultBean delFormModel(@RequestParam Long id){
        coreCustomFormModelService.removeById(id);
        return ResultBean.buildSuccess();
    }
}
