Improve statistic

This commit is contained in:
2025-05-30 12:04:54 +08:00
parent 46e4ffc9d8
commit 5e6d202acd
3 changed files with 21 additions and 22 deletions

View File

@@ -113,10 +113,13 @@ func parseResourceIfPresent(line string, host string) *model.ResourceView {
func GetResource(id uint, host string) (*model.ResourceDetailView, error) {
r, err := dao.GetResourceByID(id)
_ = dao.AddResourceViewCount(id)
if err != nil {
return nil, err
}
err = dao.AddResourceViewCount(id)
if err != nil {
log.Error("AddResourceViewCount error: ", err)
}
v := r.ToDetailView()
if host != "" {
related := findRelatedResources(r, host)