(cfg *config.Config)
| 20 | } |
| 21 | |
| 22 | func NewRecomComponent(cfg *config.Config) (*RecomComponent, error) { |
| 23 | gs, err := git.NewGitServer(cfg) |
| 24 | if err != nil { |
| 25 | return nil, fmt.Errorf("failed to init git server,%w", err) |
| 26 | } |
| 27 | |
| 28 | return &RecomComponent{ |
| 29 | rs: database.NewRecomStore(), |
| 30 | repos: database.NewRepoStore(), |
| 31 | gs: gs, |
| 32 | }, nil |
| 33 | } |
| 34 | |
| 35 | func (rc *RecomComponent) SetOpWeight(ctx context.Context, repoID, weight int64) error { |
| 36 | _, err := rc.repos.FindById(ctx, repoID) |