package cn.ey.biz.module.system.controller.admin.category;

import cn.ey.biz.common.pojo.R;
import cn.ey.biz.module.system.controller.admin.category.vo.CategoryTplRespVO;
import cn.ey.biz.module.system.service.category.CategoryTplService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import static cn.ey.biz.common.pojo.R.success;

@Api(tags = "管理后台 - 字典tpl")
@RestController
@RequestMapping("/system/category-tpl")
@Validated
public class CategoryTplController {

    @Resource
    private CategoryTplService categoryTplService;

    @GetMapping("/get-category-tpl")
    @ApiOperation("根据code查询category-tpl")
    @PreAuthorize("@ss.hasPermission('system:category-data:query')")
    public R<CategoryTplRespVO> getTpl(@RequestParam("categoryCode") String categoryCode) {
        CategoryTplRespVO categoryTplDO=categoryTplService.getTpl(categoryCode);
        return success(categoryTplDO);
    }

}
