我從數(shù)據(jù)庫中獲取數(shù)據(jù),它們顯示在瀏覽器或郵遞員之類的軟件中,與此相同/ 20221125143847// http://localhost:3000/api/v1/datesmain/read{"alldates": [{ "ID": 1, "CreatedAt": "2022-11-25T00:00:00Z", "UpdatedAt": "2022-11-25T00:00:00Z", "DeletedAt": null, "volume": "20", "image_url": "/assets/images/IMG_3429.jpg\n", "average_weight": 7.5, "dates_type_id": 1, "wight_type_id": 1},{ "ID": 2, "CreatedAt": "2022-11-25T00:00:00Z", "UpdatedAt": "2022-11-25T00:00:00Z", "DeletedAt": null, "volume": "15", "image_url": "/assets/images/IMG_3436.jpg\n", "average_weight": 7.5, "dates_type_id": 1, "wight_type_id": 1} ]}正如您看到的圖像 url 是正確的,并且所有圖像都在項目根目錄中的文件夾中,名稱為“assets”,因為我不理解它可能通過此 URL 顯示我的圖像http://localhost:3000/api/v1/datesmain/assets/images/IMG_3429.jpg我想用java或...將它們?nèi)匡@示為前端的列表視圖但是當(dāng)像這樣在瀏覽器中復(fù)制并過去一個 url 時// http://localhost:3000/api/v1/datesmain/static/images/IMG_3429.jpg { "message": "Not Found" }我該如何解決?這是我的小代碼func ReadAllDatesMain(e echo.Context) error {ad, err := logic.ReadAllDatesMain()if err != nil { return nil}return e.JSON(http.StatusOK, map[string]interface{}{ "alldates": ad,})}
- 1 回答
- 0 關(guān)注
- 110 瀏覽
添加回答
舉報
0/150
提交
取消
