package com.yihu.hos.resource.controller;

import com.yihu.hos.resource.service.StdService;
import com.yihu.hos.web.framework.model.Result;
import com.yihu.hos.web.framework.util.controller.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 数据采集配置页面
 * Created by hzp on 2015/8/12.
 */
@RequestMapping("/std")
@Controller("stdController")
public class StdController extends BaseController {



    @Resource(name = StdService.BEAN_ID)
    StdService stdService;


    /**************************** 标准字典 ************************************************/
    /**
     * 通过字典ID获取字段
     * @return
     */
    @RequestMapping("getDictByScheme")
    @ResponseBody
    public Result getDictByScheme(String version, String dictId){
        try {
            return stdService.getDictResultByVersion(version, dictId);
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }


}
