Android MVP模式 解析JSON 显示到ListView上

目录(?)[+]

Android MVP模式 解析JSON 显示到ListView上

有关MVP模式的介绍,这里不作详细解释,稍后会更新MVP设计模式,请等待链接……

简述本次的主要功能实现:

    通过mvp设计模式,(MVP的主要优势是将view层和model层完全解偶)解析json数据,然后展示到ListView上,所有的讲解将通过注释详细解释

整体功能框架如下图所示:
这里写图片描述

view层:负责界面的更新和展示

MainActivity.Java

<code class="hljs java has-numbering"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MainActivity</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">AppCompatActivity</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">ViewInter</span> {</span>

    <span class="hljs-comment">//需要显示的数据项</span>
    <span class="hljs-keyword">private</span> ListView mList;
    <span class="hljs-comment">//自定义的适配器</span>
    <span class="hljs-keyword">private</span> MyAdapter adapter;
    <span class="hljs-comment">//对应json数据的地址</span>
    <span class="hljs-keyword">private</span> String path= <span class="hljs-string">"http://api102.meishi.cc/v5/class_list1.php?lon=&source=android&cid=6&vk=2417a0052eac5cd81d5dce4d168a3973&sort_sc=asc&sort=default&lat=&page=%d&bcid=13&format=json"</span>;
    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">protected</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onCreate</span>(Bundle savedInstanceState) {
        <span class="hljs-keyword">super</span>.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        <span class="hljs-comment">//获取ListView的id</span>
        mList = (ListView)findViewById(R.id.mList);
        <span class="hljs-comment">//view层告诉presenter层,我需要数据,然后对应的presenter就相当于一个传递者,找模型层去拿对  </span>
        <span class="hljs-comment">//应的数据</span>
        <span class="hljs-keyword">new</span> Presenter(<span class="hljs-keyword">this</span>).load(String.format(path,<span class="hljs-number">2</span>));
    }

    <span class="hljs-javadoc">/**
     * 通过结果回调的方式,拿到对应的数据
     *<span class="hljs-javadoctag"> @param</span> dataBeen ListView上所显示的数据项
     */</span>
    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">showData</span>(List<HotFoodBean.ObjBean.DataBean> dataBeen) {
        <span class="hljs-comment">//创建自定义适配器</span>
        adapter = <span class="hljs-keyword">new</span> MyAdapter(dataBeen);
        <span class="hljs-comment">//设置适配器</span>
        mList.setAdapter(adapter);
    }
}</code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li></ul><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li></ul>

ViewInter.java

<code class="hljs java has-numbering"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">interface</span> <span class="hljs-title">ViewInter</span> {</span>
    <span class="hljs-javadoc">/**
     * 定义一个通用功能的接口,所有需要更新界面的功能都放这这里面
     *<span class="hljs-javadoctag"> @param</span> dataBeen
     */</span>
    <span class="hljs-keyword">void</span> showData(List<HotFoodBean.ObjBean.DataBean> dataBeen);
}</code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li></ul><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li></ul>

presenter层:起承接作用,帮view层拿到对应的数据

Presenter.java

<code class="hljs java has-numbering"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Presenter</span> {</span>
    <span class="hljs-comment">//模型层数据类型</span>
    ModelInter modelInter;
    <span class="hljs-comment">//视图层数据类型</span>
    ViewInter viewInter;
    <span class="hljs-comment">//这里只需要获得view层的数据类型即可</span>
    <span class="hljs-keyword">public</span> <span class="hljs-title">Presenter</span>(ViewInter viewInter){
        <span class="hljs-keyword">this</span>.viewInter = viewInter;
        <span class="hljs-comment">//同时创建模型层,主要是为了拿对应的数据</span>
        modelInter = <span class="hljs-keyword">new</span> ModelImp();
    }

    <span class="hljs-javadoc">/**
     * 视图层需要数据时,只需要调用次方法就可以拿到对应的数据
     *<span class="hljs-javadoctag"> @param</span> path 对应的json数据地址
     */</span>
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">load</span>(String path){
        <span class="hljs-javadoc">/**
         * 通过模型层的getData方法拿对应的数据
         * 通过匿名内部类实现ModelInter.OnDataCompleteListener
         * 接口中的onLoadComplete方法,主要功能是解析
         * json数据到实体中,这里是用的Google的Gson解析Json
         */</span>
        modelInter.getData(<span class="hljs-keyword">new</span> ModelInter.OnDataCompleteListener() {
            <span class="hljs-annotation">@Override</span>
            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onLoadComplete</span>(<span class="hljs-keyword">byte</span>[] bytes, String path) {
                <span class="hljs-comment">//通过接口回调传过来的bytes转化为字符串</span>
                String json = <span class="hljs-keyword">new</span> String(bytes);
                <span class="hljs-comment">//解析到对应的实体类</span>
                HotFoodBean foodBean = <span class="hljs-keyword">new</span> Gson().fromJson(json, HotFoodBean.class);
                <span class="hljs-comment">//将数据返回给view层</span>
                viewInter.showData(foodBean.getObj().getData());
            }
        },path);
    }
}</code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li><li>36</li></ul><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li><li>36</li></ul>

