package com.dk.mdm.controller.mst;

import com.dk.common.model.pojo.PageList;
import com.dk.common.response.ResponseResultVO;
import com.dk.mdm.model.pojo.mst.TableSet;
import com.dk.common.service.BaseService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import com.dk.mdm.service.mst.TableSetService;

@Api(tags = "用户表格设置API接口")
@RestController
@RequestMapping("/mst/tableSet")
public class TableSetController{

    public BaseService<TableSet> getService() {
        return tableSetService;
    }

    @Autowired
    private TableSetService tableSetService;

    /**
     * @desc : 条件查询
     * @author : 周兴
     * @date : 2024/7/31 10:36
     */
    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
    @PostMapping({"list_by"})
    public ResponseResultVO<PageList<TableSet>> selectByCond(@RequestBody TableSet tableSet) {
        return tableSetService.selectByCond(tableSet);
    }

    /**
     * @desc : 保存表格设置
     * @author : 周兴
     * @date : 2024/7/31 9:39
     */
    @ApiOperation( value = "新建", notes = "新建" )
    @PostMapping({"save_table_set"})
    public ResponseResultVO<?> saveTableSet(@RequestBody TableSet tableSet) {
        return tableSetService.saveTableSet(tableSet);
    }
}
