1 /*
2  *  Make.org Core API
3  *  Copyright (C) 2018 Make.org
4  *
5  * This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU Affero General Public License as
7  *  published by the Free Software Foundation, either version 3 of the
8  *  License, or (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU Affero General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Affero General Public License
16  *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
17  *
18  */
19 
20 package org.make.api.technical.businessconfig
21 
22 import akka.http.scaladsl.server.{Directives, Route}
23 import io.swagger.annotations._
24 import org.make.api.operation.OperationServiceComponent
25 import org.make.api.question.QuestionServiceComponent
26 
27 import javax.ws.rs.Path
28 import org.make.api.technical.MakeDirectives.MakeDirectivesDependencies
29 import org.make.api.technical.{MakeAuthenticationDirectives, MakeDirectives, ShortenedNames}
30 import org.make.core.{FrontConfiguration, HttpCodes}
31 
32 @Api(value = "Configurations")
33 @Path(value = "/configurations")
34 trait ConfigurationsApi extends Directives {
35 
36   @Path(value = "front")
37   @ApiOperation(value = "front-configuration", httpMethod = "GET", code = HttpCodes.OK)
38   @ApiResponses(
39     value = Array(new ApiResponse(code = HttpCodes.OK, message = "Ok", response = classOf[FrontConfiguration]))
40   )
41   def businessConfigurationFront: Route
42 
43   final def routes: Route = businessConfigurationFront
44 
45 }
46 
47 trait ConfigurationsApiComponent {
48   def configurationsApi: ConfigurationsApi
49 }
50 
51 trait DefaultConfigurationsApiComponent
52     extends ConfigurationsApiComponent
53     with MakeDirectives
54     with MakeAuthenticationDirectives
55     with ShortenedNames {
56   self: MakeDirectivesDependencies with QuestionServiceComponent with OperationServiceComponent =>
57 
58   override lazy val configurationsApi: ConfigurationsApi = new DefaultConfigurationsApi
59 
60   class DefaultConfigurationsApi extends ConfigurationsApi {
61     def businessConfigurationFront: Route =
62       get {
63         path("configurations" / "front") {
64           makeOperation("FrontConfiguration") { _ =>
65             complete(FrontConfiguration.default())
66           }
67         }
68       }
69   }
70 
71 }
Line Stmt Id Pos Tree Symbol Tests Code
43 44256 1656 - 1682 Select org.make.api.technical.businessconfig.ConfigurationsApi.businessConfigurationFront ConfigurationsApi.this.businessConfigurationFront
62 43481 2235 - 2417 Apply scala.Function1.apply server.this.Directive.addByNameNullaryApply(DefaultConfigurationsApi.this.get).apply(server.this.Directive.addByNameNullaryApply(DefaultConfigurationsApi.this.path[Unit](DefaultConfigurationsApi.this._segmentStringToPathMatcher("configurations")./[Unit](DefaultConfigurationsApi.this._segmentStringToPathMatcher("front"))(TupleOps.this.Join.join0P[Unit]))).apply(server.this.Directive.addDirectiveApply[(org.make.core.RequestContext,)](DefaultConfigurationsApiComponent.this.makeOperation("FrontConfiguration", DefaultConfigurationsApiComponent.this.makeOperation$default$2, DefaultConfigurationsApiComponent.this.makeOperation$default$3))(util.this.ApplyConverter.hac1[org.make.core.RequestContext]).apply(((x$1: org.make.core.RequestContext) => DefaultConfigurationsApi.this.complete(marshalling.this.ToResponseMarshallable.apply[org.make.core.FrontConfiguration](org.make.core.FrontConfiguration.default(org.make.core.FrontConfiguration.default$default$1, org.make.core.FrontConfiguration.default$default$2, org.make.core.FrontConfiguration.default$default$3))(marshalling.this.Marshaller.liftMarshaller[org.make.core.FrontConfiguration](DefaultConfigurationsApiComponent.this.marshaller[org.make.core.FrontConfiguration](core.this.FrontConfiguration.codec, DefaultConfigurationsApiComponent.this.marshaller$default$2[org.make.core.FrontConfiguration]))))))))
62 36480 2235 - 2238 Select akka.http.scaladsl.server.directives.MethodDirectives.get DefaultConfigurationsApi.this.get
63 49759 2254 - 2270 Literal <nosymbol> "configurations"
63 51344 2249 - 2409 Apply scala.Function1.apply server.this.Directive.addByNameNullaryApply(DefaultConfigurationsApi.this.path[Unit](DefaultConfigurationsApi.this._segmentStringToPathMatcher("configurations")./[Unit](DefaultConfigurationsApi.this._segmentStringToPathMatcher("front"))(TupleOps.this.Join.join0P[Unit]))).apply(server.this.Directive.addDirectiveApply[(org.make.core.RequestContext,)](DefaultConfigurationsApiComponent.this.makeOperation("FrontConfiguration", DefaultConfigurationsApiComponent.this.makeOperation$default$2, DefaultConfigurationsApiComponent.this.makeOperation$default$3))(util.this.ApplyConverter.hac1[org.make.core.RequestContext]).apply(((x$1: org.make.core.RequestContext) => DefaultConfigurationsApi.this.complete(marshalling.this.ToResponseMarshallable.apply[org.make.core.FrontConfiguration](org.make.core.FrontConfiguration.default(org.make.core.FrontConfiguration.default$default$1, org.make.core.FrontConfiguration.default$default$2, org.make.core.FrontConfiguration.default$default$3))(marshalling.this.Marshaller.liftMarshaller[org.make.core.FrontConfiguration](DefaultConfigurationsApiComponent.this.marshaller[org.make.core.FrontConfiguration](core.this.FrontConfiguration.codec, DefaultConfigurationsApiComponent.this.marshaller$default$2[org.make.core.FrontConfiguration])))))))
63 50252 2254 - 2280 ApplyToImplicitArgs akka.http.scaladsl.server.PathMatcher./ DefaultConfigurationsApi.this._segmentStringToPathMatcher("configurations")./[Unit](DefaultConfigurationsApi.this._segmentStringToPathMatcher("front"))(TupleOps.this.Join.join0P[Unit])
63 42994 2249 - 2281 Apply akka.http.scaladsl.server.directives.PathDirectives.path DefaultConfigurationsApi.this.path[Unit](DefaultConfigurationsApi.this._segmentStringToPathMatcher("configurations")./[Unit](DefaultConfigurationsApi.this._segmentStringToPathMatcher("front"))(TupleOps.this.Join.join0P[Unit]))
63 41639 2273 - 2280 ApplyImplicitView akka.http.scaladsl.server.ImplicitPathMatcherConstruction._segmentStringToPathMatcher DefaultConfigurationsApi.this._segmentStringToPathMatcher("front")
63 37479 2271 - 2271 TypeApply akka.http.scaladsl.server.util.TupleOps.Join.join0P TupleOps.this.Join.join0P[Unit]
64 44766 2294 - 2294 Select org.make.api.technical.MakeDirectives.makeOperation$default$3 DefaultConfigurationsApiComponent.this.makeOperation$default$3
64 37271 2294 - 2399 Apply scala.Function1.apply server.this.Directive.addDirectiveApply[(org.make.core.RequestContext,)](DefaultConfigurationsApiComponent.this.makeOperation("FrontConfiguration", DefaultConfigurationsApiComponent.this.makeOperation$default$2, DefaultConfigurationsApiComponent.this.makeOperation$default$3))(util.this.ApplyConverter.hac1[org.make.core.RequestContext]).apply(((x$1: org.make.core.RequestContext) => DefaultConfigurationsApi.this.complete(marshalling.this.ToResponseMarshallable.apply[org.make.core.FrontConfiguration](org.make.core.FrontConfiguration.default(org.make.core.FrontConfiguration.default$default$1, org.make.core.FrontConfiguration.default$default$2, org.make.core.FrontConfiguration.default$default$3))(marshalling.this.Marshaller.liftMarshaller[org.make.core.FrontConfiguration](DefaultConfigurationsApiComponent.this.marshaller[org.make.core.FrontConfiguration](core.this.FrontConfiguration.codec, DefaultConfigurationsApiComponent.this.marshaller$default$2[org.make.core.FrontConfiguration]))))))
64 35901 2294 - 2329 Apply org.make.api.technical.MakeDirectives.makeOperation DefaultConfigurationsApiComponent.this.makeOperation("FrontConfiguration", DefaultConfigurationsApiComponent.this.makeOperation$default$2, DefaultConfigurationsApiComponent.this.makeOperation$default$3)
64 49508 2307 - 2307 TypeApply akka.http.scaladsl.server.util.ApplyConverterInstances.hac1 util.this.ApplyConverter.hac1[org.make.core.RequestContext]
64 30957 2294 - 2294 Select org.make.api.technical.MakeDirectives.makeOperation$default$2 DefaultConfigurationsApiComponent.this.makeOperation$default$2
64 34862 2308 - 2328 Literal <nosymbol> "FrontConfiguration"
65 37514 2377 - 2377 Select org.make.core.FrontConfiguration.default$default$2 org.make.core.FrontConfiguration.default$default$2
65 42418 2358 - 2386 Apply org.make.core.FrontConfiguration.default org.make.core.FrontConfiguration.default(org.make.core.FrontConfiguration.default$default$1, org.make.core.FrontConfiguration.default$default$2, org.make.core.FrontConfiguration.default$default$3)
65 36960 2384 - 2384 ApplyToImplicitArgs akka.http.scaladsl.marshalling.LowPriorityToResponseMarshallerImplicits.liftMarshaller marshalling.this.Marshaller.liftMarshaller[org.make.core.FrontConfiguration](DefaultConfigurationsApiComponent.this.marshaller[org.make.core.FrontConfiguration](core.this.FrontConfiguration.codec, DefaultConfigurationsApiComponent.this.marshaller$default$2[org.make.core.FrontConfiguration]))
65 47935 2384 - 2384 TypeApply de.heikoseeberger.akkahttpcirce.BaseCirceSupport.marshaller$default$2 DefaultConfigurationsApiComponent.this.marshaller$default$2[org.make.core.FrontConfiguration]
65 49708 2358 - 2386 ApplyToImplicitArgs akka.http.scaladsl.marshalling.ToResponseMarshallable.apply marshalling.this.ToResponseMarshallable.apply[org.make.core.FrontConfiguration](org.make.core.FrontConfiguration.default(org.make.core.FrontConfiguration.default$default$1, org.make.core.FrontConfiguration.default$default$2, org.make.core.FrontConfiguration.default$default$3))(marshalling.this.Marshaller.liftMarshaller[org.make.core.FrontConfiguration](DefaultConfigurationsApiComponent.this.marshaller[org.make.core.FrontConfiguration](core.this.FrontConfiguration.codec, DefaultConfigurationsApiComponent.this.marshaller$default$2[org.make.core.FrontConfiguration])))
65 51308 2377 - 2377 Select org.make.core.FrontConfiguration.default$default$3 org.make.core.FrontConfiguration.default$default$3
65 41439 2349 - 2387 Apply akka.http.scaladsl.server.directives.RouteDirectives.complete DefaultConfigurationsApi.this.complete(marshalling.this.ToResponseMarshallable.apply[org.make.core.FrontConfiguration](org.make.core.FrontConfiguration.default(org.make.core.FrontConfiguration.default$default$1, org.make.core.FrontConfiguration.default$default$2, org.make.core.FrontConfiguration.default$default$3))(marshalling.this.Marshaller.liftMarshaller[org.make.core.FrontConfiguration](DefaultConfigurationsApiComponent.this.marshaller[org.make.core.FrontConfiguration](core.this.FrontConfiguration.codec, DefaultConfigurationsApiComponent.this.marshaller$default$2[org.make.core.FrontConfiguration]))))
65 44802 2384 - 2384 ApplyToImplicitArgs de.heikoseeberger.akkahttpcirce.BaseCirceSupport.marshaller DefaultConfigurationsApiComponent.this.marshaller[org.make.core.FrontConfiguration](core.this.FrontConfiguration.codec, DefaultConfigurationsApiComponent.this.marshaller$default$2[org.make.core.FrontConfiguration])
65 41402 2377 - 2377 Select org.make.core.FrontConfiguration.default$default$1 org.make.core.FrontConfiguration.default$default$1
65 34900 2384 - 2384 Select org.make.core.FrontConfiguration.codec core.this.FrontConfiguration.codec