const {request, summary, tags, body, path} = require('koa-swagger-decorator');
import { sqlTabelHead } from "../repository/listHead.js";
import Restful from '../utils/Restful.js';

function setPath(path) {
    return `/list/tabel/${path}`;
}

let restful = new Restful();

const tag = tags(['表格相关']);

export default class Routers {

    @request('get', setPath('head'))
    @tag
    @summary('获取表格头部')
    static async getTableHead (ctx, next){
        let list = await sqlTabelHead();
        restful.rest(ctx, {headList:list});
    }
};
