package com.miaxis.open.controller;

import com.miaxis.common.annotation.Log;
import com.miaxis.common.constant.Constants;
import com.miaxis.common.core.controller.BaseController;
import com.miaxis.common.core.domain.Response;
import com.miaxis.common.core.domain.entity.SysDictData;
import com.miaxis.common.core.page.ResponsePageInfo;
import com.miaxis.common.enums.BusinessTypeEnum;
import com.miaxis.common.utils.SecurityUtils;
import com.miaxis.common.utils.poi.ExcelUtil;
import com.miaxis.system.service.ISysDictDataService;
import com.miaxis.system.service.ISysDictTypeService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 数据字典信息
 *
 * @author miaxis
 */
@RestController
@RequestMapping(Constants.OPEN_PREFIX+"/system/dict/data")
@Api(tags={"【OPEN-数据字典信息】"})
public class OpenDictDataController extends BaseController
{

    @Autowired
    private ISysDictTypeService dictTypeService;



    /**
     * 根据字典类型查询字典数据信息
     */
    @GetMapping(value = "/type/{dictType}")
    @ApiOperation("根据字典类型查询字典数据信息")
    public Response<List<SysDictData>> dictType(
            @ApiParam(name = "dictType", value = "根据字典类型查询字典数据信息", required = true)
            @PathVariable("dictType") String dictType
    ){
        return Response.success(dictTypeService.selectDictDataByType(dictType));
    }


}
