Skip to content

Commit 5b1e71d

Browse files
committed
Version 1.0.1 of DSS is adapted to Apache of linkis #444
1 parent 549e1c7 commit 5b1e71d

File tree

1 file changed

+2
-15
lines changed
  • dss-commons/dss-common/src/main/scala/com/webank/wedatasphere/dss/common/utils

1 file changed

+2
-15
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
1-
/*
2-
* Copyright 2019 WeBank
3-
* Licensed under the Apache License, Version 2.0 (the "License");
4-
* you may not use this file except in compliance with the License.
5-
* You may obtain a copy of the License at
6-
* http://www.apache.org/licenses/LICENSE-2.0
7-
* Unless required by applicable law or agreed to in writing, software
8-
* distributed under the License is distributed on an "AS IS" BASIS,
9-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10-
* See the License for the specific language governing permissions and
11-
* limitations under the License.
12-
*/
13-
141
package com.webank.wedatasphere.dss.common.utils
152

163
import org.apache.linkis.server.Message
174

185
import javax.ws.rs.core.Response
196

20-
217
object MessageUtils {
228
implicit def messageToResponse(message: Message): Response =
239
Response.status(messageToHttpStatus(message)).entity(message).build()
10+
2411
implicit def responseToMessage(response: Response): Message = response.readEntity(classOf[Message])
12+
2513
def messageToHttpStatus(message: Message): Int = message.getStatus match {
2614
case -1 => 401
2715
case 0 => 200
@@ -31,4 +19,3 @@ object MessageUtils {
3119
case 4 => 206
3220
}
3321
}
34-

0 commit comments

Comments
 (0)