<?php

namespace app\adminapi\controller\diy;

use app\adminapi\controller\Controller;
use app\adminapi\service\diy\Template as TemplateService;
use think\facade\Request;

/**
 * @package app\adminapi\controller\diy
 * @class Template
 * @author xzncit 2024/3/28
 */
class Template extends Controller {

    /**
     * @return \think\response\Json
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function index(){
        return returnAjax("msg:ok",1,TemplateService::getList());
    }

    public function save(){
        return returnAjax("msg:ok",1,TemplateService::save(Request::param("id",0,"intval")));
    }

}