<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 一、概述 有時候,業務中,會需要根據業務需要,將數據返回給前端之前,進行一些基于業務邏輯的預處理; 舉例來說,同一個商品,指定多個價格,根據當前登陸用戶的不同,啟用不同的價格,那么,可以借用這個插件機制,極大的簡化業務設計和開發,只需要設計多個價格,但根據當前登陸用戶,動態的獲取具體某個價格設置到返回字段名,然后給前端,前端的編碼就非常簡單,無需加入業務判斷邏輯了; ## 二、方案 ### **實現自己的定制業務類** 定義一個業務bean,實現CustomizeReturnResultAspectProcessor,這個bean,可以使用任何IOC中的資源,非常強大; 舉例; ``` @Component public class SalePriceCustomizeReturnResultProcessor implements CustomizeReturnResultAspectProcessor { @Override public void businessLogic(RayModel model) throws Exception { String modelPropertyName = "listobject"; if (model.getCurLoginData() != null) { long identity = model.getCurLoginData().getCurIdentityId(); List newList = new ArrayList(); List list = (List) ByteCodeUtil.getBeanValue(model, modelPropertyName); if (list != null) { for (Object obj : list) { String fieldName = "skuSalePrice"; Long value = (Long) ByteCodeUtil.getBeanValue(obj, fieldName + identity); BeanUtil.setProperty(obj, fieldName, value); newList.add(obj); } BeanUtil.setProperty(model, modelPropertyName, newList); } } } } ``` ### **業務方法中使用** 用RayCustomizeReturnResultProcessor注解; ``` @RayServiceMethod @RayCustomizeReturnResultProcessor(processorClass = com.ray.sale.spi.SalePriceCustomizeReturnResultProcessor.class) public ResponseObject listsku(long spuId) throws Exception { model.setListobject(rmallGoodsSkuDao.findBySpuId(spuId)); return responseObj; } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看