我正在通過 Springboot 和 PostgreSQL 開發(fā)一個網(wǎng)絡(luò)應(yīng)用程序作為我的數(shù)據(jù)庫。我正在嘗試創(chuàng)建一個路徑,該路徑將在我的數(shù)據(jù)庫中創(chuàng)建一個新條目,其中一個參數(shù)是多邊形的字符串表示形式。這是處理函數(shù)的注釋:@RequestMapping("/addhero/{id}/{fName}/{lName}/{luck}/{powerLevel}/{area}/{sPower}/{powerCategory}")這是函數(shù)的聲明:public String showHeroAdditionResult(@PathVariable("id") int id, @PathVariable("fName") String fName, @PathVariable("lName") String lName, @PathVariable("luck") float luck, @PathVariable("powerLevel") float powerLevel, @PathVariable("area") String area, @PathVariable("sPower") String sPower, @PathVariable("powerCategory") String powerCategory)這就是我嘗試初始化對象的方式:PGpolygon polygon = new PGpolygon(area);這是我正在使用的路徑: localhost:8080/addhero/483/YU/YU/1/22/(1,1),(2,2),(1,1)/Axe/weapon 我收到以下錯誤:我什至嘗試使用硬編碼字符串,但效果不佳,我根本不明白為什么它說多邊形的大小僅為 1。感謝您的幫助和時間!
1 回答
慕仙森
TA貢獻1827條經(jīng)驗 獲得超8個贊
設(shè)法解決了這個問題,這就是你應(yīng)該如何提供一個多邊形作為路徑參數(shù):((1,1),(2,2),(1,1)) 然后只需將這個字符串原樣提供給 PGpolygon 構(gòu)造函數(shù)。希望這對任何人都有幫助!
添加回答
舉報
0/150
提交
取消
