Compare commits
46 Commits
taiwan-tin
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
6cb148ff3e | 3 years ago |
|
|
b8b4861b06 | 3 years ago |
|
|
33b887e46e | 3 years ago |
|
|
1ac7844c36 | 3 years ago |
|
|
9118e7b285 | 3 years ago |
|
|
abfa16c686 | 3 years ago |
|
|
87118f89ca | 3 years ago |
|
|
5867b06535 | 3 years ago |
|
|
d518e5fbcc | 3 years ago |
|
|
3b887f8463 | 3 years ago |
|
|
7842d651f3 | 3 years ago |
|
|
0c00e7f29b | 3 years ago |
|
|
f94adbc2b9 | 3 years ago |
|
|
1acb78e77f | 3 years ago |
|
|
86d8a79ff6 | 3 years ago |
|
|
66e4e5daf2 | 3 years ago |
|
|
3d0611365f | 3 years ago |
|
|
7d0d3231d8 | 3 years ago |
|
|
4f6ba52093 | 3 years ago |
|
|
ab227a7155 | 3 years ago |
|
|
a7a431daa0 | 3 years ago |
|
|
f5ae3d9505 | 4 years ago |
|
|
6ff5ea3e5c | 4 years ago |
|
|
307f3994a7 | 4 years ago |
|
|
f3b5cfa730 | 4 years ago |
|
|
f6c011c307 | 4 years ago |
|
|
b1e01176e8 | 4 years ago |
|
|
c33599566e | 4 years ago |
|
|
dc14848a5c | 4 years ago |
|
|
5c9194b9a3 | 4 years ago |
|
|
4600d46906 | 4 years ago |
|
|
535ac337bf | 4 years ago |
|
|
f3f1a8f1a6 | 4 years ago |
|
|
b54c850ce9 | 4 years ago |
|
|
9c3815ebac | 4 years ago |
|
|
ccb509a47e | 4 years ago |
|
|
ef8cfff5b8 | 4 years ago |
|
|
ad41d5fddb | 4 years ago |
|
|
90f2815017 | 4 years ago |
|
|
95be7414a9 | 4 years ago |
|
|
66526de6f1 | 4 years ago |
|
|
1cd8223e80 | 4 years ago |
|
|
2bb0393302 | 4 years ago |
|
|
4e518c19d3 | 4 years ago |
|
|
5d5fa9d2d6 | 4 years ago |
|
|
1c15675ba6 | 4 years ago |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 360 KiB After Width: | Height: | Size: 360 KiB |
|
Before Width: | Height: | Size: 299 KiB After Width: | Height: | Size: 299 KiB |
Binary file not shown.
@ -1,8 +1,8 @@
|
||||
package com.zhehekeji.common;
|
||||
package com.leaper.common;
|
||||
|
||||
import com.zhehekeji.common.properities.Md5Properity;
|
||||
import com.zhehekeji.common.properities.RedisProperity;
|
||||
import com.zhehekeji.common.util.MD5Util;
|
||||
import com.leaper.common.properities.Md5Properity;
|
||||
import com.leaper.common.properities.RedisProperity;
|
||||
import com.leaper.common.util.MD5Util;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.common.constant;
|
||||
package com.leaper.common.constant;
|
||||
|
||||
public abstract class CommonConstant {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.common.properities;
|
||||
package com.leaper.common.properities;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.common.properities;
|
||||
package com.leaper.common.properities;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.common.properities;
|
||||
package com.leaper.common.properities;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ -0,0 +1,59 @@
|
||||
package com.leaper.common.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
@Slf4j
|
||||
public class FileUtil {
|
||||
|
||||
public static void save(String text,String path){
|
||||
|
||||
//判断文件是否存在
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
try {
|
||||
file.createNewFile();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(file);
|
||||
fileOutputStream.write(text.getBytes());
|
||||
fileOutputStream.close();
|
||||
log.info("write text success :{}",text);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static String getText(String path){
|
||||
File file = new File(path);
|
||||
if(file.exists()){
|
||||
try {
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
byte[] bytes = new byte[1024];//定义字节长度
|
||||
int len = 0;
|
||||
String txt = null;
|
||||
while ((len = fileInputStream.read(bytes)) != -1) {//与文件读取出来的长度比较,内部有数据读完是-1,所以不等于-1
|
||||
txt = new String(bytes, 0, len);//从0取到有数据的末尾
|
||||
}
|
||||
|
||||
fileInputStream.close();
|
||||
return txt;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String path = "./lotnum_now";
|
||||
save("www",path);
|
||||
getText(path);
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.common.util;
|
||||
package com.leaper.common.util;
|
||||
|
||||
import com.zhehekeji.core.util.Assert;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -1,6 +1,6 @@
|
||||
package com.zhehekeji.common.util;
|
||||
package com.leaper.common.util;
|
||||
|
||||
import com.zhehekeji.common.properities.Md5Properity;
|
||||
import com.leaper.common.properities.Md5Properity;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.common.util;
|
||||
package com.leaper.common.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.common.util;
|
||||
package com.leaper.common.util;
|
||||
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.EncodeHintType;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.common.util;
|
||||
package com.leaper.common.util;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.common.util;
|
||||
package com.leaper.common.util;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.common.util;
|
||||
package com.leaper.common.util;
|
||||
|
||||
import com.zhehekeji.core.util.Assert;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -0,0 +1,29 @@
|
||||
package encryptor;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public class Encryptor {
|
||||
public native static String encryptStr(String str);
|
||||
static
|
||||
{
|
||||
try{
|
||||
String path = System.getProperty("user.dir")+"\\libs\\encrypt";
|
||||
|
||||
System.setProperty("java.library.path", path);
|
||||
Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths");
|
||||
fieldSysPath.setAccessible(true);
|
||||
fieldSysPath.set(null, null);
|
||||
|
||||
System.loadLibrary("Encryptor");
|
||||
}catch(Exception e)
|
||||
{
|
||||
System.out.println(e);
|
||||
}
|
||||
}
|
||||
public static void main(String[] args)
|
||||
{
|
||||
|
||||
String noEncrypt = "12345";
|
||||
String encrypt = Encryptor.encryptStr(noEncrypt);
|
||||
System.out.println(encrypt);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@ -0,0 +1,5 @@
|
||||
package com.leaper.filter;
|
||||
|
||||
public interface FilterConstance {
|
||||
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.leaper.filter.aspect;
|
||||
|
||||
import com.leaper.common.util.FileUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Scanner;
|
||||
|
||||
@Slf4j
|
||||
public class LPLicense {
|
||||
|
||||
private static LocalDateTime lastUpdate = null;
|
||||
|
||||
private static String lic_str = null;
|
||||
|
||||
private static String lic_path = "./lp.lic";
|
||||
|
||||
private static String key_path = "./lp.key";
|
||||
|
||||
private static String CPU_INFO = null;
|
||||
|
||||
private static String DISK_INFO = null;
|
||||
|
||||
/**
|
||||
* 初始的时候创建
|
||||
*/
|
||||
public static void createLicKeyIfNotExist(){
|
||||
File file = new File(key_path);
|
||||
if(!file.exists()){
|
||||
String cpu = getCpuInfo();
|
||||
CPU_INFO = cpu;
|
||||
String disk = getDiskInfo();
|
||||
DISK_INFO = disk;
|
||||
FileUtil.save(cpu+disk,key_path);
|
||||
}
|
||||
}
|
||||
|
||||
private static String getCpuInfo(){
|
||||
try {
|
||||
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 cpu = sc.next();
|
||||
return cpu;
|
||||
} catch (IOException e) {
|
||||
log.error("GET CPU error:{}",e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getDiskInfo(){
|
||||
try {
|
||||
Process process = Runtime.getRuntime().exec(
|
||||
new String[] { "wmic","diskdrive","where","index=0", "get", "serialnumber"});
|
||||
process.getOutputStream().close();
|
||||
Scanner sc = new Scanner(process.getInputStream());
|
||||
String property = sc.next();
|
||||
String disk = sc.next();
|
||||
return disk;
|
||||
} catch (IOException e) {
|
||||
log.error("Get DISK error:{}",e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getLic(){
|
||||
//每小时读取一次lic文件
|
||||
if(lastUpdate == null || LocalDateTime.now().toLocalTime().getHour() != lastUpdate.toLocalTime().getHour()){
|
||||
lastUpdate = LocalDateTime.now();
|
||||
lic_str = FileUtil.getText(lic_path);
|
||||
CPU_INFO = getCpuInfo();
|
||||
DISK_INFO = getDiskInfo();
|
||||
}
|
||||
return lic_str;
|
||||
}
|
||||
|
||||
public static boolean checkLic(String licStr){
|
||||
return CPU_INFO != null && DISK_INFO != null && licStr.equals(encryptor.Encryptor.encryptStr(CPU_INFO+DISK_INFO));
|
||||
}
|
||||
|
||||
public static boolean checkLic(){
|
||||
String licStr = getLic();
|
||||
if(StringUtils.isEmpty(licStr)){
|
||||
return false;
|
||||
}
|
||||
return checkLic(licStr);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
createLicKeyIfNotExist();
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.filter.pojo;
|
||||
package com.leaper.filter.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@ -1,22 +1,14 @@
|
||||
package com.zhehekeji.filter.pojo;
|
||||
package com.leaper.filter.pojo;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface SessionHandler {
|
||||
public @interface LicenseHandler {
|
||||
|
||||
String value() default "";
|
||||
|
||||
UserType userType() default UserType.USER;
|
||||
|
||||
/**
|
||||
* 是否检验登录
|
||||
* @return true:检验 false:不检验
|
||||
*/
|
||||
boolean login() default true;
|
||||
|
||||
/**
|
||||
* 是否检验权限
|
||||
* @return true:检验 false:不检验 默认检验
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.filter.pojo;
|
||||
package com.leaper.filter.pojo;
|
||||
|
||||
/**
|
||||
* @Description 用户分类
|
||||
@ -1,12 +0,0 @@
|
||||
package com.zhehekeji.filter;
|
||||
|
||||
public interface FilterConstance {
|
||||
|
||||
String HEADER = "token";
|
||||
|
||||
String JWT_KEY = "zhehekeji";
|
||||
|
||||
String SESSION_PREFIX = "session:";
|
||||
|
||||
Long SESSION_EXPIRE = 10800l;
|
||||
}
|
||||
@ -1,73 +0,0 @@
|
||||
package com.zhehekeji.filter.aspect;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zhehekeji.common.util.HttpUtil;
|
||||
import com.zhehekeji.core.pojo.HttpStatus;
|
||||
import com.zhehekeji.core.pojo.Result;
|
||||
import com.zhehekeji.core.util.Assert;
|
||||
import com.zhehekeji.filter.FilterConstance;
|
||||
import com.zhehekeji.filter.pojo.CurrentUser;
|
||||
import com.zhehekeji.filter.pojo.SessionHandler;
|
||||
import com.zhehekeji.filter.pojo.UserType;
|
||||
import com.zhehekeji.filter.util.CurrentUserUtil;
|
||||
import com.zhehekeji.filter.util.JwtUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Description Session切面
|
||||
* @Author wangyiming1031@aliyun.com
|
||||
* @Date 2019/10/28 19:26
|
||||
**/
|
||||
@Aspect
|
||||
@Component
|
||||
@Slf4j
|
||||
public class SessionAspect {
|
||||
|
||||
@Value("${zhehe.filter.enable}")
|
||||
private Boolean enable;
|
||||
@Value("${userUrl}")
|
||||
private String userUrl;
|
||||
|
||||
/**
|
||||
* zhehekeji..*.controller
|
||||
* 匹配zhehekeji 到controller多级目录
|
||||
*
|
||||
* @param sessionHandler
|
||||
*/
|
||||
@Before("execution(public * com.zhehekeji..*.controller.*.*(..))&&@annotation(sessionHandler)")
|
||||
public void handler(SessionHandler sessionHandler){
|
||||
if(!enable){
|
||||
return;
|
||||
}
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
String token = request.getHeader(FilterConstance.HEADER);
|
||||
CurrentUser currentUser = null;
|
||||
try {
|
||||
String res = HttpUtil.token(userUrl+"/api/account/checkToken",token);
|
||||
Result currentUserResult = JSONObject.parseObject(res,Result.class);
|
||||
if(currentUserResult != null && currentUserResult.getCode() == 200){
|
||||
currentUser = JSONObject.parseObject(JSONObject.toJSONString(currentUserResult.getData()),CurrentUser.class);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (sessionHandler.login()) {
|
||||
Assert.isTrue(currentUser != null, HttpStatus.UNAUTHORIZED.getCode(), HttpStatus.UNAUTHORIZED.getReasonPhrase());
|
||||
}
|
||||
if (sessionHandler.auth()) {
|
||||
//todo 权限检验
|
||||
}
|
||||
CurrentUserUtil.setCurrentUser(currentUser);
|
||||
}
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
package com.zhehekeji.filter.util;
|
||||
|
||||
import com.zhehekeji.filter.pojo.CurrentUser;
|
||||
|
||||
/**
|
||||
* @Description 当前操作人线程
|
||||
* @Author wangyiming1031@aliyun.com
|
||||
* @Date 2019/10/28 19:22
|
||||
**/
|
||||
public class CurrentUserUtil {
|
||||
|
||||
private static ThreadLocal<CurrentUser> currentUser = new ThreadLocal<>();
|
||||
|
||||
/**
|
||||
* 获取当前操作人
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static CurrentUser getCurrentUser() {
|
||||
return currentUser.get();
|
||||
}
|
||||
|
||||
public static void setCurrentUser(CurrentUser user) {
|
||||
currentUser.set(user);
|
||||
}
|
||||
|
||||
public static void delCurrentUser() {
|
||||
currentUser.remove();
|
||||
}
|
||||
}
|
||||
@ -1,85 +0,0 @@
|
||||
package com.zhehekeji.filter.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zhehekeji.filter.FilterConstance;
|
||||
import com.zhehekeji.filter.pojo.CurrentUser;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.JwtBuilder;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description JWTUtil
|
||||
* @Author wangyiming1031@aliyun.com
|
||||
* @Date 2019/10/28 19:11
|
||||
**/
|
||||
public class JwtUtil {
|
||||
|
||||
/**
|
||||
* 生成JWT
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private static String createJWT(CurrentUser currentUser) {
|
||||
String userJson = JSONObject.toJSONString(currentUser);
|
||||
JwtBuilder builder = Jwts.builder()
|
||||
.setSubject(userJson)
|
||||
.setIssuedAt(new Date())
|
||||
.signWith(SignatureAlgorithm.HS256, FilterConstance.JWT_KEY);
|
||||
return builder.compact();
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析JWT
|
||||
* 抛出异常 则jwt错误
|
||||
* @param jwtStr
|
||||
* @return
|
||||
*/
|
||||
public static Claims parseJWT(String jwtStr) {
|
||||
return Jwts.parser()
|
||||
.setSigningKey(FilterConstance.JWT_KEY)
|
||||
.parseClaimsJws(jwtStr)
|
||||
.getBody();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前操作人
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public static CurrentUser getUser(HttpServletRequest request) {
|
||||
String token = getToken(request);
|
||||
Claims claims;
|
||||
try {
|
||||
claims = parseJWT(token);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
String json = claims.getSubject();
|
||||
CurrentUser userInfo = JSONObject.parseObject(json, CurrentUser.class);
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
private static String getToken(HttpServletRequest request) {
|
||||
return request.getHeader(FilterConstance.HEADER);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成jwt,并将jwt放入返回头
|
||||
* 主要考虑的是 返回header 由用户过滤模块维护
|
||||
* @param response
|
||||
* @param currentUser
|
||||
* @return
|
||||
*/
|
||||
public static String createTokenAndHeader(HttpServletResponse response,CurrentUser currentUser){
|
||||
String jwt = createJWT(currentUser);
|
||||
response.setHeader(FilterConstance.HEADER,jwt);
|
||||
return jwt;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
@ECHO OFF
|
||||
|
||||
SET dbhost=127.0.0.1
|
||||
SET dbuser=root
|
||||
SET dbpasswd=Leaper@123
|
||||
SET dbName=test
|
||||
set sqlfile=C:\Users\Peter\Desktop\lia_duoji.sql
|
||||
|
||||
cd D:\hzleaper_auto_install\mysql-5.7.33-winx64\bin
|
||||
|
||||
::执行SQL脚本
|
||||
@ECHO Start!
|
||||
mysql -h%dbhost% -u%dbuser% -p%dbpasswd% < %sqlfile% --default-character-set=utf8
|
||||
|
||||
ECHO OK!
|
||||
PAUSE
|
||||
|
||||
@ECHO Done!
|
||||
@ -1,12 +1,11 @@
|
||||
package com.zhehekeji.web;
|
||||
package com.leaper.web;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
|
||||
@SpringBootApplication(scanBasePackages = {"com.zhehekeji"})
|
||||
@MapperScan("com.zhehekeji.**.mapper.**")
|
||||
@SpringBootApplication(scanBasePackages = {"com.leaper","com.zhehekeji.core"})
|
||||
@MapperScan("com.leaper.**.mapper.**")
|
||||
public class Application {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication springApplication = new SpringApplication(Application.class);
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.config;
|
||||
package com.leaper.web.config;
|
||||
|
||||
import com.github.pagehelper.cache.GuavaCache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.config;
|
||||
package com.leaper.web.config;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.mybatis.spring.SqlSessionFactoryBean;
|
||||
@ -1,10 +1,10 @@
|
||||
package com.zhehekeji.web.controller;
|
||||
package com.leaper.web.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zhehekeji.core.pojo.Result;
|
||||
import com.zhehekeji.web.entity.Category;
|
||||
import com.zhehekeji.web.pojo.category.PageSearch;
|
||||
import com.zhehekeji.web.service.CategoryService;
|
||||
import com.leaper.web.entity.Category;
|
||||
import com.leaper.web.pojo.category.PageSearch;
|
||||
import com.leaper.web.service.CategoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
@ -0,0 +1,35 @@
|
||||
package com.leaper.web.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.leaper.web.pojo.stock.CheckLogSearch;
|
||||
import com.leaper.common.util.ValidatorUtil;
|
||||
import com.zhehekeji.core.pojo.Result;
|
||||
import com.leaper.web.entity.CheckLog;
|
||||
import com.leaper.web.service.CheckLogService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Api(tags = "盘点历史")
|
||||
@RequestMapping("/checkLog")
|
||||
@RestController
|
||||
public class CheckLogController {
|
||||
|
||||
@Resource
|
||||
private CheckLogService checkLogService;
|
||||
@Resource
|
||||
private ValidatorUtil validatorUtil;
|
||||
|
||||
@ApiOperation("盘点历史")
|
||||
@PostMapping("")
|
||||
public Result<PageInfo<CheckLog>> list(@RequestBody CheckLogSearch checkLogSearch){
|
||||
return Result.success(checkLogService.list(checkLogSearch));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.controller;
|
||||
package com.leaper.web.controller;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
package com.leaper.web.controller;
|
||||
|
||||
import com.leaper.web.service.CommandHandler;
|
||||
import com.leaper.web.service.ksec.KsecInfo;
|
||||
import com.zhehekeji.core.pojo.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(value = "monitor",tags = "监控接口 HTTP协议")
|
||||
@RestController
|
||||
@RequestMapping("/monitor")
|
||||
@Slf4j
|
||||
public class MonitorController {
|
||||
|
||||
@PostMapping("/task")
|
||||
public Result monitorTask(@RequestBody KsecInfo ksecInfo){
|
||||
CommandHandler.exec(ksecInfo);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,14 +1,14 @@
|
||||
package com.zhehekeji.web.controller;
|
||||
package com.leaper.web.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zhehekeji.common.util.ValidatorUtil;
|
||||
import com.leaper.common.util.ValidatorUtil;
|
||||
import com.zhehekeji.core.pojo.Result;
|
||||
import com.zhehekeji.web.pojo.OrderSaveReq;
|
||||
import com.zhehekeji.web.pojo.OrderSearch;
|
||||
import com.zhehekeji.web.pojo.OrderVO;
|
||||
import com.zhehekeji.web.service.OrderService;
|
||||
import com.zhehekeji.web.service.PlcCmdInfo;
|
||||
import com.zhehekeji.web.service.PlcService;
|
||||
import com.leaper.web.pojo.OrderSaveReq;
|
||||
import com.leaper.web.pojo.OrderSearch;
|
||||
import com.leaper.web.pojo.OrderVO;
|
||||
import com.leaper.web.service.OrderService;
|
||||
import com.leaper.web.service.PlcCmdInfo;
|
||||
import com.leaper.web.service.PlcService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
@ -1,13 +1,17 @@
|
||||
package com.zhehekeji.web.controller;
|
||||
package com.leaper.web.controller;
|
||||
|
||||
import com.leaper.web.service.GoodsActionTimes;
|
||||
import com.leaper.web.service.PlcService;
|
||||
import com.leaper.web.service.StreetConn;
|
||||
import com.leaper.web.service.StreetService;
|
||||
import com.zhehekeji.core.pojo.Result;
|
||||
import com.zhehekeji.core.util.Assert;
|
||||
import com.zhehekeji.web.config.ConfigProperties;
|
||||
import com.zhehekeji.web.entity.Street;
|
||||
import com.zhehekeji.web.mapper.StreetMapper;
|
||||
import com.zhehekeji.web.service.*;
|
||||
import com.zhehekeji.web.service.ksec.KsecNettyClient;
|
||||
import com.zhehekeji.web.service.robotic.NettyClient;
|
||||
import com.leaper.web.config.ConfigProperties;
|
||||
import com.leaper.web.entity.Street;
|
||||
import com.leaper.web.mapper.StreetMapper;
|
||||
import com.leaper.web.service.*;
|
||||
import com.leaper.web.service.ksec.KsecNettyClient;
|
||||
import com.leaper.web.service.robotic.NettyClient;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -1,21 +1,14 @@
|
||||
package com.zhehekeji.web.controller;
|
||||
package com.leaper.web.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zhehekeji.common.util.HttpUtil;
|
||||
import com.zhehekeji.core.pojo.Result;
|
||||
import com.zhehekeji.core.util.Assert;
|
||||
import com.zhehekeji.web.pojo.IndexVO;
|
||||
import com.zhehekeji.web.service.sick.SickConnMap;
|
||||
import com.leaper.web.service.sick.SickConnMap;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@Api( tags = "传感器")
|
||||
@RequestMapping(value = "/sensor")
|
||||
@RestController()
|
||||
@ -0,0 +1,32 @@
|
||||
package com.leaper.web.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.leaper.web.service.StockLogService;
|
||||
import com.leaper.common.util.ValidatorUtil;
|
||||
import com.zhehekeji.core.pojo.Result;
|
||||
import com.leaper.web.entity.StockLog;
|
||||
import com.leaper.web.pojo.stock.StockLogSearch;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Api(tags = "库存历史")
|
||||
@RequestMapping("/stockLog")
|
||||
@RestController
|
||||
public class StockLogController {
|
||||
|
||||
@Resource
|
||||
private StockLogService stockLogService;
|
||||
@Resource
|
||||
private ValidatorUtil validatorUtil;
|
||||
|
||||
@ApiOperation("库存历史")
|
||||
@PostMapping("")
|
||||
public Result<PageInfo<StockLog>> list(@RequestBody StockLogSearch stockLogSearch){
|
||||
return Result.success(stockLogService.page(stockLogSearch));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
package com.zhehekeji.web.controller;
|
||||
package com.leaper.web.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zhehekeji.common.util.ValidatorUtil;
|
||||
import com.leaper.common.util.ValidatorUtil;
|
||||
import com.zhehekeji.core.pojo.Result;
|
||||
import com.zhehekeji.web.pojo.warn.WarnSearch;
|
||||
import com.zhehekeji.web.pojo.warn.WarnVO;
|
||||
import com.zhehekeji.web.service.WarnService;
|
||||
import com.leaper.web.pojo.warn.WarnSearch;
|
||||
import com.leaper.web.pojo.warn.WarnVO;
|
||||
import com.leaper.web.service.WarnService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.entity;
|
||||
package com.leaper.web.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.entity;
|
||||
package com.leaper.web.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.entity;
|
||||
package com.leaper.web.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.entity;
|
||||
package com.leaper.web.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.entity;
|
||||
package com.leaper.web.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.entity;
|
||||
package com.leaper.web.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.entity;
|
||||
package com.leaper.web.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.entity;
|
||||
package com.leaper.web.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.entity;
|
||||
package com.leaper.web.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
@ -1,6 +1,6 @@
|
||||
package com.zhehekeji.web.lib;
|
||||
package com.leaper.web.lib;
|
||||
|
||||
import com.zhehekeji.web.lib.joyware.NetSDKLib;
|
||||
import com.leaper.web.lib.joyware.NetSDKLib;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -1,6 +1,6 @@
|
||||
package com.zhehekeji.web.lib;
|
||||
package com.leaper.web.lib;
|
||||
|
||||
import com.zhehekeji.web.lib.joyware.NetSDKLib;
|
||||
import com.leaper.web.lib.joyware.NetSDKLib;
|
||||
|
||||
public interface CameraControlLoginModule {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.lib;
|
||||
package com.leaper.web.lib;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.lib;
|
||||
package com.leaper.web.lib;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@ -1,8 +1,8 @@
|
||||
package com.zhehekeji.web.lib.hik;
|
||||
package com.leaper.web.lib.hik;
|
||||
|
||||
import com.sun.jna.Pointer;
|
||||
import com.zhehekeji.web.lib.CameraConnMap;
|
||||
import com.zhehekeji.web.lib.joyware.NetSDKLib;
|
||||
import com.leaper.web.lib.CameraConnMap;
|
||||
import com.leaper.web.lib.joyware.NetSDKLib;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@ -1,7 +1,7 @@
|
||||
package com.zhehekeji.web.lib.joyware;
|
||||
package com.leaper.web.lib.joyware;
|
||||
|
||||
import com.leaper.web.lib.CameraConnMap;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.zhehekeji.web.lib.CameraConnMap;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.lib.joyware;
|
||||
package com.leaper.web.lib.joyware;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@ -1,7 +1,7 @@
|
||||
package com.zhehekeji.web.lib.joyware;
|
||||
package com.leaper.web.lib.joyware;
|
||||
|
||||
import com.sun.jna.Pointer;
|
||||
import com.zhehekeji.common.util.PathUtil;
|
||||
import com.leaper.common.util.PathUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.*;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.lib.joyware;
|
||||
package com.leaper.web.lib.joyware;
|
||||
|
||||
/**
|
||||
* @author 251823
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.lib.joyware;
|
||||
package com.leaper.web.lib.joyware;
|
||||
/**
|
||||
* @author 251823
|
||||
* @description 订阅云台元数据接口输输出参数
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.lib.joyware;
|
||||
package com.leaper.web.lib.joyware;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.zhehekeji.web.lib.joyware;
|
||||
package com.leaper.web.lib.joyware;
|
||||
|
||||
import com.zhehekeji.web.lib.joyware.NetSDKLib.LLong;
|
||||
import com.leaper.web.lib.joyware.NetSDKLib.LLong;
|
||||
import com.sun.jna.Memory;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.Structure;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.zhehekeji.web.lib.joyware;
|
||||
package com.leaper.web.lib.joyware;
|
||||
|
||||
import com.sun.jna.Platform;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue