package com.xiang.xservice.application.generator.controller;

import com.xiang.xservice.application.generator.entity.dto.TemplateList;
import com.xiang.xservice.application.generator.service.TemplateService;
import com.xiang.xservice.basic.common.resp.Result;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 模板管理控制器
 *
 * @author zhengkai.blog.csdn.net
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("system/generator/template")
public class TemplateController {

    private final TemplateService templateService;

    @PostMapping("/all")
    public Result<TemplateList> getAllTemplates() throws Exception {
        return Result.success(templateService.getAllTemplates());
    }

}