File tree Expand file tree Collapse file tree
jdk_8_maven/cs/graphql/graphql-ncs/src/main/kotlin/org/graphqlncs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package org.graphqlncs
2+
3+ class Exep (message : String? ) : RuntimeException(message)
Original file line number Diff line number Diff line change 11package org.graphqlncs.resolver
22
33import graphql.kickstart.tools.GraphQLQueryResolver
4+ import org.graphqlncs.Exep
45import org.graphqlncs.type.*
6+ import org.springframework.http.ResponseEntity
57import org.springframework.stereotype.Component
68
79@Component
@@ -32,10 +34,18 @@ open class QueryResolver(
3234 }
3335
3436 fun remainder (a : Int , b : Int ): Int {
35- return remainder.exe(a, b)
37+ val lim = 10000
38+ return if (a > lim || a < - lim || b > lim || b < - lim) {
39+ throw Exep (" 400" )
40+ } else remainder.exe(a, b)
3641 }
3742
3843 fun bessj (n : Int , x : Double ): Double {
39- return bessj.bessj(n, x)
44+
45+ return if (n <= 2 || n > 1000 ) {
46+ throw Exep (" 400" )
47+
48+ } else
49+ bessj.bessj(n, x)
4050 }
4151}
You can’t perform that action at this time.
0 commit comments