Compare commits
No commits in common. "lab3" and "master" have entirely different histories.
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,7 +4,7 @@ build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
node_modules
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
|
@ -1,39 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<link href="node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="main.css"/>
|
||||
<title>LabWork1</title>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1 class="text-white mx-2">Добро пожаловать</h1>
|
||||
</header>
|
||||
<article>
|
||||
<div class="m-2">
|
||||
<input type="text" class="form-control my-2" id="number-1" aria-describedby="basic-addon3">
|
||||
<input type="text" class="form-control" id="number-2" aria-describedby="basic-addon3">
|
||||
<div class="my-2">
|
||||
<button id="sum" type="button" class="btn btn-dark">+</button>
|
||||
<button id="dif" type="button" class="btn btn-dark">-</button>
|
||||
<button id="com" type="button" class="btn btn-dark">*</button>
|
||||
<button id="div" type="button" class="btn btn-dark">/</button>
|
||||
</div>
|
||||
<div>
|
||||
<select id="SelectId">
|
||||
<option value="int">int</option>
|
||||
<option value="string">str</option>
|
||||
</select>
|
||||
</div>
|
||||
<p id="Conclusion">Вывод:</p>
|
||||
</div>
|
||||
</article>
|
||||
<footer><p class="text-white mx-2">Просто сайтик</p></footer>
|
||||
<script src="Script.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,35 +0,0 @@
|
||||
let number1_input=document.getElementById("number-1");
|
||||
let number2_input=document.getElementById("number-2");
|
||||
let button_sum=document.getElementById("sum");
|
||||
let button_dif=document.getElementById("dif");
|
||||
let button_com=document.getElementById("com");
|
||||
let button_div=document.getElementById("div");
|
||||
let Conclusion=document.getElementById("Conclusion");
|
||||
let Select=document.getElementById("SelectId")
|
||||
|
||||
button_sum.onclick=function(event){
|
||||
executeRequest("sum");
|
||||
};
|
||||
button_dif.onclick=function(event){
|
||||
executeRequest("dif")
|
||||
};
|
||||
button_com.onclick=function(event){
|
||||
executeRequest("com")
|
||||
};
|
||||
button_div.onclick=function(event){
|
||||
executeRequest("div")
|
||||
};
|
||||
|
||||
function executeRequest(operationAddress) {
|
||||
let numOne = number1_input.value;
|
||||
let numTwo = number2_input.value;
|
||||
let selecttype=Select.value;
|
||||
console.log(`http://localhost:8080/${operationAddress}?firstObj=${numOne}&secondObj=${numTwo}&type=${selecttype}`)
|
||||
fetch(`http://localhost:8080/${operationAddress}?firstObj=${numOne}&secondObj=${numTwo}&type=${selecttype}`)
|
||||
.then((response) => {
|
||||
return response.text()
|
||||
})
|
||||
.then((data) => {
|
||||
Conclusion.innerHTML="Вывод: " + data;
|
||||
});
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
html
|
||||
{
|
||||
min-height: 100vh;
|
||||
}
|
||||
body
|
||||
{
|
||||
display: grid;
|
||||
grid-template-rows:auto 1fr auto;
|
||||
min-height: 100vh;
|
||||
}
|
||||
header
|
||||
{
|
||||
background-color: black;
|
||||
}
|
||||
footer
|
||||
{
|
||||
background-color: black;
|
||||
}
|
803
FrontEnd/package-lock.json
generated
803
FrontEnd/package-lock.json
generated
@ -1,803 +0,0 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "frontend",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"bootstrap": "^5.2.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"http-server": "^14.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@popperjs/core": {
|
||||
"version": "2.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz",
|
||||
"integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==",
|
||||
"peer": true,
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/popperjs"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/async": {
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz",
|
||||
"integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.14"
|
||||
}
|
||||
},
|
||||
"node_modules/basic-auth": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
|
||||
"integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"safe-buffer": "5.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/bootstrap": {
|
||||
"version": "5.2.3",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.3.tgz",
|
||||
"integrity": "sha512-cEKPM+fwb3cT8NzQZYEu4HilJ3anCrWqh3CHAok1p9jXqMPsPTBhU25fBckEJHJ/p+tTxTFTsFQGM+gaHpi3QQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/twbs"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/bootstrap"
|
||||
}
|
||||
],
|
||||
"peerDependencies": {
|
||||
"@popperjs/core": "^2.11.6"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
|
||||
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1",
|
||||
"get-intrinsic": "^1.0.2"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-name": "~1.1.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/corser": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz",
|
||||
"integrity": "sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
|
||||
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/eventemitter3": {
|
||||
"version": "4.0.7",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
|
||||
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.2",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
|
||||
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"debug": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz",
|
||||
"integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1",
|
||||
"has": "^1.0.3",
|
||||
"has-symbols": "^1.0.3"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
|
||||
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
|
||||
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/he": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
|
||||
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"he": "bin/he"
|
||||
}
|
||||
},
|
||||
"node_modules/html-encoding-sniffer": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz",
|
||||
"integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"whatwg-encoding": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/http-proxy": {
|
||||
"version": "1.18.1",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
|
||||
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"eventemitter3": "^4.0.0",
|
||||
"follow-redirects": "^1.0.0",
|
||||
"requires-port": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/http-server": {
|
||||
"version": "14.1.1",
|
||||
"resolved": "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz",
|
||||
"integrity": "sha512-+cbxadF40UXd9T01zUHgA+rlo2Bg1Srer4+B4NwIHdaGxAGGv59nYRnGGDJ9LBk7alpS0US+J+bLLdQOOkJq4A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"basic-auth": "^2.0.1",
|
||||
"chalk": "^4.1.2",
|
||||
"corser": "^2.0.1",
|
||||
"he": "^1.2.0",
|
||||
"html-encoding-sniffer": "^3.0.0",
|
||||
"http-proxy": "^1.18.1",
|
||||
"mime": "^1.6.0",
|
||||
"minimist": "^1.2.6",
|
||||
"opener": "^1.5.1",
|
||||
"portfinder": "^1.0.28",
|
||||
"secure-compare": "3.0.1",
|
||||
"union": "~0.5.0",
|
||||
"url-join": "^4.0.1"
|
||||
},
|
||||
"bin": {
|
||||
"http-server": "bin/http-server"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/mime": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
||||
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"mime": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/minimist": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
||||
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
||||
"dev": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/mkdirp": {
|
||||
"version": "0.5.6",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
|
||||
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.6"
|
||||
},
|
||||
"bin": {
|
||||
"mkdirp": "bin/cmd.js"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.12.3",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz",
|
||||
"integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==",
|
||||
"dev": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/opener": {
|
||||
"version": "1.5.2",
|
||||
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
|
||||
"integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"opener": "bin/opener-bin.js"
|
||||
}
|
||||
},
|
||||
"node_modules/portfinder": {
|
||||
"version": "1.0.32",
|
||||
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz",
|
||||
"integrity": "sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"async": "^2.6.4",
|
||||
"debug": "^3.2.7",
|
||||
"mkdirp": "^0.5.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.11.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
|
||||
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"side-channel": "^1.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/requires-port": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/secure-compare": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz",
|
||||
"integrity": "sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
|
||||
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.0",
|
||||
"get-intrinsic": "^1.0.2",
|
||||
"object-inspect": "^1.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/supports-color": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"has-flag": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/union": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz",
|
||||
"integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"qs": "^6.4.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/url-join": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz",
|
||||
"integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/whatwg-encoding": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz",
|
||||
"integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"iconv-lite": "0.6.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@popperjs/core": {
|
||||
"version": "2.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz",
|
||||
"integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==",
|
||||
"peer": true
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-convert": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"async": {
|
||||
"version": "2.6.4",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz",
|
||||
"integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lodash": "^4.17.14"
|
||||
}
|
||||
},
|
||||
"basic-auth": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
|
||||
"integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "5.1.2"
|
||||
}
|
||||
},
|
||||
"bootstrap": {
|
||||
"version": "5.2.3",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.3.tgz",
|
||||
"integrity": "sha512-cEKPM+fwb3cT8NzQZYEu4HilJ3anCrWqh3CHAok1p9jXqMPsPTBhU25fBckEJHJ/p+tTxTFTsFQGM+gaHpi3QQ==",
|
||||
"requires": {}
|
||||
},
|
||||
"call-bind": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
|
||||
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"function-bind": "^1.1.1",
|
||||
"get-intrinsic": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-name": "~1.1.4"
|
||||
}
|
||||
},
|
||||
"color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||
"dev": true
|
||||
},
|
||||
"corser": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz",
|
||||
"integrity": "sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ==",
|
||||
"dev": true
|
||||
},
|
||||
"debug": {
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
|
||||
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"eventemitter3": {
|
||||
"version": "4.0.7",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
|
||||
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
|
||||
"dev": true
|
||||
},
|
||||
"follow-redirects": {
|
||||
"version": "1.15.2",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
|
||||
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
|
||||
"dev": true
|
||||
},
|
||||
"function-bind": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
|
||||
"dev": true
|
||||
},
|
||||
"get-intrinsic": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz",
|
||||
"integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"function-bind": "^1.1.1",
|
||||
"has": "^1.0.3",
|
||||
"has-symbols": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"has": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
|
||||
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"function-bind": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"dev": true
|
||||
},
|
||||
"has-symbols": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
|
||||
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
|
||||
"dev": true
|
||||
},
|
||||
"he": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
|
||||
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
|
||||
"dev": true
|
||||
},
|
||||
"html-encoding-sniffer": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz",
|
||||
"integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"whatwg-encoding": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"http-proxy": {
|
||||
"version": "1.18.1",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
|
||||
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"eventemitter3": "^4.0.0",
|
||||
"follow-redirects": "^1.0.0",
|
||||
"requires-port": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"http-server": {
|
||||
"version": "14.1.1",
|
||||
"resolved": "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz",
|
||||
"integrity": "sha512-+cbxadF40UXd9T01zUHgA+rlo2Bg1Srer4+B4NwIHdaGxAGGv59nYRnGGDJ9LBk7alpS0US+J+bLLdQOOkJq4A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"basic-auth": "^2.0.1",
|
||||
"chalk": "^4.1.2",
|
||||
"corser": "^2.0.1",
|
||||
"he": "^1.2.0",
|
||||
"html-encoding-sniffer": "^3.0.0",
|
||||
"http-proxy": "^1.18.1",
|
||||
"mime": "^1.6.0",
|
||||
"minimist": "^1.2.6",
|
||||
"opener": "^1.5.1",
|
||||
"portfinder": "^1.0.28",
|
||||
"secure-compare": "3.0.1",
|
||||
"union": "~0.5.0",
|
||||
"url-join": "^4.0.1"
|
||||
}
|
||||
},
|
||||
"iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"dev": true
|
||||
},
|
||||
"mime": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
||||
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
|
||||
"dev": true
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
||||
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
||||
"dev": true
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.6",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
|
||||
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "^1.2.6"
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"dev": true
|
||||
},
|
||||
"object-inspect": {
|
||||
"version": "1.12.3",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz",
|
||||
"integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==",
|
||||
"dev": true
|
||||
},
|
||||
"opener": {
|
||||
"version": "1.5.2",
|
||||
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
|
||||
"integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==",
|
||||
"dev": true
|
||||
},
|
||||
"portfinder": {
|
||||
"version": "1.0.32",
|
||||
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz",
|
||||
"integrity": "sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"async": "^2.6.4",
|
||||
"debug": "^3.2.7",
|
||||
"mkdirp": "^0.5.6"
|
||||
}
|
||||
},
|
||||
"qs": {
|
||||
"version": "6.11.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
|
||||
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"side-channel": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"requires-port": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
|
||||
"dev": true
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"dev": true
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"dev": true
|
||||
},
|
||||
"secure-compare": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz",
|
||||
"integrity": "sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw==",
|
||||
"dev": true
|
||||
},
|
||||
"side-channel": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
|
||||
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"call-bind": "^1.0.0",
|
||||
"get-intrinsic": "^1.0.2",
|
||||
"object-inspect": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"union": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz",
|
||||
"integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"qs": "^6.4.0"
|
||||
}
|
||||
},
|
||||
"url-join": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz",
|
||||
"integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==",
|
||||
"dev": true
|
||||
},
|
||||
"whatwg-encoding": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz",
|
||||
"integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"iconv-lite": "0.6.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "http-server -p 3000 ./",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"http-server":"^14.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"bootstrap":"^5.2.3"
|
||||
}
|
||||
}
|
@ -1,11 +1,10 @@
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.0.2'
|
||||
id 'io.spring.dependency-management' version '1.1.0'
|
||||
}
|
||||
|
||||
group = 'np'
|
||||
group = 'ru.ulstu.is'
|
||||
version = '0.0.1-SNAPSHOT'
|
||||
sourceCompatibility = '17'
|
||||
|
||||
@ -15,13 +14,9 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
implementation 'com.h2database:h2:2.1.210'
|
||||
implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.6.5'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
}
|
||||
|
||||
tasks.named('test') {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
}
|
||||
|
BIN
data.mv.db
BIN
data.mv.db
Binary file not shown.
128
data.trace.db
128
data.trace.db
@ -1,128 +0,0 @@
|
||||
2023-03-27 16:52:44 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLSyntaxErrorException: Синтаксическая ошибка в выражении SQL "create table [*]user (id bigint not null, email varchar(255), first_name varchar(255), last_name varchar(255), primary key (id))"; ожидалось "identifier"
|
||||
Syntax error in SQL statement "create table [*]user (id bigint not null, email varchar(255), first_name varchar(255), last_name varchar(255), primary key (id))"; expected "identifier"; SQL statement:
|
||||
create table user (id bigint not null, email varchar(255), first_name varchar(255), last_name varchar(255), primary key (id)) [42001-210]
|
||||
2023-03-27 16:52:44 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLSyntaxErrorException: Синтаксическая ошибка в выражении SQL "alter table if exists comment add constraint FK8kcum44fvpupyw6f5baccx25c foreign key (user_id) references [*]user"; ожидалось "identifier"
|
||||
Syntax error in SQL statement "alter table if exists comment add constraint FK8kcum44fvpupyw6f5baccx25c foreign key (user_id) references [*]user"; expected "identifier"; SQL statement:
|
||||
alter table if exists comment add constraint FK8kcum44fvpupyw6f5baccx25c foreign key (user_id) references user [42001-210]
|
||||
2023-03-27 16:52:44 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLSyntaxErrorException: Синтаксическая ошибка в выражении SQL "alter table if exists post add constraint FK72mt33dhhs48hf9gcqrq4fxte foreign key (user_id) references [*]user"; ожидалось "identifier"
|
||||
Syntax error in SQL statement "alter table if exists post add constraint FK72mt33dhhs48hf9gcqrq4fxte foreign key (user_id) references [*]user"; expected "identifier"; SQL statement:
|
||||
alter table if exists post add constraint FK72mt33dhhs48hf9gcqrq4fxte foreign key (user_id) references user [42001-210]
|
||||
2023-03-27 21:45:28 database: wrong user or password; user: "SA"
|
||||
org.h2.message.DbException: Неверное имя пользователя или пароль
|
||||
Wrong user name or password [28000-210]
|
||||
at org.h2.message.DbException.get(DbException.java:227)
|
||||
at org.h2.message.DbException.get(DbException.java:203)
|
||||
at org.h2.message.DbException.get(DbException.java:192)
|
||||
at org.h2.engine.Engine.openSession(Engine.java:154)
|
||||
at org.h2.engine.Engine.openSession(Engine.java:222)
|
||||
at org.h2.engine.Engine.createSession(Engine.java:201)
|
||||
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:338)
|
||||
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:122)
|
||||
at org.h2.util.JdbcUtils.getConnection(JdbcUtils.java:288)
|
||||
at org.h2.server.web.WebServer.getConnection(WebServer.java:807)
|
||||
at org.h2.server.web.WebApp.login(WebApp.java:1033)
|
||||
at org.h2.server.web.WebApp.process(WebApp.java:226)
|
||||
at org.h2.server.web.WebApp.processRequest(WebApp.java:176)
|
||||
at org.h2.server.web.JakartaWebServlet.doGet(JakartaWebServlet.java:129)
|
||||
at org.h2.server.web.JakartaWebServlet.doPost(JakartaWebServlet.java:166)
|
||||
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:731)
|
||||
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:814)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:223)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
|
||||
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
|
||||
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
|
||||
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
|
||||
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
|
||||
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177)
|
||||
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
|
||||
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
|
||||
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:119)
|
||||
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
|
||||
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
|
||||
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
|
||||
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:400)
|
||||
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
|
||||
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:859)
|
||||
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1734)
|
||||
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
|
||||
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
|
||||
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
|
||||
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
|
||||
at java.base/java.lang.Thread.run(Thread.java:833)
|
||||
Caused by: org.h2.jdbc.JdbcSQLInvalidAuthorizationSpecException: Неверное имя пользователя или пароль
|
||||
Wrong user name or password [28000-210]
|
||||
at org.h2.message.DbException.getJdbcSQLException(DbException.java:529)
|
||||
at org.h2.message.DbException.getJdbcSQLException(DbException.java:496)
|
||||
... 50 more
|
||||
2023-03-27 21:45:50 database: wrong user or password; user: "SA"
|
||||
org.h2.message.DbException: Неверное имя пользователя или пароль
|
||||
Wrong user name or password [28000-210]
|
||||
at org.h2.message.DbException.get(DbException.java:227)
|
||||
at org.h2.message.DbException.get(DbException.java:203)
|
||||
at org.h2.message.DbException.get(DbException.java:192)
|
||||
at org.h2.engine.Engine.openSession(Engine.java:154)
|
||||
at org.h2.engine.Engine.openSession(Engine.java:222)
|
||||
at org.h2.engine.Engine.createSession(Engine.java:201)
|
||||
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:338)
|
||||
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:122)
|
||||
at org.h2.util.JdbcUtils.getConnection(JdbcUtils.java:288)
|
||||
at org.h2.server.web.WebServer.getConnection(WebServer.java:807)
|
||||
at org.h2.server.web.WebApp.login(WebApp.java:1033)
|
||||
at org.h2.server.web.WebApp.process(WebApp.java:226)
|
||||
at org.h2.server.web.WebApp.processRequest(WebApp.java:176)
|
||||
at org.h2.server.web.JakartaWebServlet.doGet(JakartaWebServlet.java:129)
|
||||
at org.h2.server.web.JakartaWebServlet.doPost(JakartaWebServlet.java:166)
|
||||
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:731)
|
||||
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:814)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:223)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
|
||||
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
|
||||
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
|
||||
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
|
||||
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
|
||||
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
|
||||
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
|
||||
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177)
|
||||
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
|
||||
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
|
||||
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:119)
|
||||
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
|
||||
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
|
||||
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
|
||||
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:400)
|
||||
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
|
||||
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:859)
|
||||
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1734)
|
||||
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
|
||||
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
|
||||
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
|
||||
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
|
||||
at java.base/java.lang.Thread.run(Thread.java:833)
|
||||
Caused by: org.h2.jdbc.JdbcSQLInvalidAuthorizationSpecException: Неверное имя пользователя или пароль
|
||||
Wrong user name or password [28000-210]
|
||||
at org.h2.message.DbException.getJdbcSQLException(DbException.java:529)
|
||||
at org.h2.message.DbException.getJdbcSQLException(DbException.java:496)
|
||||
... 50 more
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,79 +0,0 @@
|
||||
package ru.ulstu.is.sbapp.Comment.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import ru.ulstu.is.sbapp.Post.model.Post;
|
||||
import ru.ulstu.is.sbapp.User.model.User;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
public class Comment {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private String Text;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER,cascade = CascadeType.MERGE)
|
||||
private Post post;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER,cascade = CascadeType.MERGE)
|
||||
private User user;
|
||||
|
||||
public Comment()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Comment(String text)
|
||||
{
|
||||
this.Text=text;
|
||||
}
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public String getText() {return Text;}
|
||||
public void setText(String text){this.Text=text;}
|
||||
public User getUser()
|
||||
{
|
||||
return user;
|
||||
}
|
||||
public Post getPost()
|
||||
{
|
||||
return post;
|
||||
}
|
||||
public void setPost(Post post, User user){
|
||||
if(post!=null)
|
||||
{
|
||||
post.getComments().add(this);
|
||||
this.post = post;
|
||||
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Comment comment = (Comment) o;
|
||||
return Objects.equals(id, comment.id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Comment{" +
|
||||
"id=" + id +
|
||||
", Text='" + Text + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
package ru.ulstu.is.sbapp.Comment.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
import org.springframework.util.StringUtils;
|
||||
import ru.ulstu.is.sbapp.Comment.model.Comment;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CommentService {
|
||||
@PersistenceContext
|
||||
private EntityManager em;
|
||||
|
||||
@Transactional
|
||||
public Comment addComment(String Text) {
|
||||
if (!StringUtils.hasText(Text)) {
|
||||
throw new IllegalArgumentException("TEXT is null or empty");
|
||||
}
|
||||
final Comment comment = new Comment(Text);
|
||||
em.persist(comment);
|
||||
return comment;
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public Comment findComment(Long id) {
|
||||
final Comment comment = em.find(Comment.class, id);
|
||||
if (comment == null) {
|
||||
throw new EntityNotFoundException(String.format("Comment with id [%s] is not found", id));
|
||||
}
|
||||
return comment;
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public List<Comment> findAllComments() {
|
||||
return em.createQuery("select c from Comment c", Comment.class)
|
||||
.getResultList();
|
||||
}
|
||||
@Transactional
|
||||
public Comment updateComment(Long id,String Text) {
|
||||
final Comment currentComment = findComment(id);
|
||||
currentComment.setText(Text);
|
||||
return em.merge(currentComment);
|
||||
}
|
||||
@Transactional
|
||||
public Comment deleteComment(Long id) {
|
||||
final Comment currentComment = findComment(id);
|
||||
em.remove(currentComment);
|
||||
return currentComment;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteAllComments() {
|
||||
em.createQuery("delete from Comment").executeUpdate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
package ru.ulstu.is.sbapp.Post.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import ru.ulstu.is.sbapp.Comment.model.Comment;
|
||||
import ru.ulstu.is.sbapp.User.model.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
public class Post {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@Column
|
||||
private String Heading;
|
||||
|
||||
private String Content;
|
||||
|
||||
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER,cascade = CascadeType.MERGE)
|
||||
private User user;
|
||||
|
||||
@OneToMany(mappedBy = "post",fetch = FetchType.EAGER,cascade = CascadeType.MERGE)
|
||||
private List<Comment> comments=new ArrayList<>();
|
||||
|
||||
public Post(){}
|
||||
|
||||
public Post(String Heading, String Content)
|
||||
{
|
||||
this.Heading = Heading;
|
||||
this.Content = Content;
|
||||
}
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public String getHeading()
|
||||
{
|
||||
return Heading;
|
||||
}
|
||||
public String getContent()
|
||||
{
|
||||
return Content;
|
||||
}
|
||||
public void setHeading(String Heading){
|
||||
this.Heading =Heading;
|
||||
}
|
||||
public void setContent(String Content)
|
||||
{
|
||||
this.Content = Content;
|
||||
}
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
public User getUser()
|
||||
{
|
||||
return user;
|
||||
}
|
||||
|
||||
|
||||
public void deleteUser() {
|
||||
this.user = null;
|
||||
}
|
||||
public List<Comment> getComments()
|
||||
{
|
||||
return comments;
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Post post = (Post) o;
|
||||
return Objects.equals(id, post.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Post{" +
|
||||
"id=" + id +
|
||||
", Heading='" + Heading + '\'' +
|
||||
", Content ='" + Content + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
package ru.ulstu.is.sbapp.Post.service;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import ru.ulstu.is.sbapp.Comment.model.Comment;
|
||||
import ru.ulstu.is.sbapp.Post.model.Post;
|
||||
import ru.ulstu.is.sbapp.User.model.User;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PostService {
|
||||
@PersistenceContext
|
||||
private EntityManager em;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PostService.class);
|
||||
@Transactional
|
||||
public Post addPost(String Heading, String Content) {
|
||||
if (!StringUtils.hasText(Heading) || !StringUtils.hasText(Content) ) {
|
||||
throw new IllegalArgumentException("Post info is null or empty");
|
||||
}
|
||||
final Post post = new Post(Heading,Content);
|
||||
em.persist(post);
|
||||
return post;
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public Post findPost(Long id) {
|
||||
final Post post = em.find(Post.class, id);
|
||||
if (post == null) {
|
||||
throw new EntityNotFoundException(String.format("Post with id [%s] is not found", id));
|
||||
}
|
||||
return post;
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public List<Post> findAllPosts() {
|
||||
return em.createQuery("select p from Post p", Post.class)
|
||||
.getResultList();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Post updatePost(Long id, String Heading, String Content) {
|
||||
if (!StringUtils.hasText(Heading) || !StringUtils.hasText(Content) ) {
|
||||
throw new IllegalArgumentException("Post info is null or empty");
|
||||
}
|
||||
final Post currentPost = findPost(id);
|
||||
currentPost.setHeading(Heading);
|
||||
currentPost.setContent(Content);
|
||||
return em.merge(currentPost);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Post deletePost(Long id) {
|
||||
final Post currentPost = findPost(id);
|
||||
em.createQuery("Delete from Comment where post.id = "+id).executeUpdate();
|
||||
em.remove(currentPost);
|
||||
return currentPost;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteAllPosts() {
|
||||
em.createQuery("delete from Comment").executeUpdate();
|
||||
em.createQuery("delete from Post").executeUpdate();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Comment addCommentToPost(Long id, User user, String text){
|
||||
final Post post = findPost(id);
|
||||
if(post == null){
|
||||
throw new IllegalArgumentException("Post with id " + id + " not found");
|
||||
}
|
||||
Comment comment=new Comment(text);
|
||||
comment.setPost(post, em.find(User.class, user.getId()));
|
||||
return em.merge(comment);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void removeCommentFromPost(Long id, Comment comment){
|
||||
final Post post = findPost(id);
|
||||
log.info(post.toString());
|
||||
post.getComments().remove(comment);
|
||||
em.merge(post);
|
||||
comment.setPost(null, null);
|
||||
em.createQuery("Delete from Comment where Id = "+comment.getId()).executeUpdate();
|
||||
}
|
||||
}
|
@ -2,10 +2,20 @@ package ru.ulstu.is.sbapp;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@SpringBootApplication
|
||||
@RestController
|
||||
public class SbappApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SbappApplication.class, args);
|
||||
}
|
||||
@GetMapping("/String")
|
||||
public String Vvod(@RequestParam(value = "str", defaultValue = "none") String str) {
|
||||
return String.format("Вы ввели %s!", str);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,103 +0,0 @@
|
||||
package ru.ulstu.is.sbapp.User.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import ru.ulstu.is.sbapp.Comment.model.Comment;
|
||||
import ru.ulstu.is.sbapp.Post.model.Post;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name="tab_user")
|
||||
public class User {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
@Column()
|
||||
private String firstName;
|
||||
private String lastName;
|
||||
|
||||
private String email;
|
||||
|
||||
@OneToMany(mappedBy ="user",cascade = CascadeType.MERGE,fetch = FetchType.EAGER)
|
||||
private List<Post> posts =new ArrayList<>();
|
||||
|
||||
@OneToMany(mappedBy ="user",cascade = CascadeType.MERGE,fetch = FetchType.EAGER)
|
||||
private List<Comment> comments =new ArrayList<>();
|
||||
|
||||
public User() {
|
||||
}
|
||||
|
||||
public User(String firstName, String lastName, String email) {
|
||||
this.firstName = firstName;
|
||||
this.lastName = lastName;
|
||||
this.email=email;
|
||||
}
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
public List<Post> getPosts()
|
||||
{
|
||||
return posts;
|
||||
}
|
||||
public List<Comment> getComments()
|
||||
{
|
||||
return comments;
|
||||
}
|
||||
public void addNewPost(Post post) {
|
||||
posts.add(post);
|
||||
post.setUser(this);
|
||||
}
|
||||
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
public void setEmail(String email){
|
||||
this.email=email;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
User user = (User) o;
|
||||
return Objects.equals(id, user.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Client{" +
|
||||
"id=" + id +
|
||||
", firstName='" + firstName + '\'' +
|
||||
", lastName='" + lastName + '\'' +
|
||||
", email='" + email + '\'' +
|
||||
", posts=" + posts +'\''+
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
package ru.ulstu.is.sbapp.User.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import ru.ulstu.is.sbapp.Post.model.Post;
|
||||
import ru.ulstu.is.sbapp.User.model.User;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
import ru.ulstu.is.sbapp.Comment.service.CommentService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class UserService {
|
||||
@PersistenceContext
|
||||
private EntityManager em;
|
||||
|
||||
@Autowired
|
||||
CommentService commentService;
|
||||
|
||||
@Transactional
|
||||
public User addUser(String firstName, String lastName, String email) {
|
||||
if (!StringUtils.hasText(firstName) || !StringUtils.hasText(lastName) || !StringUtils.hasText(email)) {
|
||||
throw new IllegalArgumentException("Client info is null or empty");
|
||||
}
|
||||
final User user = new User(firstName, lastName, email);
|
||||
em.persist(user);
|
||||
return user;
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public User findUser(Long id) {
|
||||
final User user = em.find(User.class, id);
|
||||
if (user == null) {
|
||||
throw new EntityNotFoundException(String.format("User with id [%s] is not found", id));
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public List<User> findAllUsers() {
|
||||
return em.createQuery("select u from User u", User.class)
|
||||
.getResultList();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public User updateUser(Long id, String firstName, String lastName, String email) {
|
||||
if (!StringUtils.hasText(firstName) || !StringUtils.hasText(lastName) || !StringUtils.hasText(email)) {
|
||||
throw new IllegalArgumentException("User info is null or empty");
|
||||
}
|
||||
final User currentUser = findUser(id);
|
||||
currentUser.setFirstName(firstName);
|
||||
currentUser.setLastName(lastName);
|
||||
currentUser.setEmail(email);
|
||||
return em.merge(currentUser);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public User deleteUser(Long id) {
|
||||
final User currentUser = findUser(id);
|
||||
em.createQuery("Delete from Post Where user.id = " + id).executeUpdate();
|
||||
em.createQuery("Delete from Comment Where user.id = " + id).executeUpdate();
|
||||
em.remove(currentUser);
|
||||
return currentUser;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteAllUsers() {
|
||||
em.createQuery("Delete from Post").executeUpdate();
|
||||
em.createQuery("Delete from Comment").executeUpdate();
|
||||
em.createQuery("delete from User").executeUpdate();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Post addNewPost(Long id, String Heading, String Content) {
|
||||
User currentUser = findUser(id);
|
||||
Post post = new Post(Heading, Content);
|
||||
post.setUser(currentUser);
|
||||
return em.merge(post);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deletePost(Long id, Post post) {
|
||||
em.createQuery("Delete Comment where post.Id = " + post.getId()).executeUpdate();
|
||||
em.createQuery("Delete from Post where Id = " + post.getId()).executeUpdate();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public List<Object[]> SelectCommentByText(String Text) {
|
||||
return em.createQuery("SELECT u.email,p.Heading,c.Text FROM User u " +
|
||||
"JOIN u.posts p JOIN p.comments c WHERE c.Text LIKE :texty",Object[].class)
|
||||
.setParameter("texty",Text)
|
||||
.getResultList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
package ru.ulstu.is.sbapp.speaker.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import ru.ulstu.is.sbapp.speaker.service.MethodService;
|
||||
|
||||
@RestController
|
||||
public class UserController {
|
||||
private final MethodService methodService;
|
||||
public UserController(MethodService methodService)
|
||||
{
|
||||
this.methodService=methodService;
|
||||
}
|
||||
|
||||
@GetMapping("/sum")
|
||||
public String sum(@RequestParam(value = "firstObj",defaultValue = "0") String firstObj,
|
||||
@RequestParam(value = "secondObj",defaultValue = "0") String secondObj,
|
||||
@RequestParam(value = "type",defaultValue = "int")String type)
|
||||
{
|
||||
Object a = firstObj;
|
||||
Object b = secondObj;
|
||||
return methodService.Sum(a,b,type);
|
||||
}
|
||||
@GetMapping("/dif")
|
||||
public String dif(@RequestParam(value = "firstObj",defaultValue = "0") String firstObj,
|
||||
@RequestParam(value = "secondObj",defaultValue = "0") String secondObj,
|
||||
@RequestParam(value = "type",defaultValue = "int")String type)
|
||||
{
|
||||
Object a = firstObj;
|
||||
Object b = secondObj;
|
||||
return methodService.Dif(a,b,type);
|
||||
}
|
||||
@GetMapping("/com")
|
||||
public String com(@RequestParam(value = "firstObj",defaultValue = "0") String firstObj,
|
||||
@RequestParam(value = "secondObj",defaultValue = "0") String secondObj,
|
||||
@RequestParam(value = "type",defaultValue = "int")String type)
|
||||
{
|
||||
Object a = firstObj;
|
||||
Object b = secondObj;
|
||||
return methodService.Com(a,b,type);
|
||||
}
|
||||
@GetMapping("/div")
|
||||
public String div(@RequestParam(value = "firstObj",defaultValue = "0") String firstObj,
|
||||
@RequestParam(value = "secondObj",defaultValue = "0") String secondObj,
|
||||
@RequestParam(value = "type",defaultValue = "int")String type)
|
||||
{
|
||||
Object a = firstObj;
|
||||
Object b = secondObj;
|
||||
return methodService.Div(a,b,type);
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package ru.ulstu.is.sbapp.speaker.domain;
|
||||
|
||||
public interface IMethods<T> {
|
||||
T Sum(T firstObj,T secondObj);
|
||||
T Dif (T firstObj, T secondObj);
|
||||
T Com(T firstObj,T secondObj);
|
||||
T Div (T firstObj, T secondObj);
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package ru.ulstu.is.sbapp.speaker.domain;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component(value = "int")
|
||||
public class MethodInteger implements IMethods<Integer> {
|
||||
@Override
|
||||
public Integer Sum(Integer firstObj, Integer secondObj) {
|
||||
return firstObj + secondObj;
|
||||
}
|
||||
@Override
|
||||
public Integer Dif(Integer firstObj, Integer secondObj) {
|
||||
return firstObj -secondObj;
|
||||
}
|
||||
@Override
|
||||
public Integer Com(Integer firstObj, Integer secondObj) {
|
||||
return firstObj * secondObj;
|
||||
}
|
||||
@Override
|
||||
public Integer Div(Integer firstObj, Integer secondObj) {
|
||||
int num = secondObj;
|
||||
if (num == 0){
|
||||
return null;
|
||||
}else{
|
||||
return firstObj / num;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
package ru.ulstu.is.sbapp.speaker.domain;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component(value = "string")
|
||||
public class MethodString implements IMethods<String> {
|
||||
@Override
|
||||
public String Sum(String firstObj,String secondObj)
|
||||
{
|
||||
return firstObj.concat(secondObj);
|
||||
}
|
||||
@Override
|
||||
public String Dif(String firstObj,String secondObj)
|
||||
{
|
||||
if(firstObj.contains(secondObj))
|
||||
{
|
||||
return firstObj.replace(secondObj,"");
|
||||
}
|
||||
return (firstObj);
|
||||
}
|
||||
@Override
|
||||
public String Com(String firstObj,String secondObj)
|
||||
{
|
||||
String res = (firstObj);
|
||||
for (int i = 0; i < (secondObj).length(); i++) {
|
||||
res = Sum(res, firstObj);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@Override
|
||||
public String Div(String firstObj,String secondObj)
|
||||
{
|
||||
if (firstObj.contains(secondObj)){
|
||||
return "true";
|
||||
}else{
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
package ru.ulstu.is.sbapp.speaker.service;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
import ru.ulstu.is.sbapp.speaker.domain.IMethods;
|
||||
import ru.ulstu.is.sbapp.speaker.domain.MethodInteger;
|
||||
import ru.ulstu.is.sbapp.speaker.domain.MethodString;
|
||||
|
||||
@Service
|
||||
public class MethodService {
|
||||
private final ApplicationContext applicationContext;
|
||||
public MethodService(ApplicationContext applicationContext)
|
||||
{
|
||||
this.applicationContext=applicationContext;
|
||||
}
|
||||
public String Sum(Object firstObj,Object secondObj,String type)
|
||||
{
|
||||
final IMethods method=(IMethods) applicationContext.getBean(type);
|
||||
if (method instanceof MethodString){
|
||||
return String.format("%s", method.Sum(firstObj,secondObj));
|
||||
}else{
|
||||
return String.format("%s", method.Sum(Integer.parseInt(firstObj.toString()),Integer.parseInt(secondObj.toString())));
|
||||
}
|
||||
}
|
||||
public String Com(Object firstObj,Object secondObj,String type)
|
||||
{
|
||||
final IMethods method=(IMethods) applicationContext.getBean(type);
|
||||
if (method instanceof MethodString){
|
||||
return String.format("%s", method.Com(firstObj,secondObj));
|
||||
}else{
|
||||
return String.format("%s", method.Com(Integer.parseInt(firstObj.toString()),Integer.parseInt(secondObj.toString())));
|
||||
}
|
||||
}
|
||||
public String Dif(Object firstObj,Object secondObj,String type)
|
||||
{
|
||||
final IMethods method=(IMethods) applicationContext.getBean(type);
|
||||
if (method instanceof MethodString){
|
||||
return String.format("%s", method.Dif(firstObj,secondObj));
|
||||
}else{
|
||||
return String.format("%s", method.Dif(Integer.parseInt(firstObj.toString()),Integer.parseInt(secondObj.toString())));
|
||||
}
|
||||
}
|
||||
public String Div(Object firstObj,Object secondObj,String type)
|
||||
{
|
||||
final IMethods method=(IMethods) applicationContext.getBean(type);
|
||||
if (method instanceof MethodString){
|
||||
return String.format("%s", method.Div(firstObj,secondObj));
|
||||
}else{
|
||||
return String.format("%s", method.Div(Integer.parseInt(firstObj.toString()),Integer.parseInt(secondObj.toString())));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +1 @@
|
||||
spring.main.banner-mode=off
|
||||
#server.port=8080
|
||||
spring.datasource.url=jdbc:h2:file:./data
|
||||
spring.datasource.driverClassName=org.h2.Driver
|
||||
spring.datasource.username=sa
|
||||
spring.datasource.password=password
|
||||
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
spring.h2.console.enabled=true
|
||||
spring.h2.console.settings.trace=false
|
||||
spring.h2.console.settings.web-allow-others=false
|
||||
|
||||
|
@ -1,117 +0,0 @@
|
||||
package ru.ulstu.is.sbapp;
|
||||
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import ru.ulstu.is.sbapp.Comment.model.Comment;
|
||||
import ru.ulstu.is.sbapp.Post.model.Post;
|
||||
import ru.ulstu.is.sbapp.Post.service.PostService;
|
||||
import ru.ulstu.is.sbapp.User.model.User;
|
||||
import ru.ulstu.is.sbapp.User.service.UserService;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@SpringBootTest
|
||||
public class JpaClientTests {
|
||||
private static final Logger log = LoggerFactory.getLogger(JpaClientTests.class);
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
private PostService postService;
|
||||
|
||||
@Test
|
||||
void testClientCreate() {
|
||||
userService.deleteAllUsers();
|
||||
final User user = userService.addUser("Pasha","Sorokin","sorokin.zxcv@gmail.com");
|
||||
log.info("testUserCreate: " + user.toString());
|
||||
Assertions.assertNotNull(user.getId());
|
||||
|
||||
userService.deleteAllUsers();
|
||||
}
|
||||
@Test
|
||||
void testReadClient()
|
||||
{
|
||||
userService.deleteAllUsers();
|
||||
final User user = userService.addUser("Pasha","Sorokin","sorokin.zxcv@gmail.com");
|
||||
log.info("testUserRead[0]: " + user.toString());
|
||||
final User curuser=userService.findUser(user.getId());
|
||||
log.info("testUserRead[1]: " + curuser.toString());
|
||||
Assertions.assertEquals(user, curuser);
|
||||
userService.deleteAllUsers();
|
||||
}
|
||||
@Test
|
||||
void testClientReadNotFound() {
|
||||
userService.deleteAllUsers();
|
||||
Assertions.assertThrows(EntityNotFoundException.class, () -> userService.findUser(-1L));
|
||||
}
|
||||
@Test
|
||||
void testClientReadAll() {
|
||||
userService.deleteAllUsers();
|
||||
userService.addUser("Pupa","Lupa","sasdfdsf@gmail.com");
|
||||
userService.addUser("Pasha","Sorokin","sorokin.zxcv@gmail.com");
|
||||
final List<User> users = userService.findAllUsers();
|
||||
log.info("testUserReadAll: " + users.toString());
|
||||
Assertions.assertEquals(users.size(), 2);
|
||||
|
||||
userService.deleteAllUsers();
|
||||
}
|
||||
@Test
|
||||
void testClientReadAllEmpty() {
|
||||
userService.deleteAllUsers();
|
||||
final List<User> users = userService.findAllUsers();
|
||||
log.info("testUserReadAllEmpty: " + users.toString());
|
||||
Assertions.assertEquals(users.size(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAddAndDeletePost()
|
||||
{
|
||||
postService.deleteAllPosts();
|
||||
userService.deleteAllUsers();
|
||||
final User user = userService.addUser("Pasha","Sorokin","sorokin.zxcv@gmail.com");
|
||||
final Post post =userService.addNewPost(user.getId(),"Text1","Text2");
|
||||
final Post post1=userService.addNewPost(user.getId(),"Привет","Да");
|
||||
final List<Post> posts =postService.findAllPosts();
|
||||
final User user1 = userService.findUser(user.getId());
|
||||
final List<Post> posts1 = user1.getPosts();
|
||||
log.info("testAddAndDeletePost :: ADD " + posts.toString() + " and " + posts1.toString());
|
||||
Assertions.assertEquals(posts.get(0).getUser(), user);
|
||||
Assertions.assertEquals(posts.toString(), posts1.toString());
|
||||
log.info("testAddAndDeletePost :: Delete ");
|
||||
userService.deletePost(user.getId(),post);
|
||||
final User us = userService.findUser(user.getId());
|
||||
Assertions.assertThrows(EntityNotFoundException.class, () -> postService.findPost(post.getId()));
|
||||
final List<Post> postss =postService.findAllPosts();
|
||||
log.info(us.getPosts().toString());
|
||||
log.info(postss.toString());
|
||||
userService.deleteAllUsers();
|
||||
postService.deleteAllPosts();
|
||||
}
|
||||
//посты и коментарии содержащие определенный текст
|
||||
@Test
|
||||
void Selected()
|
||||
{
|
||||
postService.deleteAllPosts();
|
||||
userService.deleteAllUsers();
|
||||
final User user = userService.addUser("Pasha","Sorokin","sorokin.zxcv@gmail.com");
|
||||
final User user1 = userService.addUser("Pasha","Sorokin","zxcv@gmail.com");
|
||||
final Post post =userService.addNewPost(user.getId(),"Text1","Да");
|
||||
final Post post1=userService.addNewPost(user.getId(),"Привет","Да");
|
||||
final Post post2 = userService.addNewPost(user1.getId(),"ага","конечно");
|
||||
final Comment comment3 = postService.addCommentToPost(post2.getId(),user,"Привет");
|
||||
final Comment comment = postService.addCommentToPost(post.getId(),user,"нект");
|
||||
final Comment comment1 = postService.addCommentToPost(post1.getId(),user1,"Привет");
|
||||
final User u = userService.findUser(user.getId());
|
||||
final List<Post> userPosts = u.getPosts();
|
||||
log.info("Сюда");
|
||||
log.info(userPosts.toString());
|
||||
List<Object[]> onk=(userService.SelectCommentByText("Привет"));
|
||||
log.info(String.valueOf((userService.SelectCommentByText("Привет").size())));
|
||||
|
||||
}
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
package ru.ulstu.is.sbapp;
|
||||
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import ru.ulstu.is.sbapp.Comment.model.Comment;
|
||||
import ru.ulstu.is.sbapp.Comment.service.CommentService;
|
||||
import ru.ulstu.is.sbapp.User.service.UserService;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@SpringBootTest
|
||||
public class JpaCommentTest {
|
||||
private static final Logger log = LoggerFactory.getLogger(JpaCommentTest.class);
|
||||
@Autowired
|
||||
private CommentService commentService;
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Test
|
||||
void testTidingCreate()
|
||||
{
|
||||
commentService.deleteAllComments();
|
||||
final Comment comment=commentService.addComment("Net");
|
||||
log.info("testCommentCreate: " + comment.toString());
|
||||
Assertions.assertNotNull(comment.getId());
|
||||
commentService.deleteAllComments();
|
||||
}
|
||||
@Test
|
||||
void testTidingRead()
|
||||
{
|
||||
commentService.deleteAllComments();
|
||||
final Comment comment=commentService.addComment("Net");
|
||||
log.info("testCommentRead[0]: " + comment.toString());
|
||||
final Comment findComment=commentService.findComment(comment.getId());
|
||||
log.info("testCommentRead[1]: " + findComment.toString());
|
||||
Assertions.assertEquals(comment, findComment);
|
||||
|
||||
commentService.deleteAllComments();
|
||||
}
|
||||
@Test
|
||||
void testTidingReadNotFound() {
|
||||
commentService.deleteAllComments();
|
||||
Assertions.assertThrows(EntityNotFoundException.class, () -> commentService.findComment(-1L));
|
||||
}
|
||||
@Test
|
||||
void testAllTidingRead()
|
||||
{
|
||||
commentService.deleteAllComments();
|
||||
commentService.addComment("Net");
|
||||
commentService.addComment("yep");
|
||||
final List<Comment> comments = commentService.findAllComments();
|
||||
log.info("testAllCommentRead: " + comments.toString());
|
||||
Assertions.assertEquals(comments.size(), 2);
|
||||
|
||||
commentService.deleteAllComments();
|
||||
}
|
||||
@Test
|
||||
void testTidingReadAllEmpty() {
|
||||
commentService.deleteAllComments();
|
||||
final List<Comment> comments = commentService.findAllComments();
|
||||
log.info("testCommentReadAllEmpty: " + comments.toString());
|
||||
Assertions.assertEquals(comments.size(), 0);
|
||||
}
|
||||
@Test
|
||||
void testUpdateTiding()
|
||||
{
|
||||
commentService.deleteAllComments();
|
||||
final Comment comment=commentService.addComment("Net");
|
||||
log.info("testUpdateComment: " + comment.toString());
|
||||
commentService.updateComment(comment.getId(),"Ladno");
|
||||
final Comment comment1=commentService.findComment(comment.getId());
|
||||
log.info("testUpdateComment: " + comment1.toString());
|
||||
Assertions.assertEquals(comment1.getText(), "Ladno");
|
||||
commentService.deleteAllComments();
|
||||
}
|
||||
|
||||
}
|
@ -1,137 +0,0 @@
|
||||
package ru.ulstu.is.sbapp;
|
||||
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import ru.ulstu.is.sbapp.Comment.model.Comment;
|
||||
import ru.ulstu.is.sbapp.Comment.service.CommentService;
|
||||
import ru.ulstu.is.sbapp.Post.model.Post;
|
||||
import ru.ulstu.is.sbapp.Post.service.PostService;
|
||||
import ru.ulstu.is.sbapp.User.model.User;
|
||||
import ru.ulstu.is.sbapp.User.service.UserService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SpringBootTest
|
||||
public class JpaPostTests {
|
||||
private static final Logger log = LoggerFactory.getLogger(JpaPostTests.class);
|
||||
@Autowired
|
||||
private CommentService commentService;
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
private PostService postService;
|
||||
|
||||
@Test
|
||||
void TestAddPost(){
|
||||
postService.deleteAllPosts();
|
||||
final Post post = postService.addPost("Test","Test");
|
||||
Assertions.assertNotNull(post.getId());
|
||||
}
|
||||
|
||||
@Test
|
||||
void TestFindPost(){
|
||||
postService.deleteAllPosts();
|
||||
final Post post = postService.addPost("Test","Test");
|
||||
final Post findPost = postService.findPost(post.getId());
|
||||
Assertions.assertEquals(post, findPost);
|
||||
}
|
||||
|
||||
@Test
|
||||
void TestPostReadNotFound(){
|
||||
postService.deleteAllPosts();
|
||||
Assertions.assertThrows(EntityNotFoundException.class, () -> postService.findPost(-1L));
|
||||
}
|
||||
|
||||
@Test
|
||||
void TestFindAllPost(){
|
||||
postService.deleteAllPosts();
|
||||
final Post firstPost = postService.addPost("Test1","Test1");
|
||||
final Post secondPost = postService.addPost("Test2","Test2");
|
||||
final List<Post> posts = postService.findAllPosts();
|
||||
Assertions.assertEquals(posts.size(), 2);
|
||||
}
|
||||
@Test
|
||||
void TestPostReadAllEmpty() {
|
||||
postService.deleteAllPosts();
|
||||
final List<Post> posts = postService.findAllPosts();
|
||||
Assertions.assertEquals(posts.size(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void TestPostUpdate(){
|
||||
postService.deleteAllPosts();
|
||||
Post post = postService.addPost("Test1", "Test1");
|
||||
post = postService.updatePost(post.getId(), "Test2", "Test2");
|
||||
Assertions.assertEquals(post.getHeading(), "Test2");
|
||||
Assertions.assertEquals(post.getContent(), "Test2");
|
||||
}
|
||||
|
||||
@Test
|
||||
void TestDeletePost(){
|
||||
postService.deleteAllPosts();
|
||||
final Post post = postService.addPost("Test","Test");
|
||||
postService.deletePost(post.getId());
|
||||
Assertions.assertThrows(EntityNotFoundException.class, () -> postService.findPost(1L));
|
||||
}
|
||||
|
||||
@Test
|
||||
void TestAddComment()
|
||||
{
|
||||
log.info("Добавление комментария");
|
||||
postService.deleteAllPosts();
|
||||
userService.deleteAllUsers();
|
||||
final User user = userService.addUser("Pasha","Sorokin","sorokin.zxcv@gmail.com");
|
||||
final Post post =userService.addNewPost(user.getId(),"Text1","Text2");
|
||||
final User user2=userService.findUser(user.getId());
|
||||
log.info(user2.getPosts().toString());
|
||||
final Post post2=postService.findPost(post.getId());
|
||||
log.info(post2.toString());
|
||||
final Comment comment =postService.addCommentToPost(post.getId(),user,"Крутой пост");
|
||||
final List<Comment> comments = commentService.findAllComments();
|
||||
log.info(comments.toString());
|
||||
final User user1=userService.findUser(user.getId());
|
||||
log.info(user1.getComments().toString());
|
||||
final Post post1=postService.findPost(post.getId());
|
||||
log.info(post1.getComments().toString());
|
||||
}
|
||||
@Test
|
||||
void TestDeleteCommentFromPost()
|
||||
{
|
||||
log.info("Удаление коммента");
|
||||
postService.deleteAllPosts();
|
||||
userService.deleteAllUsers();
|
||||
final User user = userService.addUser("Pasha","Sorokin","sorokin.zxcv@gmail.com");
|
||||
final Post post =userService.addNewPost(user.getId(),"Text1","Text2");
|
||||
final User user2=userService.findUser(user.getId());
|
||||
log.info("Посты юзера (добавили)"+user2.getPosts().toString());
|
||||
final Post post2=postService.findPost(post.getId());
|
||||
log.info("Пост который добавили"+post2.toString());
|
||||
final Comment comment =postService.addCommentToPost(post.getId(),user,"Крутой пост");
|
||||
final Comment commentcur =postService.addCommentToPost(post.getId(),user,"Пост плохой");
|
||||
final List<Comment> comments = commentService.findAllComments();
|
||||
log.info("Добавили коммент"+comments.toString());
|
||||
final User user1=userService.findUser(user.getId());
|
||||
log.info("Комменты юзера"+user1.getComments().toString());
|
||||
final Post post1=postService.findPost(post.getId());
|
||||
log.info("Комменты к посту"+post1.getComments().toString());
|
||||
Comment comment1 = commentService.findComment(comment.getId());
|
||||
log.info("Удаляем коммент");
|
||||
postService.removeCommentFromPost(post.getId(),comment1);
|
||||
final User user3=userService.findUser(user.getId());
|
||||
log.info(user3.getPosts().toString());
|
||||
log.info("Комменты юзера после удаления"+user3.getComments().toString());
|
||||
final Post post3 = postService.findPost(post.getId());
|
||||
log.info(post3.toString());
|
||||
log.info(post3.getComments().toString());
|
||||
final List<Comment> comment4=commentService.findAllComments();
|
||||
log.info(comment4.toString());
|
||||
commentService.deleteAllComments();
|
||||
postService.deleteAllPosts();
|
||||
userService.deleteAllUsers();
|
||||
}
|
||||
}
|
@ -1,53 +1,13 @@
|
||||
package ru.ulstu.is.sbapp;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import ru.ulstu.is.sbapp.speaker.service.MethodService;
|
||||
|
||||
@SpringBootTest
|
||||
class SbappApplicationTests {
|
||||
@Autowired
|
||||
MethodService methodService;
|
||||
|
||||
@Test
|
||||
void testSumInt() {
|
||||
final String res=methodService.Sum(1,1,"int");
|
||||
Assertions.assertEquals(2,Integer.parseInt(res));
|
||||
}
|
||||
@Test
|
||||
void testDifInt() {
|
||||
final String res=methodService.Dif(1,1,"int");
|
||||
Assertions.assertEquals(0,Integer.parseInt(res));
|
||||
}
|
||||
@Test
|
||||
void testComInt() {
|
||||
final String res=methodService.Com(3,2,"int");
|
||||
Assertions.assertEquals(6,Integer.parseInt(res));
|
||||
}
|
||||
@Test
|
||||
void testDivInt() {
|
||||
final String res=methodService.Div(6,2,"int");
|
||||
Assertions.assertEquals(3,Integer.parseInt(res));
|
||||
}
|
||||
@Test
|
||||
void testSumStr() {
|
||||
final String res=methodService.Sum("1","1","string");
|
||||
Assertions.assertEquals("11",res);
|
||||
}
|
||||
@Test
|
||||
void testDifStr() {
|
||||
final String res=methodService.Dif("2133","2","string");
|
||||
Assertions.assertEquals("133",res);
|
||||
}
|
||||
@Test
|
||||
void testComStr() {
|
||||
final String res=methodService.Com("abc","ba","string");
|
||||
Assertions.assertEquals("abcabcabc",res);
|
||||
}
|
||||
@Test
|
||||
void testDivStr() {
|
||||
final String res=methodService.Div("1010","2","string");
|
||||
Assertions.assertEquals("false",res);
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
spring.datasource.url=jdbc:h2:mem:testdb
|
||||
spring.datasource.driverClassName=org.h2.Driver
|
||||
spring.datasource.username=sa
|
||||
spring.datasource.password=password
|
||||
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
|
||||
spring.jpa.hibernate.ddl-auto=create-drop
|
Loading…
Reference in New Issue
Block a user