fix(park):修正一处应用错误。

This commit is contained in:
徐涛 2022-09-19 11:27:37 +08:00
parent 1e04922cee
commit 308c9e959c

View File

@ -130,10 +130,7 @@ func (_ParkService) FetchParkDetail(pid string) (*model.Park, error) {
Where("id = ?", pid). Where("id = ?", pid).
Scan(ctx) Scan(ctx)
if err != nil { if err != nil {
return nil, err return nil, exceptions.NewNotFoundErrorFromError("未找到符合条件的园区记录。", err)
}
if park == nil {
return nil, exceptions.NewNotFoundError("未找到符合条件的园区记录。")
} }
cache.CacheEntity(*park, []string{fmt.Sprintf("park:%s", pid)}, "park", pid) cache.CacheEntity(*park, []string{fmt.Sprintf("park:%s", pid)}, "park", pid)
return park, nil return park, nil