如下面这种
//http://localhost:8080/api/v1/user/info/email/test@163.com
 @RequestMapping(value = "/info/email/{email}",method = RequestMethod.GET)
    public User getInfoByEmail(@PathVariable String email){
        User user = userRepository.findByEmail(email);
        return user;
    }

 



//继承adapter 设置属性即可。
import
org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; /** * Created by Administrator on 2017/7/10 0010. */ @Configuration public class WebConfig extends WebMvcConfigurerAdapter { @Override public void configurePathMatch(PathMatchConfigurer configurer) { configurer.setUseSuffixPatternMatch(false); } }

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2021-07-21
  • 2021-12-24
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2021-05-31
  • 2021-11-27
相关资源
相似解决方案