init 2
This commit is contained in:
+1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2
File diff suppressed because one or more lines are too long
+33
File diff suppressed because one or more lines are too long
+2
@@ -0,0 +1,2 @@
|
|||||||
|
/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
|
||||||
|
(function(){const settingsElement=document.querySelector('head > script[type="application/json"][data-drupal-selector="drupal-settings-json"], body > script[type="application/json"][data-drupal-selector="drupal-settings-json"]');window.drupalSettings={};if(settingsElement!==null)window.drupalSettings=JSON.parse(settingsElement.textContent);})();;
|
||||||
+73
File diff suppressed because one or more lines are too long
+2
File diff suppressed because one or more lines are too long
+1106
File diff suppressed because it is too large
Load Diff
+963
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
|
After Width: | Height: | Size: 352 KiB |
+1
@@ -0,0 +1 @@
|
|||||||
|
"use strict";!function(s,u){var l=s.__acuityAdsPixelEventServer||"https://e.acuityplatform.com/pj",r="http://",n="https://",f="pixelKey",y="pk";function a(e){try{var t=d(function(e){var t=e.err,r=e.topFrame,n="";if(t)try{n=s.top.location.href}catch(e){n=s.location.href}else n=r.location.href;return n}(function(){var e=s,t=!1;try{for(;e.parent.document!==e.document;){if(!e.parent.document){t=!0;break}e=e.parent}}catch(e){t=!0}return{topFrame:e,err:t}}())),r=function(e){{if(e.hasOwnProperty(f)&&e[f])return e[f];if(e.hasOwnProperty(y)&&e[y])return e[y];if(s.acuityAdsPixelKey)return s.acuityAdsPixelKey;throw new TypeError("Missing required Pixel Key. Please check snippet or pass Pixel Key like following: aap({ pixelKey: '12345' }).")}}(e||{}),n=(c=r,o=t,p=e||{},"".concat(l,"?")+["pk=".concat(c),"pu=".concat(o)].concat(Object.keys(p).filter(function(e){return p[e]&&(!Array.isArray(p[e])||0<p[e].length)}).map(function(e){return"".concat(e,"=").concat(d(Array.isArray(p[e])?p[e].join("~"):p[e]))})).join("&"));a=n,(i=u.createElement("script")).setAttribute("type","text/javascript"),i.src=a,u.body.appendChild(i)}catch(e){console.error("AcuityAds Pixel",e)}var a,i,c,o,p}function i(e){var t=e;return e.startsWith(n)||e.startsWith(r)||(t=n+e),t}s.acuityParseResponse=function(e){try{(t=e).iframeUrls.forEach(function(e){var t=u.createElement("iframe");t.src=i(e),u.body.appendChild(t)}),t.iframeSnippets.forEach(function(e){u.body.insertAdjacentHTML("beforeend",e)}),t.imageUrls.forEach(function(e){var t=u.createElement("img");t.src=i(e),u.body.append(t)}),t.imageUrlsWithNoContent.forEach(function(e){var t=u.createElement("img");t.width=0,t.height=0,t.style.display="none",t.ariaHidden=!0,t.alt="",t.src=i(e),t.referrerPolicy="no-referrer",u.body.append(t)}),t.javascriptSnippets.forEach(function(e){var t=e.replace(' type="text/javascript"',"").replace("<script>","").replace("<\/script>",""),r=u.createElement("script");r.setAttribute("type","text/javascript"),r.innerHTML=t,u.body.appendChild(r)}),t.javascriptUrls.forEach(function(e){var t=u.createElement("script");t.setAttribute("type","text/javascript"),t.src=e,u.body.appendChild(t)})}catch(e){console.error("AcuityAds Pixel",e)}var t};var d=function(e){return encodeURIComponent(e)};!function(){for(var t,e=(t=a,function(e){e&&e.delay&&0<e.delay?setTimeout(function(){t(e)},e.delay):t(e)}),r=0;r<s.acuityAdsEventQueue.length;r++)e(s.acuityAdsEventQueue[r]);s.aap=e}()}(window,document);
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
acuityPiggybackCallback({"imageUrls":[],"iframeSnippets":[],"iframeUrls":[],"javascriptSnippets":[],"javascriptUrls":[],"imageUrlsWithNoContent":["https://pixel.tapad.com/idsync/ex/receive?partner_id=3150&partner_device_id=1471927928490&partner_url=https%3A%2F%2Fums.acuityplatform.com%2Fsum%3Fumid%3D64%26auid%3D1471927928490%26uid%3D%24%7BTA_DEVICE_ID%7D"]})
|
||||||
+13
File diff suppressed because one or more lines are too long
+144
File diff suppressed because one or more lines are too long
+2
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 43 B |
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+232
@@ -0,0 +1,232 @@
|
|||||||
|
(function(){'use strict';var n,ca=typeof Object.create=="function"?Object.create:function(a){function b(){}
|
||||||
|
b.prototype=a;return new b},p=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;
|
||||||
|
a[b]=c.value;return a};
|
||||||
|
function da(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}
|
||||||
|
var q=da(this);function r(a,b){if(b)a:{var c=q;a=a.split(".");for(var d=0;d<a.length-1;d++){var h=a[d];if(!(h in c))break a;c=c[h]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&b!=null&&p(c,a,{configurable:!0,writable:!0,value:b})}}
|
||||||
|
var t;if(typeof Object.setPrototypeOf=="function")t=Object.setPrototypeOf;else{var u;a:{var ea={a:!0},fa={};try{fa.__proto__=ea;u=fa.a;break a}catch(a){}u=!1}t=u?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ha=t;
|
||||||
|
function ia(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}
|
||||||
|
function v(a){var b=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];if(b)return b.call(a);if(typeof a.length=="number")return{next:ia(a)};throw Error(String(a)+" is not an iterable or ArrayLike");}
|
||||||
|
function ja(a){if(!(a instanceof Object))throw new TypeError("Iterator result "+a+" is not an object");}
|
||||||
|
function y(){this.o=!1;this.j=null;this.m=void 0;this.g=1;this.i=this.l=0;this.D=this.h=null}
|
||||||
|
function z(a){if(a.o)throw new TypeError("Generator is already running");a.o=!0}
|
||||||
|
y.prototype.B=function(a){this.m=a};
|
||||||
|
function A(a,b){a.h={N:b,O:!0};a.g=a.l||a.i}
|
||||||
|
y.prototype.getNextAddressJsc=function(){return this.g};
|
||||||
|
y.prototype.getYieldResultJsc=function(){return this.m};
|
||||||
|
y.prototype.return=function(a){this.h={return:a};this.g=this.i};
|
||||||
|
y.prototype["return"]=y.prototype.return;y.prototype.T=function(a){this.h={C:a};this.g=this.i};
|
||||||
|
y.prototype.jumpThroughFinallyBlocks=y.prototype.T;y.prototype.u=function(a,b){this.g=b;return{value:a}};
|
||||||
|
y.prototype.yield=y.prototype.u;y.prototype.W=function(a,b){a=v(a);var c=a.next();ja(c);if(c.done)this.m=c.value,this.g=b;else return this.j=a,this.u(c.value,b)};
|
||||||
|
y.prototype.yieldAll=y.prototype.W;y.prototype.C=function(a){this.g=a};
|
||||||
|
y.prototype.jumpTo=y.prototype.C;y.prototype.G=function(){this.g=0};
|
||||||
|
y.prototype.jumpToEnd=y.prototype.G;y.prototype.I=function(a,b){this.l=a;b!=void 0&&(this.i=b)};
|
||||||
|
y.prototype.setCatchFinallyBlocks=y.prototype.I;y.prototype.V=function(a){this.l=0;this.i=a||0};
|
||||||
|
y.prototype.setFinallyBlock=y.prototype.V;y.prototype.H=function(a,b){this.g=a;this.l=b||0};
|
||||||
|
y.prototype.leaveTryBlock=y.prototype.H;y.prototype.F=function(a){this.l=a||0;a=this.h.N;this.h=null;return a};
|
||||||
|
y.prototype.enterCatchBlock=y.prototype.F;y.prototype.K=function(a,b,c){c?this.D[c]=this.h:this.D=[this.h];this.l=a||0;this.i=b||0};
|
||||||
|
y.prototype.enterFinallyBlock=y.prototype.K;y.prototype.U=function(a,b){b=this.D.splice(b||0)[0];(b=this.h=this.h||b)?b.O?this.g=this.l||this.i:b.C!=void 0&&this.i<b.C?(this.g=b.C,this.h=null):this.g=this.i:this.g=a};
|
||||||
|
y.prototype.leaveFinallyBlock=y.prototype.U;y.prototype.S=function(a){return new C(a)};
|
||||||
|
y.prototype.forIn=y.prototype.S;function C(a){this.i=a;this.g=[];for(var b in a)this.g.push(b);this.g.reverse()}
|
||||||
|
C.prototype.h=function(){for(;this.g.length>0;){var a=this.g.pop();if(a in this.i)return a}return null};
|
||||||
|
C.prototype.getNext=C.prototype.h;function ka(a){this.g=new y;this.h=a}
|
||||||
|
function la(a,b){z(a.g);var c=a.g.j;if(c)return D(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.g.return);
|
||||||
|
a.g.return(b);return E(a)}
|
||||||
|
function D(a,b,c,d){try{var h=b.call(a.g.j,c);ja(h);if(!h.done)return a.g.o=!1,h;var k=h.value}catch(f){return a.g.j=null,A(a.g,f),E(a)}a.g.j=null;d.call(a.g,k);return E(a)}
|
||||||
|
function E(a){for(;a.g.g;)try{var b=a.h(a.g);if(b)return a.g.o=!1,{value:b.value,done:!1}}catch(c){a.g.m=void 0,A(a.g,c)}a.g.o=!1;if(a.g.h){b=a.g.h;a.g.h=null;if(b.O)throw b.N;return{value:b.return,done:!0}}return{value:void 0,done:!0}}
|
||||||
|
function ma(a){this.next=function(b){z(a.g);a.g.j?b=D(a,a.g.j.next,b,a.g.B):(a.g.B(b),b=E(a));return b};
|
||||||
|
this.throw=function(b){z(a.g);a.g.j?b=D(a,a.g.j["throw"],b,a.g.B):(A(a.g,b),b=E(a));return b};
|
||||||
|
this.return=function(b){return la(a,b)};
|
||||||
|
this[Symbol.iterator]=function(){return this}}
|
||||||
|
function na(a){function b(d){return a.next(d)}
|
||||||
|
function c(d){return a.throw(d)}
|
||||||
|
return new Promise(function(d,h){function k(f){f.done?d(f.value):Promise.resolve(f.value).then(b,c).then(k,h)}
|
||||||
|
k(a.next())})}
|
||||||
|
function F(a){return na(new ma(new ka(a)))}
|
||||||
|
r("Symbol",function(a){function b(k){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(k||"")+"_"+h++,k)}
|
||||||
|
function c(k,f){this.g=k;p(this,"description",{configurable:!0,writable:!0,value:f})}
|
||||||
|
if(a)return a;c.prototype.toString=function(){return this.g};
|
||||||
|
var d="jscomp_symbol_"+(Math.random()*1E9>>>0)+"_",h=0;return b});
|
||||||
|
r("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");p(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return oa(ia(this))}});
|
||||||
|
return a});
|
||||||
|
function oa(a){a={next:a};a[Symbol.iterator]=function(){return this};
|
||||||
|
return a}
|
||||||
|
r("Promise",function(a){function b(f){this.h=0;this.i=void 0;this.g=[];this.o=!1;var e=this.j();try{f(e.resolve,e.reject)}catch(g){e.reject(g)}}
|
||||||
|
function c(){this.g=null}
|
||||||
|
function d(f){return f instanceof b?f:new b(function(e){e(f)})}
|
||||||
|
if(a)return a;c.prototype.h=function(f){if(this.g==null){this.g=[];var e=this;this.i(function(){e.l()})}this.g.push(f)};
|
||||||
|
var h=q.setTimeout;c.prototype.i=function(f){h(f,0)};
|
||||||
|
c.prototype.l=function(){for(;this.g&&this.g.length;){var f=this.g;this.g=[];for(var e=0;e<f.length;++e){var g=f[e];f[e]=null;try{g()}catch(l){this.j(l)}}}this.g=null};
|
||||||
|
c.prototype.j=function(f){this.i(function(){throw f;})};
|
||||||
|
b.prototype.j=function(){function f(l){return function(m){g||(g=!0,l.call(e,m))}}
|
||||||
|
var e=this,g=!1;return{resolve:f(this.G),reject:f(this.l)}};
|
||||||
|
b.prototype.G=function(f){if(f===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(f instanceof b)this.I(f);else{a:switch(typeof f){case "object":var e=f!=null;break a;case "function":e=!0;break a;default:e=!1}e?this.F(f):this.m(f)}};
|
||||||
|
b.prototype.F=function(f){var e=void 0;try{e=f.then}catch(g){this.l(g);return}typeof e=="function"?this.K(e,f):this.m(f)};
|
||||||
|
b.prototype.l=function(f){this.u(2,f)};
|
||||||
|
b.prototype.m=function(f){this.u(1,f)};
|
||||||
|
b.prototype.u=function(f,e){if(this.h!=0)throw Error("Cannot settle("+f+", "+e+"): Promise already settled in state"+this.h);this.h=f;this.i=e;this.h===2&&this.H();this.B()};
|
||||||
|
b.prototype.H=function(){var f=this;h(function(){if(f.D()){var e=q.console;typeof e!=="undefined"&&e.error(f.i)}},1)};
|
||||||
|
b.prototype.D=function(){if(this.o)return!1;var f=q.CustomEvent,e=q.Event,g=q.dispatchEvent;if(typeof g==="undefined")return!0;typeof f==="function"?f=new f("unhandledrejection",{cancelable:!0}):typeof e==="function"?f=new e("unhandledrejection",{cancelable:!0}):(f=q.document.createEvent("CustomEvent"),f.initCustomEvent("unhandledrejection",!1,!0,f));f.promise=this;f.reason=this.i;return g(f)};
|
||||||
|
b.prototype.B=function(){if(this.g!=null){for(var f=0;f<this.g.length;++f)k.h(this.g[f]);this.g=null}};
|
||||||
|
var k=new c;b.prototype.I=function(f){var e=this.j();f.J(e.resolve,e.reject)};
|
||||||
|
b.prototype.K=function(f,e){var g=this.j();try{f.call(e,g.resolve,g.reject)}catch(l){g.reject(l)}};
|
||||||
|
b.prototype.then=function(f,e){function g(x,B){return typeof x=="function"?function(aa){try{l(x(aa))}catch(ba){m(ba)}}:B}
|
||||||
|
var l,m,w=new b(function(x,B){l=x;m=B});
|
||||||
|
this.J(g(f,l),g(e,m));return w};
|
||||||
|
b.prototype.catch=function(f){return this.then(void 0,f)};
|
||||||
|
b.prototype.J=function(f,e){function g(){switch(l.h){case 1:f(l.i);break;case 2:e(l.i);break;default:throw Error("Unexpected state: "+l.h);}}
|
||||||
|
var l=this;this.g==null?k.h(g):this.g.push(g);this.o=!0};
|
||||||
|
b.resolve=d;b.reject=function(f){return new b(function(e,g){g(f)})};
|
||||||
|
b.race=function(f){return new b(function(e,g){for(var l=v(f),m=l.next();!m.done;m=l.next())d(m.value).J(e,g)})};
|
||||||
|
b.all=function(f){var e=v(f),g=e.next();return g.done?d([]):new b(function(l,m){function w(aa){return function(ba){x[aa]=ba;B--;B==0&&l(x)}}
|
||||||
|
var x=[],B=0;do x.push(void 0),B++,d(g.value).J(w(x.length-1),m),g=e.next();while(!g.done)})};
|
||||||
|
return b});
|
||||||
|
function G(a,b){return Object.prototype.hasOwnProperty.call(a,b)}
|
||||||
|
var pa=typeof Object.assign=="function"?Object.assign:function(a,b){if(a==null)throw new TypeError("No nullish arg");a=Object(a);for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var h in d)G(d,h)&&(a[h]=d[h])}return a};
|
||||||
|
r("Object.assign",function(a){return a||pa});
|
||||||
|
r("Symbol.dispose",function(a){return a?a:Symbol("Symbol.dispose")});
|
||||||
|
r("WeakMap",function(a){function b(g){this.g=(e+=Math.random()+1).toString();if(g){g=v(g);for(var l;!(l=g.next()).done;)l=l.value,this.set(l[0],l[1])}}
|
||||||
|
function c(){}
|
||||||
|
function d(g){var l=typeof g;return l==="object"&&g!==null||l==="function"}
|
||||||
|
function h(g){if(!G(g,f)){var l=new c;p(g,f,{value:l})}}
|
||||||
|
function k(g){var l=Object[g];l&&(Object[g]=function(m){if(m instanceof c)return m;Object.isExtensible(m)&&h(m);return l(m)})}
|
||||||
|
if(function(){if(!a||!Object.seal)return!1;try{var g=Object.seal({}),l=Object.seal({}),m=new a([[g,2],[l,3]]);if(m.get(g)!=2||m.get(l)!=3)return!1;m.delete(g);m.set(l,4);return!m.has(g)&&m.get(l)==4}catch(w){return!1}}())return a;
|
||||||
|
var f="$jscomp_hidden_"+Math.random();k("freeze");k("preventExtensions");k("seal");var e=0;b.prototype.set=function(g,l){if(!d(g))throw Error("Invalid WeakMap key");h(g);if(!G(g,f))throw Error("WeakMap key fail: "+g);g[f][this.g]=l;return this};
|
||||||
|
b.prototype.get=function(g){return d(g)&&G(g,f)?g[f][this.g]:void 0};
|
||||||
|
b.prototype.has=function(g){return d(g)&&G(g,f)&&G(g[f],this.g)};
|
||||||
|
b.prototype.delete=function(g){return d(g)&&G(g,f)&&G(g[f],this.g)?delete g[f][this.g]:!1};
|
||||||
|
return b});
|
||||||
|
r("Map",function(a){function b(){var e={};return e.previous=e.next=e.head=e}
|
||||||
|
function c(e,g){var l=e[1];return oa(function(){if(l){for(;l.head!=e[1];)l=l.previous;for(;l.next!=l.head;)return l=l.next,{done:!1,value:g(l)};l=null}return{done:!0,value:void 0}})}
|
||||||
|
function d(e,g){var l=g&&typeof g;l=="object"||l=="function"?k.has(g)?l=k.get(g):(l=""+ ++f,k.set(g,l)):l="p_"+g;var m=e[0][l];if(m&&G(e[0],l))for(e=0;e<m.length;e++){var w=m[e];if(g!==g&&w.key!==w.key||g===w.key)return{id:l,list:m,index:e,entry:w}}return{id:l,list:m,index:-1,entry:void 0}}
|
||||||
|
function h(e){this[0]={};this[1]=b();this.size=0;if(e){e=v(e);for(var g;!(g=e.next()).done;)g=g.value,this.set(g[0],g[1])}}
|
||||||
|
if(function(){if(!a||typeof a!="function"||!a.prototype.entries||typeof Object.seal!="function")return!1;try{var e=Object.seal({x:4}),g=new a(v([[e,"s"]]));if(g.get(e)!="s"||g.size!=1||g.get({x:4})||g.set({x:4},"t")!=g||g.size!=2)return!1;var l=g.entries(),m=l.next();if(m.done||m.value[0]!=e||m.value[1]!="s")return!1;m=l.next();return m.done||m.value[0].x!=4||m.value[1]!="t"||!l.next().done?!1:!0}catch(w){return!1}}())return a;
|
||||||
|
var k=new WeakMap;h.prototype.set=function(e,g){e=e===0?0:e;var l=d(this,e);l.list||(l.list=this[0][l.id]=[]);l.entry?l.entry.value=g:(l.entry={next:this[1],previous:this[1].previous,head:this[1],key:e,value:g},l.list.push(l.entry),this[1].previous.next=l.entry,this[1].previous=l.entry,this.size++);return this};
|
||||||
|
h.prototype.delete=function(e){e=d(this,e);return e.entry&&e.list?(e.list.splice(e.index,1),e.list.length||delete this[0][e.id],e.entry.previous.next=e.entry.next,e.entry.next.previous=e.entry.previous,e.entry.head=null,this.size--,!0):!1};
|
||||||
|
h.prototype.clear=function(){this[0]={};this[1]=this[1].previous=b();this.size=0};
|
||||||
|
h.prototype.has=function(e){return!!d(this,e).entry};
|
||||||
|
h.prototype.get=function(e){return(e=d(this,e).entry)&&e.value};
|
||||||
|
h.prototype.entries=function(){return c(this,function(e){return[e.key,e.value]})};
|
||||||
|
h.prototype.keys=function(){return c(this,function(e){return e.key})};
|
||||||
|
h.prototype.values=function(){return c(this,function(e){return e.value})};
|
||||||
|
h.prototype.forEach=function(e,g){for(var l=this.entries(),m;!(m=l.next()).done;)m=m.value,e.call(g,m[1],m[0],this)};
|
||||||
|
h.prototype[Symbol.iterator]=h.prototype.entries;var f=0;return h});
|
||||||
|
r("Set",function(a){function b(c){this.g=new Map;if(c){c=v(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.g.size}
|
||||||
|
if(function(){if(!a||typeof a!="function"||!a.prototype.entries||typeof Object.seal!="function")return!1;try{var c=Object.seal({x:4}),d=new a(v([c]));if(!d.has(c)||d.size!=1||d.add(c)!=d||d.size!=1||d.add({x:4})!=d||d.size!=2)return!1;var h=d.entries(),k=h.next();if(k.done||k.value[0]!=c||k.value[1]!=c)return!1;k=h.next();return k.done||k.value[0]==c||k.value[0].x!=4||k.value[1]!=k.value[0]?!1:h.next().done}catch(f){return!1}}())return a;
|
||||||
|
b.prototype.add=function(c){c=c===0?0:c;this.g.set(c,c);this.size=this.g.size;return this};
|
||||||
|
b.prototype.delete=function(c){c=this.g.delete(c);this.size=this.g.size;return c};
|
||||||
|
b.prototype.clear=function(){this.g.clear();this.size=0};
|
||||||
|
b.prototype.has=function(c){return this.g.has(c)};
|
||||||
|
b.prototype.entries=function(){return this.g.entries()};
|
||||||
|
b.prototype.values=function(){return this.g.values()};
|
||||||
|
b.prototype.keys=b.prototype.values;b.prototype[Symbol.iterator]=b.prototype.values;b.prototype.forEach=function(c,d){var h=this;this.g.forEach(function(k){return c.call(d,k,k,h)})};
|
||||||
|
return b});
|
||||||
|
r("Array.prototype.find",function(a){return a?a:function(b,c){a:{var d=this;d instanceof String&&(d=String(d));for(var h=d.length,k=0;k<h;k++){var f=d[k];if(b.call(c,f,k,d)){b=f;break a}}b=void 0}return b}});
|
||||||
|
r("Array.from",function(a){return a?a:function(b,c,d){c=c!=null?c:function(e){return e};
|
||||||
|
var h=[],k=typeof Symbol!="undefined"&&Symbol.iterator&&b[Symbol.iterator];if(typeof k=="function"){b=k.call(b);for(var f=0;!(k=b.next()).done;)h.push(c.call(d,k.value,f++))}else for(k=b.length,f=0;f<k;f++)h.push(c.call(d,b[f],f));return h}});/*
|
||||||
|
|
||||||
|
Copyright The Closure Library Authors.
|
||||||
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
var H=this||self;function I(a){var b=typeof a;return b=="object"&&a!=null||b=="function"}
|
||||||
|
function qa(a){return Object.prototype.hasOwnProperty.call(a,ra)&&a[ra]||(a[ra]=++sa)}
|
||||||
|
var ra="closure_uid_"+(Math.random()*1E9>>>0),sa=0;function J(a,b){a=a.split(".");for(var c=H,d;a.length&&(d=a.shift());)a.length||b===void 0?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b}
|
||||||
|
function ta(a,b){function c(){}
|
||||||
|
c.prototype=b.prototype;a.R=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.ea=function(d,h,k){for(var f=Array(arguments.length-2),e=2;e<arguments.length;e++)f[e-2]=arguments[e];return b.prototype[h].apply(d,f)}}
|
||||||
|
;var ua=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(typeof a==="string")return typeof b!=="string"||b.length!=1?-1:a.indexOf(b,0);
|
||||||
|
for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},va=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,h=typeof a==="string"?a.split(""):a,k=0;k<d;k++)k in h&&b.call(c,h[k],k,a)};
|
||||||
|
function wa(a,b){b=ua(a,b);b>=0&&Array.prototype.splice.call(a,b,1)}
|
||||||
|
function xa(a){return Array.prototype.concat.apply([],arguments)}
|
||||||
|
function ya(a){var b=a.length;if(b>0){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]}
|
||||||
|
;function za(a,b){this.i=a;this.j=b;this.h=0;this.g=null}
|
||||||
|
za.prototype.get=function(){if(this.h>0){this.h--;var a=this.g;this.g=a.next;a.next=null}else a=this.i();return a};function Aa(a){H.setTimeout(function(){throw a;},0)}
|
||||||
|
;function Ba(){this.h=this.g=null}
|
||||||
|
Ba.prototype.add=function(a,b){var c=Ca.get();c.set(a,b);this.h?this.h.next=c:this.g=c;this.h=c};
|
||||||
|
Ba.prototype.remove=function(){var a=null;this.g&&(a=this.g,this.g=this.g.next,this.g||(this.h=null),a.next=null);return a};
|
||||||
|
var Ca=new za(function(){return new Da},function(a){return a.reset()});
|
||||||
|
function Da(){this.next=this.scope=this.g=null}
|
||||||
|
Da.prototype.set=function(a,b){this.g=a;this.scope=b;this.next=null};
|
||||||
|
Da.prototype.reset=function(){this.next=this.scope=this.g=null};var Ea,Fa=!1,Ga=new Ba;function Ha(a){Ea||Ia();Fa||(Ea(),Fa=!0);Ga.add(a,void 0)}
|
||||||
|
function Ia(){var a=Promise.resolve(void 0);Ea=function(){a.then(Ja)}}
|
||||||
|
function Ja(){for(var a;a=Ga.remove();){try{a.g.call(a.scope)}catch(c){Aa(c)}var b=Ca;b.j(a);b.h<100&&(b.h++,a.next=b.g,b.g=a)}Fa=!1}
|
||||||
|
;function K(){this.i=this.i;this.j=this.j}
|
||||||
|
K.prototype.i=!1;K.prototype.dispose=function(){this.i||(this.i=!0,this.L())};
|
||||||
|
K.prototype[Symbol.dispose]=function(){this.dispose()};
|
||||||
|
K.prototype.addOnDisposeCallback=function(a,b){this.i?b!==void 0?a.call(b):a():(this.j||(this.j=[]),b&&(a=a.bind(b)),this.j.push(a))};
|
||||||
|
K.prototype.L=function(){if(this.j)for(;this.j.length;)this.j.shift()()};function Ka(a){var b={},c;for(c in a)b[c]=a[c];return b}
|
||||||
|
;var La=/&/g,Ma=/</g,Na=/>/g,Oa=/"/g,Pa=/'/g,Qa=/\x00/g,Ra=/[\x00&<>"']/;/*
|
||||||
|
|
||||||
|
Copyright Google LLC
|
||||||
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
function L(a){this.g=a}
|
||||||
|
L.prototype.toString=function(){return this.g};
|
||||||
|
var Sa=new L("about:invalid#zClosurez");function Ta(a){this.Y=a}
|
||||||
|
function M(a){return new Ta(function(b){return b.substr(0,a.length+1).toLowerCase()===a+":"})}
|
||||||
|
var Ua=[M("data"),M("http"),M("https"),M("mailto"),M("ftp"),new Ta(function(a){return/^[^:]*([/?#]|$)/.test(a)})],Va=/^\s*(?!javascript:)(?:[\w+.-]+:|[^:/?#]*(?:[/?#]|$))/i;var Wa={da:0,ba:1,ca:2,0:"FORMATTED_HTML_CONTENT",1:"EMBEDDED_INTERNAL_CONTENT",2:"EMBEDDED_TRUSTED_EXTERNAL_CONTENT"};function N(a,b){b=Error.call(this,a+" cannot be used with intent "+Wa[b]);this.message=b.message;"stack"in b&&(this.stack=b.stack);this.type=a;this.name="TypeCannotBeUsedWithIframeIntentError"}
|
||||||
|
var O=Error;N.prototype=ca(O.prototype);N.prototype.constructor=N;if(ha)ha(N,O);else for(var P in O)if(P!="prototype")if(Object.defineProperties){var Xa=Object.getOwnPropertyDescriptor(O,P);Xa&&Object.defineProperty(N,P,Xa)}else N[P]=O[P];N.R=O.prototype;function Ya(a){Ra.test(a)&&(a.indexOf("&")!=-1&&(a=a.replace(La,"&")),a.indexOf("<")!=-1&&(a=a.replace(Ma,"<")),a.indexOf(">")!=-1&&(a=a.replace(Na,">")),a.indexOf('"')!=-1&&(a=a.replace(Oa,""")),a.indexOf("'")!=-1&&(a=a.replace(Pa,"'")),a.indexOf("\x00")!=-1&&(a=a.replace(Qa,"�")));return a}
|
||||||
|
;var Za,Q;a:{for(var $a=["CLOSURE_FLAGS"],R=H,ab=0;ab<$a.length;ab++)if(R=R[$a[ab]],R==null){Q=null;break a}Q=R}var bb=Q&&Q[610401301];Za=bb!=null?bb:!1;function S(){var a=H.navigator;return a&&(a=a.userAgent)?a:""}
|
||||||
|
var T,cb=H.navigator;T=cb?cb.userAgentData||null:null;function db(){return Za?!!T&&T.brands.length>0:!1}
|
||||||
|
function eb(a){var b={};a.forEach(function(c){b[c[0]]=c[1]});
|
||||||
|
return function(c){return b[c.find(function(d){return d in b})]||""}}
|
||||||
|
function fb(){for(var a=S(),b=RegExp("([A-Z][\\w ]+)/([^\\s]+)\\s*(?:\\((.*?)\\))?","g"),c=[],d;d=b.exec(a);)c.push([d[1],d[2],d[3]||void 0]);a=eb(c);if(db())a:{if(Za&&T)for(b=0;b<T.brands.length;b++)if((c=T.brands[b].brand)&&c.indexOf("Chromium")!=-1){b=!0;break a}b=!1}else b=(S().indexOf("Chrome")!=-1||S().indexOf("CriOS")!=-1)&&(db()||S().indexOf("Edge")==-1)||S().indexOf("Silk")!=-1;return b?a(["Chrome","CriOS","HeadlessChrome"]):""}
|
||||||
|
function gb(){if(db()){var a=T.brands.find(function(b){return b.brand==="Chromium"});
|
||||||
|
if(!a||!a.version)return NaN;a=a.version.split(".")}else{a=fb();if(a==="")return NaN;a=a.split(".")}return a.length===0?NaN:Number(a[0])}
|
||||||
|
;function U(a){K.call(this);this.o=1;this.l=[];this.m=0;this.g=[];this.h={};this.u=!!a}
|
||||||
|
ta(U,K);n=U.prototype;n.subscribe=function(a,b,c){var d=this.h[a];d||(d=this.h[a]=[]);var h=this.o;this.g[h]=a;this.g[h+1]=b;this.g[h+2]=c;this.o=h+3;d.push(h);return h};
|
||||||
|
n.unsubscribe=function(a,b,c){if(a=this.h[a]){var d=this.g;if(a=a.find(function(h){return d[h+1]==b&&d[h+2]==c}))return this.M(a)}return!1};
|
||||||
|
n.M=function(a){var b=this.g[a];if(b){var c=this.h[b];this.m!=0?(this.l.push(a),this.g[a+1]=function(){}):(c&&wa(c,a),delete this.g[a],delete this.g[a+1],delete this.g[a+2])}return!!b};
|
||||||
|
n.P=function(a,b){var c=this.h[a];if(c){var d=Array(arguments.length-1),h=arguments.length,k;for(k=1;k<h;k++)d[k-1]=arguments[k];if(this.u)for(k=0;k<c.length;k++)h=c[k],hb(this.g[h+1],this.g[h+2],d);else{this.m++;try{for(k=0,h=c.length;k<h&&!this.i;k++){var f=c[k];this.g[f+1].apply(this.g[f+2],d)}}finally{if(this.m--,this.l.length>0&&this.m==0)for(;c=this.l.pop();)this.M(c)}}return k!=0}return!1};
|
||||||
|
function hb(a,b,c){Ha(function(){a.apply(b,c)})}
|
||||||
|
n.clear=function(a){if(a){var b=this.h[a];b&&(b.forEach(this.M,this),delete this.h[a])}else this.g.length=0,this.h={}};
|
||||||
|
n.L=function(){U.R.L.call(this);this.clear();this.l.length=0};var ib=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function jb(a){var b=a.match(ib);a=b[1];var c=b[2],d=b[3];b=b[4];var h="";a&&(h+=a+":");d&&(h+="//",c&&(h+=c+"@"),h+=d,b&&(h+=":"+b));return h}
|
||||||
|
function kb(a,b,c){if(Array.isArray(b))for(var d=0;d<b.length;d++)kb(a,String(b[d]),c);else b!=null&&c.push(a+(b===""?"":"="+encodeURIComponent(String(b))))}
|
||||||
|
var lb=/#|$/;var mb=["https://www.google.com"];function nb(){var a=this;this.g=[];this.h=function(){Promise.all(a.g.map(function(b){document.requestStorageAccessFor(b)})).then(function(){window.removeEventListener("click",a.h)})}}
|
||||||
|
function ob(){return F(function(a){var b=a.return;var c=gb()>=119;return b.call(a,c&&!!navigator.permissions&&!!navigator.permissions.query&&"requestStorageAccessFor"in document)})}
|
||||||
|
function pb(){var a=new nb,b=["https://www.youtube.com"];b=b===void 0?mb:b;F(function(c){switch(c.g){case 1:return c.u(ob(),2);case 2:if(!c.m){c.C(3);break}return c.u(Promise.all(b.map(function(d){var h;return F(function(k){if(k.g==1)return k.I(2),k.u(navigator.permissions.query({name:"top-level-storage-access",requestedOrigin:d}),4);if(k.g!=2)return h=k.m,h.state==="prompt"&&a.g.push(d),k.H(0);k.F();k.G()})})),4);
|
||||||
|
case 4:a.g.length>0&&window.addEventListener("click",a.h);case 3:return c.return()}})}
|
||||||
|
;var V={},qb=[],W=new U,rb={};function sb(){for(var a=v(qb),b=a.next();!b.done;b=a.next())b=b.value,b()}
|
||||||
|
function tb(a,b){return a.tagName.toLowerCase().substring(0,3)==="yt:"?a.getAttribute(b):a.dataset?a.dataset[b]:a.getAttribute("data-"+b)}
|
||||||
|
function ub(a){W.P.apply(W,arguments)}
|
||||||
|
;function vb(a){return(a.search("cue")===0||a.search("load")===0)&&a!=="loadModule"}
|
||||||
|
function wb(a){return a.search("get")===0||a.search("is")===0}
|
||||||
|
;var xb=window;
|
||||||
|
function X(a,b){this.A={};this.playerInfo={};this.videoTitle="";this.j=this.g=null;this.h=0;this.m=!1;this.l=[];this.i=null;this.B={};this.options=null;this.u=this.Z.bind(this);if(!a)throw Error("YouTube player element ID required.");this.id=qa(this);b=Object.assign({title:"video player",videoId:"",width:640,height:360},b||{});var c=document;if(a=typeof a==="string"?c.getElementById(a):a){xb.yt_embedsEnableRsaforFromIframeApi&&pb();c=a.tagName.toLowerCase()==="iframe";b.host||(b.host=c?jb(a.src):
|
||||||
|
"https://www.youtube.com");this.options=b||{};b=[this.options,window.YTConfig||{}];for(var d=0;d<b.length;d++)b[d].host&&(b[d].host=b[d].host.toString().replace("http://","https://"));if(!c){b=document.createElement("iframe");c=a.attributes;d=0;for(var h=c.length;d<h;d++){var k=c[d].value;k!=null&&k!==""&&k!=="null"&&b.setAttribute(c[d].name,k)}b.setAttribute("frameBorder","0");b.setAttribute("allowfullscreen","");b.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share");
|
||||||
|
b.setAttribute("referrerPolicy","strict-origin-when-cross-origin");b.setAttribute("title","YouTube "+Y(this,"title"));(c=Y(this,"width"))&&b.setAttribute("width",c.toString());(c=Y(this,"height"))&&b.setAttribute("height",c.toString());this.j=a;(c=a.parentNode)&&c.replaceChild(b,a);a=yb(this,b);c=""+Y(this,"host")+zb(this)+"?";d=[];for(var f in a)kb(f,a[f],d);f=c+d.join("&");if(xb.yt_embedsEnableIframeSrcWithIntent){var e=e===void 0?Ua:e;a:if(e=e===void 0?Ua:e,f instanceof L)e=f;else{for(a=0;a<e.length;++a)if(c=
|
||||||
|
e[a],c instanceof Ta&&c.Y(f)){e=new L(f);break a}e=void 0}e=e||Sa;b.removeAttribute("srcdoc");f="allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-storage-access-by-user-activation".split(" ");b.setAttribute("sandbox","");for(a=0;a<f.length;a++)b.sandbox.supports&&!b.sandbox.supports(f[a])||b.sandbox.add(f[a]);if(e instanceof L)if(e instanceof L)e=e.g;else throw Error("");else e=Va.test(e)?e:void 0;e!==void 0&&(b.src=e);b.sandbox.add("allow-presentation",
|
||||||
|
"allow-top-navigation")}else b.src=f;a=b}this.g=a;this.g.id||(this.g.id="widget"+qa(this.g));V[this.g.id]=this;if(window.postMessage){this.i=new U;Ab(this);b=Y(this,"events");for(var g in b)b.hasOwnProperty(g)&&this.addEventListener(g,b[g]);for(var l in rb)rb.hasOwnProperty(l)&&Bb(this,l)}}}
|
||||||
|
n=X.prototype;n.setSize=function(a,b){this.g.width=a.toString();this.g.height=b.toString();return this};
|
||||||
|
n.getIframe=function(){return this.g};
|
||||||
|
n.addEventListener=function(a,b){var c=b;typeof b==="string"&&(c=function(){window[b].apply(window,arguments)});
|
||||||
|
if(!c)return this;this.i.subscribe(a,c);Cb(this,a);return this};
|
||||||
|
function Bb(a,b){b=b.split(".");if(b.length===2){var c=b[1];"player"===b[0]&&Cb(a,c)}}
|
||||||
|
n.destroy=function(){this.g&&this.g.id&&(V[this.g.id]=null);var a=this.i;a&&typeof a.dispose=="function"&&a.dispose();if(this.j){a=this.j;var b=this.g,c=b.parentNode;c&&c.replaceChild(a,b)}else(a=this.g)&&a.parentNode&&a.parentNode.removeChild(a);Z&&(Z[this.id]=null);this.options=null;this.g&&this.o&&this.g.removeEventListener("load",this.o);this.j=this.g=null};
|
||||||
|
function Db(a,b,c){c=c||[];c=Array.prototype.slice.call(c);b={event:"command",func:b,args:c};a.m?a.sendMessage(b):a.l.push(b)}
|
||||||
|
n.Z=function(){Eb(this)||clearInterval(this.h)};
|
||||||
|
function Eb(a){if(!a.g||!a.g.contentWindow)return!1;a.sendMessage({event:"listening"});return!0}
|
||||||
|
function Ab(a){Fb(a,a.id,String(Y(a,"host")));var b=Number(xb.yt_embedsWidgetPollIntervalMs)||250;a.h=setInterval(a.u,b);a.g&&(a.o=function(){clearInterval(a.h);a.h=setInterval(a.u,b)},a.g.addEventListener("load",a.o))}
|
||||||
|
function Gb(a){var b=a.getBoundingClientRect();a=Math.max(0,Math.min(b.bottom,window.innerHeight||document.documentElement.clientHeight)-Math.max(b.top,0))*Math.max(0,Math.min(b.right,window.innerWidth||document.documentElement.clientWidth)-Math.max(b.left,0));a=(b=b.height*b.width)?a/b:0;return document.visibilityState==="hidden"||a<.5?1:a<.75?2:a<.85?3:a<.95?4:a<1?5:6}
|
||||||
|
function Cb(a,b){a.B[b]||(a.B[b]=!0,Db(a,"addEventListener",[b]))}
|
||||||
|
n.sendMessage=function(a){a.id=this.id;a.channel="widget";a=JSON.stringify(a);var b=jb(this.g.src||"").replace("http:","https:");if(this.g.contentWindow)try{this.g.contentWindow.postMessage(a,b)}catch(c){if(c.name&&c.name==="SyntaxError")c.message&&c.message.indexOf("target origin ''")>0||console&&console.warn&&console.warn(c);else throw c;}else console&&console.warn&&console.warn("The YouTube player is not attached to the DOM. API calls should be made after the onReady event. See more: https://developers.google.com/youtube/iframe_api_reference#Events")};
|
||||||
|
function zb(a){if((a=String(Y(a,"videoId")))&&(a.length!==11||!a.match(/^[a-zA-Z0-9\-_]+$/)))throw Error("Invalid video id");return"/embed/"+a}
|
||||||
|
function yb(a,b){var c=Y(a,"playerVars");c?c=Ka(c):c={};window!==window.top&&document.referrer&&(c.widget_referrer=document.referrer.substring(0,256));var d=Y(a,"embedConfig");if(d){if(I(d))try{d=JSON.stringify(d)}catch(h){console.error("Invalid embed config JSON",h)}c.embed_config=d}c.enablejsapi=window.postMessage?1:0;window.location.host&&(c.origin=window.location.protocol+"//"+window.location.host);c.widgetid=a.id;window.location.href&&va(["debugjs","debugcss"],function(h){var k=window.location.href;
|
||||||
|
var f=k.search(lb);b:{var e=0;for(var g=h.length;(e=k.indexOf(h,e))>=0&&e<f;){var l=k.charCodeAt(e-1);if(l==38||l==63)if(l=k.charCodeAt(e+g),!l||l==61||l==38||l==35)break b;e+=g+1}e=-1}if(e<0)k=null;else{g=k.indexOf("&",e);if(g<0||g>f)g=f;e+=h.length+1;k=decodeURIComponent(k.slice(e,g!==-1?g:0).replace(/\+/g," "))}k!==null&&(c[h]=k)});
|
||||||
|
window.location.href&&(c.forigin=window.location.href);a=window.location.ancestorOrigins;c.aoriginsup=a===void 0?0:1;a&&a.length>0&&(c.aorigins=Array.from(a).join(","));window.document.referrer&&(c.gporigin=window.document.referrer);b&&(c.vf=Gb(b));return c}
|
||||||
|
function Hb(a,b){if(I(b)){for(var c in b)b.hasOwnProperty(c)&&(a.playerInfo[c]=b[c]);a.playerInfo.hasOwnProperty("videoData")&&(b=a.playerInfo.videoData,b.hasOwnProperty("title")&&b.title?(b=b.title,b!==a.videoTitle&&(a.videoTitle=b,a.g.setAttribute("title",b))):(a.videoTitle="",a.g.setAttribute("title","YouTube "+Y(a,"title"))))}}
|
||||||
|
function Ib(a,b){b=v(b);for(var c=b.next(),d={};!c.done;d={v:void 0},c=b.next())d.v=c.value,a[d.v]||(d.v==="getCurrentTime"?a[d.v]=function(){var h=this.playerInfo.currentTime;if(this.playerInfo.playerState===1){var k=(Date.now()/1E3-this.playerInfo.currentTimeLastUpdated_)*this.playerInfo.playbackRate;k>0&&(h+=Math.min(k,1))}return h}:vb(d.v)?a[d.v]=function(h){return function(){this.playerInfo={};
|
||||||
|
this.A={};Db(this,h.v,arguments);return this}}(d):wb(d.v)?a[d.v]=function(h){return function(){var k=h.v,f=0;
|
||||||
|
k.search("get")===0?f=3:k.search("is")===0&&(f=2);return this.playerInfo[k.charAt(f).toLowerCase()+k.substring(f+1)]}}(d):a[d.v]=function(h){return function(){Db(this,h.v,arguments);
|
||||||
|
return this}}(d))}
|
||||||
|
n.getVideoEmbedCode=function(){var a=""+Y(this,"host")+zb(this),b=Number(Y(this,"width")),c=Number(Y(this,"height"));if(isNaN(b)||isNaN(c))throw Error("Invalid width or height property");b=Math.floor(b);c=Math.floor(c);var d=this.videoTitle;a=Ya(a);d=Ya(d!=null?d:"YouTube video player");return'<iframe width="'+b+'" height="'+c+'" src="'+a+'" title="'+(d+'" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>')};
|
||||||
|
n.getOptions=function(a){return this.A.namespaces?a?this.A[a]?this.A[a].options||[]:[]:this.A.namespaces||[]:[]};
|
||||||
|
n.getOption=function(a,b){if(this.A.namespaces&&a&&b&&this.A[a])return this.A[a][b]};
|
||||||
|
function Y(a,b){a=[a.options,window.YTConfig||{}];for(var c=0;c<a.length;c++){var d=a[c][b];if(d!==void 0)return d}return null}
|
||||||
|
var Z=null,Jb=null;function Kb(a){if(a.tagName.toLowerCase()!=="iframe"){var b=tb(a,"videoid");b&&(b={videoId:b,width:tb(a,"width"),height:tb(a,"height")},new X(a,b))}}
|
||||||
|
function Fb(a,b,c){Z||(Z={},Jb=new Set,Lb.addEventListener("message",function(d){a:if(Jb.has(d.origin)){try{var h=JSON.parse(d.data)}catch(e){break a}var k=Z[h.id];if(k&&d.origin===k.X)switch(d=k.aa,d.m=!0,d.m&&(va(d.l,d.sendMessage,d),d.l.length=0),k=h.event,h=h.info,k){case "apiInfoDelivery":if(I(h))for(var f in h)h.hasOwnProperty(f)&&(d.A[f]=h[f]);break;case "infoDelivery":Hb(d,h);break;case "initialDelivery":I(h)&&(clearInterval(d.h),d.playerInfo={},d.A={},Ib(d,h.apiInterface),Hb(d,h));break;
|
||||||
|
case "alreadyInitialized":clearInterval(d.h);break;case "readyToListen":Eb(d);break;default:d.i.i||(f={target:d,data:h},d.i.P(k,f),ub("player."+k,f))}}}));
|
||||||
|
Z[b]={aa:a,X:c};Jb.add(c)}
|
||||||
|
var Lb=window;J("YT.PlayerState.UNSTARTED",-1);J("YT.PlayerState.ENDED",0);J("YT.PlayerState.PLAYING",1);J("YT.PlayerState.PAUSED",2);J("YT.PlayerState.BUFFERING",3);J("YT.PlayerState.CUED",5);J("YT.get",function(a){return V[a]});
|
||||||
|
J("YT.scan",sb);J("YT.subscribe",function(a,b,c){W.subscribe(a,b,c);rb[a]=!0;for(var d in V)V.hasOwnProperty(d)&&Bb(V[d],a)});
|
||||||
|
J("YT.unsubscribe",function(a,b,c){W.unsubscribe(a,b,c)});
|
||||||
|
J("YT.Player",X);X.prototype.destroy=X.prototype.destroy;X.prototype.setSize=X.prototype.setSize;X.prototype.getIframe=X.prototype.getIframe;X.prototype.addEventListener=X.prototype.addEventListener;X.prototype.getVideoEmbedCode=X.prototype.getVideoEmbedCode;X.prototype.getOptions=X.prototype.getOptions;X.prototype.getOption=X.prototype.getOption;qb.push(function(a){var b=a;b||(b=document);a=ya(b.getElementsByTagName("yt:player"));b=ya((b||document).querySelectorAll(".yt-player"));va(xa(a,b),Kb)});
|
||||||
|
typeof YTConfig!=="undefined"&&YTConfig.parsetags&&YTConfig.parsetags!=="onload"||sb();var Mb=H.onYTReady;Mb&&Mb();var Nb=H.onYouTubeIframeAPIReady;Nb&&Nb();var Ob=H.onYouTubePlayerAPIReady;Ob&&Ob();}).call(this);
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
# Phân tích mức độ đáp ứng giao diện của index.html
|
||||||
|
|
||||||
|
Dựa trên nội dung của file `sisvietnam_components_analysis.md` và việc quét, kiểm tra trực tiếp mã nguồn của file `index.html` hiện tại, dưới đây là bảng so sánh và phân tích về mức độ đáp ứng (tính đầy đủ) các thành phần giao diện.
|
||||||
|
|
||||||
|
Dưới đây là các thành phần **đã có/đáp ứng đủ** và các thành phần **đang thiếu/cần bổ sung** vào `index.html` để có thể tái hiện đầy đủ trang chủ của S.I.S Việt Nam:
|
||||||
|
|
||||||
|
## 1. Các thành phần đã có và đủ số lượng (Đạt yêu cầu cơ bản)
|
||||||
|
Các thành phần khung (Wrapper) và liên kết cơ bản của trang UMass Amherst hiện tại có số lượng dư sức chứa cấu trúc của SIS Vietnam:
|
||||||
|
- **Cấu trúc HTML cơ bản:** `<header>`, `<footer>`, `<section>` đều đã có đủ số lượng tối thiểu. Thẻ `<div>` có 331 thẻ (so với 190 yêu cầu).
|
||||||
|
- **Điều hướng & Liên kết:** Có tới 122 thẻ `<a>` (yêu cầu 66), 55 thẻ có class `menu` (yêu cầu 32). Hệ thống danh sách `<ul>`, `<li>` cũng vượt số lượng yêu cầu (40 thẻ `<li>` so với 36).
|
||||||
|
- **Tiêu đề:** Khá đầy đủ với 8 thẻ `<h2>` và 17 thẻ `<h3>` (yêu cầu 3 và 7).
|
||||||
|
- **Khung chứa (Container):** 55 class `.container` (vượt mức 18 yêu cầu).
|
||||||
|
- **Nhúng (iframe):** Có 5 thẻ `<iframe>` (đã dư 1 thẻ bản đồ theo yêu cầu).
|
||||||
|
|
||||||
|
## 2. Các thành phần đang THIẾU và cần bổ sung (Chưa đầy đủ)
|
||||||
|
Đây là các thành phần quan trọng tạo nên nét đặc trưng của trang web bệnh viện SIS Vietnam nhưng file `index.html` hiện tại chưa có, hoặc dùng class khác không tương thích:
|
||||||
|
|
||||||
|
1. **Hệ thống Lưới (Grid System - row, col):**
|
||||||
|
- **Thực trạng:** `index.html` hiện tại chỉ có 3 class `.row` và 4 class `.col`.
|
||||||
|
- **Yêu cầu SIS:** Cần tới 15 `.row` và 47 `.col`.
|
||||||
|
- **Đánh giá:** Trang UMass Amherst dùng cấu trúc layout khác (vd: `lc--layout-container`, `lr--layout-region`) chứ không dùng Bootstrap Grid chuẩn. Cần phải đan xen thêm hệ thống `row/col` để chia nhỏ giao diện thành nhiều cột như trang SIS.
|
||||||
|
|
||||||
|
2. **Trình chiếu (Slider & Carousel):**
|
||||||
|
- **Thực trạng:** Không tìm thấy class `.slider` hay `.carousel` nào.
|
||||||
|
- **Yêu cầu SIS:** 13 class `.slider` và 5 class `.carousel` (thường dùng cho banner chính, slide đội ngũ bác sĩ, cảm nhận khách hàng...).
|
||||||
|
- **Đánh giá:** **Cực kỳ quan trọng.** Cần nhúng thư viện như Owl Carousel, SwiperJS hoặc Slick Slider vào `index.html` và xây dựng cấu trúc HTML cho slider.
|
||||||
|
|
||||||
|
3. **Biểu mẫu liên hệ/Đặt lịch (Form):**
|
||||||
|
- **Thực trạng:** Không có thẻ `<form>` nào trong thân trang (chỉ có 1 form tìm kiếm ở header).
|
||||||
|
- **Yêu cầu SIS:** Cần 3 thẻ `<form>` (Dành cho việc đặt lịch khám, form liên hệ tư vấn, form đăng ký nhận tin).
|
||||||
|
- **Đánh giá:** Cần bổ sung các khối HTML form này vào nội dung chính (`<main>`).
|
||||||
|
|
||||||
|
4. **Nút bấm tiêu chuẩn (Buttons - `.btn`):**
|
||||||
|
- **Thực trạng:** Không có class `.btn`.
|
||||||
|
- **Yêu cầu SIS:** 10 class `.btn`.
|
||||||
|
- **Đánh giá:** Hiện tại trang đang dùng class nút bấm của theme UMass (như `.button-primary`). Bạn có thể giữ nguyên, nhưng nếu bê y nguyên CSS từ file SIS qua thì cần đổi lại/thêm class `.btn`.
|
||||||
|
|
||||||
|
5. **Banner Quảng cáo/Thông báo (`.banner`):**
|
||||||
|
- **Thực trạng:** 0 class.
|
||||||
|
- **Yêu cầu SIS:** Cần 2 class `.banner`.
|
||||||
|
|
||||||
|
6. **Hình ảnh (`<img>`):**
|
||||||
|
- **Thực trạng:** Mới chỉ có khoảng 18 hình ảnh.
|
||||||
|
- **Yêu cầu SIS:** 46 hình ảnh (Bao gồm logo, banner, ảnh bác sĩ, cơ sở vật chất, bài viết tin tức...). Cần chèn thêm rất nhiều khối hình ảnh.
|
||||||
|
|
||||||
|
## Tổng kết và Khuyến nghị
|
||||||
|
File `index.html` hiện tại chủ yếu là "vỏ bọc" mượn từ UMass Amherst. Để nó biến thành trang của S.I.S Việt Nam đầy đủ, cần:
|
||||||
|
1. Nhúng thêm **Thư viện Slider** (như Swiper/Owl Carousel).
|
||||||
|
2. Xây dựng lại **Hệ thống Grid (row/col)** ở phần `<main>` cho phù hợp với 47 cột dữ liệu.
|
||||||
|
3. Chèn các **Form đặt lịch khám** và tăng cường các thẻ **Hình ảnh/Banner**.
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# Phân tích Cấu trúc Giao diện: sisvietnam.vn
|
||||||
|
|
||||||
|
Báo cáo chi tiết số lượng và loại thành phần giao diện (UI Components) đang được sử dụng trên trang web Bệnh viện Đa khoa Quốc tế S.I.S Cần Thơ (`https://sisvietnam.vn/`).
|
||||||
|
|
||||||
|
## 1. Bố cục khung (Layout Structure)
|
||||||
|
Trang web sử dụng hệ thống chia cột dạng Grid (khả năng cao là Bootstrap) để dàn trang.
|
||||||
|
|
||||||
|
* **`<header>` (Đầu trang):** 1 thẻ
|
||||||
|
* **`.header` (Lớp giao diện đầu trang):** 2 class
|
||||||
|
* **`<footer>` (Chân trang):** 1 thẻ
|
||||||
|
* **`.footer` (Lớp giao diện chân trang):** 21 class (Footer được chia làm rất nhiều cột nhỏ)
|
||||||
|
* **`<section>` (Phân khu):** 1 thẻ
|
||||||
|
* **`.container` (Vỏ bọc nội dung):** 18 class
|
||||||
|
* **`.row` (Hàng):** 15 class
|
||||||
|
* **`.col` (Cột):** 47 class
|
||||||
|
|
||||||
|
## 2. Các thành phần tương tác (UI Components)
|
||||||
|
* **`.slider` & `.carousel` (Trình chiếu ảnh trượt):** 13 class `.slider` và 5 class `.carousel` (Sử dụng thư viện Owl Carousel).
|
||||||
|
* **`<img>` (Hình ảnh):** 46 thẻ
|
||||||
|
* **`.banner` (Biểu ngữ quảng cáo):** 2 class
|
||||||
|
* **`.menu` (Thanh điều hướng):** 32 class
|
||||||
|
* **`<a>` (Đường liên kết):** 66 thẻ
|
||||||
|
* **`<ul>` / `<li>` (Danh sách):** 7 danh sách (`<ul>`) với 36 mục (`<li>`)
|
||||||
|
* **`.btn` (Nút bấm):** 10 class
|
||||||
|
* **`<form>` (Biểu mẫu):** 3 thẻ (Sử dụng plugin Contact Form 7)
|
||||||
|
* **`.widget` (Khối tiện ích):** 3 class
|
||||||
|
* **`<iframe>` (Bản đồ / Nhúng ngoại vi):** 1 thẻ
|
||||||
|
|
||||||
|
## 3. Phân tích kỹ thuật (Technical Tags)
|
||||||
|
* **`<div>` (Thẻ khối cơ bản):** 190 thẻ
|
||||||
|
* **`<h2>` & `<h3>` (Thẻ tiêu đề):** 3 thẻ `<h2>` và 7 thẻ `<h3>`
|
||||||
|
* **`<script>` (Mã Javascript):** 58 thẻ (Google Analytics, Tag Manager, Facebook Pixel...)
|
||||||
|
* **`<style>` (CSS Nội tuyến):** 10 thẻ
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
> **Đánh giá Kiến trúc:**
|
||||||
|
> Trang web được xây dựng bằng **WordPress**, sử dụng hệ thống **Grid** để cấu trúc bố cục tĩnh, kết hợp với các **Carousel/Slider** để làm sinh động giao diện. Phần thu thập dữ liệu khách hàng được xử lý qua các **Form**.
|
||||||
|
> Nếu bạn dùng các công cụ như Pinegrow hoặc Webflow, kiến trúc này có thể dễ dàng sao chép bằng cách sử dụng cấu trúc `Container -> Row -> Column`.
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/java/.devcontainer/base.Dockerfile
|
||||||
|
|
||||||
|
# [Choice] Java version (use -bullseye variants on local arm64/Apple Silicon): 17, 17-bullseye, 17-buster
|
||||||
|
ARG VARIANT="17"
|
||||||
|
FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}
|
||||||
|
|
||||||
|
# [Option] Install Maven
|
||||||
|
ARG INSTALL_MAVEN="false"
|
||||||
|
ARG MAVEN_VERSION=""
|
||||||
|
# [Option] Install Gradle
|
||||||
|
ARG INSTALL_GRADLE="false"
|
||||||
|
ARG GRADLE_VERSION=""
|
||||||
|
RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \
|
||||||
|
&& if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi
|
||||||
|
|
||||||
|
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
|
||||||
|
ARG NODE_VERSION="none"
|
||||||
|
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
|
||||||
|
|
||||||
|
# [Optional] Uncomment this section to install additional OS packages.
|
||||||
|
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
|
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
||||||
|
|
||||||
|
# [Optional] Uncomment this line to install global node packages.
|
||||||
|
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
||||||
|
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/java
|
||||||
|
{
|
||||||
|
"name": "Sisvietnamvn",
|
||||||
|
"build": {
|
||||||
|
"dockerfile": "Dockerfile",
|
||||||
|
"args": {
|
||||||
|
// Update the VARIANT arg to pick a Java version: 17, 19
|
||||||
|
// Append -bullseye or -buster to pin to an OS version.
|
||||||
|
// Use the -bullseye variants on local arm64/Apple Silicon.
|
||||||
|
"VARIANT": "21-bullseye",
|
||||||
|
// Options
|
||||||
|
// maven and gradle wrappers are used by default, we don't need them installed globally
|
||||||
|
// "INSTALL_MAVEN": "false",
|
||||||
|
// "INSTALL_GRADLE": "true",
|
||||||
|
"NODE_VERSION": "24.16.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
// Set *default* container specific settings.json values on container create.
|
||||||
|
"settings": {
|
||||||
|
"java.jdt.ls.java.home": "/docker-java-home"
|
||||||
|
},
|
||||||
|
|
||||||
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
|
"extensions": ["vscjava.vscode-java-pack", "pivotal.vscode-boot-dev-pack", "esbenp.prettier-vscode"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
"forwardPorts": [8080],
|
||||||
|
|
||||||
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
|
// "postCreateCommand": "java -version",
|
||||||
|
|
||||||
|
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||||
|
"remoteUser": "vscode",
|
||||||
|
|
||||||
|
// Mount the workspace folder to the same path inside the container, so docker-in-docker containers work correctly. See https://github.com/jhipster/generator-jhipster/issues/31239
|
||||||
|
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
|
||||||
|
"workspaceFolder": "${localWorkspaceFolder}",
|
||||||
|
|
||||||
|
"features": {
|
||||||
|
"docker-in-docker": "latest",
|
||||||
|
"docker-from-docker": "latest"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# EditorConfig helps developers define and maintain consistent
|
||||||
|
# coding styles between different editors and IDEs
|
||||||
|
# editorconfig.org
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
|
||||||
|
# We recommend you to keep these unchanged
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
# Change these settings to your own preference
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
# Generated by jhipster:java:bootstrap generator
|
||||||
|
[*.java]
|
||||||
|
indent_size = 4
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
# This file is inspired by https://github.com/alexkaratarakis/gitattributes
|
||||||
|
#
|
||||||
|
# Auto detect text files and perform LF normalization
|
||||||
|
# https://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
# The above will handle all files NOT found below
|
||||||
|
# These files are text and should be normalized (Convert crlf => lf)
|
||||||
|
|
||||||
|
*.bat text eol=crlf
|
||||||
|
*.cmd text eol=crlf
|
||||||
|
*.ps1 text eol=crlf
|
||||||
|
*.coffee text
|
||||||
|
*.css text
|
||||||
|
*.cql text
|
||||||
|
*.df text
|
||||||
|
*.ejs text
|
||||||
|
*.html text
|
||||||
|
*.java text
|
||||||
|
*.js text
|
||||||
|
*.json text
|
||||||
|
*.less text
|
||||||
|
*.properties text
|
||||||
|
*.sass text
|
||||||
|
*.scss text
|
||||||
|
*.sh text eol=lf
|
||||||
|
*.sql text
|
||||||
|
*.ts text
|
||||||
|
*.xml text
|
||||||
|
*.yaml text
|
||||||
|
*.yml text
|
||||||
|
|
||||||
|
# Documents
|
||||||
|
*.doc diff=astextplain
|
||||||
|
*.DOC diff=astextplain
|
||||||
|
*.docx diff=astextplain
|
||||||
|
*.DOCX diff=astextplain
|
||||||
|
*.dot diff=astextplain
|
||||||
|
*.DOT diff=astextplain
|
||||||
|
*.pdf diff=astextplain
|
||||||
|
*.PDF diff=astextplain
|
||||||
|
*.rtf diff=astextplain
|
||||||
|
*.RTF diff=astextplain
|
||||||
|
*.markdown text
|
||||||
|
*.md text
|
||||||
|
*.adoc text
|
||||||
|
*.textile text
|
||||||
|
*.mustache text
|
||||||
|
*.csv text
|
||||||
|
*.tab text
|
||||||
|
*.tsv text
|
||||||
|
*.txt text
|
||||||
|
AUTHORS text
|
||||||
|
CHANGELOG text
|
||||||
|
CHANGES text
|
||||||
|
CONTRIBUTING text
|
||||||
|
COPYING text
|
||||||
|
copyright text
|
||||||
|
*COPYRIGHT* text
|
||||||
|
INSTALL text
|
||||||
|
license text
|
||||||
|
LICENSE text
|
||||||
|
NEWS text
|
||||||
|
readme text
|
||||||
|
*README* text
|
||||||
|
TODO text
|
||||||
|
|
||||||
|
# Graphics
|
||||||
|
*.png binary
|
||||||
|
*.jpg binary
|
||||||
|
*.jpeg binary
|
||||||
|
*.gif binary
|
||||||
|
*.tif binary
|
||||||
|
*.tiff binary
|
||||||
|
*.ico binary
|
||||||
|
# SVG treated as an asset (binary) by default. If you want to treat it as text,
|
||||||
|
# comment-out the following line and uncomment the line after.
|
||||||
|
*.svg binary
|
||||||
|
#*.svg text
|
||||||
|
*.eps binary
|
||||||
|
|
||||||
|
# These files are binary and should be left untouched
|
||||||
|
# (binary is a macro for -text -diff)
|
||||||
|
*.class binary
|
||||||
|
*.jar binary
|
||||||
|
*.war binary
|
||||||
|
|
||||||
|
## LINTERS
|
||||||
|
.csslintrc text
|
||||||
|
.eslintrc text
|
||||||
|
.jscsrc text
|
||||||
|
.jshintrc text
|
||||||
|
.jshintignore text
|
||||||
|
.stylelintrc text
|
||||||
|
|
||||||
|
## CONFIGS
|
||||||
|
*.conf text
|
||||||
|
*.config text
|
||||||
|
.editorconfig text
|
||||||
|
.gitattributes text
|
||||||
|
.gitconfig text
|
||||||
|
.gitignore text
|
||||||
|
.htaccess text
|
||||||
|
*.npmignore text
|
||||||
|
|
||||||
|
## HEROKU
|
||||||
|
Procfile text
|
||||||
|
.slugignore text
|
||||||
|
|
||||||
|
## AUDIO
|
||||||
|
*.kar binary
|
||||||
|
*.m4a binary
|
||||||
|
*.mid binary
|
||||||
|
*.midi binary
|
||||||
|
*.mp3 binary
|
||||||
|
*.ogg binary
|
||||||
|
*.ra binary
|
||||||
|
|
||||||
|
## VIDEO
|
||||||
|
*.3gpp binary
|
||||||
|
*.3gp binary
|
||||||
|
*.as binary
|
||||||
|
*.asf binary
|
||||||
|
*.asx binary
|
||||||
|
*.fla binary
|
||||||
|
*.flv binary
|
||||||
|
*.m4v binary
|
||||||
|
*.mng binary
|
||||||
|
*.mov binary
|
||||||
|
*.mp4 binary
|
||||||
|
*.mpeg binary
|
||||||
|
*.mpg binary
|
||||||
|
*.swc binary
|
||||||
|
*.swf binary
|
||||||
|
*.webm binary
|
||||||
|
|
||||||
|
## ARCHIVES
|
||||||
|
*.7z binary
|
||||||
|
*.gz binary
|
||||||
|
*.rar binary
|
||||||
|
*.tar binary
|
||||||
|
*.zip binary
|
||||||
|
|
||||||
|
## FONTS
|
||||||
|
*.ttf binary
|
||||||
|
*.eot binary
|
||||||
|
*.otf binary
|
||||||
|
*.woff binary
|
||||||
|
*.woff2 binary
|
||||||
@@ -0,0 +1,153 @@
|
|||||||
|
######################
|
||||||
|
# Node
|
||||||
|
######################
|
||||||
|
/node/
|
||||||
|
node_tmp/
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log.*
|
||||||
|
/.awcache/*
|
||||||
|
/.cache-loader/*
|
||||||
|
/dist/
|
||||||
|
|
||||||
|
######################
|
||||||
|
# SASS
|
||||||
|
######################
|
||||||
|
.sass-cache/
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Eclipse
|
||||||
|
######################
|
||||||
|
*.pydevproject
|
||||||
|
.project
|
||||||
|
.metadata
|
||||||
|
tmp/
|
||||||
|
*.tmp
|
||||||
|
*.bak
|
||||||
|
*.swp
|
||||||
|
*~.nib
|
||||||
|
local.properties
|
||||||
|
.classpath
|
||||||
|
.settings/
|
||||||
|
.loadpath
|
||||||
|
.factorypath
|
||||||
|
|
||||||
|
# External tool builders
|
||||||
|
.externalToolBuilders/**
|
||||||
|
|
||||||
|
# Locally stored "Eclipse launch configurations"
|
||||||
|
*.launch
|
||||||
|
|
||||||
|
# CDT-specific
|
||||||
|
.cproject
|
||||||
|
|
||||||
|
# PDT-specific
|
||||||
|
.buildpath
|
||||||
|
|
||||||
|
# STS-specific
|
||||||
|
/.sts4-cache/*
|
||||||
|
|
||||||
|
######################
|
||||||
|
# IntelliJ
|
||||||
|
######################
|
||||||
|
.idea/
|
||||||
|
*.iml
|
||||||
|
*.iws
|
||||||
|
*.ipr
|
||||||
|
*.ids
|
||||||
|
*.orig
|
||||||
|
classes/
|
||||||
|
out/
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Visual Studio Code
|
||||||
|
######################
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
*.code-workspace
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Maven
|
||||||
|
######################
|
||||||
|
/log/
|
||||||
|
/target/
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Gradle
|
||||||
|
######################
|
||||||
|
.gradle/
|
||||||
|
/build/
|
||||||
|
/buildSrc/.gradle/
|
||||||
|
/buildSrc/build/
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Package Files
|
||||||
|
######################
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.ear
|
||||||
|
*.db
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Windows
|
||||||
|
######################
|
||||||
|
# Windows image file caches
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Mac OSX
|
||||||
|
######################
|
||||||
|
.DS_Store
|
||||||
|
.svn
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear on external disk
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Directories
|
||||||
|
######################
|
||||||
|
/bin/
|
||||||
|
/deploy/
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Logs
|
||||||
|
######################
|
||||||
|
*.log*
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Others
|
||||||
|
######################
|
||||||
|
*.class
|
||||||
|
*.*~
|
||||||
|
*~
|
||||||
|
.merge_file*
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Gradle Wrapper
|
||||||
|
######################
|
||||||
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Maven Wrapper
|
||||||
|
######################
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
|
||||||
|
######################
|
||||||
|
# ESLint
|
||||||
|
######################
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Code coverage
|
||||||
|
######################
|
||||||
|
coverage/
|
||||||
|
.nyc_output/
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
node_modules
|
||||||
|
package-lock.json
|
||||||
|
.git
|
||||||
|
|
||||||
|
# Generated by jhipster:java-simple-application:gradle
|
||||||
|
build
|
||||||
|
gradle
|
||||||
|
.gradle
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
printWidth: 140
|
||||||
|
singleQuote: true
|
||||||
|
tabWidth: 2
|
||||||
|
useTabs: false
|
||||||
|
arrowParens: avoid
|
||||||
|
bracketSameLine: false
|
||||||
|
plugins:
|
||||||
|
- prettier-plugin-packagejson
|
||||||
|
- prettier-plugin-java
|
||||||
|
overrides:
|
||||||
|
- files: "*.java"
|
||||||
|
options:
|
||||||
|
tabWidth: 4
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "Debug (Launch) - SisvietnamvnApp",
|
||||||
|
"request": "launch",
|
||||||
|
"mainClass": "com.sisvietnamvn.web.SisvietnamvnApp",
|
||||||
|
"projectName": "sisvietnamvn",
|
||||||
|
"vmArgs": "-Dspring.profiles.active=dev"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "Debug (Attach) - Port 5005",
|
||||||
|
"request": "attach",
|
||||||
|
"hostName": "localhost",
|
||||||
|
"port": 5005
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"java.compile.nullAnalysis.mode": "automatic",
|
||||||
|
"jdk.jdkhome": "C:\\Program Files\\Eclipse Adoptium\\jdk-21.0.11.10-hotspot",
|
||||||
|
"java.jdt.ls.java.home": "C:\\Program Files\\Eclipse Adoptium\\jdk-21.0.11.10-hotspot",
|
||||||
|
"java.configuration.runtimes": [
|
||||||
|
{
|
||||||
|
"name": "JavaSE-21",
|
||||||
|
"path": "C:\\Program Files\\Eclipse Adoptium\\jdk-21.0.11.10-hotspot",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"generator-jhipster": {
|
||||||
|
"applicationType": "monolith",
|
||||||
|
"authenticationType": "jwt",
|
||||||
|
"baseName": "sisvietnamvn",
|
||||||
|
"buildTool": "gradle",
|
||||||
|
"cacheProvider": "ehcache",
|
||||||
|
"clientFramework": "no",
|
||||||
|
"creationTimestamp": 1717387200000,
|
||||||
|
"databaseType": "sql",
|
||||||
|
"defaultCommand": "app",
|
||||||
|
"devDatabaseType": "h2Disk",
|
||||||
|
"enableHibernateCache": true,
|
||||||
|
"enableSwaggerCodegen": false,
|
||||||
|
"enableTranslation": false,
|
||||||
|
"entities": [],
|
||||||
|
"jhiPrefix": "jhi",
|
||||||
|
"jhipsterVersion": "9.1.0",
|
||||||
|
"jwtSecretKey": "ZWRjOTBhYjJiYzg5N2JhMTUyMTBiYzZhNzJjMWUwNmYzOTM3MjJmZGE3Zjc3NGE0ODhjMDZlYzRjNmFiODFhMDNkNmFjNmYwYzY4NmMwNGRkMDMwY2Q0NTllNDlhYzEyMjg0NmY2NzM5MWM1M2IxOTdkMDNhZTBhZDkzYWJjMWI=",
|
||||||
|
"messageBroker": "no",
|
||||||
|
"monorepository": true,
|
||||||
|
"nativeLanguage": "en",
|
||||||
|
"packageFolder": "com/sisvietnamvn/web/",
|
||||||
|
"packageName": "com.sisvietnamvn.web",
|
||||||
|
"prodDatabaseType": "oracle",
|
||||||
|
"searchEngine": "no",
|
||||||
|
"serverPort": 8080,
|
||||||
|
"skipClient": true,
|
||||||
|
"skipCommitHook": true,
|
||||||
|
"skipUserManagement": false,
|
||||||
|
"testFrameworks": []
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# Environment Transfer Guide
|
||||||
|
|
||||||
|
To transfer the development environment for this application to another PC, you need to install a few key technologies based on the project's configuration (JHipster 9.1.0, Spring Boot monolith).
|
||||||
|
|
||||||
|
Here is the complete list of tools and dependencies you need to install on the new PC:
|
||||||
|
|
||||||
|
## 1. Required Technologies
|
||||||
|
* **Java Development Kit (JDK):** **Version 21** (The project is configured with `sourceCompatibility=21` in `build.gradle`).
|
||||||
|
* **Node.js:** **Version >= 24.16.0** (Required for JHipster frontend tooling and code formatting, as specified in `package.json`).
|
||||||
|
* **NPM:** Comes bundled with Node.js.
|
||||||
|
* **Git:** To clone and transfer your source code.
|
||||||
|
|
||||||
|
## 2. Automatically Managed Dependencies (No installation required)
|
||||||
|
* **Gradle:** You do **not** need to install Gradle manually. The project uses the Gradle Wrapper (`gradlew`). Running it will automatically download the correct version for you.
|
||||||
|
* **Database (Development):** The `dev` profile uses an **H2 in-memory/file-based database**. You do not need to install an external database to run the project locally.
|
||||||
|
* *(Note: The `prod` profile uses an Oracle Database, which is only necessary if you are running it in production mode).*
|
||||||
|
|
||||||
|
## 3. Recommended Tools (Optional)
|
||||||
|
* **IDE:** IntelliJ IDEA, Eclipse, or Visual Studio Code with the Java Extension Pack.
|
||||||
|
* **Docker Desktop:** Useful if you want to run additional services (like SonarQube or JHipster Control Center) via the `docker-compose` files located in `src/main/docker/`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## How to start the project on the new PC
|
||||||
|
Once you've installed **Java 21** and **Node.js >= 24.16.0**, you can transfer your code to the new PC and run the following commands in your project's root folder:
|
||||||
|
|
||||||
|
### 1. Install Node dependencies
|
||||||
|
```bash
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Start the development server
|
||||||
|
```bash
|
||||||
|
./gradlew
|
||||||
|
```
|
||||||
|
*(On Windows Command Prompt or PowerShell, use `.\gradlew` instead).*
|
||||||
|
|
||||||
|
This will download all necessary Java dependencies via Gradle and start the application on `http://localhost:8080`.
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# Getting Started
|
||||||
|
|
||||||
|
### Reference Documentation
|
||||||
|
For further reference, please consider the following sections:
|
||||||
|
|
||||||
|
* [Official Gradle documentation](https://docs.gradle.org)
|
||||||
|
* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/4.0.6/gradle-plugin)
|
||||||
|
* [Create an OCI image](https://docs.spring.io/spring-boot/4.0.6/gradle-plugin/packaging-oci-image.html)
|
||||||
|
* [Spring Web](https://docs.spring.io/spring-boot/4.0.6/reference/web/servlet.html)
|
||||||
|
* [Thymeleaf](https://docs.spring.io/spring-boot/4.0.6/reference/web/servlet.html#web.servlet.spring-mvc.template-engines)
|
||||||
|
* [Spring Boot DevTools](https://docs.spring.io/spring-boot/4.0.6/reference/using/devtools.html)
|
||||||
|
|
||||||
|
### Guides
|
||||||
|
The following guides illustrate how to use some features concretely:
|
||||||
|
|
||||||
|
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
|
||||||
|
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
|
||||||
|
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
|
||||||
|
* [Handling Form Submission](https://spring.io/guides/gs/handling-form-submission/)
|
||||||
|
|
||||||
|
### Additional Links
|
||||||
|
These additional references should also help you:
|
||||||
|
|
||||||
|
* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle)
|
||||||
|
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# Project Knowledge Base
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
This project is a web application built using **Java**, **Spring Boot**, and **Thymeleaf**. It serves as the frontend layer for `sisvietnamvn`, currently rendering static-like pages with dynamic templating provided by Thymeleaf. The static assets seem to be heavily inspired by or imported from UMass Amherst website templates, integrated into a Spring Boot architecture.
|
||||||
|
|
||||||
|
## System Architecture
|
||||||
|
* **Language:** Java 21
|
||||||
|
* **Framework:** Spring Boot (Version 4.0.6 as per `build.gradle`)
|
||||||
|
* **Build Tool:** Gradle
|
||||||
|
* **Application Type:** Spring Web MVC application
|
||||||
|
* **Routing:** Basic MVC routing handled by `@Controller` classes. Currently, `HomeController.java` maps endpoints to Thymeleaf templates:
|
||||||
|
* `/` -> `index.html`
|
||||||
|
* `/about` -> `about.html`
|
||||||
|
* `/flex-finish` -> `flex-finish.html`
|
||||||
|
|
||||||
|
## Directory Structure
|
||||||
|
The structure strictly adheres to standard Maven/Gradle Spring Boot conventions:
|
||||||
|
* `build.gradle` / `settings.gradle`: Gradle configuration files defining dependencies and build settings.
|
||||||
|
* `src/main/java/com/sisvietnamvn/web/`: Contains Java source code.
|
||||||
|
* `SisvietnamvnApplication.java`: Main Spring Boot entry point.
|
||||||
|
* `controller/HomeController.java`: Web controller managing page routing.
|
||||||
|
* `src/main/resources/`: Contains configuration and web assets.
|
||||||
|
* `application.properties`: Spring Boot configuration properties.
|
||||||
|
* `static/`: Stores all static assets (CSS, JS, Images). Assets are organized into subdirectories like `css/`, `images/`, `js/`, and specific page folders like `flex-finish/` and `UMass Amherst _ UMass Amherst_files/`.
|
||||||
|
* `templates/`: Contains Thymeleaf `.html` view templates.
|
||||||
|
* `fragments/`: Contains reusable Thymeleaf layout components (`layout.html`, `header.html`, `footer.html`).
|
||||||
|
|
||||||
|
## Libraries and Dependencies
|
||||||
|
* **Spring Boot Starter Web** (`spring-boot-starter-webmvc`): For building web, including RESTful, applications using Spring MVC.
|
||||||
|
* **Spring Boot Starter Thymeleaf** (`spring-boot-starter-thymeleaf`): For HTML templating.
|
||||||
|
* **Thymeleaf Layout Dialect** (`nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect`): Provides decorator pattern for Thymeleaf, allowing the use of a common layout (`layout.html`) that other pages inject content into.
|
||||||
|
* **Spring Boot DevTools** (`spring-boot-devtools`): For fast application restarts and live reload during development.
|
||||||
|
* **Frontend Libraries:**
|
||||||
|
* jQuery (`jquery.min.js`)
|
||||||
|
* Lazysizes (`lazysizes.min.js`) for lazy loading images.
|
||||||
|
* Various Lottie scripts and custom scripts copied into static folders.
|
||||||
|
|
||||||
|
## Coding Conventions & Best Practices
|
||||||
|
1. **Templating & Layouts:** The project relies on the Thymeleaf Layout Dialect. Pages should define their content within a `layout:fragment="content"` block and reference the master layout (`layout.html`). Reusable parts (like headers/footers) are stored in the `fragments` folder and included via `th:replace`.
|
||||||
|
2. **Asset Management:** Static assets (CSS, images, JS) are referenced via absolute paths starting from the root `/` (e.g., `<script src="/Undergraduate Study _ UMass Amherst_files/base.js.download"></script>`). This relies on Spring Boot's default static resource mapping.
|
||||||
|
3. **Controllers:** Keep controllers lightweight. Endpoints should generally just return the template name as a String.
|
||||||
|
4. **Language Level:** The project uses Java 21, allowing for modern Java features (records, pattern matching, etc.) if backend logic is expanded in the future.
|
||||||
@@ -0,0 +1,314 @@
|
|||||||
|
# sisvietnamvn
|
||||||
|
|
||||||
|
This application was generated using JHipster 9.1.0, you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v9.1.0](https://www.jhipster.tech/documentation-archive/v9.1.0).
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
|
||||||
|
Node is required for generation and recommended for development. `package.json` is always generated for a better development experience with prettier, commit hooks, scripts and so on.
|
||||||
|
|
||||||
|
In the project root, JHipster generates configuration files for tools like git, prettier, eslint, husky, and others that are well known and you can find references in the web.
|
||||||
|
|
||||||
|
`/src/*` structure follows default Java structure.
|
||||||
|
|
||||||
|
- `.yo-rc.json` - Yeoman configuration file
|
||||||
|
JHipster configuration is stored in this file at `generator-jhipster` key. You may find `generator-jhipster-*` for specific blueprints configuration.
|
||||||
|
- `.yo-resolve` (optional) - Yeoman conflict resolver
|
||||||
|
Allows to use a specific action when conflicts are found skipping prompts for files that matches a pattern. Each line should match `[pattern] [action]` with pattern been a [Minimatch](https://github.com/isaacs/minimatch#minimatch) pattern and action been one of skip (default if omitted) or force. Lines starting with `#` are considered comments and are ignored.
|
||||||
|
- `.jhipster/*.json` - JHipster entity configuration files
|
||||||
|
- `/src/main/docker` - Docker configurations for the application and services that the application depends on
|
||||||
|
|
||||||
|
## Database Configuration
|
||||||
|
|
||||||
|
### Development Database (H2 Console)
|
||||||
|
- **Profile**: `dev`
|
||||||
|
- **Database Type**: H2 (File-based, embedded)
|
||||||
|
- **JDBC URL**: `jdbc:h2:file:./build/h2db/db/sisvietnamvn`
|
||||||
|
- **Username**: `sisvietnamvn`
|
||||||
|
- **Password**: *(leave blank)*
|
||||||
|
- **Console Access**: [http://localhost:8080/h2-console](http://localhost:8080/h2-console) (requires app running in dev profile)
|
||||||
|
- **Config File**: [application-dev.yml](file:///d:/website_sisvietnam_moi/website_sisvietnam.vn/sisvietnamvn/src/main/resources/config/application-dev.yml)
|
||||||
|
|
||||||
|
### Production Database
|
||||||
|
- **Profile**: `prod`
|
||||||
|
- **Database Type**: Oracle Database
|
||||||
|
- **JDBC URL**: `jdbc:oracle:thin:@localhost:1521:xe`
|
||||||
|
- **Username**: `sisvietnamvn`
|
||||||
|
- **Config File**: [application-prod.yml](file:///d:/website_sisvietnam_moi/website_sisvietnam.vn/sisvietnamvn/src/main/resources/config/application-prod.yml)
|
||||||
|
|
||||||
|
### Schema Management
|
||||||
|
- **Tool**: Liquibase
|
||||||
|
- **Changelog Folder**: [src/main/resources/config/liquibase/](file:///d:/website_sisvietnam_moi/website_sisvietnam.vn/sisvietnamvn/src/main/resources/config/liquibase/)
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
To start your application in the dev profile, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./gradlew
|
||||||
|
```
|
||||||
|
|
||||||
|
For further instructions on how to develop with JHipster, have a look at [Using JHipster in development][].
|
||||||
|
|
||||||
|
## Building for production
|
||||||
|
|
||||||
|
### Packaging as jar
|
||||||
|
|
||||||
|
To build the final jar and optimize the sisvietnamvn application for production, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./gradlew -Pprod clean bootJar
|
||||||
|
```
|
||||||
|
|
||||||
|
To ensure everything worked, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
java -jar build/libs/*.jar
|
||||||
|
```
|
||||||
|
|
||||||
|
Refer to [Using JHipster in production][] for more details.
|
||||||
|
|
||||||
|
### Packaging as war
|
||||||
|
|
||||||
|
To package your application as a war in order to deploy it to an application server, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./gradlew -Pprod -Pwar clean bootWar
|
||||||
|
```
|
||||||
|
|
||||||
|
### JHipster Control Center
|
||||||
|
|
||||||
|
JHipster Control Center can help you manage and control your application(s). You can start a local control center server (accessible on http://localhost:7419) with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose -f src/main/docker/jhipster-control-center.yml up
|
||||||
|
```
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
### Spring Boot tests
|
||||||
|
|
||||||
|
To launch your application's tests, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./gradlew test integrationTest jacocoTestReport
|
||||||
|
```
|
||||||
|
|
||||||
|
## Others
|
||||||
|
|
||||||
|
### Code quality using Sonar
|
||||||
|
|
||||||
|
Sonar is used to analyse code quality. You can start a local Sonar server (accessible on http://localhost:9001) with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose -f src/main/docker/sonar.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
Note: we have turned off forced authentication redirect for UI in [src/main/docker/sonar.yml](src/main/docker/sonar.yml) for out of the box experience while trying out SonarQube, for real use cases turn it back on.
|
||||||
|
|
||||||
|
You can run a Sonar analysis with using the [sonar-scanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner) or by using the gradle plugin.
|
||||||
|
|
||||||
|
Then, run a Sonar analysis:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./gradlew -Pprod clean check jacocoTestReport sonarqube -Dsonar.login=admin -Dsonar.password=admin
|
||||||
|
```
|
||||||
|
|
||||||
|
Additionally, Instead of passing `sonar.password` and `sonar.login` as CLI arguments, these parameters can be configured from [sonar-project.properties](sonar-project.properties) as shown below:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sonar.login=admin
|
||||||
|
sonar.password=admin
|
||||||
|
```
|
||||||
|
|
||||||
|
For more information, refer to the [Code quality page][].
|
||||||
|
|
||||||
|
### Docker Compose support
|
||||||
|
|
||||||
|
JHipster generates a number of Docker Compose configuration files in the [src/main/docker/](src/main/docker/) folder to launch required third party services.
|
||||||
|
|
||||||
|
For example, to start required services in Docker containers, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose -f src/main/docker/services.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
To stop and remove the containers, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose -f src/main/docker/services.yml down
|
||||||
|
```
|
||||||
|
|
||||||
|
[Spring Docker Compose Integration](https://docs.spring.io/spring-boot/reference/features/dev-services.html) is enabled by default. It's possible to disable it in `application.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
spring:
|
||||||
|
...
|
||||||
|
docker:
|
||||||
|
compose:
|
||||||
|
enabled: false
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also fully dockerize your application and all the services that it depends on.
|
||||||
|
To achieve this, first build a Docker image of your app by running:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run java:docker
|
||||||
|
```
|
||||||
|
|
||||||
|
Or build an arm64 Docker image when using an arm64 processor OS, i.e., Apple Silicon chips (M\*), running:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run java:docker:arm64
|
||||||
|
```
|
||||||
|
|
||||||
|
Then run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose -f src/main/docker/app.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
For more information refer to [Docker and Docker-Compose](https://www.jhipster.tech/documentation-archive/v9.1.0/docker-compose/), this page also contains information on the Docker Compose sub-generator (`jhipster docker-compose`), which is able to generate Docker configurations for one or several JHipster applications.
|
||||||
|
|
||||||
|
## Continuous Integration (optional)
|
||||||
|
|
||||||
|
To configure CI for your project, run the ci-cd sub-generator (`jhipster ci-cd`), this will let you generate configuration files for a number of Continuous Integration systems. Consult the [Setting up Continuous Integration](https://www.jhipster.tech/documentation-archive/v9.1.0/setting-up-ci/) page for more information.
|
||||||
|
|
||||||
|
## References
|
||||||
|
|
||||||
|
- [JHipster Homepage and latest documentation](https://www.jhipster.tech/)
|
||||||
|
- [JHipster 9.1.0 archive](https://www.jhipster.tech/documentation-archive/v9.1.0)
|
||||||
|
- [Using JHipster in development](https://www.jhipster.tech/documentation-archive/v9.1.0/development/)
|
||||||
|
- [Using Docker and Docker-Compose](https://www.jhipster.tech/documentation-archive/v9.1.0/docker-compose)
|
||||||
|
- [Using JHipster in production](https://www.jhipster.tech/documentation-archive/v9.1.0/production/)
|
||||||
|
- [Running tests page](https://www.jhipster.tech/documentation-archive/v9.1.0/running-tests/)
|
||||||
|
- [Code quality page](https://www.jhipster.tech/documentation-archive/v9.1.0/code-quality/)
|
||||||
|
- [Setting up Continuous Integration](https://www.jhipster.tech/documentation-archive/v9.1.0/setting-up-ci/)
|
||||||
|
- [Node.js](https://nodejs.org/)
|
||||||
|
- [NPM](https://www.npmjs.com/)
|
||||||
|
|
||||||
|
## Deployment Guide (Ubuntu server + aaPanel + Executable JAR)
|
||||||
|
|
||||||
|
### 1. Build the JAR file (on Windows)
|
||||||
|
Spring Boot applications come with a built-in web server, meaning you can package your entire application into a single executable `.jar` file!
|
||||||
|
Run the following command on your Windows PC to build the production-ready `.jar` file:
|
||||||
|
```powershell
|
||||||
|
./gradlew -Pprod clean bootJar
|
||||||
|
```
|
||||||
|
Alternatively, you can use the built-in npm script:
|
||||||
|
```powershell
|
||||||
|
npm run java:jar:prod
|
||||||
|
```
|
||||||
|
The generated `.jar` file will be located at `build/libs/sisvietnamvn-1.0.3.jar`.
|
||||||
|
|
||||||
|
### 2. Deploy and Run the application (on Ubuntu Server)
|
||||||
|
|
||||||
|
You have two main options to run the application on Ubuntu: using **aaPanel** or using standard **systemd**.
|
||||||
|
|
||||||
|
#### Option A: Using aaPanel (Recommended)
|
||||||
|
If you are using aaPanel, it is highly recommended to use its built-in **Java Project** manager to easily run the JAR file.
|
||||||
|
|
||||||
|
1. **Install Java 21**: Make sure Java 21 is installed on your Ubuntu server via aaPanel.
|
||||||
|
2. **Upload the JAR**: Upload the `sisvietnamvn-1.0.3.jar` file to a folder on your server (e.g., `/www/wwwroot/sisvietnam.vn/`).
|
||||||
|
3. **Add Java Project**: In aaPanel, go to **Website** -> **Java Project** -> **Add Java project**.
|
||||||
|
4. **Configure Project**:
|
||||||
|
- **Project Type**: `Spring_boot`
|
||||||
|
- **Project jar**: Select the `sisvietnamvn-1.0.3.jar` file you just uploaded.
|
||||||
|
- **Project Port**: `8080` (or whichever port your app is configured to use).
|
||||||
|
- **Run user**: `www` (or `root`)
|
||||||
|
- Click **Submit**. aaPanel will automatically run your JAR file in the background!
|
||||||
|
|
||||||
|
#### Option B: Using systemd (Standard Ubuntu)
|
||||||
|
If you prefer managing the server manually via terminal, you can register the JAR as a `systemd` service so it runs continuously in the background and starts automatically on boot.
|
||||||
|
|
||||||
|
1. **Upload the JAR**: Upload the `sisvietnamvn-1.0.3.jar` file to your server (e.g., `/var/www/sisvietnam/sisvietnamvn.jar`).
|
||||||
|
2. **Create the Service File**:
|
||||||
|
```bash
|
||||||
|
sudo nano /etc/systemd/system/sisvietnam.service
|
||||||
|
```
|
||||||
|
3. **Add Configuration**: Paste the following, making sure the `ExecStart` path matches where you put the jar.
|
||||||
|
```ini
|
||||||
|
[Unit]
|
||||||
|
Description=SIS Vietnam Spring Boot Application
|
||||||
|
After=syslog.target network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
ExecStart=/usr/bin/java -jar /var/www/sisvietnam/sisvietnamvn.jar
|
||||||
|
SuccessExitStatus=143
|
||||||
|
Restart=always
|
||||||
|
RestartSec=10
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
4. **Start the Service**: Run the following commands to reload systemd, enable the service to start on boot, and start it now:
|
||||||
|
```bash
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable sisvietnam.service
|
||||||
|
sudo systemctl start sisvietnam.service
|
||||||
|
```
|
||||||
|
5. **Check Status & Logs**:
|
||||||
|
- To check if it's running: `sudo systemctl status sisvietnam.service`
|
||||||
|
- To view the live terminal output: `sudo journalctl -u sisvietnam.service -f`
|
||||||
|
|
||||||
|
### 3. Configure NGINX Reverse Proxy (aaPanel)
|
||||||
|
When you set up a Java Project in aaPanel, it can automatically map your domain and set up a reverse proxy. If you need to verify or set it up manually:
|
||||||
|
|
||||||
|
1. **Add Site**: Go to aaPanel -> Website -> Add site. Enter your domain (e.g., `sisvietnam.vn`) and select **Static** for the PHP version.
|
||||||
|
2. **Setup Reverse Proxy**: Click "Settings" for the site -> "Reverse proxy" -> "Add reverse proxy".
|
||||||
|
- **Proxy name**: `JavaProxy`
|
||||||
|
- **Target URL**: `http://127.0.0.1:8080`
|
||||||
|
- **Sent Domain**: `$host`
|
||||||
|
3. **Spring Boot Proxy Trust**: Ensure Spring Boot knows it is behind a proxy so it can read client IPs correctly. In `src/main/resources/config/application-prod.yml`, verify this exists:
|
||||||
|
```yaml
|
||||||
|
server:
|
||||||
|
forward-headers-strategy: framework
|
||||||
|
```
|
||||||
|
4. **SSL**: Use aaPanel's built-in SSL manager to apply Let's Encrypt certificates to your NGINX site. You don't need to configure SSL inside Spring Boot itself.
|
||||||
|
|
||||||
|
|
||||||
|
debug mode
|
||||||
|
|
||||||
|
.\gradlew.bat bootRun --debug-jvm
|
||||||
|
## Troubleshooting: Oracle DB ORA-01017 during Development
|
||||||
|
If you encounter an `ORA-01017: invalid credential or not authorized` error when starting the application using `bootRun`, ensure the following steps have been taken:
|
||||||
|
|
||||||
|
### 1. Database & User Creation (Oracle 23ai Free)
|
||||||
|
You need to create a dedicated Pluggable Database (PDB) and a user inside the Oracle Docker container.
|
||||||
|
1. Connect to your LXC container host (e.g. `192.168.1.15`).
|
||||||
|
2. Open a `sqlplus` session inside the Oracle container:
|
||||||
|
```bash
|
||||||
|
docker exec -it sisvietnam-oracle-sisvietnam-oracle-1 sqlplus sys/Oracle123 as sysdba
|
||||||
|
```
|
||||||
|
3. Run the following SQL to create the PDB and User:
|
||||||
|
```sql
|
||||||
|
CREATE PLUGGABLE DATABASE sisvietnam ADMIN USER pdbadmin IDENTIFIED BY Oracle123 FILE_NAME_CONVERT = ('/opt/oracle/oradata/FREE/pdbseed/', '/opt/oracle/oradata/FREE/sisvietnam/');
|
||||||
|
ALTER PLUGGABLE DATABASE sisvietnam OPEN;
|
||||||
|
ALTER PLUGGABLE DATABASE sisvietnam SAVE STATE;
|
||||||
|
ALTER SESSION SET CONTAINER = sisvietnam;
|
||||||
|
CREATE USER sisvietnam IDENTIFIED BY "sisvietnam";
|
||||||
|
GRANT DBA TO sisvietnam;
|
||||||
|
GRANT ALL PRIVILEGES TO sisvietnam;
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Configure Spring Boot
|
||||||
|
Update your `application-dev.yml` to point to the newly created `sisvietnam` PDB:
|
||||||
|
```yaml
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
url: jdbc:oracle:thin:@192.168.1.15:1521/sisvietnam
|
||||||
|
username: sisvietnam
|
||||||
|
password: "sisvietnam"
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Check for Overriding Profiles (Important!)
|
||||||
|
By default, the JHipster setup might enable the `secret-samples` profile. This profile aggressively overrides the database username and blanks out the password. Check `src/main/resources/config/application-secret-samples.yml`. If you encounter an `ORA-01017`, ensure that the `dev` section in the `secret-samples` profile correctly mirrors your real credentials:
|
||||||
|
```yaml
|
||||||
|
spring:
|
||||||
|
config:
|
||||||
|
activate:
|
||||||
|
on-profile: dev
|
||||||
|
datasource:
|
||||||
|
username: sisvietnam
|
||||||
|
password: sisvietnam
|
||||||
|
```
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.DriverManager;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class TestOracleJDBC {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String jdbcUrl = "jdbc:oracle:thin:@192.168.1.15:1521/sisvietnam";
|
||||||
|
String username = "sisvietnam";
|
||||||
|
String password = "sisvietnam";
|
||||||
|
|
||||||
|
try {
|
||||||
|
Connection connection = DriverManager.getConnection(jdbcUrl, username, password);
|
||||||
|
System.out.println("Connection successful!");
|
||||||
|
connection.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
System.err.println("Connection failed!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
plugins {
|
||||||
|
id "java"
|
||||||
|
id "maven-publish"
|
||||||
|
id "idea"
|
||||||
|
id "eclipse"
|
||||||
|
alias(libs.plugins.gradle.git.properties)
|
||||||
|
alias(libs.plugins.spring.boot)
|
||||||
|
id "jhipster.docker-conventions"
|
||||||
|
id "jhipster.code-quality-conventions"
|
||||||
|
id "org.liquibase.gradle"
|
||||||
|
// jhipster-needle-gradle-plugins - JHipster will add additional gradle plugins here
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "com.sisvietnamvn.web"
|
||||||
|
version = "1.0.4"
|
||||||
|
|
||||||
|
description = ""
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility=21
|
||||||
|
targetCompatibility=21
|
||||||
|
}
|
||||||
|
assert System.properties["java.specification.version"] == "21" || "25"
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
// Local maven repository is required for libraries built locally with maven like development jhipster-bom.
|
||||||
|
// mavenLocal()
|
||||||
|
// jhipster-needle-gradle-repositories - JHipster will add additional repositories
|
||||||
|
}
|
||||||
|
|
||||||
|
apply from: "gradle/spring-boot.gradle"
|
||||||
|
apply from: "gradle/liquibase.gradle"
|
||||||
|
// jhipster-needle-gradle-apply-from - JHipster will add additional gradle scripts to be applied here
|
||||||
|
|
||||||
|
idea {
|
||||||
|
module {
|
||||||
|
excludeDirs += files("node_modules")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// eclipse {
|
||||||
|
// sourceSets {
|
||||||
|
// main {
|
||||||
|
// java {
|
||||||
|
// srcDirs += ["build/generated/sources/annotationProcessor/java/main"]
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation libs.jhipster.framework
|
||||||
|
implementation libs.mapstruct
|
||||||
|
implementation libs.springdoc.openapi.starter.webmvc.api
|
||||||
|
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.3"
|
||||||
|
implementation "com.oracle.database.jdbc:ojdbc8"
|
||||||
|
implementation "org.springframework.boot:spring-boot-h2console"
|
||||||
|
implementation "org.springframework.boot:spring-boot-jackson2"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter-actuator"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter-aspectj"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter-cache"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter-jackson"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter-liquibase"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter-mail"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter-security"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
|
||||||
|
implementation "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter-tomcat"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter-validation"
|
||||||
|
implementation "org.springframework.boot:spring-boot-starter-web"
|
||||||
|
implementation "org.springframework.security:spring-security-data"
|
||||||
|
implementation "com.fasterxml.jackson.datatype:jackson-datatype-hppc"
|
||||||
|
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
|
||||||
|
implementation "com.zaxxer:HikariCP"
|
||||||
|
implementation "io.micrometer:micrometer-registry-prometheus"
|
||||||
|
implementation "javax.cache:cache-api"
|
||||||
|
implementation "org.apache.commons:commons-lang3"
|
||||||
|
implementation "org.ehcache:ehcache::jakarta"
|
||||||
|
implementation "org.hibernate.orm:hibernate-core"
|
||||||
|
implementation "org.hibernate.orm:hibernate-jcache"
|
||||||
|
implementation "org.hibernate.validator:hibernate-validator"
|
||||||
|
implementation "tools.jackson.datatype:jackson-datatype-hibernate7"
|
||||||
|
implementation "tools.jackson.module:jackson-module-jaxb-annotations"
|
||||||
|
testImplementation(libs.archunit.junit5.api) {
|
||||||
|
exclude group: 'org.slf4j', module: 'slf4j-api'
|
||||||
|
}
|
||||||
|
testImplementation "org.springframework.boot:spring-boot-starter-jackson-test"
|
||||||
|
testImplementation "org.springframework.boot:spring-boot-starter-security-test"
|
||||||
|
testImplementation "org.springframework.boot:spring-boot-starter-test"
|
||||||
|
testImplementation "org.springframework.boot:spring-boot-starter-webmvc-test"
|
||||||
|
testImplementation "org.springframework.boot:spring-boot-test"
|
||||||
|
testImplementation "org.springframework.security:spring-security-test"
|
||||||
|
testImplementation "org.testcontainers:testcontainers"
|
||||||
|
testImplementation "org.testcontainers:testcontainers-jdbc"
|
||||||
|
testImplementation "org.testcontainers:testcontainers-junit-jupiter"
|
||||||
|
testRuntimeOnly(libs.archunit.junit5.engine) {
|
||||||
|
exclude group: 'org.slf4j', module: 'slf4j-api'
|
||||||
|
}
|
||||||
|
annotationProcessor libs.mapstruct.processor
|
||||||
|
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
|
||||||
|
annotationProcessor "org.glassfish.jaxb:jaxb-runtime"
|
||||||
|
annotationProcessor "org.hibernate.orm:hibernate-processor"
|
||||||
|
// jhipster-needle-gradle-dependency - JHipster will add additional dependencies here
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register('printSourceSets') {
|
||||||
|
doLast {
|
||||||
|
println "classesDirs = ${sourceSets.main.output.classesDirs.files}"
|
||||||
|
println "runtimeClasspath = ${sourceSets.main.runtimeClasspath.files}"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
./gradlew -Pprod clean bootJar
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
plugins {
|
||||||
|
id 'groovy-gradle-plugin'
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation libs.jib.plugin
|
||||||
|
implementation libs.modernizer.plugin
|
||||||
|
implementation libs.nohttp.plugin
|
||||||
|
implementation libs.sonarqube.plugin
|
||||||
|
implementation libs.spotless.plugin
|
||||||
|
// jhipster-needle-gradle-dependency - JHipster will add additional dependencies for convention plugins here
|
||||||
|
// jhipster-needle-gradle-build-src-dependency - Deprecated: JHipster will add additional dependencies for convention plugins here
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
[versions]
|
||||||
|
# jhipster-needle-gradle-dependency-catalog-version - JHipster will add additional versions for convention plugins here
|
||||||
|
# jhipster-needle-gradle-build-src-dependency-catalog-version - Deprecated: JHipster will add additional versions for convention plugins here
|
||||||
|
|
||||||
|
[libraries]
|
||||||
|
jib-plugin = { module = "com.google.cloud.tools:jib-gradle-plugin", version = "3.5.3" }
|
||||||
|
modernizer-plugin = { module = "com.github.andygoossens:gradle-modernizer-plugin", version = "1.13.0" }
|
||||||
|
nohttp-plugin = { module = "io.spring.nohttp:nohttp-gradle", version = "0.0.11" }
|
||||||
|
sonarqube-plugin = { module = "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin", version = "7.3.0.8198" }
|
||||||
|
spotless-plugin = { module = "com.diffplug.spotless:spotless-plugin-gradle", version = "8.5.1" }
|
||||||
|
# jhipster-needle-gradle-dependency-catalog-libraries - JHipster will add additional libraries versions
|
||||||
|
|
||||||
|
[plugins]
|
||||||
|
# jhipster-needle-gradle-dependency-catalog-plugins - JHipster will add additional plugins versions
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
plugins {
|
||||||
|
id "jacoco"
|
||||||
|
id "org.sonarqube"
|
||||||
|
id "com.diffplug.spotless"
|
||||||
|
id "com.github.andygoossens.gradle-modernizer-plugin"
|
||||||
|
id "io.spring.nohttp"
|
||||||
|
}
|
||||||
|
|
||||||
|
jacoco {
|
||||||
|
toolVersion = "${libs.versions.jacoco.get()}"
|
||||||
|
}
|
||||||
|
|
||||||
|
jacocoTestReport {
|
||||||
|
executionData(tasks.withType(Test))
|
||||||
|
classDirectories.from = files(sourceSets.main.output.classesDirs)
|
||||||
|
sourceDirectories.from = files(sourceSets.main.java.srcDirs)
|
||||||
|
|
||||||
|
reports {
|
||||||
|
xml.required = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
file("sonar-project.properties").withReader {
|
||||||
|
Properties sonarProperties = new Properties()
|
||||||
|
sonarProperties.load(it)
|
||||||
|
|
||||||
|
sonarProperties.each { key, value ->
|
||||||
|
sonarqube {
|
||||||
|
properties {
|
||||||
|
property(key, value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spotless {
|
||||||
|
java {
|
||||||
|
target 'src/*/java/**/*.java'
|
||||||
|
// removeUnusedImports()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
modernizer {
|
||||||
|
failOnViolations = true
|
||||||
|
includeTestClasses = true
|
||||||
|
}
|
||||||
|
|
||||||
|
checkstyle {
|
||||||
|
toolVersion = "${libs.versions.checkstyle.get()}"
|
||||||
|
configFile = file("checkstyle.xml")
|
||||||
|
ignoreFailures = true
|
||||||
|
checkstyleTest.enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
|
nohttp {
|
||||||
|
source.include("build.gradle", "README.md")
|
||||||
|
}
|
||||||
|
|
||||||
|
// workaround for https://github.com/checkstyle/checkstyle/issues/14123
|
||||||
|
configurations.checkstyle {
|
||||||
|
resolutionStrategy.capabilitiesResolution.withCapability("com.google.collections:google-collections") {
|
||||||
|
select("com.google.guava:guava:0")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
plugins {
|
||||||
|
id "com.google.cloud.tools.jib"
|
||||||
|
}
|
||||||
|
|
||||||
|
jib {
|
||||||
|
configurationName = "productionRuntimeClasspath"
|
||||||
|
from {
|
||||||
|
image = "eclipse-temurin:25-jre-noble"
|
||||||
|
platforms {
|
||||||
|
platform {
|
||||||
|
architecture = "${findProperty('jibArchitecture') ?: 'amd64'}"
|
||||||
|
os = "linux"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
image = "sisvietnamvn:latest"
|
||||||
|
}
|
||||||
|
container {
|
||||||
|
entrypoint = ["bash", "-c", "/entrypoint.sh"]
|
||||||
|
ports = ["8080"]
|
||||||
|
environment = [
|
||||||
|
SPRING_OUTPUT_ANSI_ENABLED: "ALWAYS",
|
||||||
|
JHIPSTER_SLEEP: "0"
|
||||||
|
]
|
||||||
|
creationTime = "USE_CURRENT_TIMESTAMP"
|
||||||
|
user = 1000
|
||||||
|
}
|
||||||
|
extraDirectories {
|
||||||
|
paths = file("src/main/docker/jib")
|
||||||
|
permissions = ["/entrypoint.sh": "755"]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
||||||
|
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||||
|
<module name="Checker">
|
||||||
|
|
||||||
|
<!-- Configure checker to use UTF-8 encoding -->
|
||||||
|
<property name="charset" value="UTF-8"/>
|
||||||
|
<!-- Configure checker to run on files with these extensions -->
|
||||||
|
<property name="fileExtensions" value=""/>
|
||||||
|
<!-- For detailed checkstyle configuration, see https://github.com/spring-io/nohttp/tree/master/nohttp-checkstyle -->
|
||||||
|
<module name="io.spring.nohttp.checkstyle.check.NoHttpCheck">
|
||||||
|
</module>
|
||||||
|
<module name="TreeWalker">
|
||||||
|
<module name="MissingJavadocMethod">
|
||||||
|
<!-- Disable Javadoc requirement as we want to follow "clean code" guidelines and classes, methods and arguments names should be self-explanatory -->
|
||||||
|
<property name="allowMissingPropertyJavadoc" value="true"/>
|
||||||
|
</module>
|
||||||
|
</module>
|
||||||
|
<!-- Allow suppression with comments
|
||||||
|
// CHECKSTYLE:OFF
|
||||||
|
... ignored content ...
|
||||||
|
// CHECKSTYLE:ON
|
||||||
|
-->
|
||||||
|
<module name="SuppressWithPlainTextCommentFilter"/>
|
||||||
|
</module>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
rootProject.name=sisvietnamvn
|
||||||
|
profile=dev
|
||||||
|
|
||||||
|
liquibaseVersion=5.0.2
|
||||||
|
liquibaseTaskPrefix=liquibase
|
||||||
|
liquibasePluginVersion=3.1.0
|
||||||
|
# jhipster-needle-gradle-property - JHipster will add additional properties here
|
||||||
|
|
||||||
|
## below are some of the gradle performance improvement settings that can be used as required, these are not enabled by default
|
||||||
|
|
||||||
|
## The Gradle daemon aims to improve the startup and execution time of Gradle.
|
||||||
|
## The daemon is enabled by default in Gradle 3+ setting this to false will disable this.
|
||||||
|
## https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:ways_to_disable_gradle_daemon
|
||||||
|
## uncomment the below line to disable the daemon
|
||||||
|
|
||||||
|
#org.gradle.daemon=false
|
||||||
|
|
||||||
|
## Specifies the JVM arguments used for the daemon process.
|
||||||
|
## The setting is particularly useful for tweaking memory settings.
|
||||||
|
## Default value: -Xmx1024m -XX:MaxPermSize=256m
|
||||||
|
## uncomment the below line to override the daemon defaults
|
||||||
|
|
||||||
|
#org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||||
|
|
||||||
|
## When configured, Gradle will run in incubating parallel mode.
|
||||||
|
## This option should only be used with decoupled projects. More details, visit
|
||||||
|
## http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
|
## uncomment the below line to enable parallel mode
|
||||||
|
|
||||||
|
#org.gradle.parallel=true
|
||||||
|
|
||||||
|
## Enables new incubating mode that makes Gradle selective when configuring projects.
|
||||||
|
## Only relevant projects are configured which results in faster builds for large multi-projects.
|
||||||
|
## http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand
|
||||||
|
## uncomment the below line to enable the selective mode
|
||||||
|
|
||||||
|
#org.gradle.configureondemand=true
|
||||||
|
|
||||||
|
org.gradle.warning.mode=all
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
[versions]
|
||||||
|
mapstruct = "1.6.3"
|
||||||
|
archunit-junit5 = "1.4.2"
|
||||||
|
checkstyle = "13.4.2"
|
||||||
|
jacoco = "0.8.14"
|
||||||
|
# jhipster-needle-gradle-dependency-catalog-version - JHipster will add additional versions for convention plugins here
|
||||||
|
|
||||||
|
[libraries]
|
||||||
|
jhipster-framework = { module = "tech.jhipster:jhipster-framework", version = "9.1.0" }
|
||||||
|
springdoc-openapi-starter-webmvc-api = { module = "org.springdoc:springdoc-openapi-starter-webmvc-api", version = "3.0.3" }
|
||||||
|
archunit-junit5-api = { module = "com.tngtech.archunit:archunit-junit5-api", version.ref = "archunit-junit5" }
|
||||||
|
archunit-junit5-engine = { module = "com.tngtech.archunit:archunit-junit5-engine", version.ref = "archunit-junit5" }
|
||||||
|
mapstruct = { module = "org.mapstruct:mapstruct", version.ref = "mapstruct" }
|
||||||
|
mapstruct-processor = { module = "org.mapstruct:mapstruct-processor", version.ref = "mapstruct" }
|
||||||
|
# jhipster-needle-gradle-dependency-catalog-libraries - JHipster will add additional libraries versions
|
||||||
|
|
||||||
|
[plugins]
|
||||||
|
gradle-git-properties = { id = "com.gorylenko.gradle-git-properties", version = "3.0.3" }
|
||||||
|
spring-boot = { id = "org.springframework.boot", version = "4.0.6" }
|
||||||
|
# jhipster-needle-gradle-dependency-catalog-plugins - JHipster will add additional plugins versions
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
configurations {
|
||||||
|
liquibaseRuntime.extendsFrom sourceSets.main.compileClasspath
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation "org.liquibase:liquibase-core"
|
||||||
|
liquibaseRuntime "org.liquibase:liquibase-core"
|
||||||
|
// Dependency required to parse options. Refer to https://github.com/liquibase/liquibase-gradle-plugin/tree/Release_2.2.0#news.
|
||||||
|
liquibaseRuntime "info.picocli:picocli:4.7.7"
|
||||||
|
if (project.hasProperty("prod") || project.hasProperty("gae")) {
|
||||||
|
liquibaseRuntime "com.oracle.database.jdbc:ojdbc8"
|
||||||
|
}
|
||||||
|
liquibaseRuntime "org.liquibase.ext:liquibase-hibernate6:${liquibaseVersion}"
|
||||||
|
// jhipster-needle-gradle-dependency - JHipster will add additional dependencies here
|
||||||
|
}
|
||||||
|
|
||||||
|
project.ext.diffChangelogFile = "src/main/resources/config/liquibase/changelog/" + new Date().format("yyyyMMddHHmmss") + "_changelog.xml"
|
||||||
|
if (!project.hasProperty("runList")) {
|
||||||
|
project.ext.runList = "main"
|
||||||
|
}
|
||||||
|
|
||||||
|
liquibase {
|
||||||
|
activities {
|
||||||
|
main {
|
||||||
|
driver "org.h2.Driver"
|
||||||
|
url "jdbc:h2:file:./build/h2db/db/sisvietnamvn"
|
||||||
|
username "sisvietnamvn"
|
||||||
|
changelogFile "src/main/resources/config/liquibase/master.xml"
|
||||||
|
logLevel "debug"
|
||||||
|
classpath "src/main/resources/"
|
||||||
|
}
|
||||||
|
diffLog {
|
||||||
|
driver "org.h2.Driver"
|
||||||
|
url "jdbc:h2:file:./build/h2db/db/sisvietnamvn"
|
||||||
|
username "sisvietnamvn"
|
||||||
|
changelogFile project.ext.diffChangelogFile
|
||||||
|
referenceUrl "hibernate:spring:com.sisvietnamvn.web.domain?dialect=org.hibernate.dialect.H2Dialect&hibernate.physical_naming_strategy=org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.hibernate.SpringImplicitNamingStrategy"
|
||||||
|
logLevel "debug"
|
||||||
|
classpath layout.buildDirectory.dir("classes/java/main").get().asFile.absolutePath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
runList = project.ext.runList
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named('liquibaseDiff').configure { dependsOn(tasks.named('compileJava')) }
|
||||||
|
tasks.named('liquibaseDiffChangelog').configure { dependsOn(tasks.named('compileJava')) }
|
||||||
|
|
||||||
|
ext {
|
||||||
|
if (project.hasProperty("no-liquibase")) {
|
||||||
|
springProfiles += ",no-liquibase"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
dependencies {
|
||||||
|
developmentOnly "org.springframework.boot:spring-boot-devtools"
|
||||||
|
implementation "com.h2database:h2"
|
||||||
|
// jhipster-needle-gradle-dependency - JHipster will add additional dependencies here
|
||||||
|
}
|
||||||
|
|
||||||
|
springBoot {
|
||||||
|
buildInfo {
|
||||||
|
excludes = ['time']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bootRun {
|
||||||
|
args = ["--spring.profiles.active=${springProfiles}"]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
processResources {
|
||||||
|
inputs.property('version', version)
|
||||||
|
inputs.property('springProfiles', springProfiles)
|
||||||
|
filesMatching("**/application.yml") {
|
||||||
|
filter {
|
||||||
|
it.replace("@project.version@", version)
|
||||||
|
}
|
||||||
|
filter {
|
||||||
|
it.replace("@spring.profiles.active@", springProfiles)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def integrationTest = tasks.register('integrationTest', Test) {
|
||||||
|
maxHeapSize = "1G"
|
||||||
|
useJUnitPlatform()
|
||||||
|
description = "Execute integration tests."
|
||||||
|
group = "verification"
|
||||||
|
include "**/*IT*", "**/*IntTest*"
|
||||||
|
testLogging {
|
||||||
|
events = ['FAILED', 'SKIPPED']
|
||||||
|
exceptionFormat = "full"
|
||||||
|
}
|
||||||
|
systemProperty('spring.profiles.active', springTestProfiles)
|
||||||
|
// uncomment if the tests reports are not generated
|
||||||
|
// see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
|
||||||
|
// ignoreFailures true
|
||||||
|
reports.html.required = false
|
||||||
|
dependsOn(tasks.named('test'))
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
dependencies {
|
||||||
|
testImplementation "org.testcontainers:testcontainers-oracle-xe"
|
||||||
|
// jhipster-needle-gradle-dependency - JHipster will add additional dependencies here
|
||||||
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
if (project.hasProperty("api-docs")) {
|
||||||
|
springProfiles += ",api-docs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
springBoot {
|
||||||
|
buildInfo()
|
||||||
|
}
|
||||||
|
|
||||||
|
bootRun {
|
||||||
|
args = ["--spring.profiles.active=${springProfiles}"]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
processResources {
|
||||||
|
inputs.property('version', version)
|
||||||
|
inputs.property('springProfiles', springProfiles)
|
||||||
|
filesMatching("**/application.yml") {
|
||||||
|
filter {
|
||||||
|
it.replace("@project.version@", version)
|
||||||
|
}
|
||||||
|
filter {
|
||||||
|
it.replace("@spring.profiles.active@", springProfiles)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def integrationTest = tasks.register('integrationTest', Test) {
|
||||||
|
maxHeapSize = "1G"
|
||||||
|
useJUnitPlatform()
|
||||||
|
description = "Execute integration tests."
|
||||||
|
group = "verification"
|
||||||
|
include "**/*IT*", "**/*IntTest*"
|
||||||
|
testLogging {
|
||||||
|
events = ['FAILED', 'SKIPPED']
|
||||||
|
exceptionFormat = "full"
|
||||||
|
}
|
||||||
|
systemProperty('spring.profiles.active', springTestProfiles)
|
||||||
|
// uncomment if the tests reports are not generated
|
||||||
|
// see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
|
||||||
|
// ignoreFailures true
|
||||||
|
reports.html.required = false
|
||||||
|
dependsOn(tasks.named('test'))
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
ext {
|
||||||
|
if (project.hasProperty("prod")) {
|
||||||
|
springProfiles = "prod"
|
||||||
|
springTestProfiles = "test,testprod"
|
||||||
|
} else {
|
||||||
|
springProfiles = "dev"
|
||||||
|
springTestProfiles = "test,testdev"
|
||||||
|
}
|
||||||
|
if (project.hasProperty("tls")) {
|
||||||
|
springProfiles += ",tls"
|
||||||
|
}
|
||||||
|
if (project.hasProperty("e2e")) {
|
||||||
|
springProfiles += ",e2e"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'io.spring.dependency-management'
|
||||||
|
|
||||||
|
// jhipster-needle-gradle-apply-from - JHipster will add additional gradle scripts to be applied here
|
||||||
|
|
||||||
|
if (project.hasProperty("prod")) {
|
||||||
|
apply from: "gradle/profile_prod.gradle"
|
||||||
|
} else {
|
||||||
|
apply from: "gradle/profile_dev.gradle"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (project.hasProperty("war")) {
|
||||||
|
apply from: "gradle/war.gradle"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
defaultTasks "bootRun"
|
||||||
|
|
||||||
|
springBoot {
|
||||||
|
mainClass = "com.sisvietnamvn.web.SisvietnamvnApp"
|
||||||
|
}
|
||||||
|
|
||||||
|
test {
|
||||||
|
useJUnitPlatform()
|
||||||
|
exclude "**/*IT*", "**/*IntTest*"
|
||||||
|
testLogging {
|
||||||
|
events = ['FAILED', 'SKIPPED']
|
||||||
|
exceptionFormat = "full"
|
||||||
|
}
|
||||||
|
jvmArgs += '-Xmx512m'
|
||||||
|
|
||||||
|
systemProperty('spring.profiles.active', springTestProfiles)
|
||||||
|
|
||||||
|
// uncomment if the tests reports are not generated
|
||||||
|
// see https://github.com/jhipster/generator-jhipster/pull/2771 and https://github.com/jhipster/generator-jhipster/pull/4484
|
||||||
|
// ignoreFailures true
|
||||||
|
reports.html.required = false
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named('check').configure { dependsOn(tasks.named('integrationTest')) }
|
||||||
|
|
||||||
|
tasks.register('testReport', TestReport) {
|
||||||
|
destinationDirectory = layout.buildDirectory.dir("reports/tests")
|
||||||
|
testResults.from(test)
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register('integrationTestReport', TestReport) {
|
||||||
|
destinationDirectory = layout.buildDirectory.dir("reports/tests")
|
||||||
|
testResults.from(tasks.named('integrationTest'))
|
||||||
|
}
|
||||||
|
|
||||||
|
gitProperties {
|
||||||
|
failOnNoGitDirectory = false
|
||||||
|
keys = ["git.branch", "git.commit.id.abbrev", "git.commit.id.describe"]
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named('generateGitProperties') {
|
||||||
|
outputs.doNotCacheIf("Task is always executed") { true }
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register('cleanResources', Delete) {
|
||||||
|
delete "build/resources"
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named('compileJava').configure { dependsOn(tasks.named('processResources')) }
|
||||||
|
tasks.named('processResources').configure { dependsOn(tasks.named('bootBuildInfo')) }
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
apply plugin: "war"
|
||||||
|
|
||||||
|
bootWar {
|
||||||
|
mainClass = "com.sisvietnamvn.web.SisvietnamvnApp"
|
||||||
|
includes = ["WEB-INF/**", "META-INF/**"]
|
||||||
|
}
|
||||||
|
|
||||||
|
war {
|
||||||
|
enabled = true
|
||||||
|
archiveExtension = "war.original"
|
||||||
|
includes = ["WEB-INF/**", "META-INF/**"]
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
|||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
dependencies {
|
||||||
|
implementation "io.micrometer:micrometer-tracing-bridge-brave"
|
||||||
|
implementation "io.zipkin.reporter2:zipkin-reporter-brave"
|
||||||
|
}
|
||||||
Vendored
+245
@@ -0,0 +1,245 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright © 2015-2021 the original authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh Gradle
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
app_path=$0
|
||||||
|
|
||||||
|
# Need this for daisy-chained symlinks.
|
||||||
|
while
|
||||||
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
|
[ -h "$app_path" ]
|
||||||
|
do
|
||||||
|
ls=$( ls -ld "$app_path" )
|
||||||
|
link=${ls#*' -> '}
|
||||||
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD=maximum
|
||||||
|
|
||||||
|
warn () {
|
||||||
|
echo "$*"
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
die () {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
nonstop=false
|
||||||
|
case "$( uname )" in #(
|
||||||
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
|
Darwin* ) darwin=true ;; #(
|
||||||
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
|
NONSTOP* ) nonstop=true ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||||
|
else
|
||||||
|
JAVACMD=$JAVA_HOME/bin/java
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD=java
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
|
case $MAX_FD in #(
|
||||||
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
|
warn "Could not query maximum file descriptor limit"
|
||||||
|
esac
|
||||||
|
case $MAX_FD in #(
|
||||||
|
'' | soft) :;; #(
|
||||||
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
|
# * args from the command line
|
||||||
|
# * the main class name
|
||||||
|
# * -classpath
|
||||||
|
# * -D...appname settings
|
||||||
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||||
|
|
||||||
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Collect all arguments for the java command;
|
||||||
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
|
# double quotes to make sure that they get re-expanded; and
|
||||||
|
# * put everything else in single quotes, so that it's not re-expanded.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-classpath "$CLASSPATH" \
|
||||||
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
||||||
Vendored
+92
@@ -0,0 +1,92 @@
|
|||||||
|
@rem
|
||||||
|
@rem Copyright 2015 the original author or authors.
|
||||||
|
@rem
|
||||||
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@rem you may not use this file except in compliance with the License.
|
||||||
|
@rem You may obtain a copy of the License at
|
||||||
|
@rem
|
||||||
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@rem
|
||||||
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
|
@rem limitations under the License.
|
||||||
|
@rem
|
||||||
|
|
||||||
|
@if "%DEBUG%"=="" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
|
exit /b %EXIT_CODE%
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
Generated
+7382
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
"name": "sisvietnamvn",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"description": "Description for sisvietnamvn",
|
||||||
|
"license": "UNLICENSED",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"app:start": "./gradlew",
|
||||||
|
"app:up": "docker compose -f src/main/docker/app.yml up --wait",
|
||||||
|
"backend:build-cache": "npm run backend:info && npm run backend:nohttp:test && npm run ci:e2e:package -- -x webapp -x webapp_test",
|
||||||
|
"backend:doc:test": "./gradlew javadoc ",
|
||||||
|
"backend:info": "./gradlew -v",
|
||||||
|
"backend:nohttp:test": "./gradlew checkstyleNohttp ",
|
||||||
|
"backend:start": "./gradlew ",
|
||||||
|
"backend:unit:test": "./gradlew test integrationTest -Dlogging.level.ROOT=OFF -Dlogging.level.tech.jhipster=OFF -Dlogging.level.com.sisvietnamvn.web=OFF -Dlogging.level.org.springframework=OFF -Dlogging.level.org.springframework.web=OFF -Dlogging.level.org.springframework.security=OFF",
|
||||||
|
"ci:backend:test": "npm run backend:info && npm run backend:doc:test && npm run backend:nohttp:test && npm run backend:unit:test -- -P$npm_package_config_default_environment",
|
||||||
|
"ci:e2e:package": "npm run java:$npm_package_config_packaging:$npm_package_config_default_environment -- -Pe2e -Denforcer.skip=true",
|
||||||
|
"postci:e2e:package": "cp build/libs/*.$npm_package_config_packaging e2e.$npm_package_config_packaging",
|
||||||
|
"ci:e2e:prepare": "npm run ci:e2e:prepare:docker",
|
||||||
|
"ci:e2e:prepare:docker": "npm run services:up --if-present && docker ps -a",
|
||||||
|
"preci:e2e:server:start": "npm run services:db:await --if-present && npm run services:others:await --if-present",
|
||||||
|
"ci:e2e:server:start": "java -jar e2e.$npm_package_config_packaging --spring.profiles.active=e2e,secret-samples,$npm_package_config_default_environment -Dlogging.level.ROOT=OFF -Dlogging.level.tech.jhipster=OFF -Dlogging.level.com.sisvietnamvn.web=OFF -Dlogging.level.org.springframework=OFF -Dlogging.level.org.springframework.web=OFF -Dlogging.level.org.springframework.security=OFF --logging.level.org.springframework.web=ERROR",
|
||||||
|
"ci:e2e:teardown": "npm run ci:e2e:teardown:docker --if-present",
|
||||||
|
"ci:server:await": "echo \"Waiting for server at port $npm_package_config_backend_port to start\" && wait-on -t 180000 http-get://127.0.0.1:$npm_package_config_backend_port/management/health && echo \"Server at port $npm_package_config_backend_port started\"",
|
||||||
|
"docker:db:up": "echo \"Docker for db oracle not configured for application sisvietnamvn\"",
|
||||||
|
"java:docker": "./gradlew bootJar -Pprod jibDockerBuild",
|
||||||
|
"java:docker:arm64": "npm run java:docker -- -PjibArchitecture=arm64",
|
||||||
|
"java:docker:dev": "npm run java:docker -- -Pdev,webapp",
|
||||||
|
"java:docker:prod": "npm run java:docker -- -Pprod",
|
||||||
|
"java:jar": "./gradlew bootJar -x test -x integrationTest",
|
||||||
|
"java:jar:dev": "npm run java:jar -- -Pdev,webapp",
|
||||||
|
"java:jar:prod": "npm run java:jar -- -Pprod",
|
||||||
|
"java:war": "./gradlew bootWar -Pwar -x test -x integrationTest",
|
||||||
|
"java:war:dev": "npm run java:war -- -Pdev,webapp",
|
||||||
|
"java:war:prod": "npm run java:war -- -Pprod"
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"backend_port": 8080,
|
||||||
|
"default_environment": "prod",
|
||||||
|
"packaging": "jar"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"generator-jhipster": "9.1.0",
|
||||||
|
"prettier": "3.8.3",
|
||||||
|
"prettier-plugin-java": "2.9.6",
|
||||||
|
"prettier-plugin-packagejson": "3.0.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=24.16.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
// jhipster-needle-gradle-plugin-management-repositories - JHipster will add additional entries here
|
||||||
|
}
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath "org.liquibase:liquibase-core:${liquibaseVersion}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
plugins {
|
||||||
|
id "org.liquibase.gradle" version "${liquibasePluginVersion}"
|
||||||
|
// jhipster-needle-gradle-plugin-management-plugins - JHipster will add additional entries here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.name = "sisvietnamvn"
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
# TÀI LIỆU YÊU CẦU WEBSITE BỆNH VIỆN S.I.S CẦN THƠ
|
||||||
|
*(Trích xuất từ file WEBSITE BENH VIEN.xlsx)*
|
||||||
|
|
||||||
|
Tài liệu này đóng vai trò là kim chỉ nam cho Developer (IDE Code) để thiết kế kiến trúc hệ thống, cơ sở dữ liệu và giao diện người dùng cho Website Bệnh viện Đa khoa Quốc tế S.I.S Cần Thơ.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. TỔNG QUAN DỰ ÁN
|
||||||
|
### 1.1. Đối tượng khách hàng mục tiêu
|
||||||
|
* **Độ tuổi:** Trung niên (Từ 30 - 60 tuổi). Do đó, UI/UX cần rõ ràng, dễ nhìn, chữ to, dễ thao tác.
|
||||||
|
* **Hành vi:** Có nhu cầu và quan tâm đặc biệt đến việc chăm sóc sức khỏe đối với các bệnh: **Đột quỵ, Tim mạch, Cơ xương khớp**.
|
||||||
|
|
||||||
|
### 1.2. Mục đích cốt lõi của Website
|
||||||
|
1. Cung cấp thông tin Giới thiệu về Dịch vụ Bệnh viện.
|
||||||
|
2. Quảng bá thương hiệu S.I.S.
|
||||||
|
3. Đẩy mạnh các chiến dịch PR & Marketing trực tuyến.
|
||||||
|
4. Cung cấp kiến thức giáo dục sức khỏe cộng đồng.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. YÊU CẦU THIẾT KẾ VÀ KỸ THUẬT (TECHNICAL SPECS)
|
||||||
|
* **Ngôn ngữ:** Hỗ trợ Song ngữ (Tiếng Anh - Tiếng Việt). Cần thiết lập cấu trúc i18n cho Frontend.
|
||||||
|
* **Bố cục (Layout):**
|
||||||
|
* Chia cột rõ ràng (Trái / Phải).
|
||||||
|
* **Cột trái:** Hiển thị luồng Tin tức Bệnh viện.
|
||||||
|
* **Cột phải:** Hiển thị các Banner Gói khám nổi bật hoặc Chương trình Khuyến mãi mới nhất.
|
||||||
|
* **Đa phương tiện:** Tích hợp âm thanh vào các Banner/Cover chính.
|
||||||
|
* **Tính năng lõi:**
|
||||||
|
* **Tích hợp cổng Thanh toán trực tuyến** (VNPAY, Paypal... do Kế toán và IT quyết định).
|
||||||
|
* Check chính tả tự động.
|
||||||
|
* **Tối ưu hóa (SEO & Performance):**
|
||||||
|
* Tốc độ tải trang nhanh (Cần tối ưu dung lượng ảnh Slider/Banner).
|
||||||
|
* Truy xuất dữ liệu chuẩn SEO và tích hợp Google Analytics, Google Search Console.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. CẤU TRÚC SITEMAP & TÍNH NĂNG CHI TIẾT
|
||||||
|
|
||||||
|
### I. VỀ CHÚNG TÔI
|
||||||
|
Trọng tâm sử dụng đồ họa trực quan (Infographic) để gây ấn tượng.
|
||||||
|
* **Giới thiệu Bệnh viện:** Thông tin Ban giám đốc.
|
||||||
|
* **Giá trị cốt lõi / Tầm nhìn / Sứ mệnh**
|
||||||
|
* **Lịch sử hình thành:** Hiển thị dưới dạng Infographic **Chuỗi thời gian (Timeline)**.
|
||||||
|
* **Giải thưởng:** Hiển thị dưới dạng Infographic Chuỗi thời gian. Cập nhật liên tục.
|
||||||
|
* **Sơ đồ tổ chức:** Hiển thị dưới dạng Infographic **Mạng lưới (Network/Tree)**.
|
||||||
|
|
||||||
|
### II. DỊCH VỤ BỆNH VIỆN
|
||||||
|
* **Gói tầm soát sức khỏe:** Các trang giới thiệu gói khám riêng biệt. (Giá có thể thay đổi).
|
||||||
|
* **Dịch vụ nổi bật:** Kỹ thuật đặt stent + coil, Hút huyết khối, Nội soi khớp/Super bath, Phẫu thuật bắt cầu động mạch cảnh, Phẫu thuật mở sọ giải áp, Phục hồi chức năng.
|
||||||
|
* **Trang thiết bị:** MRI, DSA, Hệ thống xét nghiệm, Phòng mổ Hybrid, Cấp cứu di động + Ca nô.
|
||||||
|
* **Tổng đài cấp cứu Đột quỵ**
|
||||||
|
* **Đặt lịch khám:** Form cố định. Danh sách bác sĩ thay đổi theo tuần. Cần lấy dữ liệu từ hệ thống Call Center.
|
||||||
|
* **Thanh toán trực tuyến:** Module thanh toán.
|
||||||
|
|
||||||
|
### III. TÌM BÁC SĨ
|
||||||
|
Trang danh bạ Bác sĩ toàn viện. Cấu trúc Profile bác sĩ bao gồm:
|
||||||
|
1. Họ và tên
|
||||||
|
2. Chuyên khoa
|
||||||
|
3. Kinh nghiệm làm việc
|
||||||
|
4. **Hệ thống đánh giá/Review:** Khách hàng có thể để lại Nhận xét (Gồm Họ tên, SĐT, Email). Cam kết bảo mật thông tin.
|
||||||
|
5. Nút "Đăng ký khám" trỏ về tính năng Đặt lịch.
|
||||||
|
|
||||||
|
### IV. CHUYÊN KHOA
|
||||||
|
* Danh sách tất cả các chuyên khoa và phòng ban tại bệnh viện.
|
||||||
|
|
||||||
|
### V. GÓC KHÁCH HÀNG
|
||||||
|
* **Giờ làm việc**
|
||||||
|
* **Khám bệnh Ngoại trú:** Quy trình khám, Hướng dẫn BHYT, Hướng dẫn khám Dịch vụ.
|
||||||
|
* **Điều trị Nội trú:** Dịch vụ phòng nội trú, Thông tin thăm bệnh, Thông tin nhập/xuất viện.
|
||||||
|
* **Thông tin viện phí:** Bảng biểu phí (Cập nhật thường xuyên bởi Kế toán).
|
||||||
|
* **Hỏi Bác sĩ S.I.S:** Cung cấp Form thu thập câu hỏi gồm các trường:
|
||||||
|
* *Họ tên, SĐT, Email.*
|
||||||
|
* *Chủ đề dropdown:* Thần kinh-Đột quỵ, Tim mạch, Cơ xương khớp, Phục hồi chức năng, Khác.
|
||||||
|
* *Ô nhập Câu hỏi.*
|
||||||
|
|
||||||
|
### VI. GÓC TRUYỀN THÔNG
|
||||||
|
Cho phép khách hàng để lại bình luận/phản hồi ở mọi bài viết.
|
||||||
|
* **Tin tức:** Blog tin bài cập nhật hàng tuần.
|
||||||
|
* **Cẩm nang sức khỏe:** Các lời khuyên của bác sĩ (Đột quỵ, Tim mạch, Cơ xương khớp...).
|
||||||
|
* **Câu chuyện bệnh nhân:** Bài viết hoặc Video thực tế.
|
||||||
|
* **Góc Tri ân:** Nơi đăng tải thư cảm ơn của bệnh nhân.
|
||||||
|
|
||||||
|
### VII. KHÁC
|
||||||
|
* Hoạt động từ thiện / Hoạt động nội bộ
|
||||||
|
* Chương trình Đào tạo / Tuyển dụng
|
||||||
|
* Liên hệ
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> **Ghi chú cho Developer:**
|
||||||
|
> Dựa trên yêu cầu này, hệ thống cần một CMS linh hoạt (như đã phân tích là WordPress hoặc hệ thống nội bộ). DB Schema cần chú trọng các bảng: `Doctors`, `Specialties`, `Services/Packages`, `News/Blogs`, `Questions`, và `Reviews`. Phân quyền Backend cần tách biệt rõ ràng cho `Team Truyền thông` (quản lý bài viết) và `Team Kế toán` (Quản lý giá dịch vụ/thanh toán).
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
sonar.projectKey = sisvietnamvn
|
||||||
|
sonar.projectName = sisvietnamvn generated by jhipster
|
||||||
|
|
||||||
|
# Typescript tests files must be inside sources and tests, otherwise `INFO: Test execution data ignored for 80 unknown
|
||||||
|
# files, including:` is shown.
|
||||||
|
sonar.sources = src
|
||||||
|
sonar.tests = src
|
||||||
|
sonar.host.url = http://localhost:9001
|
||||||
|
sonar.sourceEncoding = UTF-8
|
||||||
|
|
||||||
|
sonar.test.inclusions = src/test/**/*.*
|
||||||
|
sonar.junit.reportPaths = build/test-results/test,build/test-results/integrationTest
|
||||||
|
sonar.java.codeCoveragePlugin = jacoco
|
||||||
|
sonar.coverage.jacoco.xmlReportPaths = build/reports/jacoco/test/jacocoTestReport.xml
|
||||||
|
|
||||||
|
sonar.issue.ignore.multicriteria = S7027-domain, S3437, S7027-dto, UndocumentedApi, S125, S4502, S4684, S5145, S6437, S6437-2, S6418, S1192
|
||||||
|
# Rule https://rules.sonarsource.com/java/RSPEC-7027 is ignored for entities
|
||||||
|
sonar.issue.ignore.multicriteria.S7027-domain.resourceKey = src/main/java/com/sisvietnamvn/web/domain/**/*
|
||||||
|
sonar.issue.ignore.multicriteria.S7027-domain.ruleKey = javaarchitecture:S7027
|
||||||
|
# Rule https://rules.sonarsource.com/java/RSPEC-3437 is ignored
|
||||||
|
sonar.issue.ignore.multicriteria.S3437.resourceKey = src/main/java/com/sisvietnamvn/web/**/*
|
||||||
|
sonar.issue.ignore.multicriteria.S3437.ruleKey = squid:S3437
|
||||||
|
# Rule https://rules.sonarsource.com/java/RSPEC-7027 is ignored for dtos
|
||||||
|
sonar.issue.ignore.multicriteria.S7027-dto.resourceKey = src/main/java/com/sisvietnamvn/web/service/dto/**/*
|
||||||
|
sonar.issue.ignore.multicriteria.S7027-dto.ruleKey = javaarchitecture:S7027
|
||||||
|
# Rule https://rules.sonarsource.com/java/RSPEC-1176 is ignored, as we want to follow "clean code" guidelines and
|
||||||
|
# classes, methods and arguments names should be self-explanatory
|
||||||
|
sonar.issue.ignore.multicriteria.UndocumentedApi.resourceKey = src/main/java/com/sisvietnamvn/web/**/*
|
||||||
|
sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey = squid:UndocumentedApi
|
||||||
|
# Rule https://rules.sonarsource.com/xml/RSPEC-125 is ignored, we provide commented examples
|
||||||
|
sonar.issue.ignore.multicriteria.S125.resourceKey = src/main/resources/logback-spring.xml
|
||||||
|
sonar.issue.ignore.multicriteria.S125.ruleKey = xml:S125
|
||||||
|
# Rule https://rules.sonarsource.com/java/RSPEC-4502 is ignored, as for JWT tokens we are not subject to CSRF attack
|
||||||
|
sonar.issue.ignore.multicriteria.S4502.resourceKey = src/main/java/com/sisvietnamvn/web/config/SecurityConfiguration.java
|
||||||
|
sonar.issue.ignore.multicriteria.S4502.ruleKey = java:S4502
|
||||||
|
# Rule https://rules.sonarsource.com/java/RSPEC-4684
|
||||||
|
sonar.issue.ignore.multicriteria.S4684.resourceKey = src/main/java/com/sisvietnamvn/web/web/rest/**/*
|
||||||
|
sonar.issue.ignore.multicriteria.S4684.ruleKey = java:S4684
|
||||||
|
# Rule https://rules.sonarsource.com/java/RSPEC-5145 is ignored, as we use log filter to format log messages
|
||||||
|
sonar.issue.ignore.multicriteria.S5145.resourceKey = src/main/java/com/sisvietnamvn/web/**/*
|
||||||
|
sonar.issue.ignore.multicriteria.S5145.ruleKey = javasecurity:S5145
|
||||||
|
# Rule https://rules.sonarsource.com/java/RSPEC-6437 is ignored, hardcoded passwords are provided for development
|
||||||
|
# purposes
|
||||||
|
sonar.issue.ignore.multicriteria.S6437.resourceKey = src/main/resources/config/application-secret-samples.yml
|
||||||
|
sonar.issue.ignore.multicriteria.S6437.ruleKey = java:S6437
|
||||||
|
# Rule https://rules.sonarsource.com/java/RSPEC-6437 is ignored, hardcoded passwords are provided for development
|
||||||
|
# purposes
|
||||||
|
sonar.issue.ignore.multicriteria.S6437-2.resourceKey = src/main/resources/config/application-tls.yml
|
||||||
|
sonar.issue.ignore.multicriteria.S6437-2.ruleKey = java:S6437
|
||||||
|
# Rule yaml:S6418 is ignored, hardcoded passwords are provided for development and testing purposes
|
||||||
|
sonar.issue.ignore.multicriteria.S6418.resourceKey = src/main/resources/config/application-secret-samples.yml
|
||||||
|
sonar.issue.ignore.multicriteria.S6418.ruleKey = yaml:S6418
|
||||||
|
# Rule https://rules.sonarsource.com/java/RSPEC-1192, there is no easy way to avoid this issue
|
||||||
|
sonar.issue.ignore.multicriteria.S1192.resourceKey = src/main/java/com/sisvietnamvn/web/config/CacheConfiguration.java
|
||||||
|
sonar.issue.ignore.multicriteria.S1192.ruleKey = java:S1192
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# This configuration is intended for development purpose, it's **your** responsibility to harden it for production
|
||||||
|
name: sisvietnamvn
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: sisvietnamvn
|
||||||
|
environment:
|
||||||
|
- _JAVA_OPTIONS=-Xmx512m -Xms256m
|
||||||
|
- SPRING_PROFILES_ACTIVE=prod,api-docs,secret-samples
|
||||||
|
- MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED=true
|
||||||
|
- SPRING_DATASOURCE_URL=jdbc:oracle:thin:@oracle:1521:sisvietnamvn
|
||||||
|
- SPRING_DATASOURCE_USERNAME=system
|
||||||
|
- SPRING_DATASOURCE_PASSWORD=oracle
|
||||||
|
- SPRING_LIQUIBASE_URL=jdbc:oracle:thin:@oracle:1521:sisvietnamvn
|
||||||
|
# If you want to expose these ports outside your dev PC,
|
||||||
|
# remove the "127.0.0.1:" prefix
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:8080:8080
|
||||||
|
healthcheck:
|
||||||
|
test:
|
||||||
|
[
|
||||||
|
'CMD-SHELL',
|
||||||
|
'bash -c ''exec 3<>/dev/tcp/127.0.0.1/8080; printf "GET /management/health HTTP/1.0\r\nHost: localhost\r\n\r\n" >&3; grep -q "\"status\":\"UP\"" <&3''',
|
||||||
|
]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 40
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: 1
|
||||||
|
|
||||||
|
providers:
|
||||||
|
- name: 'Prometheus'
|
||||||
|
orgId: 1
|
||||||
|
folder: ''
|
||||||
|
type: file
|
||||||
|
disableDeletion: false
|
||||||
|
editable: true
|
||||||
|
options:
|
||||||
|
path: /etc/grafana/provisioning/dashboards
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
apiVersion: 1
|
||||||
|
|
||||||
|
# list of datasources that should be deleted from the database
|
||||||
|
deleteDatasources:
|
||||||
|
- name: Prometheus
|
||||||
|
orgId: 1
|
||||||
|
|
||||||
|
# list of datasources to insert/update depending
|
||||||
|
# whats available in the database
|
||||||
|
datasources:
|
||||||
|
# <string, required> name of the datasource. Required
|
||||||
|
- name: Prometheus
|
||||||
|
# <string, required> datasource type. Required
|
||||||
|
type: prometheus
|
||||||
|
# <string, required> access mode. direct or proxy. Required
|
||||||
|
access: proxy
|
||||||
|
# <int> org id. will default to orgId 1 if not specified
|
||||||
|
orgId: 1
|
||||||
|
# <string> url
|
||||||
|
# On MacOS, replace localhost by host.docker.internal
|
||||||
|
url: http://localhost:9090
|
||||||
|
# <string> database password, if used
|
||||||
|
password:
|
||||||
|
# <string> database user, if used
|
||||||
|
user:
|
||||||
|
# <string> database name, if used
|
||||||
|
database:
|
||||||
|
# <bool> enable/disable basic auth
|
||||||
|
basicAuth: false
|
||||||
|
# <string> basic auth username
|
||||||
|
basicAuthUser: admin
|
||||||
|
# <string> basic auth password
|
||||||
|
basicAuthPassword: admin
|
||||||
|
# <bool> enable/disable with credentials headers
|
||||||
|
withCredentials:
|
||||||
|
# <bool> mark as default datasource. Max one per org
|
||||||
|
isDefault: true
|
||||||
|
# <map> fields that will be converted to json and stored in json_data
|
||||||
|
jsonData:
|
||||||
|
graphiteVersion: '1.1'
|
||||||
|
tlsAuth: false
|
||||||
|
tlsAuthWithCACert: false
|
||||||
|
# <string> json object of data that will be encrypted.
|
||||||
|
secureJsonData:
|
||||||
|
tlsCACert: '...'
|
||||||
|
tlsClientCert: '...'
|
||||||
|
tlsClientKey: '...'
|
||||||
|
version: 1
|
||||||
|
# <bool> allow users to edit datasources from the UI.
|
||||||
|
editable: true
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
## How to use JHCC docker compose
|
||||||
|
# To allow JHCC to reach JHipster application from a docker container note that we set the host as host.docker.internal
|
||||||
|
# To reach the application from a browser, you need to add '127.0.0.1 host.docker.internal' to your hosts file.
|
||||||
|
### Discovery mode
|
||||||
|
# JHCC supports 3 kinds of discovery mode: Consul, Eureka and static
|
||||||
|
# In order to use one, please set SPRING_PROFILES_ACTIVE to one (and only one) of this values: consul,eureka,static
|
||||||
|
### Discovery properties
|
||||||
|
# According to the discovery mode choose as Spring profile, you have to set the right properties
|
||||||
|
# please note that current properties are set to run JHCC with default values, personalize them if needed
|
||||||
|
# and remove those from other modes. You can only have one mode active.
|
||||||
|
#### Eureka
|
||||||
|
# - EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://admin:admin@host.docker.internal:8761/eureka/
|
||||||
|
#### Consul
|
||||||
|
# - SPRING_CLOUD_CONSUL_HOST=host.docker.internal
|
||||||
|
# - SPRING_CLOUD_CONSUL_PORT=8500
|
||||||
|
#### Static
|
||||||
|
# Add instances to "MyApp"
|
||||||
|
# - SPRING_CLOUD_DISCOVERY_CLIENT_SIMPLE_INSTANCES_MYAPP_0_URI=http://host.docker.internal:8081
|
||||||
|
# - SPRING_CLOUD_DISCOVERY_CLIENT_SIMPLE_INSTANCES_MYAPP_1_URI=http://host.docker.internal:8082
|
||||||
|
# Or add a new application named MyNewApp
|
||||||
|
# - SPRING_CLOUD_DISCOVERY_CLIENT_SIMPLE_INSTANCES_MYNEWAPP_0_URI=http://host.docker.internal:8080
|
||||||
|
# This configuration is intended for development purpose, it's **your** responsibility to harden it for production
|
||||||
|
|
||||||
|
#### IMPORTANT
|
||||||
|
# If you choose Consul or Eureka mode:
|
||||||
|
# Do not forget to remove the prefix "127.0.0.1" in front of their port in order to expose them.
|
||||||
|
# This is required because JHCC needs to communicate with Consul or Eureka.
|
||||||
|
# - In Consul mode, the ports are in the consul.yml file.
|
||||||
|
# - In Eureka mode, the ports are in the jhipster-registry.yml file.
|
||||||
|
|
||||||
|
name: sisvietnamvn
|
||||||
|
services:
|
||||||
|
jhipster-control-center:
|
||||||
|
image: 'jhipster/jhipster-control-center:v0.5.0'
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
# Patch /etc/hosts to support resolving host.docker.internal to the internal IP address used by the host in all OSes
|
||||||
|
- echo "`ip route | grep default | cut -d ' ' -f3` host.docker.internal" | tee -a /etc/hosts > /dev/null && java -jar /jhipster-control-center.jar
|
||||||
|
environment:
|
||||||
|
- _JAVA_OPTIONS=-Xmx512m -Xms256m
|
||||||
|
- SPRING_PROFILES_ACTIVE=prod,api-docs,static
|
||||||
|
- SPRING_SECURITY_USER_PASSWORD=admin
|
||||||
|
# The token should have the same value than the one declared in you Spring configuration under the jhipster.security.authentication.jwt.base64-secret configuration's entry
|
||||||
|
- JHIPSTER_SECURITY_AUTHENTICATION_JWT_BASE64_SECRET=ZWRjOTBhYjJiYzg5N2JhMTUyMTBiYzZhNzJjMWUwNmYzOTM3MjJmZGE3Zjc3NGE0ODhjMDZlYzRjNmFiODFhMDNkNmFjNmYwYzY4NmMwNGRkMDMwY2Q0NTllNDlhYzEyMjg0NmY2NzM5MWM1M2IxOTdkMDNhZTBhZDkzYWJjMWI=
|
||||||
|
- SPRING_CLOUD_DISCOVERY_CLIENT_SIMPLE_INSTANCES_SISVIETNAMVN_0_URI=http://host.docker.internal:8080
|
||||||
|
- LOGGING_FILE_NAME=/tmp/jhipster-control-center.log
|
||||||
|
# If you want to expose these ports outside your dev PC,
|
||||||
|
# remove the "127.0.0.1:" prefix
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:7419:7419
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "The application will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP}
|
||||||
|
|
||||||
|
# usage: file_env VAR [DEFAULT]
|
||||||
|
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
|
||||||
|
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
|
||||||
|
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
|
||||||
|
file_env() {
|
||||||
|
local var="$1"
|
||||||
|
local file_var="${var}_FILE"
|
||||||
|
local def="${2:-}"
|
||||||
|
if [[ ${!var:-} && ${!file_var:-} ]]; then
|
||||||
|
echo >&2 "error: both $var and $file_var are set (but are exclusive)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
local val="$def"
|
||||||
|
if [[ ${!var:-} ]]; then
|
||||||
|
val="${!var}"
|
||||||
|
elif [[ ${!file_var:-} ]]; then
|
||||||
|
val="$(< "${!file_var}")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n $val ]]; then
|
||||||
|
export "$var"="$val"
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset "$file_var"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
file_env 'SPRING_DATASOURCE_URL'
|
||||||
|
file_env 'SPRING_DATASOURCE_USERNAME'
|
||||||
|
file_env 'SPRING_DATASOURCE_PASSWORD'
|
||||||
|
file_env 'SPRING_LIQUIBASE_URL'
|
||||||
|
file_env 'SPRING_LIQUIBASE_USER'
|
||||||
|
file_env 'SPRING_LIQUIBASE_PASSWORD'
|
||||||
|
file_env 'JHIPSTER_REGISTRY_PASSWORD'
|
||||||
|
|
||||||
|
exec java ${JAVA_OPTS} -noverify -XX:+AlwaysPreTouch -cp /app/resources/:/app/classes/:/app/libs/* "com.sisvietnamvn.web.SisvietnamvnApp" "$@"
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# This configuration is intended for development purpose, it's **your** responsibility to harden it for production
|
||||||
|
name: sisvietnamvn
|
||||||
|
services:
|
||||||
|
prometheus:
|
||||||
|
image: prom/prometheus:v3.11.3
|
||||||
|
volumes:
|
||||||
|
- ./prometheus/:/etc/prometheus/
|
||||||
|
command:
|
||||||
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||||
|
# If you want to expose these ports outside your dev PC,
|
||||||
|
# remove the "127.0.0.1:" prefix
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:9090:9090
|
||||||
|
# On MacOS, remove next line and replace localhost by host.docker.internal in prometheus/prometheus.yml and
|
||||||
|
# grafana/provisioning/datasources/datasource.yml
|
||||||
|
network_mode: 'host' # to test locally running service
|
||||||
|
grafana:
|
||||||
|
image: grafana/grafana:13.0.1
|
||||||
|
volumes:
|
||||||
|
- ./grafana/provisioning/:/etc/grafana/provisioning/
|
||||||
|
environment:
|
||||||
|
- GF_SECURITY_ADMIN_PASSWORD=admin
|
||||||
|
- GF_USERS_ALLOW_SIGN_UP=false
|
||||||
|
- GF_INSTALL_PLUGINS=grafana-piechart-panel
|
||||||
|
# If you want to expose these ports outside your dev PC,
|
||||||
|
# remove the "127.0.0.1:" prefix
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:3000:3000
|
||||||
|
# On MacOS, remove next line and replace localhost by host.docker.internal in prometheus/prometheus.yml and
|
||||||
|
# grafana/provisioning/datasources/datasource.yml
|
||||||
|
network_mode: 'host' # to test locally running service
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# This configuration is intended for development purpose, it's **your** responsibility to harden it for production
|
||||||
|
name: sisvietnam-oracle
|
||||||
|
services:
|
||||||
|
sisvietnam-oracle:
|
||||||
|
image: container-registry.oracle.com/database/free:latest
|
||||||
|
restart: always
|
||||||
|
network_mode: "host"
|
||||||
|
environment:
|
||||||
|
# Password for the SYS, SYSTEM, and PDBADMIN administrative accounts (official image uses ORACLE_PWD)
|
||||||
|
- ORACLE_PWD=Oracle123!
|
||||||
|
- ORACLE_PASSWORD=Oracle123!
|
||||||
|
- ORACLE_PDB=sisvietnam
|
||||||
|
# Name of the pluggable database (official image default is FREEPDB1)
|
||||||
|
- ORACLE_DATABASE=sisvietnam
|
||||||
|
# Note: The official Oracle Free image does not automatically create custom app users/databases.
|
||||||
|
# If needed, create the 'sisvietnam' user manually or use the SYSTEM user to connect.
|
||||||
|
- APP_USER=sisvietnam
|
||||||
|
- APP_USER_PASSWORD=sisvietnam
|
||||||
|
volumes:
|
||||||
|
- ~/oracle-data:/opt/oracle/oradata
|
||||||
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# Sample global config for monitoring JHipster applications
|
||||||
|
global:
|
||||||
|
scrape_interval: 15s # By default, scrape targets every 15 seconds.
|
||||||
|
evaluation_interval: 15s # By default, scrape targets every 15 seconds.
|
||||||
|
# scrape_timeout is set to the global default (10s).
|
||||||
|
|
||||||
|
# Attach these labels to any time series or alerts when communicating with
|
||||||
|
# external systems (federation, remote storage, Alertmanager).
|
||||||
|
external_labels:
|
||||||
|
monitor: 'jhipster'
|
||||||
|
|
||||||
|
# A scrape configuration containing exactly one endpoint to scrape:
|
||||||
|
# Here it's Prometheus itself.
|
||||||
|
scrape_configs:
|
||||||
|
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
|
||||||
|
- job_name: 'prometheus'
|
||||||
|
|
||||||
|
# Override the global default and scrape targets from this job every 5 seconds.
|
||||||
|
scrape_interval: 5s
|
||||||
|
|
||||||
|
# scheme defaults to 'http' enable https in case your application is server via https
|
||||||
|
#scheme: https
|
||||||
|
# basic auth is not needed by default. See https://www.jhipster.tech/monitoring/#configuring-metrics-forwarding for details
|
||||||
|
#basic_auth:
|
||||||
|
# username: admin
|
||||||
|
# password: admin
|
||||||
|
metrics_path: /management/prometheus
|
||||||
|
static_configs:
|
||||||
|
- targets:
|
||||||
|
# On MacOS, replace localhost by host.docker.internal
|
||||||
|
- localhost:8080
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# This configuration is intended for development purpose, it's **your** responsibility to harden it for production
|
||||||
|
name: sisvietnamvn
|
||||||
|
services:
|
||||||
|
sonar:
|
||||||
|
container_name: sonarqube
|
||||||
|
image: sonarqube:26.5.0.122743-community
|
||||||
|
# Forced authentication redirect for UI is turned off for out of the box experience while trying out SonarQube
|
||||||
|
# For real use cases delete SONAR_FORCEAUTHENTICATION variable or set SONAR_FORCEAUTHENTICATION=true
|
||||||
|
environment:
|
||||||
|
- SONAR_FORCEAUTHENTICATION=false
|
||||||
|
# If you want to expose these ports outside your dev PC,
|
||||||
|
# remove the "127.0.0.1:" prefix
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:9001:9000
|
||||||
|
- 127.0.0.1:9000:9000
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.sisvietnamvn.web;
|
||||||
|
|
||||||
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
|
import tech.jhipster.config.DefaultProfileUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a helper Java class that provides an alternative to creating a {@code web.xml}.
|
||||||
|
* This will be invoked only when the application is deployed to a Servlet container like Tomcat, JBoss etc.
|
||||||
|
*/
|
||||||
|
public class ApplicationWebXml extends SpringBootServletInitializer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||||
|
// set a default to use when no profile is configured.
|
||||||
|
DefaultProfileUtil.addDefaultProfile(application.application());
|
||||||
|
return application.sources(SisvietnamvnApp.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.sisvietnamvn.web;
|
||||||
|
|
||||||
|
import jakarta.annotation.Generated;
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Generated(value = "JHipster", comments = "Generated by JHipster 9.1.0")
|
||||||
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
@Target({ ElementType.TYPE })
|
||||||
|
public @interface GeneratedByJHipster {}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package com.sisvietnamvn.web;
|
||||||
|
|
||||||
|
import com.sisvietnamvn.web.config.ApplicationProperties;
|
||||||
|
import com.sisvietnamvn.web.config.CRLFLogConverter;
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
import org.springframework.boot.h2console.autoconfigure.H2ConsoleAutoConfiguration;
|
||||||
|
import org.springframework.boot.liquibase.autoconfigure.LiquibaseProperties;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import tech.jhipster.config.DefaultProfileUtil;
|
||||||
|
import tech.jhipster.config.JHipsterConstants;
|
||||||
|
|
||||||
|
@SpringBootApplication(exclude = { H2ConsoleAutoConfiguration.class })
|
||||||
|
@EnableConfigurationProperties({ LiquibaseProperties.class, ApplicationProperties.class })
|
||||||
|
public class SisvietnamvnApp {
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(SisvietnamvnApp.class);
|
||||||
|
|
||||||
|
private final Environment env;
|
||||||
|
|
||||||
|
public SisvietnamvnApp(Environment env) {
|
||||||
|
this.env = env;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes sisvietnamvn.
|
||||||
|
* <p>
|
||||||
|
* Spring profiles can be configured with a program argument --spring.profiles.active=your-active-profile
|
||||||
|
* <p>
|
||||||
|
* You can find more information on how profiles work with JHipster on <a href="https://www.jhipster.tech/profiles/">https://www.jhipster.tech/profiles/</a>.
|
||||||
|
*/
|
||||||
|
@PostConstruct
|
||||||
|
public void initApplication() {
|
||||||
|
Collection<String> activeProfiles = List.of(env.getActiveProfiles());
|
||||||
|
if (
|
||||||
|
activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) &&
|
||||||
|
activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_PRODUCTION)
|
||||||
|
) {
|
||||||
|
LOG.error(
|
||||||
|
"You have misconfigured your application! It should not run " + "with both the 'dev' and 'prod' profiles at the same time."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) &&
|
||||||
|
activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_CLOUD)
|
||||||
|
) {
|
||||||
|
LOG.error(
|
||||||
|
"You have misconfigured your application! It should not " + "run with both the 'dev' and 'cloud' profiles at the same time."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main method, used to run the application.
|
||||||
|
*
|
||||||
|
* @param args the command line arguments.
|
||||||
|
*/
|
||||||
|
public static void main(String[] args) {
|
||||||
|
var app = new SpringApplication(SisvietnamvnApp.class);
|
||||||
|
DefaultProfileUtil.addDefaultProfile(app);
|
||||||
|
Environment env = app.run(args).getEnvironment();
|
||||||
|
logApplicationStartup(env);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void logApplicationStartup(Environment env) {
|
||||||
|
String protocol = Optional.ofNullable(env.getProperty("server.ssl.key-store"))
|
||||||
|
.map(key -> "https")
|
||||||
|
.orElse("http");
|
||||||
|
String applicationName = env.getProperty("spring.application.name");
|
||||||
|
String serverPort = env.getProperty("server.port");
|
||||||
|
String contextPath = Optional.ofNullable(env.getProperty("server.servlet.context-path"))
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.orElse("/");
|
||||||
|
var hostAddress = "localhost";
|
||||||
|
try {
|
||||||
|
hostAddress = InetAddress.getLocalHost().getHostAddress();
|
||||||
|
} catch (UnknownHostException e) {
|
||||||
|
LOG.warn("The host name could not be determined, using `localhost` as fallback");
|
||||||
|
}
|
||||||
|
LOG.info(
|
||||||
|
CRLFLogConverter.CRLF_SAFE_MARKER,
|
||||||
|
"""
|
||||||
|
|
||||||
|
----------------------------------------------------------
|
||||||
|
\tApplication '{}' is running! Access URLs:
|
||||||
|
\tLocal: \t\t{}://localhost:{}{}
|
||||||
|
\tExternal: \t{}://{}:{}{}
|
||||||
|
\tProfile(s): \t{}
|
||||||
|
----------------------------------------------------------""",
|
||||||
|
applicationName,
|
||||||
|
protocol,
|
||||||
|
serverPort,
|
||||||
|
contextPath,
|
||||||
|
protocol,
|
||||||
|
hostAddress,
|
||||||
|
serverPort,
|
||||||
|
contextPath,
|
||||||
|
env.getActiveProfiles().length == 0 ? env.getDefaultProfiles() : env.getActiveProfiles()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
package com.sisvietnamvn.web.aop.logging;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import org.aspectj.lang.JoinPoint;
|
||||||
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
|
import org.aspectj.lang.annotation.AfterThrowing;
|
||||||
|
import org.aspectj.lang.annotation.Around;
|
||||||
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
|
import org.aspectj.lang.annotation.Pointcut;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import org.springframework.core.env.Profiles;
|
||||||
|
import tech.jhipster.config.JHipsterConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Aspect for logging execution of service and repository Spring components.
|
||||||
|
*
|
||||||
|
* By default, it only runs with the "dev" profile.
|
||||||
|
*/
|
||||||
|
@Aspect
|
||||||
|
public class LoggingAspect {
|
||||||
|
|
||||||
|
private final Environment env;
|
||||||
|
|
||||||
|
public LoggingAspect(Environment env) {
|
||||||
|
this.env = env;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pointcut that matches all repositories, services and Web REST endpoints.
|
||||||
|
*/
|
||||||
|
@Pointcut(
|
||||||
|
"""
|
||||||
|
within(@org.springframework.stereotype.Repository *)
|
||||||
|
|| within(@org.springframework.stereotype.Service *)
|
||||||
|
|| within(@org.springframework.web.bind.annotation.RestController *)
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
public void springBeanPointcut() {
|
||||||
|
// Method is empty as this is just a Pointcut, the implementations are in the advices.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pointcut that matches all Spring beans in the application's main packages.
|
||||||
|
*/
|
||||||
|
@Pointcut(
|
||||||
|
"""
|
||||||
|
within(com.sisvietnamvn.web.repository..*)
|
||||||
|
|| within(com.sisvietnamvn.web.service..*)
|
||||||
|
|| within(com.sisvietnamvn.web.web.rest..*)
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
public void applicationPackagePointcut() {
|
||||||
|
// Method is empty as this is just a Pointcut, the implementations are in the advices.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the {@link Logger} associated to the given {@link JoinPoint}.
|
||||||
|
*
|
||||||
|
* @param joinPoint join point we want the logger for.
|
||||||
|
* @return {@link Logger} associated to the given {@link JoinPoint}.
|
||||||
|
*/
|
||||||
|
private Logger logger(JoinPoint joinPoint) {
|
||||||
|
return LoggerFactory.getLogger(joinPoint.getSignature().getDeclaringTypeName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Advice that logs methods throwing exceptions.
|
||||||
|
*
|
||||||
|
* @param joinPoint join point for advice.
|
||||||
|
* @param e exception.
|
||||||
|
*/
|
||||||
|
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
|
||||||
|
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
|
||||||
|
if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT))) {
|
||||||
|
logger(joinPoint).error(
|
||||||
|
"Exception in {}() with cause = '{}' and exception = '{}'",
|
||||||
|
joinPoint.getSignature().getName(),
|
||||||
|
e.getCause() != null ? e.getCause() : "NULL",
|
||||||
|
e.getMessage(),
|
||||||
|
e
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
logger(joinPoint).error(
|
||||||
|
"Exception in {}() with cause = {}",
|
||||||
|
joinPoint.getSignature().getName(),
|
||||||
|
e.getCause() != null ? String.valueOf(e.getCause()) : "NULL"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Advice that logs when a method is entered and exited.
|
||||||
|
*
|
||||||
|
* @param joinPoint join point for advice.
|
||||||
|
* @return result.
|
||||||
|
* @throws Throwable throws {@link IllegalArgumentException}.
|
||||||
|
*/
|
||||||
|
@Around("applicationPackagePointcut() && springBeanPointcut()")
|
||||||
|
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||||
|
var log = logger(joinPoint);
|
||||||
|
if (log.isDebugEnabled()) {
|
||||||
|
log.debug("Enter: {}() with argument[s] = {}", joinPoint.getSignature().getName(), Arrays.toString(joinPoint.getArgs()));
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Object result = joinPoint.proceed();
|
||||||
|
if (log.isDebugEnabled()) {
|
||||||
|
log.debug("Exit: {}() with result = {}", joinPoint.getSignature().getName(), result);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
log.error("Illegal argument: {} in {}()", Arrays.toString(joinPoint.getArgs()), joinPoint.getSignature().getName());
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* Logging aspect.
|
||||||
|
*/
|
||||||
|
package com.sisvietnamvn.web.aop.logging;
|
||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Properties specific to Sisvietnamvn.
|
||||||
|
* <p>
|
||||||
|
* Properties are configured in the {@code application.yml} file.
|
||||||
|
* See {@link tech.jhipster.config.JHipsterProperties} for a good example.
|
||||||
|
*/
|
||||||
|
@ConfigurationProperties(prefix = "application", ignoreUnknownFields = false)
|
||||||
|
public class ApplicationProperties {
|
||||||
|
|
||||||
|
private final Liquibase liquibase = new Liquibase();
|
||||||
|
|
||||||
|
// jhipster-needle-application-properties-property
|
||||||
|
|
||||||
|
public Liquibase getLiquibase() {
|
||||||
|
return liquibase;
|
||||||
|
}
|
||||||
|
|
||||||
|
// jhipster-needle-application-properties-property-getter
|
||||||
|
|
||||||
|
public static class Liquibase {
|
||||||
|
|
||||||
|
private Boolean asyncStart = true;
|
||||||
|
|
||||||
|
public Boolean getAsyncStart() {
|
||||||
|
return asyncStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAsyncStart(Boolean asyncStart) {
|
||||||
|
this.asyncStart = asyncStart;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// jhipster-needle-application-properties-property-class
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||||
|
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler;
|
||||||
|
import org.springframework.boot.autoconfigure.task.TaskExecutionProperties;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Profile;
|
||||||
|
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
import tech.jhipster.async.ExceptionHandlingAsyncTaskExecutor;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableAsync
|
||||||
|
@EnableScheduling
|
||||||
|
@Profile("!testdev & !testprod")
|
||||||
|
public class AsyncConfiguration implements AsyncConfigurer {
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(AsyncConfiguration.class);
|
||||||
|
|
||||||
|
private final TaskExecutionProperties taskExecutionProperties;
|
||||||
|
|
||||||
|
public AsyncConfiguration(TaskExecutionProperties taskExecutionProperties) {
|
||||||
|
this.taskExecutionProperties = taskExecutionProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Bean(name = "taskExecutor")
|
||||||
|
public Executor getAsyncExecutor() {
|
||||||
|
LOG.debug("Creating Async Task Executor");
|
||||||
|
var executor = new ThreadPoolTaskExecutor();
|
||||||
|
executor.setCorePoolSize(taskExecutionProperties.getPool().getCoreSize());
|
||||||
|
executor.setMaxPoolSize(taskExecutionProperties.getPool().getMaxSize());
|
||||||
|
executor.setQueueCapacity(taskExecutionProperties.getPool().getQueueCapacity());
|
||||||
|
executor.setThreadNamePrefix(taskExecutionProperties.getThreadNamePrefix());
|
||||||
|
return new ExceptionHandlingAsyncTaskExecutor(executor);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
|
||||||
|
return new SimpleAsyncUncaughtExceptionHandler();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||||
|
import ch.qos.logback.core.pattern.CompositeConverter;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import org.slf4j.Marker;
|
||||||
|
import org.slf4j.MarkerFactory;
|
||||||
|
import org.springframework.boot.ansi.AnsiColor;
|
||||||
|
import org.springframework.boot.ansi.AnsiElement;
|
||||||
|
import org.springframework.boot.ansi.AnsiOutput;
|
||||||
|
import org.springframework.boot.ansi.AnsiStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Log filter to prevent attackers from forging log entries by submitting input containing CRLF characters.
|
||||||
|
* CRLF characters are replaced with a red colored _ character.
|
||||||
|
*
|
||||||
|
* @see <a href="https://owasp.org/www-community/attacks/Log_Injection">Log Forging Description</a>
|
||||||
|
* @see <a href="https://github.com/jhipster/generator-jhipster/issues/14949">JHipster issue</a>
|
||||||
|
*/
|
||||||
|
public class CRLFLogConverter extends CompositeConverter<ILoggingEvent> {
|
||||||
|
|
||||||
|
public static final Marker CRLF_SAFE_MARKER = MarkerFactory.getMarker("CRLF_SAFE");
|
||||||
|
|
||||||
|
private static final String[] SAFE_LOGS = {
|
||||||
|
"org.hibernate",
|
||||||
|
"org.springframework.boot.autoconfigure",
|
||||||
|
"org.springframework.boot.diagnostics",
|
||||||
|
};
|
||||||
|
private static final Map<String, AnsiElement> ELEMENTS;
|
||||||
|
|
||||||
|
static {
|
||||||
|
Map<String, AnsiElement> ansiElements = new HashMap<>();
|
||||||
|
ansiElements.put("faint", AnsiStyle.FAINT);
|
||||||
|
ansiElements.put("red", AnsiColor.RED);
|
||||||
|
ansiElements.put("green", AnsiColor.GREEN);
|
||||||
|
ansiElements.put("yellow", AnsiColor.YELLOW);
|
||||||
|
ansiElements.put("blue", AnsiColor.BLUE);
|
||||||
|
ansiElements.put("magenta", AnsiColor.MAGENTA);
|
||||||
|
ansiElements.put("cyan", AnsiColor.CYAN);
|
||||||
|
ELEMENTS = Collections.unmodifiableMap(ansiElements);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String transform(ILoggingEvent event, String in) {
|
||||||
|
AnsiElement element = ELEMENTS.get(getFirstOption());
|
||||||
|
List<Marker> markers = event.getMarkerList();
|
||||||
|
if ((markers != null && !markers.isEmpty() && markers.getFirst().contains(CRLF_SAFE_MARKER)) || isLoggerSafe(event)) {
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
String replacement = element == null ? "_" : toAnsiString("_", element);
|
||||||
|
return in.replaceAll("[\n\r\t]", replacement);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isLoggerSafe(ILoggingEvent event) {
|
||||||
|
for (String safeLogger : SAFE_LOGS) {
|
||||||
|
if (event.getLoggerName().startsWith(safeLogger)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String toAnsiString(String in, AnsiElement element) {
|
||||||
|
return AnsiOutput.toString(element, in);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
|
import org.ehcache.config.builders.*;
|
||||||
|
import org.ehcache.jsr107.Eh107Configuration;
|
||||||
|
import org.hibernate.cache.jcache.ConfigSettings;
|
||||||
|
import org.springframework.boot.cache.autoconfigure.JCacheManagerCustomizer;
|
||||||
|
import org.springframework.boot.hibernate.autoconfigure.HibernatePropertiesCustomizer;
|
||||||
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import tech.jhipster.config.JHipsterProperties;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableCaching
|
||||||
|
public class CacheConfiguration {
|
||||||
|
|
||||||
|
private final javax.cache.configuration.Configuration<Object, Object> jcacheConfiguration;
|
||||||
|
|
||||||
|
public CacheConfiguration(JHipsterProperties jHipsterProperties) {
|
||||||
|
var ehcache = jHipsterProperties.getCache().getEhcache();
|
||||||
|
|
||||||
|
jcacheConfiguration = Eh107Configuration.fromEhcacheCacheConfiguration(
|
||||||
|
CacheConfigurationBuilder.newCacheConfigurationBuilder(
|
||||||
|
Object.class,
|
||||||
|
Object.class,
|
||||||
|
ResourcePoolsBuilder.heap(ehcache.getMaxEntries())
|
||||||
|
)
|
||||||
|
.withExpiry(ExpiryPolicyBuilder.timeToLiveExpiration(Duration.ofSeconds(ehcache.getTimeToLiveSeconds())))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public HibernatePropertiesCustomizer hibernatePropertiesCustomizer(javax.cache.CacheManager cacheManager) {
|
||||||
|
return hibernateProperties -> hibernateProperties.put(ConfigSettings.CACHE_MANAGER, cacheManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public JCacheManagerCustomizer cacheManagerCustomizer() {
|
||||||
|
return cm -> {
|
||||||
|
createCache(cm, com.sisvietnamvn.web.repository.UserRepository.USERS_BY_LOGIN_CACHE);
|
||||||
|
createCache(cm, com.sisvietnamvn.web.repository.UserRepository.USERS_BY_EMAIL_CACHE);
|
||||||
|
createCache(cm, com.sisvietnamvn.web.domain.User.class.getName());
|
||||||
|
createCache(cm, com.sisvietnamvn.web.domain.Authority.class.getName());
|
||||||
|
createCache(cm, com.sisvietnamvn.web.domain.User.class.getName() + ".authorities");
|
||||||
|
// jhipster-needle-ehcache-add-entry
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createCache(javax.cache.CacheManager cm, String cacheName) {
|
||||||
|
javax.cache.Cache<Object, Object> cache = cm.getCache(cacheName);
|
||||||
|
if (cache != null) {
|
||||||
|
cache.clear();
|
||||||
|
} else {
|
||||||
|
cm.createCache(cacheName, jcacheConfiguration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.info.BuildProperties;
|
||||||
|
import org.springframework.boot.info.GitProperties;
|
||||||
|
import org.springframework.cache.interceptor.KeyGenerator;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import tech.jhipster.config.cache.PrefixedKeyGenerator;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class CacheKeyGeneratorConfiguration {
|
||||||
|
|
||||||
|
private GitProperties gitProperties;
|
||||||
|
private BuildProperties buildProperties;
|
||||||
|
|
||||||
|
@Autowired(required = false)
|
||||||
|
public void setGitProperties(GitProperties gitProperties) {
|
||||||
|
this.gitProperties = gitProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired(required = false)
|
||||||
|
public void setBuildProperties(BuildProperties buildProperties) {
|
||||||
|
this.buildProperties = buildProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public KeyGenerator keyGenerator() {
|
||||||
|
return new PrefixedKeyGenerator(this.gitProperties, this.buildProperties);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Application constants.
|
||||||
|
*/
|
||||||
|
public final class Constants {
|
||||||
|
|
||||||
|
// Regex for acceptable logins
|
||||||
|
public static final String LOGIN_REGEX = "^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$";
|
||||||
|
|
||||||
|
public static final String SYSTEM = "system";
|
||||||
|
public static final String DEFAULT_LANGUAGE = "en";
|
||||||
|
|
||||||
|
private Constants() {}
|
||||||
|
}
|
||||||
+62
@@ -0,0 +1,62 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
import org.springframework.boot.h2console.autoconfigure.H2ConsoleProperties;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Profile;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
||||||
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
import tech.jhipster.config.JHipsterConstants;
|
||||||
|
import tech.jhipster.config.h2.H2ConfigurationHelper;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableJpaRepositories({ "com.sisvietnamvn.web.repository" })
|
||||||
|
@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware")
|
||||||
|
@EnableTransactionManagement
|
||||||
|
@EnableConfigurationProperties(H2ConsoleProperties.class)
|
||||||
|
public class DatabaseConfiguration {
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(DatabaseConfiguration.class);
|
||||||
|
|
||||||
|
private final Environment env;
|
||||||
|
|
||||||
|
public DatabaseConfiguration(Environment env) {
|
||||||
|
this.env = env;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open the TCP port for the H2 database, so it is available remotely.
|
||||||
|
*
|
||||||
|
* @return the H2 database TCP server.
|
||||||
|
* @throws SQLException if the server failed to start.
|
||||||
|
*/
|
||||||
|
@Bean(initMethod = "start", destroyMethod = "stop")
|
||||||
|
@Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)
|
||||||
|
@ConditionalOnProperty(prefix = "spring.h2.console", name = "enabled", havingValue = "true")
|
||||||
|
public Object h2TCPServer() throws SQLException {
|
||||||
|
String port = getValidPortForH2();
|
||||||
|
LOG.debug("H2 database is available on port {}", port);
|
||||||
|
return H2ConfigurationHelper.createServer(port);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getValidPortForH2() {
|
||||||
|
var port = Integer.parseInt(env.getProperty("server.port"));
|
||||||
|
if (port < 10000) {
|
||||||
|
port = 10000 + port;
|
||||||
|
} else {
|
||||||
|
if (port < 63536) {
|
||||||
|
port = port + 2000;
|
||||||
|
} else {
|
||||||
|
port = port - 2000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return String.valueOf(port);
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.format.FormatterRegistry;
|
||||||
|
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the converters to use the ISO format for dates by default.
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class DateTimeFormatConfiguration implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addFormatters(FormatterRegistry registry) {
|
||||||
|
var registrar = new DateTimeFormatterRegistrar();
|
||||||
|
registrar.setUseIsoFormat(true);
|
||||||
|
registrar.registerFormatters(registry);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
|
||||||
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class JacksonConfiguration {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Support for Java date and time API.
|
||||||
|
* @return the corresponding Jackson module.
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public JavaTimeModule javaTimeModule() {
|
||||||
|
return new JavaTimeModule();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Jdk8Module jdk8TimeModule() {
|
||||||
|
return new Jdk8Module();
|
||||||
|
}
|
||||||
|
}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import tools.jackson.datatype.hibernate7.Hibernate7Module;
|
||||||
|
import tools.jackson.datatype.hibernate7.Hibernate7Module.Feature;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class JacksonHibernateConfiguration {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Support for Hibernate types in Jackson.
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public Hibernate7Module hibernate7Module() {
|
||||||
|
return new Hibernate7Module().configure(Feature.SERIALIZE_IDENTIFIER_FOR_LAZY_NOT_LOADED_OBJECTS, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
+83
@@ -0,0 +1,83 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import liquibase.integration.spring.SpringLiquibase;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.ObjectProvider;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.boot.jdbc.autoconfigure.DataSourceProperties;
|
||||||
|
import org.springframework.boot.liquibase.autoconfigure.LiquibaseDataSource;
|
||||||
|
import org.springframework.boot.liquibase.autoconfigure.LiquibaseProperties;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import tech.jhipster.config.JHipsterConstants;
|
||||||
|
import tech.jhipster.config.liquibase.SpringLiquibaseUtil;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class LiquibaseConfiguration {
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(LiquibaseConfiguration.class);
|
||||||
|
|
||||||
|
private final Environment env;
|
||||||
|
|
||||||
|
public LiquibaseConfiguration(Environment env) {
|
||||||
|
this.env = env;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public SpringLiquibase liquibase(
|
||||||
|
@Qualifier("taskExecutor") Executor executor,
|
||||||
|
LiquibaseProperties liquibaseProperties,
|
||||||
|
@LiquibaseDataSource ObjectProvider<DataSource> liquibaseDataSource,
|
||||||
|
ObjectProvider<DataSource> dataSource,
|
||||||
|
ApplicationProperties applicationProperties,
|
||||||
|
DataSourceProperties dataSourceProperties
|
||||||
|
) {
|
||||||
|
SpringLiquibase liquibase;
|
||||||
|
if (Boolean.TRUE.equals(applicationProperties.getLiquibase().getAsyncStart())) {
|
||||||
|
liquibase = SpringLiquibaseUtil.createAsyncSpringLiquibase(
|
||||||
|
this.env,
|
||||||
|
executor,
|
||||||
|
liquibaseDataSource.getIfAvailable(),
|
||||||
|
liquibaseProperties,
|
||||||
|
dataSource.getIfUnique(),
|
||||||
|
dataSourceProperties
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
liquibase = SpringLiquibaseUtil.createSpringLiquibase(
|
||||||
|
liquibaseDataSource.getIfAvailable(),
|
||||||
|
liquibaseProperties,
|
||||||
|
dataSource.getIfUnique(),
|
||||||
|
dataSourceProperties
|
||||||
|
);
|
||||||
|
}
|
||||||
|
liquibase.setChangeLog("classpath:config/liquibase/master.xml");
|
||||||
|
if (!CollectionUtils.isEmpty(liquibaseProperties.getContexts())) {
|
||||||
|
liquibase.setContexts(StringUtils.collectionToCommaDelimitedString(liquibaseProperties.getContexts()));
|
||||||
|
}
|
||||||
|
liquibase.setDefaultSchema(liquibaseProperties.getDefaultSchema());
|
||||||
|
liquibase.setLiquibaseSchema(liquibaseProperties.getLiquibaseSchema());
|
||||||
|
liquibase.setLiquibaseTablespace(liquibaseProperties.getLiquibaseTablespace());
|
||||||
|
liquibase.setDatabaseChangeLogLockTable(liquibaseProperties.getDatabaseChangeLogLockTable());
|
||||||
|
liquibase.setDatabaseChangeLogTable(liquibaseProperties.getDatabaseChangeLogTable());
|
||||||
|
liquibase.setDropFirst(liquibaseProperties.isDropFirst());
|
||||||
|
if (!CollectionUtils.isEmpty(liquibaseProperties.getLabelFilter())) {
|
||||||
|
liquibase.setLabelFilter(StringUtils.collectionToCommaDelimitedString(liquibaseProperties.getLabelFilter()));
|
||||||
|
}
|
||||||
|
liquibase.setChangeLogParameters(liquibaseProperties.getParameters());
|
||||||
|
liquibase.setRollbackFile(liquibaseProperties.getRollbackFile());
|
||||||
|
liquibase.setTestRollbackOnUpdate(liquibaseProperties.isTestRollbackOnUpdate());
|
||||||
|
if (env.matchesProfiles(JHipsterConstants.SPRING_PROFILE_NO_LIQUIBASE)) {
|
||||||
|
liquibase.setShouldRun(false);
|
||||||
|
} else {
|
||||||
|
liquibase.setShouldRun(liquibaseProperties.isEnabled());
|
||||||
|
LOG.debug("Configuring Liquibase");
|
||||||
|
}
|
||||||
|
return liquibase;
|
||||||
|
}
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import com.sisvietnamvn.web.aop.logging.LoggingAspect;
|
||||||
|
import org.springframework.context.annotation.*;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import tech.jhipster.config.JHipsterConstants;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableAspectJAutoProxy
|
||||||
|
public class LoggingAspectConfiguration {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)
|
||||||
|
public LoggingAspect loggingAspect(Environment env) {
|
||||||
|
return new LoggingAspect(env);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import static tech.jhipster.config.logging.LoggingUtils.*;
|
||||||
|
|
||||||
|
import ch.qos.logback.classic.LoggerContext;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import tech.jhipster.config.JHipsterProperties;
|
||||||
|
import tools.jackson.core.JacksonException;
|
||||||
|
import tools.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configures the console and Logstash log appenders from the app properties
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class LoggingConfiguration {
|
||||||
|
|
||||||
|
public LoggingConfiguration(
|
||||||
|
@Value("${spring.application.name}") String appName,
|
||||||
|
@Value("${server.port}") String serverPort,
|
||||||
|
JHipsterProperties jHipsterProperties,
|
||||||
|
ObjectMapper mapper
|
||||||
|
) throws JacksonException {
|
||||||
|
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
|
||||||
|
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
map.put("app_name", appName);
|
||||||
|
map.put("app_port", serverPort);
|
||||||
|
var customFields = mapper.writeValueAsString(map);
|
||||||
|
|
||||||
|
var loggingProperties = jHipsterProperties.getLogging();
|
||||||
|
var logstashProperties = loggingProperties.getLogstash();
|
||||||
|
|
||||||
|
if (loggingProperties.isUseJsonFormat()) {
|
||||||
|
addJsonConsoleAppender(context, customFields);
|
||||||
|
}
|
||||||
|
if (logstashProperties.isEnabled()) {
|
||||||
|
addLogstashTcpSocketAppender(context, customFields, logstashProperties);
|
||||||
|
}
|
||||||
|
if (loggingProperties.isUseJsonFormat() || logstashProperties.isEnabled()) {
|
||||||
|
addContextListener(context, customFields, loggingProperties);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+76
@@ -0,0 +1,76 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import static org.springframework.security.config.Customizer.withDefaults;
|
||||||
|
|
||||||
|
import com.sisvietnamvn.web.security.*;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import org.springframework.core.env.Profiles;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
|
||||||
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
|
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||||
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
|
import org.springframework.security.oauth2.server.resource.web.BearerTokenAuthenticationEntryPoint;
|
||||||
|
import org.springframework.security.oauth2.server.resource.web.access.BearerTokenAccessDeniedHandler;
|
||||||
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
|
import tech.jhipster.config.JHipsterConstants;
|
||||||
|
import tech.jhipster.config.JHipsterProperties;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableMethodSecurity(securedEnabled = true)
|
||||||
|
public class SecurityConfiguration {
|
||||||
|
|
||||||
|
private final Environment env;
|
||||||
|
|
||||||
|
private final JHipsterProperties jHipsterProperties;
|
||||||
|
|
||||||
|
public SecurityConfiguration(Environment env, JHipsterProperties jHipsterProperties) {
|
||||||
|
this.env = env;
|
||||||
|
this.jHipsterProperties = jHipsterProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public PasswordEncoder passwordEncoder() {
|
||||||
|
return new BCryptPasswordEncoder();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public SecurityFilterChain filterChain(HttpSecurity http) {
|
||||||
|
http.cors(withDefaults())
|
||||||
|
.csrf(csrf -> csrf.disable())
|
||||||
|
.authorizeHttpRequests(authz ->
|
||||||
|
// prettier-ignore
|
||||||
|
authz
|
||||||
|
.requestMatchers(HttpMethod.GET, "/", "/about", "/flex-finish", "/tin-tuc", "/tin-tuc/**", "/lien-he",
|
||||||
|
"/manage/**", "/css/**", "/images/**", "/js/**", "/UMass*/**", "/Undergraduate*/**",
|
||||||
|
"/favicon.ico", "/favicons/**", "/flex-finish/**", "/contact-us/**")
|
||||||
|
.permitAll()
|
||||||
|
.requestMatchers(HttpMethod.GET, "/swagger-ui/**", "/v3/api-docs/**").permitAll()
|
||||||
|
.requestMatchers(HttpMethod.POST, "/api/authenticate").permitAll()
|
||||||
|
.requestMatchers(HttpMethod.GET, "/api/authenticate").permitAll()
|
||||||
|
.requestMatchers("/api/register").permitAll()
|
||||||
|
.requestMatchers("/api/activate").permitAll()
|
||||||
|
.requestMatchers("/api/account/reset-password/init").permitAll()
|
||||||
|
.requestMatchers("/api/account/reset-password/finish").permitAll()
|
||||||
|
.requestMatchers("/api/admin/**").hasAuthority(AuthoritiesConstants.ADMIN)
|
||||||
|
.requestMatchers("/api/**").authenticated()
|
||||||
|
.requestMatchers("/management/health").permitAll()
|
||||||
|
.requestMatchers("/management/health/**").permitAll()
|
||||||
|
.requestMatchers("/management/info").permitAll()
|
||||||
|
.requestMatchers("/management/prometheus").permitAll()
|
||||||
|
.requestMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN))
|
||||||
|
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||||
|
.exceptionHandling(exceptions -> exceptions
|
||||||
|
.authenticationEntryPoint(new BearerTokenAuthenticationEntryPoint())
|
||||||
|
.accessDeniedHandler(new BearerTokenAccessDeniedHandler()))
|
||||||
|
.oauth2ResourceServer(oauth2 -> oauth2.jwt(withDefaults()));
|
||||||
|
if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT))) {
|
||||||
|
http.authorizeHttpRequests(authz -> authz.requestMatchers("/h2-console/**").permitAll())
|
||||||
|
.headers(headers -> headers.frameOptions(frameOptions -> frameOptions.sameOrigin()));
|
||||||
|
}
|
||||||
|
return http.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
+62
@@ -0,0 +1,62 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import static com.sisvietnamvn.web.security.SecurityUtils.JWT_ALGORITHM;
|
||||||
|
|
||||||
|
import com.nimbusds.jose.jwk.source.ImmutableSecret;
|
||||||
|
import com.nimbusds.jose.util.Base64;
|
||||||
|
import com.sisvietnamvn.web.management.SecurityMetersService;
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.security.oauth2.jwt.JwtDecoder;
|
||||||
|
import org.springframework.security.oauth2.jwt.JwtEncoder;
|
||||||
|
import org.springframework.security.oauth2.jwt.NimbusJwtDecoder;
|
||||||
|
import org.springframework.security.oauth2.jwt.NimbusJwtEncoder;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class SecurityJwtConfiguration {
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(SecurityJwtConfiguration.class);
|
||||||
|
|
||||||
|
@Value("${jhipster.security.authentication.jwt.base64-secret}")
|
||||||
|
private String jwtKey;
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public JwtDecoder jwtDecoder(SecurityMetersService metersService) {
|
||||||
|
NimbusJwtDecoder jwtDecoder = NimbusJwtDecoder.withSecretKey(getSecretKey()).macAlgorithm(JWT_ALGORITHM).build();
|
||||||
|
return token -> {
|
||||||
|
try {
|
||||||
|
return jwtDecoder.decode(token);
|
||||||
|
} catch (Exception e) {
|
||||||
|
if (e.getMessage().contains("Invalid signature")) {
|
||||||
|
metersService.trackTokenInvalidSignature();
|
||||||
|
} else if (e.getMessage().contains("Jwt expired at")) {
|
||||||
|
metersService.trackTokenExpired();
|
||||||
|
} else if (
|
||||||
|
e.getMessage().contains("Invalid JWT serialization") ||
|
||||||
|
e.getMessage().contains("Malformed token") ||
|
||||||
|
e.getMessage().contains("Invalid unsecured/JWS/JWE")
|
||||||
|
) {
|
||||||
|
metersService.trackTokenMalformed();
|
||||||
|
} else {
|
||||||
|
LOG.error("Unknown JWT error {}", e.getMessage());
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public JwtEncoder jwtEncoder() {
|
||||||
|
return new NimbusJwtEncoder(new ImmutableSecret<>(getSecretKey()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private SecretKey getSecretKey() {
|
||||||
|
byte[] keyBytes = Base64.from(jwtKey).decode();
|
||||||
|
return new SecretKeySpec(keyBytes, 0, keyBytes.length, JWT_ALGORITHM.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package com.sisvietnamvn.web.config;
|
||||||
|
|
||||||
|
import jakarta.servlet.*;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.boot.web.server.*;
|
||||||
|
import org.springframework.boot.web.servlet.ServletContextInitializer;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import org.springframework.core.env.Profiles;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.web.cors.CorsConfiguration;
|
||||||
|
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||||
|
import org.springframework.web.filter.CorsFilter;
|
||||||
|
import tech.jhipster.config.JHipsterConstants;
|
||||||
|
import tech.jhipster.config.JHipsterProperties;
|
||||||
|
import tech.jhipster.config.h2.H2ConfigurationHelper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration of web application with Servlet 3.0 APIs.
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class WebConfigurer implements ServletContextInitializer {
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(WebConfigurer.class);
|
||||||
|
|
||||||
|
private final Environment env;
|
||||||
|
|
||||||
|
private final JHipsterProperties jHipsterProperties;
|
||||||
|
|
||||||
|
public WebConfigurer(Environment env, JHipsterProperties jHipsterProperties) {
|
||||||
|
this.env = env;
|
||||||
|
this.jHipsterProperties = jHipsterProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStartup(ServletContext servletContext) {
|
||||||
|
if (env.getActiveProfiles().length != 0) {
|
||||||
|
LOG.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (h2ConsoleIsEnabled(env)) {
|
||||||
|
initH2Console(servletContext);
|
||||||
|
}
|
||||||
|
LOG.info("Web application fully configured");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public CorsFilter corsFilter() {
|
||||||
|
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||||
|
CorsConfiguration config = jHipsterProperties.getCors();
|
||||||
|
if (!CollectionUtils.isEmpty(config.getAllowedOrigins()) || !CollectionUtils.isEmpty(config.getAllowedOriginPatterns())) {
|
||||||
|
LOG.debug("Registering CORS filter");
|
||||||
|
source.registerCorsConfiguration("/api/**", config);
|
||||||
|
source.registerCorsConfiguration("/management/**", config);
|
||||||
|
source.registerCorsConfiguration("/v3/api-docs", config);
|
||||||
|
source.registerCorsConfiguration("/swagger-ui/**", config);
|
||||||
|
}
|
||||||
|
return new CorsFilter(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean h2ConsoleIsEnabled(Environment env) {
|
||||||
|
return (
|
||||||
|
env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) &&
|
||||||
|
"true".equals(env.getProperty("spring.h2.console.enabled"))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes H2 console.
|
||||||
|
*/
|
||||||
|
private void initH2Console(ServletContext servletContext) {
|
||||||
|
LOG.info("Initialize H2 console");
|
||||||
|
H2ConfigurationHelper.initH2Console(servletContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* Application configuration.
|
||||||
|
*/
|
||||||
|
package com.sisvietnamvn.web.config;
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.sisvietnamvn.web.controller;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class HomeController {
|
||||||
|
|
||||||
|
@GetMapping("/")
|
||||||
|
public String home() {
|
||||||
|
return "index";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trang Flex Finish (MỚI THÊM)
|
||||||
|
@GetMapping("/flex-finish")
|
||||||
|
public String flexFinish() {
|
||||||
|
return "flex-finish"; // Trả về tên file flex-finish.html
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trang Giới thiệu Bệnh viện
|
||||||
|
@GetMapping("/about")
|
||||||
|
public String about() {
|
||||||
|
return "about";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trang Tin tức
|
||||||
|
@GetMapping("/tin-tuc")
|
||||||
|
public String tintuc() {
|
||||||
|
return "tin-tuc";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/lien-he")
|
||||||
|
public String lienhe() {
|
||||||
|
return "lien-he";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.sisvietnamvn.web.controller;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/manage")
|
||||||
|
public class ManageController {
|
||||||
|
|
||||||
|
@GetMapping({"", "/"})
|
||||||
|
public String index() {
|
||||||
|
return "manage/index";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+77
@@ -0,0 +1,77 @@
|
|||||||
|
package com.sisvietnamvn.web.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.EntityListeners;
|
||||||
|
import jakarta.persistence.MappedSuperclass;
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.Instant;
|
||||||
|
import org.springframework.data.annotation.CreatedBy;
|
||||||
|
import org.springframework.data.annotation.CreatedDate;
|
||||||
|
import org.springframework.data.annotation.LastModifiedBy;
|
||||||
|
import org.springframework.data.annotation.LastModifiedDate;
|
||||||
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base abstract class for entities which will hold definitions for created, last modified, created by,
|
||||||
|
* last modified by attributes.
|
||||||
|
*/
|
||||||
|
@MappedSuperclass
|
||||||
|
@EntityListeners(AuditingEntityListener.class)
|
||||||
|
@JsonIgnoreProperties(value = { "createdBy", "createdDate", "lastModifiedBy", "lastModifiedDate" }, allowGetters = true)
|
||||||
|
public abstract class AbstractAuditingEntity<T> implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public abstract T getId();
|
||||||
|
|
||||||
|
@CreatedBy
|
||||||
|
@Column(name = "created_by", nullable = false, length = 50, updatable = false)
|
||||||
|
private String createdBy;
|
||||||
|
|
||||||
|
@CreatedDate
|
||||||
|
@Column(name = "created_date", updatable = false)
|
||||||
|
private Instant createdDate = Instant.now();
|
||||||
|
|
||||||
|
@LastModifiedBy
|
||||||
|
@Column(name = "last_modified_by", length = 50)
|
||||||
|
private String lastModifiedBy;
|
||||||
|
|
||||||
|
@LastModifiedDate
|
||||||
|
@Column(name = "last_modified_date")
|
||||||
|
private Instant lastModifiedDate = Instant.now();
|
||||||
|
|
||||||
|
public String getCreatedBy() {
|
||||||
|
return createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedBy(String createdBy) {
|
||||||
|
this.createdBy = createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getCreatedDate() {
|
||||||
|
return createdDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedDate(Instant createdDate) {
|
||||||
|
this.createdDate = createdDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLastModifiedBy() {
|
||||||
|
return lastModifiedBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastModifiedBy(String lastModifiedBy) {
|
||||||
|
this.lastModifiedBy = lastModifiedBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getLastModifiedDate() {
|
||||||
|
return lastModifiedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastModifiedDate(Instant lastModifiedDate) {
|
||||||
|
this.lastModifiedDate = lastModifiedDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package com.sisvietnamvn.web.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Objects;
|
||||||
|
import org.hibernate.annotations.Cache;
|
||||||
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||||
|
import org.springframework.data.domain.Persistable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Authority.
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "jhi_authority")
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||||
|
@JsonIgnoreProperties(value = { "new", "id" })
|
||||||
|
@SuppressWarnings("common-java:DuplicatedBlocks")
|
||||||
|
public class Authority implements Serializable, Persistable<String> {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Size(max = 50)
|
||||||
|
@Id
|
||||||
|
@Column(name = "name", length = 50, nullable = false)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@org.springframework.data.annotation.Transient
|
||||||
|
@Transient
|
||||||
|
private boolean isPersisted;
|
||||||
|
|
||||||
|
// jhipster-needle-entity-add-field - JHipster will add fields here
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Authority name(String name) {
|
||||||
|
this.setName(name);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostLoad
|
||||||
|
@PostPersist
|
||||||
|
public void updateEntityState() {
|
||||||
|
this.setIsPersisted();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getId() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@org.springframework.data.annotation.Transient
|
||||||
|
@Transient
|
||||||
|
@Override
|
||||||
|
public boolean isNew() {
|
||||||
|
return !this.isPersisted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Authority setIsPersisted() {
|
||||||
|
this.isPersisted = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(o instanceof Authority)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return getName() != null && getName().equals(((Authority) o).getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hashCode(getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
// prettier-ignore
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Authority{" +
|
||||||
|
"name=" + getName() +
|
||||||
|
"}";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,235 @@
|
|||||||
|
package com.sisvietnamvn.web.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.sisvietnamvn.web.config.Constants;
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import jakarta.validation.constraints.Email;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.Pattern;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Set;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.hibernate.annotations.BatchSize;
|
||||||
|
import org.hibernate.annotations.Cache;
|
||||||
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A user.
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "jhi_user")
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
|
||||||
|
public class User extends AbstractAuditingEntity<Long> implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
|
||||||
|
@SequenceGenerator(name = "sequenceGenerator")
|
||||||
|
@Column(name = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Pattern(regexp = Constants.LOGIN_REGEX)
|
||||||
|
@Size(min = 1, max = 50)
|
||||||
|
@Column(name = "login", length = 50, unique = true, nullable = false)
|
||||||
|
private String login;
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
@NotNull
|
||||||
|
@Size(min = 60, max = 60)
|
||||||
|
@Column(name = "password_hash", length = 60, nullable = false)
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "first_name", length = 50)
|
||||||
|
private String firstName;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "last_name", length = 50)
|
||||||
|
private String lastName;
|
||||||
|
|
||||||
|
@Email
|
||||||
|
@Size(min = 5, max = 254)
|
||||||
|
@Column(name = "email", length = 254, unique = true)
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "activated", nullable = false)
|
||||||
|
private boolean activated = false;
|
||||||
|
|
||||||
|
@Size(min = 2, max = 10)
|
||||||
|
@Column(name = "lang_key", length = 10)
|
||||||
|
private String langKey;
|
||||||
|
|
||||||
|
@Size(max = 256)
|
||||||
|
@Column(name = "image_url", length = 256)
|
||||||
|
private String imageUrl;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "activation_key", length = 20)
|
||||||
|
@JsonIgnore
|
||||||
|
private String activationKey;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "reset_key", length = 20)
|
||||||
|
@JsonIgnore
|
||||||
|
private String resetKey;
|
||||||
|
|
||||||
|
@Column(name = "reset_date")
|
||||||
|
private Instant resetDate = null;
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToMany
|
||||||
|
@JoinTable(
|
||||||
|
name = "jhi_user_authority",
|
||||||
|
joinColumns = { @JoinColumn(name = "user_id", referencedColumnName = "id") },
|
||||||
|
inverseJoinColumns = { @JoinColumn(name = "authority_name", referencedColumnName = "name") }
|
||||||
|
)
|
||||||
|
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
|
||||||
|
@BatchSize(size = 20)
|
||||||
|
private Set<Authority> authorities = new HashSet<>();
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLogin() {
|
||||||
|
return login;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Lowercase the login before saving it in database
|
||||||
|
public void setLogin(String login) {
|
||||||
|
this.login = StringUtils.lowerCase(login, Locale.ENGLISH);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImageUrl() {
|
||||||
|
return imageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImageUrl(String imageUrl) {
|
||||||
|
this.imageUrl = imageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isActivated() {
|
||||||
|
return activated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivated(boolean activated) {
|
||||||
|
this.activated = activated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getActivationKey() {
|
||||||
|
return activationKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivationKey(String activationKey) {
|
||||||
|
this.activationKey = activationKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResetKey() {
|
||||||
|
return resetKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResetKey(String resetKey) {
|
||||||
|
this.resetKey = resetKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getResetDate() {
|
||||||
|
return resetDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResetDate(Instant resetDate) {
|
||||||
|
this.resetDate = resetDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLangKey() {
|
||||||
|
return langKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLangKey(String langKey) {
|
||||||
|
this.langKey = langKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Authority> getAuthorities() {
|
||||||
|
return authorities;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthorities(Set<Authority> authorities) {
|
||||||
|
this.authorities = authorities;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(o instanceof User)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return id != null && id.equals(((User) o).id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
|
||||||
|
return getClass().hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
// prettier-ignore
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "User{" +
|
||||||
|
"login='" + login + '\'' +
|
||||||
|
", firstName='" + firstName + '\'' +
|
||||||
|
", lastName='" + lastName + '\'' +
|
||||||
|
", email='" + email + '\'' +
|
||||||
|
", imageUrl='" + imageUrl + '\'' +
|
||||||
|
", activated='" + activated + '\'' +
|
||||||
|
", langKey='" + langKey + '\'' +
|
||||||
|
", activationKey='" + activationKey + '\'' +
|
||||||
|
"}";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* Domain objects.
|
||||||
|
*/
|
||||||
|
package com.sisvietnamvn.web.domain;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user