package com.dk.mdm.controller.sys;

import com.dk.common.controller.BaseController;
import com.dk.common.response.ResponseResultVO;
import com.dk.common.service.BaseService;
import com.dk.common.model.pojo.system.PageItem;
import com.dk.mdm.service.sys.PageItemService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @desc   : 页面显示项目API接口
 * @date   : 2022/5/20 16:52
 * @author : 寇珊珊
 */
@Api(tags = "页面显示项目API接口")
@RestController
@RequestMapping("/system/page_item")
public class PageItemController extends BaseController<PageItem> {

    @Override
    public BaseService<PageItem> getService() {
        return pageItemService;
    }

    @Autowired
    private PageItemService pageItemService;

    /**
     * @desc : 敏感字段树形结构
     * @date : 2022/5/11 13:19
     * @author : 寇珊珊
     */
    @PostMapping({"select_tree_by_doc"})
    public ResponseResultVO selectTreeByDoc(@RequestBody PageItem pageItem ) {
        return pageItemService.selectTreeByDoc(pageItem);
    }

    /*
     * @desc   : 根据docCode查询可打印的pageItem
     * @author : 沈博
     * @date   : 2022/6/28 10:23
     */
    @PostMapping({"select_page_item_by_doc"})
    public ResponseResultVO selectPageItemByDoc(@RequestBody List<Map<String,Object>> maps) {
        return pageItemService.selectPageItemByDoc(maps);
    }



}