model层:主要负责数据的处理,将数据返回给presenter层,presenter层再将数据返回给view层

ModelInter.java

<code class="hljs java has-numbering"><span class="hljs-comment">//模型层中的所有功能,都写在这个接口中</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">interface</span> <span class="hljs-title">ModelInter</span> {</span>

    <span class="hljs-javadoc">/**
     * 这个方法是通过网络获取Json数据
     *<span class="hljs-javadoctag"> @param</span> listener  网络数据回调的实例
     *<span class="hljs-javadoctag"> @param</span> path Json数据的网络地址
     */</span>
    <span class="hljs-keyword">void</span> getData(OnDataCompleteListener listener,String path);
    <span class="hljs-comment">//网络请求完成后的接口回调方法,实现这个接口可以获取Json数据</span>
    <span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">interface</span> <span class="hljs-title">OnDataCompleteListener</span>{</span>
        <span class="hljs-keyword">void</span> onLoadComplete(<span class="hljs-keyword">byte</span>[] bytes,String path);
    }
}</code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li></ul><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li></ul>

ModelImp.java

<code class="hljs java has-numbering"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">ModelImp</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">ModelInter</span>{</span>

    <span class="hljs-javadoc">/**
     * 调用异步任务获取Json数据
     *<span class="hljs-javadoctag"> @param</span> listener  网络数据回调的实例
     *<span class="hljs-javadoctag"> @param</span> path Json数据的网络地址
     */</span>
    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">getData</span>(OnDataCompleteListener listener,String path) {
        <span class="hljs-keyword">new</span> MyAsyncTask(listener).execute(path);
    }
}</code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li></ul><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li></ul>

utils工具类:其中放的是一些网络请求操作

MyAsyncTask.java

<code class="hljs scala has-numbering">public <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyAsyncTask</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">AsyncTask</span><<span class="hljs-title">String</span>, <span class="hljs-title">Void</span>, <span class="hljs-title">byte</span>[]> {</span>
    <span class="hljs-comment">//Json数据的地址</span>
    <span class="hljs-keyword">private</span> String path;
    <span class="hljs-comment">//接口回调的实例</span>
    <span class="hljs-keyword">private</span> ModelInter.OnDataCompleteListener listener;

    public MyAsyncTask(ModelInter.OnDataCompleteListener listener) {
        <span class="hljs-keyword">this</span>.listener = listener;
    }

    <span class="hljs-javadoc">/**
     * 异步任务方法,在子线程中执行
     * <span class="hljs-javadoctag">@param</span> params 访问网络的地址
     * <span class="hljs-javadoctag">@return</span> 返回请求到的数据,然后执行onPostExecute方法
     */</span>
    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">protected</span> byte[] doInBackground(String... params) {
        <span class="hljs-comment">//将当前地址保存起来</span>
        path = params[<span class="hljs-number">0</span>];
        <span class="hljs-keyword">return</span> getURLData(path);
    }

    <span class="hljs-javadoc">/**
     * 获取返回的数据之后执行相应的操作
     * <span class="hljs-javadoctag">@param</span> bytes 传过来的数据
     */</span>
    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">protected</span> void onPostExecute(byte[] bytes) {
        <span class="hljs-keyword">super</span>.onPostExecute(bytes);
        <span class="hljs-comment">//如果返回来的数据不为空,并且接口实例不为空,实现接口回调</span>
        <span class="hljs-keyword">if</span> (listener != <span class="hljs-keyword">null</span> && bytes != <span class="hljs-keyword">null</span>) {
            listener.onLoadComplete(bytes,path);
        }
    }

    <span class="hljs-javadoc">/**
     * 网络请求功能
     * <span class="hljs-javadoctag">@param</span> path 网络请求地址
     * <span class="hljs-javadoctag">@return</span> 返回数据
     */</span>
    <span class="hljs-keyword">private</span> byte[] getURLData(String path) {
        <span class="hljs-keyword">try</span> {
            <span class="hljs-comment">//建立URL请求</span>
            URL url = <span class="hljs-keyword">new</span> URL(path);
            <span class="hljs-comment">//转换成HttpURLConnection</span>
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            <span class="hljs-comment">//请求方式为GET</span>
            connection.setRequestMethod(<span class="hljs-string">"GET"</span>);
            <span class="hljs-comment">//读取超时时间为5秒</span>
            connection.setReadTimeout(<span class="hljs-number">5000</span>);
            <span class="hljs-comment">//连接超时实际为5秒</span>
            connection.setConnectTimeout(<span class="hljs-number">5000</span>);
            <span class="hljs-comment">//开始连接,相当于在地址栏输入网址后敲回车键</span>
            connection.connect();
            <span class="hljs-comment">//返回200代码表示访问成功</span>
            <span class="hljs-keyword">if</span> (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
                <span class="hljs-comment">//获取服务器返回的字节流</span>
                BufferedInputStream bis = <span class="hljs-keyword">new</span> BufferedInputStream(connection.getInputStream());
                <span class="hljs-comment">//将数据保存到内存流中</span>
                ByteArrayOutputStream baos = <span class="hljs-keyword">new</span> ByteArrayOutputStream();
                int len = -<span class="hljs-number">1</span>;
                byte[] bytes = <span class="hljs-keyword">new</span> byte[<span class="hljs-number">1024</span> * <span class="hljs-number">8</span>];
                <span class="hljs-keyword">while</span> (-<span class="hljs-number">1</span> != (len = bis.read(bytes))) {
                    baos.write(bytes, <span class="hljs-number">0</span>, len);
                }
                bis.close();
                <span class="hljs-keyword">return</span> baos.toByteArray();
            }
        } <span class="hljs-keyword">catch</span> (MalformedURLException e) {
            e.printStackTrace();
        } <span class="hljs-keyword">catch</span> (IOException e) {
            e.printStackTrace();
        }
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">null</span>;
    }
}</code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li><li>36</li><li>37</li><li>38</li><li>39</li><li>40</li><li>41</li><li>42</li><li>43</li><li>44</li><li>45</li><li>46</li><li>47</li><li>48</li><li>49</li><li>50</li><li>51</li><li>52</li><li>53</li><li>54</li><li>55</li><li>56</li><li>57</li><li>58</li><li>59</li><li>60</li><li>61</li><li>62</li><li>63</li><li>64</li><li>65</li><li>66</li><li>67</li><li>68</li><li>69</li><li>70</li><li>71</li><li>72</li><li>73</li><li>74</li><li>75</li><li>76</li></ul><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li><li>36</li><li>37</li><li>38</li><li>39</li><li>40</li><li>41</li><li>42</li><li>43</li><li>44</li><li>45</li><li>46</li><li>47</li><li>48</li><li>49</li><li>50</li><li>51</li><li>52</li><li>53</li><li>54</li><li>55</li><li>56</li><li>57</li><li>58</li><li>59</li><li>60</li><li>61</li><li>62</li><li>63</li><li>64</li><li>65</li><li>66</li><li>67</li><li>68</li><li>69</li><li>70</li><li>71</li><li>72</li><li>73</li><li>74</li><li>75</li><li>76</li></ul>

adapter:自定义的ListView的适配器

MyBaseAdapter.java

<code class="hljs java has-numbering"><span class="hljs-javadoc">/**
 * 主要是抽取通用的三个方法
 */</span>
<span class="hljs-keyword">public</span> <span class="hljs-keyword">abstract</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyBaseAdapter</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">BaseAdapter</span>{</span>
    <span class="hljs-keyword">private</span> List<HotFoodBean.ObjBean.DataBean> foodBeen;
    <span class="hljs-keyword">public</span> <span class="hljs-title">MyBaseAdapter</span>(List<HotFoodBean.ObjBean.DataBean> foodBeen){
        <span class="hljs-keyword">this</span>.foodBeen = foodBeen;
    }
    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">int</span> <span class="hljs-title">getCount</span>() {
        <span class="hljs-keyword">return</span> foodBeen == <span class="hljs-keyword">null</span> ? <span class="hljs-number">0</span>:foodBeen.size();
    }

    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">public</span> Object <span class="hljs-title">getItem</span>(<span class="hljs-keyword">int</span> position) {
        <span class="hljs-keyword">return</span> foodBeen.get(position);
    }

    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">long</span> <span class="hljs-title">getItemId</span>(<span class="hljs-keyword">int</span> position) {
        <span class="hljs-keyword">return</span> position;
    }

    <span class="hljs-keyword">public</span> List<HotFoodBean.ObjBean.DataBean> <span class="hljs-title">getFoodBeen</span>() {
        <span class="hljs-keyword">return</span> foodBeen;
    }
}</code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li></ul><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li></ul>

MyAdapter.java

<code class="hljs java has-numbering"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyAdapter</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">MyBaseAdapter</span> {</span>

    <span class="hljs-comment">//将数据传递给父类</span>
    <span class="hljs-keyword">public</span> <span class="hljs-title">MyAdapter</span>(List<HotFoodBean.ObjBean.DataBean> foodBeen) {
        <span class="hljs-keyword">super</span>(foodBeen);
    }

    <span class="hljs-javadoc">/**
     * 解析布局,将每个布局返回,展示到界面上
     *
     *<span class="hljs-javadoctag"> @param</span> position    位置
     *<span class="hljs-javadoctag"> @param</span> convertView 可复用的控件,滑出屏幕后就会变成可复用
     *<span class="hljs-javadoctag"> @param</span> parent      表示ListView控件
     *<span class="hljs-javadoctag"> @return</span> 返回布局
     */</span>
    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">public</span> View <span class="hljs-title">getView</span>(<span class="hljs-keyword">int</span> position, View convertView, ViewGroup parent) {
        <span class="hljs-comment">//每次先获取将要展示的数据</span>
        HotFoodBean.ObjBean.DataBean dataBean = getFoodBeen().get(position);
        <span class="hljs-comment">//优化布局的帮助类</span>
        ViewHolder viewHolder = <span class="hljs-keyword">null</span>;
        <span class="hljs-keyword">if</span> (convertView == <span class="hljs-keyword">null</span>) {
            convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item, <span class="hljs-keyword">null</span>);
            viewHolder = <span class="hljs-keyword">new</span> ViewHolder();
            <span class="hljs-comment">//查找对应控件,并设置到帮助类中,以免重复创建,是内存泄露,</span>
            viewHolder.imageView = (ImageView) convertView.findViewById(R.id.mImg);
            <span class="hljs-comment">//以下四个控件同上</span>
            viewHolder.rat = (RatingBar) convertView.findViewById(R.id.mRat);
            viewHolder.title = (TextView) convertView.findViewById(R.id.mTitle);
            viewHolder.step = (TextView) convertView.findViewById(R.id.mStep);
            viewHolder.taste = (TextView) convertView.findViewById(R.id.mTaste);
            <span class="hljs-comment">//将viewHolder类保存到每个对象的标记中,方便下次获取</span>
            convertView.setTag(viewHolder);
        }
        <span class="hljs-comment">//以下控件设置对应的数据</span>
        viewHolder = (ViewHolder) convertView.getTag();
        viewHolder.title.setText(dataBean.getTitle());
        viewHolder.rat.setRating(Float.parseFloat(dataBean.getRate()));
        viewHolder.step.setText(dataBean.getStep() + <span class="hljs-string">"/"</span> + dataBean.getMt());
        viewHolder.taste.setText(dataBean.getKouwei() + <span class="hljs-string">"/"</span> + dataBean.getGongyi());
        <span class="hljs-comment">//这里的作用是,为了防止已经下载显示了的图片重复请求,如有不懂,欢迎提问</span>
        viewHolder.imageView.setTag(dataBean.getTitlepic());
        <span class="hljs-comment">//每次将图片都置空</span>
        viewHolder.imageView.setImageBitmap(<span class="hljs-keyword">null</span>);
         <span class="hljs-comment">//异步任务请求图片</span>
        <span class="hljs-keyword">new</span> MyAsyncTask(<span class="hljs-keyword">new</span> MyBitmapCallBack(viewHolder.imageView)).execute(dataBean.getTitlepic());
        <span class="hljs-keyword">return</span> convertView;
    }

    <span class="hljs-keyword">static</span> class ViewHolder {
        ImageView imageView;
        TextView title;
        TextView step;
        TextView taste;
        RatingBar rat;
    }
}</code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li><li>36</li><li>37</li><li>38</li><li>39</li><li>40</li><li>41</li><li>42</li><li>43</li><li>44</li><li>45</li><li>46</li><li>47</li><li>48</li><li>49</li><li>50</li><li>51</li><li>52</li><li>53</li><li>54</li><li>55</li><li>56</li><li>57</li></ul><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li><li>36</li><li>37</li><li>38</li><li>39</li><li>40</li><li>41</li><li>42</li><li>43</li><li>44</li><li>45</li><li>46</li><li>47</li><li>48</li><li>49</li><li>50</li><li>51</li><li>52</li><li>53</li><li>54</li><li>55</li><li>56</li><li>57</li></ul>

callBack:下载图片回调的实例

MyBitmapCallBack.java

