package com.bonus.sharedstation.api.service.impl;

import com.bonus.sharedstation.api.DictDataApi;
import com.bonus.sharedstation.api.service.DictService;
import com.bonus.sharedstation.api.vo.DictDataInfoDO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController // 提供 RESTful API 接口，给 Feign 调用
@Validated
public class DictDataApiImpl implements DictDataApi {

    @Resource
    private DictService dictService;

    @Override
    public List<DictDataInfoDO> getDictionaryInfo(String dataType) {
        return dictService.getDictionaryInfo(dataType);
    }

    /**
     * 单个返回值
     *
     * @param dataType
     * @return
     */
    @Override
    public DictDataInfoDO getDictionaryData(String dataType) {
        return dictService.getDictionaryData(dataType);
    }

    /**
     * 单个返回值 多个参数查询
     *
     * @param dataType
     * @param dataCode
     * @return
     */
    @Override
    public DictDataInfoDO getDictionaryDataByCondition(String dataType, String dataCode) {
        return dictService.getDictionaryDataByCondition(dataType, dataCode);
    }
}
