diff --git a/build.xml b/build.xml index 4e922ca..46a3afe 100644 --- a/build.xml +++ b/build.xml @@ -3,78 +3,125 @@ Any modifications will be overwritten. To include a user specific buildfile here, simply create one in the same directory with the processing instruction - as the first entry and export the buildfile again. --> + as the first entry and export the buildfile again. --> + - + - - - - + + + + - + - + - - - - - + + + + + - + - + - - - + + + - + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - - - - + + + + @@ -88,13 +135,19 @@ - - - - + + + + - - + + @@ -144,18 +197,21 @@ - + - + - + diff --git a/hs_err_pid11428.log b/hs_err_pid11428.log deleted file mode 100644 index 034d749..0000000 --- a/hs_err_pid11428.log +++ /dev/null @@ -1,155 +0,0 @@ -# -# There is insufficient memory for the Java Runtime Environment to continue. -# Native memory allocation (malloc) failed to allocate 1048576 bytes for AllocateHeap -# Possible reasons: -# The system is out of physical RAM or swap space -# In 32 bit mode, the process size limit was hit -# Possible solutions: -# Reduce memory load on the system -# Increase physical memory or swap space -# Check if swap backing store is full -# Use 64 bit Java on a 64 bit OS -# Decrease Java heap size (-Xmx/-Xms) -# Decrease number of Java threads -# Decrease Java thread stack sizes (-Xss) -# Set larger code cache with -XX:ReservedCodeCacheSize= -# This output file may be truncated or incomplete. -# -# Out of Memory Error (memory/allocation.inline.hpp:61), pid=11428, tid=0x0000000000001ba8 -# -# JRE version: (8.0_111-b14) (build ) -# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.111-b14 mixed mode windows-amd64 compressed oops) -# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows -# - ---------------- T H R E A D --------------- - -Current thread (0x0000000005645000): JavaThread "Unknown thread" [_thread_in_vm, id=7080, stack(0x0000000005370000,0x0000000005470000)] - -Stack: [0x0000000005370000,0x0000000005470000] -[error occurred during error reporting (printing stack bounds), id 0xc0000005] - -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) - - ---------------- P R O C E S S --------------- - -Java Threads: ( => current thread ) - -Other Threads: - -=>0x0000000005645000 (exited) JavaThread "Unknown thread" [_thread_in_vm, id=7080, stack(0x0000000005370000,0x0000000005470000)] - -VM state:not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: None - -Heap: - PSYoungGen total 56832K, used 983K [0x0000000781100000, 0x0000000785000000, 0x00000007c0000000) - eden space 49152K, 2% used [0x0000000781100000,0x00000007811f5c38,0x0000000784100000) - from space 7680K, 0% used [0x0000000784880000,0x0000000784880000,0x0000000785000000) - to space 7680K, 0% used [0x0000000784100000,0x0000000784100000,0x0000000784880000) - ParOldGen total 130048K, used 0K [0x0000000703200000, 0x000000070b100000, 0x0000000781100000) - object space 130048K, 0% used [0x0000000703200000,0x0000000703200000,0x000000070b100000) - Metaspace used 770K, capacity 4480K, committed 4480K, reserved 1056768K - class space used 75K, capacity 384K, committed 384K, reserved 1048576K - -Card table byte_map: [0x0000000014b00000,0x00000000150f0000] byte_map_base: 0x00000000112e7000 - -Marking Bits: (ParMarkBitMap*) 0x000000006eeba6c0 - Begin Bits: [0x00000000158e0000, 0x0000000018818000) - End Bits: [0x0000000018818000, 0x000000001b750000) - -Polling page: 0x00000000031f0000 - -CodeCache: size=245760Kb used=328Kb max_used=328Kb free=245431Kb - bounds [0x0000000005740000, 0x00000000059b0000, 0x0000000014740000] - total_blobs=58 nmethods=0 adapters=38 - compilation: enabled - -Compilation events (0 events): -No events - -GC Heap History (0 events): -No events - -Deoptimization events (0 events): -No events - -Internal exceptions (0 events): -No events - -Events (10 events): -Event: 0.029 loading class java/lang/Short -Event: 0.029 loading class java/lang/Short done -Event: 0.029 loading class java/lang/Integer -Event: 0.029 loading class java/lang/Integer done -Event: 0.029 loading class java/lang/Long -Event: 0.029 loading class java/lang/Long done -Event: 0.030 loading class java/lang/NullPointerException -Event: 0.030 loading class java/lang/NullPointerException done -Event: 0.030 loading class java/lang/ArithmeticException -Event: 0.030 loading class java/lang/ArithmeticException done - - -Dynamic libraries: -0x00007ff6dbbf0000 - 0x00007ff6dbc27000 C:\Program Files\Java\jdk1.8.0_111\bin\java.exe -0x00007ffb25090000 - 0x00007ffb25270000 C:\Windows\SYSTEM32\ntdll.dll -0x00007ffb24d30000 - 0x00007ffb24dde000 C:\Windows\System32\KERNEL32.DLL -0x00007ffb222f0000 - 0x00007ffb22556000 C:\Windows\System32\KERNELBASE.dll -0x00007ffb24de0000 - 0x00007ffb24e81000 C:\Windows\System32\ADVAPI32.dll -0x00007ffb22b10000 - 0x00007ffb22bad000 C:\Windows\System32\msvcrt.dll -0x00007ffb22770000 - 0x00007ffb227cb000 C:\Windows\System32\sechost.dll -0x00007ffb22640000 - 0x00007ffb2275f000 C:\Windows\System32\RPCRT4.dll -0x00007ffb22c80000 - 0x00007ffb22e0e000 C:\Windows\System32\USER32.dll -0x00007ffb222d0000 - 0x00007ffb222f0000 C:\Windows\System32\win32u.dll -0x00007ffb227d0000 - 0x00007ffb227f8000 C:\Windows\System32\GDI32.dll -0x00007ffb21490000 - 0x00007ffb21621000 C:\Windows\System32\gdi32full.dll -0x00007ffb21800000 - 0x00007ffb2189b000 C:\Windows\System32\msvcp_win.dll -0x00007ffb21680000 - 0x00007ffb21776000 C:\Windows\System32\ucrtbase.dll -0x00007ffb15650000 - 0x00007ffb158b9000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.16299.15_none_cc92fb402215d91d\COMCTL32.dll -0x00007ffb22800000 - 0x00007ffb22b08000 C:\Windows\System32\combase.dll -0x00007ffb21780000 - 0x00007ffb217f2000 C:\Windows\System32\bcryptPrimitives.dll -0x00007ffb22fe0000 - 0x00007ffb2300d000 C:\Windows\System32\IMM32.DLL -0x000000006f570000 - 0x000000006f642000 C:\Program Files\Java\jdk1.8.0_111\jre\bin\msvcr100.dll -0x000000006e6a0000 - 0x000000006ef3a000 C:\Program Files\Java\jdk1.8.0_111\jre\bin\server\jvm.dll -0x00007ffb22630000 - 0x00007ffb22638000 C:\Windows\System32\PSAPI.DLL -0x00007ffb1e130000 - 0x00007ffb1e139000 C:\Windows\SYSTEM32\WSOCK32.dll -0x00007ffb22bb0000 - 0x00007ffb22c1c000 C:\Windows\System32\WS2_32.dll -0x00007ffb1e9d0000 - 0x00007ffb1e9f3000 C:\Windows\SYSTEM32\WINMM.dll -0x00007ffb1e9a0000 - 0x00007ffb1e9ca000 C:\Windows\SYSTEM32\WINMMBASE.dll -0x00007ffb21630000 - 0x00007ffb2167a000 C:\Windows\System32\cfgmgr32.dll -0x00007ffb1b0f0000 - 0x00007ffb1b0fa000 C:\Windows\SYSTEM32\VERSION.dll -0x000000006f560000 - 0x000000006f56f000 C:\Program Files\Java\jdk1.8.0_111\jre\bin\verify.dll -0x000000006f530000 - 0x000000006f559000 C:\Program Files\Java\jdk1.8.0_111\jre\bin\java.dll -0x000000006f700000 - 0x000000006f723000 C:\Program Files\Java\jdk1.8.0_111\jre\bin\instrument.dll -0x000000006f510000 - 0x000000006f526000 C:\Program Files\Java\jdk1.8.0_111\jre\bin\zip.dll - -VM Arguments: -jvm_args: -javaagent:D:\tool\IDEA\IntelliJ IDEA 2017.3.4\lib\idea_rt.jar=55910:D:\tool\IDEA\IntelliJ IDEA 2017.3.4\bin -Dfile.encoding=UTF-8 -java_command: cn.hellohao.test.Task2 -java_class_path (initial): C:\Program Files\Java\jdk1.8.0_111\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\rt.jar;E:\myjavawork\Tbed\target\classes;E:\RepMaven\repo\org\springframework\boot\spring-boot-starter-thymeleaf\2.1.1.RELEASE\spring-boot-starter-thymeleaf-2.1.1.RELEASE.jar;E:\RepMaven\repo\org\springframework\boot\spring-boot-starter\2.1.1.RELEASE\spring-boot-starter-2.1.1.RELEASE.jar;E:\RepMaven\repo\org\springframework\boot\spring-boot\2.1.1.RELEASE\spring-boot-2.1.1.RELEASE.jar;E:\RepMaven\repo\org\springframework\boot\spring-boot-starter-logging\2.1.1.RELEASE\spring-boot-starter-logging-2.1.1.RELEASE.jar;E:\RepMaven\repo\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;E:\RepMaven\repo\ch\qos\logback\logback-core\1.2.3\logback- -Launcher Type: SUN_STANDARD - -Environment Variables: -JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111 -PATH=E:\oracle\product\10.2.0\client_2\bin;E:\SQLPlus\Documents\product\11.2.0\client_1\bin;E:\SQLPlus\oracle\bin;E:\桌面\nTrun_V3.0.3\Goto;C;\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\tool\SVN\bin;C:\Program Files\Java\jdk1.8.0_111;C:\Program Files\Java\jdk1.8.0_111\bin;C:\Program Files\Java\jdk1.8.0_111\jre\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\hellohao\AppData\Local\Microsoft\WindowsApps;D:\tool\Bandizip\;D:\tool\go\bin;D:\Maven\apache-maven-3.5.3\bin;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Program Files\MySQL\MySQL Server 5.7\bin;D:\tool\Git\cmd;C:\Users\hellohao\AppData\Local\Microsoft\WindowsApps;D:\tool\Bandizip\;D:\tool\开发工具\VSCode\Microsoft VS Code Insiders\bin -USERNAME=hellohao -OS=Windows_NT -PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 94 Stepping 3, GenuineIntel - - - ---------------- S Y S T E M --------------- - -OS: Windows 10.0 , 64 bit Build 16299 (10.0.16299.15) - -CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 94 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, rtm, 3dnowpref, lzcnt, tsc, tscinvbit, bmi1, bmi2, adx - -Memory: 4k page, physical 12372972k(1709532k free), swap 12372972k(5124k free) - -vm_info: Java HotSpot(TM) 64-Bit Server VM (25.111-b14) for windows-amd64 JRE (1.8.0_111-b14), built on Sep 22 2016 19:24:05 by "java_re" with MS VC++ 10.0 (VS2010) - -time: Sat Jan 26 16:29:59 2019 -elapsed time: 0 seconds (0d 0h 0m 0s) - diff --git a/hs_err_pid15776.log b/hs_err_pid15776.log deleted file mode 100644 index b90cca0..0000000 --- a/hs_err_pid15776.log +++ /dev/null @@ -1,155 +0,0 @@ -# -# There is insufficient memory for the Java Runtime Environment to continue. -# Native memory allocation (malloc) failed to allocate 1048576 bytes for AllocateHeap -# Possible reasons: -# The system is out of physical RAM or swap space -# In 32 bit mode, the process size limit was hit -# Possible solutions: -# Reduce memory load on the system -# Increase physical memory or swap space -# Check if swap backing store is full -# Use 64 bit Java on a 64 bit OS -# Decrease Java heap size (-Xmx/-Xms) -# Decrease number of Java threads -# Decrease Java thread stack sizes (-Xss) -# Set larger code cache with -XX:ReservedCodeCacheSize= -# This output file may be truncated or incomplete. -# -# Out of Memory Error (memory/allocation.inline.hpp:61), pid=15776, tid=0x000000000000215c -# -# JRE version: (8.0_111-b14) (build ) -# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.111-b14 mixed mode windows-amd64 compressed oops) -# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows -# - ---------------- T H R E A D --------------- - -Current thread (0x0000000005175000): JavaThread "Unknown thread" [_thread_in_vm, id=8540, stack(0x0000000004f50000,0x0000000005050000)] - -Stack: [0x0000000004f50000,0x0000000005050000] -[error occurred during error reporting (printing stack bounds), id 0xc0000005] - -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) - - ---------------- P R O C E S S --------------- - -Java Threads: ( => current thread ) - -Other Threads: - -=>0x0000000005175000 (exited) JavaThread "Unknown thread" [_thread_in_vm, id=8540, stack(0x0000000004f50000,0x0000000005050000)] - -VM state:not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: None - -Heap: - PSYoungGen total 56832K, used 983K [0x0000000781100000, 0x0000000785000000, 0x00000007c0000000) - eden space 49152K, 2% used [0x0000000781100000,0x00000007811f5c38,0x0000000784100000) - from space 7680K, 0% used [0x0000000784880000,0x0000000784880000,0x0000000785000000) - to space 7680K, 0% used [0x0000000784100000,0x0000000784100000,0x0000000784880000) - ParOldGen total 130048K, used 0K [0x0000000703200000, 0x000000070b100000, 0x0000000781100000) - object space 130048K, 0% used [0x0000000703200000,0x0000000703200000,0x000000070b100000) - Metaspace used 770K, capacity 4480K, committed 4480K, reserved 1056768K - class space used 75K, capacity 384K, committed 384K, reserved 1048576K - -Card table byte_map: [0x0000000014630000,0x0000000014c20000] byte_map_base: 0x0000000010e17000 - -Marking Bits: (ParMarkBitMap*) 0x000000006eeba6c0 - Begin Bits: [0x0000000015410000, 0x0000000018348000) - End Bits: [0x0000000018348000, 0x000000001b280000) - -Polling page: 0x0000000003290000 - -CodeCache: size=245760Kb used=328Kb max_used=328Kb free=245431Kb - bounds [0x0000000005270000, 0x00000000054e0000, 0x0000000014270000] - total_blobs=58 nmethods=0 adapters=38 - compilation: enabled - -Compilation events (0 events): -No events - -GC Heap History (0 events): -No events - -Deoptimization events (0 events): -No events - -Internal exceptions (0 events): -No events - -Events (10 events): -Event: 0.037 loading class java/lang/Short -Event: 0.037 loading class java/lang/Short done -Event: 0.037 loading class java/lang/Integer -Event: 0.037 loading class java/lang/Integer done -Event: 0.037 loading class java/lang/Long -Event: 0.037 loading class java/lang/Long done -Event: 0.038 loading class java/lang/NullPointerException -Event: 0.038 loading class java/lang/NullPointerException done -Event: 0.038 loading class java/lang/ArithmeticException -Event: 0.038 loading class java/lang/ArithmeticException done - - -Dynamic libraries: -0x00007ff6dbbf0000 - 0x00007ff6dbc27000 C:\Program Files\Java\jdk1.8.0_111\bin\java.exe -0x00007ffb25090000 - 0x00007ffb25270000 C:\Windows\SYSTEM32\ntdll.dll -0x00007ffb24d30000 - 0x00007ffb24dde000 C:\Windows\System32\KERNEL32.DLL -0x00007ffb222f0000 - 0x00007ffb22556000 C:\Windows\System32\KERNELBASE.dll -0x00007ffb24de0000 - 0x00007ffb24e81000 C:\Windows\System32\ADVAPI32.dll -0x00007ffb22b10000 - 0x00007ffb22bad000 C:\Windows\System32\msvcrt.dll -0x00007ffb22770000 - 0x00007ffb227cb000 C:\Windows\System32\sechost.dll -0x00007ffb22640000 - 0x00007ffb2275f000 C:\Windows\System32\RPCRT4.dll -0x00007ffb22c80000 - 0x00007ffb22e0e000 C:\Windows\System32\USER32.dll -0x00007ffb222d0000 - 0x00007ffb222f0000 C:\Windows\System32\win32u.dll -0x00007ffb227d0000 - 0x00007ffb227f8000 C:\Windows\System32\GDI32.dll -0x00007ffb21490000 - 0x00007ffb21621000 C:\Windows\System32\gdi32full.dll -0x00007ffb21800000 - 0x00007ffb2189b000 C:\Windows\System32\msvcp_win.dll -0x00007ffb21680000 - 0x00007ffb21776000 C:\Windows\System32\ucrtbase.dll -0x00007ffb15650000 - 0x00007ffb158b9000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.16299.15_none_cc92fb402215d91d\COMCTL32.dll -0x00007ffb22800000 - 0x00007ffb22b08000 C:\Windows\System32\combase.dll -0x00007ffb21780000 - 0x00007ffb217f2000 C:\Windows\System32\bcryptPrimitives.dll -0x00007ffb22fe0000 - 0x00007ffb2300d000 C:\Windows\System32\IMM32.DLL -0x000000006f570000 - 0x000000006f642000 C:\Program Files\Java\jdk1.8.0_111\jre\bin\msvcr100.dll -0x000000006e6a0000 - 0x000000006ef3a000 C:\Program Files\Java\jdk1.8.0_111\jre\bin\server\jvm.dll -0x00007ffb22630000 - 0x00007ffb22638000 C:\Windows\System32\PSAPI.DLL -0x00007ffb1e130000 - 0x00007ffb1e139000 C:\Windows\SYSTEM32\WSOCK32.dll -0x00007ffb22bb0000 - 0x00007ffb22c1c000 C:\Windows\System32\WS2_32.dll -0x00007ffb1e9d0000 - 0x00007ffb1e9f3000 C:\Windows\SYSTEM32\WINMM.dll -0x00007ffb1b0f0000 - 0x00007ffb1b0fa000 C:\Windows\SYSTEM32\VERSION.dll -0x00007ffb1e9a0000 - 0x00007ffb1e9ca000 C:\Windows\SYSTEM32\winmmbase.dll -0x00007ffb21630000 - 0x00007ffb2167a000 C:\Windows\System32\cfgmgr32.dll -0x000000006f560000 - 0x000000006f56f000 C:\Program Files\Java\jdk1.8.0_111\jre\bin\verify.dll -0x000000006f530000 - 0x000000006f559000 C:\Program Files\Java\jdk1.8.0_111\jre\bin\java.dll -0x000000006f700000 - 0x000000006f723000 C:\Program Files\Java\jdk1.8.0_111\jre\bin\instrument.dll -0x000000006f510000 - 0x000000006f526000 C:\Program Files\Java\jdk1.8.0_111\jre\bin\zip.dll - -VM Arguments: -jvm_args: -javaagent:D:\tool\IDEA\IntelliJ IDEA 2017.3.4\lib\idea_rt.jar=55884:D:\tool\IDEA\IntelliJ IDEA 2017.3.4\bin -Dfile.encoding=UTF-8 -java_command: cn.hellohao.test.Task2 -java_class_path (initial): C:\Program Files\Java\jdk1.8.0_111\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\rt.jar;E:\myjavawork\Tbed\target\classes;E:\RepMaven\repo\org\springframework\boot\spring-boot-starter-thymeleaf\2.1.1.RELEASE\spring-boot-starter-thymeleaf-2.1.1.RELEASE.jar;E:\RepMaven\repo\org\springframework\boot\spring-boot-starter\2.1.1.RELEASE\spring-boot-starter-2.1.1.RELEASE.jar;E:\RepMaven\repo\org\springframework\boot\spring-boot\2.1.1.RELEASE\spring-boot-2.1.1.RELEASE.jar;E:\RepMaven\repo\org\springframework\boot\spring-boot-starter-logging\2.1.1.RELEASE\spring-boot-starter-logging-2.1.1.RELEASE.jar;E:\RepMaven\repo\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;E:\RepMaven\repo\ch\qos\logback\logback-core\1.2.3\logback- -Launcher Type: SUN_STANDARD - -Environment Variables: -JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111 -PATH=E:\oracle\product\10.2.0\client_2\bin;E:\SQLPlus\Documents\product\11.2.0\client_1\bin;E:\SQLPlus\oracle\bin;E:\桌面\nTrun_V3.0.3\Goto;C;\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\tool\SVN\bin;C:\Program Files\Java\jdk1.8.0_111;C:\Program Files\Java\jdk1.8.0_111\bin;C:\Program Files\Java\jdk1.8.0_111\jre\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\hellohao\AppData\Local\Microsoft\WindowsApps;D:\tool\Bandizip\;D:\tool\go\bin;D:\Maven\apache-maven-3.5.3\bin;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Program Files\MySQL\MySQL Server 5.7\bin;D:\tool\Git\cmd;C:\Users\hellohao\AppData\Local\Microsoft\WindowsApps;D:\tool\Bandizip\;D:\tool\开发工具\VSCode\Microsoft VS Code Insiders\bin -USERNAME=hellohao -OS=Windows_NT -PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 94 Stepping 3, GenuineIntel - - - ---------------- S Y S T E M --------------- - -OS: Windows 10.0 , 64 bit Build 16299 (10.0.16299.15) - -CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 94 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, rtm, 3dnowpref, lzcnt, tsc, tscinvbit, bmi1, bmi2, adx - -Memory: 4k page, physical 12372972k(1729808k free), swap 12372972k(5296k free) - -vm_info: Java HotSpot(TM) 64-Bit Server VM (25.111-b14) for windows-amd64 JRE (1.8.0_111-b14), built on Sep 22 2016 19:24:05 by "java_re" with MS VC++ 10.0 (VS2010) - -time: Sat Jan 26 16:29:45 2019 -elapsed time: 0 seconds (0d 0h 0m 0s) - diff --git a/index.html b/index.html new file mode 100644 index 0000000..ea5c253 --- /dev/null +++ b/index.html @@ -0,0 +1,8 @@ +{ +"id": 192, +"hitokoto": "涓嶈锛屾垜鐜板湪鏆傛椂鐣欏湪浠栬韩杈癸紝鐩村埌閭h浆鐬嵆閫濈殑鏃ュ瓙鍒版潵銆", +"type": "a", +"from": "澶忕洰鍙嬩汉甯", +"creator": "Sai", +"created_at": "1468605911" +} diff --git a/mvnw b/mvnw deleted file mode 100644 index 5551fde..0000000 --- a/mvnw +++ /dev/null @@ -1,286 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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 -# -# http://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. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" - # TODO classpath? -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - 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 - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - wget "$jarUrl" -O "$wrapperJarPath" - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - curl -o "$wrapperJarPath" "$jarUrl" - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd deleted file mode 100644 index e5cfb0a..0000000 --- a/mvnw.cmd +++ /dev/null @@ -1,161 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" -FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - echo Found %WRAPPER_JAR% -) else ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" - echo Finished downloading %WRAPPER_JAR% -) -@REM End of extension - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml index ddc6673..056e65e 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,6 @@ - org.springframework.boot spring-boot-starter-thymeleaf @@ -41,7 +40,60 @@ druid-spring-boot-starter 1.1.10 + + + com.aliyun.oss + aliyun-sdk-oss + 2.8.3 + + + + javax.mail + mail + 1.4.7 + + + + org.springframework.boot + spring-boot-starter-mail + + + + com.baidu.aip + java-sdk + 4.11.0 + + + + + org.quartz-scheduler + quartz + 2.2.1 + + + + org.springframework + spring-context-support + + + + + org.springframework + spring-tx + 4.3.16.RELEASE + + + + org.slf4j + slf4j-api + 1.7.21 + + + commons-logging + commons-logging + 1.2 + org.springframework.boot diff --git a/src/main/java/cn/hellohao/JianHuangThread.java b/src/main/java/cn/hellohao/JianHuangThread.java new file mode 100644 index 0000000..9f32b4d --- /dev/null +++ b/src/main/java/cn/hellohao/JianHuangThread.java @@ -0,0 +1,35 @@ +package cn.hellohao; + +import cn.hellohao.pojo.Imgreview; +import cn.hellohao.pojo.Keys; +import cn.hellohao.pojo.User; +import cn.hellohao.service.ImgreviewService; +import cn.hellohao.utils.ImageReview; + +import java.util.HashMap; +import java.util.Map; + +public class JianHuangThread extends Thread { + + private Keys key; + private Map hashMap; + private ImgreviewService imgreviewService; + private User user; + + public JianHuangThread(ImgreviewService imgreviewService, Keys keys, User user, Map hashMap) { + this.key = keys; + this.user = user; + this.imgreviewService = imgreviewService; + this.hashMap = hashMap; + } + + @Override + public void run() { + Imgreview imgreview = imgreviewService.selectByPrimaryKey(1); + if (user != null) { + ImageReview.imgJB(hashMap, key.getRequestAddress() + "/", key, imgreview); + } else { + ImageReview.imgJB(hashMap, key.getRequestAddress() + "/", key, imgreview); + } + } +} diff --git a/src/main/java/cn/hellohao/TbedApplication.java b/src/main/java/cn/hellohao/TbedApplication.java index 968a6d2..10007ba 100644 --- a/src/main/java/cn/hellohao/TbedApplication.java +++ b/src/main/java/cn/hellohao/TbedApplication.java @@ -12,13 +12,14 @@ import org.springframework.context.annotation.Configuration; @Configuration public class TbedApplication { - public static void main(String[] args) { - SpringApplication.run(TbedApplication.class, args); - - } - /** + public static void main(String[] args) { + SpringApplication.run(TbedApplication.class, args); + + } + + /** * 鏂囦欢涓婁紶閰嶇疆 - * + * * @return */ @Bean diff --git a/src/main/java/cn/hellohao/controller/AdminController.java b/src/main/java/cn/hellohao/controller/AdminController.java index b3dd508..286e60c 100644 --- a/src/main/java/cn/hellohao/controller/AdminController.java +++ b/src/main/java/cn/hellohao/controller/AdminController.java @@ -1,146 +1,374 @@ package cn.hellohao.controller; -import cn.hellohao.pojo.Images; -import cn.hellohao.pojo.Keys; -import cn.hellohao.pojo.User; +import cn.hellohao.pojo.*; import cn.hellohao.pojo.vo.PageResultBean; -import cn.hellohao.service.ImgService; -import cn.hellohao.service.KeysService; -import cn.hellohao.service.UserService; +import cn.hellohao.service.*; import cn.hellohao.service.impl.ImgServiceImpl; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; -import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import java.util.HashMap; import java.util.List; +import java.util.Map; @Controller @RequestMapping("/admin") public class AdminController { - @Autowired - private ImgService imgService; - @Autowired - private KeysService keysService; - @Autowired - private UserService userService; + @Autowired + private ImgService imgService; + @Autowired + private KeysService keysService; + @Autowired + private UserService userService; + @Autowired + private ImgreviewService imgreviewService; + @Autowired + private ConfigService configService; + @Autowired + private EmailConfigService emailConfigService; - // 杩涘叆鍚庡彴椤甸潰 - @RequestMapping(value = "/admin.do") - public String goadmin(HttpSession session, Model model, HttpServletRequest request) { - Integer storageType1 = (Integer) session.getAttribute("storageType"); - Integer storageType = keysService.selectKeysType(); - Keys key = keysService.selectKeys(storageType); - User u = (User) session.getAttribute("user"); - if(u.getLevel()>1) { - model.addAttribute("counts", imgService.counts(null)); - model.addAttribute("getUserTotal", userService.getUserTotal()); - }else { - model.addAttribute("counts", imgService.countimg(u.getId())); - } - model.addAttribute("username", u.getUsername()); - model.addAttribute("level", u.getLevel()); - model.addAttribute("email", u.getEmail()); - model.addAttribute("loginid", 100); - //key淇℃伅 - model.addAttribute("AccessKey", key.getAccessKey()); - model.addAttribute("AccessSecret", key.getAccessSecret()); - model.addAttribute("Endpoint", key.getEndpoint()); - model.addAttribute("Bucketname", key.getBucketname()); - model.addAttribute("RequestAddress", key.getRequestAddress()); - model.addAttribute("StorageType", storageType); - model.addAttribute("text_foot", "
  • Hellohao ©
  • 鍒囧嬁涓婁紶杩濆弽涓崕浜烘皯鍏卞拰鍥戒簰鑱旂綉娉曞緥鏉$害璧勬簮
  • "); - if (u.getLevel() > 1) { - model.addAttribute("htgl", - ""); - } - return "admin/table"; - } - @RequestMapping(value = "/selecttable.do") - @ResponseBody - public PageResultBean selectByFy(HttpSession session, Integer pageNum, Integer pageSize) { - User u = (User) session.getAttribute("user"); - // 浣跨敤Pagehelper浼犲叆褰撳墠椤垫暟鍜岄〉闈㈡樉绀烘潯鏁颁細鑷姩涓烘垜浠殑select璇彞鍔犱笂limit鏌ヨ - // 浠庝粬鐨勪笅涓鏉ql寮濮嬪垎椤 - PageHelper.startPage(pageNum, pageSize); - List images = null; - if(u.getLevel()>1){ //鏍规嵁鐢ㄦ埛绛夌骇鏌ヨ绠$悊鍛樻煡璇㈡墍鏈夌殑淇℃伅 - images = imgService.selectimg(null);// 杩欐槸鎴戜滑鐨剆ql - }else{ - images = imgService.selectimg(u.getId());// 杩欐槸鎴戜滑鐨剆ql - } - // 浣跨敤pageInfo鍖呰鏌ヨ - PageInfo rolePageInfo = new PageInfo<>(images);// - return new PageResultBean<>(rolePageInfo.getTotal(), rolePageInfo.getList()); - } - - @PostMapping("/updatekey.do") - @ResponseBody - public String updatekey(Keys key) { - Integer ret = keysService.updateKey(key); - JSONArray jsonArray = new JSONArray(); - jsonArray.add(ret); - return jsonArray.toString(); - } - @PostMapping("/deleimg.do") - @ResponseBody - public String deleimg(HttpSession session,Integer id) { - Integer storageType = (Integer) session.getAttribute("storageType"); - Images images = imgService.selectByPrimaryKey(id); - Keys key = keysService.selectKeys(storageType); - ImgServiceImpl de = new ImgServiceImpl(); - de.delect(key, images.getImgname()); - JSONArray jsonArray = new JSONArray(); - Integer ret = imgService.deleimg(id); - jsonArray.add(ret); - return jsonArray.toString(); - } - - //淇敼璧勬枡 - @PostMapping("/change.do") - @ResponseBody - public String change(HttpSession session,User user) { - System.out.println(user.getUsername()); - Integer count = userService.checkUsername(user.getUsername()); - User u = (User) session.getAttribute("user"); - user.setEmail(u.getEmail()); - JSONArray jsonArray = new JSONArray(); - if(count==0) { - Integer ret = userService.change(user); - jsonArray.add(ret); - if(u.getEmail()!=null&&u.getPassword()!=null) { - session.removeAttribute("user"); - //鍒锋柊view - session.invalidate(); - } - - }else { - jsonArray.add("-1"); - } - // -1 鐢ㄦ埛鍚嶉噸澶 - return jsonArray.toString(); - } - + @RequestMapping(value = "/goadmin") + public String goadmin1(HttpSession session, Model model, HttpServletRequest request) { + User user = (User) session.getAttribute("user"); + if (user.getLevel() == 1) { + model.addAttribute("level", "鏅氱敤鎴"); + } else if (user.getLevel() == 2) { + model.addAttribute("level", "绠$悊鍛"); + } else { + model.addAttribute("level", "鏈 鐭"); + } + model.addAttribute("levels", user.getLevel()); + model.addAttribute("username", user.getUsername()); + return "admin/index"; + } - @GetMapping(value = "/images/{id}") - @ResponseBody - public Images selectByFy(@PathVariable("id") Integer id) { - return imgService.selectByPrimaryKey(id); - } + + // 杩涘叆鍚庡彴椤甸潰 + @RequestMapping(value = "/admin") + public String goadmin(HttpSession session, Model model, HttpServletRequest request) { + Config config = configService.getSourceype();//鏌ヨ褰撳墠绯荤粺浣跨敤鐨勫瓨鍌ㄦ簮绫诲瀷銆 + Keys key = keysService.selectKeys(config.getSourcekey()); + User u = (User) session.getAttribute("user"); + Imgreview imgreview = imgreviewService.selectByPrimaryKey(1); +// if (u.getLevel() > 1) { +// //绠$悊鍛 +// model.addAttribute("counts", imgService.counts(null)); +// } else { +// //涓汉鐢ㄦ埛 +// //model.addAttribute("counts", imgService.countimg(u.getId()));//杩欎釜鏄牴鎹敤鎴穒d鏌ヨ浠栫殑鍥剧墖鏁 +// +// } + model.addAttribute("usercount", imgService.countimg(u.getId()));//杩欎釜鏄牴鎹敤鎴穒d鏌ヨ浠栫殑鍥剧墖鏁 + model.addAttribute("counts", imgService.counts(null) + 1000);//鎬绘暟 + model.addAttribute("getUserTotal", userService.getUserTotal() + 100); + model.addAttribute("imgreviewcount", imgreview.getCount()); + model.addAttribute("username", u.getUsername()); + model.addAttribute("level", u.getLevel()); + model.addAttribute("email", u.getEmail()); + model.addAttribute("loginid", 100); + model.addAttribute("source", key.getStorageType()); + + //key淇℃伅 +// model.addAttribute("AccessKey", key.getAccessKey()); +// model.addAttribute("AccessSecret", key.getAccessSecret()); +// model.addAttribute("Endpoint", key.getEndpoint()); +// model.addAttribute("Bucketname", key.getBucketname()); +// model.addAttribute("RequestAddress", key.getRequestAddress()); +// model.addAttribute("StorageType", storageType); +// if (u.getLevel() > 1) { +//// model.addAttribute("htgl", +//// "绯荤粺閰嶇疆"); +//// +//// } + return "admin/table"; + } + + @RequestMapping(value = "/selecttable") + @ResponseBody + public PageResultBean selectByFy(HttpSession session, Integer pageNum, Integer pageSize, Integer selecttype) { + User u = (User) session.getAttribute("user"); + // 浣跨敤Pagehelper浼犲叆褰撳墠椤垫暟鍜岄〉闈㈡樉绀烘潯鏁颁細鑷姩涓烘垜浠殑select璇彞鍔犱笂limit鏌ヨ + // 浠庝粬鐨勪笅涓鏉ql寮濮嬪垎椤 + PageHelper.startPage(pageNum, pageSize); + List images = null; + if (u.getLevel() > 1) { //鏍规嵁鐢ㄦ埛绛夌骇鏌ヨ绠$悊鍛樻煡璇㈡墍鏈夌殑淇℃伅 + if (selecttype == 1) { + images = imgService.selectimg(null);// 杩欐槸鎴戜滑鐨剆ql + } else { + images = imgService.selectimg(u.getId());// 杩欐槸鎴戜滑鐨剆ql + } + } else { + images = imgService.selectimg(u.getId());// 杩欐槸鎴戜滑鐨剆ql + } + // 浣跨敤pageInfo鍖呰鏌ヨ + PageInfo rolePageInfo = new PageInfo<>(images);// + return new PageResultBean<>(rolePageInfo.getTotal(), rolePageInfo.getList()); + } + + //鑾峰彇鐢ㄦ埛淇℃伅鍒楄〃 + @RequestMapping(value = "/selectusertable") + @ResponseBody + public PageResultBean selectByFy1(HttpSession session, Integer pageNum, Integer pageSize) { + User u = (User) session.getAttribute("user"); + // 浣跨敤Pagehelper浼犲叆褰撳墠椤垫暟鍜岄〉闈㈡樉绀烘潯鏁颁細鑷姩涓烘垜浠殑select璇彞鍔犱笂limit鏌ヨ + // 浠庝粬鐨勪笅涓鏉ql寮濮嬪垎椤 + PageHelper.startPage(pageNum, pageSize); + List users = null; + if (u.getLevel() > 1) { //鏍规嵁鐢ㄦ埛绛夌骇鏌ヨ绠$悊鍛樻煡璇㈡墍鏈夌殑淇℃伅 + users = userService.getuserlist();// 杩欐槸鎴戜滑鐨剆ql + // 浣跨敤pageInfo鍖呰鏌ヨ + PageInfo rolePageInfo = new PageInfo<>(users);// + return new PageResultBean<>(rolePageInfo.getTotal(), rolePageInfo.getList()); + } else { + return null; + } + } + + //杩斿洖瀵硅薄瀛樺偍鐣岄潰 + @RequestMapping(value = "/root/touser") + public String touser() { + return "admin/user"; + } + + //鑾峰彇鐢ㄦ埛淇℃伅鍒楄〃 + @RequestMapping(value = "/selectusertable2") + @ResponseBody + public Map selectByFy12(HttpSession session, @RequestParam(required = false, defaultValue = "1") int page, + @RequestParam(required = false) int limit) { + User u = (User) session.getAttribute("user"); + // 浣跨敤Pagehelper浼犲叆褰撳墠椤垫暟鍜岄〉闈㈡樉绀烘潯鏁颁細鑷姩涓烘垜浠殑select璇彞鍔犱笂limit鏌ヨ + // 浠庝粬鐨勪笅涓鏉ql寮濮嬪垎椤 + PageHelper.startPage(page, limit); + List users = null; + if (u.getLevel() > 1) { //鏍规嵁鐢ㄦ埛绛夌骇鏌ヨ绠$悊鍛樻煡璇㈡墍鏈夌殑淇℃伅 + users = userService.getuserlist();// 杩欐槸鎴戜滑鐨剆ql + // 浣跨敤pageInfo鍖呰鏌ヨ + PageInfo rolePageInfo = new PageInfo<>(users);// + Map map = new HashMap(); + map.put("code", 0); + map.put("msg", ""); + map.put("count", rolePageInfo.getTotal()); + map.put("data", rolePageInfo.getList()); + return map; + } else { + return null; + } + } + + //杩斿洖瀵硅薄瀛樺偍鐣岄潰 + @RequestMapping(value = "/root/tostorage") + public String tostorage(HttpSession session, Model model, HttpServletRequest request) { + Config config = configService.getSourceype();//鏌ヨ褰撳墠绯荤粺浣跨敤鐨勫瓨鍌ㄦ簮绫诲瀷銆 + Keys key = keysService.selectKeys(config.getSourcekey()); + //key淇℃伅 + model.addAttribute("AccessKey", key.getAccessKey()); + model.addAttribute("AccessSecret", key.getAccessSecret()); + model.addAttribute("Endpoint", key.getEndpoint()); + model.addAttribute("Bucketname", key.getBucketname()); + model.addAttribute("RequestAddress", key.getRequestAddress()); + model.addAttribute("StorageType", config.getSourcekey()); + return "admin/storageconfig"; + } + + //鏍规嵁涓嬫媺妗嗛夌殑瀛樺偍婧愭煡璇㈠搴旂殑key + @PostMapping("/root/getkey") + @ResponseBody + public String getkey(Integer storageType) { + JSONArray jsonArray = new JSONArray(); + Keys key = keysService.selectKeys(storageType); + jsonArray.add(key); + return jsonArray.toString(); + } + + @PostMapping("/root/updatekey") + @ResponseBody + public String updatekey(Keys key) { + JSONArray jsonArray = new JSONArray(); + Config config = new Config(); + config.setSourcekey(key.getStorageType()); + Integer val = configService.setSourceype(config); + if (val > 0) { + Integer ret = keysService.updateKey(key); + jsonArray.add(ret); + } else { + jsonArray.add(0); + } + return jsonArray.toString(); + } + + @PostMapping("/deleimg") + @ResponseBody + public String deleimg(HttpSession session, Integer id, Integer sourcekey) { + JSONObject jsonObject = new JSONObject(); + User u = (User) session.getAttribute("user"); + Images images = imgService.selectByPrimaryKey(id); + Keys key = keysService.selectKeys(sourcekey); + ImgServiceImpl de = new ImgServiceImpl(); + + if (key.getStorageType() == 1) { + de.delect(key, images.getImgname()); + } else if (key.getStorageType() == 2) { + de.delectOSS(key, images.getImgname()); + } else if (key.getStorageType() == 3) { + //鍒濆鍖栬吘璁簯 + } else if (key.getStorageType() == 4) { + //鍒濆鍖栦竷鐗涗簯 + } else { + System.err.println("鏈幏鍙栧埌瀵硅薄瀛樺偍鍙傛暟锛屽垹闄ゅけ璐ャ"); + } + Integer ret = imgService.deleimg(id); + Integer count = 0; + if (ret > 0) { + jsonObject.put("usercount", imgService.countimg(u.getId())); + jsonObject.put("count", imgService.counts(null) + 1000); + count = 1; + } else { + count = 0; + } + jsonObject.put("val", count); + return jsonObject.toString(); + } + + //鎵归噺鍒犻櫎鍥剧墖 + @PostMapping("/deleallimg") + @ResponseBody + public String deleallimg(HttpSession session, @RequestParam("ids[]") Integer[] ids) { + JSONObject jsonObject = new JSONObject(); + Integer v = 0; + ImgServiceImpl de = new ImgServiceImpl(); + User u = (User) session.getAttribute("user"); + for (int i = 0; i < ids.length; i++) { + Images images = imgService.selectByPrimaryKey(ids[i]); + Keys key = keysService.selectKeys(images.getSource()); + if (key.getStorageType() == 1) { + de.delect(key, images.getImgname()); + } else if (key.getStorageType() == 2) { + de.delectOSS(key, images.getImgname()); + } else if (key.getStorageType() == 3) { + //鍒濆鍖栬吘璁簯 + } else if (key.getStorageType() == 4) { + //鍒濆鍖栦竷鐗涗簯 + } else { + System.err.println("鏈幏鍙栧埌瀵硅薄瀛樺偍鍙傛暟锛屽垹闄ゅけ璐ャ"); + } + Integer ret = imgService.deleimg(ids[i]); + if (ret < 1) { + v = 0; + } else { + v = 1; + } + } + jsonObject.put("usercount", imgService.countimg(u.getId())); + jsonObject.put("count", imgService.counts(null) + 1000); + jsonObject.put("val", v); + return jsonObject.toString(); + } + + //鍒櫎鐢ㄦ埗 + @PostMapping("/root/deleuser") + @ResponseBody + public String deleuser(HttpSession session, Integer id) { + JSONArray jsonArray = new JSONArray(); + Integer ret = userService.deleuser(id); + jsonArray.add(ret); + return jsonArray.toString(); + } + + //杩涘叆淇敼瀵嗙爜椤甸潰 + @RequestMapping(value = "/tosetuser") + public String tosetuser(HttpSession session, Model model, HttpServletRequest request) { + User u = (User) session.getAttribute("user"); + //key淇℃伅 + model.addAttribute("username", u.getUsername()); +// + return "admin/setuser"; + } + + //淇敼璧勬枡 + @PostMapping("/change") + @ResponseBody + public String change(HttpSession session, User user) { + //Integer count = userService.checkUsername(user.getUsername());//鏌ヨ鐢ㄦ埛鍚嶆槸鍚﹂噸澶 + User u = (User) session.getAttribute("user"); + user.setEmail(u.getEmail()); + JSONArray jsonArray = new JSONArray(); + //if(count==0) { + Integer ret = userService.change(user); + jsonArray.add(ret); + if (u.getEmail() != null && u.getPassword() != null) { + session.removeAttribute("user"); + //鍒锋柊view + session.invalidate(); + } + //}else { + // jsonArray.add("-1"); + //} + // -1 鐢ㄦ埛鍚嶉噸澶 + return jsonArray.toString(); + } + + //璺宠浆閭閰嶇疆椤甸潰 + @RequestMapping(value = "/root/emailconfig") + public String emailconfig(Model model) { + EmailConfig emailConfig = emailConfigService.getemail(); + model.addAttribute("emailConfig",emailConfig); + return "admin/emailconfig"; + } + //淇敼閭楠岃瘉 + @PostMapping("/root/updateemail") + @ResponseBody + public Integer updateemail(HttpSession session,String emails, String emailkey, String emailurl, String port, String emailname, Integer using ) { + EmailConfig emailConfig = new EmailConfig(); + emailConfig.setEmailname(emailname); + emailConfig.setEmails(emails); + emailConfig.setEmailkey(emailkey); + emailConfig.setEmailurl(emailurl); + emailConfig.setPort(port); + emailConfig.setUsing(using); + Integer ret = emailConfigService.updateemail(emailConfig); + return ret; + } + //璺宠浆绯荤粺閰嶇疆椤甸潰 + @RequestMapping(value = "/root/towebconfig") + public String towebconfig(Model model) { + Config config = configService.getSourceype(); + model.addAttribute("config",config); + return "admin/webconfig"; + } + //淇敼绔欑偣閰嶇疆 + @PostMapping("/root/updateconfig") + @ResponseBody + public Integer updateconfig(HttpSession session, String webname,String explain, String logos, + String footed, String links, String notice,String baidu ) { + System.err.println(links); + Config config = new Config(); + config.setWebname(webname); + config.setExplain(explain); + config.setLogos(logos); + config.setFooted(footed); + config.setLinks(links); + config.setNotice(notice); + config.setBaidu(baidu); + Integer ret = configService.setSourceype(config); + return ret; + } + + @GetMapping(value = "/images/{id}") + @ResponseBody + public Images selectByFy(@PathVariable("id") Integer id) { + return imgService.selectByPrimaryKey(id); + } } diff --git a/src/main/java/cn/hellohao/controller/ImageReviewController.java b/src/main/java/cn/hellohao/controller/ImageReviewController.java new file mode 100644 index 0000000..653bc83 --- /dev/null +++ b/src/main/java/cn/hellohao/controller/ImageReviewController.java @@ -0,0 +1,47 @@ +package cn.hellohao.controller; + +import cn.hellohao.pojo.Imgreview; +import cn.hellohao.service.ImgreviewService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +@Controller +@RequestMapping("/admin") +public class ImageReviewController { + + @Autowired + private ImgreviewService imgreviewService; + + + @RequestMapping(value = "/root/ImageReview") + public String ForwardImageReview(Model model) { + //鏌ヨ鐧惧害閴撮粍鐨刱ey + Imgreview imgreview = imgreviewService.selectByPrimaryKey(1); + model.addAttribute("appid", imgreview.getAppId()); + model.addAttribute("apikey", imgreview.getApiKey()); + model.addAttribute("secretkey", imgreview.getSecretKey()); + model.addAttribute("using", imgreview.getUsing()); + + return "admin/imageIdentify"; + } + + //閴撮粍鍔熻兘寮鍏 + @RequestMapping(value = "/root/ImgreviewSwitch") + @ResponseBody + public String ImgreviewSwitch(String appId, String apiKey, String secretKey, Integer using) { + Imgreview imgreview = new Imgreview(); + imgreview.setId(1);//鐩墠灏变竴绉嶉壌榛勫姛鑳芥墍浠ヨ姝讳簡 + //if(using!=null&&using.equals("")){ + imgreview.setUsing(using); + imgreview.setAppId(appId); + imgreview.setApiKey(apiKey); + imgreview.setSecretKey(secretKey); + Integer ret = imgreviewService.updateByPrimaryKeySelective(imgreview); + + return ret.toString(); + } + +} diff --git a/src/main/java/cn/hellohao/controller/UpdateImgController.java b/src/main/java/cn/hellohao/controller/UpdateImgController.java index b524ef3..6870bb4 100644 --- a/src/main/java/cn/hellohao/controller/UpdateImgController.java +++ b/src/main/java/cn/hellohao/controller/UpdateImgController.java @@ -1,158 +1,191 @@ package cn.hellohao.controller; -import java.io.File; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - +import java.text.SimpleDateFormat; +import java.util.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; - +import cn.hellohao.pojo.*; +import cn.hellohao.service.*; +import cn.hellohao.service.impl.OSSImageupload; +import cn.hellohao.utils.Sentence; +import cn.hellohao.utils.SetText; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import com.alibaba.fastjson.JSONArray; -import cn.hellohao.pojo.Images; -import cn.hellohao.pojo.Keys; -import cn.hellohao.pojo.User; -import cn.hellohao.service.KeysService; -import cn.hellohao.service.UserService; import cn.hellohao.service.impl.NOSImageupload; -import org.springframework.web.multipart.commons.CommonsMultipartResolver; @Controller public class UpdateImgController { - @Autowired - private NOSImageupload nOSImageupload; - @Autowired - private UserService userService; - @Autowired - private KeysService keysService; - - - public static String getSubString(String text, String left, String right) { - String result = ""; - int zLen; - if (left == null || left.isEmpty()) { - zLen = 0; - } else { - zLen = text.indexOf(left); - if (zLen > -1) { - zLen += left.length(); - } else { - zLen = 0; - } - } - int yLen = text.indexOf(right, zLen); - if (yLen < 0 || right == null || right.isEmpty()) { - yLen = text.length(); - } - result = text.substring(zLen, yLen); - return result; - } - - - - @RequestMapping({"/","/index.do"}) - public String indexImg(Model model,HttpServletRequest request,HttpSession httpSession){ - Integer storageType = keysService.selectKeysType(); - System.out.println("绫诲瀷=========="+storageType); - Keys key = keysService.selectKeys(storageType); - nOSImageupload.Initialize(key); - //鏌ヨ鍝瀵硅薄瀛樺偍 - httpSession.setAttribute("storageType", storageType); - - model.addAttribute("text_foot", "
  • Hellohao ©
  • 鍒囧嬁涓婁紶杩濆弽涓崕浜烘皯鍏卞拰鍥戒簰鑱旂綉娉曞緥鏉$害璧勬簮
  • "); - User u = (User) httpSession.getAttribute("user"); - String email = (String) httpSession.getAttribute("email"); - String pass = (String) httpSession.getAttribute("pass"); - if(email!=null && pass!=null) { - //鐧婚檰鎴愬姛 - Integer ret = userService.login(u.getEmail(), u.getPassword()); - if(ret>0) { - User user = userService.getUsers(u.getEmail()); - model.addAttribute("username",user.getUsername()); - model.addAttribute("level",user.getLevel()); - model.addAttribute("loginid",100); - model.addAttribute("imgcount",3); - model.addAttribute("fileSize",5120); - - }else { - model.addAttribute("loginid",-1); - model.addAttribute("imgcount",1); - } - }else { - model.addAttribute("loginid",-2); - model.addAttribute("imgcount",1); - model.addAttribute("imgcount",1); - model.addAttribute("fileSize",3072); - - } + @Autowired + private NOSImageupload nOSImageupload; + @Autowired + private UserService userService; + @Autowired + private KeysService keysService; + @Autowired + private NoticeService noticeService; + @Autowired + private OSSImageupload ossImageupload; + @Autowired + private ConfigService configService; + + + @RequestMapping({"/", "/index"}) + public String indexImg(Model model, HttpServletRequest request, HttpSession httpSession) throws Exception { + Config config = configService.getSourceype();//鏌ヨ褰撳墠绯荤粺浣跨敤鐨勫瓨鍌ㄦ簮绫诲瀷銆 + Keys key = keysService.selectKeys(config.getSourcekey());//鐒跺悗鏍规嵁绫诲瀷鍐嶆煡璇ey + if(key.getStorageType()==1){ + nOSImageupload.Initialize(key);//瀹炰緥鍖栫綉鏄 + System.out.println("NOS鍒濆鍖栨垚鍔熴"); + }else if (key.getStorageType()==2){ + OSSImageupload.Initialize(key); + System.out.println("OSS鍒濆鍖栨垚鍔熴"); + }else if(key.getStorageType()==3){ + //鍒濆鍖栬吘璁簯 + }else if(key.getStorageType()==4){ + //鍒濆鍖栦竷鐗涗簯 + }else{ + System.err.println("鏈幏鍙栧埌瀵硅薄瀛樺偍鍙傛暟锛屽垵濮嬪寲澶辫触銆"); + } + + User u = (User) httpSession.getAttribute("user"); + String email = (String) httpSession.getAttribute("email"); + if (email != null) { + //鐧婚檰鎴愬姛 + Integer ret = userService.login(u.getEmail(), u.getPassword()); + if (ret > 0) { + User user = userService.getUsers(u.getEmail()); + model.addAttribute("username", user.getUsername()); + model.addAttribute("level", user.getLevel()); + model.addAttribute("loginid", 100); + model.addAttribute("imgcount", 3); + model.addAttribute("fileSize", 5120); + + } else { + model.addAttribute("loginid", -1); + model.addAttribute("imgcount", 1); + } + } else { + model.addAttribute("loginid", -2); + model.addAttribute("imgcount", 1); + model.addAttribute("fileSize", 3072); + + } + model.addAttribute("config", config); + +// AipContentCensor client = ImageReview.Initialize(); +// String url = "https://hellohao.nos-eastchina1.126.net/Hellohao/huangse.png"; +// JSONObject res = client.antiPorn(url); +// res = client.imageCensorUserDefined(url, EImgType.URL, null); +// System.out.println(res.toString()); + +// +// CronTrigger cron = (CronTrigger) scheduler.getTrigger(cronTrigger.getKey()); +// String currentCron = cron.getCronExpression();// 褰撳墠Trigger浣跨敤鐨 +// System.err.println("褰撳墠trigger浣跨敤鐨-"+currentCron); +// +// //淇敼姣忛殧?绉掓墽琛屼换鍔 +// CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule("0 09 07 * * ?"); +// +// // 鎸夋柊鐨刢ronExpression琛ㄨ揪寮忛噸鏂版瀯寤簍rigger +// cron = cron.getTriggerBuilder().withIdentity(cronTrigger.getKey()) +// .withSchedule(scheduleBuilder).build(); +// +// scheduler.rescheduleJob(cronTrigger.getKey(),cron); + return "index"; } - - @RequestMapping(value="/upimg.do") + + @RequestMapping(value = "/upimg") @ResponseBody - public String exit(HttpServletRequest request,HttpServletResponse response,HttpSession session - ,@RequestParam(value = "file", required = false) MultipartFile[] file,String filename) throws Exception{ - long stime = System.currentTimeMillis(); - User u = (User) session.getAttribute("user"); - - - JSONArray jsonArray = new JSONArray(); - Map map = new HashMap<>(); - for (MultipartFile multipartFile : file) { - //鑾峰彇鏂囦欢鍚 - String fileName = multipartFile.getOriginalFilename(); - String lastname = fileName.substring(fileName.lastIndexOf(".") + 1); - if (!multipartFile.isEmpty()) { //鍒ゆ柇鏂囦欢鏄惁涓虹┖ - map.put(lastname, multipartFile); - //multipartFile.getOriginalFilename(); //鏂囦欢鍚 - //multipartFile.getSize(); //鏂囦欢澶у皬 - } + public String upimg(HttpServletRequest request, HttpServletResponse response, HttpSession session + , @RequestParam(value = "file", required = false) MultipartFile[] file) throws Exception { + Config config = configService.getSourceype();//鏌ヨ褰撳墠绯荤粺浣跨敤鐨勫瓨鍌ㄦ簮绫诲瀷銆 + Keys key = keysService.selectKeys(config.getSourcekey()); + long stime = System.currentTimeMillis(); + User u = (User) session.getAttribute("user"); + String username = "tourist"; + if (u != null) { + username = u.getUsername(); } - Map m =nOSImageupload.Imageupload(map); - Images img = new Images(); -// for (String string : m) { -// jsonArray.add(string); -// System.out.println("鏂囦欢鍚嶅瓧锛==="+string); -// if(userid!=null) { -// //img.setImgname(imgname);//鍥剧墖鍚嶅瓧 -// img.setImgurl(string);//鍥剧墖閾炬帴 -// img.setUserid(userid);//鐢ㄦ埛id -// userService.insertimg(img); -// } -// -// } - - for (Map.Entry entry : m.entrySet()) { - jsonArray.add(entry.getKey()); - if(u!=null) { - //img.setImgname(imgname);//鍥剧墖鍚嶅瓧 - - img.setImgurl(entry.getKey());//鍥剧墖閾炬帴 - img.setUserid(u.getId());//鐢ㄦ埛id - img.setSizes((entry.getValue())/1024); - img.setImgname(getSubString(entry.getKey(), "hellohao.nos-eastchina1.126.net/", "")); - userService.insertimg(img); - long etime = System.currentTimeMillis(); - System.out.println("涓婁紶鍥剧墖鎵鐢ㄦ椂闀匡細"+String.valueOf(etime-stime)+"ms"); - } - } - - return jsonArray.toString(); + JSONArray jsonArray = new JSONArray(); + Map map = new HashMap<>(); + for (MultipartFile multipartFile : file) { + // 鑾峰彇ImageReader瀵硅薄鐨勮凯浠e櫒 + //鑾峰彇鏂囦欢鍚 + String fileName = multipartFile.getOriginalFilename(); + String lastname = fileName.substring(fileName.lastIndexOf(".") + 1);//鑾峰彇鏂囦欢鍚庣紑 + if (!multipartFile.isEmpty()) { //鍒ゆ柇鏂囦欢鏄惁涓虹┖ + map.put(lastname, multipartFile); + //multipartFile.getOriginalFilename(); //鏂囦欢鍚 + //multipartFile.getSize(); //鏂囦欢澶у皬 + } + } + Map m = null; + + if(key.getStorageType()==1){ + m = nOSImageupload.Imageupload(map, username); + }else if (key.getStorageType()==2){ + m = ossImageupload.ImageuploadOSS(map, username); + }else if(key.getStorageType()==3){ + //鍒濆鍖栬吘璁簯 + }else if(key.getStorageType()==4){ + //鍒濆鍖栦竷鐗涗簯 + }else{ + System.err.println("鏈幏鍙栧埌瀵硅薄瀛樺偍鍙傛暟锛屼笂浼犲け璐ャ"); + } + + Images img = new Images(); + SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd"); + Date date = new Date(); + String times = df.format(new Date()); + System.out.println("涓婁紶鍥剧墖鐨勬椂闂存槸锛"+times); + for (Map.Entry entry : m.entrySet()) { + jsonArray.add(entry.getKey()); + img.setImgurl(entry.getKey());//鍥剧墖閾炬帴 + img.setUpdatetime(times); + img.setSource(key.getStorageType()); + if (u == null) { + img.setUserid(0);//鐢ㄦ埛id + } else { + img.setUserid(u.getId());//鐢ㄦ埛id + } + img.setSizes((entry.getValue()) / 1024); + img.setImgname(SetText.getSubString(entry.getKey(), key.getRequestAddress() + "/", "")); + img.setAbnormal(0); + userService.insertimg(img); + long etime = System.currentTimeMillis(); + System.out.println("涓婁紶鍥剧墖鎵鐢ㄦ椂闀匡細" + String.valueOf(etime - stime) + "ms"); + } + //寮杈熸柊杩涚▼閴撮粍銆傜幇鍦ㄥ凡缁忔敼鎴愬畾鏃跺櫒 + //鏌ヨ閴撮粍鍔熻兘鏄惁鍚姩锛1涓哄惎鐢 +// Imgreview imgreview = imgreviewService.selectByPrimaryKey(1); +// if (imgreview.getUsing() == 1) { +// //涓婁紶瀹屾垚鍚庡紑杈熸柊鐨勭嚎绋嬭繘琛屽浘鐗囬壌榛勩 +// JianHuangThread thread = new JianHuangThread(imgreviewService, key, u, m); +// thread.start(); +// } + + return jsonArray.toString(); + } + + //鍒櫎鐢ㄦ埗 + @RequestMapping("/sentence") + @ResponseBody + public String sentence(HttpSession session, Integer id) { + JSONArray jsonArray = new JSONArray(); + String text = Sentence.getURLContent(); + jsonArray.add(text); + return jsonArray.toString(); } - } diff --git a/src/main/java/cn/hellohao/controller/UserController.java b/src/main/java/cn/hellohao/controller/UserController.java index 06be511..d731d01 100644 --- a/src/main/java/cn/hellohao/controller/UserController.java +++ b/src/main/java/cn/hellohao/controller/UserController.java @@ -2,14 +2,20 @@ package cn.hellohao.controller; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.UUID; +import javax.mail.internet.MimeMessage; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import cn.hellohao.pojo.EmailConfig; +import cn.hellohao.service.EmailConfigService; +import cn.hellohao.utils.SendEmail; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.alibaba.fastjson.JSONArray; @@ -17,65 +23,116 @@ import com.alibaba.fastjson.JSONObject; import cn.hellohao.pojo.User; import cn.hellohao.service.UserService; +import org.springframework.web.servlet.ModelAndView; @Controller @RequestMapping("/user") public class UserController { - @Autowired - private UserService userService; + @Autowired + private UserService userService; + @Autowired + private EmailConfigService emailConfigService; - @RequestMapping("/register.do") - @ResponseBody - public String Register(User user) { - //鍙栧綋鍓嶆椂闂 - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//璁剧疆鏃ユ湡鏍煎紡 - String birthder = df.format(new Date());// new Date()涓鸿幏鍙栧綋鍓嶇郴缁熸椂闂 - user.setLevel(1); - user.setBirthder(birthder); - Integer ret = userService.register(user); - JSONArray jsonArray = new JSONArray(); - jsonArray.add(ret); - return jsonArray.toString(); - } - - @RequestMapping("/login.do") - @ResponseBody - public String login(HttpServletRequest request,HttpSession httpSession,String email,String password) { - JSONArray jsonArray = new JSONArray(); - Integer ret = userService.login(email, password); - if(ret>0) { - jsonArray.add(1); - User user = userService.getUsers(email); - httpSession.setAttribute("user",user); - httpSession.setAttribute("email",user.getEmail()); - httpSession.setAttribute("pass",user.getPassword()); - - //鐧诲綍鎴愬姛涔嬪悗鎶婅处鍙峰瘑鐮佸瓨鍏ession - - }else { - jsonArray.add(0); - } - return jsonArray.toString(); - } - //閫鍑 - @RequestMapping(value="/exit.do") + @RequestMapping("/register") @ResponseBody - public String exit(Model model,HttpServletRequest request,HttpSession session){ - JSONObject jsonObject = new JSONObject(); - //娉ㄩ攢锛岀Щ闄ession - User user = (User) session.getAttribute("user"); - if(user.getEmail()!=null&&user.getPassword()!=null) { - session.removeAttribute(user.getEmail()); - session.removeAttribute(user.getPassword()); - //鍒锋柊view - session.invalidate(); - jsonObject.put("exit", 1); - } - - return jsonObject.toString(); + public String Register(User user) { + //鍙栧綋鍓嶆椂闂 + JSONObject jsonObject = new JSONObject(); + EmailConfig emailConfig = emailConfigService.getemail(); + Integer countusername = userService.countusername(user.getUsername()); + Integer countmail = userService.countmail(user.getEmail()); + if (countusername == 0 && countmail == 0) { + String uid = UUID.randomUUID().toString().replace("-", "").toLowerCase(); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//璁剧疆鏃ユ湡鏍煎紡 + String birthder = df.format(new Date());// new Date()涓鸿幏鍙栧綋鍓嶇郴缁熸椂闂 + user.setLevel(1); + user.setUid(uid); + user.setBirthder(birthder); + //鏌ヨ鏄惁鍚敤浜嗛偖绠遍獙璇併 + EmailConfig emailConfig1 = emailConfigService.getemail(); + Integer type = 0; + if(emailConfig1.getUsing()==1){ + user.setIsok(0); + //鍒濆鍖栭偖绠 + MimeMessage message = SendEmail.Emails(emailConfig); + //娉ㄥ唽瀹屽彂婵娲婚摼鎺 + Thread thread = new Thread() { + public void run() { + Integer a = SendEmail.sendEmail(message, user.getUsername(), uid, user.getEmail(),emailConfig); + } + }; + thread.start(); + }else{ + //鐩存帴娉ㄥ唽 + user.setIsok(1); + type = 2; + } + Integer ret = userService.register(user); + jsonObject.put("ret",ret); + jsonObject.put("zctype",type); + } else { + jsonObject.put("ret",-2); + } + return jsonObject.toString(); } + @RequestMapping("/login.do") + @ResponseBody + public String login(HttpServletRequest request, HttpSession httpSession, String email, String password) { + JSONArray jsonArray = new JSONArray(); + Integer ret = userService.login(email, password); + if (ret > 0) { + User user = userService.getUsers(email); + if (user.getIsok() == 1) { + httpSession.setAttribute("user", user); + httpSession.setAttribute("email", user.getEmail()); + httpSession.setAttribute("pass", user.getPassword()); + jsonArray.add(1); + } else { + jsonArray.add(-1); + } + //鐧诲綍鎴愬姛涔嬪悗鎶婅处鍙峰瘑鐮佸瓨鍏ession + } else { + jsonArray.add(0); + } + return jsonArray.toString(); + } + + //閫鍑 + @RequestMapping(value = "/exit.do") + @ResponseBody + public String exit(Model model, HttpServletRequest request, HttpSession session) { + JSONObject jsonObject = new JSONObject(); + //娉ㄩ攢锛岀Щ闄ession + User user = (User) session.getAttribute("user"); + if (user.getEmail() != null && user.getPassword() != null) { + session.removeAttribute(user.getEmail()); + session.removeAttribute(user.getPassword()); + //鍒锋柊view + session.invalidate(); + jsonObject.put("exit", 1); + } + + return jsonObject.toString(); + } + + //閭婵娲 + @RequestMapping(value = "/activation.do", method = RequestMethod.GET) + public String activation(Model model, HttpServletRequest request, HttpSession session, String activation, String username) { + System.out.println("婵娲绘柟娉曡繘鍘讳簡"); + Integer ret = 0; + User user = userService.getUsersMail(activation); + if (user != null && user.getIsok() == 0) { + Integer setisok = userService.uiduser(activation); + model.addAttribute("setisok", ret); + model.addAttribute("username", username); + return "isok"; + } else { + return "redirect:/index.do"; + } + + } } diff --git a/src/main/java/cn/hellohao/dao/ConfigMapper.java b/src/main/java/cn/hellohao/dao/ConfigMapper.java new file mode 100644 index 0000000..3f266d9 --- /dev/null +++ b/src/main/java/cn/hellohao/dao/ConfigMapper.java @@ -0,0 +1,11 @@ +package cn.hellohao.dao; + +import cn.hellohao.pojo.Config; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Service; + +@Mapper +public interface ConfigMapper { + Config getSourceype(); + Integer setSourceype(Config config); +} diff --git a/src/main/java/cn/hellohao/dao/EmailConfigMapper.java b/src/main/java/cn/hellohao/dao/EmailConfigMapper.java new file mode 100644 index 0000000..6fd80ce --- /dev/null +++ b/src/main/java/cn/hellohao/dao/EmailConfigMapper.java @@ -0,0 +1,10 @@ +package cn.hellohao.dao; + +import cn.hellohao.pojo.EmailConfig; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface EmailConfigMapper { + EmailConfig getemail(); + Integer updateemail(EmailConfig emailConfig); +} diff --git a/src/main/java/cn/hellohao/dao/ImgMapper.java b/src/main/java/cn/hellohao/dao/ImgMapper.java index ade21cc..fffa31d 100644 --- a/src/main/java/cn/hellohao/dao/ImgMapper.java +++ b/src/main/java/cn/hellohao/dao/ImgMapper.java @@ -10,9 +10,20 @@ import cn.hellohao.pojo.Images; @Mapper public interface ImgMapper { - List selectimg(@Param("userid") Integer userid); - Integer countimg(@Param("userid") Integer userid); - Integer deleimg(@Param("id") Integer id); - Images selectByPrimaryKey(@Param("id") Integer id); - Integer counts(@Param("userid") Integer userid); + List selectimg(@Param("userid") Integer userid); + + Integer countimg(@Param("userid") Integer userid); + + Integer deleimg(@Param("id") Integer id); + + Images selectByPrimaryKey(@Param("id") Integer id); + + Integer counts(@Param("userid") Integer userid); + + Integer setabnormal(@Param("imgname") String imgname); + + Integer deleimgname(@Param("imgname") String imgname); + Integer deleall(@Param("id") Integer id); + + List gettimeimg(@Param("time") String time); } diff --git a/src/main/java/cn/hellohao/dao/ImgreviewMapper.java b/src/main/java/cn/hellohao/dao/ImgreviewMapper.java new file mode 100644 index 0000000..30d22fc --- /dev/null +++ b/src/main/java/cn/hellohao/dao/ImgreviewMapper.java @@ -0,0 +1,19 @@ +package cn.hellohao.dao; + +import cn.hellohao.pojo.Imgreview; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ImgreviewMapper { + int deleteByPrimaryKey(Integer id); + + int insert(Imgreview record); + + int insertSelective(Imgreview record); + + Imgreview selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(Imgreview record); + + int updateByPrimaryKey(Imgreview record); +} \ No newline at end of file diff --git a/src/main/java/cn/hellohao/dao/KeysMapper.java b/src/main/java/cn/hellohao/dao/KeysMapper.java index c22bd73..64df6c6 100644 --- a/src/main/java/cn/hellohao/dao/KeysMapper.java +++ b/src/main/java/cn/hellohao/dao/KeysMapper.java @@ -7,11 +7,9 @@ import cn.hellohao.pojo.Keys; @Mapper public interface KeysMapper { - //鏌ヨ瀵嗛挜 - Keys selectKeys(@Param("storageType") Integer storageType); - //鏌ヨkey绫诲瀷 - Integer selectKeysType(); - //淇敼key - Integer updateKey(Keys key); + //鏌ヨ瀵嗛挜 + Keys selectKeys(@Param("storageType") Integer storageType); + //淇敼key + Integer updateKey(Keys key); } diff --git a/src/main/java/cn/hellohao/dao/NoticeMapper.java b/src/main/java/cn/hellohao/dao/NoticeMapper.java new file mode 100644 index 0000000..33a99e3 --- /dev/null +++ b/src/main/java/cn/hellohao/dao/NoticeMapper.java @@ -0,0 +1,9 @@ +package cn.hellohao.dao; + +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface NoticeMapper { + + String getNotice(); +} diff --git a/src/main/java/cn/hellohao/dao/UserMapper.java b/src/main/java/cn/hellohao/dao/UserMapper.java index 94b84da..2779e03 100644 --- a/src/main/java/cn/hellohao/dao/UserMapper.java +++ b/src/main/java/cn/hellohao/dao/UserMapper.java @@ -6,19 +6,42 @@ import org.apache.ibatis.annotations.Param; import cn.hellohao.pojo.Images; import cn.hellohao.pojo.User; +import java.util.List; + @Mapper public interface UserMapper { - //娉ㄥ唽 - Integer register(User user); - //鐧诲綍 - Integer login(@Param("email") String email,@Param("password") String password); - //鑾峰彇鐢ㄦ埛淇℃伅 - User getUsers(@Param("email") String email); - //鎻掑叆鍥剧墖 - Integer insertimg(Images img); - //淇敼璧勬枡 - Integer change(User user); - //妫鏌ョ敤鎴峰悕鏄惁閲嶅 - Integer checkUsername(@Param("username") String username); - Integer getUserTotal(); + //娉ㄥ唽 + Integer register(User user); + + //鐧诲綍 + Integer login(@Param("email") String email, @Param("password") String password); + + //鑾峰彇鐢ㄦ埛淇℃伅 + User getUsers(@Param("email") String email); + + //鎻掑叆鍥剧墖 + Integer insertimg(Images img); + + //淇敼璧勬枡 + Integer change(User user); + + //妫鏌ョ敤鎴峰悕鏄惁閲嶅 + Integer checkUsername(@Param("username") String username); + + Integer getUserTotal(); + + List getuserlist(); + + //鍒櫎鐢ㄦ埗 + Integer deleuser(@Param("id") Integer id); + + //鏌ヨ鐢ㄦ埛鍚嶆垨鑰呴偖绠辨槸鍚﹀瓨鍦 + Integer countusername(@Param("username") String username); + + Integer countmail(@Param("email") String email); + + Integer uiduser(@Param("uid") String uid); + + User getUsersMail(@Param("uid") String uid); + } diff --git a/src/main/java/cn/hellohao/interceptor/InterceptorConfig.java b/src/main/java/cn/hellohao/interceptor/InterceptorConfig.java index 5b0e208..9490e06 100644 --- a/src/main/java/cn/hellohao/interceptor/InterceptorConfig.java +++ b/src/main/java/cn/hellohao/interceptor/InterceptorConfig.java @@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import cn.hellohao.pojo.User; import org.springframework.lang.Nullable; import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor; @@ -13,34 +14,46 @@ import org.springframework.web.servlet.ModelAndView; @Component -public class InterceptorConfig implements HandlerInterceptor{ - //private static final Logger log = LoggerFactory.getLogger(InterceptorConfig.class); - - /** +public class InterceptorConfig implements HandlerInterceptor { + //private static final Logger log = LoggerFactory.getLogger(InterceptorConfig.class); + + /** * 杩涘叆controller灞備箣鍓嶆嫤鎴姹 - */ - //杩欎釜鏂规硶鏄湪璁块棶鎺ュ彛涔嬪墠鎵ц鐨勶紝鎴戜滑鍙渶瑕佸湪杩欓噷鍐欓獙璇佺櫥闄嗙姸鎬佺殑涓氬姟閫昏緫锛屽氨鍙互鍦ㄧ敤鎴疯皟鐢ㄦ寚瀹氭帴鍙d箣鍓嶉獙璇佺櫥闄嗙姸鎬佷簡 + */ + //杩欎釜鏂规硶鏄湪璁块棶鎺ュ彛涔嬪墠鎵ц鐨勶紝鎴戜滑鍙渶瑕佸湪杩欓噷鍐欓獙璇佺櫥闄嗙姸鎬佺殑涓氬姟閫昏緫锛屽氨鍙互鍦ㄧ敤鎴疯皟鐢ㄦ寚瀹氭帴鍙d箣鍓嶉獙璇佺櫥闄嗙姸鎬佷簡 public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + //璁剧疆涓嶇紦瀛 +// response.setHeader("Cache-Control","no-cache"); +// response.setHeader("Pragma","no-cache"); +// response.setDateHeader("Expires",0); //姣忎竴涓」鐩浜庣櫥闄嗙殑瀹炵幇閫昏緫閮芥湁鎵鍖哄埆锛屾垜杩欓噷浣跨敤鏈绠鍗曠殑Session鎻愬彇User鏉ラ獙璇佺櫥闄嗐 HttpSession session = request.getSession(); //杩欓噷鐨刄ser鏄櫥闄嗘椂鏀惧叆session鐨 - String email = (String) session.getAttribute("email"); + User user = (User) session.getAttribute("user"); + String email = null; + Integer level = 0; + if (user != null) { + email = user.getEmail(); + level = user.getLevel(); + } + // String email = (String) session.getAttribute("email"); //濡傛灉session涓病鏈塽ser锛岃〃绀烘病鐧婚檰 - if (email == null){ + if (email == null) { //杩欎釜鏂规硶杩斿洖false琛ㄧず蹇界暐褰撳墠璇锋眰锛屽鏋滀竴涓敤鎴疯皟鐢ㄤ簡闇瑕佺櫥闄嗘墠鑳戒娇鐢ㄧ殑鎺ュ彛锛屽鏋滀粬娌℃湁鐧婚檰杩欓噷浼氱洿鎺ュ拷鐣ユ帀 //褰撶劧浣犲彲浠ュ埄鐢╮esponse缁欑敤鎴疯繑鍥炰竴浜涙彁绀轰俊鎭紝鍛婅瘔浠栨病鐧婚檰 - System.out.println("娌℃湁鐧诲綍鏉冮檺"); - request.getRequestDispatcher("/index.do").forward(request,response); + System.out.println("娌℃湁鐧诲綍鏉冮檺"); + request.getRequestDispatcher("/index").forward(request, response); return false; - }else { - System.out.println("杩涘叆鎴愬姛"); + } else { + + //System.out.println("杩涘叆鎴愬姛"); return true; //濡傛灉session閲屾湁user锛岃〃绀鸿鐢ㄦ埛宸茬粡鐧婚檰锛屾斁琛岋紝鐢ㄦ埛鍗冲彲缁х画璋冪敤鑷繁闇瑕佺殑鎺ュ彛 } } - + public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable ModelAndView modelAndView) throws Exception { } - + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable Exception ex) throws Exception { } diff --git a/src/main/java/cn/hellohao/interceptor/InterceptorConfigTwo.java b/src/main/java/cn/hellohao/interceptor/InterceptorConfigTwo.java new file mode 100644 index 0000000..6ea3bed --- /dev/null +++ b/src/main/java/cn/hellohao/interceptor/InterceptorConfigTwo.java @@ -0,0 +1,62 @@ +package cn.hellohao.interceptor; + +import cn.hellohao.pojo.User; +import org.springframework.lang.Nullable; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + + +@Component +public class InterceptorConfigTwo implements HandlerInterceptor { + //private static final Logger log = LoggerFactory.getLogger(InterceptorConfig.class); + + /** + * 杩涘叆controller灞備箣鍓嶆嫤鎴姹 + */ + //杩欎釜鏂规硶鏄湪璁块棶鎺ュ彛涔嬪墠鎵ц鐨勶紝鎴戜滑鍙渶瑕佸湪杩欓噷鍐欓獙璇佺櫥闄嗙姸鎬佺殑涓氬姟閫昏緫锛屽氨鍙互鍦ㄧ敤鎴疯皟鐢ㄦ寚瀹氭帴鍙d箣鍓嶉獙璇佺櫥闄嗙姸鎬佷簡 + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + //璁剧疆涓嶇紦瀛 +// response.setHeader("Cache-Control","no-cache"); +// response.setHeader("Pragma","no-cache"); +// response.setDateHeader("Expires",0); + //姣忎竴涓」鐩浜庣櫥闄嗙殑瀹炵幇閫昏緫閮芥湁鎵鍖哄埆锛屾垜杩欓噷浣跨敤鏈绠鍗曠殑Session鎻愬彇User鏉ラ獙璇佺櫥闄嗐 + HttpSession session = request.getSession(); + //杩欓噷鐨刄ser鏄櫥闄嗘椂鏀惧叆session鐨 + User user = (User) session.getAttribute("user"); + String email = null; + Integer level = 0; + if (user != null) { + email = user.getEmail(); + level = user.getLevel(); + } + // String email = (String) session.getAttribute("email"); + //濡傛灉session涓病鏈塽ser锛岃〃绀烘病鐧婚檰 + if (email == null) { + //杩欎釜鏂规硶杩斿洖false琛ㄧず蹇界暐褰撳墠璇锋眰锛屽鏋滀竴涓敤鎴疯皟鐢ㄤ簡闇瑕佺櫥闄嗘墠鑳戒娇鐢ㄧ殑鎺ュ彛锛屽鏋滀粬娌℃湁鐧婚檰杩欓噷浼氱洿鎺ュ拷鐣ユ帀 + //褰撶劧浣犲彲浠ュ埄鐢╮esponse缁欑敤鎴疯繑鍥炰竴浜涙彁绀轰俊鎭紝鍛婅瘔浠栨病鐧婚檰 + System.out.println("娌℃湁鐧诲綍鏉冮檺"); + request.getRequestDispatcher("/index").forward(request, response); + return false; + } else { + if (level == 2) { + System.out.println("杩涘叆鎴愬姛"); + return true; //濡傛灉session閲屾湁user锛岃〃绀鸿鐢ㄦ埛宸茬粡鐧婚檰锛屾斁琛岋紝鐢ㄦ埛鍗冲彲缁х画璋冪敤鑷繁闇瑕佺殑鎺ュ彛 + } else { + request.getRequestDispatcher("/admin/admin").forward(request, response); + return false; + } + } + } + + public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable ModelAndView modelAndView) throws Exception { + } + + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable Exception ex) throws Exception { + } + +} diff --git a/src/main/java/cn/hellohao/interceptor/WebAppConfig.java b/src/main/java/cn/hellohao/interceptor/WebAppConfig.java index 5b40b88..0f7c91f 100644 --- a/src/main/java/cn/hellohao/interceptor/WebAppConfig.java +++ b/src/main/java/cn/hellohao/interceptor/WebAppConfig.java @@ -6,29 +6,34 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + @Configuration -public class WebAppConfig implements WebMvcConfigurer { +public class WebAppConfig implements WebMvcConfigurer { @Autowired private InterceptorConfig interceptorConfig; - - - // 杩欎釜鏂规硶鏄敤鏉ラ厤缃潤鎬佽祫婧愮殑锛屾瘮濡俬tml锛宩s锛宑ss锛岀瓑绛 - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - } - - // 杩欎釜鏂规硶鐢ㄦ潵娉ㄥ唽鎷︽埅鍣紝鎴戜滑鑷繁鍐欏ソ鐨勬嫤鎴櫒闇瑕侀氳繃杩欓噷娣诲姞娉ㄥ唽鎵嶈兘鐢熸晥 - @Override - public void addInterceptors(InterceptorRegistry registry) { - - // addPathPatterns("/**") 琛ㄧず鎷︽埅鎵鏈夌殑璇锋眰锛 - // excludePathPatterns("/login", "/register") 琛ㄧず闄や簡鐧婚檰涓庢敞鍐屼箣澶栵紝鍥犱负鐧婚檰娉ㄥ唽涓嶉渶瑕佺櫥闄嗕篃鍙互璁块棶 - //registry.addInterceptor(interceptorConfig).addPathPatterns("admin/**").excludePathPatterns("/login", "/register"); - registry.addInterceptor(interceptorConfig).addPathPatterns("/admin/**"); + @Autowired + private InterceptorConfigTwo interceptorConfigTwo; - } + // 杩欎釜鏂规硶鏄敤鏉ラ厤缃潤鎬佽祫婧愮殑锛屾瘮濡俬tml锛宩s锛宑ss锛岀瓑绛 + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + } + + // 杩欎釜鏂规硶鐢ㄦ潵娉ㄥ唽鎷︽埅鍣紝鎴戜滑鑷繁鍐欏ソ鐨勬嫤鎴櫒闇瑕侀氳繃杩欓噷娣诲姞娉ㄥ唽鎵嶈兘鐢熸晥 + @Override + public void addInterceptors(InterceptorRegistry registry) { + // addPathPatterns("/**") 琛ㄧず鎷︽埅鎵鏈夌殑璇锋眰锛 + // excludePathPatterns("/login", "/register") 琛ㄧず闄や簡鐧婚檰涓庢敞鍐屼箣澶栵紝鍥犱负鐧婚檰娉ㄥ唽涓嶉渶瑕佺櫥闄嗕篃鍙互璁块棶 + //registry.addInterceptor(interceptorConfig).addPathPatterns("admin/**").excludePathPatterns("/login", "/register"); + registry.addInterceptor(interceptorConfig).addPathPatterns("/admin/**"); + registry.addInterceptor(interceptorConfigTwo).addPathPatterns("/admin/root/**"); + + } + } diff --git a/src/main/java/cn/hellohao/pojo/Config.java b/src/main/java/cn/hellohao/pojo/Config.java new file mode 100644 index 0000000..0f9bd4a --- /dev/null +++ b/src/main/java/cn/hellohao/pojo/Config.java @@ -0,0 +1,110 @@ +package cn.hellohao.pojo; + +public class Config { + private Integer id; + private Integer sourcekey; + private Integer emails; + private String webname; + private String explain; + private String logos; + private String footed; + private String links; + private String notice; + private String baidu; + + public Config() { + } + + public Config(Integer id, Integer sourcekey, Integer emails, String webname, String explain, String logos, String footed, String links, String notice, String baidu) { + this.id = id; + this.sourcekey = sourcekey; + this.emails = emails; + this.webname = webname; + this.explain = explain; + this.logos = logos; + this.footed = footed; + this.links = links; + this.notice = notice; + this.baidu = baidu; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getSourcekey() { + return sourcekey; + } + + public void setSourcekey(Integer sourcekey) { + this.sourcekey = sourcekey; + } + + public Integer getEmails() { + return emails; + } + + public void setEmails(Integer emails) { + this.emails = emails; + } + + public String getWebname() { + return webname; + } + + public void setWebname(String webname) { + this.webname = webname; + } + + public String getExplain() { + return explain; + } + + public void setExplain(String explain) { + this.explain = explain; + } + + public String getLogos() { + return logos; + } + + public void setLogos(String logos) { + this.logos = logos; + } + + public String getFooted() { + return footed; + } + + public void setFooted(String footed) { + this.footed = footed; + } + + public String getLinks() { + return links; + } + + public void setLinks(String links) { + this.links = links; + } + + public String getNotice() { + return notice; + } + + public void setNotice(String notice) { + this.notice = notice; + } + + public String getBaidu() { + return baidu; + } + + public void setBaidu(String baidu) { + this.baidu = baidu; + } +} diff --git a/src/main/java/cn/hellohao/pojo/EmailConfig.java b/src/main/java/cn/hellohao/pojo/EmailConfig.java new file mode 100644 index 0000000..813624e --- /dev/null +++ b/src/main/java/cn/hellohao/pojo/EmailConfig.java @@ -0,0 +1,80 @@ +package cn.hellohao.pojo; + +public class EmailConfig { + private Integer id ; + private String emails; + private String emailkey; + private String emailurl; + private String port; + private String emailname; + private Integer using ; + + public EmailConfig() { + } + + public EmailConfig(Integer id, String emails, String emailkey, String emailurl, String port, String emailname, Integer using) { + this.id = id; + this.emails = emails; + this.emailkey = emailkey; + this.emailurl = emailurl; + this.port = port; + this.emailname = emailname; + this.using = using; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getEmails() { + return emails; + } + + public void setEmails(String emails) { + this.emails = emails; + } + + public String getEmailkey() { + return emailkey; + } + + public void setEmailkey(String emailkey) { + this.emailkey = emailkey; + } + + public String getEmailurl() { + return emailurl; + } + + public void setEmailurl(String emailurl) { + this.emailurl = emailurl; + } + + public String getPort() { + return port; + } + + public void setPort(String port) { + this.port = port; + } + + public String getEmailname() { + return emailname; + } + + public void setEmailname(String emailname) { + this.emailname = emailname; + } + + public Integer getUsing() { + return using; + } + + public void setUsing(Integer using) { + this.using = using; + } +} diff --git a/src/main/java/cn/hellohao/pojo/Images.java b/src/main/java/cn/hellohao/pojo/Images.java index 5543256..62ce80d 100644 --- a/src/main/java/cn/hellohao/pojo/Images.java +++ b/src/main/java/cn/hellohao/pojo/Images.java @@ -1,111 +1,127 @@ package cn.hellohao.pojo; -import java.text.SimpleDateFormat; -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; public class Images { // 榛樿鐨勬椂闂村瓧绗︿覆鏍煎紡 - -//id, imgname, imgurl, userid - private Integer id; - private String imgname; - private String imgurl; - private Integer userid; - private Integer sizes=0; - private Date updatetime; - private Integer storageType; - - - public Images() { - super(); - } + + //id, imgname, imgurl, userid + private Integer id; + private String imgname; + private String imgurl; + private Integer userid; + private Integer sizes = 0; + private Integer abnormal; + private Integer source; + private String updatetime; + private String username; + private Integer storageType; - public Images(Integer id, String imgname, String imgurl, Integer userid, Integer sizes, Date updatetime, - Integer storageType) { - super(); - this.id = id; - this.imgname = imgname; - this.imgurl = imgurl; - this.userid = userid; - this.sizes = sizes; - this.updatetime = updatetime; - this.storageType = storageType; - } + public Images() { + super(); + } + public Images(Integer id, String imgname, String imgurl, Integer userid, Integer sizes, Integer abnormal, Integer source, String updatetime, String username, Integer storageType) { + this.id = id; + this.imgname = imgname; + this.imgurl = imgurl; + this.userid = userid; + this.sizes = sizes; + this.abnormal = abnormal; + this.source = source; + this.updatetime = updatetime; + this.username = username; + this.storageType = storageType; + } - public Integer getId() { - return id; - } + public Integer getId() { + return id; + } + public void setId(Integer id) { + this.id = id; + } - public void setId(Integer id) { - this.id = id; - } + public String getImgname() { + return imgname; + } + public void setImgname(String imgname) { + this.imgname = imgname; + } - public String getImgname() { - return imgname; - } + public String getImgurl() { + return imgurl; + } + public void setImgurl(String imgurl) { + this.imgurl = imgurl; + } - public void setImgname(String imgname) { - this.imgname = imgname; - } + public Integer getUserid() { + return userid; + } + public void setUserid(Integer userid) { + this.userid = userid; + } - public String getImgurl() { - return imgurl; - } + public Integer getSizes() { + return sizes; + } + public void setSizes(Integer sizes) { + this.sizes = sizes; + } - public void setImgurl(String imgurl) { - this.imgurl = imgurl; - } + public Integer getAbnormal() { + return abnormal; + } + public void setAbnormal(Integer abnormal) { + this.abnormal = abnormal; + } - public Integer getUserid() { - return userid; - } + public Integer getSource() { + return source; + } + public void setSource(Integer source) { + this.source = source; + } - public void setUserid(Integer userid) { - this.userid = userid; - } + public String getUpdatetime() { + return updatetime; + } + public void setUpdatetime(String updatetime) { + this.updatetime = updatetime; + } - public Integer getSizes() { - return sizes; - } + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } - public void setSizes(Integer sizes) { - this.sizes = sizes; - } + public Integer getStorageType() { + return storageType; + } + public void setStorageType(Integer storageType) { + this.storageType = storageType; + } - public Date getUpdatetime() { - return updatetime; - } - - - public void setUpdatetime(Date updatetime) { - this.updatetime = updatetime; - } - - - public Integer getStorageType() { - - return storageType; - } - - - public void setStorageType(Integer storageType) { - this.storageType = storageType; - } - } + @Mapper + public static interface ConfigMapper { + Config getSourceype(); + Integer setSourceype(@Param("sourcekey") Integer sourcekey); + } +} diff --git a/src/main/java/cn/hellohao/pojo/Imgreview.java b/src/main/java/cn/hellohao/pojo/Imgreview.java new file mode 100644 index 0000000..6b1581c --- /dev/null +++ b/src/main/java/cn/hellohao/pojo/Imgreview.java @@ -0,0 +1,75 @@ +package cn.hellohao.pojo; + +public class Imgreview { + private Integer id; + + private String appId; + + private String apiKey; + + private String secretKey; + + private Integer using; + + private Integer count; + + public Imgreview() { + } + + public Imgreview(Integer id, String appId, String apiKey, String secretKey, Integer using, Integer count) { + this.id = id; + this.appId = appId; + this.apiKey = apiKey; + this.secretKey = secretKey; + this.using = using; + this.count = count; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getSecretKey() { + return secretKey; + } + + public void setSecretKey(String secretKey) { + this.secretKey = secretKey; + } + + public Integer getUsing() { + return using; + } + + public void setUsing(Integer using) { + this.using = using; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } +} \ No newline at end of file diff --git a/src/main/java/cn/hellohao/pojo/Keys.java b/src/main/java/cn/hellohao/pojo/Keys.java index d7e140c..67ba917 100644 --- a/src/main/java/cn/hellohao/pojo/Keys.java +++ b/src/main/java/cn/hellohao/pojo/Keys.java @@ -1,85 +1,85 @@ package cn.hellohao.pojo; public class Keys { - private Integer id; - private String AccessKey; - private String AccessSecret; - private String Endpoint; - private String Bucketname; - private String RequestAddress; - private Integer storageType; - - public Keys() { - super(); - } + private Integer id; + private String AccessKey; + private String AccessSecret; + private String Endpoint; + private String Bucketname; + private String RequestAddress; + private Integer storageType; - public Keys(Integer id, String accessKey, String accessSecret, String endpoint, String bucketname, - String requestAddress, Integer storageType) { - super(); - this.id = id; - AccessKey = accessKey; - AccessSecret = accessSecret; - Endpoint = endpoint; - Bucketname = bucketname; - RequestAddress = requestAddress; - this.storageType = storageType; - } + public Keys() { + super(); + } - public Integer getId() { - return id; - } + public Keys(Integer id, String accessKey, String accessSecret, String endpoint, String bucketname, + String requestAddress, Integer storageType) { + super(); + this.id = id; + AccessKey = accessKey; + AccessSecret = accessSecret; + Endpoint = endpoint; + Bucketname = bucketname; + RequestAddress = requestAddress; + this.storageType = storageType; + } - public void setId(Integer id) { - this.id = id; - } + public Integer getId() { + return id; + } - public String getAccessKey() { - return AccessKey; - } + public void setId(Integer id) { + this.id = id; + } - public void setAccessKey(String accessKey) { - AccessKey = accessKey; - } + public String getAccessKey() { + return AccessKey; + } - public String getAccessSecret() { - return AccessSecret; - } + public void setAccessKey(String accessKey) { + AccessKey = accessKey; + } - public void setAccessSecret(String accessSecret) { - AccessSecret = accessSecret; - } + public String getAccessSecret() { + return AccessSecret; + } - public String getEndpoint() { - return Endpoint; - } + public void setAccessSecret(String accessSecret) { + AccessSecret = accessSecret; + } - public void setEndpoint(String endpoint) { - Endpoint = endpoint; - } + public String getEndpoint() { + return Endpoint; + } - public String getBucketname() { - return Bucketname; - } + public void setEndpoint(String endpoint) { + Endpoint = endpoint; + } - public void setBucketname(String bucketname) { - Bucketname = bucketname; - } + public String getBucketname() { + return Bucketname; + } - public String getRequestAddress() { - return RequestAddress; - } + public void setBucketname(String bucketname) { + Bucketname = bucketname; + } - public void setRequestAddress(String requestAddress) { - RequestAddress = requestAddress; - } + public String getRequestAddress() { + return RequestAddress; + } - public Integer getStorageType() { - return storageType; - } + public void setRequestAddress(String requestAddress) { + RequestAddress = requestAddress; + } - public void setStorageType(Integer storageType) { - this.storageType = storageType; - } + public Integer getStorageType() { + return storageType; + } + + public void setStorageType(Integer storageType) { + this.storageType = storageType; + } } diff --git a/src/main/java/cn/hellohao/pojo/Notice.java b/src/main/java/cn/hellohao/pojo/Notice.java new file mode 100644 index 0000000..0b754eb --- /dev/null +++ b/src/main/java/cn/hellohao/pojo/Notice.java @@ -0,0 +1,42 @@ +package cn.hellohao.pojo; + +public class Notice { + private Integer id; + private String text; + + + public Notice() { + super(); + } + + + public Notice(Integer id, String text, String password, String email, String birthder, Integer level, + Integer keyId) { + super(); + this.id = id; + this.text = text; + + } + + + public Integer getId() { + return id; + } + + + public void setId(Integer id) { + this.id = id; + } + + + public String gettext() { + return text; + } + + + public void settext(String text) { + this.text = text; + } + + +} diff --git a/src/main/java/cn/hellohao/pojo/User.java b/src/main/java/cn/hellohao/pojo/User.java index ac64740..c484246 100644 --- a/src/main/java/cn/hellohao/pojo/User.java +++ b/src/main/java/cn/hellohao/pojo/User.java @@ -1,91 +1,92 @@ package cn.hellohao.pojo; public class User { - private Integer id; - private String username; - private String password; - private String email; - private String birthder; - private Integer level; - - - public User() { - super(); - } + private Integer id; + private String username; + private String password; + private String email; + private String birthder; + private Integer level; + private String uid; + private Integer isok; - public User(Integer id, String username, String password, String email, String birthder, Integer level, - Integer keyId) { - super(); - this.id = id; - this.username = username; - this.password = password; - this.email = email; - this.birthder = birthder; - this.level = level; - } + public User() { + super(); + } + public User(Integer id, String username, String password, String email, String birthder, Integer level, String uid, Integer isok) { + this.id = id; + this.username = username; + this.password = password; + this.email = email; + this.birthder = birthder; + this.level = level; + this.uid = uid; + this.isok = isok; + } - public Integer getId() { - return id; - } + public Integer getId() { + return id; + } + public void setId(Integer id) { + this.id = id; + } - public void setId(Integer id) { - this.id = id; - } + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } - public String getUsername() { - return username; - } + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } - public void setUsername(String username) { - this.username = username; - } + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } - public String getPassword() { - return password; - } + public String getBirthder() { + return birthder; + } + public void setBirthder(String birthder) { + this.birthder = birthder; + } - public void setPassword(String password) { - this.password = password; - } + public Integer getLevel() { + return level; + } + public void setLevel(Integer level) { + this.level = level; + } - public String getEmail() { - return email; - } + public String getUid() { + return uid; + } + public void setUid(String uid) { + this.uid = uid; + } - public void setEmail(String email) { - this.email = email; - } + public Integer getIsok() { + return isok; + } - - public String getBirthder() { - return birthder; - } - - - public void setBirthder(String birthder) { - this.birthder = birthder; - } - - - public Integer getLevel() { - return level; - } - - - public void setLevel(Integer level) { - this.level = level; - } - - - - + public void setIsok(Integer isok) { + this.isok = isok; + } } diff --git a/src/main/java/cn/hellohao/quartz/QuartzConfigration.java b/src/main/java/cn/hellohao/quartz/QuartzConfigration.java new file mode 100644 index 0000000..311337c --- /dev/null +++ b/src/main/java/cn/hellohao/quartz/QuartzConfigration.java @@ -0,0 +1,87 @@ +package cn.hellohao.quartz; + +import org.quartz.Trigger; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.quartz.CronTriggerFactoryBean; +import org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean; +import org.springframework.scheduling.quartz.SchedulerFactoryBean; + +/* +* 鐢变簬springboot鏄棤xml閰嶇疆锛屾墍浠ユ澶勬垜浠噰鐢╞ean娉ㄨВ鐨勬柟寮忓疄鐜皅uartz鐨勯厤缃*/ + +@Configuration +public class QuartzConfigration { + @Bean(name = "jobDetail") + public MethodInvokingJobDetailFactoryBean detailFactoryBean(SchedulerTask task) { + // ScheduleTask涓洪渶瑕佹墽琛岀殑浠诲姟 + MethodInvokingJobDetailFactoryBean jobDetail = new MethodInvokingJobDetailFactoryBean(); + /* + * 鏄惁骞跺彂鎵ц + * 渚嬪姣5s鎵ц涓娆′换鍔★紝浣嗘槸褰撳墠浠诲姟杩樻病鏈夋墽琛屽畬锛屽氨宸茬粡杩囦簡5s浜嗭紝 + * 濡傛灉姝ゅ涓簍rue锛屽垯涓嬩竴涓换鍔′細bing鎵ц锛屽鏋滄澶勪负false锛屽垯涓嬩竴涓换鍔′細绛夊緟涓婁竴涓换鍔℃墽琛屽畬鍚庯紝鍐嶅紑濮嬫墽琛 + */ + + /* + * +"0 0 12 * * ?" 姣忓ぉ涓崍12鐐硅Е鍙 +"0 15 10 ? * *" 姣忓ぉ涓婂崍10:15瑙﹀彂 +"0 15 10 * * ?" 姣忓ぉ涓婂崍10:15瑙﹀彂 +"0 15 10 * * ? *" 姣忓ぉ涓婂崍10:15瑙﹀彂 +"0 15 10 * * ? 2005" 2005骞寸殑姣忓ぉ涓婂崍10:15瑙﹀彂 +"0 * 14 * * ?" 鍦ㄦ瘡澶╀笅鍗2鐐瑰埌涓嬪崍2:59鏈熼棿鐨勬瘡1鍒嗛挓瑙﹀彂 +"0 0/5 14 * * ?" 鍦ㄦ瘡澶╀笅鍗2鐐瑰埌涓嬪崍2:55鏈熼棿鐨勬瘡5鍒嗛挓瑙﹀彂 +"0 0/5 14,18 * * ?" 鍦ㄦ瘡澶╀笅鍗2鐐瑰埌2:55鏈熼棿鍜屼笅鍗6鐐瑰埌6:55鏈熼棿鐨勬瘡5鍒嗛挓瑙﹀彂 +"0 0-5 14 * * ?" 鍦ㄦ瘡澶╀笅鍗2鐐瑰埌涓嬪崍2:05鏈熼棿鐨勬瘡1鍒嗛挓瑙﹀彂 +"0 10,44 14 ? 3 WED" 姣忓勾涓夋湀鐨勬槦鏈熶笁鐨勪笅鍗2:10鍜2:44瑙﹀彂 +"0 15 10 ? * MON-FRI" 鍛ㄤ竴鑷冲懆浜旂殑涓婂崍10:15瑙﹀彂 +"0 15 10 15 * ?" 姣忔湀15鏃ヤ笂鍗10:15瑙﹀彂 +"0 15 10 L * ?" 姣忔湀鏈鍚庝竴鏃ョ殑涓婂崍10:15瑙﹀彂 +"0 15 10 ? * 6L" 姣忔湀鐨勬渶鍚庝竴涓槦鏈熶簲涓婂崍10:15瑙﹀彂 +"0 15 10 ? * 6L 2002-2005" 2002骞磋嚦2005骞寸殑姣忔湀鐨勬渶鍚庝竴涓槦鏈熶簲涓婂崍10:15瑙﹀彂 +"0 15 10 ? * 6#3" 姣忔湀鐨勭涓変釜鏄熸湡浜斾笂鍗10:15瑙﹀彂 + * */ + jobDetail.setConcurrent(true); + + jobDetail.setName("scheduler");// 璁剧疆浠诲姟鐨勫悕瀛 + jobDetail.setGroup("scheduler_group");// 璁剧疆浠诲姟鐨勫垎缁勶紝杩欎簺灞炴ч兘鍙互瀛樺偍鍦ㄦ暟鎹簱涓紝鍦ㄥ浠诲姟鐨勬椂鍊欎娇鐢 + + /* + * 杩欎袱琛屼唬鐮佽〃绀烘墽琛宼ask瀵硅薄涓殑scheduleTest鏂规硶銆傚畾鏃舵墽琛岀殑閫昏緫閮藉湪scheduleTest銆 + */ + jobDetail.setTargetObject(task); + + jobDetail.setTargetMethod("start"); + return jobDetail; + } + + @Bean(name = "jobTrigger") + public CronTriggerFactoryBean cronJobTrigger(MethodInvokingJobDetailFactoryBean jobDetail) { + CronTriggerFactoryBean tigger = new CronTriggerFactoryBean(); + tigger.setJobDetail(jobDetail.getObject()); + tigger.setCronExpression("0 30 04 * * ?");// 琛ㄧず姣忓ぉ涓冪偣鍗婃墽琛 + //tigger.setCronExpression("*/5 * * * * ?");//姣忎簲绉掓墽琛屼竴娆 + //tigger.set + tigger.setName("myTigger");// trigger鐨刵ame + return tigger; + + } + + @Bean(name = "scheduler") + public SchedulerFactoryBean schedulerFactory(Trigger cronJobTrigger) { + SchedulerFactoryBean bean = new SchedulerFactoryBean(); + //璁剧疆鏄惁浠绘剰涓涓凡瀹氫箟鐨凧ob浼氳鐩栫幇鍦ㄧ殑Job銆傞粯璁や负false锛屽嵆宸插畾涔夌殑Job涓嶄細瑕嗙洊鐜版湁鐨凧ob銆 + bean.setOverwriteExistingJobs(true); + // 寤舵椂鍚姩锛屽簲鐢ㄥ惎鍔5绉掑悗 锛屽畾鏃跺櫒鎵嶅紑濮嬪惎鍔 + bean.setStartupDelay(5); + // 娉ㄥ唽瀹氭椂瑙﹀彂鍣 + bean.setTriggers(cronJobTrigger); + return bean; + } + //澶氫换鍔℃椂鐨凷cheduler锛屽姩鎬佽缃甌rigger銆備竴涓猄chedulerFactoryBean鍙兘浼氭湁澶氫釜Trigger + @Bean(name = "multitaskScheduler") + public SchedulerFactoryBean schedulerFactoryBean(){ + SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean(); + return schedulerFactoryBean; + } +} \ No newline at end of file diff --git a/src/main/java/cn/hellohao/quartz/SchedulerTask.java b/src/main/java/cn/hellohao/quartz/SchedulerTask.java new file mode 100644 index 0000000..0463983 --- /dev/null +++ b/src/main/java/cn/hellohao/quartz/SchedulerTask.java @@ -0,0 +1,117 @@ +package cn.hellohao.quartz; + +import cn.hellohao.pojo.Images; +import cn.hellohao.pojo.Imgreview; +import cn.hellohao.pojo.Keys; +import cn.hellohao.service.ConfigService; +import cn.hellohao.service.ImgreviewService; +import cn.hellohao.service.KeysService; +import cn.hellohao.service.impl.ImgServiceImpl; +import com.alibaba.fastjson.JSON; +import com.baidu.aip.contentcensor.AipContentCensor; +import com.baidu.aip.contentcensor.EImgType; +import org.json.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.stereotype.Component; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/* +鍗曚换鍔℃墽琛岋紝骞朵笖閫氳繃鎺у埗鍣ㄧ殑鎺ュ彛瀹炵幇鏃堕棿闂撮殧鐨勫姩鎬佷慨鏀 +浠诲姟绫 +* */ +@Configuration +@Component +@EnableScheduling +public class SchedulerTask { + + @Autowired + private ImgServiceImpl imgService; + @Autowired + private ImgreviewService imgreviewService; + @Autowired + private KeysService keysService; + + private static AipContentCensor client; + + private static void Initializes(Imgreview imgreview) { + client = new AipContentCensor(imgreview.getAppId(), imgreview.getApiKey(), imgreview.getSecretKey()); + client.setConnectionTimeoutInMillis(2000); + client.setSocketTimeoutInMillis(60000); + } + + public void start() throws InterruptedException { + + //System.out.println("娲诲姩寮濮嬶紒锛侊紒"+new Date()); + //鏌ヨ閴撮粍key + Imgreview imgreview = imgreviewService.selectByPrimaryKey(1); + //鍒濆鍖栭壌榛 + SchedulerTask.Initializes(imgreview); + //璁$畻鍑烘槰澶╃殑鏃ユ湡 + Date d = new Date(); + SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd"); + String oldtime = df.format(new Date(d.getTime() - 1 * 24 * 60 * 60 * 1000)); + //鏈嶅姟鍣ㄨ幏鍙栧嚭杩欎釜鏃堕棿娈电殑鍊肩劧鍚庨亶鍘 + List imglist= imgService.gettimeimg(oldtime); + for (Images images : imglist) { + + String imgurl = "http://"+images.getImgurl(); + System.err.println("姝e湪閴村畾鐨勫浘鐗囷細" + imgurl); + JSONObject res = client.antiPorn(imgurl); + res = client.imageCensorUserDefined(imgurl, EImgType.URL, null); + System.err.println("杩斿洖鐨勯壌榛刯son:"+res.toString()); + com.alibaba.fastjson.JSONArray jsonArray = JSON.parseArray("[" + res.toString() + "]"); + for (Object o : jsonArray) { + com.alibaba.fastjson.JSONObject jsonObject = (com.alibaba.fastjson.JSONObject) o; + com.alibaba.fastjson.JSONArray data = jsonObject.getJSONArray("data"); + Integer conclusionType = jsonObject.getInteger("conclusionType"); + if (conclusionType == 2) { + for (Object datum : data) { + com.alibaba.fastjson.JSONObject imgdata = (com.alibaba.fastjson.JSONObject) datum; + if (imgdata.getInteger("type") == 1) { + //鏍囪鍥剧墖 + Integer ret = imgService.deleimgname(images.getImgname()); //鍒犻櫎鏁版嵁搴撳浘鐗囦俊鎭 + //Imgreview imgreview1 =imgreviewService.selectByPrimaryKey(1); + Imgreview imgreview1 = new Imgreview(); + imgreview1.setId(1); + Integer count = imgreview.getCount(); + System.out.println("杩濇硶鍥剧墖鎬绘暟锛" + count); + imgreview1.setCount(count + 1); + imgreviewService.updateByPrimaryKeySelective(imgreview1); + Keys key =null; + if(images.getSource()==1){ + key = keysService.selectKeys(images.getSource()); + imgService.delect(key, images.getImgname()); + }else if (images.getSource()==2){ + key = keysService.selectKeys(images.getSource()); + imgService.delectOSS(key, images.getImgname()); + }else if(images.getSource()==3){ + //鍒濆鍖栬吘璁簯 + }else if(images.getSource()==4){ + //鍒濆鍖栦竷鐗涗簯 + }else{ + System.err.println("鏈幏鍙栧埌瀵硅薄瀛樺偍鍙傛暟锛屼笂浼犲け璐ャ"); + } + + if (ret == 1) { + System.err.println("瀛樺湪鑹叉儏鍥剧墖锛屽垹闄ゆ垚鍔熴"); + } else { + System.err.println("瀛樺湪鑹叉儏鍥剧墖锛屽垹闄ゅけ璐"); + } + } + + } + } + + } + + } + + } + + +} \ No newline at end of file diff --git a/src/main/java/cn/hellohao/quartz/test.java b/src/main/java/cn/hellohao/quartz/test.java new file mode 100644 index 0000000..a4993c1 --- /dev/null +++ b/src/main/java/cn/hellohao/quartz/test.java @@ -0,0 +1,13 @@ +package cn.hellohao.quartz; + +import java.text.SimpleDateFormat; +import java.util.Date; + +public class test { + public static void main(String[] args) { + Date d = new Date(); + SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd"); + String oldtime = df.format(new Date(d.getTime())); + System.out.println(df.format(new Date())); + } +} diff --git a/src/main/java/cn/hellohao/service/ConfigService.java b/src/main/java/cn/hellohao/service/ConfigService.java new file mode 100644 index 0000000..ded4c1f --- /dev/null +++ b/src/main/java/cn/hellohao/service/ConfigService.java @@ -0,0 +1,10 @@ +package cn.hellohao.service; + +import cn.hellohao.pojo.Config; +import org.springframework.stereotype.Service; + +@Service +public interface ConfigService { + Config getSourceype(); + Integer setSourceype(Config config); +} diff --git a/src/main/java/cn/hellohao/service/EmailConfigService.java b/src/main/java/cn/hellohao/service/EmailConfigService.java new file mode 100644 index 0000000..2112a74 --- /dev/null +++ b/src/main/java/cn/hellohao/service/EmailConfigService.java @@ -0,0 +1,10 @@ +package cn.hellohao.service; + +import cn.hellohao.pojo.EmailConfig; +import org.springframework.stereotype.Service; + +@Service +public interface EmailConfigService { + EmailConfig getemail(); + Integer updateemail(EmailConfig emailConfig); +} diff --git a/src/main/java/cn/hellohao/service/ImgService.java b/src/main/java/cn/hellohao/service/ImgService.java index 6d1bd44..ecf5cca 100644 --- a/src/main/java/cn/hellohao/service/ImgService.java +++ b/src/main/java/cn/hellohao/service/ImgService.java @@ -8,9 +8,21 @@ import org.apache.ibatis.annotations.Param; import cn.hellohao.pojo.Images; public interface ImgService { - List selectimg(Integer id); - Integer deleimg(Integer id); - Integer countimg(Integer userid); - Images selectByPrimaryKey(Integer id); - Integer counts(Integer userid); + List selectimg(Integer id); + + Integer deleimg(Integer id); + + Integer countimg(Integer userid); + + Images selectByPrimaryKey(Integer id); + + Integer counts(Integer userid); + + Integer setabnormal(String imgname); + + Integer deleimgname(String imgname); + + Integer deleall(Integer id); + + List gettimeimg(String time); } diff --git a/src/main/java/cn/hellohao/service/ImgreviewService.java b/src/main/java/cn/hellohao/service/ImgreviewService.java new file mode 100644 index 0000000..8214532 --- /dev/null +++ b/src/main/java/cn/hellohao/service/ImgreviewService.java @@ -0,0 +1,18 @@ +package cn.hellohao.service; + +import cn.hellohao.pojo.Imgreview; + +public interface ImgreviewService { + int deleteByPrimaryKey(Integer id); + + int insert(Imgreview record); + + int insertSelective(Imgreview record); + + Imgreview selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(Imgreview record); + + int updateByPrimaryKey(Imgreview record); + +} diff --git a/src/main/java/cn/hellohao/service/KeysService.java b/src/main/java/cn/hellohao/service/KeysService.java index cad83ca..c73433f 100644 --- a/src/main/java/cn/hellohao/service/KeysService.java +++ b/src/main/java/cn/hellohao/service/KeysService.java @@ -4,11 +4,10 @@ package cn.hellohao.service; import cn.hellohao.pojo.Keys; public interface KeysService { - //鏌ヨ瀵嗛挜 - Keys selectKeys(Integer storageType); - //鏌ヨkey绫诲瀷 - Integer selectKeysType(); - //淇敼key - Integer updateKey(Keys key); + //鏌ヨ瀵嗛挜 + Keys selectKeys(Integer storageType); + + //淇敼key + Integer updateKey(Keys key); } diff --git a/src/main/java/cn/hellohao/service/NoticeService.java b/src/main/java/cn/hellohao/service/NoticeService.java new file mode 100644 index 0000000..498356e --- /dev/null +++ b/src/main/java/cn/hellohao/service/NoticeService.java @@ -0,0 +1,6 @@ +package cn.hellohao.service; + +public interface NoticeService { + + String getNotice(); +} diff --git a/src/main/java/cn/hellohao/service/UserService.java b/src/main/java/cn/hellohao/service/UserService.java index 073dd7d..54419cc 100644 --- a/src/main/java/cn/hellohao/service/UserService.java +++ b/src/main/java/cn/hellohao/service/UserService.java @@ -3,19 +3,39 @@ package cn.hellohao.service; import cn.hellohao.pojo.Images; import cn.hellohao.pojo.User; +import java.util.List; + public interface UserService { - //娉ㄥ唽 - Integer register(User user); - //鐧诲綍 - Integer login(String email,String password); - //鑾峰彇鐢ㄦ埛淇℃伅 - User getUsers(String email); - //鎻掑叆鍥剧墖 - Integer insertimg(Images img); - //淇敼璧勬枡 - Integer change(User user); - //妫鏌ョ敤鎴峰悕鏄惁閲嶅 - Integer checkUsername(String username); - - Integer getUserTotal(); + //娉ㄥ唽 + Integer register(User user); + + //鐧诲綍 + Integer login(String email, String password); + + //鑾峰彇鐢ㄦ埛淇℃伅 + User getUsers(String email); + + //鎻掑叆鍥剧墖 + Integer insertimg(Images img); + + //淇敼璧勬枡 + Integer change(User user); + + //妫鏌ョ敤鎴峰悕鏄惁閲嶅 + Integer checkUsername(String username); + + Integer getUserTotal(); + + List getuserlist(); + + Integer deleuser(Integer id); + + //鏌ヨ鐢ㄦ埛鍚嶆垨鑰呴偖绠辨槸鍚﹀瓨鍦 + Integer countusername(String username); + + Integer countmail(String email); + + Integer uiduser(String uid); + + User getUsersMail(String uid); } diff --git a/src/main/java/cn/hellohao/service/impl/ConfigServiceImpl.java b/src/main/java/cn/hellohao/service/impl/ConfigServiceImpl.java new file mode 100644 index 0000000..94d99f1 --- /dev/null +++ b/src/main/java/cn/hellohao/service/impl/ConfigServiceImpl.java @@ -0,0 +1,23 @@ +package cn.hellohao.service.impl; + +import cn.hellohao.dao.ConfigMapper; +import cn.hellohao.pojo.Config; +import cn.hellohao.pojo.Images; +import cn.hellohao.service.ConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class ConfigServiceImpl implements ConfigService { + @Autowired + private ConfigMapper configMapper; + @Override + public Config getSourceype() { + return configMapper.getSourceype(); + } + + @Override + public Integer setSourceype(Config config) { + return configMapper.setSourceype(config); + } +} diff --git a/src/main/java/cn/hellohao/service/impl/EmailServiceImpl.java b/src/main/java/cn/hellohao/service/impl/EmailServiceImpl.java new file mode 100644 index 0000000..d1c4d52 --- /dev/null +++ b/src/main/java/cn/hellohao/service/impl/EmailServiceImpl.java @@ -0,0 +1,22 @@ +package cn.hellohao.service.impl; + +import cn.hellohao.dao.EmailConfigMapper; +import cn.hellohao.pojo.EmailConfig; +import cn.hellohao.service.EmailConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class EmailServiceImpl implements EmailConfigService { + @Autowired + EmailConfigMapper emailConfigMapper; + @Override + public EmailConfig getemail() { + return emailConfigMapper.getemail(); + } + + @Override + public Integer updateemail(EmailConfig emailConfig) { + return emailConfigMapper.updateemail(emailConfig); + } +} diff --git a/src/main/java/cn/hellohao/service/impl/ImgServiceImpl.java b/src/main/java/cn/hellohao/service/impl/ImgServiceImpl.java index 38c9ebb..b419ff0 100644 --- a/src/main/java/cn/hellohao/service/impl/ImgServiceImpl.java +++ b/src/main/java/cn/hellohao/service/impl/ImgServiceImpl.java @@ -3,6 +3,7 @@ package cn.hellohao.service.impl; import java.util.ArrayList; import java.util.List; +import com.aliyun.oss.OSSClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -18,69 +19,112 @@ import cn.hellohao.pojo.Images; import cn.hellohao.pojo.Keys; import cn.hellohao.service.ImgService; +import javax.annotation.Resource; + @Service public class ImgServiceImpl implements ImgService { - @Autowired - private ImgMapper imgMapper; + @Autowired + //@Resource + private ImgMapper imgMapper; - @Override - public List selectimg(Integer userid) { - // TODO Auto-generated method stub - return imgMapper.selectimg(userid); - } + @Override + public List selectimg(Integer userid) { + // TODO Auto-generated method stub + return imgMapper.selectimg(userid); + } - @Override - public Integer deleimg(Integer id) { - // TODO Auto-generated method stub - return imgMapper.deleimg(id); - } + @Override + public Integer deleimg(Integer id) { + // TODO Auto-generated method stub + return imgMapper.deleimg(id); + } - public Images selectByPrimaryKey(Integer id) { - return imgMapper.selectByPrimaryKey(id); - } + public Images selectByPrimaryKey(Integer id) { + return imgMapper.selectByPrimaryKey(id); + } - //鍒犻櫎瀵硅薄瀛樺偍鐨勫浘鐗囨枃浠 - public void delect(Keys key,String fileName) { - // 鍒濆鍖 - Credentials credentials = new BasicCredentials(key.getAccessKey(), key.getAccessSecret()); - NosClient nosClient = new NosClient(credentials); - nosClient.setEndpoint(key.getEndpoint()); - // 鍒濆鍖朤ransferManager - TransferManager transferManager = new TransferManager(nosClient); + //鍒犻櫎瀵硅薄瀛樺偍鐨勫浘鐗囨枃浠 + public void delect(Keys key, String fileName) { + // 鍒濆鍖 + Credentials credentials = new BasicCredentials(key.getAccessKey(), key.getAccessSecret()); + NosClient nosClient = new NosClient(credentials); + nosClient.setEndpoint(key.getEndpoint()); + // 鍒濆鍖朤ransferManager + TransferManager transferManager = new TransferManager(nosClient); + //鍒椾妇妗 + ArrayList bucketList = new ArrayList(); + String tname = ""; + for (Bucket bucket : nosClient.listBuckets()) { + bucketList.add(bucket.getName()); + } + for (Object object : bucketList) { + tname = object.toString(); + //鏌ョ湅妗剁殑ACL + CannedAccessControlList acl = nosClient.getBucketAcl(object.toString()); + // bucket鏉冮檺 + } + //杩欑鏂规硶涓嶈兘鍒犻櫎鎸囧畾鏂囦欢澶逛笅鐨勬枃浠 + boolean isExist = nosClient.doesObjectExist(tname, fileName, null); + System.out.println("鏂囦欢鏄惁瀛樺湪锛" + isExist); + if (isExist) { + nosClient.deleteObject(tname, fileName); + } - //鍒椾妇妗 - ArrayList bucketList = new ArrayList(); - String tname = ""; - for (Bucket bucket : nosClient.listBuckets()) { - bucketList.add(bucket.getName()); - } - for (Object object : bucketList) { - System.out.println("妗跺悕锛"+object.toString()); - tname = object.toString(); - //鏌ョ湅妗剁殑ACL - CannedAccessControlList acl = nosClient.getBucketAcl(object.toString()); - // bucket鏉冮檺 - System.out.println("杩欎釜妗剁殑鏉冮檺鏄細"+acl.toString()); - } - //杩欐槸鍒犻櫎鏂囦欢鐨勬柟娉 - boolean isExist = nosClient.doesObjectExist(tname,fileName,null); - System.out.println("鏂囦欢鏄惁瀛樺湪锛"+isExist); - - nosClient.deleteObject(tname,fileName); - } + } - @Override - public Integer counts(Integer userid) { - // TODO Auto-generated method stub - return imgMapper.counts(userid); - } + //鍒犻櫎OSS瀵硅薄瀛樺偍鐨勫浘鐗囨枃浠 + public void delectOSS(Keys key, String fileName) { + // 鍒濆鍖 +// Endpoint浠ユ澀宸炰负渚嬶紝鍏跺畠Region璇锋寜瀹為檯鎯呭喌濉啓銆 + String endpoint = key.getEndpoint(); +// 闃块噷浜戜富璐﹀彿AccessKey鎷ユ湁鎵鏈堿PI鐨勮闂潈闄愶紝椋庨櫓寰堥珮銆傚己鐑堝缓璁偍鍒涘缓骞朵娇鐢≧AM璐﹀彿杩涜API璁块棶鎴栨棩甯歌繍缁达紝璇风櫥褰 https://ram.console.aliyun.com 鍒涘缓RAM璐﹀彿銆 + String accessKeyId = key.getAccessKey(); + String accessKeySecret = key.getAccessSecret(); + String bucketName = key.getBucketname(); + String objectName = fileName; - @Override - public Integer countimg(Integer userid) { - // TODO Auto-generated method stub - return imgMapper.countimg(userid); - } +// 鍒涘缓OSSClient瀹炰緥銆 + OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret); +// 鍒犻櫎鏂囦欢銆 + ossClient.deleteObject(bucketName, objectName); +// 鍏抽棴OSSClient銆 + ossClient.shutdown(); + } + + + @Override + public Integer counts(Integer userid) { + // TODO Auto-generated method stub + return imgMapper.counts(userid); + } + + + @Override + public Integer countimg(Integer userid) { + // TODO Auto-generated method stub + return imgMapper.countimg(userid); + } + + @Override + public Integer setabnormal(String imgname) { + return imgMapper.setabnormal(imgname); + } + + @Override + public Integer deleimgname(String imgname) { + return imgMapper.deleimgname(imgname); + } + + @Override + public Integer deleall(Integer id) { + return imgMapper.deleall(id); + } + + @Override + public List gettimeimg(String time) { + return imgMapper.gettimeimg(time); + } } diff --git a/src/main/java/cn/hellohao/service/impl/ImgreviewServiceImpl.java b/src/main/java/cn/hellohao/service/impl/ImgreviewServiceImpl.java new file mode 100644 index 0000000..159bf2f --- /dev/null +++ b/src/main/java/cn/hellohao/service/impl/ImgreviewServiceImpl.java @@ -0,0 +1,44 @@ +package cn.hellohao.service.impl; + +import cn.hellohao.dao.ImgreviewMapper; +import cn.hellohao.pojo.Imgreview; +import cn.hellohao.service.ImgreviewService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class ImgreviewServiceImpl implements ImgreviewService { + + @Autowired + private ImgreviewMapper imgreviewMapper; + + @Override + public int deleteByPrimaryKey(Integer id) { + return 0; + } + + @Override + public int insert(Imgreview record) { + return 0; + } + + @Override + public int insertSelective(Imgreview record) { + return 0; + } + + @Override + public Imgreview selectByPrimaryKey(Integer id) { + return imgreviewMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(Imgreview record) { + return imgreviewMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(Imgreview record) { + return 0; + } +} diff --git a/src/main/java/cn/hellohao/service/impl/KeysServiceImpl.java b/src/main/java/cn/hellohao/service/impl/KeysServiceImpl.java index 5036ea0..2a2ee91 100644 --- a/src/main/java/cn/hellohao/service/impl/KeysServiceImpl.java +++ b/src/main/java/cn/hellohao/service/impl/KeysServiceImpl.java @@ -9,26 +9,21 @@ import cn.hellohao.service.KeysService; @Service public class KeysServiceImpl implements KeysService { - - @Autowired - private KeysMapper keysMapper; - @Override - public Keys selectKeys(Integer storageType) { - // TODO Auto-generated method stub - return keysMapper.selectKeys(storageType); - } + @Autowired + private KeysMapper keysMapper; - @Override - public Integer selectKeysType() { - // TODO Auto-generated method stub - return keysMapper.selectKeysType(); - } + @Override + public Keys selectKeys(Integer storageType) { + // TODO Auto-generated method stub + return keysMapper.selectKeys(storageType); + } - @Override - public Integer updateKey(Keys key) { - // TODO Auto-generated method stub - return keysMapper.updateKey(key); - } + + @Override + public Integer updateKey(Keys key) { + // TODO Auto-generated method stub + return keysMapper.updateKey(key); + } } diff --git a/src/main/java/cn/hellohao/service/impl/NOSImageupload.java b/src/main/java/cn/hellohao/service/impl/NOSImageupload.java index 492f3f9..47a4f82 100644 --- a/src/main/java/cn/hellohao/service/impl/NOSImageupload.java +++ b/src/main/java/cn/hellohao/service/impl/NOSImageupload.java @@ -25,7 +25,7 @@ import cn.hellohao.pojo.Keys; @Service public class NOSImageupload { - //鐩存帴璇诲彇properties鏂囦欢鐨勫 + //鐩存帴璇诲彇properties鏂囦欢鐨勫 // @Value("${AccessKey}") // private String AccessKey; // @Value("${AccessSecret}") @@ -36,60 +36,68 @@ public class NOSImageupload { // private String Bucketname; // @Value("${RequestAddress}") // private String RequestAddress; - static String BarrelName; - static NosClient nosClient; - static Keys key; + static String BarrelName; + static NosClient nosClient; + static Keys key; - public Map Imageupload(Map fileMap) throws Exception { - // 瑕佷笂浼犳枃浠剁殑璺緞 - Map ImgUrl = new HashMap<>(); - for (Map.Entry entry : fileMap.entrySet()) { - String uuid = UUID.randomUUID().toString().replace("-", "").toLowerCase(); - //System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue()); - File file = changeFile(entry.getValue()); - try { - nosClient.putObject(BarrelName, uuid + "." + entry.getKey(), file); - ImgUrl.put(key.getRequestAddress() + "/" + uuid + "." + entry.getKey(), (int) (entry.getValue().getSize())); - } catch (Exception e) { - System.out.println("涓婁紶鎶ラ敊==" + e.getMessage()); - } - } - return ImgUrl; - } + public Map Imageupload(Map fileMap, String username) throws Exception { +// String Catalog = "";//榛樿娓稿鐩綍 +// if(username.equals("tourist")){ +// Catalog = "tourist"; +// }else{ +// Catalog = username; +// } + // 瑕佷笂浼犳枃浠剁殑璺緞 + File file = null; + Map ImgUrl = new HashMap<>(); + for (Map.Entry entry : fileMap.entrySet()) { + String uuid = UUID.randomUUID().toString().replace("-", "").toLowerCase().substring(0,5);//鐢熸垚涓涓病鏈-鐨剈uid锛岀劧鍚庡彇鍓5浣 + java.text.DateFormat format1 = new java.text.SimpleDateFormat("MMddhhmmss"); + String times = format1.format(new Date()); + file = changeFile(entry.getValue()); + try { + nosClient.putObject(BarrelName, username + "/" + uuid+times + "." + entry.getKey(), file); + ImgUrl.put(key.getRequestAddress() + "/" + username + "/" + uuid+times + "." + entry.getKey(), (int) (entry.getValue().getSize())); + } catch (Exception e) { + System.out.println("涓婁紶鎶ラ敊:" + e.getMessage()); + } + } + return ImgUrl; + } - // 杞崲鏂囦欢鏂规硶 - private File changeFile(MultipartFile multipartFile) throws Exception { - // 鑾峰彇鏂囦欢鍚 - String fileName = multipartFile.getOriginalFilename(); - // 鑾峰彇鏂囦欢鍚庣紑 - String prefix = fileName.substring(fileName.lastIndexOf(".")); - // todo 淇敼涓存椂鏂囦欢鏂囦欢鍚 - File file = File.createTempFile(fileName, prefix); - // MultipartFile to File - multipartFile.transferTo(file); - return file; - } + // 杞崲鏂囦欢鏂规硶 + private File changeFile(MultipartFile multipartFile) throws Exception { + // 鑾峰彇鏂囦欢鍚 + String fileName = multipartFile.getOriginalFilename(); + // 鑾峰彇鏂囦欢鍚庣紑 + String prefix = fileName.substring(fileName.lastIndexOf(".")); + // todo 淇敼涓存椂鏂囦欢鏂囦欢鍚 + File file = File.createTempFile(fileName, prefix); + // MultipartFile to File + multipartFile.transferTo(file); + return file; + } - //鍒濆鍖栧璞″瓨鍌 - public static void Initialize(Keys k){ - // 鍒濆鍖 - Credentials credentials = new BasicCredentials(k.getAccessKey(), k.getAccessSecret()); - nosClient = new NosClient(credentials); - nosClient.setEndpoint(k.getEndpoint()); - // 鍒濆鍖朤ransferManager - TransferManager transferManager = new TransferManager(nosClient); - // 鍒椾妇妗 - ArrayList bucketList = new ArrayList(); - for (Bucket bucket : nosClient.listBuckets()) { - bucketList.add(bucket.getName()); - } - for (Object object : bucketList) { - if (object.toString().equals(k.getBucketname())) { - BarrelName = object.toString(); - } - } - key = k; - } + //鍒濆鍖栫綉鏄揘OS瀵硅薄瀛樺偍 + public static void Initialize(Keys k) { + // 鍒濆鍖 + Credentials credentials = new BasicCredentials(k.getAccessKey(), k.getAccessSecret()); + nosClient = new NosClient(credentials); + nosClient.setEndpoint(k.getEndpoint()); + // 鍒濆鍖朤ransferManager + TransferManager transferManager = new TransferManager(nosClient); + // 鍒椾妇妗 + ArrayList bucketList = new ArrayList(); + for (Bucket bucket : nosClient.listBuckets()) { + bucketList.add(bucket.getName()); + } + for (Object object : bucketList) { + if (object.toString().equals(k.getBucketname())) { + BarrelName = object.toString(); + } + } + key = k; + } } diff --git a/src/main/java/cn/hellohao/service/impl/NoticeServiceImpl.java b/src/main/java/cn/hellohao/service/impl/NoticeServiceImpl.java new file mode 100644 index 0000000..86e4841 --- /dev/null +++ b/src/main/java/cn/hellohao/service/impl/NoticeServiceImpl.java @@ -0,0 +1,18 @@ +package cn.hellohao.service.impl; + +import cn.hellohao.dao.NoticeMapper; +import cn.hellohao.service.NoticeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class NoticeServiceImpl implements NoticeService { + + @Autowired + private NoticeMapper noticeMapper; + + @Override + public String getNotice() { + return noticeMapper.getNotice(); + } +} diff --git a/src/main/java/cn/hellohao/service/impl/OSSImageupload.java b/src/main/java/cn/hellohao/service/impl/OSSImageupload.java new file mode 100644 index 0000000..b5ba405 --- /dev/null +++ b/src/main/java/cn/hellohao/service/impl/OSSImageupload.java @@ -0,0 +1,85 @@ +package cn.hellohao.service.impl; + +import cn.hellohao.pojo.Keys; +import com.aliyun.oss.OSSClient; +import com.aliyun.oss.model.ObjectMetadata; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +@Service +public class OSSImageupload { + static String BarrelName; + static OSSClient ossClient; + static Keys key; + + public Map ImageuploadOSS(Map fileMap, String username) throws Exception { + // 瑕佷笂浼犳枃浠剁殑璺緞 + File file = null; + Map ImgUrl = new HashMap<>(); + //璁剧疆Header + ObjectMetadata meta = new ObjectMetadata(); + meta.setHeader("Content-Disposition", "inline"); + for (Map.Entry entry : fileMap.entrySet()) { + String uuid = UUID.randomUUID().toString().replace("-", "").toLowerCase().substring(0,5);//鐢熸垚涓涓病鏈-鐨剈uid锛岀劧鍚庡彇鍓5浣 + java.text.DateFormat format1 = new java.text.SimpleDateFormat("MMddhhmmss"); + String times = format1.format(new Date()); + file = changeFile(entry.getValue()); + + String head = ""; + if(entry.getKey().equals("jpg")||entry.getKey().equals("jpeg")){ + head = "image/jpeg"; + }else if(entry.getKey().equals("png")){ + head = "image/png"; + }else if(entry.getKey().equals("bmp")){ + head = "image/bmp"; + }else if(entry.getKey().equals("gif")){ + head = "image/gif"; + }else{ + System.err.println("浣嶇疆鏍煎紡鏂囦欢锛屾棤娉曞畾涔塰eader澶淬"); + } + meta.setHeader("Content-Type", head);//image/jpeg + // 涓婁紶鏂囦欢娴併 + ossClient.putObject(key.getBucketname(), username + "/" + uuid+times + "." + entry.getKey(),file,meta); + // 鍏抽棴OSSClient銆 + //ossClient.shutdown(); + ImgUrl.put(key.getRequestAddress() + "/" + username + "/" + uuid+times + "." + entry.getKey(), (int) (entry.getValue().getSize())); + + } + return ImgUrl; + } + + // 杞崲鏂囦欢鏂规硶 + private File changeFile(MultipartFile multipartFile) throws Exception { + // 鑾峰彇鏂囦欢鍚 + String fileName = multipartFile.getOriginalFilename(); + // 鑾峰彇鏂囦欢鍚庣紑 + String prefix = fileName.substring(fileName.lastIndexOf(".")); + // todo 淇敼涓存椂鏂囦欢鏂囦欢鍚 + File file = File.createTempFile(fileName, prefix); + // MultipartFile to File + multipartFile.transferTo(file); + return file; + } + + //鍒濆鍖栫綉鏄揘OS瀵硅薄瀛樺偍 + public static void Initialize(Keys k) { + // 鍒濆鍖 + // Endpoint浠ユ澀宸炰负渚嬶紝鍏跺畠Region璇锋寜瀹為檯鎯呭喌濉啓銆 + String endpoint = "http://oss-cn-beijing.aliyuncs.com"; + // 闃块噷浜戜富璐﹀彿AccessKey鎷ユ湁鎵鏈堿PI鐨勮闂潈闄愶紝椋庨櫓寰堥珮銆傚己鐑堝缓璁偍鍒涘缓骞朵娇鐢≧AM璐﹀彿杩涜API璁块棶鎴栨棩甯歌繍缁达紝璇风櫥褰 https://ram.console.aliyun.com 鍒涘缓RAM璐﹀彿銆 + String accessKeyId = "LTAI0Yd6Li0VxrUF"; + String accessKeySecret = "F2ZuDMq0IYefvVDKyfJLpRNzXldci9"; + String bucketName = "hellohao"; + // 鍒涘缓OSSClient瀹炰緥銆 + ossClient = new OSSClient(k.getEndpoint(), k.getAccessKey(), k.getAccessSecret()); + key = k; + } + + +} diff --git a/src/main/java/cn/hellohao/service/impl/UserServiceImpl.java b/src/main/java/cn/hellohao/service/impl/UserServiceImpl.java index 3e4a826..7ba858e 100644 --- a/src/main/java/cn/hellohao/service/impl/UserServiceImpl.java +++ b/src/main/java/cn/hellohao/service/impl/UserServiceImpl.java @@ -7,53 +7,84 @@ import cn.hellohao.pojo.Images; import cn.hellohao.pojo.User; import cn.hellohao.service.UserService; +import java.util.List; + @Service public class UserServiceImpl implements UserService { - @Autowired - private UserMapper userMapper; + @Autowired + private UserMapper userMapper; - @Override - public Integer register(User user) { - // TODO Auto-generated method stub - - return userMapper.register(user); - } + @Override + public Integer register(User user) { + // TODO Auto-generated method stub - @Override - public Integer login(String email, String password) { - // TODO Auto-generated method stub - return userMapper.login(email, password); - } + return userMapper.register(user); + } - @Override - public User getUsers(String email) { - // TODO Auto-generated method stub - return userMapper.getUsers(email); - } + @Override + public Integer login(String email, String password) { + // TODO Auto-generated method stub + return userMapper.login(email, password); + } - @Override - public Integer insertimg(Images img) { - // TODO Auto-generated method stub - return userMapper.insertimg(img); - } + @Override + public User getUsers(String email) { + // TODO Auto-generated method stub + return userMapper.getUsers(email); + } - @Override - public Integer change(User user) { - // TODO Auto-generated method stub - return userMapper.change(user); - } + @Override + public Integer insertimg(Images img) { + // TODO Auto-generated method stub + return userMapper.insertimg(img); + } - @Override - public Integer checkUsername(String username) { - // TODO Auto-generated method stub - return userMapper.checkUsername(username); - } + @Override + public Integer change(User user) { + // TODO Auto-generated method stub + return userMapper.change(user); + } - @Override - public Integer getUserTotal() { - // TODO Auto-generated method stub - return userMapper.getUserTotal(); - } + @Override + public Integer checkUsername(String username) { + // TODO Auto-generated method stub + return userMapper.checkUsername(username); + } + @Override + public Integer getUserTotal() { + // TODO Auto-generated method stub + return userMapper.getUserTotal(); + } + + @Override + public Integer deleuser(Integer id) { + return userMapper.deleuser(id); + } + + @Override + public Integer countusername(String username) { + return userMapper.countusername(username); + } + + @Override + public Integer countmail(String email) { + return userMapper.countmail(email); + } + + @Override + public List getuserlist() { + return userMapper.getuserlist(); + } + + @Override + public Integer uiduser(String uid) { + return userMapper.uiduser(uid); + } + + @Override + public User getUsersMail(String uid) { + return userMapper.getUsersMail(uid); + } } diff --git a/src/main/java/cn/hellohao/test/MyAuthenticator.java b/src/main/java/cn/hellohao/test/MyAuthenticator.java new file mode 100644 index 0000000..f1aacd9 --- /dev/null +++ b/src/main/java/cn/hellohao/test/MyAuthenticator.java @@ -0,0 +1,23 @@ +package cn.hellohao.test; + +import javax.mail.Authenticator; +import javax.mail.PasswordAuthentication; +import java.net.InetAddress; + +public class MyAuthenticator extends Authenticator { + /*鍦ㄤ娇鐢ˋuthenticator杩欎釜鎶借薄绫绘椂锛屾垜浠繀椤婚噰鐢ㄧ户鎵胯鎶借薄绫荤殑鏂瑰紡锛屽苟涓旇缁ф壙绫诲繀椤诲叿 + * 鏈夎繑鍥濸asswordAuthentication瀵硅薄锛堢敤浜庡瓨鍌ㄨ璇佹椂瑕佺敤鍒扮殑鐢ㄦ埛鍚嶃佸瘑鐮侊級getPasswordAuthentication() + * 鏂规硶銆傚苟涓旇鍦⊿ession涓繘琛屾敞鍐岋紝浣縎ession鑳藉浜嗚В鍦ㄨ璇佹椂璇ヤ娇鐢ㄥ摢涓被銆 + * */ + public static void main(String[] args) throws Exception { + //鑾峰彇鏈満鐨刬p鍦板潃鍜屽煙鍚 + InetAddress ia = InetAddress.getLocalHost(); + System.out.println(ia.toString()); + System.out.println(ia.getHostName());//鍩熷悕 127 + System.out.println(ia.getHostAddress());//ip鍦板潃 192.168.201.254 + + + } + + +} \ No newline at end of file diff --git a/src/main/java/cn/hellohao/test/Task2.java b/src/main/java/cn/hellohao/test/Task2.java index 9b2750c..3bc12de 100644 --- a/src/main/java/cn/hellohao/test/Task2.java +++ b/src/main/java/cn/hellohao/test/Task2.java @@ -1 +1 @@ -package cn.hellohao.test; import com.alibaba.fastjson.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.*; /** * * 浜庣涓绉嶆柟寮忕浉姣旓紝浼樺娍 1>褰撳惎鍔ㄥ拰鍘诲彇娑堜换鍔℃椂鍙互鎺у埗 2>绗竴娆℃墽琛屼换鍔℃椂鍙互鎸囧畾浣犳兂瑕佺殑delay鏃堕棿 * * 鍦ㄥ疄鐜版椂锛孴imer绫诲彲浠ヨ皟搴︿换鍔★紝TimerTask鍒欐槸閫氳繃鍦╮un()鏂规硶閲屽疄鐜板叿浣撲换鍔° Timer瀹炰緥鍙互璋冨害澶氫换鍔★紝瀹冩槸绾跨▼瀹夊叏鐨勩 * 褰揟imer鐨勬瀯閫犲櫒琚皟鐢ㄦ椂锛屽畠鍒涘缓浜嗕竴涓嚎绋嬶紝杩欎釜绾跨▼鍙互鐢ㄦ潵璋冨害浠诲姟銆 涓嬮潰鏄唬鐮侊細 * * @author GT * */ public class Task2 { public static void main(String[] args) { TimerTask task = new TimerTask() { Map map = new HashMap(); @Override public void run() { // task to run goes here //System.out.println("Hello !!!"); String url = "http://ip.360.cn/IPShare/info"; String json = loadJSON(url); //System.out.println(json); JSONObject pa=JSONObject.parseObject(json); //System.out.println(pa.getString("ip")); map.put(pa.getString("ip"),5); List> li = getKeyBySameValue(map); Integer count = 0; for (int i = 0;i30){ System.out.println("鎮ㄥ凡缁忚闄愬埗锛"); } } } }; Timer timer = new Timer(); long delay = 0; long intevalPeriod = 5 * 1000; // schedules the task to be run in an interval timer.scheduleAtFixedRate(task, delay, intevalPeriod); } // end of main //鑾峰彇鏈満ip public static String loadJSON(String url) { StringBuilder json = new StringBuilder(); try { URL oracle = new URL(url); URLConnection yc = oracle.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader( yc.getInputStream(),"utf-8"));//闃叉涔辩爜 String inputLine = null; while ((inputLine = in.readLine()) != null) { json.append(inputLine); } in.close(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return json.toString(); } public static List> getKeyBySameValue(Map map){ Map values = new HashMap(); List list; Iterator iterator = map.keySet().iterator(); while (iterator.hasNext()) { Object key = iterator.next(); Object value = map.get(key); if (map.containsValue(value)) { if (values.containsKey(value)) { list = (List) values.get(value); } else { list = new ArrayList(); } list.add(key); values.put(value, list); } } iterator = values.keySet().iterator(); Map newMap = new HashMap<>(); while (iterator.hasNext()) { Object value = iterator.next(); List result = (List) values.get(value); if (result.size() > 1) { System.out.println("value :" + value + " -> keys:" + result.toString()); } newMap.put(value,result.toString()); } List> returnList = new ArrayList<>(newMap.entrySet()); return returnList; } } \ No newline at end of file +package cn.hellohao.test; import com.alibaba.fastjson.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.*; /** * 浜庣涓绉嶆柟寮忕浉姣旓紝浼樺娍 1>褰撳惎鍔ㄥ拰鍘诲彇娑堜换鍔℃椂鍙互鎺у埗 2>绗竴娆℃墽琛屼换鍔℃椂鍙互鎸囧畾浣犳兂瑕佺殑delay鏃堕棿 *

    * 鍦ㄥ疄鐜版椂锛孴imer绫诲彲浠ヨ皟搴︿换鍔★紝TimerTask鍒欐槸閫氳繃鍦╮un()鏂规硶閲屽疄鐜板叿浣撲换鍔° Timer瀹炰緥鍙互璋冨害澶氫换鍔★紝瀹冩槸绾跨▼瀹夊叏鐨勩 * 褰揟imer鐨勬瀯閫犲櫒琚皟鐢ㄦ椂锛屽畠鍒涘缓浜嗕竴涓嚎绋嬶紝杩欎釜绾跨▼鍙互鐢ㄦ潵璋冨害浠诲姟銆 涓嬮潰鏄唬鐮侊細 * * @author GT */ public class Task2 { public static void main(String[] args) { TimerTask task = new TimerTask() { Map map = new HashMap(); @Override public void run() { // task to run goes here //System.out.println("Hello !!!"); String url = "http://ip.360.cn/IPShare/info"; String json = loadJSON(url); //System.out.println(json); JSONObject pa = JSONObject.parseObject(json); //System.out.println(pa.getString("ip")); map.put(pa.getString("ip"), 5); List> li = getKeyBySameValue(map); Integer count = 0; for (int i = 0; i < li.size(); i++) { System.out.println(li.get(i).getKey()); Integer a = Integer.parseInt(String.valueOf(li.get(i).getKey())); count = count + a; if (count > 30) { System.out.println("鎮ㄥ凡缁忚闄愬埗锛"); } } } }; Timer timer = new Timer(); long delay = 0; long intevalPeriod = 5 * 1000; // schedules the task to be run in an interval timer.scheduleAtFixedRate(task, delay, intevalPeriod); } // end of main //鑾峰彇鏈満ip public static String loadJSON(String url) { StringBuilder json = new StringBuilder(); try { URL oracle = new URL(url); URLConnection yc = oracle.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader( yc.getInputStream(), "utf-8"));//闃叉涔辩爜 String inputLine = null; while ((inputLine = in.readLine()) != null) { json.append(inputLine); } in.close(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return json.toString(); } public static List> getKeyBySameValue(Map map) { Map values = new HashMap(); List list; Iterator iterator = map.keySet().iterator(); while (iterator.hasNext()) { Object key = iterator.next(); Object value = map.get(key); if (map.containsValue(value)) { if (values.containsKey(value)) { list = (List) values.get(value); } else { list = new ArrayList(); } list.add(key); values.put(value, list); } } iterator = values.keySet().iterator(); Map newMap = new HashMap<>(); while (iterator.hasNext()) { Object value = iterator.next(); List result = (List) values.get(value); if (result.size() > 1) { System.out.println("value :" + value + " -> keys:" + result.toString()); } newMap.put(value, result.toString()); } List> returnList = new ArrayList<>(newMap.entrySet()); return returnList; } } \ No newline at end of file diff --git a/src/main/java/cn/hellohao/test/alioss.java b/src/main/java/cn/hellohao/test/alioss.java new file mode 100644 index 0000000..2452c9a --- /dev/null +++ b/src/main/java/cn/hellohao/test/alioss.java @@ -0,0 +1,87 @@ +package cn.hellohao.test; + +import com.aliyun.oss.OSSClient; +import com.aliyun.oss.common.utils.BinaryUtil; +import com.aliyun.oss.model.ObjectMetadata; + +import java.io.ByteArrayInputStream; +import java.io.FileInputStream; +import java.io.InputStream; +import java.net.URL; +import java.util.Date; + +public class alioss { + //涓婁紶鏂囦欢 +public static void shangchuan() throws Exception{ + // Endpoint浠ユ澀宸炰负渚嬶紝鍏跺畠Region璇锋寜瀹為檯鎯呭喌濉啓銆 + String endpoint = "http://oss-cn-beijing.aliyuncs.com"; + // 闃块噷浜戜富璐﹀彿AccessKey鎷ユ湁鎵鏈堿PI鐨勮闂潈闄愶紝椋庨櫓寰堥珮銆傚己鐑堝缓璁偍鍒涘缓骞朵娇鐢≧AM璐﹀彿杩涜API璁块棶鎴栨棩甯歌繍缁达紝璇风櫥褰 https://ram.console.aliyun.com 鍒涘缓RAM璐﹀彿銆 + String accessKeyId = "LTAI0Yd6Li0VxrUF"; + String accessKeySecret = "F2ZuDMq0IYefvVDKyfJLpRNzXldci9"; + String bucketName = "hellohao"; + //String objectName = "hellohao.png"; +//璁剧疆Header + ObjectMetadata meta = new ObjectMetadata(); + meta.setHeader("Content-Type", "image/jpeg");//image/jpeg + meta.setHeader("Content-Disposition", "inline"); + +// 鍒涘缓OSSClient瀹炰緥銆 + OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret); + +// 涓婁紶鏂囦欢娴併 + InputStream inputStream = new FileInputStream("D:\\妗岄潰\\璧勬枡\\TouXiang.png"); + //ossClient.putObject(bucketName, "test/TouXiang.png", inputStream,meta); + ossClient.deleteObject(bucketName, "test/TouXiang.png"); +// 鍏抽棴OSSClient銆 + ossClient.shutdown(); +} + + public static void main(String[] args) throws Exception{ + alioss.shangchuan(); + //image/jpeg + } + + + public void settou(){ + + // Endpoint浠ユ澀宸炰负渚嬶紝鍏跺畠Region璇锋寜瀹為檯鎯呭喌濉啓銆 + String endpoint = "http://oss-cn-beijing.aliyuncs.com"; +// 闃块噷浜戜富璐﹀彿AccessKey鎷ユ湁鎵鏈堿PI鐨勮闂潈闄愶紝椋庨櫓寰堥珮銆傚己鐑堝缓璁偍鍒涘缓骞朵娇鐢≧AM璐﹀彿杩涜API璁块棶鎴栨棩甯歌繍缁达紝璇风櫥褰 https://ram.console.aliyun.com 鍒涘缓RAM璐﹀彿銆 + String accessKeyId = "LTAI0Yd6Li0VxrUF"; + String accessKeySecret = "F2ZuDMq0IYefvVDKyfJLpRNzXldci9"; + + //String content = "hellohao"; + +// 鍒涘缓涓婁紶鏂囦欢鐨勫厓淇℃伅锛屽彲浠ラ氳繃鏂囦欢鍏冧俊鎭缃瓾TTP header銆 + ObjectMetadata meta = new ObjectMetadata(); + + //String md5 = BinaryUtil.toBase64String(BinaryUtil.calculateMd5(content.getBytes())); +// 寮鍚枃浠跺唴瀹筂D5鏍¢獙銆傚紑鍚悗OSS浼氭妸鎮ㄦ彁渚涚殑MD5涓庢枃浠剁殑MD5姣旇緝锛屼笉涓鑷村垯鎶涘嚭寮傚父銆 + //meta.setContentMD5(md5); +// 鎸囧畾涓婁紶鐨勫唴瀹圭被鍨嬨傚唴瀹圭被鍨嬪喅瀹氭祻瑙堝櫒灏嗕互浠涔堝舰寮忋佷粈涔堢紪鐮佽鍙栨枃浠躲傚鏋滄病鏈夋寚瀹氬垯鏍规嵁鏂囦欢鐨勬墿灞曞悕鐢熸垚锛屽鏋滄病鏈夋墿灞曞悕鍒欎负榛樿鍊糰pplication/octet-stream銆 + meta.setContentType("text/plain"); +// 璁剧疆鍐呭琚笅杞芥椂鐨勫悕绉般 + meta.setContentDisposition("attachment; filename=\"DownloadFilename\""); +// 璁剧疆涓婁紶鏂囦欢鐨勯暱搴︺傚瓒呰繃姝ら暱搴︼紝鍒欎細琚埅鏂紝涓鸿缃殑闀垮害銆傚涓嶈冻锛屽垯涓轰笂浼犳枃浠剁殑瀹為檯闀垮害銆 + //meta.setContentLength(content.length()); +// 璁剧疆鍐呭琚笅杞芥椂缃戦〉鐨勭紦瀛樿涓恒 + meta.setCacheControl("Download Action"); +// 璁剧疆缂撳瓨杩囨湡鏃堕棿锛屾牸寮忔槸鏍兼灄濞佹不鏃堕棿锛圙MT锛夈 + //meta.setExpirationTime(DateUtil.parseIso8601Date("2022-10-12T00:00:00.000Z")); +// 璁剧疆鍐呭琚笅杞芥椂鐨勭紪鐮佹牸寮忋 + meta.setContentEncoding("utf-8"); +// 璁剧疆header銆 + meta.setHeader("", ""); +// 鍒涘缓OSSClient瀹炰緥銆 + OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret); + +// 涓婁紶鏂囦欢銆 + //ossClient.putObject("", "", new ByteArrayInputStream(content.getBytes()), meta); + +// 鍏抽棴OSSClient銆 + ossClient.shutdown(); + } + +} + + diff --git a/src/main/java/cn/hellohao/test/asdf.java b/src/main/java/cn/hellohao/test/asdf.java index 1b62abb..fe5105b 100644 --- a/src/main/java/cn/hellohao/test/asdf.java +++ b/src/main/java/cn/hellohao/test/asdf.java @@ -1 +1 @@ -package cn.hellohao.test; import java.io.IOException; import java.util.Scanner; public class asdf { public static void main(String[] args) { // TODO Auto-generated method stub try {long start = System.currentTimeMillis();Process process = Runtime.getRuntime().exec(new String[] {"wmic","cpu","get","ProcessorId"});process.getOutputStream().close();Scanner sc = new Scanner(process.getInputStream());String property = sc.next();String serial = sc.next();System.out.println(property +":"+ serial);System.out.println("time:"+ (System.currentTimeMillis() - start)); } catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace(); } } } \ No newline at end of file +package cn.hellohao.test; import java.io.*; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; /** * @program: email-demo * @description: * @author: smallsoup * @create: 2019-01-27 16:44 **/ public class asdf { public static void main(String[] a) { try { URL url = new URL("https://v1.hitokoto.cn/"); BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream())); //BufferedWriter writer=new BufferedWriter(new FileWriter("index.html")); String str = ""; String line; while ((line = reader.readLine()) != null) { str = line; System.out.println(str); } reader.close(); //writer.close(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } \ No newline at end of file diff --git a/src/main/java/cn/hellohao/test/geshihuashijian.java b/src/main/java/cn/hellohao/test/geshihuashijian.java new file mode 100644 index 0000000..7485231 --- /dev/null +++ b/src/main/java/cn/hellohao/test/geshihuashijian.java @@ -0,0 +1,32 @@ +package cn.hellohao.test; + +import org.springframework.util.DigestUtils; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.UUID; + +public class geshihuashijian { + + //鐩愶紝鐢ㄤ簬娣蜂氦md5 + private static final String slat = "&%5123***&&%%$$#@"; + + public static String getMD5(String str) { + String base = str +"/"+slat; + String md5 = DigestUtils.md5DigestAsHex(base.getBytes()); + return md5; + } + + public static void main(String[] args) { + Date d = new Date(); + System.out.println(DateFormat.getDateInstance().format(d)); + String uid = UUID.randomUUID().toString().replace("-", "").toLowerCase().substring(0,5); + java.text.DateFormat format1 = new java.text.SimpleDateFormat("MMddhhmmss"); + String s = format1.format(new Date()); + + SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd"); + System.out.println(uid+s); + System.out.println("涓ゅぉ鍓嶇殑鏃ユ湡锛" + df.format(new Date(d.getTime() - 2 * 24 * 60 * 60 * 1000))); + } +} diff --git a/src/main/java/cn/hellohao/test/imgsh.java b/src/main/java/cn/hellohao/test/imgsh.java new file mode 100644 index 0000000..8b6bb47 --- /dev/null +++ b/src/main/java/cn/hellohao/test/imgsh.java @@ -0,0 +1,75 @@ +package cn.hellohao.test; + +import com.baidu.aip.contentcensor.AipContentCensor; +import com.baidu.aip.contentcensor.EImgType; +import org.json.JSONObject; + +public class imgsh { + //璁剧疆APPID/AK/SK + private static final String APP_ID = "15434135"; + private static final String API_KEY = "yDdHaeMf0FfFAxupXFkoxoPG"; + private static final String SECRET_KEY = "QGRXTy8QNDMr0dWuWS6bj7rNcwtEddKe"; + + private imgsh() { + } + + ; + + private static AipContentCensor client = new AipContentCensor(APP_ID, API_KEY, SECRET_KEY); + + public static AipContentCensor getConn() { + client.setConnectionTimeoutInMillis(2000); + client.setSocketTimeoutInMillis(60000); + return client; + } + + private static AipContentCensor chushihua() { + // 鍒濆鍖栦竴涓狝ipImageCensor + AipContentCensor client = new AipContentCensor(APP_ID, API_KEY, SECRET_KEY); + //AipImageCensor client = new AipImageCensor(APP_ID, API_KEY, SECRET_KEY); + + // 鍙夛細璁剧疆缃戠粶杩炴帴鍙傛暟 + client.setConnectionTimeoutInMillis(2000); + client.setSocketTimeoutInMillis(60000); + + // 鍙夛細璁剧疆浠g悊鏈嶅姟鍣ㄥ湴鍧, http鍜宻ocket浜岄変竴锛屾垨鑰呭潎涓嶈缃 + //client.setHttpProxy("proxy_host", proxy_port); // 璁剧疆http浠g悊 + //client.setSocketProxy("proxy_host", proxy_port); // 璁剧疆socket浠g悊 + + // 鍙夛細璁剧疆log4j鏃ュ織杈撳嚭鏍煎紡锛岃嫢涓嶈缃紝鍒欎娇鐢ㄩ粯璁ら厤缃 + // 涔熷彲浠ョ洿鎺ラ氳繃jvm鍚姩鍙傛暟璁剧疆姝ょ幆澧冨彉閲 + //System.setProperty("aip.log4j.conf", "path/to/your/log4j.properties"); + +// // 璋冪敤鎺ュ彛 +// String path = "test.jpg"; +// JSONObject res = client.antiPorn(path); +// System.out.println(res.toString(2)); + return client; + } + + public static void main(String[] args) { + AipContentCensor client = chushihua(); + sample(client); + + + } + + public static void sample(AipContentCensor client) { +// // 鍙傛暟涓烘湰鍦板浘鐗囪矾寰 +// String path = "test.jpg"; + // JSONObject response = client.imageCensorUserDefined(path, EImgType.FILE, null); +// System.out.println(response.toString()); + + // 鍙傛暟涓簎rl + //String url = "https://hellohao.nos-eastchina1.126.net/BlogImg/%E8%BF%99%E6%98%AF%E6%B5%8B%E8%AF%95%E6%96%87%E4%BB%B6%E5%A4%B9/huang.png"; + String url = "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=4225605092,1601815977&fm=26&gp=0.jpg"; + JSONObject res = client.antiPorn(url); + res = client.imageCensorUserDefined(url, EImgType.URL, null); + System.out.println(res.toString()); + +// // 鍙傛暟涓烘湰鍦板浘鐗囨枃浠朵簩杩涘埗鏁扮粍 +// byte[] file = readImageFile(imagePath); +// response = client.imageCensorUserDefined(file, null); +// System.out.println(response.toString()); + } +} diff --git a/src/main/java/cn/hellohao/test/jsontest.java b/src/main/java/cn/hellohao/test/jsontest.java new file mode 100644 index 0000000..2cc2439 --- /dev/null +++ b/src/main/java/cn/hellohao/test/jsontest.java @@ -0,0 +1,24 @@ +package cn.hellohao.test; + + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +import java.util.Map; + +public class jsontest { + public static void main(String[] args) { + String str = "[{\"conclusion\":\"涓嶅悎瑙刓",\"log_id\":15574879277703875,\"data\":[{\"msg\":\"瀛樺湪鑹叉儏鍐呭\",\"probability\":1,\"type\":1}],\"conclusionType\":2}]\n"; + + JSONArray jsonArray = JSON.parseArray(str); + for (Object o : jsonArray) { + JSONObject jsonObject = (JSONObject) o; + JSONArray data = jsonObject.getJSONArray("data"); + for (Object datum : data) { + JSONObject aaa = (JSONObject) datum; + System.out.println(aaa.getString("msg")); + } + } + } +} diff --git a/src/main/java/cn/hellohao/utils/ImageReview.java b/src/main/java/cn/hellohao/utils/ImageReview.java new file mode 100644 index 0000000..3c814bf --- /dev/null +++ b/src/main/java/cn/hellohao/utils/ImageReview.java @@ -0,0 +1,96 @@ +package cn.hellohao.utils; + +import cn.hellohao.pojo.Imgreview; +import cn.hellohao.pojo.Keys; +import cn.hellohao.service.ImgreviewService; +import cn.hellohao.service.impl.ImgServiceImpl; +import cn.hellohao.service.impl.ImgreviewServiceImpl; +import com.alibaba.fastjson.JSON; +import com.baidu.aip.contentcensor.AipContentCensor; +import com.baidu.aip.contentcensor.EImgType; +import org.json.JSONObject; +import org.springframework.stereotype.Component; + +import java.util.Map; + +@Component +public class ImageReview { + + //璁剧疆APPID/AK/SK +// private static final String APP_ID = "15434135"; +// private static final String API_KEY = "yDdHaeMf0FfFAxupXFkoxoPG"; +// private static final String SECRET_KEY = "QGRXTy8QNDMr0dWuWS6bj7rNcwtEddKe"; + private static AipContentCensor client; + + private ImageReview() { + } + + + private static void Initializes(Imgreview imgreview) { + client = new AipContentCensor(imgreview.getAppId(), imgreview.getApiKey(), imgreview.getSecretKey()); + client.setConnectionTimeoutInMillis(2000); + client.setSocketTimeoutInMillis(60000); + } + + //寮濮嬭皟鐢ㄩ壌榛勩 + public static void imgJB(Map imgmap, String requestAddress, Keys key, Imgreview imgreview) { + ImgServiceImpl imgService = SpringContextHolder.getBean(ImgServiceImpl.class); + ImgreviewServiceImpl imgreviewService = SpringContextHolder.getBean(ImgreviewServiceImpl.class); + ImageReview.Initializes(imgreview); + //閬嶅巻map,鑾峰彇閲岃竟鐨刱ey锛堝浘鐗囧湴鍧锛 + for (Map.Entry entry : imgmap.entrySet()) { + System.out.println("姝e湪閴村畾鐨勫浘鐗囷細" + entry.getKey()); + JSONObject res = client.antiPorn(entry.getKey()); + res = client.imageCensorUserDefined("http://" + entry.getKey(), EImgType.URL, null); + + com.alibaba.fastjson.JSONArray jsonArray = JSON.parseArray("[" + res.toString() + "]"); + for (Object o : jsonArray) { + com.alibaba.fastjson.JSONObject jsonObject = (com.alibaba.fastjson.JSONObject) o; + com.alibaba.fastjson.JSONArray data = jsonObject.getJSONArray("data"); + Integer conclusionType = jsonObject.getInteger("conclusionType"); + if (conclusionType == 2) { + for (Object datum : data) { + com.alibaba.fastjson.JSONObject imgdata = (com.alibaba.fastjson.JSONObject) datum; + if (imgdata.getInteger("type") == 1) { + //鏍囪鍥剧墖 + String imgname = SetText.getSubString(entry.getKey(), requestAddress, ""); + Integer ret = imgService.deleimgname(imgname); //鍒犻櫎鏁版嵁搴撳浘鐗囦俊鎭 + //Imgreview imgreview1 =imgreviewService.selectByPrimaryKey(1); + Imgreview imgreview1 = new Imgreview(); + imgreview1.setId(1); + Integer count = imgreview.getCount(); + System.out.println("鎬绘暟锛" + count); + imgreview1.setCount(count + 1); + imgreviewService.updateByPrimaryKeySelective(imgreview1); + + if(key.getStorageType()==1){ + imgService.delect(key, imgname); + }else if (key.getStorageType()==2){ + imgService.delectOSS(key, imgname); + }else if(key.getStorageType()==3){ + //鍒濆鍖栬吘璁簯 + }else if(key.getStorageType()==4){ + //鍒濆鍖栦竷鐗涗簯 + }else{ + System.err.println("鏈幏鍙栧埌瀵硅薄瀛樺偍鍙傛暟锛屼笂浼犲け璐ャ"); + } + + if (ret == 1) { + System.out.println("瀛樺湪鑹叉儏鍥剧墖锛屽垹闄ゆ垚鍔熴"); + } else { + System.out.println("瀛樺湪鑹叉儏鍥剧墖锛屽垹闄ゅけ璐"); + } + } + + } + } + + } + + + + } + } + + +} diff --git a/src/main/java/cn/hellohao/utils/SendEmail.java b/src/main/java/cn/hellohao/utils/SendEmail.java new file mode 100644 index 0000000..e6a5b5f --- /dev/null +++ b/src/main/java/cn/hellohao/utils/SendEmail.java @@ -0,0 +1,103 @@ +package cn.hellohao.utils; + +import cn.hellohao.pojo.EmailConfig; +import cn.hellohao.service.EmailConfigService; +import cn.hellohao.test.asdf; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.mail.*; +import javax.mail.internet.AddressException; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.util.Properties; + +public class SendEmail { + // 鍙戜欢浜 璐﹀彿鍜屽瘑鐮 +// private static String MY_EMAIL_NAME = "Hellohao鍥惧簥"; +// private static String MY_EMAIL_ACCOUNT = "helloshihao@163.com"; +// private static String MY_EMAIL_PASSWORD = "hellohao950504";// 瀵嗙爜,鏄綘鑷繁鐨勮缃殑鎺堟潈鐮 +// // SMTP鏈嶅姟鍣(杩欓噷鐢ㄧ殑163 SMTP鏈嶅姟鍣) +// public static String MEAIL_163_SMTP_HOST = "smtp.163.com"; +// public static String SMTP_163_PORT = "25";// 绔彛鍙,杩欎釜鏄163浣跨敤鍒扮殑;QQ鐨勫簲璇ユ槸465鎴栬875 + + public static MimeMessage Emails(EmailConfig emailConfig) { + Properties p = new Properties(); + p.setProperty("mail.smtp.host", emailConfig.getEmailurl()); + p.setProperty("mail.smtp.port", emailConfig.getPort()); + p.setProperty("mail.smtp.socketFactory.port", emailConfig.getPort()); + p.setProperty("mail.smtp.auth", "true"); + p.setProperty("mail.smtp.socketFactory.class", "SSL_FACTORY"); + + Session session = Session.getInstance(p, new Authenticator() { + // 璁剧疆璁よ瘉璐︽埛淇℃伅 + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(emailConfig.getEmails(), emailConfig.getEmailkey()); + } + }); + session.setDebug(true); + MimeMessage message = new MimeMessage(session); + System.err.println("閭欢鍒濆鍖栧畬鎴"); + return message; + } + + public static Integer sendEmail(MimeMessage message, String username, String Url, String email,EmailConfig emailConfig) { + String body = "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + "

    \n" + + "
    \n" + + "
    \n" + + "
    \n" + + " 璐﹀彿婵娲 \n" + + " \n" + + "
    \n" + + " \n" + + " \n" + + " \n" + + "
    \n" + + "
    \n" + + "
    \n" + + "
    \n" + + "
    鎮ㄦ鍦ㄦ敞鍐孒ellohao鍥惧簥
    \n" + + "

    鐐瑰嚮  婵娲婚摼鎺  杩涜璐﹀彿婵娲

    \n" + + "
    \n" + + "
    \n" + + "
    \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + try { + // 鍙戜欢浜 + message.setFrom(new InternetAddress(emailConfig.getEmails(), emailConfig.getEmailname(), "UTF-8")); + // 鏀朵欢浜哄拰鎶勯佷汉 + message.setRecipients(Message.RecipientType.TO, email); + // 鍐呭(杩欎釜鍐呭杩樹笉鑳戒贡鍐,鏈夊彲鑳戒細琚玈MTP鎷掔粷鎺;澶氳瘯鍑犳鍚) + message.setSubject(emailConfig.getEmailname()+"璐﹀彿婵娲");//鏍囬 + message.setContent(body, "text/html;charset=UTF-8");//鍐呭 + message.setSentDate(new Date()); + message.saveChanges(); + System.out.println("鍑嗗鍙戦"); + Transport.send(message); + return 1; + } catch (MessagingException e) { + e.printStackTrace(); + return 0; + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + return 0; + } + } + + +} diff --git a/src/main/java/cn/hellohao/utils/Sentence.java b/src/main/java/cn/hellohao/utils/Sentence.java new file mode 100644 index 0000000..2001594 --- /dev/null +++ b/src/main/java/cn/hellohao/utils/Sentence.java @@ -0,0 +1,38 @@ +package cn.hellohao.utils; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; + +public class Sentence { + + /** + * 鏍规嵁URL璇锋眰json鏁版嵁 + * + * @return //parm锛氳姹傜殑url閾炬帴 杩斿洖鐨勬槸json瀛楃涓 + */ + public static String getURLContent() { + String str = ""; + try { + URL url = new URL("https://v1.hitokoto.cn/"); + BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream())); + //BufferedWriter writer=new BufferedWriter(new FileWriter("index.html")); + String line; + while ((line = reader.readLine()) != null) { + str += line; + //System.out.println(str); + } + reader.close(); + + //writer.close(); + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return str; + } +} diff --git a/src/main/java/cn/hellohao/utils/SetText.java b/src/main/java/cn/hellohao/utils/SetText.java new file mode 100644 index 0000000..fbef67d --- /dev/null +++ b/src/main/java/cn/hellohao/utils/SetText.java @@ -0,0 +1,24 @@ +package cn.hellohao.utils; + +public class SetText { + public static String getSubString(String text, String left, String right) { + String result = ""; + int zLen; + if (left == null || left.isEmpty()) { + zLen = 0; + } else { + zLen = text.indexOf(left); + if (zLen > -1) { + zLen += left.length(); + } else { + zLen = 0; + } + } + int yLen = text.indexOf(right, zLen); + if (yLen < 0 || right == null || right.isEmpty()) { + yLen = text.length(); + } + result = text.substring(zLen, yLen); + return result; + } +} diff --git a/src/main/java/cn/hellohao/utils/SpringContextHolder.java b/src/main/java/cn/hellohao/utils/SpringContextHolder.java new file mode 100644 index 0000000..a7736da --- /dev/null +++ b/src/main/java/cn/hellohao/utils/SpringContextHolder.java @@ -0,0 +1,46 @@ +package cn.hellohao.utils; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +/** + * Spring鐨凙pplicationContext鐨勬寔鏈夎,鍙互鐢ㄩ潤鎬佹柟娉曠殑鏂瑰紡鑾峰彇spring瀹瑰櫒涓殑bean + * + * @author yj + * @date 2018骞5鏈27鏃 涓嬪崍6:32:11 + */ +@Component +public class SpringContextHolder implements ApplicationContextAware { + + private static ApplicationContext applicationContext; + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + SpringContextHolder.applicationContext = applicationContext; + } + + public static ApplicationContext getApplicationContext() { + assertApplicationContext(); + return applicationContext; + } + + @SuppressWarnings("unchecked") + public static T getBean(String beanName) { + assertApplicationContext(); + return (T) applicationContext.getBean(beanName); + } + + public static T getBean(Class requiredType) { + assertApplicationContext(); + return applicationContext.getBean(requiredType); + } + + private static void assertApplicationContext() { + if (SpringContextHolder.applicationContext == null) { + throw new RuntimeException("applicaitonContext灞炴т负null,璇锋鏌ユ槸鍚︽敞鍏ヤ簡SpringContextHolder!"); + } + } + +} \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index ebd9367..0c1494f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,17 +1,23 @@ #spring.profiles.active=prod +server.port=8088 mybatis.configuration.map-underscore-to-camel-case=true mybatis.mapper-locations=classpath:mapper/*.xml - logging.level.cn.hellohao.dao=debug - spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.time-zone=GMT+8 - -spring.datasource.username=root -spring.datasource.password=root -spring.datasource.url=jdbc:mysql://localhost:3306/picturebed +spring.datasource.username=picturebed +spring.datasource.password=hellohao +#spring.datasource.username=root +#spring.datasource.password=root +#spring.datasource.url=jdbc:mysql://localhost:3306/picturebed?useUnicode=true&characterEncoding=utf8 +spring.datasource.url=jdbc:mysql://hellohao.cn:3306/picturebed?useUnicode=true&characterEncoding=utf8 spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.type=com.alibaba.druid.pool.DruidDataSource +spring.thymeleaf.cache=false +spring.thymeleaf.mode=LEGACYHTML5 +spring.http.multipart.location=/data/upload_tmp +multipart.maxFileSize=10240KB +multipart.maxRequestSize=10240KB diff --git a/src/main/resources/mapper/ConfigMapper.xml b/src/main/resources/mapper/ConfigMapper.xml new file mode 100644 index 0000000..5a43b0f --- /dev/null +++ b/src/main/resources/mapper/ConfigMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + UPDATE config + + + sourcekey = #{sourcekey}, + + + emails = #{emails}, + + + webname = #{webname}, + + + `explain` = #{explain}, + + + `logos` = #{logos}, + + + `footed` = #{footed}, + + + `links` = #{links}, + + + `notice` = #{notice}, + + + `baidu` = #{baidu} + + + where id=1 + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/EmailConfigMapper.xml b/src/main/resources/mapper/EmailConfigMapper.xml new file mode 100644 index 0000000..f64f7b8 --- /dev/null +++ b/src/main/resources/mapper/EmailConfigMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + UPDATE emailconfig + + + emails = #{emails}, + + + emailkey = #{emailkey}, + + + emailurl = #{emailurl}, + + + `port` = #{port}, + + + `emailname` = #{emailname}, + + + `using` = #{using}, + + + WHERE + id = 1 + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/ImgMapper.xml b/src/main/resources/mapper/ImgMapper.xml index 801a43e..ab8cdf9 100644 --- a/src/main/resources/mapper/ImgMapper.xml +++ b/src/main/resources/mapper/ImgMapper.xml @@ -4,37 +4,64 @@ - - - - DELETE FROM imgdata WHERE id=#{id} - + + + + DELETE FROM imgdata WHERE id=#{id} + - - - + select * from imgdata where id = #{id} + - - + + + + + UPDATE imgdata set abnormal=1 where imgname=#{imgname} + + + + DELETE FROM imgdata WHERE imgname=#{imgname} + + + + + DELETE FROM imgdata WHERE id = #{id} + + + \ No newline at end of file diff --git a/src/main/resources/mapper/ImgreviewMapper.xml b/src/main/resources/mapper/ImgreviewMapper.xml new file mode 100644 index 0000000..19205a8 --- /dev/null +++ b/src/main/resources/mapper/ImgreviewMapper.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + id, app_id, api_key, secret_key, `Using`,`count` + + + + + delete from imgreview + where id = #{id,jdbcType=INTEGER} + + + + insert into imgreview (app_id, api_key, secret_key, + `Using`,count) + values (#{appId,jdbcType=VARCHAR}, #{apiKey,jdbcType=VARCHAR}, #{secretKey,jdbcType=VARCHAR}, + #{using,jdbcType=INTEGER},#{count,jdbcType=INTEGER}) + + + + insert into imgreview + + + app_id, + + + api_key, + + + secret_key, + + + `Using`, + + + `count`, + + + + + #{appId,jdbcType=VARCHAR}, + + + #{apiKey,jdbcType=VARCHAR}, + + + #{secretKey,jdbcType=VARCHAR}, + + + #{using,jdbcType=INTEGER}, + + + #{count,jdbcType=INTEGER}, + + + + + + update imgreview + + + app_id = #{appId,jdbcType=VARCHAR}, + + + api_key = #{apiKey,jdbcType=VARCHAR}, + + + secret_key = #{secretKey,jdbcType=VARCHAR}, + + + `Using` = #{using,jdbcType=INTEGER}, + + + `count` = #{count,jdbcType=INTEGER}, + + + where id = #{id,jdbcType=INTEGER} + + + + update imgreview + set app_id = #{appId,jdbcType=VARCHAR}, + api_key = #{apiKey,jdbcType=VARCHAR}, + secret_key = #{secretKey,jdbcType=VARCHAR}, + `Using` = #{using,jdbcType=INTEGER}, + `count` = #{count,jdbcType=INTEGER} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/KeysMapper.xml b/src/main/resources/mapper/KeysMapper.xml index 9ffc6bc..dbaca4e 100644 --- a/src/main/resources/mapper/KeysMapper.xml +++ b/src/main/resources/mapper/KeysMapper.xml @@ -2,38 +2,25 @@ - - - INSERT INTO user (id, username, PASSWORD, email, birthder, LEVEL) - VALUES (NULL, #{username}, #{password}, #{email}, #{birthder}, #{level}) - - - - - UPDATE `keys` - SET AccessKey = #{AccessKey}, - AccessSecret = #{AccessSecret}, - Endpoint = #{Endpoint}, - Bucketname = #{Bucketname}, - RequestAddress = #{RequestAddress}, - storageType = #{storageType} - WHERE - id = 1 + + UPDATE `keys` + SET AccessKey = #{AccessKey}, + AccessSecret = #{AccessSecret}, + Endpoint = #{Endpoint}, + Bucketname = #{Bucketname}, + RequestAddress = #{RequestAddress} + WHERE + storageType = #{storageType} \ No newline at end of file diff --git a/src/main/resources/mapper/NoticeMapper.xml b/src/main/resources/mapper/NoticeMapper.xml new file mode 100644 index 0000000..366ce1f --- /dev/null +++ b/src/main/resources/mapper/NoticeMapper.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml index 5a0b50a..c2f32a0 100644 --- a/src/main/resources/mapper/UserMapper.xml +++ b/src/main/resources/mapper/UserMapper.xml @@ -4,47 +4,93 @@ - INSERT INTO user (id, username, PASSWORD, email, birthder, LEVEL) - VALUES (NULL, #{username}, #{password}, #{email}, #{birthder}, #{level}) + INSERT INTO user (id, username, PASSWORD, email, birthder, LEVEL,uid,isok) + VALUES (NULL, #{username}, #{password}, #{email}, #{birthder}, #{level},#{uid},#{isok} ) + + + + + + + + UPDATE `user` set `isok`=1 where uid=#{uid} + - + + + - INSERT INTO imgdata (id, imgname, imgurl, userid, updatetime,sizes) - VALUES (NULL, #{imgname}, #{imgurl}, #{userid}, NOW(),#{sizes}) + INSERT INTO imgdata (id, imgname, imgurl, userid, updatetime,sizes,abnormal,source) + VALUES (NULL, #{imgname}, #{imgurl}, #{userid}, #{updatetime},#{sizes},null,#{source}) - + - UPDATE `user` set username=#{username},`password`=#{password} where email=#{email} + + UPDATE `user` set `password`=#{password} where email=#{email} - + - + SELECT count(*) FROM `user` - + + + + + + DELETE FROM user WHERE id=#{id} + + \ No newline at end of file diff --git a/src/main/resources/static/layui/css/admin.css b/src/main/resources/static/layui/css/admin.css new file mode 100644 index 0000000..6b8f902 --- /dev/null +++ b/src/main/resources/static/layui/css/admin.css @@ -0,0 +1,599 @@ +/* ----- 澶撮儴鏍峰紡 ----- */ + +/* 鑳屾櫙棰滆壊銆侀珮搴︺佸簳閮ㄩ槾褰辩嚎 */ +.layui-layout-admin .layui-header { + background-color: #fff; + height: 50px; + box-shadow: 0 1px 0 0 rgba(0, 0, 0, .05); +} + +.layui-layout-admin .layui-header .layui-nav .layui-this:after, +.layui-layout-admin .layui-header .layui-nav-bar { + height: 2px; + background-color: #03152a; + top: 0 !important; +} + +/* 鎸夐挳棰滆壊銆侀棿璺濄佹偓娴皬鎵 */ +.layui-layout-admin .layui-header .layui-nav-item a { + color: #333333; + padding: 0 15px; + cursor: pointer; +} + +/* 鎸夐挳鎮诞鏃剁殑棰滆壊 */ +.layui-layout-admin .layui-header .layui-nav-item a:hover { + color: #333333; +} + +/* 椤堕儴瀵艰埅 logo 鏍峰紡 */ +.layui-layout-admin .layui-header .layui-logo { + width: 200px; + background-color: #324157; + color: #f2f2f2; + font-size: 18px; + font-family: Myriad Pro, Helvetica Neue, Arial, Helvetica, sans-serif; + font-weight: bold; + overflow: hidden; + line-height: 50px; + transition: all .3s; + white-space: nowrap; + box-shadow: 1px 0 2px 0 rgba(0, 0, 0, .05); +} + +/* 澶撮儴姘村钩灞呬腑 */ +.layui-layout-admin .layui-header .layui-nav .layui-nav-item { + line-height: 50px; + vertical-align: unset; +} + +.layui-layout-admin .layui-header .layui-nav-item .layui-icon { + font-size: 16px; +} + +.layui-layout-admin .layui-header .layui-logo img { + height: 35px; +} + +/* 闈㈠寘灞戞牱寮 */ +.layui-layout-admin .layui-header .layui-nav .layui-breadcrumb { + margin-left: 10px; +} + +.layui-nav-child { + top: 55px; +} + +.layui-layout-admin .layui-header .layui-nav { + padding: 0 10px; +} + +/* ----- 澶撮儴鏍峰紡 ----- */ + + +/* ----- tab 鏍峰紡 ----- */ + +/* tab 搴曡壊 */ +.layui-layout-admin .layui-tab .layui-tab-title li.layui-this, +.layui-layout-admin .layui-tab .layui-tab-title li:hover { + background-color: #f6f6f6; +} + +/* tab 涓嬪垝绾 */ +.layui-tab-title { + border-bottom-width: 0; +} + +/* 瀵艰埅鏈灏忓搴 */ +.layui-layout-admin .layui-tab .layui-tab-title li { + min-width: 0; + line-height: 40px; + max-width: 160px; + text-overflow: ellipsis; + padding-right: 30px; + overflow: hidden; + border-right: 1px solid #f6f6f6; + vertical-align: top; +} + +/* 鍏抽棴鎸夐挳鏍峰紡 */ +.layui-layout-admin .layui-tab > .layui-tab-title li .layui-tab-close { + width: 16px; + height: 16px; + line-height: 16px; + border-radius: 50%; + font-size: 12px; + position: absolute; + top: 12px; + right: 8px; +} + +/* tab 椤堕儴棰滆壊 */ +.layui-layout-admin .layui-tab-title li.layui-this:after { + width: 100%; + border: none; + height: 2px; + background-color: #292B34; +} + +/* tab 椤堕儴鍒囨崲鍔ㄧ敾 */ +.layui-layout-admin .layui-tab-title li:after { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 0; + height: 2px; + border-radius: 0; + background-color: #292B34; + transition: all .3s; + transition-property: all; + transition-duration: 0.3s; + transition-timing-function: ease; + transition-delay: 0s; + -webkit-transition: all .3s; +} + +/* 闅愯棌绗竴涓 tab 鐨勫叧闂寜閽 */ +.layui-layout-admin .layui-tab > .layui-tab-title li:first-child .layui-tab-close { + display: none; +} + +/* 鏍囩鍗$涓涓殑鏍囩娌℃湁鍏抽棴鎸夐挳, 鎵浠ヨ窛绂诲彸渚х殑瀹藉害 15px */ +.layui-layout-admin .layui-tab > .layui-tab-title li:first-child { + padding: 0 15px; +} + +/* tab 椤佃窛绂婚《閮ㄨ窛绂讳负 0 */ +.layui-layout-admin .layui-tab { + margin-top: 0; +} + +/* 璺濈椤堕儴鐨勮窛绂诲拰宸︿晶瀵艰埅鐨勮窛绂 */ +.layui-layout-admin .layui-body { + left: 200px; + top: 50px; +} + +/* tab 琛岀殑楂樺害, 鑳屾櫙鑹茬瓑 */ +.layui-pagetabs { + height: 40px; + line-height: 40px; + padding: 0 80px 0 0; + background-color: #fff; + box-sizing: border-box; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .1); +} + +/* ----- tab 鏍峰紡 ----- */ + + +/* ----- tab 宸﹀彸鎸夐挳鏍峰紡 ----- */ + +.layui-layout-admin .layui-body .admin-tabs-control { + position: absolute; + top: 0; + width: 40px; + height: 40px; + line-height: 40px; + text-align: center; + cursor: pointer; + transition: all .3s; + border-left: 1px solid #eee; + z-index: 1000; + background-color: white +} + +.layui-layout-admin .layui-body .admin-tabs-control:hover { + background-color: #eee +} + +.layui-layout-admin .layui-body .layui-icon-shrink-right { + left: 0; + border-left: none; + border-right: 1px solid #eee +} + +.layui-layout-admin .layui-body .layui-icon-refresh-3 { + right: 0 +} + +/* ----- tab 宸﹀彸鎸夐挳鏍峰紡 ----- */ + + +/* ----- 瀵艰埅鏍峰紡 ----- */ + + +/* 瀵艰埅鑳屾櫙棰滆壊 */ +.layui-layout-admin .layui-side { + position: absolute; + top: 50px; + width: 200px; + background-color: #324157; + transition: all .3s; + -webkit-transition: all .3s; + box-shadow: 1px 0 2px 0 rgba(0, 0, 0, .05); + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none +} + +.layui-layout-admin .layui-side .layui-nav { + width: 200px; + background-color: transparent; +} + +.layui-layout-admin .layui-side .layui-nav .layui-nav-item .layui-icon { + position: absolute; + top: 50%; + left: 20px; + margin-top: -25px; +} + +.layui-layout-admin .layui-side .layui-nav .layui-nav-item a { + height: 50px; + line-height: 50px; + padding-left: 30px; + padding-right: 30px; +} + +/* 涓绾у鑸偓娴瓧浣撻鑹插拰鑳屾櫙棰滆壊 */ +.layui-layout-admin .layui-side .layui-nav .layui-nav-item > a:hover { + color: #BFCBD9; + background: #263445; +} + +/* 涓绾у鑸閫変腑鏃惰儗鏅鑹插拰瀛椾綋棰滆壊 */ +.layui-nav-tree .layui-this, +.layui-nav-tree .layui-this > a, +.layui-nav-tree .layui-this > a:hover { + background-color: #324157; + color: rgb(64, 158, 255) +} + +/* 浜岀骇瀵艰埅鍩虹棰滆壊 */ +.layui-nav-itemed > .layui-nav-child { + display: block; + padding: 0; + background-color: #1f2d3d !important; +} + +/* 浜岀骇瀵艰埅鎮诞瀛椾綋鑳屾櫙棰滆壊 */ +.layui-layout-admin .layui-side .layui-nav .layui-nav-item dl dd > a:hover { + background-color: #01101f; +} + +/* 浜岀骇瀵艰埅琚変腑鏃惰儗鏅鑹插拰瀛椾綋棰滆壊 */ +.layui-nav-tree .layui-nav-child dd.layui-this a, +.layui-nav-tree dd.layui-this { + background-color: #1f2d3d !important; + color: rgb(64, 158, 255) +} + +/* this 瀵艰埅閫変腑鏃, 棰滆壊涓嶅彉 */ +.layui-layout-admin .layui-side .layui-nav .layui-nav-item.layui-this > a:hover { + color: rgb(64, 158, 255) +} + + +/* 鍘婚櫎鎮诞鏃跺乏渚х殑缁挎潯 */ +.layui-nav-tree .layui-nav-bar { + width: 0; +} + +/* 瀵艰埅鑿滃崟灞曞紑鏃堕鑹 */ +.layui-nav-itemed > a { + color: #BFCBD9 !important; +} + +.layui-nav-tree .layui-nav-child, .layui-nav-tree .layui-nav-child a:hover { + color: #BFCBD9; + background: #001528 0 0; +} + +.layui-layout-admin .layui-side .layui-nav .layui-nav-more { + right: 15px +} + +.layui-layout-admin .layui-side .layui-nav .layui-nav-item .layui-nav-child a { + padding-left: 50px; + cursor: pointer +} + +.layui-layout-admin .layui-side .layui-nav .layui-nav-item .layui-nav-child .layui-nav-child a { + padding-left: 70px +} + +.layui-layout-admin .layui-side .layui-nav .layui-nav-item .layui-nav-child .layui-nav-child .layui-nav-child a { + padding-left: 90px +} + +.layui-layout-admin .layui-side .layui-nav .layui-nav-item .layui-nav-child .layui-nav-child .layui-nav-child .layui-nav-child a { + padding-left: 110px +} + +/* 涓绾х洰褰曢澶栫殑楂樺害 */ +.layui-layout-admin .layui-side .layui-nav .layui-nav-item > a { + padding-top: 3px; + padding-bottom: 3px; + cursor: pointer +} + +/* ----- 瀵艰埅鏍峰紡 ----- */ + + +/* ----- 瀵艰埅鏀惰捣鏍峰紡 ----- */ + +.layui-layout-admin.admin-nav-mini .layui-header .layui-logo { + width: 60px +} + +.layui-layout-admin.admin-nav-mini .layui-header .layui-logo cite { + display: none +} + +.layui-layout-admin.admin-nav-mini .layui-header .layui-layout-left { + left: 60px +} + +.layui-layout-admin.admin-nav-mini .layui-side { + width: 60px +} + +.layui-layout-admin.admin-nav-mini .layui-side .layui-nav { + width: 60px +} + +.layui-layout-admin.admin-nav-mini .layui-side-scroll { + width: 80px +} + +.layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item > a > cite { + display: none +} + +.layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item > a .layui-nav-more { + display: none +} + +.layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item > a { + overflow: visible +} + +.layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-itemed .layui-nav-child { + display: none +} + +.layui-layout-admin.admin-nav-mini .layui-body { + left: 60px +} + +.layui-layout-admin.admin-nav-mini .layui-footer { + left: 60px +} + +.layui-layout-admin.admin-nav-mini .layui-side .layui-nav li.layui-nav-itemed > a { + background: rgba(0, 0, 0, .3) +} + +.layui-layout-admin.admin-nav-mini .layui-header .layui-icon-shrink-right:before { + content: "\e66b" +} + +.layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item.admin-nav-hover > .layui-nav-child { + display: inline-block; + position: fixed; + top: 105px; + left: 65px; + background: #24262f !important; + min-width: 200px; + z-index: 1001 +} + +.layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item.admin-nav-hover .layui-nav-itemed > .layui-nav-child { + display: block +} + +/* ----- 瀵艰埅鏀惰捣鏍峰紡 ----- */ + + +/* ----- 瀵艰埅灏忓睆骞曟牱寮 -----*/ + +@media screen and (max-width: 750px) { + .layui-layout-admin .layui-side { + position: fixed; + left: -260px; + z-index: 10000 + } + + .layui-layout-admin .layui-body { + left: 0 + } + + .layui-layout-admin .layui-footer { + left: 0 + } + + .layui-layout-admin .layui-header .layui-logo { + left: -260px + } + + .layui-layout-admin .layui-header .layui-layout-left { + left: 0 + } + + .layui-layout-admin .layui-header .layui-icon-shrink-right:before { + content: "\e66b" + } + + .layui-layout-admin.admin-nav-mini .layui-header .layui-logo { + width: 220px; + left: 0; + z-index: 10001 + } + + .layui-layout-admin.admin-nav-mini .layui-header { + z-index: auto + } + + .layui-layout-admin.admin-nav-mini .layui-header .layui-logo cite { + display: inline-block + } + + .layui-layout-admin.admin-nav-mini .layui-header .layui-layout-left { + left: 0 + } + + .layui-layout-admin.admin-nav-mini .layui-side { + width: 220px; + left: 0 + } + + .layui-layout-admin.admin-nav-mini .layui-side .layui-nav { + width: 220px + } + + .layui-layout-admin.admin-nav-mini .layui-side-scroll { + width: 240px + } + + .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item > a > cite { + display: inline-block + } + + .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item > a .layui-nav-more { + display: inline-block + } + + .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item > a { + overflow: hidden + } + + .layui-layout-admin.admin-nav-mini .layui-side .layui-nav li.layui-nav-itemed > a { + background: transparent + } + + .layui-layout-admin.admin-nav-mini .layui-side .layui-nav li.layui-nav-item > a:hover { + background: rgba(255, 255, 255, .03) + } + + .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-itemed > .layui-nav-child { + display: block + } + + .layui-layout-admin.admin-nav-mini .layui-body { + left: 0 + } + + .layui-layout-admin.admin-nav-mini .layui-footer { + left: 0 + } + + .layui-layout-admin.admin-nav-mini .site-mobile-shade { + content: ''; + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(0, 0, 0, .1); + z-index: 9999; + cursor: pointer + } + + .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-itemed > a { + background: transparent + } + + .layui-layout-admin.admin-nav-mini .layui-header .layui-icon-shrink-right:before { + content: "\e668" + } + + .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-item.admin-nav-hover > .layui-nav-child { + display: none; + position: static; + background-color: rgba(0, 0, 0, .3) !important; + min-width: 100% + } + + .layui-layout-admin.admin-nav-mini .layui-side .layui-nav .layui-nav-itemed.admin-nav-hover > .layui-nav-child { + display: block + } + + .layui-layout-admin .layui-nav .layui-breadcrumb span, + .layui-layout-admin .layui-nav .layui-breadcrumb a:not(:last-child) { + display: none; + } +} + + +/* ----- 瀵艰埅灏忓睆骞曟牱寮 ----- */ + + +/* ----- 搴曢儴鏍峰紡 ----- */ + +.layui-layout-admin .layui-footer { + left: 200px; + background: #fff; + transition: all .3s; + color: #666; + border-top: 1px solid #eee; + height: 43px; +} + +/* ----- 搴曢儴鏍峰紡 ----- */ + + +/* ----- iframe 鏍峰紡 ----- */ + +.layui-iframe { + position: absolute; + width: 100%; + height: calc(100% - 40px) !important; + left: 0; + top: 40px; + right: 0; + bottom: 0; + border: none; +} + +/* ----- iframe 鏍峰紡 ----- */ + + +/* ----- 鍙抽敭鑿滃崟鏍峰紡 ----- */ + +.rightmenu { + position: absolute; + width: 100px; + z-index: 9999; + display: none; + background-color: #fff; + padding: 2px; + color: #333; + border: 1px solid #eee; + border-radius: 2px; + cursor: pointer; +} + +.rightmenu li { + text-align: center; + display: block; + height: 30px; + line-height: 30px; + margin: 8px 0 8px 0; + +} + +.rightmenu li:hover { + background-color: #f2f2f2; + color: #000000; +} + + +/* ----- 鍙抽敭鑿滃崟鏍峰紡 ----- */ + +html { + font-style: normal; +} \ No newline at end of file diff --git a/src/main/resources/static/layui/css/public.css b/src/main/resources/static/layui/css/public.css new file mode 100644 index 0000000..0776e96 --- /dev/null +++ b/src/main/resources/static/layui/css/public.css @@ -0,0 +1,57 @@ +/* ----- 婊氬姩鏉℃牱寮 ----- */ + +::-webkit-scrollbar { + width: 8px; + height: 8px; + background: transparent; +} + +::-webkit-scrollbar-button:vertical { + display: none; +} + +::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { + background-color: #e2e2e2; +} + +::-webkit-scrollbar-thumb { + border-radius: 8px; + background-color: #a6a6a6; +} + +::-webkit-scrollbar-thumb:vertical:hover { + background-color: #7f7f7f; +} + +::-webkit-scrollbar-thumb:vertical:active { + background-color: rgba(0, 0, 0, .38); +} + +/* ----- 婊氬姩鏉℃牱寮 ----- */ + + +* { + box-sizing: border-box; +} + +.page-loading { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #fff; +} + +.rubik-loader { + width: 64px; + height: 64px; + position: absolute; + left: 50%; + top: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + background-image: url(/images/loading.gif); + background-repeat: no-repeat; + background-position: center; +} diff --git a/src/main/resources/static/layui/home/index.html b/src/main/resources/static/layui/home/index.html new file mode 100644 index 0000000..da2ae7e --- /dev/null +++ b/src/main/resources/static/layui/home/index.html @@ -0,0 +1,80 @@ + + + + + + + + + + 222 + + + + +
    +
    +
    + +

    Hello World

    +

    Hello World

    +

    Hello World

    + +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    +

    Hello World

    + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/layui/images/avatar.png b/src/main/resources/static/layui/images/avatar.png new file mode 100644 index 0000000..25e992d Binary files /dev/null and b/src/main/resources/static/layui/images/avatar.png differ diff --git a/src/main/resources/static/layui/images/clear.png b/src/main/resources/static/layui/images/clear.png new file mode 100644 index 0000000..7852967 Binary files /dev/null and b/src/main/resources/static/layui/images/clear.png differ diff --git a/src/main/resources/static/layui/images/loading.gif b/src/main/resources/static/layui/images/loading.gif new file mode 100644 index 0000000..071ecd6 Binary files /dev/null and b/src/main/resources/static/layui/images/loading.gif differ diff --git a/src/main/resources/static/layui/images/security.png b/src/main/resources/static/layui/images/security.png new file mode 100644 index 0000000..250c4cb Binary files /dev/null and b/src/main/resources/static/layui/images/security.png differ diff --git a/src/main/resources/static/layui/js/common.js b/src/main/resources/static/layui/js/common.js new file mode 100644 index 0000000..468d71e --- /dev/null +++ b/src/main/resources/static/layui/js/common.js @@ -0,0 +1,7 @@ +$(document).ready(function () { + + // 鍔犺浇瀹屾垚鍚庡叧闂姞杞藉姩鐢. + setTimeout(function () { + $(".page-loading").hide(); + }, 500); +}); \ No newline at end of file diff --git a/src/main/resources/static/layui/js/jquery.js b/src/main/resources/static/layui/js/jquery.js new file mode 100644 index 0000000..eb7c331 --- /dev/null +++ b/src/main/resources/static/layui/js/jquery.js @@ -0,0 +1,4432 @@ +/*! + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function () { + + var + // Will speed up references to window, and allows munging its name. + window = this, + // Will speed up references to undefined, and allows munging its name. + undefined, + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + // Map over the $ in case of overwrite + _$ = window.$, + + jQuery = window.jQuery = window.$ = function (selector, context) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init(selector, context); + }, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/; + + jQuery.fn = jQuery.prototype = { + init: function (selector, context) { + // Make sure that a selection was provided + selector = selector || document; + + // Handle $(DOMElement) + if (selector.nodeType) { + this[0] = selector; + this.length = 1; + this.context = selector; + return this; + } + // Handle HTML strings + if (typeof selector === "string") { + // Are we dealing with HTML string or an ID? + var match = quickExpr.exec(selector); + + // Verify a match, and that no context was specified for #id + if (match && (match[1] || !context)) { + + // HANDLE: $(html) -> $(array) + if (match[1]) + selector = jQuery.clean([match[1]], context); + + // HANDLE: $("#id") + else { + var elem = document.getElementById(match[3]); + + // Handle the case where IE and Opera return items + // by name instead of ID + if (elem && elem.id != match[3]) + return jQuery().find(selector); + + // Otherwise, we inject the element directly into the jQuery object + var ret = jQuery(elem || []); + ret.context = document; + ret.selector = selector; + return ret; + } + + // HANDLE: $(expr, [context]) + // (which is just equivalent to: $(content).find(expr) + } else + return jQuery(context).find(selector); + + // HANDLE: $(function) + // Shortcut for document ready + } else if (jQuery.isFunction(selector)) + return jQuery(document).ready(selector); + + // Make sure that old selector state is passed along + if (selector.selector && selector.context) { + this.selector = selector.selector; + this.context = selector.context; + } + + return this.setArray(jQuery.isArray(selector) ? + selector : + jQuery.makeArray(selector)); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.3.2", + + // The number of elements contained in the matched element set + size: function () { + return this.length; + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function (num) { + return num === undefined ? + + // Return a 'clean' array + Array.prototype.slice.call(this) : + + // Return just the object + this[num]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function (elems, name, selector) { + // Build a new jQuery matched element set + var ret = jQuery(elems); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if (name === "find") + ret.selector = this.selector + (this.selector ? " " : "") + selector; + else if (name) + ret.selector = this.selector + "." + name + "(" + selector + ")"; + + // Return the newly-formed element set + return ret; + }, + + // Force the current matched set of elements to become + // the specified array of elements (destroying the stack in the process) + // You should use pushStack() in order to do this, but maintain the stack + setArray: function (elems) { + // Resetting the length to 0, then using the native Array push + // is a super-fast way to populate an object with array-like properties + this.length = 0; + Array.prototype.push.apply(this, elems); + + return this; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function (callback, args) { + return jQuery.each(this, callback, args); + }, + + // Determine the position of an element within + // the matched set of elements + index: function (elem) { + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem && elem.jquery ? elem[0] : elem + , this); + }, + + attr: function (name, value, type) { + var options = name; + + // Look for the case where we're accessing a style value + if (typeof name === "string") + if (value === undefined) + return this[0] && jQuery[type || "attr"](this[0], name); + + else { + options = {}; + options[name] = value; + } + + // Check to see if we're setting style values + return this.each(function (i) { + // Set all the styles + for (name in options) + jQuery.attr( + type ? + this.style : + this, + name, jQuery.prop(this, options[name], type, i, name) + ); + }); + }, + + css: function (key, value) { + // ignore negative width and height values + if ((key == 'width' || key == 'height') && parseFloat(value) < 0) + value = undefined; + return this.attr(key, value, "curCSS"); + }, + + text: function (text) { + if (typeof text !== "object" && text != null) + return this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(text)); + + var ret = ""; + + jQuery.each(text || this, function () { + jQuery.each(this.childNodes, function () { + if (this.nodeType != 8) + ret += this.nodeType != 1 ? + this.nodeValue : + jQuery.fn.text([this]); + }); + }); + + return ret; + }, + + wrapAll: function (html) { + if (this[0]) { + // The elements to wrap the target around + var wrap = jQuery(html, this[0].ownerDocument).clone(); + + if (this[0].parentNode) + wrap.insertBefore(this[0]); + + wrap.map(function () { + var elem = this; + + while (elem.firstChild) + elem = elem.firstChild; + + return elem; + }).append(this); + } + + return this; + }, + + wrapInner: function (html) { + return this.each(function () { + jQuery(this).contents().wrapAll(html); + }); + }, + + wrap: function (html) { + return this.each(function () { + jQuery(this).wrapAll(html); + }); + }, + + append: function () { + return this.domManip(arguments, true, function (elem) { + if (this.nodeType == 1) + this.appendChild(elem); + }); + }, + + prepend: function () { + return this.domManip(arguments, true, function (elem) { + if (this.nodeType == 1) + this.insertBefore(elem, this.firstChild); + }); + }, + + before: function () { + return this.domManip(arguments, false, function (elem) { + this.parentNode.insertBefore(elem, this); + }); + }, + + after: function () { + return this.domManip(arguments, false, function (elem) { + this.parentNode.insertBefore(elem, this.nextSibling); + }); + }, + + end: function () { + return this.prevObject || jQuery([]); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: [].push, + sort: [].sort, + splice: [].splice, + + find: function (selector) { + if (this.length === 1) { + var ret = this.pushStack([], "find", selector); + ret.length = 0; + jQuery.find(selector, this[0], ret); + return ret; + } else { + return this.pushStack(jQuery.unique(jQuery.map(this, function (elem) { + return jQuery.find(selector, elem); + })), "find", selector); + } + }, + + clone: function (events) { + // Do the clone + var ret = this.map(function () { + if (!jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this)) { + // IE copies events bound via attachEvent when + // using cloneNode. Calling detachEvent on the + // clone will also remove the events from the orignal + // In order to get around this, we use innerHTML. + // Unfortunately, this means some modifications to + // attributes in IE that are actually only stored + // as properties will not be copied (such as the + // the name attribute on an input). + var html = this.outerHTML; + if (!html) { + var div = this.ownerDocument.createElement("div"); + div.appendChild(this.cloneNode(true)); + html = div.innerHTML; + } + + return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0]; + } else + return this.cloneNode(true); + }); + + // Copy the events from the original to the clone + if (events === true) { + var orig = this.find("*").andSelf(), i = 0; + + ret.find("*").andSelf().each(function () { + if (this.nodeName !== orig[i].nodeName) + return; + + var events = jQuery.data(orig[i], "events"); + + for (var type in events) { + for (var handler in events[type]) { + jQuery.event.add(this, type, events[type][handler], events[type][handler].data); + } + } + + i++; + }); + } + + // Return the cloned set + return ret; + }, + + filter: function (selector) { + return this.pushStack( + jQuery.isFunction(selector) && + jQuery.grep(this, function (elem, i) { + return selector.call(elem, i); + }) || + + jQuery.multiFilter(selector, jQuery.grep(this, function (elem) { + return elem.nodeType === 1; + })), "filter", selector); + }, + + closest: function (selector) { + var pos = jQuery.expr.match.POS.test(selector) ? jQuery(selector) : null, + closer = 0; + + return this.map(function () { + var cur = this; + while (cur && cur.ownerDocument) { + if (pos ? pos.index(cur) > -1 : jQuery(cur).is(selector)) { + jQuery.data(cur, "closest", closer); + return cur; + } + cur = cur.parentNode; + closer++; + } + }); + }, + + not: function (selector) { + if (typeof selector === "string") + // test special case where just one selector is passed in + if (isSimple.test(selector)) + return this.pushStack(jQuery.multiFilter(selector, this, true), "not", selector); + else + selector = jQuery.multiFilter(selector, this); + + var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; + return this.filter(function () { + return isArrayLike ? jQuery.inArray(this, selector) < 0 : this != selector; + }); + }, + + add: function (selector) { + return this.pushStack(jQuery.unique(jQuery.merge( + this.get(), + typeof selector === "string" ? + jQuery(selector) : + jQuery.makeArray(selector) + ))); + }, + + is: function (selector) { + return !!selector && jQuery.multiFilter(selector, this).length > 0; + }, + + hasClass: function (selector) { + return !!selector && this.is("." + selector); + }, + + val: function (value) { + if (value === undefined) { + var elem = this[0]; + + if (elem) { + if (jQuery.nodeName(elem, 'option')) + return (elem.attributes.value || {}).specified ? elem.value : elem.text; + + // We need to handle select boxes special + if (jQuery.nodeName(elem, "select")) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type == "select-one"; + + // Nothing was selected + if (index < 0) + return null; + + // Loop through all the selected options + for (var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++) { + var option = options[i]; + + if (option.selected) { + // Get the specifc value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if (one) + return value; + + // Multi-Selects return an array + values.push(value); + } + } + + return values; + } + + // Everything else, we just grab the value + return (elem.value || "").replace(/\r/g, ""); + + } + + return undefined; + } + + if (typeof value === "number") + value += ''; + + return this.each(function () { + if (this.nodeType != 1) + return; + + if (jQuery.isArray(value) && /radio|checkbox/.test(this.type)) + this.checked = (jQuery.inArray(this.value, value) >= 0 || + jQuery.inArray(this.name, value) >= 0); + + else if (jQuery.nodeName(this, "select")) { + var values = jQuery.makeArray(value); + + jQuery("option", this).each(function () { + this.selected = (jQuery.inArray(this.value, values) >= 0 || + jQuery.inArray(this.text, values) >= 0); + }); + + if (!values.length) + this.selectedIndex = -1; + + } else + this.value = value; + }); + }, + + html: function (value) { + return value === undefined ? + (this[0] ? + this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") : + null) : + this.empty().append(value); + }, + + replaceWith: function (value) { + return this.after(value).remove(); + }, + + eq: function (i) { + return this.slice(i, +i + 1); + }, + + slice: function () { + return this.pushStack(Array.prototype.slice.apply(this, arguments), + "slice", Array.prototype.slice.call(arguments).join(",")); + }, + + map: function (callback) { + return this.pushStack(jQuery.map(this, function (elem, i) { + return callback.call(elem, i, elem); + })); + }, + + andSelf: function () { + return this.add(this.prevObject); + }, + + domManip: function (args, table, callback) { + if (this[0]) { + var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), + scripts = jQuery.clean(args, (this[0].ownerDocument || this[0]), fragment), + first = fragment.firstChild; + + if (first) + for (var i = 0, l = this.length; i < l; i++) + callback.call(root(this[i], first), this.length > 1 || i > 0 ? + fragment.cloneNode(true) : fragment); + + if (scripts) + jQuery.each(scripts, evalScript); + } + + return this; + + function root(elem, cur) { + return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? + (elem.getElementsByTagName("tbody")[0] || + elem.appendChild(elem.ownerDocument.createElement("tbody"))) : + elem; + } + } + }; + +// Give the init function the jQuery prototype for later instantiation + jQuery.fn.init.prototype = jQuery.fn; + + function evalScript(i, elem) { + if (elem.src) + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + + else + jQuery.globalEval(elem.text || elem.textContent || elem.innerHTML || ""); + + if (elem.parentNode) + elem.parentNode.removeChild(elem); + } + + function now() { + return +new Date; + } + + jQuery.extend = jQuery.fn.extend = function () { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; + + // Handle a deep copy situation + if (typeof target === "boolean") { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if (typeof target !== "object" && !jQuery.isFunction(target)) + target = {}; + + // extend jQuery itself if only one argument is passed + if (length == i) { + target = this; + --i; + } + + for (; i < length; i++) + // Only deal with non-null/undefined values + if ((options = arguments[i]) != null) + // Extend the base object + for (var name in options) { + var src = target[name], copy = options[name]; + + // Prevent never-ending loop + if (target === copy) + continue; + + // Recurse if we're merging object values + if (deep && copy && typeof copy === "object" && !copy.nodeType) + target[name] = jQuery.extend(deep, + // Never move original objects, clone them + src || (copy.length != null ? [] : {}) + , copy); + + // Don't bring in undefined values + else if (copy !== undefined) + target[name] = copy; + + } + + // Return the modified object + return target; + }; + +// exclude the following css properties to add px + var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, + // cache defaultView + defaultView = document.defaultView || {}, + toString = Object.prototype.toString; + + jQuery.extend({ + noConflict: function (deep) { + window.$ = _$; + + if (deep) + window.jQuery = _jQuery; + + return jQuery; + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function (obj) { + return toString.call(obj) === "[object Function]"; + }, + + isArray: function (obj) { + return toString.call(obj) === "[object Array]"; + }, + + // check if an element is in a (or is an) XML document + isXMLDoc: function (elem) { + return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || + !!elem.ownerDocument && jQuery.isXMLDoc(elem.ownerDocument); + }, + + // Evalulates a script in a global context + globalEval: function (data) { + if (data && /\S/.test(data)) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + if (jQuery.support.scriptEval) + script.appendChild(document.createTextNode(data)); + else + script.text = data; + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore(script, head.firstChild); + head.removeChild(script); + } + }, + + nodeName: function (elem, name) { + return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); + }, + + // args is for internal usage only + each: function (object, callback, args) { + var name, i = 0, length = object.length; + + if (args) { + if (length === undefined) { + for (name in object) + if (callback.apply(object[name], args) === false) + break; + } else + for (; i < length;) + if (callback.apply(object[i++], args) === false) + break; + + // A special, fast, case for the most common use of each + } else { + if (length === undefined) { + for (name in object) + if (callback.call(object[name], name, object[name]) === false) + break; + } else + for (var value = object[0]; + i < length && callback.call(value, i, value) !== false; value = object[++i]) { + } + } + + return object; + }, + + prop: function (elem, value, type, i, name) { + // Handle executable functions + if (jQuery.isFunction(value)) + value = value.call(elem, i); + + // Handle passing in a number to a CSS property + return typeof value === "number" && type == "curCSS" && !exclude.test(name) ? + value + "px" : + value; + }, + + className: { + // internal only, use addClass("class") + add: function (elem, classNames) { + jQuery.each((classNames || "").split(/\s+/), function (i, className) { + if (elem.nodeType == 1 && !jQuery.className.has(elem.className, className)) + elem.className += (elem.className ? " " : "") + className; + }); + }, + + // internal only, use removeClass("class") + remove: function (elem, classNames) { + if (elem.nodeType == 1) + elem.className = classNames !== undefined ? + jQuery.grep(elem.className.split(/\s+/), function (className) { + return !jQuery.className.has(classNames, className); + }).join(" ") : + ""; + }, + + // internal only, use hasClass("class") + has: function (elem, className) { + return elem && jQuery.inArray(className, (elem.className || elem).toString().split(/\s+/)) > -1; + } + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function (elem, options, callback) { + var old = {}; + // Remember the old values, and insert the new ones + for (var name in options) { + old[name] = elem.style[name]; + elem.style[name] = options[name]; + } + + callback.call(elem); + + // Revert the old values + for (var name in options) + elem.style[name] = old[name]; + }, + + css: function (elem, name, force, extra) { + if (name == "width" || name == "height") { + var val, props = {position: "absolute", visibility: "hidden", display: "block"}, + which = name == "width" ? ["Left", "Right"] : ["Top", "Bottom"]; + + function getWH() { + val = name == "width" ? elem.offsetWidth : elem.offsetHeight; + + if (extra === "border") + return; + + jQuery.each(which, function () { + if (!extra) + val -= parseFloat(jQuery.curCSS(elem, "padding" + this, true)) || 0; + if (extra === "margin") + val += parseFloat(jQuery.curCSS(elem, "margin" + this, true)) || 0; + else + val -= parseFloat(jQuery.curCSS(elem, "border" + this + "Width", true)) || 0; + }); + } + + if (elem.offsetWidth !== 0) + getWH(); + else + jQuery.swap(elem, props, getWH); + + return Math.max(0, Math.round(val)); + } + + return jQuery.curCSS(elem, name, force); + }, + + curCSS: function (elem, name, force) { + var ret, style = elem.style; + + // We need to handle opacity special in IE + if (name == "opacity" && !jQuery.support.opacity) { + ret = jQuery.attr(style, "opacity"); + + return ret == "" ? + "1" : + ret; + } + + // Make sure we're using the right name for getting the float value + if (name.match(/float/i)) + name = styleFloat; + + if (!force && style && style[name]) + ret = style[name]; + + else if (defaultView.getComputedStyle) { + + // Only "float" is needed here + if (name.match(/float/i)) + name = "float"; + + name = name.replace(/([A-Z])/g, "-$1").toLowerCase(); + + var computedStyle = defaultView.getComputedStyle(elem, null); + + if (computedStyle) + ret = computedStyle.getPropertyValue(name); + + // We should always get a number back from opacity + if (name == "opacity" && ret == "") + ret = "1"; + + } else if (elem.currentStyle) { + var camelCase = name.replace(/\-(\w)/g, function (all, letter) { + return letter.toUpperCase(); + }); + + ret = elem.currentStyle[name] || elem.currentStyle[camelCase]; + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + if (!/^\d+(px)?$/i.test(ret) && /^\d/.test(ret)) { + // Remember the original values + var left = style.left, rsLeft = elem.runtimeStyle.left; + + // Put in the new values to get a computed value out + elem.runtimeStyle.left = elem.currentStyle.left; + style.left = ret || 0; + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + elem.runtimeStyle.left = rsLeft; + } + } + + return ret; + }, + + clean: function (elems, context, fragment) { + context = context || document; + + // !context.createElement fails in IE with an error but returns typeof 'object' + if (typeof context.createElement === "undefined") + context = context.ownerDocument || context[0] && context[0].ownerDocument || document; + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + if (!fragment && elems.length === 1 && typeof elems[0] === "string") { + var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); + if (match) + return [context.createElement(match[1])]; + } + + var ret = [], scripts = [], div = context.createElement("div"); + + jQuery.each(elems, function (i, elem) { + if (typeof elem === "number") + elem += ''; + + if (!elem) + return; + + // Convert html string into DOM nodes + if (typeof elem === "string") { + // Fix "XHTML"-style tags in all browsers + elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function (all, front, tag) { + return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? + all : + front + ">"; + }); + + // Trim whitespace, otherwise indexOf won't work as expected + var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase(); + + var wrap = + // option or optgroup + !tags.indexOf("", ""] || + + !tags.indexOf("", ""] || + + tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && + [1, "", "
    "] || + + !tags.indexOf("", ""] || + + // matched above + (!tags.indexOf("", ""] || + + !tags.indexOf("", ""] || + + // IE can't serialize and + + + +
    +

    閭閰嶇疆(SMTP)

    +
    + +
    + +
    + +
    + + +
    +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + 淇濆瓨 +
    +
    +
    + + + \ No newline at end of file diff --git a/src/main/resources/templates/admin/imageIdentify.html b/src/main/resources/templates/admin/imageIdentify.html new file mode 100644 index 0000000..b3dd846 --- /dev/null +++ b/src/main/resources/templates/admin/imageIdentify.html @@ -0,0 +1,144 @@ + + + + + 鍥剧墖瀹℃牳閰嶇疆 + + + + + +
    +

    鐧惧害閴撮粍Key閰嶇疆

    +
    + +
    + + +
    + +
    + + +
    +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + + +
    + 淇濆瓨 +
    +
    +
    + + + \ No newline at end of file diff --git a/src/main/resources/templates/admin/index.html b/src/main/resources/templates/admin/index.html new file mode 100644 index 0000000..0b3ad34 --- /dev/null +++ b/src/main/resources/templates/admin/index.html @@ -0,0 +1,233 @@ + + + + + + + + 鍚庡彴绠$悊 - Hellohao鍥惧簥 + + + + + + + + + + +
    + +
    + + + + + + + + +
    + + + + +
    +
    +
    +
    +
      +
    • +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
      +
    • 鍏抽棴姝ら〉
    • +
    • 鍏抽棴鎵鏈
    • +
    • 鍏抽棴鍏朵粬
    • +
    • 鍏抽棴宸︿晶
    • +
    • 鍏抽棴鍙充晶
    • +
    +
    + + +
    +
    + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/admin/setuser.html b/src/main/resources/templates/admin/setuser.html new file mode 100644 index 0000000..75e2a6b --- /dev/null +++ b/src/main/resources/templates/admin/setuser.html @@ -0,0 +1,121 @@ + + + + + 瀵嗙爜淇敼 + + + + + +
    +

    瀵嗙爜淇敼

    +
    + +
    + +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + + +
    + 淇濆瓨 +
    +
    +
    + + + \ No newline at end of file diff --git a/src/main/resources/templates/admin/storageconfig.html b/src/main/resources/templates/admin/storageconfig.html new file mode 100644 index 0000000..883a058 --- /dev/null +++ b/src/main/resources/templates/admin/storageconfig.html @@ -0,0 +1,153 @@ + + + + + 鍌ㄥ瓨婧愰厤缃 + + + + + +
    +

    瀛樺偍婧怟ey閰嶇疆

    +
    + +
    + +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + 淇濆瓨 +
    +
    +
    + + + \ No newline at end of file diff --git a/src/main/resources/templates/admin/table.html b/src/main/resources/templates/admin/table.html index 8bcbeb8..f53d342 100644 --- a/src/main/resources/templates/admin/table.html +++ b/src/main/resources/templates/admin/table.html @@ -5,23 +5,29 @@ Hellohao鍥惧簥 - © 绾补鐨勫浘鐗囬┛绔 - - - - - - + + + + - - + + + + - - + + + + + + +
    -
    +

    鏈珯姒傚喌

    +
    +
    - -
    - - 鍥剧墖鎬绘暟 + +
    + + 鏈珯鍥剧墖鎬绘暟
    -
    +
    0 - 鐢ㄦ埛鎬绘暟 + 鏈珯鐢ㄦ埛鎬绘暟
    - -
    - 0 - Waiting.. + +
    + 0 + 鏈珯鎷︽埅闈炴硶鍥剧墖
    -
    - 0 - Waiting.. +
    + + 绯荤粺鍌ㄦ簮婧
    - -
    -
    -
    - - - - -

    鎴戠殑鍥剧墖鍒楄〃

    - - - - - - - - - - - + + + +
    + +
    鎴戠殑鍥剧墖锛 + 0 +
    + +
    閾炬帴鏃ユ湡澶у皬鎿嶄綔
    +
    + +
    + + +
    + + 鍒楄〃鏄剧ず锛 +
    + +
    + +
    +
    + +
    + + +

    鐢ㄦ埛鍒楄〃

    + +
    +
    - -
    - - - - -
    + + \ No newline at end of file diff --git a/src/main/resources/templates/admin/user.html b/src/main/resources/templates/admin/user.html new file mode 100644 index 0000000..9e71fbc --- /dev/null +++ b/src/main/resources/templates/admin/user.html @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + 鐢ㄦ埛绠$悊 + + + + +
    +
    +
    +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/admin/webconfig.html b/src/main/resources/templates/admin/webconfig.html new file mode 100644 index 0000000..f7e2a14 --- /dev/null +++ b/src/main/resources/templates/admin/webconfig.html @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + 绯荤当閰嶇疆 + + + + +
    +
    +
    +
      +
    • 棣栭〉璁剧疆
    • +
    • 鐧惧害缁熻
    • + +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    + 鍥剧墖鎺ㄨ崘澶у皬锛242px*33px +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    + + 鍙嬮摼鏍煎紡锛堝惁鍒欎細鏄剧ず寮傚父锛夛細<li><a src="鍦板潃">缃戠珯鍚</a></li> +
    +
    + +
    + 淇濆瓨 +
    +
    +
    +
    + +
    + + 娣诲姞缃戠珯缁熻鐨凧S浠g爜锛屼笉闇瑕佽娣诲姞<script>鏍囩</script> +
    + 淇濆瓨 +
    +
    +
    + +
    +
    +
    + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/footer.html b/src/main/resources/templates/footer.html index 6b1da2e..77b4f42 100644 --- a/src/main/resources/templates/footer.html +++ b/src/main/resources/templates/footer.html @@ -1,7 +1,8 @@ - + - + @@ -11,46 +12,52 @@ -
    - + + \ No newline at end of file diff --git a/src/main/resources/templates/header.html b/src/main/resources/templates/header.html index 0ab6526..7311198 100644 --- a/src/main/resources/templates/header.html +++ b/src/main/resources/templates/header.html @@ -3,36 +3,39 @@ - Hellohao鍥惧簥 - © 绾补鐨勫浘鐗囬┛绔 + + + - + diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 47dcf14..114c60d 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -2,195 +2,262 @@ - - - - - Hellohao鍥惧簥 - © 绾补鐨勫浘鐗囬┛绔 - - + + + + + + + + + + - + + + + - - + - - + + + + + - - +
    -
    - - × - - 璀﹀憡锛鎮ㄧ殑缃戠粶杩炴帴鏈夐棶棰樸 +
    + + × + + 璀﹀憡锛鎮ㄧ殑缃戠粶杩炴帴鏈夐棶棰樸 +
    + +
    +
    + +
  •  
  • +
    -