package com.lovecoding.springboot.demo.demo;

import com.lovecoding.Helloworld.HelloWorldService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class DemoController {

    @Resource
    HelloWorldService helloWorldService;

    @Resource
    TestMapper testMapper;

    @ResponseBody
    @RequestMapping("/")
    public Long t(){

        /**
         * 这个服务是 我们自定义的  stater 对象
         * 他会在 框架启动的时候就 初始化， 并读取配置档
         * 自动装配依赖
         */
        helloWorldService.print();

        return testMapper.counter();
    }


}
