package cmm.util;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import cmm.Constant;

/**
 * 
 * fix된 코드에 관한것만 사용하는 클래스
 */
public class CmmCodeUtil {
	@SuppressWarnings("unused")
	private static final Logger LOGGER = LoggerFactory.getLogger(CmmCodeUtil.class);
	
	public static List<CmmCodeVO> getAreaCodeList() {
		List<CmmCodeVO> rtnList = new ArrayList<CmmCodeVO>();
		Arrays.sort(Constant.AREA_CODE_ARRAY); // 지역번호 정렬
		CmmCodeVO vo = null;
		for(String v : Constant.AREA_CODE_ARRAY){
			vo = new CmmCodeVO();
			vo.setCode(v);
			vo.setCodeNm(v);
			vo.setCodeDc(v);
			rtnList.add(vo);
		}
		return rtnList;
	}
	public static List<CmmCodeVO> getMobileCodeList() {
		List<CmmCodeVO> rtnList = new ArrayList<CmmCodeVO>();
		Arrays.sort(Constant.MOBILE_CODE_ARRAY); // 번호 정렬
		CmmCodeVO vo = null;
		for(String v : Constant.MOBILE_CODE_ARRAY){
			vo = new CmmCodeVO();
			vo.setCode(v);
			vo.setCodeNm(v);
			vo.setCodeDc(v);
			rtnList.add(vo);
		}
		return rtnList;
	}
	public static List<CmmCodeVO> getSidoCodeList() {
		List<CmmCodeVO> rtnList = new ArrayList<CmmCodeVO>();
		CmmCodeVO vo = null;
		for(int i=0;i<Constant.DF_SIDO_CODE_ARRAY.length;i++){
			vo = new CmmCodeVO();
			vo.setCode(Constant.DF_SIDO_CODE_ARRAY[i]);
			vo.setCodeNm(Constant.DF_SIDO_NAME_ARRAY[i]);
			vo.setCodeDc(Constant.DF_SIDO_NAME_ARRAY[i]);
			rtnList.add(vo);
		}
		return rtnList;
	}
	public static List<CmmCodeVO> getSidoCodeList2() {
		List<CmmCodeVO> rtnList = new ArrayList<CmmCodeVO>();
		CmmCodeVO vo = null;
		for(int i=0;i<Constant.SIDO_NAME_ARRAY.length;i++){
			vo = new CmmCodeVO();
			vo.setCode(Constant.SIDO_NAME_ARRAY[i]);
			vo.setCodeNm(Constant.SIDO_NAME_ARRAY[i]);
			vo.setCodeDc(Constant.SIDO_NAME_ARRAY[i]);
			rtnList.add(vo);
		}
		return rtnList;
	}
}
