All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yes.tools.generator.controller.TableAttributeController Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
package org.yes.tools.generator.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.yes.tools.core.result.CommonResult;
import org.yes.tools.generator.io.TableIo;
import org.yes.tools.generator.model.TableAttributeModel;
import org.yes.tools.generator.model.TableModel;

import java.util.List;

/**
 * @author Co.
 * @name TableAttributeController
 * @date 2023/4/6 11:03
 */
@Tag(name = "表管理")
@RestController(value = "generatorTableAttributeController")
public class TableAttributeController {

    @Autowired
    private TableIo tableIo;

    @Operation(summary = "保存表属性")
    @PostMapping("api/table/saveTableAttribute")
    public CommonResult saveTableAttribute(@RequestBody TableAttributeModel model) {
        Boolean aBoolean = tableIo.saveTableAttribute(model);
        return CommonResult.success(aBoolean);
    }

    @Operation(summary = "更新表属性")
    @PostMapping("api/table/modifyTableAttribute")
    public CommonResult modifyTableAttribute(@RequestBody TableAttributeModel model) {
        Boolean aBoolean = tableIo.modifyTableAttribute(model);
        return CommonResult.success(aBoolean);
    }

    @Operation(summary = "查询表属性")
    @GetMapping("api/table/getTableAttribute")
    public CommonResult getTableAttribute(@RequestParam("menuId") String menuId) {
        TableAttributeModel tableAttribute = tableIo.getTableAttribute(menuId);
        return CommonResult.success(tableAttribute);
    }

    @Operation(summary = "保存表")
    @PostMapping("api/table/saveTable")
    public CommonResult saveTable(@RequestBody TableModel model) {
        Boolean aBoolean = tableIo.saveTable(model);
        return CommonResult.success(aBoolean);
    }

    @Operation(summary = "更新表")
    @PostMapping("api/table/modifyTable")
    public CommonResult modifyTable(@RequestBody TableModel model) {
        Boolean aBoolean = tableIo.modifyTable(model);
        return CommonResult.success(aBoolean);
    }

    @Operation(summary = "查询表详情")
    @GetMapping("api/table/getTable")
    public CommonResult getTable(@RequestParam("id") String id) {
        TableModel table = tableIo.getTable(id);
        return CommonResult.success(table);
    }

    @Operation(summary = "查询表列表")
    @GetMapping("api/table/getTableList")
    public CommonResult> getTableList(@RequestParam("menuId") String menuId) {
        List tableList = tableIo.getTableList(menuId);
        return CommonResult.success(tableList);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy