/*
 * Copyright 2002-2016 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.zuoxiaolong.blog.fast.controller;

import com.zuoxiaolong.blog.common.spring.BaseController;
import com.zuoxiaolong.blog.common.utils.CollectionUtils;
import com.zuoxiaolong.blog.sdk.ApiType;
import com.zuoxiaolong.blog.sdk.BlogApiSdk;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Xiaolong Zuo
 * @since 1.0.0
 */
@Controller
public class ExampleController extends BaseController{

    @Autowired
    private BlogApiSdk blogApiSdk;

    @RequestMapping("/example1")
    public String example1() {
        setModelAttribute("result", blogApiSdk.invokeApi(ApiType.example1));
        return "example";
    }

    @RequestMapping("/example2")
    public String example2() {
        setModelAttribute("result", blogApiSdk.invokeApi(ApiType.example2, CollectionUtils.newMap("name", "zuoxiaolong")));
        return "example";
    }

    @RequestMapping("/example4")
    public String example4() {
        setModelAttribute("result", blogApiSdk.invokeApi(ApiType.example4));
        return "example";
    }
}

@@ -1044,16 +1044,111 @@
 g;%0A%0A/**%0A
+ * %E8%BF%99%E6%98%AF%E4%B8%80%E4%B8%AA%E7%A4%BA%E4%BE%8B%E6%8E%A7%E5%88%B6%E5%99%A8%0A *%0A * BlogApiSdk%E4%BD%BF%E7%94%A8spring IOC%E7%9A%84%E6%96%B9%E5%BC%8F%E6%B3%A8%E5%85%A5%E5%8D%B3%E5%8F%AF%0A *%0A * %E8%B0%83%E7%94%A8%E6%8E%A5%E5%8F%A3%E6%97%B6,%E9%80%89%E6%8B%A9%E9%80%82%E5%BD%93%E7%9A%84API%E7%A7%8D%E7%B1%BB%E4%BC%A0%E5%85%A5,%E5%B9%B6%E4%B8%94%E4%BC%A0%E5%85%A5API%E6%89%80%E9%9C%80%E8%A6%81%E7%9A%84%E5%8F%82%E6%95%B0%E5%8D%B3%E5%8F%AF%E8%B0%83%E7%94%A8%0A *%0A
  * @auth

添加SDK和Fast框架.