示例#1
0
 public static DistributeGroupResult getDefaultResult(Number dataType) {
   DistributeGroupResult result = new DistributeGroupResult();
   result.setAccountId(1L);
   result.setCompanyName(DEFAULT_COMPANY);
   result.setCompanyUrl(DEFAULT_URL);
   result.setGroup(getGroup(DEFAULT_ID.longValue(), DEFAULT_ID.longValue(), dataType.byteValue()));
   List<PresentedTask> list = new ArrayList<PresentedTask>();
   for (int i = 0; i < 10; i++) {
     if (GroupDataType.isBeidou(dataType)) {
       list.add(new PresentedTask(getBeidouTask(i + 0L, i + 0L, DEFAULT_ID.longValue(), i)));
     } else if (GroupDataType.isQiushi(dataType)) {
       list.add(new PresentedTask(getQiushiTask(i + 0L, i + 0L, DEFAULT_ID.longValue(), i)));
     } else if (GroupDataType.isDSP(dataType)) {
       list.add(new PresentedTask(getDSPTask(i + 0L, i + 0L, DEFAULT_ID.longValue(), i)));
     } else if (GroupDataType.isNewDsp(dataType)) {
       list.add(new PresentedTask(getNewDSPTask(i + 0L, i + 0L, DEFAULT_ID.longValue(), i)));
     }
   }
   result.setList(list);
   return result;
 }
示例#2
0
  public static Integer getValidMcType(Number dataType, Number id) {
    int type = id.intValue() < 0 ? -id.intValue() : id.intValue();
    if (GroupDataType.isBeidou(dataType)) {
      switch (type % 5) {
        case 0:
          return BeidouMcType.TXT.getId();
        case 1:
          return BeidouMcType.IMG.getId();
        case 2:
          return BeidouMcType.IMGTXT.getId();
        case 3:
          return BeidouMcType.FLASH.getId();
        case 4:
          return BeidouMcType.HTML.getId();
        default:
          return BeidouMcType.TXT.getId();
      }
    } else if (GroupDataType.isQiushi(id)) {
      switch (type % 7) {
        case 0:
          return QiushiMcType.INVALID.getId();
        case 1:
          return QiushiMcType.TXT.getId();
        case 2:
          return QiushiMcType.IMG.getId();
        case 3:
          return QiushiMcType.SMALLIMGTXT.getId();
        case 4:
          return QiushiMcType.BIGIMGTXT.getId();
        case 5:
          return QiushiMcType.RICHMEDIA.getId();
        case 6:
          return QiushiMcType.VIDEO.getId();
        default:
          return QiushiMcType.TXT.getId();
      }
    } else if (GroupDataType.isDSP(id)) {
      switch (type % 3) {
        case 0:
          return DSPMcType.IMG.getId();
        case 1:
          return DSPMcType.FLASH.getId();
        case 2:
          return DSPMcType.VIDEO.getId();
        default:
          return DSPMcType.IMG.getId();
      }
    } else if (GroupDataType.isNewDsp(id)) {
      switch (type % 3) {
        case 0:
          return NewDSPMcType.FLASH.getId();
        case 1:
          return NewDSPMcType.HTML.getId();
        case 2:
          return DSPMcType.VIDEO.getId();
        default:
          return DSPMcType.IMG.getId();
      }
    }

    return 1;
  }