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
|
||||
target/
|
||||
pom.xml.tag
|
||||
@@ -255,3 +252,7 @@ Network Trash Folder
|
||||
Temporary Items
|
||||
.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>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</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>
|
||||
<synchronize>true</synchronize>
|
||||
<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>
|
||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
export const information = {
|
||||
debug: false,
|
||||
// baseUrl: '',
|
||||
debug: true,
|
||||
baseUrl: 'http://127.0.0.1:20080',
|
||||
title: '可信供给中心',
|
||||
}
|
||||
@@ -17,8 +16,8 @@ export function useAmis(amisObject) {
|
||||
struct,
|
||||
{
|
||||
data: {
|
||||
debug: information.debug,
|
||||
base: information.baseUrl,
|
||||
debug: information.debug ?? false,
|
||||
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'
|
||||
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";
|
||||
|
||||
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,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
export * from './dialog-confirmation'
|
||||
export * from './dialog-authentication'
|
||||
|
||||
@@ -62,7 +62,8 @@ function detailForm(showCreatedUserAndModifiedUser = false) {
|
||||
},
|
||||
{
|
||||
visibleOn: "${resourceType === 'API'}",
|
||||
type: 'fieldSet',
|
||||
type: 'wrapper',
|
||||
size: 'none',
|
||||
body: [
|
||||
{
|
||||
type: 'input-text',
|
||||
@@ -87,7 +88,8 @@ function detailForm(showCreatedUserAndModifiedUser = false) {
|
||||
},
|
||||
{
|
||||
visibleOn: "${resourceType === 'FILE'}",
|
||||
type: 'fieldSet',
|
||||
type: 'wrapper',
|
||||
size: 'none',
|
||||
body: [
|
||||
formInputSingleFileStatic('file', '数据文件'),
|
||||
{
|
||||
@@ -105,7 +107,8 @@ function detailForm(showCreatedUserAndModifiedUser = false) {
|
||||
},
|
||||
{
|
||||
visibleOn: "${resourceType === 'DATABASE'}",
|
||||
type: 'fieldSet',
|
||||
type: 'wrapper',
|
||||
size: 'none',
|
||||
body: [
|
||||
{
|
||||
type: 'select',
|
||||
@@ -141,7 +144,8 @@ function detailForm(showCreatedUserAndModifiedUser = false) {
|
||||
},
|
||||
{
|
||||
visibleOn: "${resourceType === 'HDFS'}",
|
||||
type: 'fieldSet',
|
||||
type: 'wrapper',
|
||||
size: 'none',
|
||||
body: [
|
||||
formInputSingleFileStatic('coreSiteFile', 'core-site.xml'),
|
||||
{
|
||||
@@ -169,7 +173,8 @@ function detailForm(showCreatedUserAndModifiedUser = false) {
|
||||
},
|
||||
{
|
||||
visibleOn: "${resourceType === 'FTP'}",
|
||||
type: 'fieldSet',
|
||||
type: 'wrapper',
|
||||
size: 'none',
|
||||
body: [
|
||||
{
|
||||
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";
|
||||
|
||||
export function userChangePasswordDialog() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<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>
|
||||
<link href="/assets/sdk/antd.css" rel="stylesheet"/>
|
||||
<link href="/assets/sdk/helper.css" rel="stylesheet"/>
|
||||
@@ -20,6 +20,6 @@
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="/assets/sdk/sdk.js"></script>
|
||||
<script type="module" src="./main.js"></script>
|
||||
<script src="./main.js" type="module"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import './style.css'
|
||||
import {apiGet, useAmis} from '../../components/constants.js'
|
||||
import {userChangePasswordDialog} from "../../components/user/dialog-user-change-password.js";
|
||||
import {tabUser} from "./tab-user.js";
|
||||
@@ -60,9 +61,9 @@ useAmis(information => {
|
||||
tabs: [
|
||||
// tabOverview(),
|
||||
tabMarket(),
|
||||
tabData(),
|
||||
tabPermissions(),
|
||||
tabCheck(),
|
||||
tabData(),
|
||||
tabUser(),
|
||||
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";
|
||||
import {
|
||||
apiGet,
|
||||
arrayInCheck,
|
||||
arrayOutCheck,
|
||||
checkState,
|
||||
crudCommonOptions,
|
||||
@@ -15,8 +14,9 @@ import {
|
||||
timeField,
|
||||
userOnly
|
||||
} from "../../components/constants.js";
|
||||
import {wareAddDialog, wareDetailDialog, wareEditeDialog} from "../../components/ware/dialog-ware.js";
|
||||
|
||||
export function resourceList() {
|
||||
export function resourceList(showMode = false) {
|
||||
return {
|
||||
type: 'crud',
|
||||
api: apiGet('${base}/data_resource/list'),
|
||||
@@ -50,6 +50,7 @@ export function resourceList() {
|
||||
...resourceDetailDialog(),
|
||||
},
|
||||
{
|
||||
visibleOn: !showMode,
|
||||
type: 'dropdown-button',
|
||||
level: 'link',
|
||||
icon: 'fa fa-ellipsis-h',
|
||||
@@ -66,8 +67,8 @@ export function resourceList() {
|
||||
...resourceEditeDialog(),
|
||||
},
|
||||
{
|
||||
disabledOn: arrayInCheck([checkState.checking], 'confirmationState'),
|
||||
disabledTip: '审查中无法删除',
|
||||
disabledOn: arrayOutCheck([checkState.none, checkState.draft], 'confirmationState'),
|
||||
disabledTip: '审查或确权成功后无法删除',
|
||||
tooltipPlacement: 'bottom',
|
||||
type: 'action',
|
||||
label: "删除",
|
||||
@@ -89,6 +90,97 @@ export function tabData() {
|
||||
title: '数据资源',
|
||||
icon: 'fa fa-database',
|
||||
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,
|
||||
mappingField,
|
||||
operationField,
|
||||
permissionStateMapping,
|
||||
timeField
|
||||
} from "../../components/constants.js";
|
||||
import {apiGet, crudCommonOptions} from "../../components/constants.js";
|
||||
import {authenticationAddDialog} from "../../components/permission/dialog-permission.js";
|
||||
|
||||
export function tabMarket() {
|
||||
@@ -14,12 +6,6 @@ export function tabMarket() {
|
||||
title: '数据市场',
|
||||
icon: 'fa fa-store',
|
||||
reload: true,
|
||||
body: [
|
||||
{
|
||||
type: 'tabs',
|
||||
tabs: [
|
||||
{
|
||||
title: '公开数据',
|
||||
body: {
|
||||
type: 'crud',
|
||||
api: {
|
||||
@@ -39,19 +25,58 @@ export function tabMarket() {
|
||||
'reload',
|
||||
],
|
||||
mode: 'cards',
|
||||
columnsCount: 3,
|
||||
card: {
|
||||
header: {
|
||||
title: '${name}',
|
||||
subTitle: '${createdTime}',
|
||||
description: '${description}',
|
||||
avatar: '${icon}',
|
||||
avatarClassName: 'pull-left thumb-md avatar b-3x m-r'
|
||||
},
|
||||
body: '${TRUNCATE(description, 50)}',
|
||||
actions: [
|
||||
{
|
||||
type: 'action',
|
||||
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',
|
||||
@@ -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>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<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 REMOVE = "/remove/{id}";
|
||||
|
||||
private final SimpleServiceSupport<ENTITY> service;
|
||||
protected final SimpleServiceSupport<ENTITY> service;
|
||||
|
||||
public SimpleControllerSupport(SimpleServiceSupport<ENTITY> 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 javax.persistence.EntityManager;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.collections.api.list.ImmutableList;
|
||||
|
||||
/**
|
||||
* @author lanyuanxiaoyao
|
||||
@@ -28,16 +23,11 @@ public abstract class LogicDeleteService<ENTITY extends LogicDeleteEntity> exten
|
||||
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)
|
||||
@Override
|
||||
public void remove(Long id) {
|
||||
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.executeUpdate();
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ import org.eclipse.collections.api.set.ImmutableSet;
|
||||
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;
|
||||
|
||||
@@ -64,6 +64,18 @@ public abstract class SimpleServiceSupport<ENTITY extends SimpleEntity> implemen
|
||||
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
|
||||
public ImmutableList<ENTITY> list() throws Exception {
|
||||
return Lists.immutable.ofAll(repository.findAll(
|
||||
@@ -106,7 +118,7 @@ public abstract class SimpleServiceSupport<ENTITY extends SimpleEntity> implemen
|
||||
}
|
||||
|
||||
@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();
|
||||
if (ObjectUtil.isEmpty(queryable)) {
|
||||
return predicates.toImmutable();
|
||||
|
||||
@@ -174,18 +174,18 @@ public class DataResourceController extends SimpleControllerSupport<DataResource
|
||||
break;
|
||||
case JSON:
|
||||
JsonResourceFormat jsonFormat = (JsonResourceFormat) dataResource.getFormat();
|
||||
item.setJsonSchemaText(jsonFormat.getSchema());
|
||||
item.setJsonSchema(mapper.readValue(jsonFormat.getSchema(), Map.class));
|
||||
item.setJsonSchemaText(jsonFormat.getJsonSchema());
|
||||
item.setJsonSchema(mapper.readValue(jsonFormat.getJsonSchema(), Map.class));
|
||||
break;
|
||||
case JSON_LINE:
|
||||
JsonLineResourceFormat jsonLineFormat = (JsonLineResourceFormat) dataResource.getFormat();
|
||||
item.setJsonLineSchemaText(jsonLineFormat.getSchema());
|
||||
item.setJsonLineSchema(mapper.readValue(jsonLineFormat.getSchema(), Map.class));
|
||||
item.setJsonLineSchemaText(jsonLineFormat.getJsonSchema());
|
||||
item.setJsonLineSchema(mapper.readValue(jsonLineFormat.getJsonSchema(), Map.class));
|
||||
break;
|
||||
case CSV:
|
||||
CsvResourceFormat csvFormat = (CsvResourceFormat) dataResource.getFormat();
|
||||
item.setCsvSchemaText(csvFormat.getSchema());
|
||||
item.setCsvSchema(mapper.readValue(csvFormat.getSchema(), Map.class));
|
||||
item.setCsvSchemaText(csvFormat.getCsvSchema());
|
||||
item.setCsvSchema(mapper.readValue(csvFormat.getCsvSchema(), Map.class));
|
||||
break;
|
||||
}
|
||||
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 java.time.LocalDateTime;
|
||||
import java.util.Set;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.ConstraintMode;
|
||||
import javax.persistence.Entity;
|
||||
@@ -23,7 +22,6 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
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 = "modifiedUser"),
|
||||
})
|
||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "authentication" + " set deleted = true where id = ?")
|
||||
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
||||
public class Authentication extends CheckingNeededEntity {
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||
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))
|
||||
@ToString.Exclude
|
||||
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.LogicDeleteEntity;
|
||||
import java.util.Set;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.ConstraintMode;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EntityListeners;
|
||||
@@ -21,7 +20,6 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
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 = "modifiedUser"),
|
||||
})
|
||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "confirmation" + " set deleted = true where id = ?")
|
||||
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
||||
public class Confirmation extends CheckingNeededEntity {
|
||||
@OneToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||
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))
|
||||
@ToString.Exclude
|
||||
private Set<DataFile> evidences;
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
package com.eshore.gringotts.web.domain.entity;
|
||||
|
||||
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.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
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
|
||||
@DynamicUpdate
|
||||
@Table(name = Constants.TABLE_PREFIX + "data_file")
|
||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "data_file" + " set deleted = true where id = ?")
|
||||
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
||||
public class DataFile extends LogicDeleteEntity {
|
||||
public class DataFile extends SimpleEntity {
|
||||
private String filename;
|
||||
private Long size;
|
||||
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.type.ResourceType;
|
||||
import java.util.Set;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.ConstraintMode;
|
||||
import javax.persistence.Entity;
|
||||
@@ -22,7 +21,6 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
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 = "modifiedUser"),
|
||||
})
|
||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "data_resource" + " set deleted = true where id = ?")
|
||||
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
||||
public class DataResource extends LogicDeleteEntity {
|
||||
@Column(nullable = false)
|
||||
private String name;
|
||||
private String description;
|
||||
@OneToOne(cascade = CascadeType.REMOVE, fetch = FetchType.LAZY)
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||
@ToString.Exclude
|
||||
private ResourceType type;
|
||||
@OneToOne(cascade = CascadeType.REMOVE, fetch = FetchType.LAZY)
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||
@ToString.Exclude
|
||||
private ResourceFormat format;
|
||||
@@ -65,13 +62,13 @@ public class DataResource extends LogicDeleteEntity {
|
||||
@JoinColumn(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||
@ToString.Exclude
|
||||
private DataFile example;
|
||||
@OneToOne(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER, mappedBy = "target")
|
||||
@OneToOne(fetch = FetchType.EAGER, mappedBy = "target")
|
||||
@ToString.Exclude
|
||||
private Confirmation confirmation;
|
||||
@OneToMany(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER, mappedBy = "target")
|
||||
@OneToMany(fetch = FetchType.EAGER, mappedBy = "target")
|
||||
@ToString.Exclude
|
||||
private Set<Authentication> authentications;
|
||||
@OneToOne(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER, mappedBy = "resource")
|
||||
@OneToOne(fetch = FetchType.EAGER, mappedBy = "resource")
|
||||
@ToString.Exclude
|
||||
private Ware ware;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
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 = "modifiedUser"),
|
||||
})
|
||||
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "ware" + " set deleted = true where id = ?")
|
||||
@Where(clause = LogicDeleteEntity.LOGIC_DELETE_CLAUSE)
|
||||
public class Ware extends CheckingNeededEntity {
|
||||
@OneToOne(cascade = CascadeType.DETACH, fetch = FetchType.EAGER)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
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.Entity;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -9,8 +7,6 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
/**
|
||||
* CSV格式
|
||||
@@ -25,10 +21,8 @@ import org.hibernate.annotations.Where;
|
||||
@NoArgsConstructor
|
||||
@Entity
|
||||
@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 {
|
||||
private String schema;
|
||||
private String csvSchema;
|
||||
|
||||
@Override
|
||||
public Type getFormatType() {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
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.Entity;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -9,8 +7,6 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
/**
|
||||
* JSON line格式
|
||||
@@ -25,10 +21,8 @@ import org.hibernate.annotations.Where;
|
||||
@NoArgsConstructor
|
||||
@Entity
|
||||
@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 {
|
||||
private String schema;
|
||||
private String jsonSchema;
|
||||
|
||||
@Override
|
||||
public Type getFormatType() {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
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.Entity;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -9,8 +7,6 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
/**
|
||||
* 一个文件就是一个JSON
|
||||
@@ -25,10 +21,8 @@ import org.hibernate.annotations.Where;
|
||||
@NoArgsConstructor
|
||||
@Entity
|
||||
@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 {
|
||||
private String schema;
|
||||
private String jsonSchema;
|
||||
|
||||
@Override
|
||||
public Type getFormatType() {
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
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.Entity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
/**
|
||||
* 无格式,文件每行就是一份数据
|
||||
@@ -21,8 +17,6 @@ import org.hibernate.annotations.Where;
|
||||
@ToString
|
||||
@Entity
|
||||
@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 {
|
||||
@Override
|
||||
public Type getFormatType() {
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
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.Entity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
/**
|
||||
* 无格式,整个文件就是一份数据
|
||||
@@ -21,8 +17,6 @@ import org.hibernate.annotations.Where;
|
||||
@ToString
|
||||
@Entity
|
||||
@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 {
|
||||
@Override
|
||||
public Type getFormatType() {
|
||||
|
||||
@@ -9,8 +9,6 @@ import javax.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
/**
|
||||
* 资源格式
|
||||
@@ -24,8 +22,6 @@ import org.hibernate.annotations.Where;
|
||||
@Entity
|
||||
@Table(name = Constants.TABLE_PREFIX + "resource_format")
|
||||
@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 Type getFormatType();
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.eshore.gringotts.web.domain.entity.type;
|
||||
|
||||
import com.eshore.gringotts.core.Constants;
|
||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
@@ -10,8 +9,6 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -20,8 +17,6 @@ import org.hibernate.annotations.Where;
|
||||
@NoArgsConstructor
|
||||
@Entity
|
||||
@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 {
|
||||
@Column(nullable = false)
|
||||
private String url;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.eshore.gringotts.web.domain.entity.type;
|
||||
|
||||
import com.eshore.gringotts.core.Constants;
|
||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
@@ -12,8 +11,6 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -22,8 +19,6 @@ import org.hibernate.annotations.Where;
|
||||
@NoArgsConstructor
|
||||
@Entity
|
||||
@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 {
|
||||
@Column(nullable = false)
|
||||
private String jdbc;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.eshore.gringotts.web.domain.entity.type;
|
||||
|
||||
import com.eshore.gringotts.core.Constants;
|
||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
||||
import com.eshore.gringotts.web.domain.entity.DataFile;
|
||||
import javax.persistence.ConstraintMode;
|
||||
import javax.persistence.Entity;
|
||||
@@ -14,8 +13,6 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -24,8 +21,6 @@ import org.hibernate.annotations.Where;
|
||||
@NoArgsConstructor
|
||||
@Entity
|
||||
@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 {
|
||||
@OneToOne
|
||||
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.eshore.gringotts.web.domain.entity.type;
|
||||
|
||||
import com.eshore.gringotts.core.Constants;
|
||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
@@ -10,8 +9,6 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -20,8 +17,6 @@ import org.hibernate.annotations.Where;
|
||||
@NoArgsConstructor
|
||||
@Entity
|
||||
@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 {
|
||||
@Column(nullable = false)
|
||||
private String url;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.eshore.gringotts.web.domain.entity.type;
|
||||
|
||||
import com.eshore.gringotts.core.Constants;
|
||||
import com.eshore.gringotts.web.domain.base.entity.LogicDeleteIdOnlyEntity;
|
||||
import com.eshore.gringotts.web.domain.entity.DataFile;
|
||||
import javax.persistence.ConstraintMode;
|
||||
import javax.persistence.Entity;
|
||||
@@ -14,8 +13,6 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -24,8 +21,6 @@ import org.hibernate.annotations.Where;
|
||||
@NoArgsConstructor
|
||||
@Entity
|
||||
@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 {
|
||||
@OneToOne
|
||||
@JoinColumn(nullable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||
|
||||
@@ -9,8 +9,6 @@ import javax.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
import org.hibernate.annotations.Where;
|
||||
|
||||
/**
|
||||
* 资源类型
|
||||
@@ -24,8 +22,6 @@ import org.hibernate.annotations.Where;
|
||||
@Entity
|
||||
@Table(name = Constants.TABLE_PREFIX + "resource_type")
|
||||
@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 Type getResourceType();
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.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.Confirmation;
|
||||
@@ -13,6 +13,7 @@ import com.eshore.gringotts.web.domain.entity.User;
|
||||
import com.eshore.gringotts.web.domain.repository.ConfirmationRepository;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Join;
|
||||
@@ -34,13 +35,13 @@ import org.springframework.stereotype.Service;
|
||||
*/
|
||||
@Slf4j
|
||||
@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 CheckOrderService checkOrderService;
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
public ConfirmationService(ConfirmationRepository confirmationRepository, UserService userService, CheckOrderService checkOrderService, Jackson2ObjectMapperBuilder builder) {
|
||||
super(confirmationRepository, userService);
|
||||
public ConfirmationService(ConfirmationRepository confirmationRepository, UserService userService, EntityManager entityManager, CheckOrderService checkOrderService, Jackson2ObjectMapperBuilder builder) {
|
||||
super(confirmationRepository, userService, entityManager);
|
||||
this.confirmationRepository = confirmationRepository;
|
||||
this.checkOrderService = checkOrderService;
|
||||
this.mapper = builder.build();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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.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.ResourceTypeRepository;
|
||||
import com.eshore.gringotts.web.helper.EntityHelper;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Join;
|
||||
@@ -34,14 +35,14 @@ import org.springframework.stereotype.Service;
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class DataResourceService extends SimpleServiceSupport<DataResource> {
|
||||
public class DataResourceService extends LogicDeleteService<DataResource> {
|
||||
private final DataResourceRepository dataResourceRepository;
|
||||
private final ResourceTypeRepository resourceTypeRepository;
|
||||
private final ResourceFormatRepository resourceFormatRepository;
|
||||
private final UserService userService;
|
||||
|
||||
public DataResourceService(DataResourceRepository repository, ResourceTypeRepository resourceTypeRepository, ResourceFormatRepository resourceFormatRepository, UserService userService) {
|
||||
super(repository, userService);
|
||||
public DataResourceService(DataResourceRepository repository, ResourceTypeRepository resourceTypeRepository, ResourceFormatRepository resourceFormatRepository, UserService userService, EntityManager entityManager) {
|
||||
super(repository, userService, entityManager);
|
||||
this.dataResourceRepository = repository;
|
||||
this.resourceTypeRepository = resourceTypeRepository;
|
||||
this.resourceFormatRepository = resourceFormatRepository;
|
||||
|
||||
@@ -45,7 +45,7 @@ public class UserService {
|
||||
if (userRepository.count() == 0) {
|
||||
User user = new User();
|
||||
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.setState(User.State.NORMAL);
|
||||
user.setCheckedUser(user);
|
||||
|
||||
@@ -2,13 +2,14 @@ package com.eshore.gringotts.web.domain.service;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.User;
|
||||
import com.eshore.gringotts.web.domain.entity.Ware;
|
||||
import com.eshore.gringotts.web.domain.repository.WareRepository;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.transaction.Transactional;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.collections.api.factory.Lists;
|
||||
@@ -24,13 +25,13 @@ import org.springframework.stereotype.Service;
|
||||
*/
|
||||
@Slf4j
|
||||
@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 CheckOrderService checkOrderService;
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
public WareService(WareRepository repository, UserService userService, CheckOrderService checkOrderService, Jackson2ObjectMapperBuilder builder) {
|
||||
super(repository, userService);
|
||||
public WareService(WareRepository repository, UserService userService, EntityManager entityManager, CheckOrderService checkOrderService, Jackson2ObjectMapperBuilder builder) {
|
||||
super(repository, userService, entityManager);
|
||||
this.wareRepository = repository;
|
||||
this.checkOrderService = checkOrderService;
|
||||
this.mapper = builder.build();
|
||||
|
||||
@@ -6,10 +6,10 @@ spring:
|
||||
profiles:
|
||||
include: common,metrics,encrypt
|
||||
datasource:
|
||||
url: jdbc:h2:./database;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
|
||||
username: lanyuanxiaoyao
|
||||
password: lanyuanxiaoyao
|
||||
driver-class-name: org.h2.Driver
|
||||
url: jdbc:mysql://132.122.1.185:31000/gringotts
|
||||
username: iap
|
||||
password: SLvwP6@SM2J*SbUw_iap
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
jpa:
|
||||
generate-ddl: true
|
||||
show-sql: true
|
||||
@@ -39,7 +39,31 @@ logging:
|
||||
spring:
|
||||
config:
|
||||
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:
|
||||
upload:
|
||||
upload-path: /Users/lanyuanxiaoyao/Project/IdeaProjects/gringotts/gringotts-web/target/upload
|
||||
|
||||
Reference in New Issue
Block a user