mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 15:56:57 +00:00
moved the APIModelSource.json to resources folder
This commit is contained in:
parent
4c8979ea03
commit
5ae7b9a9e2
2
.gitignore
vendored
2
.gitignore
vendored
@ -10,7 +10,7 @@
|
||||
.project
|
||||
.cache
|
||||
target
|
||||
obp-api/src/main/resources/
|
||||
#obp-api/src/main/resources/
|
||||
obp-api/src/test/resources/**
|
||||
!obp-api/src/test/resources/frozen_type_meta_data
|
||||
*.iml
|
||||
|
||||
@ -149,8 +149,8 @@ Here are the three types:
|
||||
|
||||
Type1: If you use `modelSource.json`, please run `APIBuilderModel.scala` main method
|
||||
```
|
||||
OBP-API/src/main/scala/code/api/APIBuilder/APIModelSource.json
|
||||
OBP-API/src/main/scala/code/api/APIBuilder/APIBuilderModel.scala
|
||||
/OBP-API/obp-api/src/main/resources/apiBuilder/APIModelSource.json
|
||||
/OBP-API/obp-api/src/main/scala/code/api/APIBuilder/APIBuilderModel.scala
|
||||
```
|
||||
Type2: If you use `apisResource.json`, please run `APIBuilder.scala` main method
|
||||
```
|
||||
|
||||
@ -265,7 +265,7 @@ object APIBuilderModel
|
||||
println("Congratulations! You make the new APIs. Please restart OBP-API server!")
|
||||
}
|
||||
|
||||
val jsonJValueFromFile: JValue = APIUtil.getJValueFromFile("src/main/scala/code/api/APIBuilder/APIModelSource.json")
|
||||
val jsonJValueFromFile: JValue = APIUtil.APIModelSourceJValue
|
||||
|
||||
//"/templates"
|
||||
val apiUrl= getApiUrl(jsonJValueFromFile)
|
||||
|
||||
@ -2756,5 +2756,16 @@ Returns a string showed to the developer
|
||||
user.hasOwnerViewAccess(BankIdAccountId(bankId, accountId)) || // TODO Use an action instead of the owner view
|
||||
AccountHolders.accountHolders.vend.getAccountHolders(bankId, accountId).exists(_.userId == user.userId)
|
||||
}
|
||||
|
||||
val APIModelSourceJValue = {
|
||||
val stream = getClass().getClassLoader().getResourceAsStream("apiBuilder/APIModelSource.json")
|
||||
try {
|
||||
val bufferedSource = scala.io.Source.fromInputStream(stream, "utf-8")
|
||||
val jsonStringFromFile = bufferedSource.mkString
|
||||
json.parse(jsonStringFromFile);
|
||||
} finally {
|
||||
stream.close()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user