SpringCloud actual combat – (3) Method for calling modules via RESTFUL

Create a class in the project and write the following:

package< span style="color: #000000;"> 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;
}
}

The project starts, visit in the browser, and return the following content:

share picture

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;
}
}

Leave a Comment

Your email address will not be published.