我從數據庫中獲取數據,它們顯示在瀏覽器或郵遞員之類的軟件中,與此相同/ 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或...將它們全部顯示為前端的列表視圖但是當像這樣在瀏覽器中復制并過去一個 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 關注
- 86 瀏覽
添加回答
舉報
0/150
提交
取消