49baee21bc6f9c67ec56eee920f9b1d96d17fd58
[institute/sw-backend.git] /
1 package com.supwisdom.institute.backend.admin.aggr.apis.service.biz;
2
3 import org.springframework.beans.factory.annotation.Autowired;
4 import org.springframework.stereotype.Service;
5
6 import com.alibaba.fastjson.JSONObject;
7 import com.supwisdom.institute.backend.admin.aggr.apis.remote.biz.BizRemoteFeignClient;
8 import com.supwisdom.institute.backend.admin.aggr.apis.vo.biz.response.data.BizQueryResponseData;
9
10 @Service
11 public class BizService {
12   
13   @Autowired
14   private BizRemoteFeignClient bizRemote;
15   
16   public BizQueryResponseData query(boolean loadAll, int pageIndex, int pageSize) {
17     
18     JSONObject jsonObject = bizRemote.query(loadAll, pageIndex, pageSize);
19     if (jsonObject == null) {
20       return null;
21     }
22     
23     if (jsonObject.getIntValue("code") == 0) {
24       JSONObject data = jsonObject.getJSONObject("data");
25       
26       return data.toJavaObject(BizQueryResponseData.class);
27     }
28     
29     return null;
30   }
31
32 }