Skip to content

Commit

Permalink
fix: biz in launchScreen.MobileGetImage
Browse files Browse the repository at this point in the history
  • Loading branch information
FantasyRL committed Nov 16, 2024
1 parent 10eed72 commit d0b406e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/launch_screen/service/mobile_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ func (s *LaunchScreenService) MobileGetImage(req *launch_screen.MobileGetImageRe
}

// addShowtime for cache
if err = s.db.LaunchScreen.AddImageListShowTime(s.ctx, respList); err != nil {
return nil, -1, fmt.Errorf("LaunchScreenService.MobileGetImage db.AddImageListShowTime error:%w", err)
if cntResp != 0 {
if err = s.db.LaunchScreen.AddImageListShowTime(s.ctx, respList); err != nil {
return nil, -1, fmt.Errorf("LaunchScreenService.MobileGetImage db.AddImageListShowTime error:%w", err)
}
} else {
return nil, 0, errno.NoRunningPictureError
}

return respList, cntResp, nil
Expand Down Expand Up @@ -151,7 +155,7 @@ func (s *LaunchScreenService) getImagesFromMySQL(studentId string, sType int64,
var eg errgroup.Group
eg.Go(func() error {
// addShowTime
return s.db.LaunchScreen.AddImageListShowTime(s.ctx, imgList)
return s.db.LaunchScreen.AddImageListShowTime(s.ctx, &currentImgList)
})
eg.Go(func() error {
// setIdCache
Expand Down

0 comments on commit d0b406e

Please sign in to comment.