第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

RESTful Web 服務(wù)。訪問資源

RESTful Web 服務(wù)。訪問資源

湖上湖 2022-06-30 18:27:42
我有一個(gè)基本的 SpringBoot 2.1.3.RELEASE 應(yīng)用程序。使用 Spring Initializer、JPA、嵌入式 Tomcat、Thymeleaf 模板引擎,并將其打包為可執(zhí)行的 JAR 文件。我有這個(gè) restController@RestController@RequestMapping("/api/v1/users")public class UserResourceController extends ResourceController {    private static final Logger LOG = LoggerFactory.getLogger(UserResourceController.class);        @GetMapping(path = "/", consumes = "application/json", produces = "application/json")    @ResponseStatus(HttpStatus.OK)    public ResponseEntity<User> getUser(@RequestHeader(value = "Authorization") String authHeader) {        User user = authUserOnPath("/users", authHeader);        user.getApplicationSetup()                .setExchangeRateWithUSD(currencyService.getUSDRate(user.getApplicationSetup().getAppCcy()));        return ResponseEntity.ok().body(user);    }}還有這個(gè):@RestController@RequestMapping("/api/v1/users/wallets")public class WalletResourceController extends ResourceController {    @Autowired    private WalletService walletService;    /**     * Get user's wallets     *      * @param request     * @param id     * @return     */    @GetMapping(path = "/", consumes = "application/json", produces = "application/json")    public ResponseEntity<List<Wallet>> getUserWallets(@RequestHeader(value = "Authorization") String authHeader) {        User user = authUserOnPath("/users/wallets", authHeader);        List<Wallet> wallets = userService.getWallets(user);        return ResponseEntity.ok().cacheControl(CacheControl.maxAge(5, TimeUnit.MINUTES)).body(wallets);    }訪問時(shí)一切正常:GET http://127.0.0.1:1133/myApp/api/v1/users但我在訪問時(shí)得到了 404:GET http://127.0.0.1:1133/myApp/api/v1/users/wallets
查看完整描述

1 回答

?
Cats萌萌

TA貢獻(xiàn)1805條經(jīng)驗(yàn) 獲得超9個(gè)贊

為了

@RequestMapping("/api/v1/users/wallets")

您指定了一個(gè)GET端點(diǎn)

 @GetMapping(path = "/" ...)

所以可訪問的 URL 位于(見 terminating /

GET http://127.0.0.1:1133/myApp/api/v1/users/wallets/


查看完整回答
反對(duì) 回復(fù) 2022-06-30
  • 1 回答
  • 0 關(guān)注
  • 127 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)