<code class="hljs java has-numbering"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyBitmapCallBack</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">ModelInter</span>.<span class="hljs-title">OnDataCompleteListener</span> {</span>
    <span class="hljs-keyword">private</span> ImageView mImg;
    <span class="hljs-comment">//将对应的图片控件传递过来</span>
    <span class="hljs-keyword">public</span> <span class="hljs-title">MyBitmapCallBack</span>(ImageView mImg){
        <span class="hljs-keyword">this</span>.mImg = mImg;
    }

    <span class="hljs-javadoc">/**
     * 当网络数据请求完成后,会调用这个方法,获取图片数据
     *<span class="hljs-javadoctag"> @param</span> bytes 图片数据
     *<span class="hljs-javadoctag"> @param</span> path 对应的图片地址
     */</span>
    <span class="hljs-annotation">@Override</span>
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onLoadComplete</span>(<span class="hljs-keyword">byte</span>[] bytes, String path) {

        String tag = (String) mImg.getTag();
        <span class="hljs-comment">//判断当前下载的图片地址是否和每次显示的图片地址是否相同</span>
        <span class="hljs-keyword">if</span>(bytes != <span class="hljs-keyword">null</span> && tag.equals(path)){
                <span class="hljs-comment">//将字节数组转换成Bitmap</span>
                Bitmap bitmap = BitmapFactory.decodeByteArray(bytes,<span class="hljs-number">0</span>,bytes.length);
                <span class="hljs-comment">//设置图片</span>
                mImg.setImageBitmap(bitmap);
        }
    }
}</code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li></ul><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li><li>25</li></ul>

好了,整体的实现都已经完成了,除了实体类HotFoodBean没有写上去之外,其他的功能都已经实现了,
可能对于初学者来说,接口回调的形式有点绕,如果当中有不懂的知识点,可以在我的博客中学习对应的知识点。

效果图如下:
这里写图片描述

最后添加上Bean实体类
HotFoodBean .java

