Files
a301_server/internal/download/service.go
tolelom 8dee6f70b3
All checks were successful
Server CI/CD / deploy (push) Successful in 38s
feat: 다운로드 정보에 fileHash 필드 추가
게임 EXE의 SHA256 해시를 저장하여 런처가 버전 검증에 활용

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 22:22:37 +09:00

27 lines
528 B
Go

package download
type Service struct {
repo *Repository
}
func NewService(repo *Repository) *Service {
return &Service{repo: repo}
}
func (s *Service) GetInfo() (*Info, error) {
return s.repo.GetLatest()
}
func (s *Service) Upsert(url, version, fileName, fileSize, fileHash string) (*Info, error) {
info, err := s.repo.GetLatest()
if err != nil {
info = &Info{}
}
info.URL = url
info.Version = version
info.FileName = fileName
info.FileSize = fileSize
info.FileHash = fileHash
return info, s.repo.Save(info)
}