You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
584 B
39 lines
584 B
package service |
|
|
|
import ( |
|
"context" |
|
|
|
"go-common/app/admin/main/up-rating/conf" |
|
"go-common/app/admin/main/up-rating/dao" |
|
"go-common/app/admin/main/up-rating/dao/global" |
|
) |
|
|
|
// Service struct |
|
type Service struct { |
|
conf *conf.Config |
|
dao *dao.Dao |
|
cache *Cache |
|
} |
|
|
|
// New fn |
|
func New(c *conf.Config) (s *Service) { |
|
global.Init(c) |
|
s = &Service{ |
|
conf: c, |
|
dao: dao.New(c), |
|
cache: NewCache(60), |
|
} |
|
return s |
|
} |
|
|
|
// Ping fn |
|
func (s *Service) Ping(c context.Context) (err error) { |
|
return nil |
|
} |
|
|
|
// Close dao |
|
func (s *Service) Close() { |
|
if s.dao != nil { |
|
s.dao.Close() |
|
} |
|
}
|
|
|