1 回答
TA贡献1847条经验 获得超11个赞
似乎Spring没有读取您的Controller,这似乎是一个结构问题。请考虑进行以下更改:
@RestController
@RequestMapping("/your_decide/")
public class MobilityApi {
@Autowired
private MobilityService mobilityService;
@GetMapping("/mobilityCC")
public Response retrieveOrderDetails(@RequestParam("orderid") String orderid) {
return mobilityService.getOrderDetails(orderid);
}
}
而且,您的主类必须位于根文件夹中。像这样的东西:

要消耗其余端点,请尝试访问 localhost:8080/your_decide/mobilityCC
编辑:
确保您具有 spring-web 依赖项。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot.version}</version>
</dependency>
添加回答
举报
