package kr.wisestone.owl.constant;
|
|
import com.google.common.collect.Lists;
|
import kr.wisestone.owl.vo.HostingFieldVo;
|
import kr.wisestone.owl.vo.UseCompanyVo;
|
|
import java.util.List;
|
|
public class UseCompany {
|
|
public static final int USE_COMPANY_HOSTING = 4; // 100
|
public static final int USE_COMPANY_ISP = 2; // 010
|
public static final int USE_COMPANY_COMPANY = 1; // 001
|
|
public static String[] Names = {"업체", "ISP", "호스팅"};
|
public static int[] useCompanies = {USE_COMPANY_COMPANY, USE_COMPANY_ISP, USE_COMPANY_HOSTING};
|
|
// 업체/ISP/호스팅 정보 유무 체크 후 UseCompanyVo.Create
|
public static UseCompanyVo checkUseCompany(int using, int useAbleCompany) //using - DB에 저장된 값, useAbleCompany - 각 업체들의 실제 값
|
{
|
if (((using & useAbleCompany) != 0)) {
|
Long Id = 0L;
|
if (useAbleCompany != USE_COMPANY_COMPANY) {
|
Id = useAbleCompany / 2L;
|
}
|
return UseCompanyVo.Create(Id, Names[Id.intValue()]);
|
}
|
return null;
|
}
|
|
// 업체/ISP/호스팅 전체 목록 가져오기
|
public static List<UseCompanyVo> getCompanyList() {
|
List<UseCompanyVo> useCompanyVos = Lists.newArrayList();
|
|
Long index = 0L;
|
for (String name : UseCompany.Names) {
|
useCompanyVos.add(UseCompanyVo.Create(index, name));
|
index++;
|
}
|
return useCompanyVos;
|
}
|
|
}
|