【解决报错】

This commit is contained in:
weizhihong 2023-08-01 17:16:16 +08:00
parent d102404b6b
commit 33cceef0c8
2 changed files with 5 additions and 1 deletions

View File

@ -35,7 +35,7 @@ func InitSimulationRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle
}
func initPublishMapInfo() {
mapArr, err := service.ListQueryPublishedGi(&dto.PublishedGiReqDto{})
mapArr, err := service.ListAllPublishedGi()
if err != nil {
panic("地图加载出错")
}

View File

@ -39,6 +39,10 @@ func ListQueryPublishedGi(req *publishedGi.PublishedGiReqDto) []*publishedGi.Pub
return publishedGi.ConvertFromSlice(find)
}
func ListAllPublishedGi() ([]*model.PublishedGi, error) {
return dbquery.PublishedGi.Debug().Find()
}
func GetPublishedGiById(id int) (*model.PublishedGi, error) {
return dbquery.PublishedGi.Where(dbquery.PublishedGi.ID.Eq(int32(id))).Debug().First()
}