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-12-11 22:18:48 +05:30
|
|
|
# For new services, please see https://docs.gitlab.com/ee/development/reusing_abstractions.html#service-classes
|
2014-09-02 18:07:02 +05:30
|
|
|
class BaseService
|
2020-05-24 23:13:21 +05:30
|
|
|
include BaseServiceUtility
|
2021-09-30 23:02:18 +05:30
|
|
|
include Gitlab::Experiment::Dsl
|
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
|