zoukankan      html  css  js  c++  java
  • 工作框架各种使用整理---自己处理分页

    <service verb="get" noun="Products">
            <in-parameters>
                <auto-parameters entity-name="mantle.product.Product"/>
                <parameter name="pageIndex" type="Integer" default-value="0"/>
                <parameter name="pageSize" type="Integer" default-value="100"/>
                <parameter name="pageNoLimit" type="Boolean" default-value="false"/>
                <parameter name="orderByField" type="String"/>
            </in-parameters>
            <out-parameters>
                <parameter name="ProductList" type="List"><parameter name="product" type="Map">
                    <auto-parameters entity-name="mantle.product.Product"/>
                </parameter></parameter>
            </out-parameters>
            <actions>
                <entity-find entity-name="mantle.product.Product" list="ProductList">
                    <search-form-inputs/>
                </entity-find>
                <service-call name="zs.common.CommonServices.add#PaginateResponseHeaders" in-map="[pageIndex:pageIndex,
                    pageSize:pageSize, totalCount:ProductListCount,pageMaxIndex:ProductListPageMaxIndex,
                    pageRangeLow:ProductListPageRangeLow, pageRangeHigh:ProductListPageRangeHigh]"/>
            </actions>
        </service>
     1  <service verb="add" noun="PaginateResponseHeaders">
     2         <in-parameters>
     3             <parameter name="pageIndex" type="Integer" required="true"/>
     4             <parameter name="pageSize" type="Integer" required="true"/>
     5             <parameter name="totalCount" type="Integer" required="true"/>
     6             <parameter name="pageMaxIndex" type="Integer" required="true"/>
     7             <parameter name="pageRangeLow" type="Integer" required="true"/>
     8             <parameter name="pageRangeHigh" type="Integer" required="true"/>
     9         </in-parameters>
    10         <actions>
    11             <script>
    12                 <!--// calculate the pagination values-->
    13                 <!--int maxIndex = Double.valueOf((new BigDecimal(totalCount-1)).divide(new BigDecimal(pageSize), 0, BigDecimal.ROUND_DOWN).intValue())-->
    14                 <!--int pageRangeLow = (pageIndex * pageSize) + 1-->
    15                 <!--int pageRangeHigh = (pageIndex * pageSize) + pageSize-->
    16                 <!--if (pageRangeHigh > totalCount) pageRangeHigh = totalCount-->
    17 
    18                 ec.web.response.addHeader("X-Page-Index", String.valueOf(pageIndex))
    19                 ec.web.response.addHeader("X-Page-Size", String.valueOf(pageSize))
    20                 ec.web.response.addHeader("X-Page-Max-Index", String.valueOf(pageMaxIndex))
    21                 ec.web.response.addHeader("X-Page-Range-Low", String.valueOf(pageRangeLow))
    22                 ec.web.response.addHeader("X-Page-Range-High", String.valueOf(pageRangeHigh))
    23                 ec.web.response.addHeader("X-Total-Count", String.valueOf(totalCount))
    24             </script>
    25         </actions>
    26     </service>
    
    
    


  • 相关阅读:
    PostgreSQL恢复误操作
    PostgreSQL修改表空间
    vim技巧记录
    postgresql recovery.conf文件内容说明
    转一篇pgpool配置
    由PostgreSQL的区域与字符集说起(转)
    PostgreSQL老司机博客 经常翻翻收获不小
    两位数相乘的口算方法
    五线谱升调与降调
    js中的封装、继承、多态
  • 原文地址:https://www.cnblogs.com/dream-to-pku/p/5643017.html
Copyright © 2011-2022 走看看