예제 #1
0
 public CommonModelField findCommonModelField(int fieldId) {
   for (CommonModel c : getCommonModelList()) {
     for (CommonModelField f : c.getCommonModelFieldList()) {
       if (f.getId() == fieldId) return f;
     }
   }
   return null;
 }
예제 #2
0
  private String _getCommonModelHTML(Set<CommonModel> list) {
    StringBuilder html = new StringBuilder();
    for (CommonModel model : list) {
      List<CommonModelField> fields = model.getCommonModelFieldListOrdered();

      html.append("<div>")
          .append(model.getName())
          .append("&lt;")
          .append(model.getCode())
          .append("&gt;</div>")
          .append("<table class=\"param-table\">")
          .append("<thead>")
          .append("<th class=\"th-identifier\">字段名</th>")
          .append("<th class=\"th-type\">类型</th>")
          .append("<th class=\"th-need\">必填</th>")
          .append("<th class=\"th-remark\">备注</th>")
          .append("</thead>");
      getCommonModelHTMLSub(html, fields, (short) 1);
      html.append("</table><hr/>");
    }
    return html.toString();
  }
예제 #3
0
 /**
  * 功能描述:增加项目的公用Model
  *
  * @param commonModel
  * @author <a href="mailto:[email protected]">李伟光 </a> created on: 2016-4-6
  */
 public void addCommonModel(CommonModel commonModel) {
   getCommonModelList().add(commonModel);
   commonModel.setProject(this);
 }
예제 #4
0
 /**
  * 功能描述:查找指定的接口公用model
  *
  * @param modelId
  * @return
  * @author <a href="mailto:[email protected]">李伟光 </a> created on: 2016-4-6
  */
 public CommonModel findCommonModel(int modelId) {
   for (CommonModel c : getCommonModelList()) {
     if (c.getId() == modelId) return c;
   }
   return null;
 }
예제 #5
0
 // 更新CommonModel基本属性
 public void update(CommonModel commonModel) {
   setCode(commonModel.getCode());
   setName(commonModel.getName());
 }