Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eea6307c87 | ||
|
|
c5366e006b | ||
|
|
f0f295bfc9 | ||
|
|
e34c5d2e3e | ||
|
|
86d6fcaec7 | ||
|
|
2c09d97cec | ||
|
|
37ac0cd311 | ||
|
|
9fa38a3065 | ||
|
|
d908f99fbd | ||
|
|
5b0b23336c | ||
|
|
263b91c42a | ||
|
|
a53c90a348 | ||
|
|
e3583dad0c | ||
|
|
514a65a5e6 | ||
|
|
57a57ace77 | ||
|
|
1338e6458c | ||
|
|
9fd46b3a20 | ||
|
|
8e8b1a7684 | ||
|
|
4d8238dd7f | ||
|
|
73f7d3085a | ||
|
|
3f8652395c | ||
|
|
8c6e0aa353 | ||
|
|
e15dd6289d | ||
|
|
7d33227d70 | ||
|
|
8fda8f7669 | ||
|
|
57a828c5b4 | ||
|
|
b9f6aa0cc2 | ||
|
|
dcb9028d86 | ||
|
|
57a2787bf8 | ||
|
|
813ddfaeac | ||
|
|
0cbf6b28ef | ||
|
|
7efb2527d0 | ||
|
|
f085c9d506 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -32,7 +32,7 @@ buildNumber.properties
|
||||
!.vscode/*.code-snippets
|
||||
.history/
|
||||
*.vsix
|
||||
**/.idea/**
|
||||
.idea/**
|
||||
cmake-build-*/
|
||||
.idea/**/mongoSettings.xml
|
||||
*.iws
|
||||
@@ -109,4 +109,3 @@ Icon
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
**/temp/
|
||||
|
||||
102
bin/.gitignore
vendored
102
bin/.gitignore
vendored
@@ -1,102 +0,0 @@
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
!.vscode/*.code-snippets
|
||||
.history/
|
||||
*.vsix
|
||||
*~
|
||||
.fuse_hidden*
|
||||
.directory
|
||||
.Trash-*
|
||||
.nfs*
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
.pnpm-debug.log*
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
lib-cov
|
||||
coverage
|
||||
*.lcov
|
||||
.nyc_output
|
||||
.grunt
|
||||
bower_components
|
||||
.lock-wscript
|
||||
build/Release
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
web_modules/
|
||||
*.tsbuildinfo
|
||||
.npm
|
||||
.eslintcache
|
||||
.stylelintcache
|
||||
.rpt2_cache/
|
||||
.rts2_cache_cjs/
|
||||
.rts2_cache_es/
|
||||
.rts2_cache_umd/
|
||||
.node_repl_history
|
||||
*.tgz
|
||||
.yarn-integrity
|
||||
.env
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.local
|
||||
.cache
|
||||
.parcel-cache
|
||||
.next
|
||||
out
|
||||
.nuxt
|
||||
dist
|
||||
.cache/
|
||||
.vuepress/dist
|
||||
.temp
|
||||
.docusaurus
|
||||
.serverless/
|
||||
.fusebox/
|
||||
.dynamodb/
|
||||
.tern-port
|
||||
.vscode-test
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
Thumbs.db
|
||||
Thumbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
*.stackdump
|
||||
[Dd]esktop.ini
|
||||
$RECYCLE.BIN/
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
*.lnk
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
Icon
|
||||
._*
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
@@ -1,54 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_package_batch, run_upload} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch([
|
||||
'service-common',
|
||||
'service-dependencies',
|
||||
'service-configuration',
|
||||
'service-forest',
|
||||
'service-cli',
|
||||
'service-cli/service-cli-core',
|
||||
'service-executor',
|
||||
'service-executor/service-executor-core',
|
||||
'utils/executor',
|
||||
])
|
||||
await run_package_batch([
|
||||
'service-api',
|
||||
'service-check',
|
||||
'service-cli/service-cli-runner',
|
||||
'service-cloud-query',
|
||||
'service-executor/service-executor-manager',
|
||||
'service-executor/service-executor-task',
|
||||
'service-command',
|
||||
'service-command-pro',
|
||||
'service-exporter',
|
||||
'service-flink-query',
|
||||
'service-gateway',
|
||||
'service-hudi-query',
|
||||
'service-info-query',
|
||||
'service-monitor',
|
||||
'service-loki-query',
|
||||
'service-pulsar-query',
|
||||
'service-queue',
|
||||
'service-scheduler',
|
||||
'service-uploader',
|
||||
'service-web',
|
||||
'service-yarn-query',
|
||||
'service-zookeeper-query',
|
||||
'utils/patch',
|
||||
'utils/sync',
|
||||
])
|
||||
for (const profile of ['b2a4', 'b2b1', 'b2b12']) {
|
||||
await run_package('service-launcher', profile)
|
||||
await run_upload(`**/service-launcher-${profile}-1.0.0-SNAPSHOT.jar`)
|
||||
}
|
||||
await run_upload('**/target/*-1.0.0-SNAPSHOT.jar')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
38
bin/build-all.sh
Executable file
38
bin/build-all.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
mvn install -N -D skipTests
|
||||
deploy service-common service-dependencies service-configuration service-forest service-cli service-cli/service-cli-core service-executor service-executor/service-executor-core utils/executor
|
||||
package service-api service-check service-cli/service-cli-runner service-cloud-query service-executor/service-executor-manager service-executor/service-executor-task service-command service-command-pro service-exporter service-flink-query service-gateway service-hudi-query service-info-query service-monitor service-loki-query service-pulsar-query service-queue service-scheduler service-uploader service-web service-yarn-query service-zookeeper-query utils/patch utils/sync
|
||||
|
||||
configs=(b2a4 b2b1 b2b12)
|
||||
for config in ${configs[*]};
|
||||
do
|
||||
mvn -pl service-launcher clean package -D skipTests -P $config
|
||||
upload $root_path/service-launcher/target/service-launcher-$config-1.0.0-SNAPSHOT.jar
|
||||
done
|
||||
|
||||
upload $root_path/service-api/target/service-api-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-check/target/service-check-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-cloud-query/target/service-cloud-query-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-command/target/service-command-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-command-pro/target/service-command-pro-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-executor/service-executor-manager/target/service-executor-manager-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-executor/service-executor-task/target/service-executor-task-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-exporter/target/service-exporter-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-flink-query/target/service-flink-query-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-gateway/target/service-gateway-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-hudi-query/target/service-hudi-query-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-info-query/target/service-info-query-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-loki-query/target/service-loki-query-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-monitor/target/service-monitor-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-pulsar-query/target/service-pulsar-query-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-queue/target/service-queue-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-scheduler/target/service-scheduler-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-web/target/service-web-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-yarn-query/target/service-yarn-query-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-zookeeper-query/target/service-zookeeper-query-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/utils/sync/target/sync-1.0.0-SNAPSHOT.jar
|
||||
|
||||
upload $root_path/service-cli/service-cli-runner/target/service-cli-runner-1.0.0-SNAPSHOT.jar
|
||||
upload $root_path/service-uploader/target/service-uploader-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-api')
|
||||
await run_upload_normal('service-api')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-api.sh
Executable file
6
bin/build-api.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-api
|
||||
upload $root_path/service-api/target/service-api-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-check')
|
||||
await run_upload_normal('service-check')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-check.sh
Executable file
6
bin/build-check.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-check
|
||||
upload $root_path/service-check/target/service-check-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-cli', 'service-cli/service-cli-core'])
|
||||
await run_package('service-cli/service-cli-runner')
|
||||
await run_upload('**/service-cli-runner-1.0.0-SNAPSHOT.jar')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-cli.sh
Executable file
6
bin/build-cli.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-cli service-cli/service-cli-core
|
||||
package service-cli/service-cli-runner
|
||||
upload $root_path/service-cli/service-cli-runner/target/service-cli-runner-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-cloud-query')
|
||||
await run_upload_normal('service-cloud-query')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-cloud-query.sh
Executable file
6
bin/build-cloud-query.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-cloud-query
|
||||
upload $root_path/service-cloud-query/target/service-cloud-query-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-command-pro')
|
||||
await run_upload_normal('service-command-pro')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-command-pro.sh
Executable file
6
bin/build-command-pro.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-command-pro
|
||||
upload $root_path/service-command-pro/target/service-command-pro-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-command')
|
||||
await run_upload_normal('service-command')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-command.sh
Executable file
6
bin/build-command.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-command
|
||||
upload $root_path/service-command/target/service-command-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest', 'service-executor', 'service-executor/service-executor-core'])
|
||||
await run_package('service-executor/service-executor-manager')
|
||||
await run_upload('**/service-executor-manager-1.0.0-SNAPSHOT.jar')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-executor-manager.sh
Executable file
6
bin/build-executor-manager.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest service-executor service-executor/service-executor-core
|
||||
package service-executor/service-executor-manager
|
||||
upload $root_path/service-executor/service-executor-manager/target/service-executor-manager-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest', 'service-executor', 'service-executor/service-executor-core'])
|
||||
await run_package('service-executor/service-executor-task')
|
||||
await run_upload('**/service-executor-task-1.0.0-SNAPSHOT.jar')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-executor-task.sh
Executable file
6
bin/build-executor-task.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest service-executor service-executor/service-executor-core
|
||||
package service-executor/service-executor-task
|
||||
upload $root_path/service-executor/service-executor-task/target/service-executor-task-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-exporter')
|
||||
await run_upload_normal('service-exporter')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-exporter.sh
Executable file
6
bin/build-exporter.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-exporter
|
||||
upload $root_path/service-exporter/target/service-exporter-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-flink-query')
|
||||
await run_upload_normal('service-flink-query')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-flink-query.sh
Executable file
6
bin/build-flink-query.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-flink-query
|
||||
upload $root_path/service-flink-query/target/service-flink-query-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,13 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-gateway')
|
||||
await run_upload_normal('service-gateway')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-gateway.sh
Executable file
6
bin/build-gateway.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-gateway
|
||||
upload $root_path/service-gateway/target/service-gateway-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-hudi-query')
|
||||
await run_upload_normal('service-hudi-query')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-hudi-query.sh
Executable file
6
bin/build-hudi-query.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-hudi-query
|
||||
upload $root_path/service-hudi-query/target/service-hudi-query-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-info-query')
|
||||
await run_upload_normal('service-info-query')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-info-query.sh
Executable file
6
bin/build-info-query.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-info-query
|
||||
upload $root_path/service-info-query/target/service-info-query-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,17 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
for (const profile of ['b2a4', 'b2b1', 'b2b12']) {
|
||||
await run_package('service-launcher', profile)
|
||||
await run_upload(`**/service-launcher-${profile}-1.0.0-SNAPSHOT.jar`)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
11
bin/build-launcher.sh
Executable file
11
bin/build-launcher.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
|
||||
configs=(b2a4 b2b1 b2b12)
|
||||
for config in ${configs[*]};
|
||||
do
|
||||
mvn -pl service-launcher clean package -D skipTests -P $config
|
||||
upload $root_path/service-launcher/target/service-launcher-$config-1.0.0-SNAPSHOT.jar
|
||||
done
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-loki-query')
|
||||
await run_upload_normal('service-loki-query')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-loki-query.sh
Executable file
6
bin/build-loki-query.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-loki-query
|
||||
upload $root_path/service-loki-query/target/service-loki-query-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-monitor')
|
||||
await run_upload_normal('service-monitor')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-monitor.sh
Executable file
6
bin/build-monitor.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-monitor
|
||||
upload $root_path/service-monitor/target/service-monitor-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common'])
|
||||
await run_package('utils/patch')
|
||||
await run_upload('**/patch-1.0.0-SNAPSHOT.jar')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-patch.sh
Executable file
6
bin/build-patch.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package utils/patch
|
||||
upload $root_path/utils/patch/target/patch-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-pulsar-query')
|
||||
await run_upload_normal('service-pulsar-query')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-pulsar-query.sh
Executable file
6
bin/build-pulsar-query.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-pulsar-query
|
||||
upload $root_path/service-pulsar-query/target/service-pulsar-query-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-queue')
|
||||
await run_upload_normal('service-queue')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-queue.sh
Executable file
6
bin/build-queue.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-queue
|
||||
upload $root_path/service-queue/target/service-queue-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-scheduler')
|
||||
await run_upload_normal('service-scheduler')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-scheduler.sh
Executable file
6
bin/build-scheduler.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-scheduler
|
||||
upload $root_path/service-scheduler/target/service-scheduler-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'utils/patch'])
|
||||
await run_package('utils/sync')
|
||||
await run_upload('**/sync-1.0.0-SNAPSHOT.jar')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-sync.sh
Executable file
6
bin/build-sync.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest utils/patch
|
||||
package utils/sync
|
||||
upload $root_path/utils/sync/target/sync-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-uploader')
|
||||
await run_upload_normal('service-uploader')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-uploader.sh
Executable file
6
bin/build-uploader.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-uploader
|
||||
ytp-transfer2 $root_path/service-uploader/target/service-uploader-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-web')
|
||||
await run_upload_normal('service-web')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-web.sh
Executable file
6
bin/build-web.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-web
|
||||
upload $root_path/service-web/target/service-web-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-yarn-query')
|
||||
await run_upload_normal('service-yarn-query')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-yarn-query.sh
Executable file
6
bin/build-yarn-query.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-yarn-query
|
||||
upload $root_path/service-yarn-query/target/service-yarn-query-1.0.0-SNAPSHOT.jar
|
||||
@@ -1,15 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js";
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy_root()
|
||||
await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest'])
|
||||
await run_package('service-zookeeper-query')
|
||||
await run_upload_normal('service-zookeeper-query')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
6
bin/build-zookeeper-query.sh
Executable file
6
bin/build-zookeeper-query.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
source $root_path/bin/library.sh
|
||||
deploy service-common service-dependencies service-configuration service-forest
|
||||
package service-zookeeper-query
|
||||
upload $root_path/service-zookeeper-query/target/service-zookeeper-query-1.0.0-SNAPSHOT.jar
|
||||
@@ -4,7 +4,7 @@ jars_path=/data/datalake/jars
|
||||
jdk_path=/opt/jdk1.8.0_162/bin/java
|
||||
|
||||
arguments=$@
|
||||
# 手动上传jar包则注释掉这行,各显神通吧反正是
|
||||
# 手动上传jar包则注释掉这行,更显神通吧反正是
|
||||
curl http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.126.207.124:36800/file/download/service-cli-runner-1.0.0-SNAPSHOT.jar -o ${jars_path}/service-cli-runner.jar
|
||||
${jdk_path} -jar ${jars_path}/service-cli-runner.jar \
|
||||
--spring.profiles.active=b12 \
|
||||
|
||||
114
bin/library.js
114
bin/library.js
@@ -1,114 +0,0 @@
|
||||
import {$, fetch, fs, glob, os, path, spinner, syncProcessCwd, usePowerShell} from 'zx'
|
||||
import {isEqual, trim, fileSize} from "licia";
|
||||
import md5file from 'md5-file'
|
||||
|
||||
syncProcessCwd(true)
|
||||
if (isEqual(os.platform(), 'win32')) {
|
||||
usePowerShell()
|
||||
}
|
||||
|
||||
const maven_setting = path.join(os.homedir(), '.m2', 'settings-nas.xml')
|
||||
|
||||
const upload_url = 'http://132.126.207.124:36800'
|
||||
const upload_username = 'AxhEbscwsJDbYMH2'
|
||||
const upload_password = 'cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4'
|
||||
|
||||
/**
|
||||
* 时间戳转自然语言
|
||||
*
|
||||
* @param timestamp 时间戳
|
||||
* @returns {string} 自然语言描述的时间
|
||||
*/
|
||||
const millisecondToString = (timestamp) => {
|
||||
const totalSeconds = Math.floor(parseFloat(timestamp) / 1000)
|
||||
if (isNaN(totalSeconds) || totalSeconds < 0) {
|
||||
return "0秒";
|
||||
}
|
||||
|
||||
const days = Math.floor(totalSeconds / 86400)
|
||||
let remaining = totalSeconds % 86400
|
||||
const hours = Math.floor(remaining / 3600)
|
||||
remaining %= 3600
|
||||
const minutes = Math.floor(remaining / 60)
|
||||
const seconds = remaining % 60
|
||||
|
||||
const parts = []
|
||||
if (days > 0) parts.push(`${days}天`)
|
||||
if (days > 0 || hours > 0) parts.push(`${hours}小时`)
|
||||
if (days > 0 || hours > 0 || minutes > 0) parts.push(`${minutes}分钟`)
|
||||
parts.push(`${seconds}秒`)
|
||||
|
||||
return parts.join('')
|
||||
}
|
||||
|
||||
export const run_deploy = async (project) => {
|
||||
let output = await spinner(
|
||||
`Deploying project ${project}`,
|
||||
() => $`mvn -pl ${project} clean deploy -D skipTests -s ${maven_setting}`
|
||||
)
|
||||
console.log(`✅ Finished deploy ${project} (${millisecondToString(output['duration'])})`)
|
||||
}
|
||||
|
||||
export const run_deploy_root = async () => {
|
||||
let output = await spinner(
|
||||
`Deploying root`,
|
||||
() => $`mvn clean deploy -N -D skipTests -s ${maven_setting}`
|
||||
)
|
||||
console.log(`✅ Finished deploy root (${millisecondToString(output['duration'])})`)
|
||||
}
|
||||
|
||||
export const run_deploy_batch = async (projects) => {
|
||||
for (const project of projects) {
|
||||
await run_deploy(project)
|
||||
}
|
||||
}
|
||||
|
||||
export const run_package = async (project, profile = 'b2b12') => {
|
||||
let output = await spinner(
|
||||
`Packaging project ${project}${isEqual(profile, 'b2b12') ? '' : ` ${profile}`}`,
|
||||
() => $`mvn -pl ${project} clean package -D skipTests -P ${profile} -s ${maven_setting}`
|
||||
)
|
||||
console.log(`✅ Finished package ${project}${isEqual(profile, 'b2b12') ? '' : ` ${profile}`} (${millisecondToString(output['duration'])})`)
|
||||
}
|
||||
|
||||
export const run_package_batch = async (projects) => {
|
||||
for (const project of projects) {
|
||||
await run_package(project)
|
||||
}
|
||||
}
|
||||
|
||||
export const upload = async (file_path) => {
|
||||
let start = new Date().getTime()
|
||||
let basename = path.basename(file_path)
|
||||
let response = await spinner(
|
||||
`Uploading project ${file_path}`,
|
||||
() => fetch(`${upload_url}/file/upload/${basename}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/octet-stream',
|
||||
'Authorization': `Basic ${Buffer.from(`${upload_username}:${upload_password}`).toString('base64')}`,
|
||||
},
|
||||
body: fs.createReadStream(file_path),
|
||||
duplex: 'half',
|
||||
})
|
||||
)
|
||||
|
||||
if (!isEqual(response.status, 200)) {
|
||||
throw response
|
||||
}
|
||||
console.log(`✅ Finished upload ${file_path} (${millisecondToString((new Date().getTime()) - start)})`)
|
||||
console.log(`📘 Uploaded ${fileSize(fs.statSync(file_path).size)}`)
|
||||
console.log(`📘 MD5 ${md5file.sync(file_path)}`)
|
||||
console.log(`📘 Download curl http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.126.207.124:36800/file/download/${basename} -o ${basename}`)
|
||||
fs.rmSync(file_path)
|
||||
}
|
||||
|
||||
export const run_upload = async (pattern) => {
|
||||
for (let p of glob.sync(pattern)) {
|
||||
await upload(path.join(trim($.sync`pwd`.text()), p))
|
||||
}
|
||||
}
|
||||
|
||||
export const run_upload_normal = async (project) => {
|
||||
await run_upload(`${project}/target/${project}-1.0.0-SNAPSHOT.jar`)
|
||||
}
|
||||
36
bin/library.sh
Executable file
36
bin/library.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
build_profile=b2b12
|
||||
|
||||
upload_username=AxhEbscwsJDbYMH2
|
||||
upload_password=cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4
|
||||
upload_url=http://$upload_username:$upload_password@132.126.207.124:36800
|
||||
|
||||
root_path=$(dirname $(cd $(dirname $0);pwd))
|
||||
|
||||
function upload() {
|
||||
source_file_path=$(realpath $1)
|
||||
file_name=$(basename $source_file_path)
|
||||
echo "↪ Source md5: $(md5sum $source_file_path | awk '{print $1}')"
|
||||
echo "↪ Uploading $source_file_path"
|
||||
curl $upload_url/file/upload/$file_name -T $source_file_path
|
||||
echo "↪ Upload ytp success"
|
||||
echo "↪ Download: curl $upload_url/file/download/$file_name -o $file_name"
|
||||
echo "↪ Delete source"
|
||||
rm $source_file_path
|
||||
}
|
||||
|
||||
function joining {
|
||||
local d=${1-} f=${2-}
|
||||
if shift 2; then
|
||||
printf %s "$f" "${@/#/$d}"
|
||||
fi
|
||||
}
|
||||
|
||||
function deploy() {
|
||||
mvn -pl $(joining , $@) clean install -D skipTests
|
||||
}
|
||||
|
||||
function package() {
|
||||
mvn -pl $(joining , $@) clean package -D skipTests -P $build_profile
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "bin",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@webpod/ps": "^0.1.1",
|
||||
"chalk": "^5.4.1",
|
||||
"envapi": "^0.2.3",
|
||||
"fs-extra": "^11.3.0",
|
||||
"globby": "^14.1.0",
|
||||
"licia": "^1.48.0",
|
||||
"md5-file": "^5.0.0",
|
||||
"minimist": "^1.2.8",
|
||||
"node-fetch-native": "^1.6.6",
|
||||
"which": "^5.0.0",
|
||||
"yaml": "^2.8.0",
|
||||
"zx": "^8.5.4"
|
||||
}
|
||||
}
|
||||
337
bin/pnpm-lock.yaml
generated
337
bin/pnpm-lock.yaml
generated
@@ -1,337 +0,0 @@
|
||||
lockfileVersion: '9.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
dependencies:
|
||||
'@webpod/ps':
|
||||
specifier: ^0.1.1
|
||||
version: 0.1.1
|
||||
chalk:
|
||||
specifier: ^5.4.1
|
||||
version: 5.4.1
|
||||
envapi:
|
||||
specifier: ^0.2.3
|
||||
version: 0.2.3
|
||||
fs-extra:
|
||||
specifier: ^11.3.0
|
||||
version: 11.3.0
|
||||
globby:
|
||||
specifier: ^14.1.0
|
||||
version: 14.1.0
|
||||
licia:
|
||||
specifier: ^1.48.0
|
||||
version: 1.48.0
|
||||
md5-file:
|
||||
specifier: ^5.0.0
|
||||
version: 5.0.0
|
||||
minimist:
|
||||
specifier: ^1.2.8
|
||||
version: 1.2.8
|
||||
node-fetch-native:
|
||||
specifier: ^1.6.6
|
||||
version: 1.6.6
|
||||
which:
|
||||
specifier: ^5.0.0
|
||||
version: 5.0.0
|
||||
yaml:
|
||||
specifier: ^2.8.0
|
||||
version: 2.8.0
|
||||
zx:
|
||||
specifier: ^8.5.4
|
||||
version: 8.5.4
|
||||
|
||||
packages:
|
||||
|
||||
'@nodelib/fs.scandir@2.1.5':
|
||||
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
'@nodelib/fs.stat@2.0.5':
|
||||
resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
'@nodelib/fs.walk@1.2.8':
|
||||
resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
'@sindresorhus/merge-streams@2.3.0':
|
||||
resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@webpod/ingrid@0.0.0-beta.3':
|
||||
resolution: {integrity: sha512-PkorwT+q/MiIF+It47ORX0wCYHumOeMKwp5KX5WbUvbCeOtSB6b5UUC5FvzlijdwK/YPR+sOitQzyVSsRrMmJA==}
|
||||
|
||||
'@webpod/ps@0.1.1':
|
||||
resolution: {integrity: sha512-SIgb4wWEVlKgdRByMMz9c3y1hpKfNm2sbretCPD49O9LG6itibULMkiRISdkpMdGRiUpbGHp8tiN3ZLYRDHj1g==}
|
||||
|
||||
braces@3.0.3:
|
||||
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
chalk@5.4.1:
|
||||
resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==}
|
||||
engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}
|
||||
|
||||
envapi@0.2.3:
|
||||
resolution: {integrity: sha512-kSPSecU+/eH0IajEYZ/LndeBjzSBmLyp/SZFgx8Zgyeu0SoGioHkICOOVJgJLaX/rqZrCrQ+eDxiaYNVcyCsbQ==}
|
||||
|
||||
fast-glob@3.3.3:
|
||||
resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==}
|
||||
engines: {node: '>=8.6.0'}
|
||||
|
||||
fastq@1.19.1:
|
||||
resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==}
|
||||
|
||||
fill-range@7.1.1:
|
||||
resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
fs-extra@11.3.0:
|
||||
resolution: {integrity: sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==}
|
||||
engines: {node: '>=14.14'}
|
||||
|
||||
glob-parent@5.1.2:
|
||||
resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
|
||||
engines: {node: '>= 6'}
|
||||
|
||||
globby@14.1.0:
|
||||
resolution: {integrity: sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
graceful-fs@4.2.11:
|
||||
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
|
||||
|
||||
ignore@7.0.4:
|
||||
resolution: {integrity: sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A==}
|
||||
engines: {node: '>= 4'}
|
||||
|
||||
is-extglob@2.1.1:
|
||||
resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
is-glob@4.0.3:
|
||||
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
is-number@7.0.0:
|
||||
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
|
||||
engines: {node: '>=0.12.0'}
|
||||
|
||||
isexe@3.1.1:
|
||||
resolution: {integrity: sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==}
|
||||
engines: {node: '>=16'}
|
||||
|
||||
jsonfile@6.1.0:
|
||||
resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
|
||||
|
||||
licia@1.48.0:
|
||||
resolution: {integrity: sha512-bBWiT5CSdEtwuAHiYTJ74yItCjIFdHi4xiFk6BRDfKa+sdCpkUHp69YKb5udNOJlHDzFjNjcMgNZ/+wQIHrB8A==}
|
||||
|
||||
md5-file@5.0.0:
|
||||
resolution: {integrity: sha512-xbEFXCYVWrSx/gEKS1VPlg84h/4L20znVIulKw6kMfmBUAZNAnF00eczz9ICMl+/hjQGo5KSXRxbL/47X3rmMw==}
|
||||
engines: {node: '>=10.13.0'}
|
||||
hasBin: true
|
||||
|
||||
merge2@1.4.1:
|
||||
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
micromatch@4.0.8:
|
||||
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
|
||||
engines: {node: '>=8.6'}
|
||||
|
||||
minimist@1.2.8:
|
||||
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
||||
|
||||
node-fetch-native@1.6.6:
|
||||
resolution: {integrity: sha512-8Mc2HhqPdlIfedsuZoc3yioPuzp6b+L5jRCRY1QzuWZh2EGJVQrGppC6V6cF0bLdbW0+O2YpqCA25aF/1lvipQ==}
|
||||
|
||||
path-type@6.0.0:
|
||||
resolution: {integrity: sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
picomatch@2.3.1:
|
||||
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
|
||||
engines: {node: '>=8.6'}
|
||||
|
||||
queue-microtask@1.2.3:
|
||||
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
|
||||
|
||||
reusify@1.1.0:
|
||||
resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==}
|
||||
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
|
||||
|
||||
run-parallel@1.2.0:
|
||||
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
|
||||
|
||||
slash@5.1.0:
|
||||
resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==}
|
||||
engines: {node: '>=14.16'}
|
||||
|
||||
to-regex-range@5.0.1:
|
||||
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
|
||||
engines: {node: '>=8.0'}
|
||||
|
||||
unicorn-magic@0.3.0:
|
||||
resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
universalify@2.0.1:
|
||||
resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
|
||||
engines: {node: '>= 10.0.0'}
|
||||
|
||||
which@5.0.0:
|
||||
resolution: {integrity: sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==}
|
||||
engines: {node: ^18.17.0 || >=20.5.0}
|
||||
hasBin: true
|
||||
|
||||
yaml@2.8.0:
|
||||
resolution: {integrity: sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==}
|
||||
engines: {node: '>= 14.6'}
|
||||
hasBin: true
|
||||
|
||||
zurk@0.11.2:
|
||||
resolution: {integrity: sha512-OKUQsmG588B18hzO4ThzOU0NUwr4C8aKl9NjGQfXUv5fskLfS6Sj3XGNbTzKj3d2+jWvmnqS2cgrwYX6bIkDyA==}
|
||||
|
||||
zx@8.5.4:
|
||||
resolution: {integrity: sha512-44oKea9Sa8ZnOkTnS6fRJpg3quzgnbB43nLrVfYnqE86J4sxgZMUDLezzKET/FdOAVkF4X+Alm9Bume+W+RW9Q==}
|
||||
engines: {node: '>= 12.17.0'}
|
||||
hasBin: true
|
||||
|
||||
snapshots:
|
||||
|
||||
'@nodelib/fs.scandir@2.1.5':
|
||||
dependencies:
|
||||
'@nodelib/fs.stat': 2.0.5
|
||||
run-parallel: 1.2.0
|
||||
|
||||
'@nodelib/fs.stat@2.0.5': {}
|
||||
|
||||
'@nodelib/fs.walk@1.2.8':
|
||||
dependencies:
|
||||
'@nodelib/fs.scandir': 2.1.5
|
||||
fastq: 1.19.1
|
||||
|
||||
'@sindresorhus/merge-streams@2.3.0': {}
|
||||
|
||||
'@webpod/ingrid@0.0.0-beta.3': {}
|
||||
|
||||
'@webpod/ps@0.1.1':
|
||||
dependencies:
|
||||
'@webpod/ingrid': 0.0.0-beta.3
|
||||
zurk: 0.11.2
|
||||
|
||||
braces@3.0.3:
|
||||
dependencies:
|
||||
fill-range: 7.1.1
|
||||
|
||||
chalk@5.4.1: {}
|
||||
|
||||
envapi@0.2.3: {}
|
||||
|
||||
fast-glob@3.3.3:
|
||||
dependencies:
|
||||
'@nodelib/fs.stat': 2.0.5
|
||||
'@nodelib/fs.walk': 1.2.8
|
||||
glob-parent: 5.1.2
|
||||
merge2: 1.4.1
|
||||
micromatch: 4.0.8
|
||||
|
||||
fastq@1.19.1:
|
||||
dependencies:
|
||||
reusify: 1.1.0
|
||||
|
||||
fill-range@7.1.1:
|
||||
dependencies:
|
||||
to-regex-range: 5.0.1
|
||||
|
||||
fs-extra@11.3.0:
|
||||
dependencies:
|
||||
graceful-fs: 4.2.11
|
||||
jsonfile: 6.1.0
|
||||
universalify: 2.0.1
|
||||
|
||||
glob-parent@5.1.2:
|
||||
dependencies:
|
||||
is-glob: 4.0.3
|
||||
|
||||
globby@14.1.0:
|
||||
dependencies:
|
||||
'@sindresorhus/merge-streams': 2.3.0
|
||||
fast-glob: 3.3.3
|
||||
ignore: 7.0.4
|
||||
path-type: 6.0.0
|
||||
slash: 5.1.0
|
||||
unicorn-magic: 0.3.0
|
||||
|
||||
graceful-fs@4.2.11: {}
|
||||
|
||||
ignore@7.0.4: {}
|
||||
|
||||
is-extglob@2.1.1: {}
|
||||
|
||||
is-glob@4.0.3:
|
||||
dependencies:
|
||||
is-extglob: 2.1.1
|
||||
|
||||
is-number@7.0.0: {}
|
||||
|
||||
isexe@3.1.1: {}
|
||||
|
||||
jsonfile@6.1.0:
|
||||
dependencies:
|
||||
universalify: 2.0.1
|
||||
optionalDependencies:
|
||||
graceful-fs: 4.2.11
|
||||
|
||||
licia@1.48.0: {}
|
||||
|
||||
md5-file@5.0.0: {}
|
||||
|
||||
merge2@1.4.1: {}
|
||||
|
||||
micromatch@4.0.8:
|
||||
dependencies:
|
||||
braces: 3.0.3
|
||||
picomatch: 2.3.1
|
||||
|
||||
minimist@1.2.8: {}
|
||||
|
||||
node-fetch-native@1.6.6: {}
|
||||
|
||||
path-type@6.0.0: {}
|
||||
|
||||
picomatch@2.3.1: {}
|
||||
|
||||
queue-microtask@1.2.3: {}
|
||||
|
||||
reusify@1.1.0: {}
|
||||
|
||||
run-parallel@1.2.0:
|
||||
dependencies:
|
||||
queue-microtask: 1.2.3
|
||||
|
||||
slash@5.1.0: {}
|
||||
|
||||
to-regex-range@5.0.1:
|
||||
dependencies:
|
||||
is-number: 7.0.0
|
||||
|
||||
unicorn-magic@0.3.0: {}
|
||||
|
||||
universalify@2.0.1: {}
|
||||
|
||||
which@5.0.0:
|
||||
dependencies:
|
||||
isexe: 3.1.1
|
||||
|
||||
yaml@2.8.0: {}
|
||||
|
||||
zurk@0.11.2: {}
|
||||
|
||||
zx@8.5.4: {}
|
||||
12
pom.xml
12
pom.xml
@@ -8,7 +8,7 @@
|
||||
<artifactId>hudi-service</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<description>Hudi服务应用集合</description>
|
||||
<description>Hudi服务模块系列应用</description>
|
||||
<modules>
|
||||
<module>service-common</module>
|
||||
<module>service-dependencies</module>
|
||||
@@ -417,16 +417,6 @@
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.4.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-invoker-plugin</artifactId>
|
||||
<version>3.9.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
|
||||
102
service-ai/bin/.gitignore
vendored
102
service-ai/bin/.gitignore
vendored
@@ -1,102 +0,0 @@
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
!.vscode/*.code-snippets
|
||||
.history/
|
||||
*.vsix
|
||||
*~
|
||||
.fuse_hidden*
|
||||
.directory
|
||||
.Trash-*
|
||||
.nfs*
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
.pnpm-debug.log*
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
lib-cov
|
||||
coverage
|
||||
*.lcov
|
||||
.nyc_output
|
||||
.grunt
|
||||
bower_components
|
||||
.lock-wscript
|
||||
build/Release
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
web_modules/
|
||||
*.tsbuildinfo
|
||||
.npm
|
||||
.eslintcache
|
||||
.stylelintcache
|
||||
.rpt2_cache/
|
||||
.rts2_cache_cjs/
|
||||
.rts2_cache_es/
|
||||
.rts2_cache_umd/
|
||||
.node_repl_history
|
||||
*.tgz
|
||||
.yarn-integrity
|
||||
.env
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.local
|
||||
.cache
|
||||
.parcel-cache
|
||||
.next
|
||||
out
|
||||
.nuxt
|
||||
dist
|
||||
.cache/
|
||||
.vuepress/dist
|
||||
.temp
|
||||
.docusaurus
|
||||
.serverless/
|
||||
.fusebox/
|
||||
.dynamodb/
|
||||
.tern-port
|
||||
.vscode-test
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
Thumbs.db
|
||||
Thumbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
*.stackdump
|
||||
[Dd]esktop.ini
|
||||
$RECYCLE.BIN/
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
*.lnk
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
Icon
|
||||
._*
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
@@ -1,12 +0,0 @@
|
||||
import {cd, path} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {run_deploy} from '../../bin/library.js'
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy('service-ai-core')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import {
|
||||
cd,
|
||||
path,
|
||||
} from 'zx'
|
||||
import {trim} from "licia";
|
||||
import {
|
||||
run_deploy,
|
||||
run_package,
|
||||
run_upload_normal,
|
||||
} from '../../bin/library.js'
|
||||
|
||||
// 切换目录
|
||||
cd(trim(path.dirname(import.meta.dirname)))
|
||||
// 执行流程
|
||||
try {
|
||||
await run_deploy('service-ai-core')
|
||||
await run_package('service-ai-web')
|
||||
await run_upload_normal('service-ai-web')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "bin",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@webpod/ps": "^0.1.1",
|
||||
"chalk": "^5.4.1",
|
||||
"envapi": "^0.2.3",
|
||||
"fs-extra": "^11.3.0",
|
||||
"globby": "^14.1.0",
|
||||
"licia": "^1.48.0",
|
||||
"md5-file": "^5.0.0",
|
||||
"minimist": "^1.2.8",
|
||||
"node-fetch-native": "^1.6.6",
|
||||
"which": "^5.0.0",
|
||||
"yaml": "^2.8.0",
|
||||
"zx": "^8.5.4"
|
||||
}
|
||||
}
|
||||
337
service-ai/bin/pnpm-lock.yaml
generated
337
service-ai/bin/pnpm-lock.yaml
generated
@@ -1,337 +0,0 @@
|
||||
lockfileVersion: '9.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
dependencies:
|
||||
'@webpod/ps':
|
||||
specifier: ^0.1.1
|
||||
version: 0.1.1
|
||||
chalk:
|
||||
specifier: ^5.4.1
|
||||
version: 5.4.1
|
||||
envapi:
|
||||
specifier: ^0.2.3
|
||||
version: 0.2.3
|
||||
fs-extra:
|
||||
specifier: ^11.3.0
|
||||
version: 11.3.0
|
||||
globby:
|
||||
specifier: ^14.1.0
|
||||
version: 14.1.0
|
||||
licia:
|
||||
specifier: ^1.48.0
|
||||
version: 1.48.0
|
||||
md5-file:
|
||||
specifier: ^5.0.0
|
||||
version: 5.0.0
|
||||
minimist:
|
||||
specifier: ^1.2.8
|
||||
version: 1.2.8
|
||||
node-fetch-native:
|
||||
specifier: ^1.6.6
|
||||
version: 1.6.6
|
||||
which:
|
||||
specifier: ^5.0.0
|
||||
version: 5.0.0
|
||||
yaml:
|
||||
specifier: ^2.8.0
|
||||
version: 2.8.0
|
||||
zx:
|
||||
specifier: ^8.5.4
|
||||
version: 8.5.4
|
||||
|
||||
packages:
|
||||
|
||||
'@nodelib/fs.scandir@2.1.5':
|
||||
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
'@nodelib/fs.stat@2.0.5':
|
||||
resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
'@nodelib/fs.walk@1.2.8':
|
||||
resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
'@sindresorhus/merge-streams@2.3.0':
|
||||
resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@webpod/ingrid@0.0.0-beta.3':
|
||||
resolution: {integrity: sha512-PkorwT+q/MiIF+It47ORX0wCYHumOeMKwp5KX5WbUvbCeOtSB6b5UUC5FvzlijdwK/YPR+sOitQzyVSsRrMmJA==}
|
||||
|
||||
'@webpod/ps@0.1.1':
|
||||
resolution: {integrity: sha512-SIgb4wWEVlKgdRByMMz9c3y1hpKfNm2sbretCPD49O9LG6itibULMkiRISdkpMdGRiUpbGHp8tiN3ZLYRDHj1g==}
|
||||
|
||||
braces@3.0.3:
|
||||
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
chalk@5.4.1:
|
||||
resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==}
|
||||
engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}
|
||||
|
||||
envapi@0.2.3:
|
||||
resolution: {integrity: sha512-kSPSecU+/eH0IajEYZ/LndeBjzSBmLyp/SZFgx8Zgyeu0SoGioHkICOOVJgJLaX/rqZrCrQ+eDxiaYNVcyCsbQ==}
|
||||
|
||||
fast-glob@3.3.3:
|
||||
resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==}
|
||||
engines: {node: '>=8.6.0'}
|
||||
|
||||
fastq@1.19.1:
|
||||
resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==}
|
||||
|
||||
fill-range@7.1.1:
|
||||
resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
fs-extra@11.3.0:
|
||||
resolution: {integrity: sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==}
|
||||
engines: {node: '>=14.14'}
|
||||
|
||||
glob-parent@5.1.2:
|
||||
resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
|
||||
engines: {node: '>= 6'}
|
||||
|
||||
globby@14.1.0:
|
||||
resolution: {integrity: sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
graceful-fs@4.2.11:
|
||||
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
|
||||
|
||||
ignore@7.0.4:
|
||||
resolution: {integrity: sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A==}
|
||||
engines: {node: '>= 4'}
|
||||
|
||||
is-extglob@2.1.1:
|
||||
resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
is-glob@4.0.3:
|
||||
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
is-number@7.0.0:
|
||||
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
|
||||
engines: {node: '>=0.12.0'}
|
||||
|
||||
isexe@3.1.1:
|
||||
resolution: {integrity: sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==}
|
||||
engines: {node: '>=16'}
|
||||
|
||||
jsonfile@6.1.0:
|
||||
resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
|
||||
|
||||
licia@1.48.0:
|
||||
resolution: {integrity: sha512-bBWiT5CSdEtwuAHiYTJ74yItCjIFdHi4xiFk6BRDfKa+sdCpkUHp69YKb5udNOJlHDzFjNjcMgNZ/+wQIHrB8A==}
|
||||
|
||||
md5-file@5.0.0:
|
||||
resolution: {integrity: sha512-xbEFXCYVWrSx/gEKS1VPlg84h/4L20znVIulKw6kMfmBUAZNAnF00eczz9ICMl+/hjQGo5KSXRxbL/47X3rmMw==}
|
||||
engines: {node: '>=10.13.0'}
|
||||
hasBin: true
|
||||
|
||||
merge2@1.4.1:
|
||||
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
micromatch@4.0.8:
|
||||
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
|
||||
engines: {node: '>=8.6'}
|
||||
|
||||
minimist@1.2.8:
|
||||
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
||||
|
||||
node-fetch-native@1.6.6:
|
||||
resolution: {integrity: sha512-8Mc2HhqPdlIfedsuZoc3yioPuzp6b+L5jRCRY1QzuWZh2EGJVQrGppC6V6cF0bLdbW0+O2YpqCA25aF/1lvipQ==}
|
||||
|
||||
path-type@6.0.0:
|
||||
resolution: {integrity: sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
picomatch@2.3.1:
|
||||
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
|
||||
engines: {node: '>=8.6'}
|
||||
|
||||
queue-microtask@1.2.3:
|
||||
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
|
||||
|
||||
reusify@1.1.0:
|
||||
resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==}
|
||||
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
|
||||
|
||||
run-parallel@1.2.0:
|
||||
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
|
||||
|
||||
slash@5.1.0:
|
||||
resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==}
|
||||
engines: {node: '>=14.16'}
|
||||
|
||||
to-regex-range@5.0.1:
|
||||
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
|
||||
engines: {node: '>=8.0'}
|
||||
|
||||
unicorn-magic@0.3.0:
|
||||
resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
universalify@2.0.1:
|
||||
resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
|
||||
engines: {node: '>= 10.0.0'}
|
||||
|
||||
which@5.0.0:
|
||||
resolution: {integrity: sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==}
|
||||
engines: {node: ^18.17.0 || >=20.5.0}
|
||||
hasBin: true
|
||||
|
||||
yaml@2.8.0:
|
||||
resolution: {integrity: sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==}
|
||||
engines: {node: '>= 14.6'}
|
||||
hasBin: true
|
||||
|
||||
zurk@0.11.2:
|
||||
resolution: {integrity: sha512-OKUQsmG588B18hzO4ThzOU0NUwr4C8aKl9NjGQfXUv5fskLfS6Sj3XGNbTzKj3d2+jWvmnqS2cgrwYX6bIkDyA==}
|
||||
|
||||
zx@8.5.4:
|
||||
resolution: {integrity: sha512-44oKea9Sa8ZnOkTnS6fRJpg3quzgnbB43nLrVfYnqE86J4sxgZMUDLezzKET/FdOAVkF4X+Alm9Bume+W+RW9Q==}
|
||||
engines: {node: '>= 12.17.0'}
|
||||
hasBin: true
|
||||
|
||||
snapshots:
|
||||
|
||||
'@nodelib/fs.scandir@2.1.5':
|
||||
dependencies:
|
||||
'@nodelib/fs.stat': 2.0.5
|
||||
run-parallel: 1.2.0
|
||||
|
||||
'@nodelib/fs.stat@2.0.5': {}
|
||||
|
||||
'@nodelib/fs.walk@1.2.8':
|
||||
dependencies:
|
||||
'@nodelib/fs.scandir': 2.1.5
|
||||
fastq: 1.19.1
|
||||
|
||||
'@sindresorhus/merge-streams@2.3.0': {}
|
||||
|
||||
'@webpod/ingrid@0.0.0-beta.3': {}
|
||||
|
||||
'@webpod/ps@0.1.1':
|
||||
dependencies:
|
||||
'@webpod/ingrid': 0.0.0-beta.3
|
||||
zurk: 0.11.2
|
||||
|
||||
braces@3.0.3:
|
||||
dependencies:
|
||||
fill-range: 7.1.1
|
||||
|
||||
chalk@5.4.1: {}
|
||||
|
||||
envapi@0.2.3: {}
|
||||
|
||||
fast-glob@3.3.3:
|
||||
dependencies:
|
||||
'@nodelib/fs.stat': 2.0.5
|
||||
'@nodelib/fs.walk': 1.2.8
|
||||
glob-parent: 5.1.2
|
||||
merge2: 1.4.1
|
||||
micromatch: 4.0.8
|
||||
|
||||
fastq@1.19.1:
|
||||
dependencies:
|
||||
reusify: 1.1.0
|
||||
|
||||
fill-range@7.1.1:
|
||||
dependencies:
|
||||
to-regex-range: 5.0.1
|
||||
|
||||
fs-extra@11.3.0:
|
||||
dependencies:
|
||||
graceful-fs: 4.2.11
|
||||
jsonfile: 6.1.0
|
||||
universalify: 2.0.1
|
||||
|
||||
glob-parent@5.1.2:
|
||||
dependencies:
|
||||
is-glob: 4.0.3
|
||||
|
||||
globby@14.1.0:
|
||||
dependencies:
|
||||
'@sindresorhus/merge-streams': 2.3.0
|
||||
fast-glob: 3.3.3
|
||||
ignore: 7.0.4
|
||||
path-type: 6.0.0
|
||||
slash: 5.1.0
|
||||
unicorn-magic: 0.3.0
|
||||
|
||||
graceful-fs@4.2.11: {}
|
||||
|
||||
ignore@7.0.4: {}
|
||||
|
||||
is-extglob@2.1.1: {}
|
||||
|
||||
is-glob@4.0.3:
|
||||
dependencies:
|
||||
is-extglob: 2.1.1
|
||||
|
||||
is-number@7.0.0: {}
|
||||
|
||||
isexe@3.1.1: {}
|
||||
|
||||
jsonfile@6.1.0:
|
||||
dependencies:
|
||||
universalify: 2.0.1
|
||||
optionalDependencies:
|
||||
graceful-fs: 4.2.11
|
||||
|
||||
licia@1.48.0: {}
|
||||
|
||||
md5-file@5.0.0: {}
|
||||
|
||||
merge2@1.4.1: {}
|
||||
|
||||
micromatch@4.0.8:
|
||||
dependencies:
|
||||
braces: 3.0.3
|
||||
picomatch: 2.3.1
|
||||
|
||||
minimist@1.2.8: {}
|
||||
|
||||
node-fetch-native@1.6.6: {}
|
||||
|
||||
path-type@6.0.0: {}
|
||||
|
||||
picomatch@2.3.1: {}
|
||||
|
||||
queue-microtask@1.2.3: {}
|
||||
|
||||
reusify@1.1.0: {}
|
||||
|
||||
run-parallel@1.2.0:
|
||||
dependencies:
|
||||
queue-microtask: 1.2.3
|
||||
|
||||
slash@5.1.0: {}
|
||||
|
||||
to-regex-range@5.0.1:
|
||||
dependencies:
|
||||
is-number: 7.0.0
|
||||
|
||||
unicorn-magic@0.3.0: {}
|
||||
|
||||
universalify@2.0.1: {}
|
||||
|
||||
which@5.0.0:
|
||||
dependencies:
|
||||
isexe: 3.1.1
|
||||
|
||||
yaml@2.8.0: {}
|
||||
|
||||
zurk@0.11.2: {}
|
||||
|
||||
zx@8.5.4: {}
|
||||
@@ -1,18 +0,0 @@
|
||||
CREATE TABLE `service_ai_feedback`
|
||||
(
|
||||
`id` bigint NOT NULL,
|
||||
`created_time` datetime(6) DEFAULT NULL,
|
||||
`modified_time` datetime(6) DEFAULT NULL,
|
||||
`analysis` longtext,
|
||||
`conclusion` longtext,
|
||||
`source` longtext NOT NULL,
|
||||
`status` tinyint NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARSET = utf8mb4;
|
||||
|
||||
CREATE TABLE `service_ai_feedback_pictures`
|
||||
(
|
||||
`feedback_id` bigint NOT NULL,
|
||||
`pictures_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`feedback_id`, `pictures_id`)
|
||||
) DEFAULT CHARSET = utf8mb4;
|
||||
@@ -1,12 +0,0 @@
|
||||
CREATE TABLE `service_ai_file`
|
||||
(
|
||||
`id` bigint NOT NULL,
|
||||
`created_time` datetime(6) DEFAULT NULL,
|
||||
`modified_time` datetime(6) DEFAULT NULL,
|
||||
`filename` varchar(255) DEFAULT NULL,
|
||||
`md5` varchar(255) DEFAULT NULL,
|
||||
`path` varchar(255) DEFAULT NULL,
|
||||
`size` bigint DEFAULT NULL,
|
||||
`type` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARSET = utf8mb4;
|
||||
@@ -1,10 +0,0 @@
|
||||
CREATE TABLE `service_ai_group`
|
||||
(
|
||||
`id` bigint NOT NULL,
|
||||
`created_time` datetime(6) DEFAULT NULL,
|
||||
`modified_time` datetime(6) DEFAULT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`status` tinyint NOT NULL,
|
||||
`knowledge_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARSET=utf8mb4;
|
||||
@@ -1,11 +0,0 @@
|
||||
CREATE TABLE `service_ai_knowledge`
|
||||
(
|
||||
`id` bigint NOT NULL,
|
||||
`created_time` datetime(6) DEFAULT NULL,
|
||||
`modified_time` datetime(6) DEFAULT NULL,
|
||||
`description` longtext NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`strategy` tinyint NOT NULL,
|
||||
`vector_source_id` bigint NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARSET = utf8mb4;
|
||||
@@ -1,216 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.lanyuanxiaoyao</groupId>
|
||||
<artifactId>service-ai</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<description>Hudi AI服务集合</description>
|
||||
<modules>
|
||||
<module>service-ai-core</module>
|
||||
<module>service-ai-web</module>
|
||||
<module>service-ai-cli</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
<build-tag>b2b12</build-tag>
|
||||
|
||||
<spring-boot.version>3.4.3</spring-boot.version>
|
||||
<spring-cloud.version>2024.0.1</spring-cloud.version>
|
||||
<spring-ai.version>1.0.0</spring-ai.version>
|
||||
<solon-ai.version>3.3.1</solon-ai.version>
|
||||
<eclipse-collections.version>11.1.0</eclipse-collections.version>
|
||||
<curator.version>5.1.0</curator.version>
|
||||
<hutool.version>5.8.27</hutool.version>
|
||||
<mapstruct.version>1.6.3</mapstruct.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- 当前项目依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.lanyuanxiaoyao</groupId>
|
||||
<artifactId>service-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lanyuanxiaoyao</groupId>
|
||||
<artifactId>service-configuration</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lanyuanxiaoyao</groupId>
|
||||
<artifactId>service-dependencies</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lanyuanxiaoyao</groupId>
|
||||
<artifactId>service-forest</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lanyuanxiaoyao</groupId>
|
||||
<artifactId>service-ai-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- spring boot 相关依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-bom</artifactId>
|
||||
<version>${spring-ai.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.dtflys.forest</groupId>
|
||||
<artifactId>forest-spring-boot3-starter</artifactId>
|
||||
<version>1.5.36</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-eclipse-collections</artifactId>
|
||||
<version>2.17.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.ulisesbocchio</groupId>
|
||||
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||
<version>3.0.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.blinkfox</groupId>
|
||||
<artifactId>fenix-spring-boot-starter</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 日志相关 -->
|
||||
<dependency>
|
||||
<groupId>pl.tkowalcz.tjahzi</groupId>
|
||||
<artifactId>logback-appender</artifactId>
|
||||
<version>0.9.23</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.loki4j</groupId>
|
||||
<artifactId>loki-logback-appender-jdk8</artifactId>
|
||||
<version>1.4.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 其他 -->
|
||||
<dependency>
|
||||
<groupId>dev.failsafe</groupId>
|
||||
<artifactId>failsafe</artifactId>
|
||||
<version>3.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.collections</groupId>
|
||||
<artifactId>eclipse-collections</artifactId>
|
||||
<version>${eclipse-collections.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.collections</groupId>
|
||||
<artifactId>eclipse-collections-api</artifactId>
|
||||
<version>${eclipse-collections.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||
<version>2.13.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.noear</groupId>
|
||||
<artifactId>solon-ai</artifactId>
|
||||
<version>${solon-ai.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.noear</groupId>
|
||||
<artifactId>solon-ai-dialect-openai</artifactId>
|
||||
<version>${solon-ai.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.14.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>${releases.id}</id>
|
||||
<name>${releases.name}</name>
|
||||
<url>${releases.url}</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>${snapshots.id}</id>
|
||||
<name>${snapshots.name}</name>
|
||||
<url>${snapshots.url}</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
</project>
|
||||
@@ -1,46 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.lanyuanxiaoyao</groupId>
|
||||
<artifactId>service-ai</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>service-ai-cli</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.freemarker</groupId>
|
||||
<artifactId>freemarker</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.cli;
|
||||
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @version 20250612
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class Generator implements ApplicationRunner {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Generator.class, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
new LlamaSwapTool().generate();
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.cli;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.extra.template.Template;
|
||||
import cn.hutool.extra.template.TemplateConfig;
|
||||
import cn.hutool.extra.template.TemplateEngine;
|
||||
import cn.hutool.extra.template.TemplateUtil;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @version 20250612
|
||||
*/
|
||||
public abstract class GeneratorTool {
|
||||
private final TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH));
|
||||
|
||||
protected void generateTemplate(String templatePath, Map<?, ?> data, String targetScriptPath) {
|
||||
Template template = engine.getTemplate(templatePath);
|
||||
String script = template.render(data);
|
||||
FileUtil.del(targetScriptPath);
|
||||
FileUtil.writeString(script, targetScriptPath, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
public abstract void generate() throws Exception;
|
||||
}
|
||||
@@ -1,244 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.cli;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @version 20250612
|
||||
*/
|
||||
public class LlamaSwapTool extends GeneratorTool {
|
||||
private static final String API_KEY = "*XMySqV%>hR&v>>g*NwCs3tpQ5FVMFEF2VHVTj<MYQd$&@$sY7CgqNyea4giJi4";
|
||||
|
||||
public static String displayName(String name) {
|
||||
return name.replaceAll("\\s+", "_")
|
||||
.replaceAll("\\.", "_")
|
||||
.toLowerCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTemplate(
|
||||
"llama-swap.ftl",
|
||||
Map.of(
|
||||
"models", List.of(
|
||||
llamaCppEmbeddingCmd("BGE/bge-m3-q4km", "bge-m3-Q4_K_M.gguf", 20),
|
||||
vllmEmbeddingCmd("BGE/bge-m3", "bge-m3", 5),
|
||||
llamaCppRerankerCmd("BGE/beg-reranker-v2-q4km", "bge-reranker-v2-m3-Q4_K_M.gguf", 20),
|
||||
vllmRerankerCmd("BGE/beg-reranker-v2", "bge-reranker-v2-m3", 5),
|
||||
|
||||
vllmCmd("Qwen3/qwen3-0.6b", "Qwen3-0.6B", 5, true),
|
||||
vllmCmd("Qwen3/qwen3-1.7b", "Qwen3-1.7B", 5, true),
|
||||
vllmCmd("Qwen3/qwen3-4b", "Qwen3-4B", 8, true),
|
||||
llamaCppCmd("Qwen3/qwen3-4b-q4km", "Qwen3-4B-Q4_K_M.gguf", 35),
|
||||
llamaCppCmd("Qwen3/qwen3-8b-q4km", "Qwen3-8B-Q4_K_M.gguf", 35),
|
||||
|
||||
vllmEmbeddingCmd("Qwen3/qwen3-embedding-0.6b", "Qwen3-Embedding-0.6B", 5),
|
||||
vllmEmbeddingCmd("Qwen3/qwen3-embedding-4b", "Qwen3-Embedding-4B", 8),
|
||||
llamaCppEmbeddingCmd("Qwen3/qwen3-embedding-4b-q4km", "Qwen3-Embedding-4B-Q4_K_M.gguf", 35),
|
||||
llamaCppEmbeddingCmd("Qwen3/qwen3-embedding-8b-q4km", "Qwen3-Embedding-8B-Q4_K_M.gguf", 35),
|
||||
|
||||
// 0.9.1 vllm还未支持
|
||||
// vllmRerankerCmd("Qwen3/qwen3-reranker-0.6b", "Qwen3-Reranker-0.6B", 5),
|
||||
// vllmRerankerCmd("Qwen3/qwen3-reranker-4b", "Qwen3-Reranker-4B", 8),
|
||||
|
||||
llamaCppVisualCmd("Qwen2.5/qwen2.5-vl-7b", "Qwen2.5-VL-7B-Instruct-BF16.gguf", 35),
|
||||
llamaCppVisualCmd("Qwen2.5/qwen2.5-vl-7b-q4km", "Qwen2.5-VL-7B-Instruct-Q4_K_M.gguf", 35),
|
||||
vllmCmd("Qwen2.5/qwen2.5-vl-3b-instruct", "Qwen2.5-VL-3B-Instruct", 8, false),
|
||||
vllmCmd("Qwen2.5/qwen2.5-vl-7b-instruct", "Qwen2.5-VL-7B-Instruct", 8, false),
|
||||
|
||||
llamaCppVisualCmd("MiniCPM/minicpm-o-2.6-7.6b-q4km", "MiniCPM-o-2_6-7.6B-Q4_K_M.gguf", 35),
|
||||
vllmCmd("MiniCPM/minicpm-o-2.6-7.6b", "MiniCPM-o-2_6", 10, false)
|
||||
)
|
||||
),
|
||||
"config.yaml"
|
||||
);
|
||||
}
|
||||
|
||||
private DockerCmd llamaCppCmd(String name, String model, Integer thread) {
|
||||
return llamaCppCmd(name, model, thread, false, false, false);
|
||||
}
|
||||
|
||||
private DockerCmd llamaCppEmbeddingCmd(String name, String model, Integer thread) {
|
||||
return llamaCppCmd(name, model, thread, true, false, false);
|
||||
}
|
||||
|
||||
private DockerCmd llamaCppRerankerCmd(String name, String model, Integer thread) {
|
||||
return llamaCppCmd(name, model, thread, false, true, false);
|
||||
}
|
||||
|
||||
private DockerCmd llamaCppVisualCmd(String name, String model, Integer thread) {
|
||||
return llamaCppCmd(name, model, thread, false, false, true);
|
||||
}
|
||||
|
||||
private DockerCmd llamaCppCmd(String name, String model, Integer thread, Boolean isEmbedding, Boolean isReranker, Boolean isVisual) {
|
||||
List<String> arguments = ListUtil.list(
|
||||
false,
|
||||
StrUtil.format("-m /models/{}", model),
|
||||
"--port ${PORT}",
|
||||
StrUtil.format("--api-key {}", API_KEY),
|
||||
"-c 0",
|
||||
"-b 4096",
|
||||
StrUtil.format("-t {}", thread),
|
||||
"-np 5",
|
||||
"--log-disable",
|
||||
"--no-webui"
|
||||
);
|
||||
if (isEmbedding) {
|
||||
arguments.add("--embedding");
|
||||
arguments.add("-ub 8192");
|
||||
arguments.add("--pooling mean");
|
||||
} else if (isReranker) {
|
||||
arguments.add("--reranking");
|
||||
} else if (isVisual) {
|
||||
arguments.add(StrUtil.format("--mmproj /models/{}.mmproj", model));
|
||||
} else {
|
||||
arguments.add("--jinja");
|
||||
}
|
||||
return new DockerCmd(
|
||||
"ghcr.io/ggml-org/llama.cpp:server",
|
||||
name,
|
||||
model,
|
||||
StrUtil.format("http://llamacpp-{}:${PORT}", displayName(model)),
|
||||
List.of(StrUtil.format("--name llamacpp-{}", displayName(model))),
|
||||
arguments
|
||||
);
|
||||
}
|
||||
|
||||
private DockerCmd vllmCmd(String name, String model, Integer cache, Boolean isReasonable) {
|
||||
return vllmCmd(name, model, cache, false, false, isReasonable);
|
||||
}
|
||||
|
||||
private DockerCmd vllmEmbeddingCmd(String name, String model, Integer cache) {
|
||||
return vllmCmd(name, model, cache, true, false, false);
|
||||
}
|
||||
|
||||
private DockerCmd vllmRerankerCmd(String name, String model, Integer cache) {
|
||||
return vllmCmd(name, model, cache, false, true, false);
|
||||
}
|
||||
|
||||
private DockerCmd vllmVisualCmd(String name, String model, Integer cache, Boolean isReasonable) {
|
||||
return vllmCmd(name, model, cache, false, false, isReasonable);
|
||||
}
|
||||
|
||||
private DockerCmd vllmCmd(String name, String model, Integer cache, Boolean isEmbedding, Boolean isReranker, Boolean isReasonable) {
|
||||
List<String> arguments = ListUtil.list(
|
||||
false,
|
||||
StrUtil.format("--model /models/{}", model),
|
||||
StrUtil.format("--served-model-name {}", name),
|
||||
"--port ${PORT}",
|
||||
StrUtil.format("--api-key {}", API_KEY),
|
||||
"--disable-log-requests",
|
||||
"--uvicorn-log-level error",
|
||||
"--trust-remote-code"
|
||||
);
|
||||
if (isEmbedding) {
|
||||
arguments.add("--task embedding");
|
||||
} else if (isReranker) {
|
||||
arguments.add("--task score");
|
||||
} else if (isReasonable) {
|
||||
arguments.add("--enable-auto-tool-choice");
|
||||
arguments.add("--tool-call-parser hermes");
|
||||
arguments.add("--enable-reasoning");
|
||||
arguments.add("--reasoning-parser deepseek_r1");
|
||||
}
|
||||
return new DockerCmd(
|
||||
"vllm-server-cpu:0.8.5.post1",
|
||||
name,
|
||||
model,
|
||||
StrUtil.format("http://vllm-{}:${PORT}", displayName(model)),
|
||||
List.of(
|
||||
StrUtil.format("--name vllm-{}", displayName(model)),
|
||||
"--privileged=true",
|
||||
"--shm-size=4g",
|
||||
StrUtil.format("-e VLLM_CPU_KVCACHE_SPACE={}", cache)
|
||||
),
|
||||
arguments
|
||||
);
|
||||
}
|
||||
|
||||
public static class DockerCmd {
|
||||
private String image;
|
||||
private String name;
|
||||
private String model;
|
||||
private String proxy;
|
||||
private List<String> options = ListUtil.list(
|
||||
false,
|
||||
"--rm",
|
||||
"--network llama",
|
||||
"-v /data/models:/models"
|
||||
);
|
||||
private List<String> arguments = ListUtil.list(false);
|
||||
|
||||
public DockerCmd(String image, String name, String model, String proxy, List<String> options, List<String> arguments) {
|
||||
this.image = image;
|
||||
this.name = name;
|
||||
this.model = model;
|
||||
this.proxy = proxy;
|
||||
this.options.addAll(options);
|
||||
this.arguments.addAll(arguments);
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setModel(String model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public String getProxy() {
|
||||
return proxy;
|
||||
}
|
||||
|
||||
public void setProxy(String proxy) {
|
||||
this.proxy = proxy;
|
||||
}
|
||||
|
||||
public List<String> getOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
public void setOptions(List<String> options) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
public List<String> getArguments() {
|
||||
return arguments;
|
||||
}
|
||||
|
||||
public void setArguments(List<String> arguments) {
|
||||
this.arguments = arguments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DockerCmd{" +
|
||||
"image='" + image + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", model='" + model + '\'' +
|
||||
", proxy='" + proxy + '\'' +
|
||||
", options=" + options +
|
||||
", arguments=" + arguments +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
healthCheckTimeout: 600
|
||||
logLevel: warn
|
||||
models:
|
||||
<#list models as model>
|
||||
"${model.name}":
|
||||
proxy: ${model.proxy}
|
||||
ttl: 86400
|
||||
cmd: |
|
||||
docker run
|
||||
<#list model.options as option>
|
||||
${option}
|
||||
</#list>
|
||||
${model.image}
|
||||
<#list model.arguments as arg>
|
||||
${arg}
|
||||
</#list>
|
||||
</#list>
|
||||
groups:
|
||||
"persistent":
|
||||
swap: false
|
||||
exclusive: false
|
||||
members:
|
||||
<#list models as model>
|
||||
- "${model.name}"
|
||||
</#list>
|
||||
@@ -1,54 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.lanyuanxiaoyao</groupId>
|
||||
<artifactId>service-ai</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>service-ai-core</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.lanyuanxiaoyao</groupId>
|
||||
<artifactId>service-forest</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.dtflys.forest</groupId>
|
||||
<artifactId>forest-spring-boot-starter</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-sleuth</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.dtflys.forest</groupId>
|
||||
<artifactId>forest-spring-boot3-starter</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.core.configuration;
|
||||
|
||||
import java.net.http.HttpClient;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.http.client.JdkClientHttpRequestFactory;
|
||||
import org.springframework.http.client.reactive.JdkClientHttpConnector;
|
||||
import org.springframework.web.client.RestClient;
|
||||
import org.springframework.web.reactive.function.client.WebClient;
|
||||
|
||||
/**
|
||||
* vLLM只能使用http1.0
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @version 20250519
|
||||
*/
|
||||
@Configuration
|
||||
public class WebClientConfiguration {
|
||||
@Bean
|
||||
@Primary
|
||||
public RestClient.Builder restClientBuilder() {
|
||||
return generateRestClientBuilder();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public WebClient.Builder webClientBuilder() {
|
||||
return generateWebClientBuilder();
|
||||
}
|
||||
|
||||
private static HttpClient httpClient() {
|
||||
return HttpClient.newBuilder()
|
||||
.version(HttpClient.Version.HTTP_1_1)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static RestClient.Builder generateRestClientBuilder() {
|
||||
return RestClient.builder()
|
||||
.requestFactory(new JdkClientHttpRequestFactory(httpClient()));
|
||||
}
|
||||
|
||||
public static WebClient.Builder generateWebClientBuilder() {
|
||||
return WebClient.builder()
|
||||
.clientConnector(new JdkClientHttpConnector(httpClient()));
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.core.entity.amis;
|
||||
|
||||
/**
|
||||
* Crud 响应
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2023-07-06
|
||||
*/
|
||||
public class AmisCrudResponse extends AmisMapResponse {
|
||||
public void setData(Iterable<?> list) {
|
||||
getData().put("items", list);
|
||||
}
|
||||
|
||||
public void setTotal(Long total) {
|
||||
getData().put("total", total);
|
||||
}
|
||||
|
||||
public void setTotal(Integer total) {
|
||||
setTotal(total.longValue());
|
||||
}
|
||||
|
||||
public void setData(Iterable<?> list, Long total) {
|
||||
setData(list);
|
||||
setTotal(total);
|
||||
}
|
||||
|
||||
public void setData(Iterable<?> list, Integer total) {
|
||||
setData(list, total.longValue());
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.core.entity.amis;
|
||||
|
||||
/**
|
||||
* Crud 响应
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2023-07-06
|
||||
*/
|
||||
public class AmisDetailResponse extends AmisMapResponse {
|
||||
public void setDetail(Object detail) {
|
||||
getData().put("detail", detail);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.core.entity.amis;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Map 响应
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2023-07-06
|
||||
*/
|
||||
public class AmisMapResponse extends AmisResponse<Map<String, Object>> {
|
||||
public AmisMapResponse() {
|
||||
setData(new HashMap<>());
|
||||
}
|
||||
|
||||
public AmisMapResponse setData(String key, Object value) {
|
||||
getData().put(key, value);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.core.entity.amis;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Amis 组件结构化返回值
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2022-09-21
|
||||
*/
|
||||
public class AmisResponse<T> {
|
||||
private static final int SUCCESS_STATUS = 0;
|
||||
private static final int ERROR_STATUS = 500;
|
||||
private static final String SUCCESS_MESSAGE = "OK";
|
||||
private static final String ERROR_MESSAGE = "ERROR";
|
||||
private Integer status;
|
||||
private String message;
|
||||
private T data;
|
||||
|
||||
public static AmisResponse<Object> responseError() {
|
||||
return responseError(ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
public static AmisResponse<Object> responseError(String message) {
|
||||
AmisResponse<Object> response = new AmisResponse<>();
|
||||
response.setStatus(ERROR_STATUS);
|
||||
response.setMessage(message);
|
||||
return response;
|
||||
}
|
||||
|
||||
public static AmisResponse<Object> responseSuccess() {
|
||||
AmisResponse<Object> response = new AmisResponse<>();
|
||||
response.setStatus(SUCCESS_STATUS);
|
||||
response.setMessage(SUCCESS_MESSAGE);
|
||||
return response;
|
||||
}
|
||||
|
||||
public static AmisResponse<Object> responseSuccess(String message) {
|
||||
AmisResponse<Object> response = new AmisResponse<>();
|
||||
response.setStatus(SUCCESS_STATUS);
|
||||
response.setMessage(message);
|
||||
return response;
|
||||
}
|
||||
|
||||
public static <E> AmisResponse<E> responseSuccess(String message, E data) {
|
||||
AmisResponse<E> response = new AmisResponse<>();
|
||||
response.setStatus(SUCCESS_STATUS);
|
||||
response.setMessage(message);
|
||||
response.setData(data);
|
||||
return response;
|
||||
}
|
||||
|
||||
public static <E> AmisResponse<E> responseSuccess(E data) {
|
||||
AmisResponse<E> response = new AmisResponse<>();
|
||||
response.setStatus(SUCCESS_STATUS);
|
||||
response.setMessage(SUCCESS_MESSAGE);
|
||||
response.setData(data);
|
||||
return response;
|
||||
}
|
||||
|
||||
public static AmisMapResponse responseMapData() {
|
||||
AmisMapResponse response = new AmisMapResponse();
|
||||
response.setStatus(SUCCESS_STATUS);
|
||||
response.setMessage(SUCCESS_MESSAGE);
|
||||
return response;
|
||||
}
|
||||
|
||||
public static AmisMapResponse responseMapData(Map<String, Object> data) {
|
||||
AmisMapResponse response = responseMapData();
|
||||
response.setData(data);
|
||||
return response;
|
||||
}
|
||||
|
||||
public static AmisMapResponse responseMapData(String key, Object value) {
|
||||
AmisMapResponse response = responseMapData();
|
||||
response.setData(key, value);
|
||||
return response;
|
||||
}
|
||||
|
||||
public static AmisCrudResponse responseCrudData(Iterable<?> data) {
|
||||
AmisCrudResponse response = new AmisCrudResponse();
|
||||
response.setStatus(SUCCESS_STATUS);
|
||||
response.setMessage(SUCCESS_MESSAGE);
|
||||
response.setData(data);
|
||||
return response;
|
||||
}
|
||||
|
||||
public static AmisCrudResponse responseCrudData(Iterable<?> data, Integer total) {
|
||||
AmisCrudResponse response = responseCrudData(data);
|
||||
response.setTotal(total);
|
||||
return response;
|
||||
}
|
||||
|
||||
public static AmisCrudResponse responseCrudData(Iterable<?> data, Long total) {
|
||||
AmisCrudResponse response = responseCrudData(data);
|
||||
response.setTotal(total);
|
||||
return response;
|
||||
}
|
||||
|
||||
public static AmisDetailResponse responseDetailData(Object detail) {
|
||||
AmisDetailResponse response = new AmisDetailResponse();
|
||||
response.setDetail(detail);
|
||||
return response;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AmisResponse{" +
|
||||
"status=" + status +
|
||||
", message='" + message + '\'' +
|
||||
", data=" + data +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.configuration;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.security.config.Customizer;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @version 20250514
|
||||
*/
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
public class SecurityConfig {
|
||||
@Bean
|
||||
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
return http.authorizeHttpRequests(
|
||||
registry -> registry
|
||||
.requestMatchers(HttpMethod.OPTIONS, "/**")
|
||||
.permitAll()
|
||||
.anyRequest()
|
||||
.authenticated()
|
||||
)
|
||||
.httpBasic(Customizer.withDefaults())
|
||||
.cors(AbstractHttpConfigurer::disable)
|
||||
.csrf(AbstractHttpConfigurer::disable)
|
||||
.formLogin(AbstractHttpConfigurer::disable)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public InMemoryUserDetailsManager userDetailsService(SecurityProperties securityProperties) {
|
||||
UserDetails user = User.builder()
|
||||
.username(securityProperties.getUsername())
|
||||
.password("{noop}" + securityProperties.getDarkcode())
|
||||
.authorities(securityProperties.getAuthority())
|
||||
.build();
|
||||
return new InMemoryUserDetailsManager(user);
|
||||
}
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.lanyuanxiaoyao</groupId>
|
||||
<artifactId>service-ai</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>service-ai-web</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.lanyuanxiaoyao</groupId>
|
||||
<artifactId>service-ai-core</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jetty</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-starter-model-deepseek</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-starter-vector-store-qdrant</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-markdown-document-reader</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.blinkfox</groupId>
|
||||
<artifactId>fenix-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-tika-document-reader</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-pdf-document-reader</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.noear</groupId>
|
||||
<artifactId>solon-ai</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.noear</groupId>
|
||||
<artifactId>solon-ai-dialect-openai</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok-mapstruct-binding</artifactId>
|
||||
<version>0.2.0</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-jpamodelgen</artifactId>
|
||||
<version>6.6.8.Final</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
<compilerArgs>
|
||||
<arg>-Amapstruct.defaultComponentModel=spring</arg>
|
||||
<arg>-Amapstruct.defaultInjectionStrategy=constructor</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web;
|
||||
|
||||
import com.blinkfox.fenix.EnableFenix;
|
||||
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
||||
import org.springframework.retry.annotation.EnableRetry;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @version 20250515
|
||||
*/
|
||||
@SpringBootApplication(scanBasePackages = "com.lanyuanxiaoyao.service")
|
||||
@EnableDiscoveryClient
|
||||
@EnableConfigurationProperties
|
||||
@EnableEncryptableProperties
|
||||
@EnableRetry
|
||||
@EnableScheduling
|
||||
@EnableFenix
|
||||
@EnableJpaAuditing
|
||||
public class WebApplication implements ApplicationRunner, ApplicationContextAware {
|
||||
private static ApplicationContext context;
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(WebApplication.class, args);
|
||||
}
|
||||
|
||||
public static <T> T getBean(Class<T> clazz) {
|
||||
return context.getBean(clazz);
|
||||
}
|
||||
|
||||
public static <T> T getBean(String name, Class<T> clazz) {
|
||||
return context.getBean(name, clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext context) throws BeansException {
|
||||
WebApplication.context = context;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.base.controller;
|
||||
|
||||
import com.lanyuanxiaoyao.service.ai.core.entity.amis.AmisResponse;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-11-28
|
||||
*/
|
||||
public interface DetailController<DETAIL_ITEM> {
|
||||
String DETAIL = "/detail/{id}";
|
||||
|
||||
AmisResponse<DETAIL_ITEM> detail(Long id) throws Exception;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.base.controller;
|
||||
|
||||
import com.lanyuanxiaoyao.service.ai.core.entity.amis.AmisCrudResponse;
|
||||
import com.lanyuanxiaoyao.service.ai.web.base.controller.query.Query;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-11-28
|
||||
*/
|
||||
public interface ListController {
|
||||
String LIST = "/list";
|
||||
|
||||
AmisCrudResponse list() throws Exception;
|
||||
|
||||
AmisCrudResponse list(Query query) throws Exception;
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.base.controller;
|
||||
|
||||
import com.lanyuanxiaoyao.service.ai.core.entity.amis.AmisResponse;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-11-28
|
||||
*/
|
||||
public interface RemoveController {
|
||||
String REMOVE = "/remove/{id}";
|
||||
|
||||
AmisResponse<Object> remove(Long id) throws Exception;
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.base.controller;
|
||||
|
||||
import com.lanyuanxiaoyao.service.ai.core.entity.amis.AmisResponse;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-11-28
|
||||
*/
|
||||
public interface SaveController<SAVE_ITEM> {
|
||||
String SAVE = "/save";
|
||||
|
||||
AmisResponse<Long> save(SAVE_ITEM item) throws Exception;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.base.controller;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-11-28
|
||||
*/
|
||||
public interface SimpleController<SAVE_ITEM, LIST_ITEM, DETAIL_ITEM> extends SaveController<SAVE_ITEM>, ListController, DetailController<DETAIL_ITEM>, RemoveController {
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.base.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.lanyuanxiaoyao.service.ai.core.entity.amis.AmisCrudResponse;
|
||||
import com.lanyuanxiaoyao.service.ai.core.entity.amis.AmisResponse;
|
||||
import com.lanyuanxiaoyao.service.ai.web.base.controller.query.Query;
|
||||
import com.lanyuanxiaoyao.service.ai.web.base.entity.SimpleEntity;
|
||||
import com.lanyuanxiaoyao.service.ai.web.base.service.SimpleServiceSupport;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-11-26
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class SimpleControllerSupport<ENTITY extends SimpleEntity, SAVE_ITEM, LIST_ITEM, DETAIL_ITEM> implements SimpleController<SAVE_ITEM, LIST_ITEM, DETAIL_ITEM> {
|
||||
protected final SimpleServiceSupport<ENTITY> service;
|
||||
|
||||
public SimpleControllerSupport(SimpleServiceSupport<ENTITY> service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
@PostMapping(SAVE)
|
||||
@Override
|
||||
public AmisResponse<Long> save(@RequestBody SAVE_ITEM item) throws Exception {
|
||||
SaveItemMapper<ENTITY, SAVE_ITEM> mapper = saveItemMapper();
|
||||
return AmisResponse.responseSuccess(service.save(mapper.from(item)));
|
||||
}
|
||||
|
||||
@GetMapping(LIST)
|
||||
@Override
|
||||
public AmisCrudResponse list() throws Exception {
|
||||
ListItemMapper<ENTITY, LIST_ITEM> mapper = listItemMapper();
|
||||
return AmisCrudResponse.responseCrudData(
|
||||
service.list()
|
||||
.collect(entity -> {
|
||||
try {
|
||||
return mapper.from(entity);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@PostMapping(LIST)
|
||||
@Override
|
||||
public AmisCrudResponse list(@RequestBody Query query) throws Exception {
|
||||
if (ObjectUtil.isNull(query)) {
|
||||
return AmisCrudResponse.responseCrudData(List.of(), 0);
|
||||
}
|
||||
ListItemMapper<ENTITY, LIST_ITEM> mapper = listItemMapper();
|
||||
Page<ENTITY> result = service.list(query);
|
||||
return AmisCrudResponse.responseCrudData(
|
||||
result.get()
|
||||
.map(entity -> {
|
||||
try {
|
||||
return mapper.from(entity);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
})
|
||||
.toList(),
|
||||
result.getTotalElements()
|
||||
);
|
||||
}
|
||||
|
||||
@GetMapping(DETAIL)
|
||||
@Override
|
||||
public AmisResponse<DETAIL_ITEM> detail(@PathVariable("id") Long id) throws Exception {
|
||||
DetailItemMapper<ENTITY, DETAIL_ITEM> mapper = detailItemMapper();
|
||||
return AmisResponse.responseSuccess(mapper.from(service.detailOrThrow(id)));
|
||||
}
|
||||
|
||||
@GetMapping(REMOVE)
|
||||
@Override
|
||||
public AmisResponse<Object> remove(@PathVariable("id") Long id) throws Exception {
|
||||
service.remove(id);
|
||||
return AmisResponse.responseSuccess();
|
||||
}
|
||||
|
||||
protected abstract SaveItemMapper<ENTITY, SAVE_ITEM> saveItemMapper();
|
||||
|
||||
protected abstract ListItemMapper<ENTITY, LIST_ITEM> listItemMapper();
|
||||
|
||||
protected abstract DetailItemMapper<ENTITY, DETAIL_ITEM> detailItemMapper();
|
||||
|
||||
public interface SaveItemMapper<ENTITY, SAVE_ITEM> {
|
||||
ENTITY from(SAVE_ITEM item) throws Exception;
|
||||
}
|
||||
|
||||
public interface ListItemMapper<ENTITY, LIST_ITEM> {
|
||||
LIST_ITEM from(ENTITY entity) throws Exception;
|
||||
}
|
||||
|
||||
public interface DetailItemMapper<ENTITY, DETAIL_ITEM> {
|
||||
DETAIL_ITEM from(ENTITY entity) throws Exception;
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.base.controller.query;
|
||||
|
||||
import lombok.Data;
|
||||
import org.eclipse.collections.api.list.ImmutableList;
|
||||
import org.eclipse.collections.api.map.ImmutableMap;
|
||||
|
||||
/**
|
||||
* 统一查询
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-12-03
|
||||
*/
|
||||
@Data
|
||||
public class Query {
|
||||
private Queryable query;
|
||||
private ImmutableList<Sortable> sort;
|
||||
private Pageable page;
|
||||
|
||||
@Data
|
||||
public static class Queryable {
|
||||
private ImmutableList<String> nullEqual;
|
||||
private ImmutableList<String> notNullEqual;
|
||||
private ImmutableList<String> empty;
|
||||
private ImmutableList<String> notEmpty;
|
||||
private ImmutableMap<String, ?> equal;
|
||||
private ImmutableMap<String, ?> notEqual;
|
||||
private ImmutableMap<String, String> like;
|
||||
private ImmutableMap<String, String> notLike;
|
||||
private ImmutableMap<String, ?> great;
|
||||
private ImmutableMap<String, ?> less;
|
||||
private ImmutableMap<String, ?> greatEqual;
|
||||
private ImmutableMap<String, ?> lessEqual;
|
||||
private ImmutableMap<String, ImmutableList<?>> in;
|
||||
private ImmutableMap<String, ImmutableList<?>> notIn;
|
||||
private ImmutableMap<String, Between> between;
|
||||
private ImmutableMap<String, Between> notBetween;
|
||||
|
||||
@Data
|
||||
public static class Between {
|
||||
private String start;
|
||||
private String end;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Sortable {
|
||||
private String column;
|
||||
private Direction direction;
|
||||
|
||||
public enum Direction {
|
||||
ASC,
|
||||
DESC,
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Pageable {
|
||||
private Integer index;
|
||||
private Integer size;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.base.entity;
|
||||
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.MappedSuperclass;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
/**
|
||||
* 实体类公共字段
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-11-20
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@MappedSuperclass
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
public class IdOnlyEntity {
|
||||
@Id
|
||||
@GeneratedValue(generator = "snowflake")
|
||||
@GenericGenerator(name = "snowflake", strategy = "com.lanyuanxiaoyao.service.ai.web.configuration.SnowflakeIdGenerator")
|
||||
private Long id;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.base.entity;
|
||||
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.MappedSuperclass;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
/**
|
||||
* 实体类公共字段
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-11-20
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString(callSuper = true)
|
||||
@MappedSuperclass
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
public class SimpleEntity extends IdOnlyEntity {
|
||||
@CreatedDate
|
||||
private LocalDateTime createdTime;
|
||||
@LastModifiedDate
|
||||
private LocalDateTime modifiedTime;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.base.entity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 创建对象使用的接收类
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-11-26
|
||||
*/
|
||||
@Data
|
||||
public class SimpleItem {
|
||||
private Long id;
|
||||
private LocalDateTime createdTime;
|
||||
private LocalDateTime modifiedTime;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.base.repository;
|
||||
|
||||
import com.blinkfox.fenix.jpa.FenixJpaRepository;
|
||||
import com.blinkfox.fenix.specification.FenixJpaSpecificationExecutor;
|
||||
import org.springframework.data.repository.NoRepositoryBean;
|
||||
import org.springframework.data.repository.query.QueryByExampleExecutor;
|
||||
|
||||
/**
|
||||
* 整合一下
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
@NoRepositoryBean
|
||||
public interface SimpleRepository<E, ID> extends FenixJpaRepository<E, ID>, FenixJpaSpecificationExecutor<E>, QueryByExampleExecutor<E> {
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.base.service;
|
||||
|
||||
import com.lanyuanxiaoyao.service.ai.web.base.controller.query.Query;
|
||||
import com.lanyuanxiaoyao.service.ai.web.base.entity.SimpleEntity;
|
||||
import java.util.Optional;
|
||||
import org.eclipse.collections.api.list.ImmutableList;
|
||||
import org.eclipse.collections.api.set.ImmutableSet;
|
||||
import org.springframework.data.domain.Page;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-11-28
|
||||
*/
|
||||
public interface SimpleService<ENTITY extends SimpleEntity> {
|
||||
Long save(ENTITY entity) throws Exception;
|
||||
|
||||
Long count() throws Exception;
|
||||
|
||||
ImmutableList<ENTITY> list() throws Exception;
|
||||
|
||||
ImmutableList<ENTITY> list(ImmutableSet<Long> ids) throws Exception;
|
||||
|
||||
Page<ENTITY> list(Query query) throws Exception;
|
||||
|
||||
Optional<ENTITY> detailOptional(Long id) throws Exception;
|
||||
|
||||
ENTITY detail(Long id) throws Exception;
|
||||
|
||||
ENTITY detailOrThrow(Long id) throws Exception;
|
||||
|
||||
ENTITY detailOrNull(Long id) throws Exception;
|
||||
|
||||
void remove(Long id) throws Exception;
|
||||
}
|
||||
@@ -1,251 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.base.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import cn.hutool.core.util.EnumUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.lanyuanxiaoyao.service.ai.web.base.controller.query.Query;
|
||||
import com.lanyuanxiaoyao.service.ai.web.base.entity.IdOnlyEntity_;
|
||||
import com.lanyuanxiaoyao.service.ai.web.base.entity.SimpleEntity;
|
||||
import com.lanyuanxiaoyao.service.ai.web.base.entity.SimpleEntity_;
|
||||
import com.lanyuanxiaoyao.service.ai.web.base.repository.SimpleRepository;
|
||||
import jakarta.persistence.criteria.CriteriaBuilder;
|
||||
import jakarta.persistence.criteria.CriteriaQuery;
|
||||
import jakarta.persistence.criteria.Path;
|
||||
import jakarta.persistence.criteria.Predicate;
|
||||
import jakarta.persistence.criteria.Root;
|
||||
import jakarta.transaction.Transactional;
|
||||
import java.util.Optional;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.collections.api.factory.Lists;
|
||||
import org.eclipse.collections.api.list.ImmutableList;
|
||||
import org.eclipse.collections.api.list.MutableList;
|
||||
import org.eclipse.collections.api.set.ImmutableSet;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class SimpleServiceSupport<ENTITY extends SimpleEntity> implements SimpleService<ENTITY> {
|
||||
private static final Integer DEFAULT_PAGE_INDEX = 1;
|
||||
private static final Integer DEFAULT_PAGE_SIZE = 10;
|
||||
protected final SimpleRepository<ENTITY, Long> repository;
|
||||
|
||||
public SimpleServiceSupport(SimpleRepository<ENTITY, Long> repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
@Transactional(rollbackOn = Throwable.class)
|
||||
@Override
|
||||
public Long save(ENTITY entity) {
|
||||
if (ObjectUtil.isNotNull(entity.getId())) {
|
||||
Long id = entity.getId();
|
||||
ENTITY targetEntity = repository.findById(entity.getId()).orElseThrow(() -> new IdNotFoundException(id));
|
||||
BeanUtil.copyProperties(
|
||||
entity,
|
||||
targetEntity,
|
||||
CopyOptions.create()
|
||||
.setIgnoreProperties(
|
||||
IdOnlyEntity_.ID,
|
||||
SimpleEntity_.CREATED_TIME,
|
||||
SimpleEntity_.MODIFIED_TIME
|
||||
)
|
||||
);
|
||||
entity = targetEntity;
|
||||
}
|
||||
entity = repository.save(entity);
|
||||
return entity.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long count() {
|
||||
return repository.count(
|
||||
(root, query, builder) ->
|
||||
builder.and(
|
||||
listPredicate(root, query, builder)
|
||||
.reject(ObjectUtil::isNull)
|
||||
.toArray(new Predicate[]{})
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableList<ENTITY> list() {
|
||||
return Lists.immutable.ofAll(repository.findAll(
|
||||
(root, query, builder) ->
|
||||
builder.and(
|
||||
listPredicate(root, query, builder)
|
||||
.reject(ObjectUtil::isNull)
|
||||
.toArray(new Predicate[]{})
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableList<ENTITY> list(ImmutableSet<Long> ids) {
|
||||
return Lists.immutable.ofAll(repository.findAll(
|
||||
(root, query, builder) -> {
|
||||
MutableList<Predicate> predicates = Lists.mutable.ofAll(listPredicate(root, query, builder));
|
||||
predicates.add(builder.in(root.get("id")).value(ids));
|
||||
return builder.and(predicates.reject(ObjectUtil::isNull).toArray(new Predicate[predicates.size()]));
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
private <Y> Path<Y> column(Root<ENTITY> root, String column) {
|
||||
String[] columns = StrUtil.splitToArray(column, "/");
|
||||
Path<Y> path = root.get(columns[0]);
|
||||
for (int i = 1; i < columns.length; i++) {
|
||||
path = path.get(columns[i]);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
private <Y> Object value(Path<Y> column, Object value) {
|
||||
Class<?> javaType = column.getJavaType();
|
||||
if (EnumUtil.isEnum(javaType)) {
|
||||
return EnumUtil.fromString((Class<Enum>) javaType, (String) value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected ImmutableList<Predicate> queryPredicates(Query.Queryable queryable, Root<ENTITY> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
|
||||
MutableList<Predicate> predicates = Lists.mutable.empty();
|
||||
if (ObjectUtil.isEmpty(queryable)) {
|
||||
return predicates.toImmutable();
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getNullEqual())) {
|
||||
queryable.getNullEqual().forEach(column -> predicates.add(builder.isNull(column(root, column))));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getNotNullEqual())) {
|
||||
queryable.getNotNullEqual().forEach(column -> predicates.add(builder.isNull(column(root, column))));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getEmpty())) {
|
||||
queryable.getEmpty().forEach(column -> predicates.add(builder.isEmpty(column(root, column))));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getNotEmpty())) {
|
||||
queryable.getNotEmpty().forEach(column -> predicates.add(builder.isNotEmpty(column(root, column))));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getEqual())) {
|
||||
queryable.getEqual().forEachKeyValue((column, value) -> {
|
||||
Path<Object> path = column(root, column);
|
||||
predicates.add(builder.equal(path, value(path, value)));
|
||||
});
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getNotEqual())) {
|
||||
queryable.getEqual().forEachKeyValue((column, value) -> {
|
||||
Path<Object> path = column(root, column);
|
||||
predicates.add(builder.notEqual(path, value(path, value)));
|
||||
});
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getLike())) {
|
||||
queryable.getLike().forEachKeyValue((column, value) -> predicates.add(builder.like(column(root, column), value)));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getNotLike())) {
|
||||
queryable.getNotLike().forEachKeyValue((column, value) -> predicates.add(builder.notLike(column(root, column), value)));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getGreat())) {
|
||||
queryable.getGreat().forEachKeyValue((column, value) -> predicates.add(builder.greaterThan(column(root, column), (Comparable<Object>) value)));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getLess())) {
|
||||
queryable.getLess().forEachKeyValue((column, value) -> predicates.add(builder.lessThan(column(root, column), (Comparable<Object>) value)));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getGreatEqual())) {
|
||||
queryable.getGreatEqual().forEachKeyValue((column, value) -> predicates.add(builder.greaterThanOrEqualTo(column(root, column), (Comparable<Object>) value)));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getLessEqual())) {
|
||||
queryable.getLessEqual().forEachKeyValue((column, value) -> predicates.add(builder.lessThanOrEqualTo(column(root, column), (Comparable<Object>) value)));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getIn())) {
|
||||
queryable.getIn().forEachKeyValue((column, value) -> predicates.add(builder.in(column(root, column)).value(value)));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getNotIn())) {
|
||||
queryable.getNotIn().forEachKeyValue((column, value) -> predicates.add(builder.in(column(root, column)).value(value).not()));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getBetween())) {
|
||||
queryable.getBetween().forEachKeyValue((column, value) -> predicates.add(builder.between(column(root, column), value.getStart(), value.getEnd())));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(queryable.getNotBetween())) {
|
||||
queryable.getNotBetween().forEachKeyValue((column, value) -> predicates.add(builder.between(column(root, column), value.getStart(), value.getEnd())));
|
||||
}
|
||||
return predicates.toImmutable();
|
||||
}
|
||||
|
||||
protected ImmutableList<Predicate> listPredicate(Root<ENTITY> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
|
||||
return Lists.immutable.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<ENTITY> list(Query listQuery) {
|
||||
PageRequest pageRequest = PageRequest.of(DEFAULT_PAGE_INDEX - 1, DEFAULT_PAGE_SIZE, Sort.by(SimpleEntity_.CREATED_TIME).descending());
|
||||
if (ObjectUtil.isNotNull(listQuery.getPage())) {
|
||||
pageRequest = PageRequest.of(
|
||||
ObjectUtil.defaultIfNull(listQuery.getPage().getIndex(), DEFAULT_PAGE_INDEX) - 1,
|
||||
ObjectUtil.defaultIfNull(listQuery.getPage().getSize(), DEFAULT_PAGE_SIZE),
|
||||
Sort.by(SimpleEntity_.CREATED_TIME).descending()
|
||||
);
|
||||
}
|
||||
return repository.findAll(
|
||||
(root, query, builder) -> {
|
||||
MutableList<Predicate> predicates = Lists.mutable.ofAll(listPredicate(root, query, builder));
|
||||
predicates.addAllIterable(queryPredicates(listQuery.getQuery(), root, query, builder));
|
||||
return builder.and(predicates.reject(ObjectUtil::isNull).toArray(new Predicate[predicates.size()]));
|
||||
},
|
||||
pageRequest
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<ENTITY> detailOptional(Long id) {
|
||||
if (ObjectUtil.isNull(id)) {
|
||||
return Optional.empty();
|
||||
}
|
||||
return repository.findOne(
|
||||
(root, query, builder) -> {
|
||||
MutableList<Predicate> predicates = Lists.mutable.ofAll(listPredicate(root, query, builder));
|
||||
predicates.add(builder.equal(root.get(IdOnlyEntity_.id), id));
|
||||
return builder.and(predicates.reject(ObjectUtil::isNull).toArray(new Predicate[predicates.size()]));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ENTITY detail(Long id) {
|
||||
return detailOrNull(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ENTITY detailOrThrow(Long id) {
|
||||
return detailOptional(id).orElseThrow(() -> new IdNotFoundException(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ENTITY detailOrNull(Long id) {
|
||||
return detailOptional(id).orElse(null);
|
||||
}
|
||||
|
||||
@Transactional(rollbackOn = Throwable.class)
|
||||
@Override
|
||||
public void remove(Long id) {
|
||||
if (ObjectUtil.isNotNull(id)) {
|
||||
repository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
public static final class IdNotFoundException extends RuntimeException {
|
||||
public IdNotFoundException() {
|
||||
super("资源不存在");
|
||||
}
|
||||
|
||||
public IdNotFoundException(Long id) {
|
||||
super(StrUtil.format("ID为{}的资源不存在", id));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.lanyuanxiaoyao.service.ai.web.configuration;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
* @version 20250527
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "file-store")
|
||||
public class FileStoreProperties {
|
||||
private String downloadPrefix;
|
||||
private String uploadPath;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user