首页 > 编程语言 > 详细

SpringCloud实战——(3)通过RESTful方式调用模块的方法

时间:2019-07-12 17:43:40      阅读:129      评论:0      收藏:0      [点我收藏+]

在项目中创建一个类,编写如下内容:

package com.f*iservice.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName FeiController
 * @Description
 * @Author chenfei
 * @Date 2019-07-12 16:50
 **/
@RestController
@RequestMapping("/f*i")
public class FeiController {

    @GetMapping("/*f")
    public int getFei(){
        return 1;
    }
}

项目启动,在浏览器中访问,并返回如下内容:

技术分享图片

 

SpringCloud实战——(3)通过RESTful方式调用模块的方法

原文:https://www.cnblogs.com/ratels/p/11177294.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!