<code class="hljs fsharp has-numbering"><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> HotFoodBean {

    /**
     * title : 热菜有关的菜谱:
     * classname : 热菜
     * classid : <span class="hljs-number">6</span>
     * total : <span class="hljs-number">46190</span>
     * header_img : http:<span class="hljs-comment">//static.meishij.net/images/mobileimg/recai1.jpg</span>
     * header_word :
     * classes : [{<span class="hljs-string">"title"</span>:<span class="hljs-string">"热菜"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"6"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"凉菜"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"5"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"素菜"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"74"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"靓汤"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"388"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"粥品"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"389"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"主食"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"390"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"点心"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"272"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"卤味"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"273"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"微波炉"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"11"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"海鲜"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"75"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"火锅"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"59"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"酱料蘸料"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"343"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"干果零食"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"77"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"饮品"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"57"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"孕妇"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"62"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"产妇"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"72"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"宝宝"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"12"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"老人"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"73"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"美容"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"58"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"瘦身"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"61"</span>}]
     * data : [{<span class="hljs-string">"id"</span>:<span class="hljs-string">"20440"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"口水鱼片"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"·配料:花鲢鱼一条,淀粉两大匙,油炸花生仁约半两,熟"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"209364"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"烤甜椒塞肉"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://images.meishij.net/p/20111121/a10388301b285e12d5083b7a1816c963_150x150.jpg"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">"烤"</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">"咸鲜味"</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">"初级入门"</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">"<15分钟"</span>,<span class="hljs-string">"step"</span>:<span class="hljs-string">"4"</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"出炉后的甜椒还是很可爱很完整,装入垫了从阳台上采下的生菜叶的盘内,淋上甜辣酱,久久不舍下箸。拍完几张片子后,差..."</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">1</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"1"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"20569"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"白宰鸡"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"·配料:鸡,色拉油,盐,辣椒粉,花椒粉,十三香,鸡精"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"615392"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"珊瑚雪花鸡"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://site.meishij.net/r/209/172/1418209/a1418209_78049.jpg"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">"蒸"</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">"咸鲜味"</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">"初中水平"</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">"<60分钟"</span>,<span class="hljs-string">"step"</span>:<span class="hljs-string">"15"</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"珊瑚雪花鸡"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">1</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"1"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"52230"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"佛手排骨的做法"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"原料:排骨400克,瘦猪肉300克,虾肉50克,鸭蛋2个,肥猪肉25克,生葱50克,荸荠50克,"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"39647"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"蜜桃鲜贝杏仁卷的做法"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"材料:水蜜桃2个、鲜贝6个、杏仁片100克、糯米纸6张调味料:沙拉酱2大匙、鸡蛋1个、太白"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"19368"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"红烧大虾"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">"烧"</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"·配料:大对虾4对(约重1000克左右)白糖75克、鸡汤150"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">1</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"1"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"537245"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"梭子蟹炖蛋"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://images.meishij.net/p/20101013/3d67d358fe4ce82a92bb7036217abc90.jpg"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">"炖"</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">"咸鲜味"</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-string">"2"</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"梭子蟹炖蛋"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">1</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"1"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"20496"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"韭菜皮蛋松"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"·配料:主料:韭菜花辅料:瘦猪肉、皮蛋调"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"6494"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"剁椒香煎豆腐"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">"煎"</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"·配料:老豆腐、剁椒、小葱末、盐、醋、生抽、鸡精"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">1</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"1"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>}]
     * is_filter : <span class="hljs-number">1</span>
     * search_num : <span class="hljs-number">624440</span>
     * column_rank : <span class="hljs-number">3</span>
     * city_hot : 北京市
     */

    <span class="hljs-keyword">private</span> ObjBean obj;
    /**
     * obj : {<span class="hljs-string">"title"</span>:<span class="hljs-string">"热菜有关的菜谱:"</span>,<span class="hljs-string">"classname"</span>:<span class="hljs-string">"热菜"</span>,<span class="hljs-string">"classid"</span>:<span class="hljs-string">"6"</span>,<span class="hljs-string">"total"</span>:<span class="hljs-string">"46190"</span>,<span class="hljs-string">"header_img"</span>:<span class="hljs-string">"http://static.meishij.net/images/mobileimg/recai1.jpg"</span>,<span class="hljs-string">"header_word"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"classes"</span>:[{<span class="hljs-string">"title"</span>:<span class="hljs-string">"热菜"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"6"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"凉菜"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"5"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"素菜"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"74"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"靓汤"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"388"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"粥品"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"389"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"主食"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"390"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"点心"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"272"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"卤味"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"273"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"微波炉"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"11"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"海鲜"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"75"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"火锅"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"59"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"酱料蘸料"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"343"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"干果零食"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"77"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"饮品"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"57"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"孕妇"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"62"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"产妇"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"72"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"宝宝"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"12"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"老人"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"73"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"美容"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"58"</span>},{<span class="hljs-string">"title"</span>:<span class="hljs-string">"瘦身"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"61"</span>}],<span class="hljs-string">"data"</span>:[{<span class="hljs-string">"id"</span>:<span class="hljs-string">"20440"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"口水鱼片"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"·配料:花鲢鱼一条,淀粉两大匙,油炸花生仁约半两,熟"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"209364"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"烤甜椒塞肉"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://images.meishij.net/p/20111121/a10388301b285e12d5083b7a1816c963_150x150.jpg"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">"烤"</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">"咸鲜味"</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">"初级入门"</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">"<15分钟"</span>,<span class="hljs-string">"step"</span>:<span class="hljs-string">"4"</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"出炉后的甜椒还是很可爱很完整,装入垫了从阳台上采下的生菜叶的盘内,淋上甜辣酱,久久不舍下箸。拍完几张片子后,差..."</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">1</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"1"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"20569"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"白宰鸡"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"·配料:鸡,色拉油,盐,辣椒粉,花椒粉,十三香,鸡精"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"615392"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"珊瑚雪花鸡"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://site.meishij.net/r/209/172/1418209/a1418209_78049.jpg"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">"蒸"</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">"咸鲜味"</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">"初中水平"</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">"<60分钟"</span>,<span class="hljs-string">"step"</span>:<span class="hljs-string">"15"</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"珊瑚雪花鸡"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">1</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"1"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"52230"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"佛手排骨的做法"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"原料:排骨400克,瘦猪肉300克,虾肉50克,鸭蛋2个,肥猪肉25克,生葱50克,荸荠50克,"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"39647"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"蜜桃鲜贝杏仁卷的做法"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"材料:水蜜桃2个、鲜贝6个、杏仁片100克、糯米纸6张调味料:沙拉酱2大匙、鸡蛋1个、太白"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"19368"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"红烧大虾"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">"烧"</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"·配料:大对虾4对(约重1000克左右)白糖75克、鸡汤150"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">1</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"1"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"537245"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"梭子蟹炖蛋"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://images.meishij.net/p/20101013/3d67d358fe4ce82a92bb7036217abc90.jpg"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">"炖"</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">"咸鲜味"</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-string">"2"</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"梭子蟹炖蛋"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">1</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"1"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"20496"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"韭菜皮蛋松"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"·配料:主料:韭菜花辅料:瘦猪肉、皮蛋调"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>},{<span class="hljs-string">"id"</span>:<span class="hljs-string">"6494"</span>,<span class="hljs-string">"title"</span>:<span class="hljs-string">"剁椒香煎豆腐"</span>,<span class="hljs-string">"titlepic"</span>:<span class="hljs-string">"http://css.meishij.net/images/nopic_150.gif"</span>,<span class="hljs-string">"gongyi"</span>:<span class="hljs-string">"煎"</span>,<span class="hljs-string">"kouwei"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"md"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"mt"</span>:<span class="hljs-string">""</span>,<span class="hljs-string">"step"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"smalltext"</span>:<span class="hljs-string">"·配料:老豆腐、剁椒、小葱末、盐、醋、生抽、鸡精"</span>,<span class="hljs-string">"is_recipe"</span>:<span class="hljs-number">1</span>,<span class="hljs-string">"item_type"</span>:<span class="hljs-string">"1"</span>,<span class="hljs-string">"rate"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"is_video"</span>:<span class="hljs-string">"0"</span>,<span class="hljs-string">"is_fav"</span>:<span class="hljs-number">0</span>,<span class="hljs-string">"is_see"</span>:<span class="hljs-number">0</span>}],<span class="hljs-string">"is_filter"</span>:<span class="hljs-string">"1"</span>,<span class="hljs-string">"search_num"</span>:<span class="hljs-number">624440</span>,<span class="hljs-string">"column_rank"</span>:<span class="hljs-string">"3"</span>,<span class="hljs-string">"city_hot"</span>:<span class="hljs-string">"北京市"</span>}
     * code : <span class="hljs-number">1</span>
     * msg : 成功
     */

    <span class="hljs-keyword">private</span> String code;
    <span class="hljs-keyword">private</span> String msg;

    <span class="hljs-keyword">public</span> ObjBean getObj() {
        <span class="hljs-keyword">return</span> obj;
    }

    <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setObj(ObjBean obj) {
        this.obj = obj;
    }

    <span class="hljs-keyword">public</span> String getCode() {
        <span class="hljs-keyword">return</span> code;
    }

    <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setCode(String code) {
        this.code = code;
    }

    <span class="hljs-keyword">public</span> String getMsg() {
        <span class="hljs-keyword">return</span> msg;
    }

    <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setMsg(String msg) {
        this.msg = msg;
    }

    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">class</span> ObjBean {
        <span class="hljs-keyword">private</span> String title;
        <span class="hljs-keyword">private</span> String classname;
        <span class="hljs-keyword">private</span> String classid;
        <span class="hljs-keyword">private</span> String total;
        <span class="hljs-keyword">private</span> String header_img;
        <span class="hljs-keyword">private</span> String header_word;
        <span class="hljs-keyword">private</span> String is_filter;
        <span class="hljs-keyword">private</span> int search_num;
        <span class="hljs-keyword">private</span> String column_rank;
        <span class="hljs-keyword">private</span> String city_hot;
        /**
         * title : 热菜
         * id : <span class="hljs-number">6</span>
         */

        <span class="hljs-keyword">private</span> List<ClassesBean> classes;
        /**
         * id : <span class="hljs-number">20440</span>
         * title : 口水鱼片
         * titlepic : http:<span class="hljs-comment">//css.meishij.net/images/nopic_150.gif</span>
         * gongyi :
         * kouwei :
         * md :
         * mt :
         * step : <span class="hljs-number">0</span>
         * smalltext : ·配料:花鲢鱼一条,淀粉两大匙,油炸花生仁约半两,熟
         * is_recipe : <span class="hljs-number">0</span>
         * item_type : <span class="hljs-number">0</span>
         * rate : <span class="hljs-number">3</span>
         * is_video : <span class="hljs-number">0</span>
         * is_fav : <span class="hljs-number">0</span>
         * is_see : <span class="hljs-number">0</span>
         */

        <span class="hljs-keyword">private</span> List<DataBean> data;

        <span class="hljs-keyword">public</span> String getTitle() {
            <span class="hljs-keyword">return</span> title;
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setTitle(String title) {
            this.title = title;
        }

        <span class="hljs-keyword">public</span> String getClassname() {
            <span class="hljs-keyword">return</span> classname;
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setClassname(String classname) {
            this.classname = classname;
        }

        <span class="hljs-keyword">public</span> String getClassid() {
            <span class="hljs-keyword">return</span> classid;
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setClassid(String classid) {
            this.classid = classid;
        }

        <span class="hljs-keyword">public</span> String getTotal() {
            <span class="hljs-keyword">return</span> total;
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setTotal(String total) {
            this.total = total;
        }

        <span class="hljs-keyword">public</span> String getHeader_img() {
            <span class="hljs-keyword">return</span> header_img;
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setHeader_img(String header_img) {
            this.header_img = header_img;
        }

        <span class="hljs-keyword">public</span> String getHeader_word() {
            <span class="hljs-keyword">return</span> header_word;
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setHeader_word(String header_word) {
            this.header_word = header_word;
        }

        <span class="hljs-keyword">public</span> String getIs_filter() {
            <span class="hljs-keyword">return</span> is_filter;
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setIs_filter(String is_filter) {
            this.is_filter = is_filter;
        }

        <span class="hljs-keyword">public</span> int getSearch_num() {
            <span class="hljs-keyword">return</span> search_num;
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setSearch_num(int search_num) {
            this.search_num = search_num;
        }

        <span class="hljs-keyword">public</span> String getColumn_rank() {
            <span class="hljs-keyword">return</span> column_rank;
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setColumn_rank(String column_rank) {
            this.column_rank = column_rank;
        }

        <span class="hljs-keyword">public</span> String getCity_hot() {
            <span class="hljs-keyword">return</span> city_hot;
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setCity_hot(String city_hot) {
            this.city_hot = city_hot;
        }

        <span class="hljs-keyword">public</span> List<ClassesBean> getClasses() {
            <span class="hljs-keyword">return</span> classes;
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setClasses(List<ClassesBean> classes) {
            this.classes = classes;
        }

        <span class="hljs-keyword">public</span> List<DataBean> getData() {
            <span class="hljs-keyword">return</span> data;
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setData(List<DataBean> data) {
            this.data = data;
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">class</span> ClassesBean {
            <span class="hljs-keyword">private</span> String title;
            <span class="hljs-keyword">private</span> String id;

            <span class="hljs-keyword">public</span> String getTitle() {
                <span class="hljs-keyword">return</span> title;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setTitle(String title) {
                this.title = title;
            }

            <span class="hljs-keyword">public</span> String getId() {
                <span class="hljs-keyword">return</span> id;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setId(String id) {
                this.id = id;
            }
        }

        <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">class</span> DataBean {
            <span class="hljs-keyword">private</span> String id;
            <span class="hljs-keyword">private</span> String title;
            <span class="hljs-keyword">private</span> String titlepic;
            <span class="hljs-keyword">private</span> String gongyi;
            <span class="hljs-keyword">private</span> String kouwei;
            <span class="hljs-keyword">private</span> String md;
            <span class="hljs-keyword">private</span> String mt;
            <span class="hljs-keyword">private</span> int step;
            <span class="hljs-keyword">private</span> String smalltext;
            <span class="hljs-keyword">private</span> int is_recipe;
            <span class="hljs-keyword">private</span> String item_type;
            <span class="hljs-keyword">private</span> String rate;
            <span class="hljs-keyword">private</span> String is_video;
            <span class="hljs-keyword">private</span> int is_fav;
            <span class="hljs-keyword">private</span> int is_see;

            <span class="hljs-keyword">public</span> String getId() {
                <span class="hljs-keyword">return</span> id;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setId(String id) {
                this.id = id;
            }

            <span class="hljs-keyword">public</span> String getTitle() {
                <span class="hljs-keyword">return</span> title;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setTitle(String title) {
                this.title = title;
            }

            <span class="hljs-keyword">public</span> String getTitlepic() {
                <span class="hljs-keyword">return</span> titlepic;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setTitlepic(String titlepic) {
                this.titlepic = titlepic;
            }

            <span class="hljs-keyword">public</span> String getGongyi() {
                <span class="hljs-keyword">return</span> gongyi;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setGongyi(String gongyi) {
                this.gongyi = gongyi;
            }

            <span class="hljs-keyword">public</span> String getKouwei() {
                <span class="hljs-keyword">return</span> kouwei;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setKouwei(String kouwei) {
                this.kouwei = kouwei;
            }

            <span class="hljs-keyword">public</span> String getMd() {
                <span class="hljs-keyword">return</span> md;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setMd(String md) {
                this.md = md;
            }

            <span class="hljs-keyword">public</span> String getMt() {
                <span class="hljs-keyword">return</span> mt;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setMt(String mt) {
                this.mt = mt;
            }

            <span class="hljs-keyword">public</span> int getStep() {
                <span class="hljs-keyword">return</span> step;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setStep(int step) {
                this.step = step;
            }

            <span class="hljs-keyword">public</span> String getSmalltext() {
                <span class="hljs-keyword">return</span> smalltext;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setSmalltext(String smalltext) {
                this.smalltext = smalltext;
            }

            <span class="hljs-keyword">public</span> int getIs_recipe() {
                <span class="hljs-keyword">return</span> is_recipe;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setIs_recipe(int is_recipe) {
                this.is_recipe = is_recipe;
            }

            <span class="hljs-keyword">public</span> String getItem_type() {
                <span class="hljs-keyword">return</span> item_type;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setItem_type(String item_type) {
                this.item_type = item_type;
            }

            <span class="hljs-keyword">public</span> String getRate() {
                <span class="hljs-keyword">return</span> rate;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setRate(String rate) {
                this.rate = rate;
            }

            <span class="hljs-keyword">public</span> String getIs_video() {
                <span class="hljs-keyword">return</span> is_video;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setIs_video(String is_video) {
                this.is_video = is_video;
            }

            <span class="hljs-keyword">public</span> int getIs_fav() {
                <span class="hljs-keyword">return</span> is_fav;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setIs_fav(int is_fav) {
                this.is_fav = is_fav;
            }

            <span class="hljs-keyword">public</span> int getIs_see() {
                <span class="hljs-keyword">return</span> is_see;
            }

            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> setIs_see(int is_see) {
                this.is_see = is_see;
            }
        }
    }
}</code>
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 技术工厂 设计师:CSDN官方博客 返回首页