2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
# This is the original root class for service related classes,
|
|
|
|
# and due to historical reason takes a project as scope.
|
|
|
|
# Later separate base classes for different scopes will be created,
|
|
|
|
# and existing service will use these one by one.
|
|
|
|
# After all are migrated, we can remove this class.
|
|
|
|
#
|
2021-06-08 01:23:25 +05:30
|
|
|
# New services should consider inheriting from:
|
|
|
|
#
|
|
|
|
# - BaseContainerService for services scoped by container (project or group)
|
|
|
|
# - BaseProjectService for services scoped to projects
|
|
|
|
#
|
|
|
|
# or, create a new base class and update this comment.
|
2014-09-02 18:07:02 +05:30
|
|
|
class BaseService
|
2020-05-24 23:13:21 +05:30
|
|
|
include BaseServiceUtility
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
attr_accessor :project, :current_user, :params
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
def initialize(project, user = nil, params = {})
|
2021-04-29 21:17:54 +05:30
|
|
|
@project = project
|
|
|
|
@current_user = user
|
|
|
|
@params = params.dup
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
delegate :repository, to: :project
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|