Compare commits
13 Commits
80a24513ab
...
74b0638a07
| Author | SHA1 | Date | |
|---|---|---|---|
| 74b0638a07 | |||
| 91e30fefe4 | |||
| d80659ca41 | |||
| 997fc4043f | |||
| 0892cda203 | |||
| 981f84ea2b | |||
| 49caded436 | |||
| 43e9306017 | |||
| 39e4e03437 | |||
| 7319335b67 | |||
| 3cf56adeac | |||
| 083a8771d2 | |||
| cedb108049 |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,6 +1,3 @@
|
|||||||
### Custom
|
|
||||||
*.db
|
|
||||||
|
|
||||||
### Maven template
|
### Maven template
|
||||||
target/
|
target/
|
||||||
pom.xml.tag
|
pom.xml.tag
|
||||||
@@ -255,3 +252,7 @@ Network Trash Folder
|
|||||||
Temporary Items
|
Temporary Items
|
||||||
.apdisk
|
.apdisk
|
||||||
|
|
||||||
|
### Custom
|
||||||
|
*.db
|
||||||
|
gringotts-web/src/main/resources/static
|
||||||
|
!gringotts-web/bin
|
||||||
4
.idea/dataSources.xml
generated
4
.idea/dataSources.xml
generated
@@ -13,11 +13,11 @@
|
|||||||
</jdbc-additional-properties>
|
</jdbc-additional-properties>
|
||||||
<working-dir>$ProjectFileDir$</working-dir>
|
<working-dir>$ProjectFileDir$</working-dir>
|
||||||
</data-source>
|
</data-source>
|
||||||
<data-source source="LOCAL" name="homeless" uuid="9af017b2-2a8b-45b4-899c-ef4fb185b77c">
|
<data-source source="LOCAL" name="gringotts@132.122.1.185" uuid="91feafc5-32a2-4c28-93a7-b39754851328">
|
||||||
<driver-ref>mysql.8</driver-ref>
|
<driver-ref>mysql.8</driver-ref>
|
||||||
<synchronize>true</synchronize>
|
<synchronize>true</synchronize>
|
||||||
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
||||||
<jdbc-url>jdbc:mysql://frp-air.top:43458</jdbc-url>
|
<jdbc-url>jdbc:mysql://132.122.1.185:31000/gringotts</jdbc-url>
|
||||||
<jdbc-additional-properties>
|
<jdbc-additional-properties>
|
||||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
export const information = {
|
export const information = {
|
||||||
debug: false,
|
debug: true,
|
||||||
// baseUrl: '',
|
|
||||||
baseUrl: 'http://127.0.0.1:20080',
|
baseUrl: 'http://127.0.0.1:20080',
|
||||||
title: '可信供给中心',
|
title: '可信供给中心',
|
||||||
}
|
}
|
||||||
@@ -17,8 +16,8 @@ export function useAmis(amisObject) {
|
|||||||
struct,
|
struct,
|
||||||
{
|
{
|
||||||
data: {
|
data: {
|
||||||
debug: information.debug,
|
debug: information.debug ?? false,
|
||||||
base: information.baseUrl,
|
base: information.baseUrl ?? '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,167 @@
|
|||||||
|
import './dialog-permission.css'
|
||||||
|
import {
|
||||||
|
apiGet,
|
||||||
|
apiPost,
|
||||||
|
formCreatedUserAndModifiedUser,
|
||||||
|
formInputClearable,
|
||||||
|
formInputMultiFileStatic,
|
||||||
|
horizontalFormOptions,
|
||||||
|
information,
|
||||||
|
inputFileFormItemCommonOptions,
|
||||||
|
size100MB
|
||||||
|
} from "../constants.js";
|
||||||
|
import {resourceList} from "../../pages/index/tab-data.js";
|
||||||
|
import {resourceDetailDialog} from "../resource/dialog-resource.js";
|
||||||
|
|
||||||
|
function detailForm(showCreatedUserAndModifiedUser = false) {
|
||||||
|
return {
|
||||||
|
debug: information.debug,
|
||||||
|
id: 'permission_form',
|
||||||
|
type: 'form',
|
||||||
|
...horizontalFormOptions(),
|
||||||
|
horizontal: {
|
||||||
|
left: 2,
|
||||||
|
},
|
||||||
|
body: [
|
||||||
|
{
|
||||||
|
type: 'hidden',
|
||||||
|
name: 'id',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'picker',
|
||||||
|
name: 'targetId',
|
||||||
|
label: '数据资源',
|
||||||
|
required: true,
|
||||||
|
multiple: false,
|
||||||
|
size: 'md',
|
||||||
|
valueField: 'id',
|
||||||
|
labelField: 'name',
|
||||||
|
source: apiGet('${base}/data_resource/list_no_authentication'),
|
||||||
|
pickerSchema: {
|
||||||
|
...resourceList(),
|
||||||
|
},
|
||||||
|
staticSchema: {
|
||||||
|
type: 'tpl',
|
||||||
|
tpl: "<span class='text-primary' style='cursor: pointer'>${targetName}</span>",
|
||||||
|
onEvent: {
|
||||||
|
click: {
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
actionType: 'dialog',
|
||||||
|
...resourceDetailDialog('targetId'),
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'textarea',
|
||||||
|
placeholder: '请输入确权说明',
|
||||||
|
label: '确权说明',
|
||||||
|
name: 'description',
|
||||||
|
...formInputClearable,
|
||||||
|
},
|
||||||
|
formInputMultiFileStatic('evidenceFiles', '相关材料'),
|
||||||
|
{
|
||||||
|
visibleOn: '${!detail}',
|
||||||
|
type: 'input-file',
|
||||||
|
label: '相关材料',
|
||||||
|
name: 'evidenceFiles',
|
||||||
|
multiple: true,
|
||||||
|
required: true,
|
||||||
|
joinValues: false,
|
||||||
|
...inputFileFormItemCommonOptions(undefined, size100MB),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input-datetime-range',
|
||||||
|
name: 'activeTime',
|
||||||
|
extraName: 'expiredTime',
|
||||||
|
label: '授权时间',
|
||||||
|
required: true,
|
||||||
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
shortcuts: [
|
||||||
|
'7dayslater',
|
||||||
|
'14dayslater',
|
||||||
|
'30dayslater',
|
||||||
|
'180dayslater',
|
||||||
|
'365dayslater',
|
||||||
|
]
|
||||||
|
},
|
||||||
|
...(showCreatedUserAndModifiedUser ? formCreatedUserAndModifiedUser() : [])
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function authenticationAddDialog() {
|
||||||
|
let data = {add: true, authentication: true}
|
||||||
|
return {
|
||||||
|
actionType: 'dialog',
|
||||||
|
dialog: {
|
||||||
|
title: '新增授权申请',
|
||||||
|
size: 'md',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
type: 'reset',
|
||||||
|
label: '重置',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'submit',
|
||||||
|
label: '确定',
|
||||||
|
level: 'primary',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
body: {
|
||||||
|
...detailForm(),
|
||||||
|
api: apiPost(`\${base}/authentication/save`),
|
||||||
|
data: data,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function authenticationDetailDialog(field = 'id', actions = []) {
|
||||||
|
let data = {detail: true, authentication: true}
|
||||||
|
return {
|
||||||
|
actionType: 'dialog',
|
||||||
|
dialog: {
|
||||||
|
title: '授权申请详情',
|
||||||
|
size: 'md',
|
||||||
|
actions: actions,
|
||||||
|
body: {
|
||||||
|
...detailForm(true),
|
||||||
|
initApi: apiGet(`\${base}/authentication/detail/\${${field}}`),
|
||||||
|
static: true,
|
||||||
|
data: data,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function authenticationEditeDialog(field = 'id') {
|
||||||
|
let data = {edit: true, authentication: true}
|
||||||
|
return {
|
||||||
|
actionType: 'dialog',
|
||||||
|
dialog: {
|
||||||
|
title: '授权申请详情',
|
||||||
|
size: 'md',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
type: 'reset',
|
||||||
|
label: '重置',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'submit',
|
||||||
|
label: '确定',
|
||||||
|
level: 'primary',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
body: {
|
||||||
|
...detailForm(),
|
||||||
|
api: apiPost(`\${base}/authentication/save`),
|
||||||
|
initApi: apiGet(`\${base}/authentication/detail/\${${field}}`),
|
||||||
|
data: data,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
152
gringotts-frontend/components/permission/dialog-confirmation.js
Normal file
152
gringotts-frontend/components/permission/dialog-confirmation.js
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
import './dialog-permission.css'
|
||||||
|
import {
|
||||||
|
apiGet,
|
||||||
|
apiPost,
|
||||||
|
formCreatedUserAndModifiedUser,
|
||||||
|
formInputClearable,
|
||||||
|
formInputMultiFileStatic,
|
||||||
|
horizontalFormOptions,
|
||||||
|
information,
|
||||||
|
inputFileFormItemCommonOptions,
|
||||||
|
size100MB
|
||||||
|
} from "../constants.js";
|
||||||
|
import {resourceList} from "../../pages/index/tab-data.js";
|
||||||
|
import {resourceDetailDialog} from "../resource/dialog-resource.js";
|
||||||
|
|
||||||
|
function detailForm(showCreatedUserAndModifiedUser = false) {
|
||||||
|
return {
|
||||||
|
debug: information.debug,
|
||||||
|
id: 'permission_form',
|
||||||
|
type: 'form',
|
||||||
|
...horizontalFormOptions(),
|
||||||
|
horizontal: {
|
||||||
|
left: 2,
|
||||||
|
},
|
||||||
|
body: [
|
||||||
|
{
|
||||||
|
type: 'hidden',
|
||||||
|
name: 'id',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'picker',
|
||||||
|
name: 'targetId',
|
||||||
|
label: '数据资源',
|
||||||
|
required: true,
|
||||||
|
multiple: false,
|
||||||
|
size: 'md',
|
||||||
|
valueField: 'id',
|
||||||
|
labelField: 'name',
|
||||||
|
source: apiGet('${base}/data_resource/list_no_confirmation'),
|
||||||
|
pickerSchema: {
|
||||||
|
...resourceList(true),
|
||||||
|
},
|
||||||
|
staticSchema: {
|
||||||
|
type: 'tpl',
|
||||||
|
tpl: "<span class='text-primary' style='cursor: pointer'>${targetName}</span>",
|
||||||
|
onEvent: {
|
||||||
|
click: {
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
actionType: 'dialog',
|
||||||
|
...resourceDetailDialog('targetId'),
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'textarea',
|
||||||
|
placeholder: '请输入确权说明',
|
||||||
|
label: '确权说明',
|
||||||
|
name: 'description',
|
||||||
|
...formInputClearable,
|
||||||
|
},
|
||||||
|
formInputMultiFileStatic('evidenceFiles', '相关材料'),
|
||||||
|
{
|
||||||
|
visibleOn: '${!detail}',
|
||||||
|
type: 'input-file',
|
||||||
|
label: '相关材料',
|
||||||
|
name: 'evidenceFiles',
|
||||||
|
multiple: true,
|
||||||
|
required: true,
|
||||||
|
joinValues: false,
|
||||||
|
...inputFileFormItemCommonOptions(undefined, size100MB),
|
||||||
|
},
|
||||||
|
...(showCreatedUserAndModifiedUser ? formCreatedUserAndModifiedUser() : [])
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function confirmationAddDialog() {
|
||||||
|
let data = {add: true, confirmation: true}
|
||||||
|
return {
|
||||||
|
actionType: 'dialog',
|
||||||
|
dialog: {
|
||||||
|
title: '新增确权申请',
|
||||||
|
size: 'md',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
type: 'reset',
|
||||||
|
label: '重置',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'submit',
|
||||||
|
label: '确定',
|
||||||
|
level: 'primary',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
body: {
|
||||||
|
...detailForm(),
|
||||||
|
api: apiPost(`\${base}/confirmation/save`),
|
||||||
|
data: data,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function confirmationDetailDialog(field = 'id', actions = []) {
|
||||||
|
let data = {detail: true, confirmation: true}
|
||||||
|
return {
|
||||||
|
actionType: 'dialog',
|
||||||
|
dialog: {
|
||||||
|
title: '确权申请详情',
|
||||||
|
size: 'md',
|
||||||
|
actions: actions,
|
||||||
|
body: {
|
||||||
|
...detailForm(true),
|
||||||
|
initApi: apiGet(`\${base}/confirmation/detail/\${${field}}`),
|
||||||
|
static: true,
|
||||||
|
data: data,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function confirmationEditeDialog(field = 'id') {
|
||||||
|
let data = {edit: true, confirmation: true}
|
||||||
|
return {
|
||||||
|
actionType: 'dialog',
|
||||||
|
dialog: {
|
||||||
|
title: '确权申请详情',
|
||||||
|
size: 'md',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
type: 'reset',
|
||||||
|
label: '重置',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'submit',
|
||||||
|
label: '确定',
|
||||||
|
level: 'primary',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
body: {
|
||||||
|
...detailForm(),
|
||||||
|
api: apiPost(`\${base}/confirmation/save`),
|
||||||
|
initApi: apiGet(`\${base}/confirmation/detail/\${${field}}`),
|
||||||
|
data: data,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,208 +1,2 @@
|
|||||||
import './dialog-permission.css'
|
export * from './dialog-confirmation'
|
||||||
import {
|
export * from './dialog-authentication'
|
||||||
apiGet,
|
|
||||||
apiPost,
|
|
||||||
formCreatedUserAndModifiedUser,
|
|
||||||
formInputClearable,
|
|
||||||
formInputMultiFileStatic,
|
|
||||||
horizontalFormOptions,
|
|
||||||
information,
|
|
||||||
inputFileFormItemCommonOptions,
|
|
||||||
size100MB
|
|
||||||
} from "../constants.js";
|
|
||||||
import {resourceList} from "../../pages/index/tab-data.js";
|
|
||||||
import {resourceDetailDialog} from "../resource/dialog-resource.js";
|
|
||||||
|
|
||||||
const CONFIRMATION_TYPE = 'confirmation'
|
|
||||||
const AUTHENTICATION_TYPE = 'authentication'
|
|
||||||
|
|
||||||
const CONFIRMATION = {
|
|
||||||
type: 'confirmation',
|
|
||||||
pickerApi: apiGet('${base}/data_resource/list_no_confirmation')
|
|
||||||
}
|
|
||||||
|
|
||||||
const AUTHENTICATION = {
|
|
||||||
type: 'authentication',
|
|
||||||
pickerApi: apiGet('${base}/data_resource/list_no_authentication')
|
|
||||||
}
|
|
||||||
|
|
||||||
function detailForm(pickerApi = apiGet('${base}/data_resource/list'), showCreatedUserAndModifiedUser = false) {
|
|
||||||
return {
|
|
||||||
debug: information.debug,
|
|
||||||
id: 'permission_form',
|
|
||||||
type: 'form',
|
|
||||||
...horizontalFormOptions(),
|
|
||||||
horizontal: {
|
|
||||||
left: 2,
|
|
||||||
},
|
|
||||||
body: [
|
|
||||||
{
|
|
||||||
type: 'hidden',
|
|
||||||
name: 'id',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'picker',
|
|
||||||
name: 'targetId',
|
|
||||||
label: '数据资源',
|
|
||||||
required: true,
|
|
||||||
multiple: false,
|
|
||||||
size: 'md',
|
|
||||||
valueField: 'id',
|
|
||||||
labelField: 'name',
|
|
||||||
source: pickerApi,
|
|
||||||
pickerSchema: {
|
|
||||||
...resourceList(),
|
|
||||||
},
|
|
||||||
staticSchema: {
|
|
||||||
type: 'tpl',
|
|
||||||
tpl: "<span class='text-primary' style='cursor: pointer'>${targetName}</span>",
|
|
||||||
onEvent: {
|
|
||||||
click: {
|
|
||||||
actions: [
|
|
||||||
{
|
|
||||||
actionType: 'dialog',
|
|
||||||
...resourceDetailDialog('targetId'),
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'textarea',
|
|
||||||
placeholder: '请输入确权说明',
|
|
||||||
label: '确权说明',
|
|
||||||
name: 'description',
|
|
||||||
...formInputClearable,
|
|
||||||
},
|
|
||||||
formInputMultiFileStatic('evidenceFiles', '相关材料'),
|
|
||||||
{
|
|
||||||
visibleOn: '${!detail}',
|
|
||||||
type: 'input-file',
|
|
||||||
label: '相关材料',
|
|
||||||
name: 'evidenceFiles',
|
|
||||||
multiple: true,
|
|
||||||
required: true,
|
|
||||||
joinValues: false,
|
|
||||||
...inputFileFormItemCommonOptions(undefined, size100MB),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
visibleOn: `\${${AUTHENTICATION_TYPE}}`,
|
|
||||||
type: 'input-datetime-range',
|
|
||||||
name: 'activeTime',
|
|
||||||
extraName: 'expiredTime',
|
|
||||||
label: '授权时间',
|
|
||||||
required: true,
|
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
shortcuts: [
|
|
||||||
'7dayslater',
|
|
||||||
'14dayslater',
|
|
||||||
'30dayslater',
|
|
||||||
'180dayslater',
|
|
||||||
'365dayslater',
|
|
||||||
]
|
|
||||||
},
|
|
||||||
...(showCreatedUserAndModifiedUser ? formCreatedUserAndModifiedUser() : [])
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function confirmationAddDialog() {
|
|
||||||
return permissionAddDialog(CONFIRMATION)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function authenticationAddDialog() {
|
|
||||||
return permissionAddDialog(AUTHENTICATION)
|
|
||||||
}
|
|
||||||
|
|
||||||
function permissionAddDialog(config) {
|
|
||||||
let data = {add: true}
|
|
||||||
data[config.type] = true
|
|
||||||
return {
|
|
||||||
actionType: 'dialog',
|
|
||||||
dialog: {
|
|
||||||
title: '新增确权申请',
|
|
||||||
size: 'md',
|
|
||||||
actions: [
|
|
||||||
{
|
|
||||||
type: 'reset',
|
|
||||||
label: '重置',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'submit',
|
|
||||||
label: '确定',
|
|
||||||
level: 'primary',
|
|
||||||
}
|
|
||||||
],
|
|
||||||
body: {
|
|
||||||
...detailForm(config.pickerApi),
|
|
||||||
api: apiPost(`\${base}/${config.type}/save`),
|
|
||||||
data: data,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function confirmationDetailDialog(field = 'id', actions = []) {
|
|
||||||
return permissionDetailDialog(CONFIRMATION, field, actions)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function authenticationDetailDialog(field = 'id', actions = []) {
|
|
||||||
return permissionDetailDialog(AUTHENTICATION, field, actions)
|
|
||||||
}
|
|
||||||
|
|
||||||
function permissionDetailDialog(config, field = 'id', actions = []) {
|
|
||||||
let data = {detail: true}
|
|
||||||
data[config.type] = true
|
|
||||||
return {
|
|
||||||
actionType: 'dialog',
|
|
||||||
dialog: {
|
|
||||||
title: '确权申请详情',
|
|
||||||
size: 'md',
|
|
||||||
actions: actions,
|
|
||||||
body: {
|
|
||||||
...detailForm(config.pickerApi, true),
|
|
||||||
initApi: apiGet(`\${base}/${config.type}/detail/\${${field}}`),
|
|
||||||
static: true,
|
|
||||||
data: data,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function confirmationEditeDialog(field = 'id') {
|
|
||||||
return permissionEditeDialog(CONFIRMATION, field)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function authenticationEditeDialog(field = 'id') {
|
|
||||||
return permissionEditeDialog(AUTHENTICATION, field)
|
|
||||||
}
|
|
||||||
|
|
||||||
function permissionEditeDialog(config, field = 'id') {
|
|
||||||
let data = {edit: true}
|
|
||||||
data[config.type] = true
|
|
||||||
return {
|
|
||||||
actionType: 'dialog',
|
|
||||||
dialog: {
|
|
||||||
title: '确权申请详情',
|
|
||||||
size: 'md',
|
|
||||||
actions: [
|
|
||||||
{
|
|
||||||
type: 'reset',
|
|
||||||
label: '重置',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'submit',
|
|
||||||
label: '确定',
|
|
||||||
level: 'primary',
|
|
||||||
}
|
|
||||||
],
|
|
||||||
body: {
|
|
||||||
...detailForm(config.pickerApi),
|
|
||||||
api: apiPost(`\${base}/${config.type}/save`),
|
|
||||||
initApi: apiGet(`\${base}/${config.type}/detail/\${${field}}`),
|
|
||||||
data: data,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -62,7 +62,8 @@ function detailForm(showCreatedUserAndModifiedUser = false) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
visibleOn: "${resourceType === 'API'}",
|
visibleOn: "${resourceType === 'API'}",
|
||||||
type: 'fieldSet',
|
type: 'wrapper',
|
||||||
|
size: 'none',
|
||||||
body: [
|
body: [
|
||||||
{
|
{
|
||||||
type: 'input-text',
|
type: 'input-text',
|
||||||
@@ -87,7 +88,8 @@ function detailForm(showCreatedUserAndModifiedUser = false) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
visibleOn: "${resourceType === 'FILE'}",
|
visibleOn: "${resourceType === 'FILE'}",
|
||||||
type: 'fieldSet',
|
type: 'wrapper',
|
||||||
|
size: 'none',
|
||||||
body: [
|
body: [
|
||||||
formInputSingleFileStatic('file', '数据文件'),
|
formInputSingleFileStatic('file', '数据文件'),
|
||||||
{
|
{
|
||||||
@@ -105,7 +107,8 @@ function detailForm(showCreatedUserAndModifiedUser = false) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
visibleOn: "${resourceType === 'DATABASE'}",
|
visibleOn: "${resourceType === 'DATABASE'}",
|
||||||
type: 'fieldSet',
|
type: 'wrapper',
|
||||||
|
size: 'none',
|
||||||
body: [
|
body: [
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
@@ -141,7 +144,8 @@ function detailForm(showCreatedUserAndModifiedUser = false) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
visibleOn: "${resourceType === 'HDFS'}",
|
visibleOn: "${resourceType === 'HDFS'}",
|
||||||
type: 'fieldSet',
|
type: 'wrapper',
|
||||||
|
size: 'none',
|
||||||
body: [
|
body: [
|
||||||
formInputSingleFileStatic('coreSiteFile', 'core-site.xml'),
|
formInputSingleFileStatic('coreSiteFile', 'core-site.xml'),
|
||||||
{
|
{
|
||||||
@@ -169,7 +173,8 @@ function detailForm(showCreatedUserAndModifiedUser = false) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
visibleOn: "${resourceType === 'FTP'}",
|
visibleOn: "${resourceType === 'FTP'}",
|
||||||
type: 'fieldSet',
|
type: 'wrapper',
|
||||||
|
size: 'none',
|
||||||
body: [
|
body: [
|
||||||
{
|
{
|
||||||
type: 'input-text',
|
type: 'input-text',
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {horizontalFormOptions, apiPost} from '../constants.js'
|
import {apiPost, horizontalFormOptions} from '../constants.js'
|
||||||
import {confirmPasswordFormItem, passwordFormItem} from "./dialog-user-item.js";
|
import {confirmPasswordFormItem, passwordFormItem} from "./dialog-user-item.js";
|
||||||
|
|
||||||
export function userChangePasswordDialog() {
|
export function userChangePasswordDialog() {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="zh">
|
<html lang="zh">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8"/>
|
<meta charset="UTF-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||||
<title></title>
|
<title></title>
|
||||||
<link href="/assets/sdk/antd.css" rel="stylesheet"/>
|
<link href="/assets/sdk/antd.css" rel="stylesheet"/>
|
||||||
<link href="/assets/sdk/helper.css" rel="stylesheet"/>
|
<link href="/assets/sdk/helper.css" rel="stylesheet"/>
|
||||||
@@ -20,6 +20,6 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script src="/assets/sdk/sdk.js"></script>
|
<script src="/assets/sdk/sdk.js"></script>
|
||||||
<script type="module" src="./main.js"></script>
|
<script src="./main.js" type="module"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import './style.css'
|
||||||
import {apiGet, useAmis} from '../../components/constants.js'
|
import {apiGet, useAmis} from '../../components/constants.js'
|
||||||
import {userChangePasswordDialog} from "../../components/user/dialog-user-change-password.js";
|
import {userChangePasswordDialog} from "../../components/user/dialog-user-change-password.js";
|
||||||
import {tabUser} from "./tab-user.js";
|
import {tabUser} from "./tab-user.js";
|
||||||
@@ -60,9 +61,9 @@ useAmis(information => {
|
|||||||
tabs: [
|
tabs: [
|
||||||
// tabOverview(),
|
// tabOverview(),
|
||||||
tabMarket(),
|
tabMarket(),
|
||||||
|
tabData(),
|
||||||
tabPermissions(),
|
tabPermissions(),
|
||||||
tabCheck(),
|
tabCheck(),
|
||||||
tabData(),
|
|
||||||
tabUser(),
|
tabUser(),
|
||||||
tabSettings(),
|
tabSettings(),
|
||||||
]
|
]
|
||||||
|
|||||||
0
gringotts-frontend/pages/index/style.css
Normal file
0
gringotts-frontend/pages/index/style.css
Normal file
@@ -5,7 +5,6 @@ import {
|
|||||||
} from "../../components/resource/dialog-resource.js";
|
} from "../../components/resource/dialog-resource.js";
|
||||||
import {
|
import {
|
||||||
apiGet,
|
apiGet,
|
||||||
arrayInCheck,
|
|
||||||
arrayOutCheck,
|
arrayOutCheck,
|
||||||
checkState,
|
checkState,
|
||||||
crudCommonOptions,
|
crudCommonOptions,
|
||||||
@@ -15,8 +14,9 @@ import {
|
|||||||
timeField,
|
timeField,
|
||||||
userOnly
|
userOnly
|
||||||
} from "../../components/constants.js";
|
} from "../../components/constants.js";
|
||||||
|
import {wareAddDialog, wareDetailDialog, wareEditeDialog} from "../../components/ware/dialog-ware.js";
|
||||||
|
|
||||||
export function resourceList() {
|
export function resourceList(showMode = false) {
|
||||||
return {
|
return {
|
||||||
type: 'crud',
|
type: 'crud',
|
||||||
api: apiGet('${base}/data_resource/list'),
|
api: apiGet('${base}/data_resource/list'),
|
||||||
@@ -50,6 +50,7 @@ export function resourceList() {
|
|||||||
...resourceDetailDialog(),
|
...resourceDetailDialog(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
visibleOn: !showMode,
|
||||||
type: 'dropdown-button',
|
type: 'dropdown-button',
|
||||||
level: 'link',
|
level: 'link',
|
||||||
icon: 'fa fa-ellipsis-h',
|
icon: 'fa fa-ellipsis-h',
|
||||||
@@ -66,8 +67,8 @@ export function resourceList() {
|
|||||||
...resourceEditeDialog(),
|
...resourceEditeDialog(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
disabledOn: arrayInCheck([checkState.checking], 'confirmationState'),
|
disabledOn: arrayOutCheck([checkState.none, checkState.draft], 'confirmationState'),
|
||||||
disabledTip: '审查中无法删除',
|
disabledTip: '审查或确权成功后无法删除',
|
||||||
tooltipPlacement: 'bottom',
|
tooltipPlacement: 'bottom',
|
||||||
type: 'action',
|
type: 'action',
|
||||||
label: "删除",
|
label: "删除",
|
||||||
@@ -89,6 +90,97 @@ export function tabData() {
|
|||||||
title: '数据资源',
|
title: '数据资源',
|
||||||
icon: 'fa fa-database',
|
icon: 'fa fa-database',
|
||||||
reload: true,
|
reload: true,
|
||||||
body: resourceList(),
|
body: {
|
||||||
|
type: 'tabs',
|
||||||
|
tabs: [
|
||||||
|
{
|
||||||
|
title: '资源定义',
|
||||||
|
tab: resourceList()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '资源上架',
|
||||||
|
tab: {
|
||||||
|
type: 'crud',
|
||||||
|
api: apiGet('${base}/ware/list'),
|
||||||
|
...crudCommonOptions(),
|
||||||
|
headerToolbar: [
|
||||||
|
'reload',
|
||||||
|
{
|
||||||
|
type: 'action',
|
||||||
|
label: '',
|
||||||
|
icon: 'fa fa-plus',
|
||||||
|
...wareAddDialog()
|
||||||
|
},
|
||||||
|
],
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
name: 'name',
|
||||||
|
label: '名称',
|
||||||
|
width: 200,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'description',
|
||||||
|
label: '描述',
|
||||||
|
},
|
||||||
|
mappingField('state', '状态', permissionStateMapping),
|
||||||
|
timeField('createdTime', '创建时间'),
|
||||||
|
operationField('操作', undefined, [
|
||||||
|
{
|
||||||
|
type: 'action',
|
||||||
|
label: '查看',
|
||||||
|
level: 'link',
|
||||||
|
...wareDetailDialog(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
visibleOn: "${state === 'CHECKING'}",
|
||||||
|
type: 'action',
|
||||||
|
label: '撤销',
|
||||||
|
level: 'link',
|
||||||
|
confirmTitle: '确认撤销',
|
||||||
|
confirmText: '确认撤销名称为「${name}」的确权申请吗?',
|
||||||
|
actionType: 'ajax',
|
||||||
|
api: apiGet('${base}/ware/retract/${id}'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
visibleOn: "${state === 'DRAFT' || state === 'REJECT'}",
|
||||||
|
type: 'action',
|
||||||
|
label: '提交',
|
||||||
|
level: 'link',
|
||||||
|
confirmTitle: '确认提交',
|
||||||
|
confirmText: '确认提交名称为「${name}」的确权申请吗?',
|
||||||
|
actionType: 'ajax',
|
||||||
|
api: apiGet('${base}/ware/submit/${id}'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'dropdown-button',
|
||||||
|
level: 'link',
|
||||||
|
icon: 'fa fa-ellipsis-h',
|
||||||
|
hideCaret: true,
|
||||||
|
trigger: 'hover',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
disabledOn: "${state !== 'DRAFT'}",
|
||||||
|
type: 'action',
|
||||||
|
label: '编辑',
|
||||||
|
level: 'link',
|
||||||
|
...wareEditeDialog(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
disabledOn: "${state === 'CHECKING'}",
|
||||||
|
type: 'action',
|
||||||
|
label: "删除",
|
||||||
|
confirmTitle: '确认删除',
|
||||||
|
confirmText: '确认删除名称为「${name}」的确权申请吗?删除后对应的数据资源处于未确权状态。',
|
||||||
|
actionType: 'ajax',
|
||||||
|
api: apiGet('${base}/ware/remove/${id}'),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]),
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,4 @@
|
|||||||
import {wareAddDialog, wareDetailDialog, wareEditeDialog} from "../../components/ware/dialog-ware.js";
|
import {apiGet, crudCommonOptions} from "../../components/constants.js";
|
||||||
import {
|
|
||||||
apiGet,
|
|
||||||
crudCommonOptions,
|
|
||||||
mappingField,
|
|
||||||
operationField,
|
|
||||||
permissionStateMapping,
|
|
||||||
timeField
|
|
||||||
} from "../../components/constants.js";
|
|
||||||
import {authenticationAddDialog} from "../../components/permission/dialog-permission.js";
|
import {authenticationAddDialog} from "../../components/permission/dialog-permission.js";
|
||||||
|
|
||||||
export function tabMarket() {
|
export function tabMarket() {
|
||||||
@@ -14,12 +6,6 @@ export function tabMarket() {
|
|||||||
title: '数据市场',
|
title: '数据市场',
|
||||||
icon: 'fa fa-store',
|
icon: 'fa fa-store',
|
||||||
reload: true,
|
reload: true,
|
||||||
body: [
|
|
||||||
{
|
|
||||||
type: 'tabs',
|
|
||||||
tabs: [
|
|
||||||
{
|
|
||||||
title: '公开数据',
|
|
||||||
body: {
|
body: {
|
||||||
type: 'crud',
|
type: 'crud',
|
||||||
api: {
|
api: {
|
||||||
@@ -39,19 +25,58 @@ export function tabMarket() {
|
|||||||
'reload',
|
'reload',
|
||||||
],
|
],
|
||||||
mode: 'cards',
|
mode: 'cards',
|
||||||
|
columnsCount: 3,
|
||||||
card: {
|
card: {
|
||||||
header: {
|
header: {
|
||||||
title: '${name}',
|
title: '${name}',
|
||||||
subTitle: '${createdTime}',
|
subTitle: '${createdTime}',
|
||||||
description: '${description}',
|
|
||||||
avatar: '${icon}',
|
avatar: '${icon}',
|
||||||
avatarClassName: 'pull-left thumb-md avatar b-3x m-r'
|
avatarClassName: 'pull-left thumb-md avatar b-3x m-r'
|
||||||
},
|
},
|
||||||
|
body: '${TRUNCATE(description, 50)}',
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
type: 'action',
|
type: 'action',
|
||||||
label: '查看',
|
label: '查看',
|
||||||
...wareDetailDialog(),
|
actionType: 'dialog',
|
||||||
|
dialog: {
|
||||||
|
title: '数据产品详情',
|
||||||
|
size: 'md',
|
||||||
|
actions: [],
|
||||||
|
body: {
|
||||||
|
type: 'service',
|
||||||
|
api: apiGet(`\${base}/ware/detail/\${id}`),
|
||||||
|
body: [
|
||||||
|
{
|
||||||
|
type: 'property',
|
||||||
|
title: '产品信息',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
label: '名称',
|
||||||
|
content: '${name}',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '归属',
|
||||||
|
content: '${createdUsername}',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '创建时间',
|
||||||
|
content: '${createdTime}',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
span: 3,
|
||||||
|
label: '描述',
|
||||||
|
content: '${description}',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'tpl',
|
||||||
|
tpl: '${content|raw}'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'action',
|
type: 'action',
|
||||||
@@ -61,93 +86,5 @@ export function tabMarket() {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '我的数据',
|
|
||||||
body: {
|
|
||||||
type: 'crud',
|
|
||||||
api: apiGet('${base}/ware/list'),
|
|
||||||
...crudCommonOptions(),
|
|
||||||
headerToolbar: [
|
|
||||||
'reload',
|
|
||||||
{
|
|
||||||
type: 'action',
|
|
||||||
label: '',
|
|
||||||
icon: 'fa fa-plus',
|
|
||||||
...wareAddDialog()
|
|
||||||
},
|
|
||||||
],
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
name: 'name',
|
|
||||||
label: '名称',
|
|
||||||
width: 200,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'description',
|
|
||||||
label: '描述',
|
|
||||||
},
|
|
||||||
mappingField('state', '状态', permissionStateMapping),
|
|
||||||
timeField('createdTime', '创建时间'),
|
|
||||||
operationField('操作', undefined, [
|
|
||||||
{
|
|
||||||
type: 'action',
|
|
||||||
label: '查看',
|
|
||||||
level: 'link',
|
|
||||||
...wareDetailDialog(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
visibleOn: "${state === 'CHECKING'}",
|
|
||||||
type: 'action',
|
|
||||||
label: '撤销',
|
|
||||||
level: 'link',
|
|
||||||
confirmTitle: '确认撤销',
|
|
||||||
confirmText: '确认撤销名称为「${name}」的确权申请吗?',
|
|
||||||
actionType: 'ajax',
|
|
||||||
api: apiGet('${base}/ware/retract/${id}'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
visibleOn: "${state === 'DRAFT' || state === 'REJECT'}",
|
|
||||||
type: 'action',
|
|
||||||
label: '提交',
|
|
||||||
level: 'link',
|
|
||||||
confirmTitle: '确认提交',
|
|
||||||
confirmText: '确认提交名称为「${name}」的确权申请吗?',
|
|
||||||
actionType: 'ajax',
|
|
||||||
api: apiGet('${base}/ware/submit/${id}'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
visibleOn: "${!public}",
|
|
||||||
type: 'dropdown-button',
|
|
||||||
level: 'link',
|
|
||||||
icon: 'fa fa-ellipsis-h',
|
|
||||||
hideCaret: true,
|
|
||||||
trigger: 'hover',
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
disabledOn: "${state !== 'DRAFT'}",
|
|
||||||
type: 'action',
|
|
||||||
label: '编辑',
|
|
||||||
level: 'link',
|
|
||||||
...wareEditeDialog(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
disabledOn: "${state === 'CHECKING'}",
|
|
||||||
type: 'action',
|
|
||||||
label: "删除",
|
|
||||||
confirmTitle: '确认删除',
|
|
||||||
confirmText: '确认删除名称为「${name}」的确权申请吗?删除后对应的数据资源处于未确权状态。',
|
|
||||||
actionType: 'ajax',
|
|
||||||
api: apiGet('${base}/ware/remove/${id}'),
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
2
gringotts-web/bin/start.sh
Executable file
2
gringotts-web/bin/start.sh
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P"Dp^A47>WSn:Wn].gs/+"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.'
|
||||||
|
nohup /home/iap/gringotts/jdk/jdk-11.0.25+9/bin/java -jar /home/iap/gringotts/gringotts-web-1.0.0-SNAPSHOT.jar --spring.profiles.active=build > run.log 2>&1 &
|
||||||
40
gringotts-web/bin/stop.sh
Executable file
40
gringotts-web/bin/stop.sh
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
original_command="$0"
|
||||||
|
application_name="gringotts-web-1.0.0-SNAPSHOT.jar"
|
||||||
|
|
||||||
|
function get_pid() {
|
||||||
|
ID=$(ps -ef | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{ print $2 }')
|
||||||
|
if [[ -z "$ID" ]]; then
|
||||||
|
ID=$(ps aux | grep "$application_name" | grep -v grep | grep -v $original_command | awk '{print $2}')
|
||||||
|
if [[ -z "$ID" ]]; then
|
||||||
|
ID=$(/home/iap/gringotts/jdk/jdk-11.0.25+9/bin/jps -lmvV | grep "$application_name" | awk '{print $1}')
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo $ID
|
||||||
|
}
|
||||||
|
|
||||||
|
pid=$(get_pid)
|
||||||
|
|
||||||
|
if [[ -z "$pid" ]]; then
|
||||||
|
echo "Application is already stopped."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Stopping $pid..."
|
||||||
|
kill $pid
|
||||||
|
|
||||||
|
LOOPS=0
|
||||||
|
while (true); do
|
||||||
|
cpid=$(get_pid)
|
||||||
|
if [[ -z "$cpid" ]]; then
|
||||||
|
echo "Oook! cost:$LOOPS"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
LOOPS=$(($LOOPS+1))
|
||||||
|
if [[ $(($LOOPS%15)) -eq 0 ]]; then
|
||||||
|
echo "Wait timeout, try to force kill $pid..."
|
||||||
|
kill -9 $pid
|
||||||
|
fi
|
||||||
|
sleep 1s
|
||||||
|
done
|
||||||
@@ -34,6 +34,10 @@
|
|||||||
<version>${hibernate.version}</version>
|
<version>${hibernate.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database</groupId>
|
<groupId>com.h2database</groupId>
|
||||||
<artifactId>h2</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public abstract class SimpleControllerSupport<ENTITY extends SimpleEntity, SAVE_
|
|||||||
protected static final String DETAIL = "/detail/{id}";
|
protected static final String DETAIL = "/detail/{id}";
|
||||||
protected static final String REMOVE = "/remove/{id}";
|
protected static final String REMOVE = "/remove/{id}";
|
||||||
|
|
||||||
private final SimpleServiceSupport<ENTITY> service;
|
protected final SimpleServiceSupport<ENTITY> service;
|
||||||
|
|
||||||
public SimpleControllerSupport(SimpleServiceSupport<ENTITY> service) {
|
public SimpleControllerSupport(SimpleServiceSupport<ENTITY> service) {
|
||||||
this.service = service;
|
this.service = service;
|
||||||
|
|||||||
@@ -7,13 +7,8 @@ import com.eshore.gringotts.web.domain.base.repository.SimpleRepository;
|
|||||||
import com.eshore.gringotts.web.domain.service.UserService;
|
import com.eshore.gringotts.web.domain.service.UserService;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.Query;
|
import javax.persistence.Query;
|
||||||
import javax.persistence.criteria.CriteriaBuilder;
|
|
||||||
import javax.persistence.criteria.CriteriaQuery;
|
|
||||||
import javax.persistence.criteria.Predicate;
|
|
||||||
import javax.persistence.criteria.Root;
|
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.eclipse.collections.api.list.ImmutableList;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lanyuanxiaoyao
|
* @author lanyuanxiaoyao
|
||||||
@@ -28,16 +23,11 @@ public abstract class LogicDeleteService<ENTITY extends LogicDeleteEntity> exten
|
|||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected ImmutableList<Predicate> listPredicate(Root<ENTITY> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
|
|
||||||
return super.listPredicate(root, query, builder).newWith(builder.equal(root.get("deleted"), false));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(rollbackOn = Throwable.class)
|
@Transactional(rollbackOn = Throwable.class)
|
||||||
@Override
|
@Override
|
||||||
public void remove(Long id) {
|
public void remove(Long id) {
|
||||||
String entityName = ClassUtil.getTypeArgument(this.getClass()).getSimpleName();
|
String entityName = ClassUtil.getTypeArgument(this.getClass()).getSimpleName();
|
||||||
Query query = manager.createQuery(StrUtil.format("update {} entity set deleted=true where id=?1", entityName));
|
Query query = manager.createQuery(StrUtil.format("update {} entity set entity.deleted = true where id = ?1", entityName));
|
||||||
query.setParameter(1, id);
|
query.setParameter(1, id);
|
||||||
query.executeUpdate();
|
query.executeUpdate();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import org.eclipse.collections.api.set.ImmutableSet;
|
|||||||
public interface SimpleService<ENTITY extends SimpleEntity> {
|
public interface SimpleService<ENTITY extends SimpleEntity> {
|
||||||
Long save(ENTITY entity) throws Exception;
|
Long save(ENTITY entity) throws Exception;
|
||||||
|
|
||||||
|
Long count() throws Exception;
|
||||||
|
|
||||||
ImmutableList<ENTITY> list() throws Exception;
|
ImmutableList<ENTITY> list() throws Exception;
|
||||||
|
|
||||||
ImmutableList<ENTITY> list(ImmutableSet<Long> ids) throws Exception;
|
ImmutableList<ENTITY> list(ImmutableSet<Long> ids) throws Exception;
|
||||||
|
|||||||
@@ -64,6 +64,18 @@ public abstract class SimpleServiceSupport<ENTITY extends SimpleEntity> implemen
|
|||||||
return entity.getId();
|
return entity.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long count() throws Exception {
|
||||||
|
return repository.count(
|
||||||
|
(root, query, builder) ->
|
||||||
|
builder.and(
|
||||||
|
listPredicate(root, query, builder)
|
||||||
|
.reject(ObjectUtil::isNull)
|
||||||
|
.toArray(new Predicate[]{})
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ImmutableList<ENTITY> list() throws Exception {
|
public ImmutableList<ENTITY> list() throws Exception {
|
||||||
return Lists.immutable.ofAll(repository.findAll(
|
return Lists.immutable.ofAll(repository.findAll(
|
||||||
@@ -106,7 +118,7 @@ public abstract class SimpleServiceSupport<ENTITY extends SimpleEntity> implemen
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private ImmutableList<Predicate> queryPredicates(Query.Queryable queryable, Root<ENTITY> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
|
protected ImmutableList<Predicate> queryPredicates(Query.Queryable queryable, Root<ENTITY> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
|
||||||
MutableList<Predicate> predicates = Lists.mutable.empty();
|
MutableList<Predicate> predicates = Lists.mutable.empty();
|
||||||
if (ObjectUtil.isEmpty(queryable)) {
|
if (ObjectUtil.isEmpty(queryable)) {
|
||||||
return predicates.toImmutable();
|
return predicates.toImmutable();
|
||||||
|
|||||||
@@ -174,18 +174,18 @@ public class DataResourceController extends SimpleControllerSupport<DataResource
|
|||||||
break;
|
break;
|
||||||
case JSON:
|
case JSON:
|
||||||
JsonResourceFormat jsonFormat = (JsonResourceFormat) dataResource.getFormat();
|
JsonResourceFormat jsonFormat = (JsonResourceFormat) dataResource.getFormat();
|
||||||
item.setJsonSchemaText(jsonFormat.getSchema());
|
item.setJsonSchemaText(jsonFormat.getJsonSchema());
|
||||||
item.setJsonSchema(mapper.readValue(jsonFormat.getSchema(), Map.class));
|
item.setJsonSchema(mapper.readValue(jsonFormat.getJsonSchema(), Map.class));
|
||||||
break;
|
break;
|
||||||
case JSON_LINE:
|
case JSON_LINE:
|
||||||
JsonLineResourceFormat jsonLineFormat = (JsonLineResourceFormat) dataResource.getFormat();
|
JsonLineResourceFormat jsonLineFormat = (JsonLineResourceFormat) dataResource.getFormat();
|
||||||
item.setJsonLineSchemaText(jsonLineFormat.getSchema());
|
item.setJsonLineSchemaText(jsonLineFormat.getJsonSchema());
|
||||||
item.setJsonLineSchema(mapper.readValue(jsonLineFormat.getSchema(), Map.class));
|
item.setJsonLineSchema(mapper.readValue(jsonLineFormat.getJsonSchema(), Map.class));
|
||||||
break;
|
break;
|
||||||
case CSV:
|
case CSV:
|
||||||
CsvResourceFormat csvFormat = (CsvResourceFormat) dataResource.getFormat();
|
CsvResourceFormat csvFormat = (CsvResourceFormat) dataResource.getFormat();
|
||||||
item.setCsvSchemaText(csvFormat.getSchema());
|
item.setCsvSchemaText(csvFormat.getCsvSchema());
|
||||||
item.setCsvSchema(mapper.readValue(csvFormat.getSchema(), Map.class));
|
item.setCsvSchema(mapper.readValue(csvFormat.getCsvSchema(), Map.class));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isNotNull(dataResource.getExample())) {
|
if (ObjectUtil.isNotNull(dataResource.getExample())) {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity;
|
|||||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity;
|
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.persistence.CascadeType;
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.ConstraintMode;
|
import javax.persistence.ConstraintMode;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
@@ -23,7 +22,6 @@ import lombok.Getter;
|
|||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.DynamicUpdate;
|
import org.hibernate.annotations.DynamicUpdate;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
import org.hibernate.annotations.Where;
|
||||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
|
|
||||||
@@ -50,13 +48,12 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
|||||||
@NamedAttributeNode(value = "createdUser"),
|
@NamedAttributeNode(value = "createdUser"),
|
||||||
@NamedAttributeNode(value = "modifiedUser"),
|
@NamedAttributeNode(value = "modifiedUser"),
|
||||||
})
|
})
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "authentication" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
||||||
public class Authentication extends CheckingNeededEntity {
|
public class Authentication extends CheckingNeededEntity {
|
||||||
@ManyToOne(fetch = FetchType.EAGER)
|
@ManyToOne(fetch = FetchType.EAGER)
|
||||||
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||||
private DataResource target;
|
private DataResource target;
|
||||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
@OneToMany(fetch = FetchType.LAZY)
|
||||||
@JoinTable(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT), inverseForeignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
@JoinTable(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT), inverseForeignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
private Set<DataFile> evidences;
|
private Set<DataFile> evidences;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import com.eshore.gringotts.core.Constants;
|
|||||||
import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity;
|
import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity;
|
||||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity;
|
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.persistence.CascadeType;
|
|
||||||
import javax.persistence.ConstraintMode;
|
import javax.persistence.ConstraintMode;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.EntityListeners;
|
import javax.persistence.EntityListeners;
|
||||||
@@ -21,7 +20,6 @@ import lombok.Getter;
|
|||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.DynamicUpdate;
|
import org.hibernate.annotations.DynamicUpdate;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
import org.hibernate.annotations.Where;
|
||||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
|
|
||||||
@@ -48,13 +46,12 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
|||||||
@NamedAttributeNode(value = "createdUser"),
|
@NamedAttributeNode(value = "createdUser"),
|
||||||
@NamedAttributeNode(value = "modifiedUser"),
|
@NamedAttributeNode(value = "modifiedUser"),
|
||||||
})
|
})
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "confirmation" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
||||||
public class Confirmation extends CheckingNeededEntity {
|
public class Confirmation extends CheckingNeededEntity {
|
||||||
@OneToOne(fetch = FetchType.EAGER)
|
@OneToOne(fetch = FetchType.EAGER)
|
||||||
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||||
private DataResource target;
|
private DataResource target;
|
||||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
@OneToMany(fetch = FetchType.LAZY)
|
||||||
@JoinTable(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT), inverseForeignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
@JoinTable(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT), inverseForeignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
private Set<DataFile> evidences;
|
private Set<DataFile> evidences;
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
package com.eshore.gringotts.web.domain.entity;
|
package com.eshore.gringotts.web.domain.entity;
|
||||||
|
|
||||||
import com.eshore.gringotts.core.Constants;
|
import com.eshore.gringotts.core.Constants;
|
||||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity;
|
import com.eshore.gringotts.web.domain.base.entity.SimpleEntity;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.DynamicUpdate;
|
import org.hibernate.annotations.DynamicUpdate;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传文件
|
* 上传文件
|
||||||
@@ -23,9 +21,7 @@ import org.hibernate.annotations.Where;
|
|||||||
@Entity
|
@Entity
|
||||||
@DynamicUpdate
|
@DynamicUpdate
|
||||||
@Table(name = Constants.TABLE_PREFIX + "data_file")
|
@Table(name = Constants.TABLE_PREFIX + "data_file")
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "data_file" + " set deleted = true where id = ?")
|
public class DataFile extends SimpleEntity {
|
||||||
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
|
||||||
public class DataFile extends LogicDeleteEntity {
|
|
||||||
private String filename;
|
private String filename;
|
||||||
private Long size;
|
private Long size;
|
||||||
private String md5;
|
private String md5;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity;
|
|||||||
import com.eshore.gringotts.web.domain.entity.format.ResourceFormat;
|
import com.eshore.gringotts.web.domain.entity.format.ResourceFormat;
|
||||||
import com.eshore.gringotts.web.domain.entity.type.ResourceType;
|
import com.eshore.gringotts.web.domain.entity.type.ResourceType;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.persistence.CascadeType;
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.ConstraintMode;
|
import javax.persistence.ConstraintMode;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
@@ -22,7 +21,6 @@ import lombok.Getter;
|
|||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.DynamicUpdate;
|
import org.hibernate.annotations.DynamicUpdate;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
import org.hibernate.annotations.Where;
|
||||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
|
|
||||||
@@ -47,17 +45,16 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
|||||||
@NamedAttributeNode(value = "createdUser"),
|
@NamedAttributeNode(value = "createdUser"),
|
||||||
@NamedAttributeNode(value = "modifiedUser"),
|
@NamedAttributeNode(value = "modifiedUser"),
|
||||||
})
|
})
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "data_resource" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
||||||
public class DataResource extends LogicDeleteEntity {
|
public class DataResource extends LogicDeleteEntity {
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
private String name;
|
private String name;
|
||||||
private String description;
|
private String description;
|
||||||
@OneToOne(cascade = CascadeType.REMOVE, fetch = FetchType.LAZY)
|
@OneToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
private ResourceType type;
|
private ResourceType type;
|
||||||
@OneToOne(cascade = CascadeType.REMOVE, fetch = FetchType.LAZY)
|
@OneToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
private ResourceFormat format;
|
private ResourceFormat format;
|
||||||
@@ -65,13 +62,13 @@ public class DataResource extends LogicDeleteEntity {
|
|||||||
@JoinColumn(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
@JoinColumn(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
private DataFile example;
|
private DataFile example;
|
||||||
@OneToOne(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER, mappedBy = "target")
|
@OneToOne(fetch = FetchType.EAGER, mappedBy = "target")
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
private Confirmation confirmation;
|
private Confirmation confirmation;
|
||||||
@OneToMany(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER, mappedBy = "target")
|
@OneToMany(fetch = FetchType.EAGER, mappedBy = "target")
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
private Set<Authentication> authentications;
|
private Set<Authentication> authentications;
|
||||||
@OneToOne(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER, mappedBy = "resource")
|
@OneToOne(fetch = FetchType.EAGER, mappedBy = "resource")
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
private Ware ware;
|
private Ware ware;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import lombok.Getter;
|
|||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.DynamicUpdate;
|
import org.hibernate.annotations.DynamicUpdate;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
import org.hibernate.annotations.Where;
|
||||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
|
|
||||||
@@ -48,7 +47,6 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
|||||||
@NamedAttributeNode(value = "createdUser"),
|
@NamedAttributeNode(value = "createdUser"),
|
||||||
@NamedAttributeNode(value = "modifiedUser"),
|
@NamedAttributeNode(value = "modifiedUser"),
|
||||||
})
|
})
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "ware" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
||||||
public class Ware extends CheckingNeededEntity {
|
public class Ware extends CheckingNeededEntity {
|
||||||
@OneToOne(cascade = CascadeType.DETACH, fetch = FetchType.EAGER)
|
@OneToOne(cascade = CascadeType.DETACH, fetch = FetchType.EAGER)
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.eshore.gringotts.web.domain.entity.format;
|
package com.eshore.gringotts.web.domain.entity.format;
|
||||||
|
|
||||||
import com.eshore.gringotts.core.Constants;
|
|
||||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
|
||||||
import javax.persistence.DiscriminatorValue;
|
import javax.persistence.DiscriminatorValue;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -9,8 +7,6 @@ import lombok.Getter;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CSV格式
|
* CSV格式
|
||||||
@@ -25,10 +21,8 @@ import org.hibernate.annotations.Where;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Entity
|
@Entity
|
||||||
@DiscriminatorValue("CSV")
|
@DiscriminatorValue("CSV")
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_format" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
|
|
||||||
public class CsvResourceFormat extends ResourceFormat {
|
public class CsvResourceFormat extends ResourceFormat {
|
||||||
private String schema;
|
private String csvSchema;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Type getFormatType() {
|
public Type getFormatType() {
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.eshore.gringotts.web.domain.entity.format;
|
package com.eshore.gringotts.web.domain.entity.format;
|
||||||
|
|
||||||
import com.eshore.gringotts.core.Constants;
|
|
||||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
|
||||||
import javax.persistence.DiscriminatorValue;
|
import javax.persistence.DiscriminatorValue;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -9,8 +7,6 @@ import lombok.Getter;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSON line格式
|
* JSON line格式
|
||||||
@@ -25,10 +21,8 @@ import org.hibernate.annotations.Where;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Entity
|
@Entity
|
||||||
@DiscriminatorValue("JSON_LINE")
|
@DiscriminatorValue("JSON_LINE")
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_format" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
|
|
||||||
public class JsonLineResourceFormat extends ResourceFormat {
|
public class JsonLineResourceFormat extends ResourceFormat {
|
||||||
private String schema;
|
private String jsonSchema;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Type getFormatType() {
|
public Type getFormatType() {
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.eshore.gringotts.web.domain.entity.format;
|
package com.eshore.gringotts.web.domain.entity.format;
|
||||||
|
|
||||||
import com.eshore.gringotts.core.Constants;
|
|
||||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
|
||||||
import javax.persistence.DiscriminatorValue;
|
import javax.persistence.DiscriminatorValue;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -9,8 +7,6 @@ import lombok.Getter;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 一个文件就是一个JSON
|
* 一个文件就是一个JSON
|
||||||
@@ -25,10 +21,8 @@ import org.hibernate.annotations.Where;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Entity
|
@Entity
|
||||||
@DiscriminatorValue("JSON")
|
@DiscriminatorValue("JSON")
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_format" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
|
|
||||||
public class JsonResourceFormat extends ResourceFormat {
|
public class JsonResourceFormat extends ResourceFormat {
|
||||||
private String schema;
|
private String jsonSchema;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Type getFormatType() {
|
public Type getFormatType() {
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
package com.eshore.gringotts.web.domain.entity.format;
|
package com.eshore.gringotts.web.domain.entity.format;
|
||||||
|
|
||||||
import com.eshore.gringotts.core.Constants;
|
|
||||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
|
||||||
import javax.persistence.DiscriminatorValue;
|
import javax.persistence.DiscriminatorValue;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无格式,文件每行就是一份数据
|
* 无格式,文件每行就是一份数据
|
||||||
@@ -21,8 +17,6 @@ import org.hibernate.annotations.Where;
|
|||||||
@ToString
|
@ToString
|
||||||
@Entity
|
@Entity
|
||||||
@DiscriminatorValue("LINE")
|
@DiscriminatorValue("LINE")
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_format" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
|
|
||||||
public class LineResourceFormat extends ResourceFormat {
|
public class LineResourceFormat extends ResourceFormat {
|
||||||
@Override
|
@Override
|
||||||
public Type getFormatType() {
|
public Type getFormatType() {
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
package com.eshore.gringotts.web.domain.entity.format;
|
package com.eshore.gringotts.web.domain.entity.format;
|
||||||
|
|
||||||
import com.eshore.gringotts.core.Constants;
|
|
||||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
|
||||||
import javax.persistence.DiscriminatorValue;
|
import javax.persistence.DiscriminatorValue;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无格式,整个文件就是一份数据
|
* 无格式,整个文件就是一份数据
|
||||||
@@ -21,8 +17,6 @@ import org.hibernate.annotations.Where;
|
|||||||
@ToString
|
@ToString
|
||||||
@Entity
|
@Entity
|
||||||
@DiscriminatorValue("NONE")
|
@DiscriminatorValue("NONE")
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_format" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
|
|
||||||
public class NoneResourceFormat extends ResourceFormat {
|
public class NoneResourceFormat extends ResourceFormat {
|
||||||
@Override
|
@Override
|
||||||
public Type getFormatType() {
|
public Type getFormatType() {
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ import javax.persistence.Table;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资源格式
|
* 资源格式
|
||||||
@@ -24,8 +22,6 @@ import org.hibernate.annotations.Where;
|
|||||||
@Entity
|
@Entity
|
||||||
@Table(name = Constants.TABLE_PREFIX + "resource_format")
|
@Table(name = Constants.TABLE_PREFIX + "resource_format")
|
||||||
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
|
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_format" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
|
|
||||||
public abstract class ResourceFormat extends LogicDeleteIdOnlyEntity {
|
public abstract class ResourceFormat extends LogicDeleteIdOnlyEntity {
|
||||||
public abstract Type getFormatType();
|
public abstract Type getFormatType();
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.eshore.gringotts.web.domain.entity.type;
|
package com.eshore.gringotts.web.domain.entity.type;
|
||||||
|
|
||||||
import com.eshore.gringotts.core.Constants;
|
import com.eshore.gringotts.core.Constants;
|
||||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
@@ -10,8 +9,6 @@ import lombok.Getter;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -20,8 +17,6 @@ import org.hibernate.annotations.Where;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = Constants.TABLE_PREFIX + "resource_type_api")
|
@Table(name = Constants.TABLE_PREFIX + "resource_type_api")
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_type_api" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
|
|
||||||
public class ApiResourceType extends ResourceType {
|
public class ApiResourceType extends ResourceType {
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
private String url;
|
private String url;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.eshore.gringotts.web.domain.entity.type;
|
package com.eshore.gringotts.web.domain.entity.type;
|
||||||
|
|
||||||
import com.eshore.gringotts.core.Constants;
|
import com.eshore.gringotts.core.Constants;
|
||||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.EnumType;
|
import javax.persistence.EnumType;
|
||||||
@@ -12,8 +11,6 @@ import lombok.Getter;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -22,8 +19,6 @@ import org.hibernate.annotations.Where;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = Constants.TABLE_PREFIX + "resource_type_database")
|
@Table(name = Constants.TABLE_PREFIX + "resource_type_database")
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_type_database" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
|
|
||||||
public class DatabaseResourceType extends ResourceType {
|
public class DatabaseResourceType extends ResourceType {
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
private String jdbc;
|
private String jdbc;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.eshore.gringotts.web.domain.entity.type;
|
package com.eshore.gringotts.web.domain.entity.type;
|
||||||
|
|
||||||
import com.eshore.gringotts.core.Constants;
|
import com.eshore.gringotts.core.Constants;
|
||||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
|
||||||
import com.eshore.gringotts.web.domain.entity.DataFile;
|
import com.eshore.gringotts.web.domain.entity.DataFile;
|
||||||
import javax.persistence.ConstraintMode;
|
import javax.persistence.ConstraintMode;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
@@ -14,8 +13,6 @@ import lombok.Getter;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -24,8 +21,6 @@ import org.hibernate.annotations.Where;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = Constants.TABLE_PREFIX + "resource_type_file")
|
@Table(name = Constants.TABLE_PREFIX + "resource_type_file")
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_type_file" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
|
|
||||||
public class FileResourceType extends ResourceType {
|
public class FileResourceType extends ResourceType {
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.eshore.gringotts.web.domain.entity.type;
|
package com.eshore.gringotts.web.domain.entity.type;
|
||||||
|
|
||||||
import com.eshore.gringotts.core.Constants;
|
import com.eshore.gringotts.core.Constants;
|
||||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
@@ -10,8 +9,6 @@ import lombok.Getter;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -20,8 +17,6 @@ import org.hibernate.annotations.Where;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = Constants.TABLE_PREFIX + "resource_type_ftp")
|
@Table(name = Constants.TABLE_PREFIX + "resource_type_ftp")
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_type_ftp" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
|
|
||||||
public class FtpResourceType extends ResourceType {
|
public class FtpResourceType extends ResourceType {
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
private String url;
|
private String url;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.eshore.gringotts.web.domain.entity.type;
|
package com.eshore.gringotts.web.domain.entity.type;
|
||||||
|
|
||||||
import com.eshore.gringotts.core.Constants;
|
import com.eshore.gringotts.core.Constants;
|
||||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
|
||||||
import com.eshore.gringotts.web.domain.entity.DataFile;
|
import com.eshore.gringotts.web.domain.entity.DataFile;
|
||||||
import javax.persistence.ConstraintMode;
|
import javax.persistence.ConstraintMode;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
@@ -14,8 +13,6 @@ import lombok.Getter;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -24,8 +21,6 @@ import org.hibernate.annotations.Where;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = Constants.TABLE_PREFIX + "resource_type_hdfs")
|
@Table(name = Constants.TABLE_PREFIX + "resource_type_hdfs")
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_type_hdfs" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
|
|
||||||
public class HDFSResourceType extends ResourceType {
|
public class HDFSResourceType extends ResourceType {
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ import javax.persistence.Table;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.hibernate.annotations.SQLDelete;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资源类型
|
* 资源类型
|
||||||
@@ -24,8 +22,6 @@ import org.hibernate.annotations.Where;
|
|||||||
@Entity
|
@Entity
|
||||||
@Table(name = Constants.TABLE_PREFIX + "resource_type")
|
@Table(name = Constants.TABLE_PREFIX + "resource_type")
|
||||||
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
|
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
|
||||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_type" + " set deleted = true where id = ?")
|
|
||||||
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
|
|
||||||
public abstract class ResourceType extends LogicDeleteIdOnlyEntity {
|
public abstract class ResourceType extends LogicDeleteIdOnlyEntity {
|
||||||
public abstract Type getResourceType();
|
public abstract Type getResourceType();
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity;
|
import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity;
|
||||||
import com.eshore.gringotts.web.domain.base.service.CheckingService;
|
import com.eshore.gringotts.web.domain.base.service.CheckingService;
|
||||||
import com.eshore.gringotts.web.domain.base.service.SimpleServiceSupport;
|
import com.eshore.gringotts.web.domain.base.service.LogicDeleteService;
|
||||||
import com.eshore.gringotts.web.domain.entity.CheckOrder;
|
import com.eshore.gringotts.web.domain.entity.CheckOrder;
|
||||||
import com.eshore.gringotts.web.domain.entity.CheckOrder_;
|
import com.eshore.gringotts.web.domain.entity.CheckOrder_;
|
||||||
import com.eshore.gringotts.web.domain.entity.Confirmation;
|
import com.eshore.gringotts.web.domain.entity.Confirmation;
|
||||||
@@ -13,6 +13,7 @@ import com.eshore.gringotts.web.domain.entity.User;
|
|||||||
import com.eshore.gringotts.web.domain.repository.ConfirmationRepository;
|
import com.eshore.gringotts.web.domain.repository.ConfirmationRepository;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.criteria.CriteriaBuilder;
|
import javax.persistence.criteria.CriteriaBuilder;
|
||||||
import javax.persistence.criteria.CriteriaQuery;
|
import javax.persistence.criteria.CriteriaQuery;
|
||||||
import javax.persistence.criteria.Join;
|
import javax.persistence.criteria.Join;
|
||||||
@@ -34,13 +35,13 @@ import org.springframework.stereotype.Service;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service("com.eshore.gringotts.web.domain.service.ConfirmationService")
|
@Service("com.eshore.gringotts.web.domain.service.ConfirmationService")
|
||||||
public class ConfirmationService extends SimpleServiceSupport<Confirmation> implements CheckingService {
|
public class ConfirmationService extends LogicDeleteService<Confirmation> implements CheckingService {
|
||||||
private final ConfirmationRepository confirmationRepository;
|
private final ConfirmationRepository confirmationRepository;
|
||||||
private final CheckOrderService checkOrderService;
|
private final CheckOrderService checkOrderService;
|
||||||
private final ObjectMapper mapper;
|
private final ObjectMapper mapper;
|
||||||
|
|
||||||
public ConfirmationService(ConfirmationRepository confirmationRepository, UserService userService, CheckOrderService checkOrderService, Jackson2ObjectMapperBuilder builder) {
|
public ConfirmationService(ConfirmationRepository confirmationRepository, UserService userService, EntityManager entityManager, CheckOrderService checkOrderService, Jackson2ObjectMapperBuilder builder) {
|
||||||
super(confirmationRepository, userService);
|
super(confirmationRepository, userService, entityManager);
|
||||||
this.confirmationRepository = confirmationRepository;
|
this.confirmationRepository = confirmationRepository;
|
||||||
this.checkOrderService = checkOrderService;
|
this.checkOrderService = checkOrderService;
|
||||||
this.mapper = builder.build();
|
this.mapper = builder.build();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.eshore.gringotts.web.domain.service;
|
package com.eshore.gringotts.web.domain.service;
|
||||||
|
|
||||||
import com.eshore.gringotts.web.domain.base.service.SimpleServiceSupport;
|
import com.eshore.gringotts.web.domain.base.service.LogicDeleteService;
|
||||||
import com.eshore.gringotts.web.domain.entity.Authentication;
|
import com.eshore.gringotts.web.domain.entity.Authentication;
|
||||||
import com.eshore.gringotts.web.domain.entity.Authentication_;
|
import com.eshore.gringotts.web.domain.entity.Authentication_;
|
||||||
import com.eshore.gringotts.web.domain.entity.Confirmation;
|
import com.eshore.gringotts.web.domain.entity.Confirmation;
|
||||||
@@ -15,6 +15,7 @@ import com.eshore.gringotts.web.domain.repository.DataResourceRepository;
|
|||||||
import com.eshore.gringotts.web.domain.repository.ResourceFormatRepository;
|
import com.eshore.gringotts.web.domain.repository.ResourceFormatRepository;
|
||||||
import com.eshore.gringotts.web.domain.repository.ResourceTypeRepository;
|
import com.eshore.gringotts.web.domain.repository.ResourceTypeRepository;
|
||||||
import com.eshore.gringotts.web.helper.EntityHelper;
|
import com.eshore.gringotts.web.helper.EntityHelper;
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.criteria.CriteriaBuilder;
|
import javax.persistence.criteria.CriteriaBuilder;
|
||||||
import javax.persistence.criteria.CriteriaQuery;
|
import javax.persistence.criteria.CriteriaQuery;
|
||||||
import javax.persistence.criteria.Join;
|
import javax.persistence.criteria.Join;
|
||||||
@@ -34,14 +35,14 @@ import org.springframework.stereotype.Service;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class DataResourceService extends SimpleServiceSupport<DataResource> {
|
public class DataResourceService extends LogicDeleteService<DataResource> {
|
||||||
private final DataResourceRepository dataResourceRepository;
|
private final DataResourceRepository dataResourceRepository;
|
||||||
private final ResourceTypeRepository resourceTypeRepository;
|
private final ResourceTypeRepository resourceTypeRepository;
|
||||||
private final ResourceFormatRepository resourceFormatRepository;
|
private final ResourceFormatRepository resourceFormatRepository;
|
||||||
private final UserService userService;
|
private final UserService userService;
|
||||||
|
|
||||||
public DataResourceService(DataResourceRepository repository, ResourceTypeRepository resourceTypeRepository, ResourceFormatRepository resourceFormatRepository, UserService userService) {
|
public DataResourceService(DataResourceRepository repository, ResourceTypeRepository resourceTypeRepository, ResourceFormatRepository resourceFormatRepository, UserService userService, EntityManager entityManager) {
|
||||||
super(repository, userService);
|
super(repository, userService, entityManager);
|
||||||
this.dataResourceRepository = repository;
|
this.dataResourceRepository = repository;
|
||||||
this.resourceTypeRepository = resourceTypeRepository;
|
this.resourceTypeRepository = resourceTypeRepository;
|
||||||
this.resourceFormatRepository = resourceFormatRepository;
|
this.resourceFormatRepository = resourceFormatRepository;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class UserService {
|
|||||||
if (userRepository.count() == 0) {
|
if (userRepository.count() == 0) {
|
||||||
User user = new User();
|
User user = new User();
|
||||||
user.setUsername("administrator@eshore.com");
|
user.setUsername("administrator@eshore.com");
|
||||||
user.setPassword(encryptPassword("administrator"));
|
user.setPassword(encryptPassword("bLiN+,qAss,uo'nxoH_:d@HEdD*WdZWAudq$J'a$5Z#aS>K-*dWN5L-i<m:w/U,R"));
|
||||||
user.setRole(User.Role.ADMINISTRATOR);
|
user.setRole(User.Role.ADMINISTRATOR);
|
||||||
user.setState(User.State.NORMAL);
|
user.setState(User.State.NORMAL);
|
||||||
user.setCheckedUser(user);
|
user.setCheckedUser(user);
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ package com.eshore.gringotts.web.domain.service;
|
|||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.eshore.gringotts.web.domain.base.service.CheckingService;
|
import com.eshore.gringotts.web.domain.base.service.CheckingService;
|
||||||
import com.eshore.gringotts.web.domain.base.service.SimpleServiceSupport;
|
import com.eshore.gringotts.web.domain.base.service.LogicDeleteService;
|
||||||
import com.eshore.gringotts.web.domain.entity.CheckOrder;
|
import com.eshore.gringotts.web.domain.entity.CheckOrder;
|
||||||
import com.eshore.gringotts.web.domain.entity.User;
|
import com.eshore.gringotts.web.domain.entity.User;
|
||||||
import com.eshore.gringotts.web.domain.entity.Ware;
|
import com.eshore.gringotts.web.domain.entity.Ware;
|
||||||
import com.eshore.gringotts.web.domain.repository.WareRepository;
|
import com.eshore.gringotts.web.domain.repository.WareRepository;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.eclipse.collections.api.factory.Lists;
|
import org.eclipse.collections.api.factory.Lists;
|
||||||
@@ -24,13 +25,13 @@ import org.springframework.stereotype.Service;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service("com.eshore.gringotts.web.domain.service.WareService")
|
@Service("com.eshore.gringotts.web.domain.service.WareService")
|
||||||
public class WareService extends SimpleServiceSupport<Ware> implements CheckingService {
|
public class WareService extends LogicDeleteService<Ware> implements CheckingService {
|
||||||
private final WareRepository wareRepository;
|
private final WareRepository wareRepository;
|
||||||
private final CheckOrderService checkOrderService;
|
private final CheckOrderService checkOrderService;
|
||||||
private final ObjectMapper mapper;
|
private final ObjectMapper mapper;
|
||||||
|
|
||||||
public WareService(WareRepository repository, UserService userService, CheckOrderService checkOrderService, Jackson2ObjectMapperBuilder builder) {
|
public WareService(WareRepository repository, UserService userService, EntityManager entityManager, CheckOrderService checkOrderService, Jackson2ObjectMapperBuilder builder) {
|
||||||
super(repository, userService);
|
super(repository, userService, entityManager);
|
||||||
this.wareRepository = repository;
|
this.wareRepository = repository;
|
||||||
this.checkOrderService = checkOrderService;
|
this.checkOrderService = checkOrderService;
|
||||||
this.mapper = builder.build();
|
this.mapper = builder.build();
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ spring:
|
|||||||
profiles:
|
profiles:
|
||||||
include: common,metrics,encrypt
|
include: common,metrics,encrypt
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:h2:./database;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
|
url: jdbc:mysql://132.122.1.185:31000/gringotts
|
||||||
username: lanyuanxiaoyao
|
username: iap
|
||||||
password: lanyuanxiaoyao
|
password: SLvwP6@SM2J*SbUw_iap
|
||||||
driver-class-name: org.h2.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
jpa:
|
jpa:
|
||||||
generate-ddl: true
|
generate-ddl: true
|
||||||
show-sql: true
|
show-sql: true
|
||||||
@@ -39,7 +39,31 @@ logging:
|
|||||||
spring:
|
spring:
|
||||||
config:
|
config:
|
||||||
activate:
|
activate:
|
||||||
on-profile: macOS
|
on-profile: dev
|
||||||
|
datasource:
|
||||||
|
url: jdbc:h2:./database;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
|
||||||
|
username: lanyuanxiaoyao
|
||||||
|
password: lanyuanxiaoyao
|
||||||
|
driver-class-name: org.h2.Driver
|
||||||
|
|
||||||
|
---
|
||||||
|
spring:
|
||||||
|
config:
|
||||||
|
activate:
|
||||||
|
on-profile: build
|
||||||
|
datasource:
|
||||||
|
url: jdbc:mysql://132.122.1.185:31000/gringotts
|
||||||
|
username: iap
|
||||||
|
password: SLvwP6@SM2J*SbUw_iap
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
gringotts:
|
||||||
|
upload:
|
||||||
|
upload-path: /home/iap/gringotts/upload
|
||||||
|
---
|
||||||
|
spring:
|
||||||
|
config:
|
||||||
|
activate:
|
||||||
|
on-profile: macos
|
||||||
gringotts:
|
gringotts:
|
||||||
upload:
|
upload:
|
||||||
upload-path: /Users/lanyuanxiaoyao/Project/IdeaProjects/gringotts/gringotts-web/target/upload
|
upload-path: /Users/lanyuanxiaoyao/Project/IdeaProjects/gringotts/gringotts-web/target/upload
|
||||||
|
|||||||
Reference in New Issue
Block a user