commit
9a689bf07b
354 changed files with 39150 additions and 0 deletions
@ -0,0 +1,43 @@ |
|||||
|
# Created by .ignore support plugin (hsz.mobi) |
||||
|
### Example user template template |
||||
|
### Example user template |
||||
|
target |
||||
|
target/ |
||||
|
target/* |
||||
|
# IntelliJ project files |
||||
|
.idea |
||||
|
.idea/ |
||||
|
.idea/* |
||||
|
*.iml |
||||
|
.mvn |
||||
|
.mvn/ |
||||
|
.mvn/* |
||||
|
out |
||||
|
gen |
||||
|
### Java template |
||||
|
# Compiled class file |
||||
|
*.class |
||||
|
|
||||
|
# Log file |
||||
|
*.log |
||||
|
|
||||
|
# BlueJ files |
||||
|
*.ctxt |
||||
|
|
||||
|
# Mobile Tools for Java (J2ME) |
||||
|
.mtj.tmp/ |
||||
|
|
||||
|
# Package Files # |
||||
|
*.jar |
||||
|
*.war |
||||
|
*.nar |
||||
|
*.ear |
||||
|
*.zip |
||||
|
*.tar.gz |
||||
|
*.rar |
||||
|
|
||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml |
||||
|
hs_err_pid* |
||||
|
mbg.xml |
||||
|
resources/mbg.xml |
||||
|
resources/application.yml |
@ -0,0 +1,54 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<parent> |
||||
|
<artifactId>ccsens_dh</artifactId> |
||||
|
<groupId>com.ccsens</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>cloudutil</artifactId> |
||||
|
|
||||
|
|
||||
|
<dependencies> |
||||
|
<!--util--> |
||||
|
<dependency> |
||||
|
<artifactId>util</artifactId> |
||||
|
<groupId>com.ccsens</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
<!--eureka client--> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.cloud</groupId> |
||||
|
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> |
||||
|
</dependency> |
||||
|
<!--Feign--> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.cloud</groupId> |
||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId> |
||||
|
</dependency> |
||||
|
<!--hystrix--> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.cloud</groupId> |
||||
|
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId> |
||||
|
</dependency> |
||||
|
<!--sleuth--> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.cloud</groupId> |
||||
|
<artifactId>spring-cloud-starter-sleuth</artifactId> |
||||
|
</dependency> |
||||
|
<!--sleuth 界面--> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.cloud</groupId> |
||||
|
<artifactId>spring-cloud-sleuth-zipkin</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>fastjson</artifactId> |
||||
|
<version>1.2.62</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,13 @@ |
|||||
|
package com.ccsens.cloudutil.annotation; |
||||
|
|
||||
|
import java.lang.annotation.*; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Documented |
||||
|
@Retention(RetentionPolicy.RUNTIME) |
||||
|
@Target(ElementType.METHOD) |
||||
|
public @interface CacheMd5 { |
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.ccsens.cloudutil.annotation; |
||||
|
|
||||
|
import java.lang.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* 有token,则根据token获取userId, 无则不获取 |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/26 16:39 |
||||
|
*/ |
||||
|
@Documented |
||||
|
@Retention(RetentionPolicy.RUNTIME) |
||||
|
@Target(ElementType.METHOD) |
||||
|
public @interface Login { |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package com.ccsens.cloudutil.annotation; |
||||
|
|
||||
|
import java.lang.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* @description: 用于标识方法需要登录,获取userId |
||||
|
* 如果未登录,直接返回用户未登录 |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/09 09:48 |
||||
|
*/ |
||||
|
@Documented |
||||
|
@Retention(RetentionPolicy.RUNTIME) |
||||
|
@Target(ElementType.METHOD) |
||||
|
public @interface MustLogin { |
||||
|
/** |
||||
|
* -1 不处理 |
||||
|
* 0: 数组 |
||||
|
* 1:List |
||||
|
* 2:Set |
||||
|
* 3: Map |
||||
|
* */ |
||||
|
byte type() default -1; |
||||
|
|
||||
|
} |
@ -0,0 +1,96 @@ |
|||||
|
package com.ccsens.cloudutil.aspect; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import com.ccsens.util.Md5Util; |
||||
|
import com.ccsens.util.WebConstant; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.aspectj.lang.ProceedingJoinPoint; |
||||
|
import org.aspectj.lang.annotation.*; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.context.request.RequestContextHolder; |
||||
|
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
|
||||
|
|
||||
|
@Slf4j |
||||
|
@Aspect |
||||
|
@Component |
||||
|
public class CacheMd5Aspect { |
||||
|
|
||||
|
@Pointcut("@annotation(com.ccsens.cloudutil.annotation.CacheMd5)") |
||||
|
public void cacheMd5(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Around("cacheMd5()") |
||||
|
public Object cacheMd5TestAspect1(ProceedingJoinPoint joinPoint) throws Throwable { |
||||
|
long s = System.currentTimeMillis(); |
||||
|
//拿到入参
|
||||
|
Object[] args = joinPoint.getArgs(); |
||||
|
|
||||
|
HttpServletRequest request = ((ServletRequestAttributes) |
||||
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
||||
|
//获取入参的md5值
|
||||
|
final String inMd5 = request.getHeader(WebConstant.HEADER_KEY_MD5); |
||||
|
//获取返回值
|
||||
|
JsonResponse proceed = (JsonResponse) joinPoint.proceed(args); |
||||
|
//入参没有md5直接返回
|
||||
|
if(inMd5 == null){ |
||||
|
log.info("cache---入参md5为空"); |
||||
|
long e = System.currentTimeMillis(); |
||||
|
log.info("切面时间:{}",e-s); |
||||
|
return proceed; |
||||
|
} |
||||
|
//异常直接返回
|
||||
|
if(proceed.getCode() != 200){ |
||||
|
log.info("cache---接口异常"); |
||||
|
long e = System.currentTimeMillis(); |
||||
|
log.info("切面时间:{}",e-s); |
||||
|
return proceed; |
||||
|
} |
||||
|
//获取返回数据
|
||||
|
if(proceed.getData() == null){ |
||||
|
log.info("cache---返回数据为空"); |
||||
|
long e = System.currentTimeMillis(); |
||||
|
log.info("切面时间:{}",e-s); |
||||
|
return proceed; |
||||
|
} |
||||
|
//将date转成json并加密
|
||||
|
String data; |
||||
|
// 判断是否基本类型或字符串
|
||||
|
String type = "TYPE"; |
||||
|
if (proceed.getData() instanceof String ) { |
||||
|
data = (String)proceed.getData(); |
||||
|
} else if (proceed.getData() instanceof StringBuilder || proceed.getData() instanceof StringBuffer) { |
||||
|
data = proceed.getData().toString(); |
||||
|
} else if (proceed.getData().getClass().getField(type) != null && |
||||
|
((Class)proceed.getData().getClass().getField(type).get(null)).isPrimitive()) { |
||||
|
// 基本类型
|
||||
|
data = String.valueOf(proceed.getData()); |
||||
|
} else { |
||||
|
try { |
||||
|
data = JSONObject.toJSONString(proceed.getData()); |
||||
|
} catch (Exception e) { |
||||
|
log.error("md5转换json异常:{}", e); |
||||
|
data = proceed.getData().toString(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
String outMd5 = Md5Util.stringTo(data); |
||||
|
log.info("md5:{}",outMd5); |
||||
|
if(inMd5.equalsIgnoreCase(outMd5)){ |
||||
|
log.info("md5相同则返回空"); |
||||
|
proceed.setMd5Status(JsonResponse.MD5Status.CHECK_SAME_YES); |
||||
|
proceed.setData(null); |
||||
|
} else { |
||||
|
proceed.setMd5Status(JsonResponse.MD5Status.CHECK_SAME_NO); |
||||
|
} |
||||
|
long e = System.currentTimeMillis(); |
||||
|
log.info("切面时间:{}",e-s); |
||||
|
return proceed; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,149 @@ |
|||||
|
package com.ccsens.cloudutil.aspect; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
import com.ccsens.cloudutil.bean.tall.dto.LogDto; |
||||
|
import com.ccsens.cloudutil.feign.TallFeignClient; |
||||
|
import com.ccsens.util.UploadFileUtil_Servlet3; |
||||
|
import com.ccsens.util.WebConstant; |
||||
|
import io.jsonwebtoken.Claims; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.aspectj.lang.ProceedingJoinPoint; |
||||
|
import org.aspectj.lang.annotation.Around; |
||||
|
import org.aspectj.lang.annotation.Aspect; |
||||
|
import org.aspectj.lang.annotation.Pointcut; |
||||
|
import org.aspectj.lang.reflect.MethodSignature; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.core.annotation.Order; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.context.request.RequestContextHolder; |
||||
|
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
|
||||
|
import javax.servlet.ServletRequest; |
||||
|
import javax.servlet.ServletResponse; |
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import javax.servlet.http.Part; |
||||
|
import java.lang.reflect.Method; |
||||
|
import java.util.HashSet; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/10 10:06 |
||||
|
*/ |
||||
|
@Order(1) |
||||
|
@Slf4j |
||||
|
@Aspect |
||||
|
@Component |
||||
|
public class LogAspect { |
||||
|
|
||||
|
@Autowired |
||||
|
private TallFeignClient tallFeignClient; |
||||
|
|
||||
|
/**不记录日志的接口*/ |
||||
|
private Set<String> ignoreUrlSet = new HashSet<>(); |
||||
|
{ |
||||
|
ignoreUrlSet.add("/log/operation"); |
||||
|
ignoreUrlSet.add("/users/token"); |
||||
|
ignoreUrlSet.add("/users/claims"); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Pointcut("execution(* com.ccsens.tall.web..*(..)) || execution(* com.ccsens.ht.api..*(..))" + |
||||
|
" || execution(* com.ccsens.mt.api..*(..)) || execution(* com.ccsens.game.api..*(..))" + |
||||
|
" || execution(* com.ccsens.health.api..*(..)) || execution(* com.ccsens.pims.api..*(..))") |
||||
|
public void logAdvice(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Around("logAdvice()") |
||||
|
public Object around(ProceedingJoinPoint pjp) throws Throwable { |
||||
|
LogDto logDto = initLog(pjp); |
||||
|
|
||||
|
|
||||
|
Object result; |
||||
|
try { |
||||
|
result = pjp.proceed(); |
||||
|
} catch (Throwable throwable) { |
||||
|
log.error("方法运行异常", throwable); |
||||
|
if (logDto != null) { |
||||
|
String message = throwable.toString(); |
||||
|
logDto.setResult(message.length() > 1000 ? message.substring(0,1000) : message); |
||||
|
tallFeignClient.log(logDto); |
||||
|
} |
||||
|
throw throwable; |
||||
|
} |
||||
|
if (logDto != null) { |
||||
|
if("/users/signin".equals(logDto.getUrl()) && result != null){ |
||||
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(result)); |
||||
|
if(json.getIntValue("code") == 200 && json.get("data") != null){ |
||||
|
long userId = json.getJSONObject("data").getLongValue("id"); |
||||
|
logDto.setUserId(userId); |
||||
|
} |
||||
|
} |
||||
|
String message = result == null ? null : result.toString().length() > 1000 ? result.toString().substring(0, 1000) : result.toString(); |
||||
|
logDto.setResult(message); |
||||
|
tallFeignClient.log(logDto); |
||||
|
} |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取方法路径、描述、参数 |
||||
|
* @param pjp |
||||
|
* @return |
||||
|
*/ |
||||
|
private LogDto initLog(ProceedingJoinPoint pjp) { |
||||
|
|
||||
|
//路径
|
||||
|
HttpServletRequest request = ((ServletRequestAttributes) |
||||
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
||||
|
String url = request.getServletPath(); |
||||
|
|
||||
|
if (ignoreUrlSet.contains(url)){ |
||||
|
log.info("保存日志,不进行记录"); |
||||
|
return null; |
||||
|
} |
||||
|
LogDto dto = new LogDto(); |
||||
|
dto.setUrl(url); |
||||
|
dto.setFacility(request.getHeader("fingerprint")); |
||||
|
//参数
|
||||
|
Object[] args = pjp.getArgs(); |
||||
|
StringBuilder param = new StringBuilder(); |
||||
|
for (int i = 0; i < args.length; i++) { |
||||
|
if (args[i] == null) { |
||||
|
continue; |
||||
|
}else if (args[i] instanceof ServletResponse) { |
||||
|
continue; |
||||
|
} else if (args[i] instanceof ServletRequest) { |
||||
|
Object claims = request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS); |
||||
|
String userId = claims == null ? null : ((Claims) claims).getSubject(); |
||||
|
if (userId != null) { |
||||
|
param.append("userId:").append(userId).append("--"); |
||||
|
dto.setUserId(Long.parseLong(userId)); |
||||
|
} |
||||
|
|
||||
|
} else if (args[i] instanceof Part) { |
||||
|
param.append("file:").append(UploadFileUtil_Servlet3.getFileNameByPart((Part)args[i])).append("--"); |
||||
|
}else { |
||||
|
param.append(args[i]).append("--"); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
dto.setParams(param.length() > 1000 ? param.substring(0, 1000) : param.toString()); |
||||
|
try { |
||||
|
MethodSignature methodSignature = (MethodSignature) pjp.getSignature(); |
||||
|
Method method = pjp.getTarget().getClass().getMethod(methodSignature.getName(), methodSignature.getParameterTypes()); |
||||
|
ApiOperation annotation = method.getAnnotation(ApiOperation.class); |
||||
|
dto.setMethodDesc(annotation == null ? "" : annotation.value()); |
||||
|
} catch (Exception e) { |
||||
|
log.error("获取方法时异常",e); |
||||
|
} |
||||
|
|
||||
|
return dto; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,150 @@ |
|||||
|
package com.ccsens.cloudutil.aspect; |
||||
|
|
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
import com.ccsens.cloudutil.annotation.MustLogin; |
||||
|
import com.ccsens.cloudutil.feign.Tall3FeignClient; |
||||
|
import com.ccsens.util.CodeEnum; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import com.ccsens.util.WebConstant; |
||||
|
import com.ccsens.util.bean.dto.QueryDto; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.aspectj.lang.ProceedingJoinPoint; |
||||
|
import org.aspectj.lang.Signature; |
||||
|
import org.aspectj.lang.annotation.Around; |
||||
|
import org.aspectj.lang.annotation.Aspect; |
||||
|
import org.aspectj.lang.annotation.Pointcut; |
||||
|
import org.aspectj.lang.reflect.MethodSignature; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.core.annotation.Order; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.context.request.RequestContextHolder; |
||||
|
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import java.lang.reflect.*; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/09 09:54 |
||||
|
*/ |
||||
|
@Order(0) |
||||
|
@Slf4j |
||||
|
@Aspect |
||||
|
@Component |
||||
|
public class MustLoginAspect { |
||||
|
@Autowired |
||||
|
private Tall3FeignClient tall3FeignClient; |
||||
|
|
||||
|
@Pointcut("@annotation(com.ccsens.cloudutil.annotation.MustLogin) || @annotation(com.ccsens.cloudutil.annotation.Login) ") |
||||
|
public void loginAdvice(){} |
||||
|
|
||||
|
@Around("loginAdvice()") |
||||
|
public Object around(ProceedingJoinPoint pjp) throws Throwable { |
||||
|
|
||||
|
HttpServletRequest request = ((ServletRequestAttributes) |
||||
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
||||
|
|
||||
|
final String authHeader = request.getHeader(WebConstant.HEADER_KEY_TOKEN); |
||||
|
// if(StrUtil.isEmpty(authHeader)){
|
||||
|
// return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
|
||||
|
// }
|
||||
|
Object[] args = pjp.getArgs(); |
||||
|
QueryDto dto = args == null || args.length < 1 ? null : (QueryDto) args[0]; |
||||
|
|
||||
|
//获取userId
|
||||
|
JsonResponse response = null; |
||||
|
if(StrUtil.isNotEmpty(authHeader)){ |
||||
|
log.info("MustLogin————token:{}", authHeader); |
||||
|
response = tall3FeignClient.getUserIdByToken(authHeader); |
||||
|
} |
||||
|
log.info("{}获取userId:{}", authHeader, response); |
||||
|
|
||||
|
Signature signature = pjp.getSignature(); |
||||
|
MethodSignature methodSignature = (MethodSignature) signature; |
||||
|
Method targetMethod = methodSignature.getMethod(); |
||||
|
|
||||
|
MustLogin mustLoginAnnotation = targetMethod.getAnnotation(MustLogin.class); |
||||
|
fillSpecial(dto, mustLoginAnnotation); |
||||
|
if (mustLoginAnnotation == null) { |
||||
|
log.info("不是必须登录,有token,则添加userId,没有则不添加"); |
||||
|
if (response != null && response.getCode().intValue() == CodeEnum.SUCCESS.getCode().intValue() && response.getData() != null) { |
||||
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(response.getData())); |
||||
|
Long userId = json.getLong("id"); |
||||
|
String userName = json.getString("userName"); |
||||
|
String avatarUrl = json.getString("avatarUrl"); |
||||
|
String phone = json.getString("phone"); |
||||
|
if (dto != null) { |
||||
|
dto.setUserId(userId); |
||||
|
dto.setUserName(userName); |
||||
|
dto.setAvatarUrl(avatarUrl); |
||||
|
dto.setPhone(phone); |
||||
|
} |
||||
|
} |
||||
|
Object result = pjp.proceed(); |
||||
|
return result; |
||||
|
} |
||||
|
//必须登录,未登录直接返回未登录相关信息
|
||||
|
//必须登录,未登录直接返回未登录相关信息
|
||||
|
if (response == null) { |
||||
|
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); |
||||
|
} |
||||
|
if (response.getCode().intValue() != CodeEnum.SUCCESS.getCode().intValue()) { |
||||
|
return response; |
||||
|
} |
||||
|
if (response.getData() == null) { |
||||
|
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); |
||||
|
} |
||||
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(response.getData())); |
||||
|
Long userId = json.getLong("id"); |
||||
|
String userName = json.getString("userName"); |
||||
|
String avatarUrl = json.getString("avatarUrl"); |
||||
|
String phone = json.getString("phone"); |
||||
|
if (userId == null || userId == 0) { |
||||
|
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); |
||||
|
} |
||||
|
|
||||
|
if (dto != null) { |
||||
|
dto.setUserId(userId); |
||||
|
dto.setUserName(userName); |
||||
|
dto.setAvatarUrl(avatarUrl); |
||||
|
dto.setPhone(phone); |
||||
|
} |
||||
|
|
||||
|
Object result = pjp.proceed(); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
private void fillSpecial(QueryDto dto, MustLogin mustLoginAnnotation) { |
||||
|
if (mustLoginAnnotation == null) { |
||||
|
return; |
||||
|
} |
||||
|
if (dto != null && mustLoginAnnotation.type() > -1) { |
||||
|
switch (mustLoginAnnotation.type()) { |
||||
|
case 0: |
||||
|
Object obj = dto.getParam(); |
||||
|
if (obj!= null && !obj.getClass().isArray()) { |
||||
|
Class<?> aClass = dto.getParam().getClass(); |
||||
|
Object o = Array.newInstance(aClass, 1); |
||||
|
Array.set(o, 0, dto.getParam()); |
||||
|
dto.setParam(o); |
||||
|
} |
||||
|
break; |
||||
|
case 1: |
||||
|
Object obj1 = dto.getParam(); |
||||
|
if (obj1!= null && !(obj1 instanceof List)) { |
||||
|
ArrayList arrayList = new ArrayList(); |
||||
|
arrayList.add(dto.getParam()); |
||||
|
dto.setParam(arrayList); |
||||
|
} |
||||
|
break; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.ccsens.cloudutil.bean; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/11/27 10:06 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class QueryParam<T> { |
||||
|
private T t; |
||||
|
private Long userId; |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class HolidaysDto { |
||||
|
@Data |
||||
|
public static class GetHolidays{ |
||||
|
private Long startTime; |
||||
|
private Long endTime; |
||||
|
} |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/09 18:01 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel |
||||
|
public class LogDto { |
||||
|
|
||||
|
private Long id; |
||||
|
@ApiModelProperty("接口地址") |
||||
|
private String url; |
||||
|
@ApiModelProperty("接口参数") |
||||
|
private String params; |
||||
|
@ApiModelProperty("接口描述") |
||||
|
private String methodDesc; |
||||
|
@ApiModelProperty("接口返回值(或异常)") |
||||
|
private String result; |
||||
|
@ApiModelProperty("设备信息") |
||||
|
private String facility; |
||||
|
@ApiModelProperty("设备信息") |
||||
|
private Long userId; |
||||
|
} |
@ -0,0 +1,169 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.dto; |
||||
|
|
||||
|
import cn.hutool.core.collection.CollectionUtil; |
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import com.ccsens.util.CodeEnum; |
||||
|
import com.ccsens.util.PropUtil; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import org.springframework.beans.BeanUtils; |
||||
|
|
||||
|
import javax.validation.constraints.NotEmpty; |
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/05 10:37 |
||||
|
*/ |
||||
|
public class MemberRoleDto { |
||||
|
@ApiModel("MemberRoleDtoAssign") |
||||
|
@Data |
||||
|
public static class Assign{ |
||||
|
@ApiModelProperty("项目ID") |
||||
|
private Long projectId; |
||||
|
@ApiModelProperty("项目名称") |
||||
|
private String projectName = PropUtil.projectName; |
||||
|
@ApiModelProperty("角色") |
||||
|
private List<String> roleNames; |
||||
|
@ApiModelProperty("用户ID") |
||||
|
@NotNull |
||||
|
private Long userId; |
||||
|
@ApiModelProperty("用户名") |
||||
|
@NotNull |
||||
|
private String name; |
||||
|
@ApiModelProperty("操作人ID") |
||||
|
@NotNull |
||||
|
private Long createBy; |
||||
|
|
||||
|
|
||||
|
public CodeEnum check(){ |
||||
|
//至少有一个条件
|
||||
|
boolean noProject = (projectId == null || projectId == 0 ) && StrUtil.isBlank(projectName); |
||||
|
if (noProject) { |
||||
|
return CodeEnum.PARAM_ERROR; |
||||
|
} |
||||
|
return CodeEnum.SUCCESS; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@ApiModel("MemberRoleDtoDelete") |
||||
|
@Data |
||||
|
public static class Delete{ |
||||
|
@ApiModelProperty("项目ID") |
||||
|
private Long projectId; |
||||
|
@ApiModelProperty("项目名称") |
||||
|
private String projectName = PropUtil.projectName; |
||||
|
@ApiModelProperty("角色") |
||||
|
private List<String> roleNames; |
||||
|
@ApiModelProperty("用户ID") |
||||
|
@NotNull |
||||
|
private Long userId; |
||||
|
|
||||
|
public CodeEnum check(){ |
||||
|
//至少有一个条件
|
||||
|
boolean hasProject = (projectId == null || projectId == 0 ) && StrUtil.isBlank(projectName); |
||||
|
if (!hasProject) { |
||||
|
return CodeEnum.PARAM_ERROR; |
||||
|
} |
||||
|
return CodeEnum.SUCCESS; |
||||
|
} |
||||
|
|
||||
|
public Assign toAssign(){ |
||||
|
Assign assign = new Assign(); |
||||
|
BeanUtils.copyProperties(this, assign); |
||||
|
return assign; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("添加成员") |
||||
|
public static class SaveMember{ |
||||
|
@NotNull |
||||
|
@ApiModelProperty("项目id") |
||||
|
private Long projectId; |
||||
|
@ApiModelProperty("成员名") |
||||
|
private String memberName; |
||||
|
@NotEmpty |
||||
|
@ApiModelProperty("成员手机号") |
||||
|
private String phone; |
||||
|
@ApiModelProperty("所属角色的id") |
||||
|
private List<Long> roleId; |
||||
|
@ApiModelProperty("奖惩干系人手机号") |
||||
|
private String stakeholderPhone; |
||||
|
@ApiModelProperty("奖惩干系人姓名") |
||||
|
private String stakeholderName; |
||||
|
@ApiModelProperty("token") |
||||
|
private String token; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("添加角色") |
||||
|
public static class SaveRole{ |
||||
|
@NotNull(message = "项目不能为空") |
||||
|
@ApiModelProperty("项目id") |
||||
|
private Long projectId; |
||||
|
@NotEmpty(message = "角色名不能为空") |
||||
|
@ApiModelProperty("角色名") |
||||
|
private String roleName; |
||||
|
@ApiModelProperty("token") |
||||
|
private String token; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel |
||||
|
public static class GetMemberByPhone{ |
||||
|
@ApiModelProperty("项目id") |
||||
|
private Long projectId; |
||||
|
@ApiModelProperty("手机号") |
||||
|
private String phone; |
||||
|
@ApiModelProperty("token") |
||||
|
private String token; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("给角色添加成员") |
||||
|
public static class SaveMemberInRole{ |
||||
|
@NotNull(message = "角色Id不能为空") |
||||
|
@ApiModelProperty("角色id") |
||||
|
private Long roleId; |
||||
|
@ApiModelProperty("成员Id") |
||||
|
private Long memberId; |
||||
|
@ApiModelProperty("token") |
||||
|
private String token; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("给角色添加成员") |
||||
|
public static class DeleteRole{ |
||||
|
@ApiModelProperty("角色id") |
||||
|
private Long roleId; |
||||
|
@ApiModelProperty("token") |
||||
|
private String token; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("给模板项目添加成员") |
||||
|
public static class SaveMemberForTemplate { |
||||
|
@NotNull(message = "项目id不能为空") |
||||
|
@ApiModelProperty("项目id") |
||||
|
private Long projectId; |
||||
|
@ApiModelProperty("成员列表") |
||||
|
private List<MemberForTemplate> memberForTemplate; |
||||
|
} |
||||
|
@Data |
||||
|
@ApiModel("模板项目成员信息") |
||||
|
public static class MemberForTemplate { |
||||
|
@ApiModelProperty("用户id(医生)") |
||||
|
private Long userId; |
||||
|
@ApiModelProperty("成员名") |
||||
|
private String memberName; |
||||
|
@ApiModelProperty("成员手机号") |
||||
|
private String phone; |
||||
|
@ApiModelProperty("所属角色的名称") |
||||
|
private List<String> roleName; |
||||
|
} |
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotEmpty; |
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.util.List; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
/** |
||||
|
* @author AUSU |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ProjectDto { |
||||
|
@Data |
||||
|
@ApiModel("根据模板复制项目") |
||||
|
public static class CopyProject{ |
||||
|
@NotNull(message = "请选择要复制得项目") |
||||
|
@ApiModelProperty("项目id") |
||||
|
private Long projectId; |
||||
|
@ApiModelProperty("新项目名字") |
||||
|
private String projectName; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("添加项目信息") |
||||
|
public static class SaveProjectDto{ |
||||
|
@ApiModelProperty("id") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("父项目id") |
||||
|
private Long parentId; |
||||
|
@ApiModelProperty("项目名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty("开始时间") |
||||
|
private Long startTime; |
||||
|
@ApiModelProperty("结束时间") |
||||
|
private Long endTime; |
||||
|
@ApiModelProperty("接口访问地址") |
||||
|
private String url; |
||||
|
@ApiModelProperty("模板code") |
||||
|
private String code; |
||||
|
@ApiModelProperty("用户列表") |
||||
|
private Set<Long> userIdList; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("保存用户项目列表") |
||||
|
public static class SaveUserProject{ |
||||
|
@ApiModelProperty("项目id") |
||||
|
private List<Long> projectId; |
||||
|
@ApiModelProperty("用户id") |
||||
|
private List<Long> userId; |
||||
|
} |
||||
|
} |
@ -0,0 +1,137 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.dto; |
||||
|
|
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import com.ccsens.util.exception.BaseException; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import lombok.NonNull; |
||||
|
|
||||
|
import javax.validation.constraints.NotEmpty; |
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel |
||||
|
public class TallTaskDto { |
||||
|
|
||||
|
@ApiModel |
||||
|
@Data |
||||
|
public static class AddTask { |
||||
|
@ApiModelProperty("关联项目Id") |
||||
|
private Long projectId; |
||||
|
@ApiModelProperty("关联的任务id(detailId)") |
||||
|
private Long parentTaskId; |
||||
|
@ApiModelProperty("任务名称") |
||||
|
@NotEmpty(message = "任务名不能为空") |
||||
|
private String taskName; |
||||
|
@ApiModelProperty("任务描述") |
||||
|
private String description; |
||||
|
@ApiModelProperty("负责人id") |
||||
|
@NotNull(message = "请选择负责人") |
||||
|
private Long executorId; |
||||
|
@ApiModelProperty("开始时间") |
||||
|
private Long beginTime; |
||||
|
@ApiModelProperty("结束时间") |
||||
|
private Long endTime; |
||||
|
@ApiModelProperty("重复周期") |
||||
|
private String cycle; |
||||
|
@ApiModelProperty("交付物") |
||||
|
private String taskDeliver; |
||||
|
@ApiModelProperty("插件") |
||||
|
private List<Long> pluginList; |
||||
|
@ApiModelProperty("优先级 3,紧急重要 2,紧急不重要 1,重要不紧急 0,不重要不紧急 默认0") |
||||
|
private Byte priority; |
||||
|
@ApiModelProperty("任务提醒消息") |
||||
|
private TaskRemindByAdd taskRemind; |
||||
|
@ApiModelProperty("token") |
||||
|
private String token; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("添加时设置任务提醒") |
||||
|
public static class TaskRemindByAdd{ |
||||
|
@ApiModelProperty("提醒时机 0不提醒 1开始前,2开始时,3开始后,4结束前,5结束时,6结束后,7自定义时间") |
||||
|
private Byte remindTiming; |
||||
|
@ApiModelProperty("时长 提醒时机是“开始时”或“结束时”可以为空") |
||||
|
private Long duration = 0L; |
||||
|
@ApiModelProperty("时间单位 0分钟 1小时 2天") |
||||
|
private Byte unit; |
||||
|
|
||||
|
public Long getDuration(){ |
||||
|
if(ObjectUtil.isNull(unit)) { |
||||
|
throw new BaseException("时间单位不能为空"); |
||||
|
} |
||||
|
if(remindTiming == 7){ |
||||
|
return duration; |
||||
|
} |
||||
|
switch (unit) { |
||||
|
case 0: |
||||
|
return duration * 60 * 1000L; |
||||
|
case 1: |
||||
|
return duration * 60 * 60 * 1000L; |
||||
|
case 2: |
||||
|
return duration * 24 * 60 * 60 * 1000L; |
||||
|
default: |
||||
|
return duration; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("修改任务详细信息") |
||||
|
public static class UpdateTaskInfo{ |
||||
|
@ApiModelProperty("任务id") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("任务名") |
||||
|
private String name; |
||||
|
@ApiModelProperty("任务详情") |
||||
|
private String description; |
||||
|
@ApiModelProperty("负责人") |
||||
|
private Long executorRole; |
||||
|
@ApiModelProperty("任务开始时间") |
||||
|
private Long beginTime; |
||||
|
@ApiModelProperty("任务结束时间") |
||||
|
private Long endTime; |
||||
|
@ApiModelProperty("重复频率") |
||||
|
private String cycle; |
||||
|
@ApiModelProperty("任务奖惩") |
||||
|
private Long money; |
||||
|
@ApiModelProperty("任务切换模式,0时间到立刻切换 1延迟delay_time切换 2手动切换") |
||||
|
private int delay; |
||||
|
@ApiModelProperty("延迟切换时间") |
||||
|
private Long delayTime; |
||||
|
@ApiModelProperty("优先级 3,紧急重要 2,紧急不重要 1,重要不紧急 0,不重要不紧急 默认0") |
||||
|
private Byte priority; |
||||
|
@ApiModelProperty("是否是里程碑 0否 1是") |
||||
|
private Byte milestone; |
||||
|
@ApiModelProperty("需要修改的插件Id") |
||||
|
private List<Long> plugins; |
||||
|
@ApiModelProperty("token") |
||||
|
private String token; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("修改插件配置") |
||||
|
public static class UpdatePluginConfig { |
||||
|
@NonNull |
||||
|
@ApiModelProperty("任务id") |
||||
|
private Long taskId; |
||||
|
@ApiModelProperty("任务插件id") |
||||
|
private Long taskPluginId; |
||||
|
@ApiModelProperty("页面接口路径") |
||||
|
private String webPath; |
||||
|
@ApiModelProperty("入参") |
||||
|
private String importParam; |
||||
|
@ApiModelProperty("放置位置 默认0 ,0任务名 1详情页 2任务下") |
||||
|
private Byte placeLocation; |
||||
|
@ApiModelProperty("程序位置 0:tall内部,1外部") |
||||
|
private Byte routineLocation; |
||||
|
@ApiModelProperty("token") |
||||
|
private String token; |
||||
|
|
||||
|
public UpdatePluginConfig() { |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: whj |
||||
|
* @time: 2021/6/3 10:10 |
||||
|
*/ |
||||
|
public class TaskDto { |
||||
|
@ApiModel |
||||
|
@Data |
||||
|
public static class StartTask { |
||||
|
@ApiModelProperty("项目Id") |
||||
|
@NotNull(message = "projectId is required.") |
||||
|
private Long projectId; |
||||
|
@ApiModelProperty("角色Id") |
||||
|
@NotNull(message = "roleId is required.") |
||||
|
private Long roleId; |
||||
|
@ApiModelProperty("任务在当前时间的subTimeId") |
||||
|
@NotNull(message = "taskId is required.") |
||||
|
private Long taskId; |
||||
|
@ApiModelProperty("开始任务的时间 如果为空则为当前时间") |
||||
|
private Long startTime; |
||||
|
@ApiModelProperty("是否修改后续任务的时间(0否,1是)") |
||||
|
private Byte isUpdateTime = 0; |
||||
|
} |
||||
|
|
||||
|
@ApiModel |
||||
|
@Data |
||||
|
public static class TaskSubTimeId { |
||||
|
@ApiModelProperty("任务id") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("任务完成状态0未完成 1进行中 2已完成") |
||||
|
private Integer completedStatus; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotEmpty; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/05 10:22 |
||||
|
*/ |
||||
|
public class UserDto { |
||||
|
//默认注册
|
||||
|
@Data |
||||
|
@ApiModel("UserDtoDefaultUserSingup") |
||||
|
public static class DefaultUserSingup{ |
||||
|
@ApiModelProperty("手机号") |
||||
|
@NotEmpty(message = "手机号不能为空") |
||||
|
private String phone; |
||||
|
@ApiModelProperty("账号") |
||||
|
@NotEmpty(message = "账号不能为空.") |
||||
|
private String account; |
||||
|
@ApiModelProperty("来源") |
||||
|
private byte source; |
||||
|
} |
||||
|
} |
@ -0,0 +1,62 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Data |
||||
|
public class WpsDto { |
||||
|
@Data |
||||
|
@ApiModel("业务和WPS") |
||||
|
public static class Business{ |
||||
|
@ApiModelProperty("业务ID") |
||||
|
private Long businessId; |
||||
|
@ApiModelProperty("wps文件ID") |
||||
|
private Long wpsFileId; |
||||
|
@ApiModelProperty("业务类型 0项目WBS 1交付物 2会议记录。后面是pims内的表:3产品依据表,4产品收入表,5成本表,6损益表,7现金流表") |
||||
|
private Byte businessType; |
||||
|
@ApiModelProperty("用户ID") |
||||
|
private Long userId; |
||||
|
@ApiModelProperty("文件名") |
||||
|
private String fileName; |
||||
|
@ApiModelProperty("文件路径,默认在WebConstant.UPLOAD_PATH_BASE下") |
||||
|
private String filePath; |
||||
|
@ApiModelProperty("文件实际存储路径") |
||||
|
private String realFilePath; |
||||
|
@ApiModelProperty("文件大小") |
||||
|
private Long fileSize; |
||||
|
@ApiModelProperty("操作类型 值:WebConstant Wps USER_OPERATION... ") |
||||
|
private byte operation; |
||||
|
@ApiModelProperty("操作权限 WebConstant Wps PROJECT_PRIVILEGE...") |
||||
|
private byte privilege; |
||||
|
@ApiModelProperty("操作权限查询路径") |
||||
|
private String privilegeQueryUrl; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查找wps文件路径") |
||||
|
public static class VisitWpsUrl{ |
||||
|
@NotNull |
||||
|
@ApiModelProperty("业务ID") |
||||
|
private Long businessId; |
||||
|
@NotNull |
||||
|
@ApiModelProperty("业务类型") |
||||
|
private byte businessType; |
||||
|
@NotNull |
||||
|
@ApiModelProperty("userId") |
||||
|
private Long userId; |
||||
|
@ApiModelProperty("访问路径") |
||||
|
private Map<String, String> params; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("异步通知") |
||||
|
public static class Async{ |
||||
|
@ApiModelProperty("文件ID") |
||||
|
private Long fileId; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class HolidaysVo { |
||||
|
|
||||
|
@Data |
||||
|
public static class Holidays{ |
||||
|
private List<String> workday; |
||||
|
private List<String> nonWorkday; |
||||
|
} |
||||
|
} |
@ -0,0 +1,57 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class MemberVo { |
||||
|
|
||||
|
@Data |
||||
|
public static class MemberInfo{ |
||||
|
private Long id; |
||||
|
private Long userId; |
||||
|
private Long projectId; |
||||
|
private String nickname; |
||||
|
private String avatarUrl; |
||||
|
private Integer no; |
||||
|
private String phone; |
||||
|
private String description; |
||||
|
private Long joinTime; |
||||
|
private Long stakeholderId; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("角色信息") |
||||
|
public static class RoleInfo{ |
||||
|
@ApiModelProperty("角色id") |
||||
|
private Long roleId; |
||||
|
@ApiModelProperty("角色名") |
||||
|
private String roleName; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("添加时返回成员信息") |
||||
|
public static class Member{ |
||||
|
@ApiModelProperty("成员id") |
||||
|
private Long memberId; |
||||
|
@ApiModelProperty("成员名") |
||||
|
private String memberName; |
||||
|
@ApiModelProperty("手机号") |
||||
|
private String phone; |
||||
|
@ApiModelProperty("userId") |
||||
|
private Long userId; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查找项目内所有的成员") |
||||
|
public static class MemberList{ |
||||
|
@ApiModelProperty("成员id") |
||||
|
private Long memberId; |
||||
|
@ApiModelProperty("成员名") |
||||
|
private String memberName; |
||||
|
@ApiModelProperty("userId") |
||||
|
private Long userId; |
||||
|
} |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class PluginVo { |
||||
|
|
||||
|
@ApiModel |
||||
|
@Data |
||||
|
public static class PluginSignField{ |
||||
|
@ApiModelProperty("变量名") |
||||
|
private String name; |
||||
|
@ApiModelProperty("展示名") |
||||
|
private String description; |
||||
|
@ApiModelProperty("类型 0文本 1文本框 2单选 3多选") |
||||
|
private int type; |
||||
|
@ApiModelProperty("类型值(文本,单选,多选,展示的内容 例:{\"1\":\"男\",\"2\":\"女\"},)") |
||||
|
private String fieldValue; |
||||
|
@ApiModelProperty("正则表达式") |
||||
|
private String format; |
||||
|
@ApiModelProperty("是否必填") |
||||
|
private int isRequired; |
||||
|
@ApiModelProperty("是否支持模糊查询") |
||||
|
private int isFuzzy; |
||||
|
} |
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author AUSU |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ProjectVo { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("复制的项目信息") |
||||
|
public static class ProjectInfo{ |
||||
|
@ApiModelProperty("项目id") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("任务详情") |
||||
|
private List<TaskDetail> taskDetails; |
||||
|
} |
||||
|
@Data |
||||
|
@ApiModel("任务详情") |
||||
|
public static class TaskDetail{ |
||||
|
@ApiModelProperty("任务详情id") |
||||
|
private Long taskDetailId; |
||||
|
@ApiModelProperty("任务详情名称") |
||||
|
private String taskDetailName; |
||||
|
@ApiModelProperty("任务等级") |
||||
|
private Byte taskDetailLevel; |
||||
|
@ApiModelProperty("任务详情下的分解任务") |
||||
|
private List<TaskSub> taskSubList; |
||||
|
} |
||||
|
@Data |
||||
|
@ApiModel("分解任务") |
||||
|
public static class TaskSub{ |
||||
|
@ApiModelProperty("分解任务id") |
||||
|
private Long taskSubId; |
||||
|
@ApiModelProperty("分解任务开始时间") |
||||
|
private Long startTime; |
||||
|
@ApiModelProperty("分解任务结束时间") |
||||
|
private Long endTime; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,124 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.vo; |
||||
|
|
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class TaskVo { |
||||
|
@Data |
||||
|
public static class TaskInfoWithFeign{ |
||||
|
private Long id; |
||||
|
private String name; |
||||
|
private Long projectId; |
||||
|
private String projectName; |
||||
|
} |
||||
|
|
||||
|
@ApiModel |
||||
|
@Data |
||||
|
public static class NormalTask{ |
||||
|
@ApiModelProperty("任务详细信息id") |
||||
|
private Long detailId; |
||||
|
@ApiModelProperty("当前任务的时间段id") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty("详细描述") |
||||
|
private String description; |
||||
|
@ApiModelProperty("父任务名称") |
||||
|
private String parentName; |
||||
|
@ApiModelProperty("所属项目id") |
||||
|
private Long projectId; |
||||
|
@ApiModelProperty("所属项目名称") |
||||
|
private String projectName; |
||||
|
@ApiModelProperty("负责人Id") |
||||
|
private Long executorRole; |
||||
|
@ApiModelProperty("负责人名称") |
||||
|
private String executorRoleName; |
||||
|
@ApiModelProperty("开始时间") |
||||
|
private Long beginTime; |
||||
|
@ApiModelProperty("结束时间") |
||||
|
private Long endTime; |
||||
|
@ApiModelProperty("时长") |
||||
|
private Long duration; |
||||
|
@ApiModelProperty("循环周期") |
||||
|
private String cycle; |
||||
|
@ApiModelProperty("跳转模式 0自动,1延迟,2手动") |
||||
|
private int delay; |
||||
|
@ApiModelProperty("实际开始时间") |
||||
|
private Long realBeginTime; |
||||
|
@ApiModelProperty("实际结束时间") |
||||
|
private Long realEndTime; |
||||
|
@ApiModelProperty("跳转结束时间") |
||||
|
private Long loopEndTime; |
||||
|
@ApiModelProperty("跳转的任务id") |
||||
|
private Long loopTo; |
||||
|
@ApiModelProperty("执行时间") |
||||
|
private Long execTimes; |
||||
|
@ApiModelProperty("奖惩") |
||||
|
private BigDecimal money; |
||||
|
@ApiModelProperty("状态:0-未开始,1-进行中,2-已完成") |
||||
|
private int process; |
||||
|
@ApiModelProperty("子项目id") |
||||
|
private Long subProjectId; |
||||
|
@ApiModelProperty("子项目名字") |
||||
|
private String subProjectName; |
||||
|
@ApiModelProperty("服务器时间") |
||||
|
private Long serverTime; |
||||
|
@ApiModelProperty("任务类型 0普通任务 1虚拟任务") |
||||
|
private int virtual; |
||||
|
@ApiModelProperty("有无分组") |
||||
|
private int hasGroup; |
||||
|
@ApiModelProperty("分数") |
||||
|
private BigDecimal score; |
||||
|
@ApiModelProperty("插件") |
||||
|
private List<PluginVo> plugins; |
||||
|
@ApiModelProperty("二级任务") |
||||
|
private List<NormalTask> secondTasks; |
||||
|
@ApiModelProperty("时间状态 0:正常 1:任务开始 2:任务结束") |
||||
|
private Byte timeStatus = 0; |
||||
|
@ApiModelProperty("当前周期内任务的序号") |
||||
|
private int sequence; |
||||
|
@ApiModelProperty("页面/接口路径") |
||||
|
private String webPath; |
||||
|
@ApiModelProperty("程序位置 0:tall内部,1外部") |
||||
|
private Byte routineLocation; |
||||
|
@ApiModelProperty("入参") |
||||
|
private String importParam; |
||||
|
public Long getDuration(){ |
||||
|
if(ObjectUtil.isNotNull(beginTime) && ObjectUtil.isNotNull(endTime)) { |
||||
|
return endTime - beginTime; |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
public Long getServerTime(){ |
||||
|
return System.currentTimeMillis(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@ApiModel |
||||
|
@Data |
||||
|
public static class PluginVo{ |
||||
|
@ApiModelProperty("插件id") |
||||
|
private String id; |
||||
|
@ApiModelProperty("插件名") |
||||
|
private String name; |
||||
|
@ApiModelProperty("插件描述") |
||||
|
private String description; |
||||
|
@ApiModelProperty("显示分类") |
||||
|
private String showType; |
||||
|
@ApiModelProperty("页面/接口路径") |
||||
|
private String webPath; |
||||
|
@ApiModelProperty("程序位置 0:tall内部,1外部") |
||||
|
private Byte routineLocation; |
||||
|
@ApiModelProperty("入参") |
||||
|
private String importParam; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/05 10:22 |
||||
|
*/ |
||||
|
public class UserVo { |
||||
|
//默认注册
|
||||
|
@Data |
||||
|
@ApiModel("UserVoDefaultUserSingup") |
||||
|
public static class DefaultUserSingup{ |
||||
|
@ApiModelProperty("用户ID") |
||||
|
private Long id; |
||||
|
} |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class WpsVo { |
||||
|
@Data |
||||
|
public static class BusinessFileIdAndPath{ |
||||
|
@ApiModelProperty("业务id") |
||||
|
private Long businessId; |
||||
|
@ApiModelProperty("文件路径") |
||||
|
private String filePath; |
||||
|
} |
||||
|
} |
@ -0,0 +1,55 @@ |
|||||
|
//package com.ccsens.cloudutil.config;
|
||||
|
//
|
||||
|
//import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
|
//import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
//import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
|
//import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
//import feign.codec.Decoder;
|
||||
|
//import feign.codec.Encoder;
|
||||
|
//import feign.form.spring.SpringFormEncoder;
|
||||
|
//import org.springframework.beans.factory.ObjectFactory;
|
||||
|
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
//import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
||||
|
//import org.springframework.cloud.openfeign.support.ResponseEntityDecoder;
|
||||
|
//import org.springframework.cloud.openfeign.support.SpringDecoder;
|
||||
|
//import org.springframework.cloud.openfeign.support.SpringEncoder;
|
||||
|
//import org.springframework.context.annotation.Bean;
|
||||
|
//import org.springframework.context.annotation.Configuration;
|
||||
|
//import org.springframework.http.MediaType;
|
||||
|
//import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
|
//
|
||||
|
//import java.util.ArrayList;
|
||||
|
//import java.util.List;
|
||||
|
//
|
||||
|
///**
|
||||
|
// * @description:
|
||||
|
// * @author: wuHuiJuan
|
||||
|
// * @create: 2019/12/09 15:27
|
||||
|
// */
|
||||
|
//@Configuration
|
||||
|
//public class FeignConfig {
|
||||
|
//
|
||||
|
// @Autowired
|
||||
|
// private ObjectFactory<HttpMessageConverters> messageConverters;
|
||||
|
//
|
||||
|
// @Bean
|
||||
|
// public Encoder feignFormEncoder() {
|
||||
|
// return new SpringFormEncoder(new SpringEncoder(messageConverters));
|
||||
|
// }
|
||||
|
//
|
||||
|
// @Bean
|
||||
|
// public Decoder feignDecoder() {
|
||||
|
// return new ResponseEntityDecoder(new SpringDecoder(() -> {
|
||||
|
// MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
|
||||
|
// List<MediaType> mediaTypeList = new ArrayList<>();
|
||||
|
// mediaTypeList.add(MediaType.TEXT_HTML);
|
||||
|
// mediaTypeList.add(MediaType.APPLICATION_JSON_UTF8);
|
||||
|
// converter.setSupportedMediaTypes(mediaTypeList);
|
||||
|
//
|
||||
|
// ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
// objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
|
// converter.setObjectMapper(objectMapper); return new HttpMessageConverters(converter);
|
||||
|
// }));
|
||||
|
// }
|
||||
|
//
|
||||
|
//}
|
@ -0,0 +1,45 @@ |
|||||
|
package com.ccsens.cloudutil.config; |
||||
|
|
||||
|
import cn.hutool.json.JSONObject; |
||||
|
import cn.hutool.json.JSONUtil; |
||||
|
import feign.RequestInterceptor; |
||||
|
import feign.RequestTemplate; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
import org.springframework.http.HttpHeaders; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.context.request.RequestContextHolder; |
||||
|
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Configuration |
||||
|
public class FeignTokenConfig implements RequestInterceptor { |
||||
|
@Override |
||||
|
public void apply(RequestTemplate template) { |
||||
|
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); |
||||
|
System.out.println("attributes:"+attributes); |
||||
|
if (attributes != null) { |
||||
|
HttpServletRequest request = attributes.getRequest(); |
||||
|
System.out.println("token:" + request.getHeader(HttpHeaders.AUTHORIZATION)); |
||||
|
//添加token
|
||||
|
template.header(HttpHeaders.AUTHORIZATION, request.getHeader(HttpHeaders.AUTHORIZATION)); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
byte[] body = template.body(); |
||||
|
if (body == null) { |
||||
|
return; |
||||
|
} |
||||
|
String json = new String(body); |
||||
|
JSONObject jsonObject = JSONUtil.parseObj(json); |
||||
|
|
||||
|
//添加token
|
||||
|
template.header("Authorization", jsonObject.getStr("token")); |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,41 @@ |
|||||
|
package com.ccsens.cloudutil.feign; |
||||
|
|
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.util.StringUtils; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
|
||||
|
@FeignClient(name = "health", path = "", fallbackFactory = HealthFeignClientFallBack.class) |
||||
|
public interface HealthFeignClient { |
||||
|
/** |
||||
|
* 获取suiteAccessToken |
||||
|
* @param suiteId |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("getSuiteAccessToken") |
||||
|
String getSuiteAccessToken(@RequestParam(name = "suiteId") String suiteId); |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Slf4j |
||||
|
@Component |
||||
|
class HealthFeignClientFallBack implements FallbackFactory<HealthFeignClient> { |
||||
|
@Override |
||||
|
public HealthFeignClient create(Throwable throwable) { |
||||
|
String msg = throwable == null ? "" : throwable.getMessage(); |
||||
|
if (!StringUtils.isEmpty(msg)) { |
||||
|
log.error(msg); |
||||
|
} |
||||
|
return new HealthFeignClient() { |
||||
|
@Override |
||||
|
public String getSuiteAccessToken(String suiteId) { |
||||
|
return null; |
||||
|
} |
||||
|
}; |
||||
|
} |
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
package com.ccsens.cloudutil.feign; |
||||
|
|
||||
|
import com.ccsens.cloudutil.bean.QueryParam; |
||||
|
import com.ccsens.cloudutil.bean.tall.dto.LogDto; |
||||
|
import com.ccsens.cloudutil.bean.tall.dto.MemberRoleDto; |
||||
|
import com.ccsens.cloudutil.bean.tall.dto.UserDto; |
||||
|
import com.ccsens.cloudutil.bean.tall.vo.MemberVo; |
||||
|
import com.ccsens.cloudutil.bean.tall.vo.PluginVo; |
||||
|
import com.ccsens.cloudutil.bean.tall.vo.TaskVo; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.util.StringUtils; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@FeignClient(name = "mt", path = "", fallbackFactory = MtFeignClientFallBack.class) |
||||
|
public interface MtFeignClient { |
||||
|
/** |
||||
|
* 普通成员获取自己对任务的评分 |
||||
|
* @param taskId |
||||
|
* @param userId |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("plugins/memberScore") |
||||
|
BigDecimal getMemberScore(@RequestParam(name = "taskId")Long taskId, @RequestParam(name = "userId")Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 项目经理获取任务的平均分 |
||||
|
* @param projectId |
||||
|
* @param taskId |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("plugins/adminScore") |
||||
|
BigDecimal getAdminScore(@RequestParam(name = "projectId")Long projectId, @RequestParam(name = "taskId")Long taskId); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Slf4j |
||||
|
@Component |
||||
|
class MtFeignClientFallBack implements FallbackFactory<MtFeignClient> { |
||||
|
@Override |
||||
|
public MtFeignClient create(Throwable throwable) { |
||||
|
String msg = throwable == null ? "" : throwable.getMessage(); |
||||
|
if (!StringUtils.isEmpty(msg)) { |
||||
|
log.error(msg); |
||||
|
} |
||||
|
return new MtFeignClient() { |
||||
|
@Override |
||||
|
public BigDecimal getMemberScore(Long taskId,Long userId) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public BigDecimal getAdminScore(Long projectId,Long taskId) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
}; |
||||
|
} |
||||
|
} |
@ -0,0 +1,113 @@ |
|||||
|
package com.ccsens.cloudutil.feign; |
||||
|
|
||||
|
import com.ccsens.cloudutil.bean.tall.dto.HolidaysDto; |
||||
|
import com.ccsens.cloudutil.bean.tall.dto.LogDto; |
||||
|
import com.ccsens.cloudutil.bean.tall.dto.ProjectDto; |
||||
|
import com.ccsens.cloudutil.bean.tall.vo.HolidaysVo; |
||||
|
import com.ccsens.cloudutil.config.FeignTokenConfig; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@FeignClient(name = "tall3", path = "v3.0",fallbackFactory = Tall3FeignClientFallBack.class,configuration = FeignTokenConfig.class) |
||||
|
public interface Tall3FeignClient { |
||||
|
/** |
||||
|
* 根据token获取userId |
||||
|
* |
||||
|
* @param token |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("users/token") |
||||
|
JsonResponse getUserIdByToken(@RequestParam(required = true, name = "token") String token); |
||||
|
|
||||
|
/** |
||||
|
* 记录操作日志 |
||||
|
* |
||||
|
* @param logDto |
||||
|
* @return |
||||
|
*/ |
||||
|
@RequestMapping("/log/operation") |
||||
|
JsonResponse log(LogDto logDto); |
||||
|
|
||||
|
/** |
||||
|
* 在tall3内保存项目信息 |
||||
|
*/ |
||||
|
@RequestMapping("project/save") |
||||
|
JsonResponse saveProjectList(ProjectDto.SaveProjectDto projectDto); |
||||
|
|
||||
|
/** |
||||
|
* tall3内保存用户项目列表 |
||||
|
*/ |
||||
|
@RequestMapping("project/saveUserProject") |
||||
|
JsonResponse saveUserProject(ProjectDto.SaveUserProject projectDto); |
||||
|
|
||||
|
/** |
||||
|
* tall3内保存用户项目列表 |
||||
|
*/ |
||||
|
@RequestMapping("holidays") |
||||
|
JsonResponse<HolidaysVo.Holidays> getHolidays(HolidaysDto.GetHolidays getHolidays); |
||||
|
|
||||
|
/** |
||||
|
* 根据手机号查找userId |
||||
|
*/ |
||||
|
@GetMapping("/project/businessDeleteProject") |
||||
|
JsonResponse businessDeleteProject(@RequestParam(name = "projectId")Long projectId); |
||||
|
|
||||
|
/** |
||||
|
* 根据手机号查找userId |
||||
|
*/ |
||||
|
@GetMapping("/users/userIdByPhone") |
||||
|
JsonResponse<Long> getUserIdByPhone(@RequestParam(name = "phone")String phone); |
||||
|
} |
||||
|
|
||||
|
@Slf4j |
||||
|
@Component |
||||
|
class Tall3FeignClientFallBack implements FallbackFactory<Tall3FeignClient> { |
||||
|
|
||||
|
@Override |
||||
|
public Tall3FeignClient create(Throwable cause) { |
||||
|
log.error("访问tall3异常", cause); |
||||
|
return new Tall3FeignClient() { |
||||
|
@Override |
||||
|
public JsonResponse getUserIdByToken(String token) { |
||||
|
return null; |
||||
|
} |
||||
|
@Override |
||||
|
public JsonResponse log(LogDto logDto) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse saveProjectList(ProjectDto.SaveProjectDto projectDto) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse saveUserProject(ProjectDto.SaveUserProject projectDto) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<HolidaysVo.Holidays> getHolidays(HolidaysDto.GetHolidays getHolidays) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
@Override |
||||
|
public JsonResponse businessDeleteProject(Long projectId) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
@Override |
||||
|
public JsonResponse<Long> getUserIdByPhone(String phone) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
}; |
||||
|
} |
||||
|
} |
@ -0,0 +1,477 @@ |
|||||
|
package com.ccsens.cloudutil.feign; |
||||
|
|
||||
|
import com.ccsens.cloudutil.bean.QueryParam; |
||||
|
import com.ccsens.cloudutil.bean.tall.dto.*; |
||||
|
import com.ccsens.cloudutil.bean.tall.vo.*; |
||||
|
import com.ccsens.cloudutil.config.FeignTokenConfig; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import com.ccsens.util.bean.dto.QueryDto; |
||||
|
import feign.hystrix.FallbackFactory; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/11/27 10:03 |
||||
|
*/ |
||||
|
|
||||
|
@FeignClient(name = "tall", path = "v1.0",fallbackFactory = TallFeignClientFallBack.class,configuration = FeignTokenConfig.class) |
||||
|
public interface TallFeignClient { |
||||
|
|
||||
|
/** |
||||
|
* 输入两个userid将两个账号合并(保留企业用户的id) |
||||
|
* @param userId 需要保存的userid |
||||
|
* @param uselessId 不需要保存的userid |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/users/mergeUserId") |
||||
|
JsonResponse mergeUserId(@RequestParam(required = true, name = "userId") Long userId,@RequestParam(required = true, name = "uselessId") Long uselessId); |
||||
|
|
||||
|
/** |
||||
|
* 获取 |
||||
|
* |
||||
|
* @param map |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/getPort") |
||||
|
String get(QueryParam map); |
||||
|
|
||||
|
/** |
||||
|
* 注册用户 |
||||
|
* |
||||
|
* @param signup |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/defaultRegister") |
||||
|
JsonResponse<UserVo.DefaultUserSingup> defaultRegister(UserDto.DefaultUserSingup signup); |
||||
|
|
||||
|
/** |
||||
|
* 为用户分配角色 |
||||
|
* |
||||
|
* @param assign |
||||
|
* @return |
||||
|
*/ |
||||
|
@RequestMapping("assignRoles") |
||||
|
JsonResponse assignRoles(MemberRoleDto.Assign assign); |
||||
|
|
||||
|
/** |
||||
|
* 为用户删除角色 |
||||
|
* |
||||
|
* @param deleteDto |
||||
|
* @return |
||||
|
*/ |
||||
|
@RequestMapping("deleteRoles") |
||||
|
JsonResponse deleteRoles(MemberRoleDto.Delete deleteDto); |
||||
|
|
||||
|
/** |
||||
|
* 根据token获取userId |
||||
|
* |
||||
|
* @param token |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("users/token") |
||||
|
JsonResponse getUserIdByToken(@RequestParam(required = true, name = "token") String token); |
||||
|
|
||||
|
/** |
||||
|
* 记录操作日志 |
||||
|
* |
||||
|
* @param logDto |
||||
|
* @return |
||||
|
*/ |
||||
|
@RequestMapping("/log/operation") |
||||
|
JsonResponse log(LogDto logDto); |
||||
|
|
||||
|
/** |
||||
|
* 通过任务id获得任务信息 |
||||
|
* |
||||
|
* @param taskId |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/tasks/projectId") |
||||
|
TaskVo.TaskInfoWithFeign getProjectId(@RequestParam(name = "taskId") Long taskId); |
||||
|
|
||||
|
/** |
||||
|
* 查询该用户在项目中的member信息 |
||||
|
* |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/users/member") |
||||
|
JsonResponse<MemberVo.MemberInfo> getMemberByUserId(@RequestParam(name = "userId") Long userId, @RequestParam(name = "projectId") Long projectId); |
||||
|
|
||||
|
/** |
||||
|
* 当用户不在项目中时查询该用户信息 |
||||
|
* |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/users/getUserInfo") |
||||
|
JsonResponse<MemberVo.MemberInfo> getUserByUserId(@RequestParam(name = "userId") Long userId); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 获取项目下的所有成员id |
||||
|
* |
||||
|
* @param projectId |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/users/allMemberAll") |
||||
|
List<Long> getMemberIdListByProject(@RequestParam(name = "projectId") Long projectId); |
||||
|
|
||||
|
/** |
||||
|
* 通过token获得userId(消息系统用) |
||||
|
* |
||||
|
* @param token |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/users/claims") |
||||
|
String getUserId(@RequestParam(name = "token") String token); |
||||
|
|
||||
|
/** |
||||
|
* 通过插件id获取签到字段和详细信息 |
||||
|
*/ |
||||
|
@GetMapping("/plugins/sign") |
||||
|
List<PluginVo.PluginSignField> getSignFieldByTaskPluginId(@RequestParam(name = "taskPluginId") Long taskPluginId); |
||||
|
|
||||
|
/** |
||||
|
* 模糊查询 |
||||
|
*/ |
||||
|
@GetMapping("/plugins/fuzzy") |
||||
|
List<String> getSignFuzzy(@RequestParam(name = "taskPluginId") Long taskPluginId, @RequestParam(name = "signinName") String signinName, @RequestParam(name = "key") String key); |
||||
|
|
||||
|
/** |
||||
|
* 通过插件id获取签到字段和详细信息 |
||||
|
*/ |
||||
|
@GetMapping("/plugins/task") |
||||
|
Long getTaskIdByTaskPluginId(@RequestParam(name = "taskPluginId") Long taskPluginId); |
||||
|
|
||||
|
/** |
||||
|
* 保存WPS业务和文件记录 |
||||
|
*/ |
||||
|
@RequestMapping("/wps/saveWps") |
||||
|
JsonResponse saveWpsFile(WpsDto.Business business); |
||||
|
|
||||
|
/** |
||||
|
* 查询WPS业务和文件记录 |
||||
|
*/ |
||||
|
@RequestMapping("/wps/visitUrls") |
||||
|
List<String> queryVisitUrls(WpsDto.VisitWpsUrl visitWpsUrl); |
||||
|
|
||||
|
/** |
||||
|
* 根据wpsId查询wps文件路径 |
||||
|
*/ |
||||
|
@GetMapping("/wps/wpsId") |
||||
|
JsonResponse<WpsVo.BusinessFileIdAndPath> getPathByWpsId(@RequestParam(name = "wpsId")Long wpsId); |
||||
|
/** |
||||
|
* 根据手机号查找userId |
||||
|
*/ |
||||
|
@GetMapping("/users/userIdByPhone") |
||||
|
JsonResponse<Long> getUserIdByPhone(@RequestParam(name = "phone")String phone); |
||||
|
/** |
||||
|
* 查找wps文件路径 |
||||
|
*/ |
||||
|
@GetMapping("/v1/3rd/getFilePath") |
||||
|
String getWpsFilePath(@RequestParam(name = "businessId") Long businessId,@RequestParam(name = "businessType") byte businessType); |
||||
|
|
||||
|
/** |
||||
|
* 通过userId呵taskId查找用户信息 |
||||
|
*/ |
||||
|
@GetMapping("/users/memberByTask") |
||||
|
JsonResponse<MemberVo.MemberInfo> getMemberInfoByUserIdAndTaskId(@RequestParam(name = "userId") Long userId,@RequestParam(name = "taskId") Long taskId); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 添加任务 |
||||
|
*/ |
||||
|
@RequestMapping("/tasks") |
||||
|
JsonResponse<TaskVo.NormalTask> saveTask(TallTaskDto.AddTask addTask); |
||||
|
|
||||
|
/** |
||||
|
* 修改任务 |
||||
|
*/ |
||||
|
@RequestMapping("/tasks/change") |
||||
|
JsonResponse<TaskVo.NormalTask> updataTask(TallTaskDto.UpdateTaskInfo updateTaskInfo); |
||||
|
|
||||
|
/** |
||||
|
* 完成任务 |
||||
|
*/ |
||||
|
@RequestMapping("/tasks/finish") |
||||
|
JsonResponse<TaskVo.NormalTask> finishTask(TaskDto.TaskSubTimeId task); |
||||
|
/** |
||||
|
* 删除任务 |
||||
|
*/ |
||||
|
@DeleteMapping("/tasks") |
||||
|
JsonResponse deleteTask(@RequestParam(name = "taskId") Long taskId); |
||||
|
|
||||
|
/** |
||||
|
* 修改任务插件配置 |
||||
|
*/ |
||||
|
@RequestMapping("/plugins/config") |
||||
|
JsonResponse<TaskVo.PluginVo> updatePluginConfig(TallTaskDto.UpdatePluginConfig updatePluginConfig); |
||||
|
|
||||
|
/** |
||||
|
* 添加角色 |
||||
|
*/ |
||||
|
@RequestMapping("/roles/save") |
||||
|
JsonResponse<MemberVo.RoleInfo> saveRole(MemberRoleDto.SaveRole saveRole); |
||||
|
|
||||
|
/** |
||||
|
* 添加成员 |
||||
|
*/ |
||||
|
@RequestMapping("/members/save") |
||||
|
JsonResponse<MemberVo.Member> saveMember(MemberRoleDto.SaveMember saveMember); |
||||
|
|
||||
|
/** |
||||
|
* 将成员添加至角色内 |
||||
|
*/ |
||||
|
@RequestMapping("/roles/saveMember") |
||||
|
JsonResponse saveMemberInRole(MemberRoleDto.SaveMemberInRole saveMember); |
||||
|
/** |
||||
|
* 将成员从角色内删除 |
||||
|
*/ |
||||
|
@RequestMapping("/roles/deleteMember") |
||||
|
JsonResponse deleteMemberInRole(MemberRoleDto.SaveMemberInRole saveMember); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 通过手机号和项目id查询成员信息 |
||||
|
*/ |
||||
|
@RequestMapping("/members/query/memberByPhone") |
||||
|
JsonResponse<MemberVo.MemberList> queryMemberByPhone(MemberRoleDto.GetMemberByPhone getMemberByPhone); |
||||
|
|
||||
|
/** |
||||
|
* 删除角色 |
||||
|
*/ |
||||
|
@RequestMapping("/roles/delete") |
||||
|
JsonResponse deleteRole(MemberRoleDto.DeleteRole deleteRole); |
||||
|
|
||||
|
/** |
||||
|
* 根据项目模板复制项目 |
||||
|
* @param copyProject 项目id |
||||
|
* @return 项目 |
||||
|
*/ |
||||
|
@RequestMapping(value = "/projects/copyProject",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) |
||||
|
JsonResponse<ProjectVo.ProjectInfo> copyProjectNew(QueryDto<ProjectDto.CopyProject> copyProject); |
||||
|
|
||||
|
/** |
||||
|
* 给复制后的模板项目添加成员 |
||||
|
* @param memberForTemplate 项目id和成员 |
||||
|
* @return 成功/失败 |
||||
|
*/ |
||||
|
@RequestMapping(value = "/members/addMemberForTemplate",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) |
||||
|
JsonResponse addMemberForTemplate(QueryDto<MemberRoleDto.SaveMemberForTemplate> memberForTemplate); |
||||
|
|
||||
|
/** |
||||
|
* 开始节点 |
||||
|
* @param param 时间 |
||||
|
* @return 结果 |
||||
|
* @throws Exception |
||||
|
*/ |
||||
|
@RequestMapping(value = "/tasks/start", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
JsonResponse startNode(TaskDto.StartTask param) throws Exception; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 在tall3内保存项目信息 |
||||
|
*/ |
||||
|
@RequestMapping("/project/save") |
||||
|
JsonResponse saveProjectList(ProjectDto.SaveProjectDto projectDto); |
||||
|
} |
||||
|
|
||||
|
@Slf4j |
||||
|
@Component |
||||
|
class TallFeignClientFallBack implements FallbackFactory<TallFeignClient> { |
||||
|
|
||||
|
@Override |
||||
|
public TallFeignClient create(Throwable throwable) { |
||||
|
log.error("yichang", throwable); |
||||
|
return new TallFeignClient() { |
||||
|
@Override |
||||
|
public JsonResponse mergeUserId(Long userId, Long uselessId) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String get(QueryParam map) { |
||||
|
return "hello world"; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse defaultRegister(UserDto.DefaultUserSingup signup) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse assignRoles(MemberRoleDto.Assign assign) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse deleteRoles(MemberRoleDto.Delete deleteDto) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse getUserIdByToken(String token) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse log(LogDto logDto) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public TaskVo.TaskInfoWithFeign getProjectId(Long taskId) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<MemberVo.MemberInfo> getMemberByUserId(Long userId, Long projectId) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<MemberVo.MemberInfo> getUserByUserId(Long userId) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<Long> getMemberIdListByProject(Long projectId) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String getUserId(String token) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<PluginVo.PluginSignField> getSignFieldByTaskPluginId(Long taskPluginId) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<String> getSignFuzzy(Long taskPluginId, String signinName, String key) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Long getTaskIdByTaskPluginId(Long taskPluginId) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse saveWpsFile(WpsDto.Business business) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<String> queryVisitUrls(WpsDto.VisitWpsUrl visitWpsUrl) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<WpsVo.BusinessFileIdAndPath> getPathByWpsId(Long async) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<Long> getUserIdByPhone(String phone) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String getWpsFilePath(Long businessId, byte businessType) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<MemberVo.MemberInfo> getMemberInfoByUserIdAndTaskId(Long userId, Long taskId) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<TaskVo.NormalTask> saveTask(TallTaskDto.AddTask addTask) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<TaskVo.NormalTask> updataTask(TallTaskDto.UpdateTaskInfo updateTaskInfo) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<TaskVo.NormalTask> finishTask(TaskDto.TaskSubTimeId task) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse deleteTask(Long taskId) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<TaskVo.PluginVo> updatePluginConfig(TallTaskDto.UpdatePluginConfig updatePluginConfig) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<MemberVo.RoleInfo> saveRole(MemberRoleDto.SaveRole saveRole) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<MemberVo.Member> saveMember(MemberRoleDto.SaveMember saveMember) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse saveMemberInRole(MemberRoleDto.SaveMemberInRole saveMember) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse deleteMemberInRole(MemberRoleDto.SaveMemberInRole saveMember) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<MemberVo.MemberList> queryMemberByPhone(MemberRoleDto.GetMemberByPhone getMemberByPhone) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse deleteRole(MemberRoleDto.DeleteRole deleteRole) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse<ProjectVo.ProjectInfo> copyProjectNew(QueryDto<ProjectDto.CopyProject> copyProject) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse addMemberForTemplate(QueryDto<MemberRoleDto.SaveMemberForTemplate> memberForTemplate) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse startNode(TaskDto.StartTask param) throws Exception { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public JsonResponse saveProjectList(ProjectDto.SaveProjectDto projectDto) { |
||||
|
return JsonResponse.newInstance().fail(); |
||||
|
} |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package com.ccsens.cloudutil.interceptor; |
||||
|
|
||||
|
import org.springframework.web.servlet.HandlerInterceptor; |
||||
|
import org.springframework.web.servlet.ModelAndView; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/09 18:24 |
||||
|
*/ |
||||
|
public class LogInterceptor implements HandlerInterceptor { |
||||
|
@Override |
||||
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
||||
|
//路径
|
||||
|
String path = request.getContextPath(); |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package com.ccsens.cloudutil.ribbon; |
||||
|
|
||||
|
import org.springframework.cloud.netflix.ribbon.RibbonClient; |
||||
|
import org.springframework.cloud.netflix.ribbon.RibbonClients; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/11/26 12:11 |
||||
|
*/ |
||||
|
@Configuration |
||||
|
@RibbonClient(name="${spring.application.name}", configuration = RibbonConfiguration.class) |
||||
|
public class RibbonClientConfig { |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
package com.ccsens.cloudutil.ribbon; |
||||
|
|
||||
|
import com.netflix.loadbalancer.IRule; |
||||
|
import com.netflix.loadbalancer.RoundRobinRule; |
||||
|
import com.netflix.loadbalancer.WeightedResponseTimeRule; |
||||
|
import org.springframework.cloud.netflix.ribbon.RibbonClient; |
||||
|
import org.springframework.cloud.netflix.ribbon.RibbonClients; |
||||
|
import org.springframework.context.annotation.Bean; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
|
||||
|
/** |
||||
|
* @description: 负载均衡 |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/11/26 12:04 |
||||
|
*/ |
||||
|
@Configuration |
||||
|
public class RibbonConfiguration { |
||||
|
/**根据响应时间加权,响应时间越长,权重越小,被选中的可能性越低*/ |
||||
|
// @Bean
|
||||
|
// public IRule weightedResponseTimeRule() {
|
||||
|
// return new WeightedResponseTimeRule();
|
||||
|
// }
|
||||
|
|
||||
|
/**轮询*/ |
||||
|
@Bean |
||||
|
public IRule roundRobinRule(){ |
||||
|
return new RoundRobinRule(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/* |
||||
|
负载均衡机制 ,也可以自定义 |
||||
|
AvailabilityFilteringRule:过滤掉一直连接失败的被标记为circuit tripped的后端Server,并过滤掉那些高并发的后端Server或者使用一个AvailabilityPredicate来包含过滤server的逻辑,其实就就是检查status里记录的各个Server的运行状态; |
||||
|
BestAvailableRule:选择一个最小的并发请求的Server,逐个考察Server,如果Server被tripped了,则跳过。 |
||||
|
RandomRule:随机选择一个Server; |
||||
|
ResponseTimeWeightedRule:作用同WeightedResponseTimeRule,二者作用一样; |
||||
|
RetryRule:对选定的负载均衡策略机上重试机制,在一个配置时间段内当选择Server不成功,则一直尝试使用subRule的方式选择一个可用的server; |
||||
|
RoundRobinRule:轮询选择, 轮询index,选择index对应位置的Server; |
||||
|
WeightedResponseTimeRule:根据响应时间加权,响应时间越长,权重越小,被选中的可能性越低; |
||||
|
ZoneAvoidanceRule:复合判断Server所在区域的性能和Server的可用性选择Server; |
||||
|
*/ |
||||
|
|
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
//package com.ccsens.cloudutil.ribbon;
|
||||
|
//
|
||||
|
//import com.netflix.client.config.IClientConfig;
|
||||
|
//import com.netflix.loadbalancer.AbstractLoadBalancerRule;
|
||||
|
//import com.netflix.loadbalancer.ILoadBalancer;
|
||||
|
//import com.netflix.loadbalancer.Server;
|
||||
|
//import org.springframework.context.annotation.Primary;
|
||||
|
//
|
||||
|
////@Primary
|
||||
|
//public class WpsBalanceRule extends AbstractLoadBalancerRule {
|
||||
|
//
|
||||
|
// @Override
|
||||
|
// public void initWithNiwsConfig(IClientConfig clientConfig) {
|
||||
|
//
|
||||
|
// }
|
||||
|
//
|
||||
|
// @Override
|
||||
|
// public Server choose(Object key) {
|
||||
|
// return choose(getLoadBalancer(), key);
|
||||
|
// }
|
||||
|
//
|
||||
|
// private Server choose(ILoadBalancer loadBalancer, Object key) {
|
||||
|
// System.out.println(key);
|
||||
|
// return null;
|
||||
|
// }
|
||||
|
//
|
||||
|
//
|
||||
|
//}
|
@ -0,0 +1,72 @@ |
|||||
|
#服务端点暴露 |
||||
|
management: |
||||
|
endpoints: |
||||
|
web: |
||||
|
exposure: |
||||
|
# 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*' |
||||
|
include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream |
||||
|
# # 不暴露哪些端点 |
||||
|
# exclude: env,beans,configprops |
||||
|
endpoint: |
||||
|
health: |
||||
|
# 是否展示健康检查详情 |
||||
|
show-details: always |
||||
|
health: |
||||
|
redis: |
||||
|
enabled: false |
||||
|
#eureka注册 |
||||
|
eureka: |
||||
|
client: |
||||
|
service-url: |
||||
|
# 指定eureka server通信地址,注意/eureka/小尾巴不能少 |
||||
|
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/ |
||||
|
defaultZone: http://admin:admin@127.0.0.1:7010/eureka/ |
||||
|
instance: |
||||
|
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server |
||||
|
prefer-ip-address: true |
||||
|
metadata-map: |
||||
|
management: |
||||
|
context-path: ${server.servlet.context-path}/actuator |
||||
|
home-page-url-path: ${server.servlet.context-path}/ |
||||
|
status-page-url-path: ${server.servlet.context-path}/actuator/info |
||||
|
health-check-url-path: ${server.servlet.context-path}/actuator/health |
||||
|
ribbon: |
||||
|
ConnectTimeout: 60000 |
||||
|
ReadTimeout: 60000 |
||||
|
eureka: |
||||
|
enable: true |
||||
|
feign: |
||||
|
client: |
||||
|
config: |
||||
|
default: |
||||
|
connectTime: 50000 |
||||
|
readTimeout: 50000 |
||||
|
# NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。 |
||||
|
# BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。 |
||||
|
# HEADERS:记录BASIC级别的基础上,记录请求和响应的header。 |
||||
|
# FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据 |
||||
|
loggerLevel: basic |
||||
|
hystrix: |
||||
|
enabled: true |
||||
|
hystrix: |
||||
|
command: |
||||
|
default: |
||||
|
execution: |
||||
|
timeout: |
||||
|
enabled: true |
||||
|
isolation: |
||||
|
strategy: SEMAPHORE |
||||
|
thread: |
||||
|
timeoutInMilliseconds: 60000 |
||||
|
# sleuth |
||||
|
logging: |
||||
|
level: |
||||
|
root: info |
||||
|
org.springframework.cloud.sleuth: DEBUG |
||||
|
spring: |
||||
|
# zipkin: |
||||
|
# base-url: http://anyring.cc:9411 |
||||
|
# sleuth: |
||||
|
# sampler: |
||||
|
# # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。 |
||||
|
# probability: 1.0 |
@ -0,0 +1,143 @@ |
|||||
|
#<<<<<<< HEAD |
||||
|
##服务端点暴露 |
||||
|
#management: |
||||
|
# endpoints: |
||||
|
# web: |
||||
|
# exposure: |
||||
|
# # 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*' |
||||
|
# include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream |
||||
|
## # 不暴露哪些端点 |
||||
|
## exclude: env,beans,configprops |
||||
|
# endpoint: |
||||
|
# health: |
||||
|
# # 是否展示健康检查详情 |
||||
|
# show-details: always |
||||
|
# health: |
||||
|
# redis: |
||||
|
# enabled: false |
||||
|
##eureka注册 |
||||
|
#eureka: |
||||
|
# client: |
||||
|
# service-url: |
||||
|
# # 指定eureka server通信地址,注意/eureka/小尾巴不能少 |
||||
|
# #defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/ |
||||
|
## defaultZone: http://admin:admin@49.233.89.188:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@192.168.0.99:7010/eureka/ |
||||
|
# instance: |
||||
|
# # 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server |
||||
|
# prefer-ip-address: true |
||||
|
# metadata-map: |
||||
|
# management: |
||||
|
# context-path: ${server.servlet.context-path:}/actuator |
||||
|
# home-page-url-path: ${server.servlet.context-path:}/ |
||||
|
# status-page-url-path: ${server.servlet.context-path:}/actuator/info |
||||
|
# health-check-url-path: ${server.servlet.context-path:}/actuator/health |
||||
|
#feign: |
||||
|
# client: |
||||
|
# config: |
||||
|
# default: |
||||
|
# connectTime: 5000 |
||||
|
# readTimeout: 5000 |
||||
|
# # NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。 |
||||
|
# # BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。 |
||||
|
# # HEADERS:记录BASIC级别的基础上,记录请求和响应的header。 |
||||
|
# # FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据 |
||||
|
# loggerLevel: basic |
||||
|
# hystrix: |
||||
|
# enabled: true |
||||
|
## sleuth |
||||
|
#logging: |
||||
|
# level: |
||||
|
# root: info |
||||
|
# org.springframework.cloud.sleuth: DEBUG |
||||
|
#spring: |
||||
|
## zipkin: |
||||
|
## base-url: http://49.233.89.188:9411 |
||||
|
## sleuth: |
||||
|
## sampler: |
||||
|
## # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。 |
||||
|
## probability: 1.0 |
||||
|
# cloud: |
||||
|
# inetutils: |
||||
|
#======= |
||||
|
#服务端点暴露 |
||||
|
management: |
||||
|
endpoints: |
||||
|
web: |
||||
|
exposure: |
||||
|
# 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*' |
||||
|
include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream |
||||
|
# # 不暴露哪些端点 |
||||
|
# exclude: env,beans,configprops |
||||
|
endpoint: |
||||
|
health: |
||||
|
# 是否展示健康检查详情 |
||||
|
show-details: always |
||||
|
health: |
||||
|
redis: |
||||
|
enabled: false |
||||
|
#eureka注册 |
||||
|
eureka: |
||||
|
client: |
||||
|
service-url: |
||||
|
# 指定eureka server通信地址,注意/eureka/小尾巴不能少 |
||||
|
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/ |
||||
|
defaultZone: http://admin:admin@49.232.6.143:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@192.168.0.99:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@test.tall.wiki:7010/eureka/ |
||||
|
instance: |
||||
|
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server |
||||
|
prefer-ip-address: true |
||||
|
metadata-map: |
||||
|
management: |
||||
|
context-path: ${server.servlet.context-path:}/actuator |
||||
|
home-page-url-path: ${server.servlet.context-path:}/ |
||||
|
status-page-url-path: ${server.servlet.context-path:}/actuator/info |
||||
|
health-check-url-path: ${server.servlet.context-path:}/actuator/health |
||||
|
feign: |
||||
|
client: |
||||
|
config: |
||||
|
default: |
||||
|
connectTime: 5000 |
||||
|
readTimeout: 5000 |
||||
|
# NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。 |
||||
|
# BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。 |
||||
|
# HEADERS:记录BASIC级别的基础上,记录请求和响应的header。 |
||||
|
# FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据 |
||||
|
loggerLevel: basic |
||||
|
hystrix: |
||||
|
enabled: true |
||||
|
hystrix: |
||||
|
threadpool: |
||||
|
default: |
||||
|
coreSize: 200 #并发执行的最大线程数,默认10 |
||||
|
maxQueueSize: 1000 #BlockingQueue的最大队列数,默认值-1 |
||||
|
queueSizeRejectionThreshold: 800 #即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝,默认值5 |
||||
|
command: |
||||
|
default: |
||||
|
execution: |
||||
|
timeout: |
||||
|
enabled: true |
||||
|
isolation: |
||||
|
strategy: SEMAPHORE |
||||
|
thread: |
||||
|
timeoutInMilliseconds: 60000 |
||||
|
#ribbon的超时时间 |
||||
|
ribbon: |
||||
|
ReadTimeout: 60000 |
||||
|
ConnectTimeout: 60000 |
||||
|
# sleuth |
||||
|
logging: |
||||
|
level: |
||||
|
root: info |
||||
|
org.springframework.cloud.sleuth: DEBUG |
||||
|
spring: |
||||
|
# zipkin: |
||||
|
# base-url: http://49.233.89.188:9411 |
||||
|
# sleuth: |
||||
|
# sampler: |
||||
|
# # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。 |
||||
|
# probability: 1.0 |
||||
|
cloud: |
||||
|
inetutils: |
||||
|
ignored-interfaces: ['VMware.*'] |
@ -0,0 +1,66 @@ |
|||||
|
#服务端点暴露 |
||||
|
management: |
||||
|
endpoints: |
||||
|
web: |
||||
|
exposure: |
||||
|
# 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*' |
||||
|
include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream |
||||
|
# # 不暴露哪些端点 |
||||
|
# exclude: env,beans,configprops |
||||
|
endpoint: |
||||
|
health: |
||||
|
# 是否展示健康检查详情 |
||||
|
show-details: always |
||||
|
health: |
||||
|
redis: |
||||
|
enabled: false |
||||
|
#eureka注册 |
||||
|
eureka: |
||||
|
client: |
||||
|
service-url: |
||||
|
# 指定eureka server通信地址,注意/eureka/小尾巴不能少 |
||||
|
defaultZone: http://admin:admin@82.157.24.76:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@49.232.6.143:7010/eureka/ |
||||
|
instance: |
||||
|
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server |
||||
|
prefer-ip-address: true |
||||
|
metadata-map: |
||||
|
management: |
||||
|
context-path: ${server.servlet.context-path:}/actuator |
||||
|
home-page-url-path: ${server.servlet.context-path:}/ |
||||
|
status-page-url-path: ${server.servlet.context-path:}/actuator/info |
||||
|
health-check-url-path: ${server.servlet.context-path:}/actuator/health |
||||
|
feign: |
||||
|
client: |
||||
|
config: |
||||
|
default: |
||||
|
connectTime: 5000 |
||||
|
readTimeout: 5000 |
||||
|
# NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。 |
||||
|
# BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。 |
||||
|
# HEADERS:记录BASIC级别的基础上,记录请求和响应的header。 |
||||
|
# FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据 |
||||
|
loggerLevel: basic |
||||
|
hystrix: |
||||
|
enabled: true |
||||
|
hystrix: |
||||
|
command: |
||||
|
default: |
||||
|
execution: |
||||
|
isolation: |
||||
|
strategy: SEMAPHORE |
||||
|
thread: |
||||
|
timeoutInMilliseconds: 60000 |
||||
|
#ribbon的超时时间 |
||||
|
ribbon: |
||||
|
ReadTimeout: 60000 |
||||
|
ConnectTimeout: 60000 |
||||
|
# sleuth |
||||
|
logging: |
||||
|
level: |
||||
|
root: info |
||||
|
org.springframework.cloud.sleuth: DEBUG |
||||
|
spring: |
||||
|
cloud: |
||||
|
inetutils: |
||||
|
ignored-interfaces: ['VMware.*'] |
@ -0,0 +1,145 @@ |
|||||
|
#<<<<<<< HEAD |
||||
|
##服务端点暴露 |
||||
|
#management: |
||||
|
# endpoints: |
||||
|
# web: |
||||
|
# exposure: |
||||
|
# # 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*' |
||||
|
# include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream |
||||
|
## # 不暴露哪些端点 |
||||
|
## exclude: env,beans,configprops |
||||
|
# endpoint: |
||||
|
# health: |
||||
|
# # 是否展示健康检查详情 |
||||
|
# show-details: always |
||||
|
# health: |
||||
|
# redis: |
||||
|
# enabled: false |
||||
|
##eureka注册 |
||||
|
#eureka: |
||||
|
# client: |
||||
|
# service-url: |
||||
|
# # 指定eureka server通信地址,注意/eureka/小尾巴不能少 |
||||
|
# #defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/ |
||||
|
## defaultZone: http://admin:admin@49.233.89.188:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@192.168.0.99:7010/eureka/ |
||||
|
# instance: |
||||
|
# # 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server |
||||
|
# prefer-ip-address: true |
||||
|
# metadata-map: |
||||
|
# management: |
||||
|
# context-path: ${server.servlet.context-path:}/actuator |
||||
|
# home-page-url-path: ${server.servlet.context-path:}/ |
||||
|
# status-page-url-path: ${server.servlet.context-path:}/actuator/info |
||||
|
# health-check-url-path: ${server.servlet.context-path:}/actuator/health |
||||
|
#feign: |
||||
|
# client: |
||||
|
# config: |
||||
|
# default: |
||||
|
# connectTime: 5000 |
||||
|
# readTimeout: 5000 |
||||
|
# # NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。 |
||||
|
# # BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。 |
||||
|
# # HEADERS:记录BASIC级别的基础上,记录请求和响应的header。 |
||||
|
# # FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据 |
||||
|
# loggerLevel: basic |
||||
|
# hystrix: |
||||
|
# enabled: true |
||||
|
## sleuth |
||||
|
#logging: |
||||
|
# level: |
||||
|
# root: info |
||||
|
# org.springframework.cloud.sleuth: DEBUG |
||||
|
#spring: |
||||
|
## zipkin: |
||||
|
## base-url: http://49.233.89.188:9411 |
||||
|
## sleuth: |
||||
|
## sampler: |
||||
|
## # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。 |
||||
|
## probability: 1.0 |
||||
|
# cloud: |
||||
|
# inetutils: |
||||
|
#======= |
||||
|
#服务端点暴露 |
||||
|
management: |
||||
|
endpoints: |
||||
|
web: |
||||
|
exposure: |
||||
|
# 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*' |
||||
|
include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream |
||||
|
# # 不暴露哪些端点 |
||||
|
# exclude: env,beans,configprops |
||||
|
endpoint: |
||||
|
health: |
||||
|
# 是否展示健康检查详情 |
||||
|
show-details: always |
||||
|
health: |
||||
|
redis: |
||||
|
enabled: false |
||||
|
#eureka注册 |
||||
|
eureka: |
||||
|
client: |
||||
|
service-url: |
||||
|
# 指定eureka server通信地址,注意/eureka/小尾巴不能少 |
||||
|
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/ |
||||
|
|
||||
|
# defaultZone: http://admin:admin@101.201.226.21:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@121.36.3.207:7010/eureka/ |
||||
|
defaultZone: http://admin:admin@127.0.0.1:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@test.tall.wiki:7010/eureka/ |
||||
|
instance: |
||||
|
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server |
||||
|
prefer-ip-address: true |
||||
|
metadata-map: |
||||
|
management: |
||||
|
context-path: ${server.servlet.context-path:}/actuator |
||||
|
home-page-url-path: ${server.servlet.context-path:}/ |
||||
|
status-page-url-path: ${server.servlet.context-path:}/actuator/info |
||||
|
health-check-url-path: ${server.servlet.context-path:}/actuator/health |
||||
|
feign: |
||||
|
client: |
||||
|
config: |
||||
|
default: |
||||
|
connectTime: 60000 |
||||
|
readTimeout: 60000 |
||||
|
# NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。 |
||||
|
# BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。 |
||||
|
# HEADERS:记录BASIC级别的基础上,记录请求和响应的header。 |
||||
|
# FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据 |
||||
|
loggerLevel: basic |
||||
|
hystrix: |
||||
|
enabled: true |
||||
|
hystrix: |
||||
|
command: |
||||
|
default: |
||||
|
execution: |
||||
|
timeout: |
||||
|
enabled: true |
||||
|
isolation: |
||||
|
strategy: THREAD |
||||
|
thread: |
||||
|
timeoutInMilliseconds: 60000 |
||||
|
threadpool: |
||||
|
default: |
||||
|
coreSize: 200 #并发执行的最大线程数,默认10 |
||||
|
maxQueueSize: 1000 #BlockingQueue的最大队列数,默认值-1 |
||||
|
queueSizeRejectionThreshold: 800 #即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝,默认值5 |
||||
|
#ribbon的超时时间 |
||||
|
ribbon: |
||||
|
ReadTimeout: 60000 |
||||
|
ConnectTimeout: 60000 |
||||
|
# sleuth |
||||
|
logging: |
||||
|
level: |
||||
|
root: info |
||||
|
org.springframework.cloud.sleuth: DEBUG |
||||
|
spring: |
||||
|
# zipkin: |
||||
|
# base-url: http://49.233.89.188:9411 |
||||
|
# sleuth: |
||||
|
# sampler: |
||||
|
# # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。 |
||||
|
# probability: 1.0 |
||||
|
cloud: |
||||
|
inetutils: |
||||
|
ignored-interfaces: ['VMware.*'] |
@ -0,0 +1,145 @@ |
|||||
|
#<<<<<<< HEAD |
||||
|
##服务端点暴露 |
||||
|
#management: |
||||
|
# endpoints: |
||||
|
# web: |
||||
|
# exposure: |
||||
|
# # 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*' |
||||
|
# include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream |
||||
|
## # 不暴露哪些端点 |
||||
|
## exclude: env,beans,configprops |
||||
|
# endpoint: |
||||
|
# health: |
||||
|
# # 是否展示健康检查详情 |
||||
|
# show-details: always |
||||
|
# health: |
||||
|
# redis: |
||||
|
# enabled: false |
||||
|
##eureka注册 |
||||
|
#eureka: |
||||
|
# client: |
||||
|
# service-url: |
||||
|
# # 指定eureka server通信地址,注意/eureka/小尾巴不能少 |
||||
|
# #defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/ |
||||
|
## defaultZone: http://admin:admin@49.233.89.188:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@192.168.0.99:7010/eureka/ |
||||
|
# instance: |
||||
|
# # 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server |
||||
|
# prefer-ip-address: true |
||||
|
# metadata-map: |
||||
|
# management: |
||||
|
# context-path: ${server.servlet.context-path:}/actuator |
||||
|
# home-page-url-path: ${server.servlet.context-path:}/ |
||||
|
# status-page-url-path: ${server.servlet.context-path:}/actuator/info |
||||
|
# health-check-url-path: ${server.servlet.context-path:}/actuator/health |
||||
|
#feign: |
||||
|
# client: |
||||
|
# config: |
||||
|
# default: |
||||
|
# connectTime: 5000 |
||||
|
# readTimeout: 5000 |
||||
|
# # NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。 |
||||
|
# # BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。 |
||||
|
# # HEADERS:记录BASIC级别的基础上,记录请求和响应的header。 |
||||
|
# # FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据 |
||||
|
# loggerLevel: basic |
||||
|
# hystrix: |
||||
|
# enabled: true |
||||
|
## sleuth |
||||
|
#logging: |
||||
|
# level: |
||||
|
# root: info |
||||
|
# org.springframework.cloud.sleuth: DEBUG |
||||
|
#spring: |
||||
|
## zipkin: |
||||
|
## base-url: http://49.233.89.188:9411 |
||||
|
## sleuth: |
||||
|
## sampler: |
||||
|
## # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。 |
||||
|
## probability: 1.0 |
||||
|
# cloud: |
||||
|
# inetutils: |
||||
|
#======= |
||||
|
#服务端点暴露 |
||||
|
management: |
||||
|
endpoints: |
||||
|
web: |
||||
|
exposure: |
||||
|
# 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*' |
||||
|
include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream |
||||
|
# # 不暴露哪些端点 |
||||
|
# exclude: env,beans,configprops |
||||
|
endpoint: |
||||
|
health: |
||||
|
# 是否展示健康检查详情 |
||||
|
show-details: always |
||||
|
health: |
||||
|
redis: |
||||
|
enabled: false |
||||
|
#eureka注册 |
||||
|
eureka: |
||||
|
client: |
||||
|
service-url: |
||||
|
# 指定eureka server通信地址,注意/eureka/小尾巴不能少 |
||||
|
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/ |
||||
|
|
||||
|
# defaultZone: http://admin:admin@101.201.226.21:7010/eureka/ |
||||
|
defaultZone: http://admin:admin@121.36.3.207:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@127.0.0.1:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@test.tall.wiki:7010/eureka/ |
||||
|
instance: |
||||
|
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server |
||||
|
prefer-ip-address: true |
||||
|
metadata-map: |
||||
|
management: |
||||
|
context-path: ${server.servlet.context-path:}/actuator |
||||
|
home-page-url-path: ${server.servlet.context-path:}/ |
||||
|
status-page-url-path: ${server.servlet.context-path:}/actuator/info |
||||
|
health-check-url-path: ${server.servlet.context-path:}/actuator/health |
||||
|
feign: |
||||
|
client: |
||||
|
config: |
||||
|
default: |
||||
|
connectTime: 60000 |
||||
|
readTimeout: 60000 |
||||
|
# NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。 |
||||
|
# BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。 |
||||
|
# HEADERS:记录BASIC级别的基础上,记录请求和响应的header。 |
||||
|
# FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据 |
||||
|
loggerLevel: basic |
||||
|
hystrix: |
||||
|
enabled: true |
||||
|
hystrix: |
||||
|
command: |
||||
|
default: |
||||
|
execution: |
||||
|
timeout: |
||||
|
enabled: true |
||||
|
isolation: |
||||
|
strategy: THREAD |
||||
|
thread: |
||||
|
timeoutInMilliseconds: 60000 |
||||
|
threadpool: |
||||
|
default: |
||||
|
coreSize: 200 #并发执行的最大线程数,默认10 |
||||
|
maxQueueSize: 1000 #BlockingQueue的最大队列数,默认值-1 |
||||
|
queueSizeRejectionThreshold: 800 #即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝,默认值5 |
||||
|
#ribbon的超时时间 |
||||
|
ribbon: |
||||
|
ReadTimeout: 60000 |
||||
|
ConnectTimeout: 60000 |
||||
|
# sleuth |
||||
|
logging: |
||||
|
level: |
||||
|
root: info |
||||
|
org.springframework.cloud.sleuth: DEBUG |
||||
|
spring: |
||||
|
# zipkin: |
||||
|
# base-url: http://49.233.89.188:9411 |
||||
|
# sleuth: |
||||
|
# sampler: |
||||
|
# # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。 |
||||
|
# probability: 1.0 |
||||
|
cloud: |
||||
|
inetutils: |
||||
|
ignored-interfaces: ['VMware.*'] |
@ -0,0 +1,82 @@ |
|||||
|
#服务端点暴露 |
||||
|
management: |
||||
|
endpoints: |
||||
|
web: |
||||
|
exposure: |
||||
|
# 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*' |
||||
|
include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream |
||||
|
# # 不暴露哪些端点 |
||||
|
exclude: env,beans,configprops |
||||
|
endpoint: |
||||
|
health: |
||||
|
# 是否展示健康检查详情 |
||||
|
show-details: always |
||||
|
health: |
||||
|
redis: |
||||
|
enabled: false |
||||
|
#eureka注册 |
||||
|
eureka: |
||||
|
client: |
||||
|
service-url: |
||||
|
# 指定eureka server通信地址,注意/eureka/小尾巴不能少 |
||||
|
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/ |
||||
|
|
||||
|
# defaultZone: http://admin:admin@81.70.54.64:7010/eureka/ |
||||
|
defaultZone: http://admin:admin@121.36.3.207:7010/eureka/ |
||||
|
|
||||
|
instance: |
||||
|
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server |
||||
|
prefer-ip-address: true |
||||
|
metadata-map: |
||||
|
management: |
||||
|
context-path: ${server.servlet.context-path:}/actuator |
||||
|
home-page-url-path: ${server.servlet.context-path:}/ |
||||
|
status-page-url-path: ${server.servlet.context-path:}/actuator/info |
||||
|
health-check-url-path: ${server.servlet.context-path:}/actuator/health |
||||
|
feign: |
||||
|
client: |
||||
|
config: |
||||
|
default: |
||||
|
connectTime: 5000 |
||||
|
readTimeout: 5000 |
||||
|
# NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。 |
||||
|
# BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。 |
||||
|
# HEADERS:记录BASIC级别的基础上,记录请求和响应的header。 |
||||
|
# FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据 |
||||
|
loggerLevel: basic |
||||
|
hystrix: |
||||
|
enabled: true |
||||
|
hystrix: |
||||
|
threadpool: |
||||
|
default: |
||||
|
coreSize: 200 #并发执行的最大线程数,默认10 |
||||
|
maxQueueSize: 1000 #BlockingQueue的最大队列数,默认值-1 |
||||
|
queueSizeRejectionThreshold: 800 #即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝,默认值5 |
||||
|
command: |
||||
|
default: |
||||
|
execution: |
||||
|
timeout: |
||||
|
enabled: true |
||||
|
isolation: |
||||
|
strategy: SEMAPHORE |
||||
|
thread: |
||||
|
timeoutInMilliseconds: 60000 |
||||
|
#ribbon的超时时间 |
||||
|
ribbon: |
||||
|
ReadTimeout: 60000 |
||||
|
ConnectTimeout: 60000 |
||||
|
# sleuth |
||||
|
logging: |
||||
|
level: |
||||
|
root: info |
||||
|
org.springframework.cloud.sleuth: DEBUG |
||||
|
spring: |
||||
|
# zipkin: |
||||
|
# base-url: http://140.143.228.3:9411 |
||||
|
# sleuth: |
||||
|
# sampler: |
||||
|
# # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。 |
||||
|
# probability: 0.1 |
||||
|
cloud: |
||||
|
inetutils: |
||||
|
ignored-interfaces: ['VMware.*'] |
@ -0,0 +1,146 @@ |
|||||
|
#<<<<<<< HEAD |
||||
|
##服务端点暴露 |
||||
|
#management: |
||||
|
# endpoints: |
||||
|
# web: |
||||
|
# exposure: |
||||
|
# # 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*' |
||||
|
# include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream |
||||
|
## # 不暴露哪些端点 |
||||
|
## exclude: env,beans,configprops |
||||
|
# endpoint: |
||||
|
# health: |
||||
|
# # 是否展示健康检查详情 |
||||
|
# show-details: always |
||||
|
# health: |
||||
|
# redis: |
||||
|
# enabled: false |
||||
|
##eureka注册 |
||||
|
#eureka: |
||||
|
# client: |
||||
|
# service-url: |
||||
|
# # 指定eureka server通信地址,注意/eureka/小尾巴不能少 |
||||
|
# #defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/ |
||||
|
## defaultZone: http://admin:admin@49.233.89.188:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@192.168.0.99:7010/eureka/ |
||||
|
# instance: |
||||
|
# # 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server |
||||
|
# prefer-ip-address: true |
||||
|
# metadata-map: |
||||
|
# management: |
||||
|
# context-path: ${server.servlet.context-path:}/actuator |
||||
|
# home-page-url-path: ${server.servlet.context-path:}/ |
||||
|
# status-page-url-path: ${server.servlet.context-path:}/actuator/info |
||||
|
# health-check-url-path: ${server.servlet.context-path:}/actuator/health |
||||
|
#feign: |
||||
|
# client: |
||||
|
# config: |
||||
|
# default: |
||||
|
# connectTime: 5000 |
||||
|
# readTimeout: 5000 |
||||
|
# # NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。 |
||||
|
# # BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。 |
||||
|
# # HEADERS:记录BASIC级别的基础上,记录请求和响应的header。 |
||||
|
# # FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据 |
||||
|
# loggerLevel: basic |
||||
|
# hystrix: |
||||
|
# enabled: true |
||||
|
## sleuth |
||||
|
#logging: |
||||
|
# level: |
||||
|
# root: info |
||||
|
# org.springframework.cloud.sleuth: DEBUG |
||||
|
#spring: |
||||
|
## zipkin: |
||||
|
## base-url: http://49.233.89.188:9411 |
||||
|
## sleuth: |
||||
|
## sampler: |
||||
|
## # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。 |
||||
|
## probability: 1.0 |
||||
|
# cloud: |
||||
|
# inetutils: |
||||
|
#======= |
||||
|
#服务端点暴露 |
||||
|
management: |
||||
|
endpoints: |
||||
|
web: |
||||
|
exposure: |
||||
|
# 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*' |
||||
|
include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream |
||||
|
# # 不暴露哪些端点 |
||||
|
# exclude: env,beans,configprops |
||||
|
endpoint: |
||||
|
health: |
||||
|
# 是否展示健康检查详情 |
||||
|
show-details: always |
||||
|
health: |
||||
|
redis: |
||||
|
enabled: false |
||||
|
#eureka注册 |
||||
|
eureka: |
||||
|
client: |
||||
|
service-url: |
||||
|
# 指定eureka server通信地址,注意/eureka/小尾巴不能少 |
||||
|
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/ |
||||
|
# defaultZone: http://admin:admin@49.232.6.143:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@192.168.0.99:7010/eureka/ |
||||
|
|
||||
|
defaultZone: http://admin:admin@192.168.0.99:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@192.168.31.13:7010/eureka/ |
||||
|
# defaultZone: http://admin:admin@test.tall.wiki:7010/eureka/ |
||||
|
instance: |
||||
|
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server |
||||
|
prefer-ip-address: true |
||||
|
metadata-map: |
||||
|
management: |
||||
|
context-path: ${server.servlet.context-path:}/actuator |
||||
|
home-page-url-path: ${server.servlet.context-path:}/ |
||||
|
status-page-url-path: ${server.servlet.context-path:}/actuator/info |
||||
|
health-check-url-path: ${server.servlet.context-path:}/actuator/health |
||||
|
feign: |
||||
|
client: |
||||
|
config: |
||||
|
default: |
||||
|
connectTime: 60000 |
||||
|
readTimeout: 60000 |
||||
|
# NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。 |
||||
|
# BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。 |
||||
|
# HEADERS:记录BASIC级别的基础上,记录请求和响应的header。 |
||||
|
# FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据 |
||||
|
loggerLevel: basic |
||||
|
hystrix: |
||||
|
enabled: true |
||||
|
hystrix: |
||||
|
command: |
||||
|
default: |
||||
|
execution: |
||||
|
timeout: |
||||
|
enabled: true |
||||
|
isolation: |
||||
|
strategy: THREAD |
||||
|
thread: |
||||
|
timeoutInMilliseconds: 60000 |
||||
|
threadpool: |
||||
|
default: |
||||
|
coreSize: 200 #并发执行的最大线程数,默认10 |
||||
|
maxQueueSize: 1000 #BlockingQueue的最大队列数,默认值-1 |
||||
|
queueSizeRejectionThreshold: 800 #即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝,默认值5 |
||||
|
#ribbon的超时时间 |
||||
|
ribbon: |
||||
|
ReadTimeout: 60000 |
||||
|
ConnectTimeout: 60000 |
||||
|
# sleuth |
||||
|
logging: |
||||
|
level: |
||||
|
root: info |
||||
|
org.springframework.cloud.sleuth: DEBUG |
||||
|
spring: |
||||
|
# zipkin: |
||||
|
# base-url: http://49.233.89.188:9411 |
||||
|
# sleuth: |
||||
|
# sampler: |
||||
|
# # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。 |
||||
|
# probability: 1.0 |
||||
|
cloud: |
||||
|
inetutils: |
||||
|
ignored-interfaces: ['VMware.*'] |
@ -0,0 +1,33 @@ |
|||||
|
HELP.md |
||||
|
target/ |
||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||
|
!**/src/main/**/target/ |
||||
|
!**/src/test/**/target/ |
||||
|
|
||||
|
### STS ### |
||||
|
.apt_generated |
||||
|
.classpath |
||||
|
.factorypath |
||||
|
.project |
||||
|
.settings |
||||
|
.springBeans |
||||
|
.sts4-cache |
||||
|
|
||||
|
### IntelliJ IDEA ### |
||||
|
.idea |
||||
|
*.iws |
||||
|
*.iml |
||||
|
*.ipr |
||||
|
|
||||
|
### NetBeans ### |
||||
|
/nbproject/private/ |
||||
|
/nbbuild/ |
||||
|
/dist/ |
||||
|
/nbdist/ |
||||
|
/.nb-gradle/ |
||||
|
build/ |
||||
|
!**/src/main/**/build/ |
||||
|
!**/src/test/**/build/ |
||||
|
|
||||
|
### VS Code ### |
||||
|
.vscode/ |
@ -0,0 +1,322 @@ |
|||||
|
#!/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 |
||||
|
# |
||||
|
# https://www.apache.org/licenses/LICENSE-2.0 |
||||
|
# |
||||
|
# Unless required by applicable law or agreed to in writing, |
||||
|
# software distributed under the License is distributed on an |
||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
||||
|
# KIND, either express or implied. See the License for the |
||||
|
# specific language governing permissions and limitations |
||||
|
# under the License. |
||||
|
# ---------------------------------------------------------------------------- |
||||
|
|
||||
|
# ---------------------------------------------------------------------------- |
||||
|
# Maven 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 |
||||
|
))" |
||||
|
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 |
||||
|
if [ -n "$MVNW_REPOURL" ]; then |
||||
|
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" |
||||
|
else |
||||
|
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" |
||||
|
fi |
||||
|
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 $cygwin; then |
||||
|
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") |
||||
|
fi |
||||
|
|
||||
|
if command -v wget >/dev/null; then |
||||
|
if [ "$MVNW_VERBOSE" = true ]; then |
||||
|
echo "Found wget ... using wget" |
||||
|
fi |
||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then |
||||
|
wget "$jarUrl" -O "$wrapperJarPath" |
||||
|
else |
||||
|
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" |
||||
|
fi |
||||
|
elif command -v curl >/dev/null; then |
||||
|
if [ "$MVNW_VERBOSE" = true ]; then |
||||
|
echo "Found curl ... using curl" |
||||
|
fi |
||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then |
||||
|
curl -o "$wrapperJarPath" "$jarUrl" -f |
||||
|
else |
||||
|
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f |
||||
|
fi |
||||
|
|
||||
|
else |
||||
|
if [ "$MVNW_VERBOSE" = true ]; then |
||||
|
echo "Falling back to using Java to download" |
||||
|
fi |
||||
|
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" |
||||
|
# For Cygwin, switch paths to Windows format before running javac |
||||
|
if $cygwin; then |
||||
|
javaClass=$(cygpath --path --windows "$javaClass") |
||||
|
fi |
||||
|
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 |
||||
|
|
||||
|
# Provide a "standardized" way to retrieve the CLI args that will |
||||
|
# work with both Windows and non-Windows executions. |
||||
|
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" |
||||
|
export MAVEN_CMD_LINE_ARGS |
||||
|
|
||||
|
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 "$@" |
@ -0,0 +1,182 @@ |
|||||
|
@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 https://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 Maven 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 keystroke 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 by 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.5.6/maven-wrapper-0.5.6.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% ( |
||||
|
if "%MVNW_VERBOSE%" == "true" ( |
||||
|
echo Found %WRAPPER_JAR% |
||||
|
) |
||||
|
) else ( |
||||
|
if not "%MVNW_REPOURL%" == "" ( |
||||
|
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" |
||||
|
) |
||||
|
if "%MVNW_VERBOSE%" == "true" ( |
||||
|
echo Couldn't find %WRAPPER_JAR%, downloading it ... |
||||
|
echo Downloading from: %DOWNLOAD_URL% |
||||
|
) |
||||
|
|
||||
|
powershell -Command "&{"^ |
||||
|
"$webclient = new-object System.Net.WebClient;"^ |
||||
|
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ |
||||
|
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ |
||||
|
"}"^ |
||||
|
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ |
||||
|
"}" |
||||
|
if "%MVNW_VERBOSE%" == "true" ( |
||||
|
echo Finished downloading %WRAPPER_JAR% |
||||
|
) |
||||
|
) |
||||
|
@REM End of extension |
||||
|
|
||||
|
@REM Provide a "standardized" way to retrieve the CLI args that will |
||||
|
@REM work with both Windows and non-Windows executions. |
||||
|
set MAVEN_CMD_LINE_ARGS=%* |
||||
|
|
||||
|
%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% |
@ -0,0 +1,90 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
<parent> |
||||
|
<artifactId>ccsens_dh</artifactId> |
||||
|
<groupId>com.ccsens</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</parent> |
||||
|
|
||||
|
<artifactId>dh_diplomatist</artifactId> |
||||
|
|
||||
|
<version>0.0.1-SNAPSHOT</version> |
||||
|
|
||||
|
<name>dh_diplomatist</name> |
||||
|
|
||||
|
<description>Demo project for Spring Boot</description> |
||||
|
<properties> |
||||
|
<java.version>1.8</java.version> |
||||
|
</properties> |
||||
|
|
||||
|
<dependencies> |
||||
|
<!--cloud 工具类--> |
||||
|
<dependency> |
||||
|
<artifactId>cloudutil</artifactId> |
||||
|
<groupId>com.ccsens</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
<!--公用接口--> |
||||
|
<!-- <dependency>--> |
||||
|
<!-- <artifactId>common</artifactId>--> |
||||
|
<!-- <groupId>com.ccsens</groupId>--> |
||||
|
<!-- <version>1.0-SNAPSHOT</version>--> |
||||
|
<!-- </dependency>--> |
||||
|
<!--util 工具类--> |
||||
|
<dependency> |
||||
|
<groupId>com.ccsens</groupId> |
||||
|
<artifactId>util</artifactId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
<scope>compile</scope> |
||||
|
</dependency> |
||||
|
<!--微信工具包--> |
||||
|
<dependency> |
||||
|
<artifactId>wechatutil</artifactId> |
||||
|
<groupId>com.ccsens</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
|
||||
|
|
||||
|
</dependencies> |
||||
|
|
||||
|
<build> |
||||
|
<plugins> |
||||
|
<plugin> |
||||
|
<groupId>org.mybatis.generator</groupId> |
||||
|
<artifactId>mybatis-generator-maven-plugin</artifactId> |
||||
|
<version>1.3.7</version> |
||||
|
<configuration> |
||||
|
<configurationFile>${basedir}/src/main/resources/mbg.xml</configurationFile> |
||||
|
<overwrite>true</overwrite> |
||||
|
</configuration> |
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>mysql</groupId> |
||||
|
<artifactId>mysql-connector-java</artifactId> |
||||
|
<version>5.1.34</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
</plugin> |
||||
|
<plugin> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
|
<configuration> |
||||
|
<mainClass>com.ccsens.dh_diplomatist.DhDiplomatistApplication</mainClass> |
||||
|
<!--<skip>true</skip>--> |
||||
|
</configuration> |
||||
|
<executions> |
||||
|
<execution> |
||||
|
<goals> |
||||
|
<goal>repackage</goal> |
||||
|
</goals> |
||||
|
</execution> |
||||
|
</executions> |
||||
|
</plugin> |
||||
|
|
||||
|
</plugins> |
||||
|
</build> |
||||
|
|
||||
|
|
||||
|
</project> |
@ -0,0 +1,33 @@ |
|||||
|
package com.ccsens.dh_diplomatist; |
||||
|
|
||||
|
import com.ccsens.cloudutil.ribbon.RibbonConfiguration; |
||||
|
import org.mybatis.spring.annotation.MapperScan; |
||||
|
import org.springframework.boot.SpringApplication; |
||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
|
import org.springframework.boot.web.servlet.ServletComponentScan; |
||||
|
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; |
||||
|
import org.springframework.cloud.openfeign.EnableFeignClients; |
||||
|
import org.springframework.context.annotation.ComponentScan; |
||||
|
import org.springframework.context.annotation.FilterType; |
||||
|
import org.springframework.scheduling.annotation.EnableAsync; |
||||
|
import org.springframework.scheduling.annotation.EnableScheduling; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@MapperScan(basePackages = {"com.ccsens.dh_diplomatist.persist.*","com.ccsens.common.persist.*"}) |
||||
|
@ServletComponentScan |
||||
|
@EnableAsync |
||||
|
@EnableScheduling |
||||
|
//开启断路器功能
|
||||
|
@EnableCircuitBreaker |
||||
|
@EnableFeignClients(basePackages = "com.ccsens.cloudutil.feign") |
||||
|
@SpringBootApplication |
||||
|
@ComponentScan(basePackages = "com.ccsens", excludeFilters = { @ComponentScan.Filter(type= FilterType.ASSIGNABLE_TYPE, value = RibbonConfiguration.class)}) |
||||
|
public class DhDiplomatistApplication { |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
SpringApplication.run(DhDiplomatistApplication.class, args); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package com.ccsens.dh_diplomatist.api; |
||||
|
|
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiImplicitParams; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Api(tags = "DEBUG" , description = "DebugController | ") |
||||
|
@RestController |
||||
|
@RequestMapping("/debug") |
||||
|
@Slf4j |
||||
|
public class DebugController { |
||||
|
|
||||
|
@ApiOperation(value = "/测试",notes = "") |
||||
|
@ApiImplicitParams({ |
||||
|
}) |
||||
|
@RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse debug(HttpServletRequest request) throws Exception { |
||||
|
|
||||
|
return JsonResponse.newInstance().ok("测试"); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,58 @@ |
|||||
|
package com.ccsens.dh_diplomatist.api; |
||||
|
|
||||
|
import cn.hutool.extra.servlet.ServletUtil; |
||||
|
import com.ccsens.dh_diplomatist.bean.dto.HeartbeatDto; |
||||
|
import com.ccsens.dh_diplomatist.bean.dto.UserDto; |
||||
|
import com.ccsens.dh_diplomatist.bean.vo.DomainVo; |
||||
|
import com.ccsens.dh_diplomatist.service.IDomainService; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import io.swagger.annotations.ApiParam; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Api(tags = "domain" , description = "域信息相关接口") |
||||
|
@RestController |
||||
|
@RequestMapping("/domain") |
||||
|
@Slf4j |
||||
|
public class DomainController { |
||||
|
@Resource |
||||
|
private IDomainService domainService; |
||||
|
|
||||
|
@ApiOperation(value = "查询用户关联的域列表(PT--传达室)", notes = "") |
||||
|
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<List<DomainVo.DomainInfo>> queryDomainByPt(@ApiParam @Validated @RequestBody UserDto.PhoneAndIdCard params) throws Exception{ |
||||
|
log.info("PT查询用户关联的域列表:{}",params); |
||||
|
|
||||
|
log.info("PT查询用户关联的域列表返回:{}",params); |
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "根据用户信息查询用户的访问权限(传达室--传达室)", notes = "") |
||||
|
@RequestMapping(value = "/queryByIdc", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<Boolean> queryDomainByIdc(@ApiParam @Validated @RequestBody UserDto.PhoneAndIdCard params) throws Exception{ |
||||
|
log.info("根据用户信息查询用户的访问权限:{}",params); |
||||
|
|
||||
|
log.info("根据用户信息查询用户的访问权限返回:{}",params); |
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "接收私域的请求返回域列表", notes = "") |
||||
|
@RequestMapping(value = "list", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<List<DomainVo.DomainInfo>> heartbeatQueryList(HttpServletRequest request, |
||||
|
@ApiParam @Validated @RequestBody HeartbeatDto.SendDomain param) throws Exception{ |
||||
|
log.info("接收私域的查询域列表请求"); |
||||
|
List<DomainVo.DomainInfo> domainInfos = domainService.heartbeatQueryList(param, ServletUtil.getClientIP(request)); |
||||
|
log.info("返回域列表信息给私域:{}",domainInfos); |
||||
|
return JsonResponse.newInstance().ok(domainInfos); |
||||
|
} |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
package com.ccsens.dh_diplomatist.api; |
||||
|
|
||||
|
import cn.hutool.extra.servlet.ServletUtil; |
||||
|
import com.ccsens.dh_diplomatist.bean.dto.HeartbeatDto; |
||||
|
import com.ccsens.dh_diplomatist.service.IHeartbeatService; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import io.swagger.annotations.ApiParam; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Api(tags = "heartbeat" , description = "域信息相关接口") |
||||
|
@RestController |
||||
|
@RequestMapping("/heartbeat") |
||||
|
@Slf4j |
||||
|
public class HeartbeatController { |
||||
|
@Resource |
||||
|
private IHeartbeatService heartbeatService; |
||||
|
|
||||
|
@ApiOperation(value = "接收私域的心跳", notes = "") |
||||
|
@RequestMapping(value = "", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse receiveHeartbeat(HttpServletRequest request, @ApiParam @Validated @RequestBody HeartbeatDto.SendDomain param) throws Exception{ |
||||
|
log.info("接收私域的心跳"); |
||||
|
heartbeatService.inHeartbeat(param,ServletUtil.getClientIP(request)); |
||||
|
log.info("接受心跳后正确返回"); |
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
package com.ccsens.dh_diplomatist.api; |
||||
|
|
||||
|
import io.swagger.annotations.Api; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Api(tags = "user" , description = "用户信息相关接口") |
||||
|
@RestController |
||||
|
@RequestMapping("/user") |
||||
|
@Slf4j |
||||
|
public class UserController { |
||||
|
|
||||
|
|
||||
|
// @ApiOperation(value = "tall调用数据中心添加用户", notes = "")
|
||||
|
// @RequestMapping(value = "/saveUserByTall", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
|
||||
|
// public JsonResponse saveUserByTall(@ApiParam @Validated @RequestBody UserDto.DomainUser params) throws Exception{
|
||||
|
// log.info("tall调用数据中心添加用户:{}",params);
|
||||
|
//
|
||||
|
// log.info("tall调用数据中心添加用户成功");
|
||||
|
// return JsonResponse.newInstance().ok();
|
||||
|
// }
|
||||
|
//
|
||||
|
// @ApiOperation(value = "私域调用公域数据中心添加用户", notes = "")
|
||||
|
// @RequestMapping(value = "/saveUserByIdc", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
|
||||
|
// public JsonResponse saveUserByIdc(@ApiParam @Validated @RequestBody UserDto.DomainUser params) throws Exception{
|
||||
|
// log.info("私域调用公域数据中心添加用户:{}",params);
|
||||
|
//
|
||||
|
// log.info("私域调用公域数据中心添加用户成功");
|
||||
|
// return JsonResponse.newInstance().ok();
|
||||
|
// }
|
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
package com.ccsens.dh_diplomatist.bean.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
public class HeartbeatDto { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("域之间传递的信息") |
||||
|
public static class SendDomain { |
||||
|
@ApiModelProperty("域code") |
||||
|
private String code; |
||||
|
@ApiModelProperty("发送时的时间戳") |
||||
|
private Long timestamp; |
||||
|
@ApiModelProperty("随机码") |
||||
|
private String noncestr; |
||||
|
@ApiModelProperty("签名后信息") |
||||
|
private byte[] data; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("心跳里的域信息") |
||||
|
public static class MessageDomainInfo { |
||||
|
@ApiModelProperty("域id") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("域名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty("域code") |
||||
|
private String code; |
||||
|
@ApiModelProperty("ip") |
||||
|
private String host; |
||||
|
} |
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
package com.ccsens.dh_diplomatist.bean.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class UserDto { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("用户身份证和手机号") |
||||
|
public static class PhoneAndIdCard{ |
||||
|
@ApiModelProperty("手机号") |
||||
|
private String phone; |
||||
|
@ApiModelProperty("身份证号") |
||||
|
private String idCard; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("域内用户信息") |
||||
|
public static class DomainUser{ |
||||
|
@ApiModelProperty("手机号") |
||||
|
private String name; |
||||
|
@ApiModelProperty("身份证号") |
||||
|
private String code; |
||||
|
@ApiModelProperty("身份证号") |
||||
|
private String domainName; |
||||
|
@ApiModelProperty("身份证号") |
||||
|
private List<PhoneAndIdCard> userList; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,117 @@ |
|||||
|
package com.ccsens.dh_diplomatist.bean.po; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class IdcBusiness implements Serializable { |
||||
|
private Long id; |
||||
|
|
||||
|
private String name; |
||||
|
|
||||
|
private String code; |
||||
|
|
||||
|
private String description; |
||||
|
|
||||
|
private Long creatorId; |
||||
|
|
||||
|
private Long operator; |
||||
|
|
||||
|
private Date createdAt; |
||||
|
|
||||
|
private Date updatedAt; |
||||
|
|
||||
|
private Byte recStatus; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public Long getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Long id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name == null ? null : name.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code == null ? null : code.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getDescription() { |
||||
|
return description; |
||||
|
} |
||||
|
|
||||
|
public void setDescription(String description) { |
||||
|
this.description = description == null ? null : description.trim(); |
||||
|
} |
||||
|
|
||||
|
public Long getCreatorId() { |
||||
|
return creatorId; |
||||
|
} |
||||
|
|
||||
|
public void setCreatorId(Long creatorId) { |
||||
|
this.creatorId = creatorId; |
||||
|
} |
||||
|
|
||||
|
public Long getOperator() { |
||||
|
return operator; |
||||
|
} |
||||
|
|
||||
|
public void setOperator(Long operator) { |
||||
|
this.operator = operator; |
||||
|
} |
||||
|
|
||||
|
public Date getCreatedAt() { |
||||
|
return createdAt; |
||||
|
} |
||||
|
|
||||
|
public void setCreatedAt(Date createdAt) { |
||||
|
this.createdAt = createdAt; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdatedAt() { |
||||
|
return updatedAt; |
||||
|
} |
||||
|
|
||||
|
public void setUpdatedAt(Date updatedAt) { |
||||
|
this.updatedAt = updatedAt; |
||||
|
} |
||||
|
|
||||
|
public Byte getRecStatus() { |
||||
|
return recStatus; |
||||
|
} |
||||
|
|
||||
|
public void setRecStatus(Byte recStatus) { |
||||
|
this.recStatus = recStatus; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append(getClass().getSimpleName()); |
||||
|
sb.append(" ["); |
||||
|
sb.append("Hash = ").append(hashCode()); |
||||
|
sb.append(", id=").append(id); |
||||
|
sb.append(", name=").append(name); |
||||
|
sb.append(", code=").append(code); |
||||
|
sb.append(", description=").append(description); |
||||
|
sb.append(", creatorId=").append(creatorId); |
||||
|
sb.append(", operator=").append(operator); |
||||
|
sb.append(", createdAt=").append(createdAt); |
||||
|
sb.append(", updatedAt=").append(updatedAt); |
||||
|
sb.append(", recStatus=").append(recStatus); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,771 @@ |
|||||
|
package com.ccsens.dh_diplomatist.bean.po; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
public class IdcBusinessExample { |
||||
|
protected String orderByClause; |
||||
|
|
||||
|
protected boolean distinct; |
||||
|
|
||||
|
protected List<Criteria> oredCriteria; |
||||
|
|
||||
|
public IdcBusinessExample() { |
||||
|
oredCriteria = new ArrayList<Criteria>(); |
||||
|
} |
||||
|
|
||||
|
public void setOrderByClause(String orderByClause) { |
||||
|
this.orderByClause = orderByClause; |
||||
|
} |
||||
|
|
||||
|
public String getOrderByClause() { |
||||
|
return orderByClause; |
||||
|
} |
||||
|
|
||||
|
public void setDistinct(boolean distinct) { |
||||
|
this.distinct = distinct; |
||||
|
} |
||||
|
|
||||
|
public boolean isDistinct() { |
||||
|
return distinct; |
||||
|
} |
||||
|
|
||||
|
public List<Criteria> getOredCriteria() { |
||||
|
return oredCriteria; |
||||
|
} |
||||
|
|
||||
|
public void or(Criteria criteria) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
|
||||
|
public Criteria or() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
oredCriteria.add(criteria); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public Criteria createCriteria() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
if (oredCriteria.size() == 0) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected Criteria createCriteriaInternal() { |
||||
|
Criteria criteria = new Criteria(); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public void clear() { |
||||
|
oredCriteria.clear(); |
||||
|
orderByClause = null; |
||||
|
distinct = false; |
||||
|
} |
||||
|
|
||||
|
protected abstract static class GeneratedCriteria { |
||||
|
protected List<Criterion> criteria; |
||||
|
|
||||
|
protected GeneratedCriteria() { |
||||
|
super(); |
||||
|
criteria = new ArrayList<Criterion>(); |
||||
|
} |
||||
|
|
||||
|
public boolean isValid() { |
||||
|
return criteria.size() > 0; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getAllCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition) { |
||||
|
if (condition == null) { |
||||
|
throw new RuntimeException("Value for condition cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value, String property) { |
||||
|
if (value == null) { |
||||
|
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
|
if (value1 == null || value2 == null) { |
||||
|
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value1, value2)); |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNull() { |
||||
|
addCriterion("id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNotNull() { |
||||
|
addCriterion("id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdEqualTo(Long value) { |
||||
|
addCriterion("id =", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotEqualTo(Long value) { |
||||
|
addCriterion("id <>", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThan(Long value) { |
||||
|
addCriterion("id >", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("id >=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThan(Long value) { |
||||
|
addCriterion("id <", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("id <=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIn(List<Long> values) { |
||||
|
addCriterion("id in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotIn(List<Long> values) { |
||||
|
addCriterion("id not in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("id between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("id not between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameIsNull() { |
||||
|
addCriterion("name is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameIsNotNull() { |
||||
|
addCriterion("name is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameEqualTo(String value) { |
||||
|
addCriterion("name =", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameNotEqualTo(String value) { |
||||
|
addCriterion("name <>", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameGreaterThan(String value) { |
||||
|
addCriterion("name >", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("name >=", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameLessThan(String value) { |
||||
|
addCriterion("name <", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameLessThanOrEqualTo(String value) { |
||||
|
addCriterion("name <=", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameLike(String value) { |
||||
|
addCriterion("name like", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameNotLike(String value) { |
||||
|
addCriterion("name not like", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameIn(List<String> values) { |
||||
|
addCriterion("name in", values, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameNotIn(List<String> values) { |
||||
|
addCriterion("name not in", values, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameBetween(String value1, String value2) { |
||||
|
addCriterion("name between", value1, value2, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameNotBetween(String value1, String value2) { |
||||
|
addCriterion("name not between", value1, value2, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeIsNull() { |
||||
|
addCriterion("code is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeIsNotNull() { |
||||
|
addCriterion("code is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeEqualTo(String value) { |
||||
|
addCriterion("code =", value, "code"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeNotEqualTo(String value) { |
||||
|
addCriterion("code <>", value, "code"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeGreaterThan(String value) { |
||||
|
addCriterion("code >", value, "code"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("code >=", value, "code"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeLessThan(String value) { |
||||
|
addCriterion("code <", value, "code"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeLessThanOrEqualTo(String value) { |
||||
|
addCriterion("code <=", value, "code"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeLike(String value) { |
||||
|
addCriterion("code like", value, "code"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeNotLike(String value) { |
||||
|
addCriterion("code not like", value, "code"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeIn(List<String> values) { |
||||
|
addCriterion("code in", values, "code"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeNotIn(List<String> values) { |
||||
|
addCriterion("code not in", values, "code"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeBetween(String value1, String value2) { |
||||
|
addCriterion("code between", value1, value2, "code"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCodeNotBetween(String value1, String value2) { |
||||
|
addCriterion("code not between", value1, value2, "code"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionIsNull() { |
||||
|
addCriterion("description is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionIsNotNull() { |
||||
|
addCriterion("description is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionEqualTo(String value) { |
||||
|
addCriterion("description =", value, "description"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionNotEqualTo(String value) { |
||||
|
addCriterion("description <>", value, "description"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionGreaterThan(String value) { |
||||
|
addCriterion("description >", value, "description"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("description >=", value, "description"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionLessThan(String value) { |
||||
|
addCriterion("description <", value, "description"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionLessThanOrEqualTo(String value) { |
||||
|
addCriterion("description <=", value, "description"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionLike(String value) { |
||||
|
addCriterion("description like", value, "description"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionNotLike(String value) { |
||||
|
addCriterion("description not like", value, "description"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionIn(List<String> values) { |
||||
|
addCriterion("description in", values, "description"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionNotIn(List<String> values) { |
||||
|
addCriterion("description not in", values, "description"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionBetween(String value1, String value2) { |
||||
|
addCriterion("description between", value1, value2, "description"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDescriptionNotBetween(String value1, String value2) { |
||||
|
addCriterion("description not between", value1, value2, "description"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatorIdIsNull() { |
||||
|
addCriterion("creator_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatorIdIsNotNull() { |
||||
|
addCriterion("creator_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatorIdEqualTo(Long value) { |
||||
|
addCriterion("creator_id =", value, "creatorId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatorIdNotEqualTo(Long value) { |
||||
|
addCriterion("creator_id <>", value, "creatorId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatorIdGreaterThan(Long value) { |
||||
|
addCriterion("creator_id >", value, "creatorId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("creator_id >=", value, "creatorId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatorIdLessThan(Long value) { |
||||
|
addCriterion("creator_id <", value, "creatorId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatorIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("creator_id <=", value, "creatorId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatorIdIn(List<Long> values) { |
||||
|
addCriterion("creator_id in", values, "creatorId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatorIdNotIn(List<Long> values) { |
||||
|
addCriterion("creator_id not in", values, "creatorId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatorIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("creator_id between", value1, value2, "creatorId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatorIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("creator_id not between", value1, value2, "creatorId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorIsNull() { |
||||
|
addCriterion("operator is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorIsNotNull() { |
||||
|
addCriterion("operator is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorEqualTo(Long value) { |
||||
|
addCriterion("operator =", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorNotEqualTo(Long value) { |
||||
|
addCriterion("operator <>", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorGreaterThan(Long value) { |
||||
|
addCriterion("operator >", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("operator >=", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorLessThan(Long value) { |
||||
|
addCriterion("operator <", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("operator <=", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorIn(List<Long> values) { |
||||
|
addCriterion("operator in", values, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorNotIn(List<Long> values) { |
||||
|
addCriterion("operator not in", values, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorBetween(Long value1, Long value2) { |
||||
|
addCriterion("operator between", value1, value2, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("operator not between", value1, value2, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNull() { |
||||
|
addCriterion("created_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNotNull() { |
||||
|
addCriterion("created_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtEqualTo(Date value) { |
||||
|
addCriterion("created_at =", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("created_at <>", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThan(Date value) { |
||||
|
addCriterion("created_at >", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at >=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThan(Date value) { |
||||
|
addCriterion("created_at <", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at <=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIn(List<Date> values) { |
||||
|
addCriterion("created_at in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("created_at not in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at not between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNull() { |
||||
|
addCriterion("updated_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNotNull() { |
||||
|
addCriterion("updated_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtEqualTo(Date value) { |
||||
|
addCriterion("updated_at =", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("updated_at <>", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThan(Date value) { |
||||
|
addCriterion("updated_at >", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at >=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThan(Date value) { |
||||
|
addCriterion("updated_at <", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at <=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIn(List<Date> values) { |
||||
|
addCriterion("updated_at in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("updated_at not in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at not between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNull() { |
||||
|
addCriterion("rec_status is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNotNull() { |
||||
|
addCriterion("rec_status is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusEqualTo(Byte value) { |
||||
|
addCriterion("rec_status =", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <>", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThan(Byte value) { |
||||
|
addCriterion("rec_status >", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status >=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThan(Byte value) { |
||||
|
addCriterion("rec_status <", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIn(List<Byte> values) { |
||||
|
addCriterion("rec_status in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotIn(List<Byte> values) { |
||||
|
addCriterion("rec_status not in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status not between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criteria extends GeneratedCriteria { |
||||
|
|
||||
|
protected Criteria() { |
||||
|
super(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criterion { |
||||
|
private String condition; |
||||
|
|
||||
|
private Object value; |
||||
|
|
||||
|
private Object secondValue; |
||||
|
|
||||
|
private boolean noValue; |
||||
|
|
||||
|
private boolean singleValue; |
||||
|
|
||||
|
private boolean betweenValue; |
||||
|
|
||||
|
private boolean listValue; |
||||
|
|
||||
|
private String typeHandler; |
||||
|
|
||||
|
public String getCondition() { |
||||
|
return condition; |
||||
|
} |
||||
|
|
||||
|
public Object getValue() { |
||||
|
return value; |
||||
|
} |
||||
|
|
||||
|
public Object getSecondValue() { |
||||
|
return secondValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isNoValue() { |
||||
|
return noValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isSingleValue() { |
||||
|
return singleValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isBetweenValue() { |
||||
|
return betweenValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isListValue() { |
||||
|
return listValue; |
||||
|
} |
||||
|
|
||||
|
public String getTypeHandler() { |
||||
|
return typeHandler; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.typeHandler = null; |
||||
|
this.noValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.typeHandler = typeHandler; |
||||
|
if (value instanceof List<?>) { |
||||
|
this.listValue = true; |
||||
|
} else { |
||||
|
this.singleValue = true; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value) { |
||||
|
this(condition, value, null); |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.secondValue = secondValue; |
||||
|
this.typeHandler = typeHandler; |
||||
|
this.betweenValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue) { |
||||
|
this(condition, value, secondValue, null); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,227 @@ |
|||||
|
package com.ccsens.dh_diplomatist.bean.po; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class IdcDomain implements Serializable { |
||||
|
private Long id; |
||||
|
|
||||
|
private String name; |
||||
|
|
||||
|
private String code; |
||||
|
|
||||
|
private String intro; |
||||
|
|
||||
|
private String url; |
||||
|
|
||||
|
private String host; |
||||
|
|
||||
|
private Byte self; |
||||
|
|
||||
|
private Byte pub; |
||||
|
|
||||
|
private Byte polling; |
||||
|
|
||||
|
private Byte answer; |
||||
|
|
||||
|
private Long lastUpdateTime; |
||||
|
|
||||
|
private Long lastAskTime; |
||||
|
|
||||
|
private Long lastAnswerTime; |
||||
|
|
||||
|
private String publicKey; |
||||
|
|
||||
|
private String privateKey; |
||||
|
|
||||
|
private Long operator; |
||||
|
|
||||
|
private Date createdAt; |
||||
|
|
||||
|
private Date updatedAt; |
||||
|
|
||||
|
private Byte recStatus; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public Long getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Long id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name == null ? null : name.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code == null ? null : code.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getIntro() { |
||||
|
return intro; |
||||
|
} |
||||
|
|
||||
|
public void setIntro(String intro) { |
||||
|
this.intro = intro == null ? null : intro.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getUrl() { |
||||
|
return url; |
||||
|
} |
||||
|
|
||||
|
public void setUrl(String url) { |
||||
|
this.url = url == null ? null : url.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getHost() { |
||||
|
return host; |
||||
|
} |
||||
|
|
||||
|
public void setHost(String host) { |
||||
|
this.host = host == null ? null : host.trim(); |
||||
|
} |
||||
|
|
||||
|
public Byte getSelf() { |
||||
|
return self; |
||||
|
} |
||||
|
|
||||
|
public void setSelf(Byte self) { |
||||
|
this.self = self; |
||||
|
} |
||||
|
|
||||
|
public Byte getPub() { |
||||
|
return pub; |
||||
|
} |
||||
|
|
||||
|
public void setPub(Byte pub) { |
||||
|
this.pub = pub; |
||||
|
} |
||||
|
|
||||
|
public Byte getPolling() { |
||||
|
return polling; |
||||
|
} |
||||
|
|
||||
|
public void setPolling(Byte polling) { |
||||
|
this.polling = polling; |
||||
|
} |
||||
|
|
||||
|
public Byte getAnswer() { |
||||
|
return answer; |
||||
|
} |
||||
|
|
||||
|
public void setAnswer(Byte answer) { |
||||
|
this.answer = answer; |
||||
|
} |
||||
|
|
||||
|
public Long getLastUpdateTime() { |
||||
|
return lastUpdateTime; |
||||
|
} |
||||
|
|
||||
|
public void setLastUpdateTime(Long lastUpdateTime) { |
||||
|
this.lastUpdateTime = lastUpdateTime; |
||||
|
} |
||||
|
|
||||
|
public Long getLastAskTime() { |
||||
|
return lastAskTime; |
||||
|
} |
||||
|
|
||||
|
public void setLastAskTime(Long lastAskTime) { |
||||
|
this.lastAskTime = lastAskTime; |
||||
|
} |
||||
|
|
||||
|
public Long getLastAnswerTime() { |
||||
|
return lastAnswerTime; |
||||
|
} |
||||
|
|
||||
|
public void setLastAnswerTime(Long lastAnswerTime) { |
||||
|
this.lastAnswerTime = lastAnswerTime; |
||||
|
} |
||||
|
|
||||
|
public String getPublicKey() { |
||||
|
return publicKey; |
||||
|
} |
||||
|
|
||||
|
public void setPublicKey(String publicKey) { |
||||
|
this.publicKey = publicKey == null ? null : publicKey.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getPrivateKey() { |
||||
|
return privateKey; |
||||
|
} |
||||
|
|
||||
|
public void setPrivateKey(String privateKey) { |
||||
|
this.privateKey = privateKey == null ? null : privateKey.trim(); |
||||
|
} |
||||
|
|
||||
|
public Long getOperator() { |
||||
|
return operator; |
||||
|
} |
||||
|
|
||||
|
public void setOperator(Long operator) { |
||||
|
this.operator = operator; |
||||
|
} |
||||
|
|
||||
|
public Date getCreatedAt() { |
||||
|
return createdAt; |
||||
|
} |
||||
|
|
||||
|
public void setCreatedAt(Date createdAt) { |
||||
|
this.createdAt = createdAt; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdatedAt() { |
||||
|
return updatedAt; |
||||
|
} |
||||
|
|
||||
|
public void setUpdatedAt(Date updatedAt) { |
||||
|
this.updatedAt = updatedAt; |
||||
|
} |
||||
|
|
||||
|
public Byte getRecStatus() { |
||||
|
return recStatus; |
||||
|
} |
||||
|
|
||||
|
public void setRecStatus(Byte recStatus) { |
||||
|
this.recStatus = recStatus; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append(getClass().getSimpleName()); |
||||
|
sb.append(" ["); |
||||
|
sb.append("Hash = ").append(hashCode()); |
||||
|
sb.append(", id=").append(id); |
||||
|
sb.append(", name=").append(name); |
||||
|
sb.append(", code=").append(code); |
||||
|
sb.append(", intro=").append(intro); |
||||
|
sb.append(", url=").append(url); |
||||
|
sb.append(", host=").append(host); |
||||
|
sb.append(", self=").append(self); |
||||
|
sb.append(", pub=").append(pub); |
||||
|
sb.append(", polling=").append(polling); |
||||
|
sb.append(", answer=").append(answer); |
||||
|
sb.append(", lastUpdateTime=").append(lastUpdateTime); |
||||
|
sb.append(", lastAskTime=").append(lastAskTime); |
||||
|
sb.append(", lastAnswerTime=").append(lastAnswerTime); |
||||
|
sb.append(", publicKey=").append(publicKey); |
||||
|
sb.append(", privateKey=").append(privateKey); |
||||
|
sb.append(", operator=").append(operator); |
||||
|
sb.append(", createdAt=").append(createdAt); |
||||
|
sb.append(", updatedAt=").append(updatedAt); |
||||
|
sb.append(", recStatus=").append(recStatus); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,128 @@ |
|||||
|
package com.ccsens.dh_diplomatist.bean.po; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class IdcDomainBusiness implements Serializable { |
||||
|
private Long id; |
||||
|
|
||||
|
private Long domainId; |
||||
|
|
||||
|
private Long businessId; |
||||
|
|
||||
|
private String url; |
||||
|
|
||||
|
private String appId; |
||||
|
|
||||
|
private String secret; |
||||
|
|
||||
|
private Long operator; |
||||
|
|
||||
|
private Date createdAt; |
||||
|
|
||||
|
private Date updatedAt; |
||||
|
|
||||
|
private Byte recStatus; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public Long getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Long id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Long getDomainId() { |
||||
|
return domainId; |
||||
|
} |
||||
|
|
||||
|
public void setDomainId(Long domainId) { |
||||
|
this.domainId = domainId; |
||||
|
} |
||||
|
|
||||
|
public Long getBusinessId() { |
||||
|
return businessId; |
||||
|
} |
||||
|
|
||||
|
public void setBusinessId(Long businessId) { |
||||
|
this.businessId = businessId; |
||||
|
} |
||||
|
|
||||
|
public String getUrl() { |
||||
|
return url; |
||||
|
} |
||||
|
|
||||
|
public void setUrl(String url) { |
||||
|
this.url = url == null ? null : url.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getAppId() { |
||||
|
return appId; |
||||
|
} |
||||
|
|
||||
|
public void setAppId(String appId) { |
||||
|
this.appId = appId == null ? null : appId.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getSecret() { |
||||
|
return secret; |
||||
|
} |
||||
|
|
||||
|
public void setSecret(String secret) { |
||||
|
this.secret = secret == null ? null : secret.trim(); |
||||
|
} |
||||
|
|
||||
|
public Long getOperator() { |
||||
|
return operator; |
||||
|
} |
||||
|
|
||||
|
public void setOperator(Long operator) { |
||||
|
this.operator = operator; |
||||
|
} |
||||
|
|
||||
|
public Date getCreatedAt() { |
||||
|
return createdAt; |
||||
|
} |
||||
|
|
||||
|
public void setCreatedAt(Date createdAt) { |
||||
|
this.createdAt = createdAt; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdatedAt() { |
||||
|
return updatedAt; |
||||
|
} |
||||
|
|
||||
|
public void setUpdatedAt(Date updatedAt) { |
||||
|
this.updatedAt = updatedAt; |
||||
|
} |
||||
|
|
||||
|
public Byte getRecStatus() { |
||||
|
return recStatus; |
||||
|
} |
||||
|
|
||||
|
public void setRecStatus(Byte recStatus) { |
||||
|
this.recStatus = recStatus; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append(getClass().getSimpleName()); |
||||
|
sb.append(" ["); |
||||
|
sb.append("Hash = ").append(hashCode()); |
||||
|
sb.append(", id=").append(id); |
||||
|
sb.append(", domainId=").append(domainId); |
||||
|
sb.append(", businessId=").append(businessId); |
||||
|
sb.append(", url=").append(url); |
||||
|
sb.append(", appId=").append(appId); |
||||
|
sb.append(", secret=").append(secret); |
||||
|
sb.append(", operator=").append(operator); |
||||
|
sb.append(", createdAt=").append(createdAt); |
||||
|
sb.append(", updatedAt=").append(updatedAt); |
||||
|
sb.append(", recStatus=").append(recStatus); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,831 @@ |
|||||
|
package com.ccsens.dh_diplomatist.bean.po; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
public class IdcDomainBusinessExample { |
||||
|
protected String orderByClause; |
||||
|
|
||||
|
protected boolean distinct; |
||||
|
|
||||
|
protected List<Criteria> oredCriteria; |
||||
|
|
||||
|
public IdcDomainBusinessExample() { |
||||
|
oredCriteria = new ArrayList<Criteria>(); |
||||
|
} |
||||
|
|
||||
|
public void setOrderByClause(String orderByClause) { |
||||
|
this.orderByClause = orderByClause; |
||||
|
} |
||||
|
|
||||
|
public String getOrderByClause() { |
||||
|
return orderByClause; |
||||
|
} |
||||
|
|
||||
|
public void setDistinct(boolean distinct) { |
||||
|
this.distinct = distinct; |
||||
|
} |
||||
|
|
||||
|
public boolean isDistinct() { |
||||
|
return distinct; |
||||
|
} |
||||
|
|
||||
|
public List<Criteria> getOredCriteria() { |
||||
|
return oredCriteria; |
||||
|
} |
||||
|
|
||||
|
public void or(Criteria criteria) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
|
||||
|
public Criteria or() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
oredCriteria.add(criteria); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public Criteria createCriteria() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
if (oredCriteria.size() == 0) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected Criteria createCriteriaInternal() { |
||||
|
Criteria criteria = new Criteria(); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public void clear() { |
||||
|
oredCriteria.clear(); |
||||
|
orderByClause = null; |
||||
|
distinct = false; |
||||
|
} |
||||
|
|
||||
|
protected abstract static class GeneratedCriteria { |
||||
|
protected List<Criterion> criteria; |
||||
|
|
||||
|
protected GeneratedCriteria() { |
||||
|
super(); |
||||
|
criteria = new ArrayList<Criterion>(); |
||||
|
} |
||||
|
|
||||
|
public boolean isValid() { |
||||
|
return criteria.size() > 0; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getAllCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition) { |
||||
|
if (condition == null) { |
||||
|
throw new RuntimeException("Value for condition cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value, String property) { |
||||
|
if (value == null) { |
||||
|
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
|
if (value1 == null || value2 == null) { |
||||
|
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value1, value2)); |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNull() { |
||||
|
addCriterion("id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNotNull() { |
||||
|
addCriterion("id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdEqualTo(Long value) { |
||||
|
addCriterion("id =", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotEqualTo(Long value) { |
||||
|
addCriterion("id <>", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThan(Long value) { |
||||
|
addCriterion("id >", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("id >=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThan(Long value) { |
||||
|
addCriterion("id <", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("id <=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIn(List<Long> values) { |
||||
|
addCriterion("id in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotIn(List<Long> values) { |
||||
|
addCriterion("id not in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("id between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("id not between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDomainIdIsNull() { |
||||
|
addCriterion("domain_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDomainIdIsNotNull() { |
||||
|
addCriterion("domain_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDomainIdEqualTo(Long value) { |
||||
|
addCriterion("domain_id =", value, "domainId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDomainIdNotEqualTo(Long value) { |
||||
|
addCriterion("domain_id <>", value, "domainId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDomainIdGreaterThan(Long value) { |
||||
|
addCriterion("domain_id >", value, "domainId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDomainIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("domain_id >=", value, "domainId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDomainIdLessThan(Long value) { |
||||
|
addCriterion("domain_id <", value, "domainId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDomainIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("domain_id <=", value, "domainId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDomainIdIn(List<Long> values) { |
||||
|
addCriterion("domain_id in", values, "domainId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDomainIdNotIn(List<Long> values) { |
||||
|
addCriterion("domain_id not in", values, "domainId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDomainIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("domain_id between", value1, value2, "domainId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andDomainIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("domain_id not between", value1, value2, "domainId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBusinessIdIsNull() { |
||||
|
addCriterion("business_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBusinessIdIsNotNull() { |
||||
|
addCriterion("business_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBusinessIdEqualTo(Long value) { |
||||
|
addCriterion("business_id =", value, "businessId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBusinessIdNotEqualTo(Long value) { |
||||
|
addCriterion("business_id <>", value, "businessId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBusinessIdGreaterThan(Long value) { |
||||
|
addCriterion("business_id >", value, "businessId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBusinessIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("business_id >=", value, "businessId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBusinessIdLessThan(Long value) { |
||||
|
addCriterion("business_id <", value, "businessId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBusinessIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("business_id <=", value, "businessId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBusinessIdIn(List<Long> values) { |
||||
|
addCriterion("business_id in", values, "businessId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBusinessIdNotIn(List<Long> values) { |
||||
|
addCriterion("business_id not in", values, "businessId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBusinessIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("business_id between", value1, value2, "businessId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBusinessIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("business_id not between", value1, value2, "businessId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlIsNull() { |
||||
|
addCriterion("url is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlIsNotNull() { |
||||
|
addCriterion("url is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlEqualTo(String value) { |
||||
|
addCriterion("url =", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlNotEqualTo(String value) { |
||||
|
addCriterion("url <>", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlGreaterThan(String value) { |
||||
|
addCriterion("url >", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("url >=", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlLessThan(String value) { |
||||
|
addCriterion("url <", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlLessThanOrEqualTo(String value) { |
||||
|
addCriterion("url <=", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlLike(String value) { |
||||
|
addCriterion("url like", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlNotLike(String value) { |
||||
|
addCriterion("url not like", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlIn(List<String> values) { |
||||
|
addCriterion("url in", values, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlNotIn(List<String> values) { |
||||
|
addCriterion("url not in", values, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlBetween(String value1, String value2) { |
||||
|
addCriterion("url between", value1, value2, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlNotBetween(String value1, String value2) { |
||||
|
addCriterion("url not between", value1, value2, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdIsNull() { |
||||
|
addCriterion("app_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdIsNotNull() { |
||||
|
addCriterion("app_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdEqualTo(String value) { |
||||
|
addCriterion("app_id =", value, "appId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdNotEqualTo(String value) { |
||||
|
addCriterion("app_id <>", value, "appId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdGreaterThan(String value) { |
||||
|
addCriterion("app_id >", value, "appId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("app_id >=", value, "appId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdLessThan(String value) { |
||||
|
addCriterion("app_id <", value, "appId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdLessThanOrEqualTo(String value) { |
||||
|
addCriterion("app_id <=", value, "appId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdLike(String value) { |
||||
|
addCriterion("app_id like", value, "appId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdNotLike(String value) { |
||||
|
addCriterion("app_id not like", value, "appId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdIn(List<String> values) { |
||||
|
addCriterion("app_id in", values, "appId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdNotIn(List<String> values) { |
||||
|
addCriterion("app_id not in", values, "appId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdBetween(String value1, String value2) { |
||||
|
addCriterion("app_id between", value1, value2, "appId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andAppIdNotBetween(String value1, String value2) { |
||||
|
addCriterion("app_id not between", value1, value2, "appId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretIsNull() { |
||||
|
addCriterion("secret is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretIsNotNull() { |
||||
|
addCriterion("secret is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretEqualTo(String value) { |
||||
|
addCriterion("secret =", value, "secret"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretNotEqualTo(String value) { |
||||
|
addCriterion("secret <>", value, "secret"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretGreaterThan(String value) { |
||||
|
addCriterion("secret >", value, "secret"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("secret >=", value, "secret"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretLessThan(String value) { |
||||
|
addCriterion("secret <", value, "secret"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretLessThanOrEqualTo(String value) { |
||||
|
addCriterion("secret <=", value, "secret"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretLike(String value) { |
||||
|
addCriterion("secret like", value, "secret"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretNotLike(String value) { |
||||
|
addCriterion("secret not like", value, "secret"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretIn(List<String> values) { |
||||
|
addCriterion("secret in", values, "secret"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretNotIn(List<String> values) { |
||||
|
addCriterion("secret not in", values, "secret"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretBetween(String value1, String value2) { |
||||
|
addCriterion("secret between", value1, value2, "secret"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andSecretNotBetween(String value1, String value2) { |
||||
|
addCriterion("secret not between", value1, value2, "secret"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorIsNull() { |
||||
|
addCriterion("operator is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorIsNotNull() { |
||||
|
addCriterion("operator is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorEqualTo(Long value) { |
||||
|
addCriterion("operator =", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorNotEqualTo(Long value) { |
||||
|
addCriterion("operator <>", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorGreaterThan(Long value) { |
||||
|
addCriterion("operator >", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("operator >=", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorLessThan(Long value) { |
||||
|
addCriterion("operator <", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("operator <=", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorIn(List<Long> values) { |
||||
|
addCriterion("operator in", values, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorNotIn(List<Long> values) { |
||||
|
addCriterion("operator not in", values, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorBetween(Long value1, Long value2) { |
||||
|
addCriterion("operator between", value1, value2, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("operator not between", value1, value2, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNull() { |
||||
|
addCriterion("created_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNotNull() { |
||||
|
addCriterion("created_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtEqualTo(Date value) { |
||||
|
addCriterion("created_at =", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("created_at <>", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThan(Date value) { |
||||
|
addCriterion("created_at >", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at >=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThan(Date value) { |
||||
|
addCriterion("created_at <", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at <=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIn(List<Date> values) { |
||||
|
addCriterion("created_at in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("created_at not in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at not between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNull() { |
||||
|
addCriterion("updated_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNotNull() { |
||||
|
addCriterion("updated_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtEqualTo(Date value) { |
||||
|
addCriterion("updated_at =", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("updated_at <>", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThan(Date value) { |
||||
|
addCriterion("updated_at >", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at >=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThan(Date value) { |
||||
|
addCriterion("updated_at <", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at <=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIn(List<Date> values) { |
||||
|
addCriterion("updated_at in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("updated_at not in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at not between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNull() { |
||||
|
addCriterion("rec_status is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNotNull() { |
||||
|
addCriterion("rec_status is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusEqualTo(Byte value) { |
||||
|
addCriterion("rec_status =", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <>", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThan(Byte value) { |
||||
|
addCriterion("rec_status >", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status >=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThan(Byte value) { |
||||
|
addCriterion("rec_status <", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIn(List<Byte> values) { |
||||
|
addCriterion("rec_status in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotIn(List<Byte> values) { |
||||
|
addCriterion("rec_status not in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status not between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criteria extends GeneratedCriteria { |
||||
|
|
||||
|
protected Criteria() { |
||||
|
super(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criterion { |
||||
|
private String condition; |
||||
|
|
||||
|
private Object value; |
||||
|
|
||||
|
private Object secondValue; |
||||
|
|
||||
|
private boolean noValue; |
||||
|
|
||||
|
private boolean singleValue; |
||||
|
|
||||
|
private boolean betweenValue; |
||||
|
|
||||
|
private boolean listValue; |
||||
|
|
||||
|
private String typeHandler; |
||||
|
|
||||
|
public String getCondition() { |
||||
|
return condition; |
||||
|
} |
||||
|
|
||||
|
public Object getValue() { |
||||
|
return value; |
||||
|
} |
||||
|
|
||||
|
public Object getSecondValue() { |
||||
|
return secondValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isNoValue() { |
||||
|
return noValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isSingleValue() { |
||||
|
return singleValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isBetweenValue() { |
||||
|
return betweenValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isListValue() { |
||||
|
return listValue; |
||||
|
} |
||||
|
|
||||
|
public String getTypeHandler() { |
||||
|
return typeHandler; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.typeHandler = null; |
||||
|
this.noValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.typeHandler = typeHandler; |
||||
|
if (value instanceof List<?>) { |
||||
|
this.listValue = true; |
||||
|
} else { |
||||
|
this.singleValue = true; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value) { |
||||
|
this(condition, value, null); |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.secondValue = secondValue; |
||||
|
this.typeHandler = typeHandler; |
||||
|
this.betweenValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue) { |
||||
|
this(condition, value, secondValue, null); |
||||
|
} |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,95 @@ |
|||||
|
package com.ccsens.dh_diplomatist.bean.po; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class IdcUser implements Serializable { |
||||
|
private Long id; |
||||
|
|
||||
|
private String idCard; |
||||
|
|
||||
|
private String phone; |
||||
|
|
||||
|
private Long operator; |
||||
|
|
||||
|
private Date createdAt; |
||||
|
|
||||
|
private Date updatedAt; |
||||
|
|
||||
|
private Byte recStatus; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public Long getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Long id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getIdCard() { |
||||
|
return idCard; |
||||
|
} |
||||
|
|
||||
|
public void setIdCard(String idCard) { |
||||
|
this.idCard = idCard == null ? null : idCard.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getPhone() { |
||||
|
return phone; |
||||
|
} |
||||
|
|
||||
|
public void setPhone(String phone) { |
||||
|
this.phone = phone == null ? null : phone.trim(); |
||||
|
} |
||||
|
|
||||
|
public Long getOperator() { |
||||
|
return operator; |
||||
|
} |
||||
|
|
||||
|
public void setOperator(Long operator) { |
||||
|
this.operator = operator; |
||||
|
} |
||||
|
|
||||
|
public Date getCreatedAt() { |
||||
|
return createdAt; |
||||
|
} |
||||
|
|
||||
|
public void setCreatedAt(Date createdAt) { |
||||
|
this.createdAt = createdAt; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdatedAt() { |
||||
|
return updatedAt; |
||||
|
} |
||||
|
|
||||
|
public void setUpdatedAt(Date updatedAt) { |
||||
|
this.updatedAt = updatedAt; |
||||
|
} |
||||
|
|
||||
|
public Byte getRecStatus() { |
||||
|
return recStatus; |
||||
|
} |
||||
|
|
||||
|
public void setRecStatus(Byte recStatus) { |
||||
|
this.recStatus = recStatus; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append(getClass().getSimpleName()); |
||||
|
sb.append(" ["); |
||||
|
sb.append("Hash = ").append(hashCode()); |
||||
|
sb.append(", id=").append(id); |
||||
|
sb.append(", idCard=").append(idCard); |
||||
|
sb.append(", phone=").append(phone); |
||||
|
sb.append(", operator=").append(operator); |
||||
|
sb.append(", createdAt=").append(createdAt); |
||||
|
sb.append(", updatedAt=").append(updatedAt); |
||||
|
sb.append(", recStatus=").append(recStatus); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,172 @@ |
|||||
|
package com.ccsens.dh_diplomatist.bean.po; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class IdcUserDomain implements Serializable { |
||||
|
private Long id; |
||||
|
|
||||
|
private Long userId; |
||||
|
|
||||
|
private Long domainId; |
||||
|
|
||||
|
private Long domainUserId; |
||||
|
|
||||
|
private String name; |
||||
|
|
||||
|
private Byte gender; |
||||
|
|
||||
|
private String avatarUrl; |
||||
|
|
||||
|
private String country; |
||||
|
|
||||
|
private String province; |
||||
|
|
||||
|
private String city; |
||||
|
|
||||
|
private Long operator; |
||||
|
|
||||
|
private Date createdAt; |
||||
|
|
||||
|
private Date updatedAt; |
||||
|
|
||||
|
private Byte recStatus; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public Long getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Long id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Long getUserId() { |
||||
|
return userId; |
||||
|
} |
||||
|
|
||||
|
public void setUserId(Long userId) { |
||||
|
this.userId = userId; |
||||
|
} |
||||
|
|
||||
|
public Long getDomainId() { |
||||
|
return domainId; |
||||
|
} |
||||
|
|
||||
|
public void setDomainId(Long domainId) { |
||||
|
this.domainId = domainId; |
||||
|
} |
||||
|
|
||||
|
public Long getDomainUserId() { |
||||
|
return domainUserId; |
||||
|
} |
||||
|
|
||||
|
public void setDomainUserId(Long domainUserId) { |
||||
|
this.domainUserId = domainUserId; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name == null ? null : name.trim(); |
||||
|
} |
||||
|
|
||||
|
public Byte getGender() { |
||||
|
return gender; |
||||
|
} |
||||
|
|
||||
|
public void setGender(Byte gender) { |
||||
|
this.gender = gender; |
||||
|
} |
||||
|
|
||||
|
public String getAvatarUrl() { |
||||
|
return avatarUrl; |
||||
|
} |
||||
|
|
||||
|
public void setAvatarUrl(String avatarUrl) { |
||||
|
this.avatarUrl = avatarUrl == null ? null : avatarUrl.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getCountry() { |
||||
|
return country; |
||||
|
} |
||||
|
|
||||
|
public void setCountry(String country) { |
||||
|
this.country = country == null ? null : country.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getProvince() { |
||||
|
return province; |
||||
|
} |
||||
|
|
||||
|
public void setProvince(String province) { |
||||
|
this.province = province == null ? null : province.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getCity() { |
||||
|
return city; |
||||
|
} |
||||
|
|
||||
|
public void setCity(String city) { |
||||
|
this.city = city == null ? null : city.trim(); |
||||
|
} |
||||
|
|
||||
|
public Long getOperator() { |
||||
|
return operator; |
||||
|
} |
||||
|
|
||||
|
public void setOperator(Long operator) { |
||||
|
this.operator = operator; |
||||
|
} |
||||
|
|
||||
|
public Date getCreatedAt() { |
||||
|
return createdAt; |
||||
|
} |
||||
|
|
||||
|
public void setCreatedAt(Date createdAt) { |
||||
|
this.createdAt = createdAt; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdatedAt() { |
||||
|
return updatedAt; |
||||
|
} |
||||
|
|
||||
|
public void setUpdatedAt(Date updatedAt) { |
||||
|
this.updatedAt = updatedAt; |
||||
|
} |
||||
|
|
||||
|
public Byte getRecStatus() { |
||||
|
return recStatus; |
||||
|
} |
||||
|
|
||||
|
public void setRecStatus(Byte recStatus) { |
||||
|
this.recStatus = recStatus; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append(getClass().getSimpleName()); |
||||
|
sb.append(" ["); |
||||
|
sb.append("Hash = ").append(hashCode()); |
||||
|
sb.append(", id=").append(id); |
||||
|
sb.append(", userId=").append(userId); |
||||
|
sb.append(", domainId=").append(domainId); |
||||
|
sb.append(", domainUserId=").append(domainUserId); |
||||
|
sb.append(", name=").append(name); |
||||
|
sb.append(", gender=").append(gender); |
||||
|
sb.append(", avatarUrl=").append(avatarUrl); |
||||
|
sb.append(", country=").append(country); |
||||
|
sb.append(", province=").append(province); |
||||
|
sb.append(", city=").append(city); |
||||
|
sb.append(", operator=").append(operator); |
||||
|
sb.append(", createdAt=").append(createdAt); |
||||
|
sb.append(", updatedAt=").append(updatedAt); |
||||
|
sb.append(", recStatus=").append(recStatus); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,641 @@ |
|||||
|
package com.ccsens.dh_diplomatist.bean.po; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
public class IdcUserExample { |
||||
|
protected String orderByClause; |
||||
|
|
||||
|
protected boolean distinct; |
||||
|
|
||||
|
protected List<Criteria> oredCriteria; |
||||
|
|
||||
|
public IdcUserExample() { |
||||
|
oredCriteria = new ArrayList<Criteria>(); |
||||
|
} |
||||
|
|
||||
|
public void setOrderByClause(String orderByClause) { |
||||
|
this.orderByClause = orderByClause; |
||||
|
} |
||||
|
|
||||
|
public String getOrderByClause() { |
||||
|
return orderByClause; |
||||
|
} |
||||
|
|
||||
|
public void setDistinct(boolean distinct) { |
||||
|
this.distinct = distinct; |
||||
|
} |
||||
|
|
||||
|
public boolean isDistinct() { |
||||
|
return distinct; |
||||
|
} |
||||
|
|
||||
|
public List<Criteria> getOredCriteria() { |
||||
|
return oredCriteria; |
||||
|
} |
||||
|
|
||||
|
public void or(Criteria criteria) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
|
||||
|
public Criteria or() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
oredCriteria.add(criteria); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public Criteria createCriteria() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
if (oredCriteria.size() == 0) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected Criteria createCriteriaInternal() { |
||||
|
Criteria criteria = new Criteria(); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public void clear() { |
||||
|
oredCriteria.clear(); |
||||
|
orderByClause = null; |
||||
|
distinct = false; |
||||
|
} |
||||
|
|
||||
|
protected abstract static class GeneratedCriteria { |
||||
|
protected List<Criterion> criteria; |
||||
|
|
||||
|
protected GeneratedCriteria() { |
||||
|
super(); |
||||
|
criteria = new ArrayList<Criterion>(); |
||||
|
} |
||||
|
|
||||
|
public boolean isValid() { |
||||
|
return criteria.size() > 0; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getAllCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition) { |
||||
|
if (condition == null) { |
||||
|
throw new RuntimeException("Value for condition cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value, String property) { |
||||
|
if (value == null) { |
||||
|
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
|
if (value1 == null || value2 == null) { |
||||
|
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value1, value2)); |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNull() { |
||||
|
addCriterion("id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNotNull() { |
||||
|
addCriterion("id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdEqualTo(Long value) { |
||||
|
addCriterion("id =", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotEqualTo(Long value) { |
||||
|
addCriterion("id <>", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThan(Long value) { |
||||
|
addCriterion("id >", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("id >=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThan(Long value) { |
||||
|
addCriterion("id <", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("id <=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIn(List<Long> values) { |
||||
|
addCriterion("id in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotIn(List<Long> values) { |
||||
|
addCriterion("id not in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("id between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("id not between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardIsNull() { |
||||
|
addCriterion("id_card is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardIsNotNull() { |
||||
|
addCriterion("id_card is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardEqualTo(String value) { |
||||
|
addCriterion("id_card =", value, "idCard"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardNotEqualTo(String value) { |
||||
|
addCriterion("id_card <>", value, "idCard"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardGreaterThan(String value) { |
||||
|
addCriterion("id_card >", value, "idCard"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("id_card >=", value, "idCard"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardLessThan(String value) { |
||||
|
addCriterion("id_card <", value, "idCard"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardLessThanOrEqualTo(String value) { |
||||
|
addCriterion("id_card <=", value, "idCard"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardLike(String value) { |
||||
|
addCriterion("id_card like", value, "idCard"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardNotLike(String value) { |
||||
|
addCriterion("id_card not like", value, "idCard"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardIn(List<String> values) { |
||||
|
addCriterion("id_card in", values, "idCard"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardNotIn(List<String> values) { |
||||
|
addCriterion("id_card not in", values, "idCard"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardBetween(String value1, String value2) { |
||||
|
addCriterion("id_card between", value1, value2, "idCard"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdCardNotBetween(String value1, String value2) { |
||||
|
addCriterion("id_card not between", value1, value2, "idCard"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneIsNull() { |
||||
|
addCriterion("phone is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneIsNotNull() { |
||||
|
addCriterion("phone is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneEqualTo(String value) { |
||||
|
addCriterion("phone =", value, "phone"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneNotEqualTo(String value) { |
||||
|
addCriterion("phone <>", value, "phone"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneGreaterThan(String value) { |
||||
|
addCriterion("phone >", value, "phone"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("phone >=", value, "phone"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneLessThan(String value) { |
||||
|
addCriterion("phone <", value, "phone"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneLessThanOrEqualTo(String value) { |
||||
|
addCriterion("phone <=", value, "phone"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneLike(String value) { |
||||
|
addCriterion("phone like", value, "phone"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneNotLike(String value) { |
||||
|
addCriterion("phone not like", value, "phone"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneIn(List<String> values) { |
||||
|
addCriterion("phone in", values, "phone"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneNotIn(List<String> values) { |
||||
|
addCriterion("phone not in", values, "phone"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneBetween(String value1, String value2) { |
||||
|
addCriterion("phone between", value1, value2, "phone"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPhoneNotBetween(String value1, String value2) { |
||||
|
addCriterion("phone not between", value1, value2, "phone"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorIsNull() { |
||||
|
addCriterion("operator is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorIsNotNull() { |
||||
|
addCriterion("operator is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorEqualTo(Long value) { |
||||
|
addCriterion("operator =", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorNotEqualTo(Long value) { |
||||
|
addCriterion("operator <>", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorGreaterThan(Long value) { |
||||
|
addCriterion("operator >", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("operator >=", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorLessThan(Long value) { |
||||
|
addCriterion("operator <", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("operator <=", value, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorIn(List<Long> values) { |
||||
|
addCriterion("operator in", values, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorNotIn(List<Long> values) { |
||||
|
addCriterion("operator not in", values, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorBetween(Long value1, Long value2) { |
||||
|
addCriterion("operator between", value1, value2, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andOperatorNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("operator not between", value1, value2, "operator"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNull() { |
||||
|
addCriterion("created_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNotNull() { |
||||
|
addCriterion("created_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtEqualTo(Date value) { |
||||
|
addCriterion("created_at =", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("created_at <>", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThan(Date value) { |
||||
|
addCriterion("created_at >", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at >=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThan(Date value) { |
||||
|
addCriterion("created_at <", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at <=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIn(List<Date> values) { |
||||
|
addCriterion("created_at in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("created_at not in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at not between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNull() { |
||||
|
addCriterion("updated_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNotNull() { |
||||
|
addCriterion("updated_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtEqualTo(Date value) { |
||||
|
addCriterion("updated_at =", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("updated_at <>", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThan(Date value) { |
||||
|
addCriterion("updated_at >", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at >=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThan(Date value) { |
||||
|
addCriterion("updated_at <", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at <=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIn(List<Date> values) { |
||||
|
addCriterion("updated_at in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("updated_at not in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at not between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNull() { |
||||
|
addCriterion("rec_status is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNotNull() { |
||||
|
addCriterion("rec_status is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusEqualTo(Byte value) { |
||||
|
addCriterion("rec_status =", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <>", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThan(Byte value) { |
||||
|
addCriterion("rec_status >", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status >=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThan(Byte value) { |
||||
|
addCriterion("rec_status <", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIn(List<Byte> values) { |
||||
|
addCriterion("rec_status in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotIn(List<Byte> values) { |
||||
|
addCriterion("rec_status not in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status not between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criteria extends GeneratedCriteria { |
||||
|
|
||||
|
protected Criteria() { |
||||
|
super(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criterion { |
||||
|
private String condition; |
||||
|
|
||||
|
private Object value; |
||||
|
|
||||
|
private Object secondValue; |
||||
|
|
||||
|
private boolean noValue; |
||||
|
|
||||
|
private boolean singleValue; |
||||
|
|
||||
|
private boolean betweenValue; |
||||
|
|
||||
|
private boolean listValue; |
||||
|
|
||||
|
private String typeHandler; |
||||
|
|
||||
|
public String getCondition() { |
||||
|
return condition; |
||||
|
} |
||||
|
|
||||
|
public Object getValue() { |
||||
|
return value; |
||||
|
} |
||||
|
|
||||
|
public Object getSecondValue() { |
||||
|
return secondValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isNoValue() { |
||||
|
return noValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isSingleValue() { |
||||
|
return singleValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isBetweenValue() { |
||||
|
return betweenValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isListValue() { |
||||
|
return listValue; |
||||
|
} |
||||
|
|
||||
|
public String getTypeHandler() { |
||||
|
return typeHandler; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.typeHandler = null; |
||||
|
this.noValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.typeHandler = typeHandler; |
||||
|
if (value instanceof List<?>) { |
||||
|
this.listValue = true; |
||||
|
} else { |
||||
|
this.singleValue = true; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value) { |
||||
|
this(condition, value, null); |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.secondValue = secondValue; |
||||
|
this.typeHandler = typeHandler; |
||||
|
this.betweenValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue) { |
||||
|
this(condition, value, secondValue, null); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
package com.ccsens.dh_diplomatist.bean.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class DomainVo { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("域信息") |
||||
|
public static class DomainInfo{ |
||||
|
@ApiModelProperty("域id") |
||||
|
private Long id; |
||||
|
@ApiModelProperty("域名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty("域code") |
||||
|
private String code; |
||||
|
@ApiModelProperty("简介") |
||||
|
private String intro; |
||||
|
@ApiModelProperty("访问前缀") |
||||
|
private String url; |
||||
|
@ApiModelProperty("ip/域名") |
||||
|
private String host; |
||||
|
@ApiModelProperty("是否是自身 0否 1是") |
||||
|
private Byte self; |
||||
|
@ApiModelProperty("是否是当前域的公域 0否 1是") |
||||
|
private Byte pub; |
||||
|
@ApiModelProperty("是否轮询 0否 1是") |
||||
|
private Byte polling; |
||||
|
@ApiModelProperty("是否接受该域的请求 0否 1是") |
||||
|
private Byte answer; |
||||
|
@ApiModelProperty("最后更新时间") |
||||
|
private Long lastUpdateTime; |
||||
|
@ApiModelProperty("最后请求时间") |
||||
|
private Long lastAskTime; |
||||
|
@ApiModelProperty("最后应答时间") |
||||
|
private Long lastAnswerTime; |
||||
|
@ApiModelProperty("公钥") |
||||
|
private String publicKey; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package com.ccsens.dh_diplomatist.config; |
||||
|
|
||||
|
import com.ccsens.dh_diplomatist.intercept.MybatisInterceptor; |
||||
|
import org.springframework.context.annotation.Bean; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/03 18:01 |
||||
|
*/ |
||||
|
@Configuration |
||||
|
public class BeanConfig { |
||||
|
/** |
||||
|
* 注册拦截器 |
||||
|
*/ |
||||
|
@Bean |
||||
|
public MybatisInterceptor mybatisInterceptor() { |
||||
|
MybatisInterceptor interceptor = new MybatisInterceptor(); |
||||
|
return interceptor; |
||||
|
} |
||||
|
} |
@ -0,0 +1,128 @@ |
|||||
|
package com.ccsens.dh_diplomatist.config; |
||||
|
|
||||
|
|
||||
|
import cn.hutool.core.lang.Snowflake; |
||||
|
import cn.hutool.core.util.IdUtil; |
||||
|
import com.ccsens.util.config.DruidProps; |
||||
|
import com.fasterxml.jackson.databind.DeserializationFeature; |
||||
|
import com.fasterxml.jackson.databind.ObjectMapper; |
||||
|
import com.fasterxml.jackson.databind.module.SimpleModule; |
||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.context.annotation.Bean; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
import org.springframework.http.MediaType; |
||||
|
import org.springframework.http.converter.HttpMessageConverter; |
||||
|
import org.springframework.http.converter.StringHttpMessageConverter; |
||||
|
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; |
||||
|
import org.springframework.web.servlet.config.annotation.*; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import javax.sql.DataSource; |
||||
|
import java.nio.charset.Charset; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
import java.util.TimeZone; |
||||
|
|
||||
|
@Configuration |
||||
|
public class SpringConfig implements WebMvcConfigurer { |
||||
|
@Resource |
||||
|
private DruidProps druidPropsUtil; |
||||
|
@Value("${spring.snowflake.workerId}") |
||||
|
private String workerId; |
||||
|
@Value("${spring.snowflake.datacenterId}") |
||||
|
private String datacenterId; |
||||
|
|
||||
|
/** |
||||
|
* 配置Converter |
||||
|
* @return |
||||
|
*/ |
||||
|
@Bean |
||||
|
public HttpMessageConverter<String> responseStringConverter() { |
||||
|
StringHttpMessageConverter converter = new StringHttpMessageConverter( |
||||
|
Charset.forName("UTF-8")); |
||||
|
return converter; |
||||
|
} |
||||
|
|
||||
|
@Bean |
||||
|
public HttpMessageConverter<Object> responseJsonConverter(){ |
||||
|
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); |
||||
|
List<MediaType> mediaTypeList = new ArrayList<>(); |
||||
|
mediaTypeList.add(MediaType.TEXT_HTML); |
||||
|
mediaTypeList.add(MediaType.APPLICATION_JSON_UTF8); |
||||
|
converter.setSupportedMediaTypes(mediaTypeList); |
||||
|
|
||||
|
ObjectMapper objectMapper = new ObjectMapper(); |
||||
|
SimpleModule simpleModule = new SimpleModule(); |
||||
|
simpleModule.addSerializer(Long.class, ToStringSerializer.instance); |
||||
|
simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); |
||||
|
objectMapper.registerModule(simpleModule); |
||||
|
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); |
||||
|
objectMapper.setTimeZone(TimeZone.getTimeZone("GMT+8")); |
||||
|
converter.setObjectMapper(objectMapper); |
||||
|
|
||||
|
return converter; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { |
||||
|
converters.add(responseStringConverter()); |
||||
|
converters.add(responseJsonConverter()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { |
||||
|
configurer.favorPathExtension(false); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void addCorsMappings(CorsRegistry registry) { |
||||
|
registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") |
||||
|
// .allowedMethods("*") // 允许提交请求的方法,*表示全部允许
|
||||
|
.allowedOrigins("*") // #允许向该服务器提交请求的URI,*表示全部允许
|
||||
|
.allowCredentials(true) // 允许cookies跨域
|
||||
|
.allowedHeaders("*") // #允许访问的头信息,*表示全部
|
||||
|
.maxAge(18000L); // 预检请求的缓存时间(秒),即在这个时间段里,对于相同的跨域请求不会再预检了
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 配置静态资源 |
||||
|
*/ |
||||
|
@Override |
||||
|
public void addResourceHandlers(ResourceHandlerRegistry registry) { |
||||
|
registry.addResourceHandler("swagger-ui.html") |
||||
|
.addResourceLocations("classpath:/META-INF/resources/"); |
||||
|
registry.addResourceHandler("/webjars/**") |
||||
|
.addResourceLocations("classpath:/META-INF/resources/webjars/"); |
||||
|
|
||||
|
registry.addResourceHandler("/uploads/**") |
||||
|
.addResourceLocations("file:///home/diplomatist/service/uploads/"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 配置拦截器 |
||||
|
* @param registry |
||||
|
*/ |
||||
|
@Override |
||||
|
public void addInterceptors(InterceptorRegistry registry) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 配置数据源(单数据源) |
||||
|
*/ |
||||
|
@Bean |
||||
|
public DataSource dataSource(){ |
||||
|
return druidPropsUtil.createDruidDataSource(); |
||||
|
} |
||||
|
|
||||
|
@Bean |
||||
|
public Snowflake snowflake(){ |
||||
|
return IdUtil.createSnowflake(Long.valueOf(workerId), Long.valueOf(datacenterId)); |
||||
|
} |
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
package com.ccsens.dh_diplomatist.config; |
||||
|
|
||||
|
import com.ccsens.util.WebConstant; |
||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
||||
|
import org.springframework.context.annotation.Bean; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
import springfox.documentation.builders.ParameterBuilder; |
||||
|
import springfox.documentation.builders.RequestHandlerSelectors; |
||||
|
import springfox.documentation.schema.ModelRef; |
||||
|
import springfox.documentation.service.ApiInfo; |
||||
|
import springfox.documentation.service.Parameter; |
||||
|
import springfox.documentation.spi.DocumentationType; |
||||
|
import springfox.documentation.spring.web.plugins.Docket; |
||||
|
import springfox.documentation.swagger2.annotations.EnableSwagger2; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Configuration |
||||
|
@EnableSwagger2 |
||||
|
@ConditionalOnExpression("${swagger.enable}") |
||||
|
//public class SwaggerConfigure extends WebMvcConfigurationSupport {
|
||||
|
public class SwaggerConfigure /*implements WebMvcConfigurer*/ { |
||||
|
@Bean |
||||
|
public Docket customDocket() { |
||||
|
//
|
||||
|
return new Docket(DocumentationType.SWAGGER_2) |
||||
|
.apiInfo(apiInfo()) |
||||
|
.select() |
||||
|
.apis(RequestHandlerSelectors |
||||
|
.basePackage("com.ccsens.dh_diplomatist.api")) |
||||
|
.build() |
||||
|
.globalOperationParameters(setHeaderToken()); |
||||
|
} |
||||
|
|
||||
|
private ApiInfo apiInfo() { |
||||
|
return new ApiInfo("Swagger Tall-game",//大标题 title
|
||||
|
"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",//小标题
|
||||
|
"1.0.0",//版本
|
||||
|
"http://swagger.io/terms/",//termsOfServiceUrl
|
||||
|
"zhangsan",//作者
|
||||
|
"Apache 2.0",//链接显示文字
|
||||
|
"http://www.apache.org/licenses/LICENSE-2.0.html"//网站链接
|
||||
|
); |
||||
|
} |
||||
|
|
||||
|
private List<Parameter> setHeaderToken() { |
||||
|
ParameterBuilder tokenPar = new ParameterBuilder(); |
||||
|
List<Parameter> pars = new ArrayList<>(); |
||||
|
tokenPar.name(WebConstant.HEADER_KEY_TOKEN).description("token") |
||||
|
.defaultValue(WebConstant.HEADER_KEY_TOKEN_PREFIX) |
||||
|
.modelRef(new ModelRef("string")).parameterType("header").required(false).build(); |
||||
|
pars.add(tokenPar.build()); |
||||
|
return pars; |
||||
|
} |
||||
|
} |
@ -0,0 +1,159 @@ |
|||||
|
package com.ccsens.dh_diplomatist.intercept; |
||||
|
|
||||
|
import cn.hutool.core.collection.CollectionUtil; |
||||
|
import com.ccsens.util.WebConstant; |
||||
|
import org.apache.ibatis.executor.Executor; |
||||
|
import org.apache.ibatis.mapping.BoundSql; |
||||
|
import org.apache.ibatis.mapping.MappedStatement; |
||||
|
import org.apache.ibatis.mapping.ResultMap; |
||||
|
import org.apache.ibatis.mapping.SqlSource; |
||||
|
import org.apache.ibatis.plugin.*; |
||||
|
import org.apache.ibatis.reflection.DefaultReflectorFactory; |
||||
|
import org.apache.ibatis.reflection.MetaObject; |
||||
|
import org.apache.ibatis.reflection.factory.DefaultObjectFactory; |
||||
|
import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory; |
||||
|
import org.apache.ibatis.session.ResultHandler; |
||||
|
import org.apache.ibatis.session.RowBounds; |
||||
|
|
||||
|
import java.lang.reflect.InvocationTargetException; |
||||
|
import java.lang.reflect.Method; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.Properties; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/11 10:58 |
||||
|
*/ |
||||
|
@Intercepts({ |
||||
|
@Signature( |
||||
|
type = Executor.class, |
||||
|
method = "query", |
||||
|
args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class} |
||||
|
) |
||||
|
}) |
||||
|
public class MybatisInterceptor implements Interceptor { |
||||
|
@Override |
||||
|
public Object intercept(Invocation invocation) throws Throwable { |
||||
|
|
||||
|
|
||||
|
String selectByExample = "selectByExample"; |
||||
|
String countByExample = "countByExample"; |
||||
|
String countByExample2 = "selectByExample_COUNT"; |
||||
|
String selectByPrimaryKey = "selectByPrimaryKey"; |
||||
|
|
||||
|
Object[] args = invocation.getArgs(); |
||||
|
MappedStatement statement = (MappedStatement) args[0]; |
||||
|
if (statement.getId().endsWith(selectByExample) |
||||
|
|| statement.getId().endsWith(countByExample) |
||||
|
|| statement.getId().endsWith(countByExample2)) { |
||||
|
//XXXExample
|
||||
|
Object example = args[1]; |
||||
|
|
||||
|
addCondition(statement, example); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} else if (statement.getId().endsWith(selectByPrimaryKey)) { |
||||
|
BoundSql boundSql = statement.getBoundSql(args[1]); |
||||
|
String sql = boundSql.getSql() + " and rec_status = 0"; |
||||
|
MappedStatement newStatement = newMappedStatement(statement, new BoundSqlSqlSource(boundSql)); |
||||
|
MetaObject msObject = MetaObject.forObject(newStatement, new DefaultObjectFactory(), new DefaultObjectWrapperFactory(),new DefaultReflectorFactory()); |
||||
|
msObject.setValue("sqlSource.boundSql.sql", sql); |
||||
|
args[0] = newStatement; |
||||
|
} |
||||
|
|
||||
|
return invocation.proceed(); |
||||
|
} |
||||
|
|
||||
|
private void addCondition(MappedStatement statement, Object example) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException { |
||||
|
if (example instanceof Map) { |
||||
|
example = ((Map) example).get("_ORIGINAL_PARAMETER_OBJECT"); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
Method method = example.getClass().getMethod("getOredCriteria", null); |
||||
|
//获取到条件数组,第一个是Criteria
|
||||
|
List list = (List) method.invoke(example); |
||||
|
if (CollectionUtil.isEmpty(list)) { |
||||
|
Class clazz = ((ResultMap) statement.getResultMaps().get(0)).getType(); |
||||
|
String exampleName = clazz.getName() + "Example"; |
||||
|
Object paramExample = Class.forName(exampleName).newInstance(); |
||||
|
Method createCriteria = paramExample.getClass().getMethod("createCriteria"); |
||||
|
Object criteria = createCriteria.invoke(paramExample); |
||||
|
Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); |
||||
|
andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); |
||||
|
list.add(criteria); |
||||
|
} else { |
||||
|
Object criteria = list.get(0); |
||||
|
Method getCriteria = criteria.getClass().getMethod("getCriteria"); |
||||
|
List params = (List) getCriteria.invoke(criteria); |
||||
|
boolean hasDel = false; |
||||
|
for (Object param : params) { |
||||
|
Method getCondition = param.getClass().getMethod("getCondition"); |
||||
|
Object condition = getCondition.invoke(param); |
||||
|
if ("rec_status =".equals(condition)) { |
||||
|
hasDel = true; |
||||
|
} |
||||
|
} |
||||
|
if (!hasDel) { |
||||
|
Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); |
||||
|
andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Object plugin(Object target) { |
||||
|
return Plugin.wrap(target, this); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void setProperties(Properties properties) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
private MappedStatement newMappedStatement(MappedStatement ms, SqlSource newSqlSource) { |
||||
|
MappedStatement.Builder builder = |
||||
|
new MappedStatement.Builder(ms.getConfiguration(), ms.getId(), newSqlSource, ms.getSqlCommandType()); |
||||
|
builder.resource(ms.getResource()); |
||||
|
builder.fetchSize(ms.getFetchSize()); |
||||
|
builder.statementType(ms.getStatementType()); |
||||
|
builder.keyGenerator(ms.getKeyGenerator()); |
||||
|
if (ms.getKeyProperties() != null && ms.getKeyProperties().length != 0) { |
||||
|
StringBuilder keyProperties = new StringBuilder(); |
||||
|
for (String keyProperty : ms.getKeyProperties()) { |
||||
|
keyProperties.append(keyProperty).append(","); |
||||
|
} |
||||
|
keyProperties.delete(keyProperties.length() - 1, keyProperties.length()); |
||||
|
builder.keyProperty(keyProperties.toString()); |
||||
|
} |
||||
|
builder.timeout(ms.getTimeout()); |
||||
|
builder.parameterMap(ms.getParameterMap()); |
||||
|
builder.resultMaps(ms.getResultMaps()); |
||||
|
builder.resultSetType(ms.getResultSetType()); |
||||
|
builder.cache(ms.getCache()); |
||||
|
builder.flushCacheRequired(ms.isFlushCacheRequired()); |
||||
|
builder.useCache(ms.isUseCache()); |
||||
|
|
||||
|
return builder.build(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 定义一个内部辅助类,作用是包装sq
|
||||
|
class BoundSqlSqlSource implements SqlSource { |
||||
|
private BoundSql boundSql; |
||||
|
public BoundSqlSqlSource(BoundSql boundSql) { |
||||
|
this.boundSql = boundSql; |
||||
|
} |
||||
|
@Override |
||||
|
public BoundSql getBoundSql(Object parameterObject) { |
||||
|
return boundSql; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
package com.ccsens.dh_diplomatist.persist.dao; |
||||
|
|
||||
|
import com.ccsens.dh_diplomatist.bean.po.IdcDomain; |
||||
|
import com.ccsens.dh_diplomatist.bean.vo.DomainVo; |
||||
|
import com.ccsens.dh_diplomatist.persist.mapper.IdcDomainMapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
public interface IdcDomainDao extends IdcDomainMapper { |
||||
|
/** |
||||
|
* 根据code查询域信息 |
||||
|
* @param code 域code |
||||
|
* @return 返回域信息 |
||||
|
*/ |
||||
|
IdcDomain getByCode(@Param("code") String code); |
||||
|
|
||||
|
/** |
||||
|
* 查找自己的域信息 |
||||
|
* @return 返回域信息 |
||||
|
*/ |
||||
|
IdcDomain getOneself(); |
||||
|
|
||||
|
/** |
||||
|
* 查询所有需要轮询的域 |
||||
|
* @return 返回域列表 |
||||
|
*/ |
||||
|
List<IdcDomain> getPolling(); |
||||
|
|
||||
|
/** |
||||
|
* 查询所有域排除自身和请求的域信息 |
||||
|
* @return 返回所有域信息 |
||||
|
*/ |
||||
|
List<DomainVo.DomainInfo> queryAllDomain(); |
||||
|
|
||||
|
/** |
||||
|
* 查询公域信息 |
||||
|
* @return 返回公域信息 |
||||
|
*/ |
||||
|
IdcDomain getPubDomain(); |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.ccsens.dh_diplomatist.persist.mapper; |
||||
|
|
||||
|
import com.ccsens.dh_diplomatist.bean.po.IdcBusiness; |
||||
|
import com.ccsens.dh_diplomatist.bean.po.IdcBusinessExample; |
||||
|
import java.util.List; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
public interface IdcBusinessMapper { |
||||
|
long countByExample(IdcBusinessExample example); |
||||
|
|
||||
|
int deleteByExample(IdcBusinessExample example); |
||||
|
|
||||
|
int deleteByPrimaryKey(Long id); |
||||
|
|
||||
|
int insert(IdcBusiness record); |
||||
|
|
||||
|
int insertSelective(IdcBusiness record); |
||||
|
|
||||
|
List<IdcBusiness> selectByExample(IdcBusinessExample example); |
||||
|
|
||||
|
IdcBusiness selectByPrimaryKey(Long id); |
||||
|
|
||||
|
int updateByExampleSelective(@Param("record") IdcBusiness record, @Param("example") IdcBusinessExample example); |
||||
|
|
||||
|
int updateByExample(@Param("record") IdcBusiness record, @Param("example") IdcBusinessExample example); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(IdcBusiness record); |
||||
|
|
||||
|
int updateByPrimaryKey(IdcBusiness record); |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.ccsens.dh_diplomatist.persist.mapper; |
||||
|
|
||||
|
import com.ccsens.dh_diplomatist.bean.po.IdcDomainBusiness; |
||||
|
import com.ccsens.dh_diplomatist.bean.po.IdcDomainBusinessExample; |
||||
|
import java.util.List; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
public interface IdcDomainBusinessMapper { |
||||
|
long countByExample(IdcDomainBusinessExample example); |
||||
|
|
||||
|
int deleteByExample(IdcDomainBusinessExample example); |
||||
|
|
||||
|
int deleteByPrimaryKey(Long id); |
||||
|
|
||||
|
int insert(IdcDomainBusiness record); |
||||
|
|
||||
|
int insertSelective(IdcDomainBusiness record); |
||||
|
|
||||
|
List<IdcDomainBusiness> selectByExample(IdcDomainBusinessExample example); |
||||
|
|
||||
|
IdcDomainBusiness selectByPrimaryKey(Long id); |
||||
|
|
||||
|
int updateByExampleSelective(@Param("record") IdcDomainBusiness record, @Param("example") IdcDomainBusinessExample example); |
||||
|
|
||||
|
int updateByExample(@Param("record") IdcDomainBusiness record, @Param("example") IdcDomainBusinessExample example); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(IdcDomainBusiness record); |
||||
|
|
||||
|
int updateByPrimaryKey(IdcDomainBusiness record); |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.ccsens.dh_diplomatist.persist.mapper; |
||||
|
|
||||
|
import com.ccsens.dh_diplomatist.bean.po.IdcDomain; |
||||
|
import com.ccsens.dh_diplomatist.bean.po.IdcDomainExample; |
||||
|
import java.util.List; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
public interface IdcDomainMapper { |
||||
|
long countByExample(IdcDomainExample example); |
||||
|
|
||||
|
int deleteByExample(IdcDomainExample example); |
||||
|
|
||||
|
int deleteByPrimaryKey(Long id); |
||||
|
|
||||
|
int insert(IdcDomain record); |
||||
|
|
||||
|
int insertSelective(IdcDomain record); |
||||
|
|
||||
|
List<IdcDomain> selectByExample(IdcDomainExample example); |
||||
|
|
||||
|
IdcDomain selectByPrimaryKey(Long id); |
||||
|
|
||||
|
int updateByExampleSelective(@Param("record") IdcDomain record, @Param("example") IdcDomainExample example); |
||||
|
|
||||
|
int updateByExample(@Param("record") IdcDomain record, @Param("example") IdcDomainExample example); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(IdcDomain record); |
||||
|
|
||||
|
int updateByPrimaryKey(IdcDomain record); |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.ccsens.dh_diplomatist.persist.mapper; |
||||
|
|
||||
|
import com.ccsens.dh_diplomatist.bean.po.IdcUserDomain; |
||||
|
import com.ccsens.dh_diplomatist.bean.po.IdcUserDomainExample; |
||||
|
import java.util.List; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
public interface IdcUserDomainMapper { |
||||
|
long countByExample(IdcUserDomainExample example); |
||||
|
|
||||
|
int deleteByExample(IdcUserDomainExample example); |
||||
|
|
||||
|
int deleteByPrimaryKey(Long id); |
||||
|
|
||||
|
int insert(IdcUserDomain record); |
||||
|
|
||||
|
int insertSelective(IdcUserDomain record); |
||||
|
|
||||
|
List<IdcUserDomain> selectByExample(IdcUserDomainExample example); |
||||
|
|
||||
|
IdcUserDomain selectByPrimaryKey(Long id); |
||||
|
|
||||
|
int updateByExampleSelective(@Param("record") IdcUserDomain record, @Param("example") IdcUserDomainExample example); |
||||
|
|
||||
|
int updateByExample(@Param("record") IdcUserDomain record, @Param("example") IdcUserDomainExample example); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(IdcUserDomain record); |
||||
|
|
||||
|
int updateByPrimaryKey(IdcUserDomain record); |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.ccsens.dh_diplomatist.persist.mapper; |
||||
|
|
||||
|
import com.ccsens.dh_diplomatist.bean.po.IdcUser; |
||||
|
import com.ccsens.dh_diplomatist.bean.po.IdcUserExample; |
||||
|
import java.util.List; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
public interface IdcUserMapper { |
||||
|
long countByExample(IdcUserExample example); |
||||
|
|
||||
|
int deleteByExample(IdcUserExample example); |
||||
|
|
||||
|
int deleteByPrimaryKey(Long id); |
||||
|
|
||||
|
int insert(IdcUser record); |
||||
|
|
||||
|
int insertSelective(IdcUser record); |
||||
|
|
||||
|
List<IdcUser> selectByExample(IdcUserExample example); |
||||
|
|
||||
|
IdcUser selectByPrimaryKey(Long id); |
||||
|
|
||||
|
int updateByExampleSelective(@Param("record") IdcUser record, @Param("example") IdcUserExample example); |
||||
|
|
||||
|
int updateByExample(@Param("record") IdcUser record, @Param("example") IdcUserExample example); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(IdcUser record); |
||||
|
|
||||
|
int updateByPrimaryKey(IdcUser record); |
||||
|
} |
@ -0,0 +1,185 @@ |
|||||
|
package com.ccsens.dh_diplomatist.service; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import cn.hutool.core.collection.CollectionUtil; |
||||
|
import cn.hutool.core.lang.Snowflake; |
||||
|
import cn.hutool.core.util.CharsetUtil; |
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import cn.hutool.crypto.asymmetric.KeyType; |
||||
|
import cn.hutool.crypto.asymmetric.RSA; |
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.alibaba.fastjson.JSONArray; |
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
import com.ccsens.dh_diplomatist.bean.dto.HeartbeatDto; |
||||
|
import com.ccsens.dh_diplomatist.bean.po.IdcDomain; |
||||
|
import com.ccsens.dh_diplomatist.bean.vo.DomainVo; |
||||
|
import com.ccsens.dh_diplomatist.persist.dao.IdcDomainDao; |
||||
|
import com.ccsens.dh_diplomatist.util.DiplomatistCodeError; |
||||
|
import com.ccsens.util.RestTemplateUtil; |
||||
|
import com.ccsens.util.exception.BaseException; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.scheduling.annotation.Scheduled; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Propagation; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) |
||||
|
public class DomainService implements IDomainService { |
||||
|
@Resource |
||||
|
private IdcDomainDao domainDao; |
||||
|
@Resource |
||||
|
private Snowflake snowflake; |
||||
|
|
||||
|
@Override |
||||
|
public List<DomainVo.DomainInfo> heartbeatQueryList(HeartbeatDto.SendDomain param, String clientIp) { |
||||
|
//TODO 验证通讯时间
|
||||
|
//根据code查找发送方域信息
|
||||
|
IdcDomain idcDomains = domainDao.getByCode(param.getCode()); |
||||
|
if(ObjectUtil.isNull(idcDomains)){ |
||||
|
//返回心跳异常
|
||||
|
log.info("未找到code对应的域"); |
||||
|
throw new BaseException(DiplomatistCodeError.GET_DOMAIN_ERROR); |
||||
|
} |
||||
|
//是否接受对方的请求
|
||||
|
if(idcDomains.getAnswer() == 0){ |
||||
|
//返回心跳异常
|
||||
|
log.info("不接受对方的请求"); |
||||
|
throw new BaseException(DiplomatistCodeError.GET_DOMAIN_ERROR); |
||||
|
} |
||||
|
//根据发送方公钥验证签名
|
||||
|
byte[] decrypt; |
||||
|
try { |
||||
|
RSA pub = new RSA(null, idcDomains.getPublicKey()); |
||||
|
decrypt = pub.decrypt(param.getData(), KeyType.PublicKey); |
||||
|
}catch (Exception e){ |
||||
|
log.info("验证签名失败:{}",e); |
||||
|
throw new BaseException(DiplomatistCodeError.GET_DOMAIN_ERROR); |
||||
|
} |
||||
|
//查询自身域信息
|
||||
|
IdcDomain selfDomains = domainDao.getOneself(); |
||||
|
HeartbeatDto.MessageDomainInfo domainInfo; |
||||
|
try { |
||||
|
//根据自身私钥解密
|
||||
|
RSA pri = new RSA(selfDomains.getPrivateKey(),null); |
||||
|
byte[] decrypt2 = pri.decrypt(decrypt, KeyType.PrivateKey); |
||||
|
log.info("解密未报错"); |
||||
|
//转换成对象
|
||||
|
domainInfo = JSON.parseObject(StrUtil.str(decrypt2, CharsetUtil.CHARSET_UTF_8), HeartbeatDto.MessageDomainInfo.class); |
||||
|
}catch (Exception e){ |
||||
|
log.info("解密失败:{}",e); |
||||
|
throw new BaseException(DiplomatistCodeError.GET_DOMAIN_ERROR); |
||||
|
} |
||||
|
//验证ip白名单是否匹配
|
||||
|
if(domainInfo == null || !domainInfo.getHost().equals(clientIp)){ |
||||
|
log.info("白名单不匹配:{}---实际请求{}",domainInfo,clientIp); |
||||
|
// throw new BaseException(dh_diplomatistCodeError.GET_DOMAIN_ERROR);
|
||||
|
} |
||||
|
//查询除了自身的所有域信息并返回
|
||||
|
return domainDao.queryAllDomain(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 定时请求公域更新自身域列表信息 |
||||
|
*/ |
||||
|
@Scheduled(cron="0/30 * * * * ?") |
||||
|
public void sendHeartbeat(){ |
||||
|
log.info("请求公域更新自身域列表信息"); |
||||
|
//查询自身域信息
|
||||
|
IdcDomain selfDomains = domainDao.getOneself(); |
||||
|
HeartbeatDto.MessageDomainInfo msgDomainInfo = new HeartbeatDto.MessageDomainInfo(); |
||||
|
//发送的信息
|
||||
|
msgDomainInfo.setId(selfDomains.getId()); |
||||
|
msgDomainInfo.setName(selfDomains.getName()); |
||||
|
msgDomainInfo.setCode(selfDomains.getCode()); |
||||
|
msgDomainInfo.setHost(selfDomains.getHost()); |
||||
|
//查询自身的公域
|
||||
|
IdcDomain pubDomain = domainDao.getPubDomain(); |
||||
|
if(ObjectUtil.isNull(pubDomain)){ |
||||
|
return; |
||||
|
} |
||||
|
//使用对方的公钥加密
|
||||
|
RSA pub = new RSA(null, pubDomain.getPublicKey()); |
||||
|
byte[] encrypt = pub.encrypt(StrUtil.bytes(JSON.toJSONString(msgDomainInfo), CharsetUtil.CHARSET_UTF_8), KeyType.PublicKey); |
||||
|
//使用自己的私钥签名
|
||||
|
RSA pri = new RSA(selfDomains.getPrivateKey(),null); |
||||
|
byte[] encrypt2 = pri.encrypt(encrypt, KeyType.PrivateKey); |
||||
|
|
||||
|
//生成发送的对象
|
||||
|
HeartbeatDto.SendDomain sendDomain = new HeartbeatDto.SendDomain(); |
||||
|
sendDomain.setCode(selfDomains.getCode()); |
||||
|
sendDomain.setTimestamp(System.currentTimeMillis()); |
||||
|
//TODO 随机码
|
||||
|
sendDomain.setData(encrypt2); |
||||
|
//发送请求
|
||||
|
String url = pubDomain.getUrl() + "/domain/list"; |
||||
|
// String url = "http://localhost:7280/domain/list";
|
||||
|
log.info("调用接口:{}--{}", url, sendDomain); |
||||
|
String postBody = RestTemplateUtil.postBody(url, sendDomain); |
||||
|
System.out.println(postBody); |
||||
|
JSONObject jsonObject = JSONObject.parseObject(postBody); |
||||
|
log.info("接口返回:{}", jsonObject); |
||||
|
//请求正确返回则修改域列表信息,否则无操作
|
||||
|
Integer code = jsonObject.getInteger("code"); |
||||
|
if (code == null || code != 200) { |
||||
|
return; |
||||
|
} |
||||
|
JSONArray data = jsonObject.getJSONArray("data"); |
||||
|
if(CollectionUtil.isNotEmpty(data)){ |
||||
|
for (Object object : data) { |
||||
|
DomainVo.DomainInfo domainInfo; |
||||
|
try { |
||||
|
JSONObject object1 = (JSONObject) object; |
||||
|
domainInfo = object1.toJavaObject(DomainVo.DomainInfo.class); |
||||
|
}catch (Exception e){ |
||||
|
log.info(""+e); |
||||
|
continue; |
||||
|
} |
||||
|
IdcDomain idcDomain = domainDao.getByCode(domainInfo.getCode()); |
||||
|
|
||||
|
if(ObjectUtil.isNotNull(idcDomain)){ |
||||
|
//修改
|
||||
|
if(StrUtil.isNotBlank(domainInfo.getName()) && !domainInfo.getName().equals(idcDomain.getName())){ |
||||
|
idcDomain.setName(domainInfo.getName()); |
||||
|
idcDomain.setLastUpdateTime(System.currentTimeMillis()); |
||||
|
} |
||||
|
if(StrUtil.isNotBlank(domainInfo.getUrl()) && !domainInfo.getUrl().equals(idcDomain.getUrl())){ |
||||
|
idcDomain.setUrl(domainInfo.getUrl()); |
||||
|
idcDomain.setLastUpdateTime(System.currentTimeMillis()); |
||||
|
} |
||||
|
if(StrUtil.isNotBlank(domainInfo.getIntro()) && !domainInfo.getIntro().equals(idcDomain.getIntro())){ |
||||
|
idcDomain.setIntro(domainInfo.getIntro()); |
||||
|
idcDomain.setLastUpdateTime(System.currentTimeMillis()); |
||||
|
} |
||||
|
if(StrUtil.isNotBlank(domainInfo.getHost()) && !domainInfo.getHost().equals(idcDomain.getHost())){ |
||||
|
idcDomain.setHost(domainInfo.getHost()); |
||||
|
idcDomain.setLastUpdateTime(System.currentTimeMillis()); |
||||
|
} |
||||
|
if(StrUtil.isNotBlank(domainInfo.getPublicKey()) && !domainInfo.getPublicKey().equals(idcDomain.getPublicKey())){ |
||||
|
idcDomain.setPublicKey(domainInfo.getPublicKey()); |
||||
|
idcDomain.setLastUpdateTime(System.currentTimeMillis()); |
||||
|
} |
||||
|
domainDao.updateByPrimaryKeySelective(idcDomain); |
||||
|
}else { |
||||
|
//添加新域信息
|
||||
|
idcDomain = new IdcDomain(); |
||||
|
BeanUtil.copyProperties(domainInfo,idcDomain); |
||||
|
idcDomain.setId(snowflake.nextId()); |
||||
|
idcDomain.setLastAnswerTime(System.currentTimeMillis()); |
||||
|
idcDomain.setLastAskTime(System.currentTimeMillis()); |
||||
|
idcDomain.setLastUpdateTime(System.currentTimeMillis()); |
||||
|
domainDao.insertSelective(idcDomain); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,134 @@ |
|||||
|
package com.ccsens.dh_diplomatist.service; |
||||
|
|
||||
|
import cn.hutool.core.collection.CollectionUtil; |
||||
|
import cn.hutool.core.util.CharsetUtil; |
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import cn.hutool.crypto.asymmetric.KeyType; |
||||
|
import cn.hutool.crypto.asymmetric.RSA; |
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
import com.ccsens.dh_diplomatist.bean.dto.HeartbeatDto; |
||||
|
import com.ccsens.dh_diplomatist.bean.po.IdcDomain; |
||||
|
import com.ccsens.dh_diplomatist.persist.dao.IdcDomainDao; |
||||
|
import com.ccsens.dh_diplomatist.util.DiplomatistCodeError; |
||||
|
import com.ccsens.util.RestTemplateUtil; |
||||
|
import com.ccsens.util.exception.BaseException; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.scheduling.annotation.Scheduled; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Propagation; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) |
||||
|
public class HeartbeatService implements IHeartbeatService { |
||||
|
|
||||
|
@Resource |
||||
|
private IdcDomainDao domainDao; |
||||
|
|
||||
|
@Override |
||||
|
public void inHeartbeat(HeartbeatDto.SendDomain param, String clientIp) { |
||||
|
|
||||
|
//TODO 验证通讯时间
|
||||
|
//根据code查找发送方域信息
|
||||
|
IdcDomain idcDomains = domainDao.getByCode(param.getCode()); |
||||
|
if(ObjectUtil.isNull(idcDomains)){ |
||||
|
//返回心跳异常
|
||||
|
log.info("未找到code对应的域"); |
||||
|
throw new BaseException(DiplomatistCodeError.HEARTBEAT_ERROR); |
||||
|
} |
||||
|
//是否接受对方的请求
|
||||
|
if(idcDomains.getAnswer() == 0){ |
||||
|
//返回心跳异常
|
||||
|
log.info("不接受对方的请求"); |
||||
|
throw new BaseException(DiplomatistCodeError.HEARTBEAT_ERROR); |
||||
|
} |
||||
|
//根据发送方公钥验证签名
|
||||
|
byte[] decrypt; |
||||
|
try { |
||||
|
RSA pub = new RSA(null, idcDomains.getPublicKey()); |
||||
|
decrypt = pub.decrypt(param.getData(), KeyType.PublicKey); |
||||
|
}catch (Exception e){ |
||||
|
log.info("验证签名失败:{}",e); |
||||
|
throw new BaseException(DiplomatistCodeError.HEARTBEAT_ERROR); |
||||
|
} |
||||
|
//查询自身域信息
|
||||
|
IdcDomain selfDomains = domainDao.getOneself(); |
||||
|
HeartbeatDto.MessageDomainInfo domainInfo; |
||||
|
try { |
||||
|
//根据自身私钥解密
|
||||
|
RSA pri = new RSA(selfDomains.getPrivateKey(),null); |
||||
|
byte[] decrypt2 = pri.decrypt(decrypt, KeyType.PrivateKey); |
||||
|
//转换成对象
|
||||
|
domainInfo = JSON.parseObject(StrUtil.str(decrypt2, CharsetUtil.CHARSET_UTF_8), HeartbeatDto.MessageDomainInfo.class); |
||||
|
}catch (Exception e){ |
||||
|
log.info("解密失败:{}",e); |
||||
|
throw new BaseException(DiplomatistCodeError.HEARTBEAT_ERROR); |
||||
|
} |
||||
|
//验证ip白名单是否匹配
|
||||
|
if(domainInfo == null || !domainInfo.getHost().equals(clientIp)){ |
||||
|
log.info("白名单不匹配:{}---实际请求{}",domainInfo,clientIp); |
||||
|
// throw new BaseException(dh_diplomatistCodeError.HEARTBEAT_ERROR);
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 定时发送心跳信息 |
||||
|
*/ |
||||
|
@Scheduled(cron="0/30 * * * * ?") |
||||
|
public void sendHeartbeat(){ |
||||
|
log.info("发送心跳信息"); |
||||
|
//查询自身域信息
|
||||
|
IdcDomain selfDomains = domainDao.getOneself(); |
||||
|
HeartbeatDto.MessageDomainInfo domainInfo = new HeartbeatDto.MessageDomainInfo(); |
||||
|
//发送的信息
|
||||
|
domainInfo.setId(selfDomains.getId()); |
||||
|
domainInfo.setName(selfDomains.getName()); |
||||
|
domainInfo.setCode(selfDomains.getCode()); |
||||
|
domainInfo.setHost(selfDomains.getHost()); |
||||
|
|
||||
|
//查找需要轮询的域
|
||||
|
List<IdcDomain> idcDomains = domainDao.getPolling(); |
||||
|
if(CollectionUtil.isNotEmpty(idcDomains)){ |
||||
|
idcDomains.forEach(idcDomain -> { |
||||
|
//修改最后请求时间
|
||||
|
idcDomain.setLastAskTime(System.currentTimeMillis()); |
||||
|
domainDao.updateByPrimaryKeySelective(idcDomain); |
||||
|
//使用对方的公钥加密
|
||||
|
RSA pub = new RSA(null, idcDomain.getPublicKey()); |
||||
|
byte[] encrypt = pub.encrypt(StrUtil.bytes(JSON.toJSONString(domainInfo), CharsetUtil.CHARSET_UTF_8), KeyType.PublicKey); |
||||
|
//使用自己的私钥签名
|
||||
|
RSA pri = new RSA(selfDomains.getPrivateKey(),null); |
||||
|
byte[] encrypt2 = pri.encrypt(encrypt, KeyType.PrivateKey); |
||||
|
//生成发送的对象
|
||||
|
HeartbeatDto.SendDomain sendDomain = new HeartbeatDto.SendDomain(); |
||||
|
sendDomain.setCode(selfDomains.getCode()); |
||||
|
sendDomain.setTimestamp(System.currentTimeMillis()); |
||||
|
//TODO 随机码
|
||||
|
sendDomain.setData(encrypt2); |
||||
|
//发送心跳
|
||||
|
String url = idcDomain.getUrl() + "/heartbeat"; |
||||
|
log.info("调用接口:{}--{}", url, sendDomain); |
||||
|
String postBody = RestTemplateUtil.postBody(url, sendDomain); |
||||
|
System.out.println(postBody); |
||||
|
JSONObject jsonObject = JSONObject.parseObject(postBody); |
||||
|
log.info("接口返回:{}", jsonObject); |
||||
|
//请求正确返回则修改最后应答时间,否则无操作
|
||||
|
Integer code = jsonObject.getInteger("code"); |
||||
|
if (code != null && code == 200) { |
||||
|
idcDomain.setLastAnswerTime(System.currentTimeMillis()); |
||||
|
domainDao.updateByPrimaryKeySelective(idcDomain); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package com.ccsens.dh_diplomatist.service; |
||||
|
|
||||
|
import com.ccsens.dh_diplomatist.bean.dto.HeartbeatDto; |
||||
|
import com.ccsens.dh_diplomatist.bean.vo.DomainVo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
public interface IDomainService { |
||||
|
/** |
||||
|
* 接受私域发送的消息,返回域列表信息 |
||||
|
* @param param 发送放信息 |
||||
|
* @param clientIp 发送方ip |
||||
|
* @return 返回域列表 |
||||
|
*/ |
||||
|
List<DomainVo.DomainInfo> heartbeatQueryList(HeartbeatDto.SendDomain param, String clientIp); |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package com.ccsens.dh_diplomatist.service; |
||||
|
|
||||
|
import com.ccsens.dh_diplomatist.bean.dto.HeartbeatDto; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
public interface IHeartbeatService { |
||||
|
|
||||
|
/** |
||||
|
* 接受心跳并返回自身域列表 |
||||
|
* @param param 发送心跳的域的code和信息 |
||||
|
* @param clientIp 请求方的ip地址 |
||||
|
*/ |
||||
|
void inHeartbeat(HeartbeatDto.SendDomain param, String clientIp); |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package com.ccsens.dh_diplomatist.util; |
||||
|
|
||||
|
import com.ccsens.util.CodeError; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
public class DiplomatistCodeError extends CodeError { |
||||
|
|
||||
|
public static final Code HEARTBEAT_ERROR = new Code(501,"心跳异常",true); |
||||
|
public static final Code GET_DOMAIN_ERROR = new Code(502,"查询域列表失败",true); |
||||
|
|
||||
|
} |
@ -0,0 +1,50 @@ |
|||||
|
package com.ccsens.dh_diplomatist.util; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
public class DiplomatistConstant { |
||||
|
|
||||
|
/**图片类型*/ |
||||
|
public static final String FILE_TYPE_IMG = "bmp,jpg,jpeg,png,tif,gif,pcx,tga,exif,fpx,svg,psd,cdr,pcd,dxf,ufo,eps,ai,raw,WMF,webp"; |
||||
|
/**文档类型*/ |
||||
|
public static final String FILE_TYPE_DOCUMENT = "doc, dot, wps, wpt, docx, dotx, docm, dotm, xls, xlt, et, xlsx, xltx, csv, xlsm, xltm, ppt,pptx,pptm,ppsx,ppsm,pps,potx,potm,dpt,dps, pdf"; |
||||
|
|
||||
|
|
||||
|
/**验证手机正则*/ |
||||
|
public static final String PHONE_REGEX = "^[1]([3-9])[0-9]{9}$"; |
||||
|
/**字符串分隔符*/ |
||||
|
public static final String STRING_REGEX = ",|,|;|;|、|/"; |
||||
|
/**wbs相关*/ |
||||
|
public static final class WbsExcel { |
||||
|
/**wbsSheet*/ |
||||
|
public static final String WBS_SHEET = "WBS"; |
||||
|
/**项目成员Sheet*/ |
||||
|
public static final String MEMBER_SHEET = "项目成员表"; |
||||
|
/**项目信息头*/ |
||||
|
public static final String PROJECT_INFO_TITLE = "项目信息"; |
||||
|
/**任务信息头*/ |
||||
|
public static final String TASK_INFO_TITLE = "项目任务分解"; |
||||
|
/**excel文件格式验证*/ |
||||
|
public static final String WBS_FILE_FORMAT = "xls,xlsx"; |
||||
|
/**插件配置表*/ |
||||
|
public static final String WBS_PLUGIN_CONFIG = "插件配置表"; |
||||
|
} |
||||
|
|
||||
|
/**wbs表时长对应关系表*/ |
||||
|
public static final Map<String, Long> WBS_DURATION = new HashMap<>(); |
||||
|
static { |
||||
|
WBS_DURATION.put("s",1000L); |
||||
|
WBS_DURATION.put("min",60 * 1000L); |
||||
|
WBS_DURATION.put("h",60 * 60 * 1000L); |
||||
|
WBS_DURATION.put("d",24 * 60 * 60 * 1000L); |
||||
|
WBS_DURATION.put("w",7 * 24 * 60 * 60 * 1000L); |
||||
|
WBS_DURATION.put("m",30 * 24 * 60 * 60 * 1000L); |
||||
|
WBS_DURATION.put("y",365 * 24 * 60 * 60 * 1000L); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
logging: |
||||
|
level: |
||||
|
com: |
||||
|
favorites: DEBUG |
||||
|
org: |
||||
|
hibernate: ERROR |
||||
|
springframework: |
||||
|
web: DEBUG |
||||
|
mybatis: |
||||
|
config-location: classpath:mybatis/mybatis-config.xml |
||||
|
mapper-locations: classpath*:mapper_*/*.xml |
||||
|
# type-aliases-package: com.ccsens.mtpro.bean |
||||
|
#server: |
||||
|
# tomcat: |
||||
|
# uri-encoding: UTF-8 |
||||
|
spring: |
||||
|
http: |
||||
|
encoding: |
||||
|
charset: UTF-8 |
||||
|
enabled: true |
||||
|
force: true |
||||
|
log-request-details: true |
||||
|
servlet: |
||||
|
multipart: |
||||
|
max-file-size: 10MB |
||||
|
max-request-size: 100MB |
||||
|
snowflake: |
||||
|
datacenterId: 9 |
||||
|
workerId: 1 |
||||
|
|
@ -0,0 +1,51 @@ |
|||||
|
server: |
||||
|
port: 7280 |
||||
|
servlet: |
||||
|
context-path: |
||||
|
spring: |
||||
|
application: |
||||
|
name: dh_diplomatist |
||||
|
datasource: |
||||
|
type: com.alibaba.druid.pool.DruidDataSource |
||||
|
rabbitmq: |
||||
|
# listener: |
||||
|
# direct: |
||||
|
# auto-startup: false |
||||
|
# simple: |
||||
|
# auto-startup: false |
||||
|
host: dd.tall.wiki |
||||
|
password: 111111 |
||||
|
port: 5672 |
||||
|
username: admin |
||||
|
redis: |
||||
|
database: 0 |
||||
|
host: 127.0.0.1 |
||||
|
jedis: |
||||
|
pool: |
||||
|
max-active: 200 |
||||
|
max-idle: 10 |
||||
|
max-wait: -1ms |
||||
|
min-idle: 0 |
||||
|
password: '' |
||||
|
port: 6379 |
||||
|
timeout: 1000ms |
||||
|
swagger: |
||||
|
enable: true |
||||
|
mybatisCache: |
||||
|
database: 1 |
||||
|
host: 127.0.0.1 |
||||
|
jedis: |
||||
|
pool: |
||||
|
max-active: 200 |
||||
|
max-idle: 10 |
||||
|
max-wait: -1 |
||||
|
min-idle: 0 |
||||
|
password: '' |
||||
|
port: 6379 |
||||
|
timeout: 1000 |
||||
|
|
||||
|
|
||||
|
file: |
||||
|
path: /home/diplomatist/service/uploads/ |
||||
|
domain: https://test.tall.wiki/gateway/dh_diplomatist |
||||
|
imgDomain: https://test.tall.wiki/gateway/dh_diplomatist/uploads/ |
@ -0,0 +1,40 @@ |
|||||
|
server: |
||||
|
port: 7280 |
||||
|
servlet: |
||||
|
context-path: |
||||
|
spring: |
||||
|
application: |
||||
|
name: dh_diplomatist |
||||
|
datasource: |
||||
|
type: com.alibaba.druid.pool.DruidDataSource |
||||
|
rabbitmq: |
||||
|
host: 121.36.3.207 |
||||
|
password: 111111 |
||||
|
port: 5672 |
||||
|
username: admin |
||||
|
redis: |
||||
|
database: 0 |
||||
|
host: 127.0.0.1 |
||||
|
jedis: |
||||
|
pool: |
||||
|
max-active: 200 |
||||
|
max-idle: 10 |
||||
|
max-wait: -1ms |
||||
|
min-idle: 0 |
||||
|
password: '' |
||||
|
# password: 'areowqr!@43ef' |
||||
|
port: 6379 |
||||
|
timeout: 1000ms |
||||
|
swagger: |
||||
|
enable: true |
||||
|
eureka: |
||||
|
instance: |
||||
|
ip-address: 101.201.226.21 |
||||
|
|
||||
|
gatewayUrl: https://www.tall.wiki/gateway/ |
||||
|
notGatewayUrl: https://www.tall.wiki/ |
||||
|
apiUrl: https://www.tall.wiki/ |
||||
|
file: |
||||
|
path: /home/diplomatist/service/uploads/ |
||||
|
domain: https://www.tall.wiki/gateway/dh_diplomatist |
||||
|
imgDomain: https://www.tall.wiki/gateway/dh_diplomatist/uploads/ |
@ -0,0 +1,48 @@ |
|||||
|
server: |
||||
|
port: 7280 |
||||
|
servlet: |
||||
|
context-path: |
||||
|
spring: |
||||
|
application: |
||||
|
name: dh_diplomatist |
||||
|
datasource: |
||||
|
type: com.alibaba.druid.pool.DruidDataSource |
||||
|
# rabbitmq: |
||||
|
# host: dd.tall.wiki |
||||
|
# password: 111111 |
||||
|
# port: 5672 |
||||
|
# username: admin |
||||
|
redis: |
||||
|
database: 0 |
||||
|
host: 127.0.0.1 |
||||
|
jedis: |
||||
|
pool: |
||||
|
max-active: 200 |
||||
|
max-idle: 10 |
||||
|
max-wait: -1ms |
||||
|
min-idle: 0 |
||||
|
password: '' |
||||
|
port: 6379 |
||||
|
timeout: 1000ms |
||||
|
swagger: |
||||
|
enable: true |
||||
|
mybatisCache: |
||||
|
database: 1 |
||||
|
host: 127.0.0.1 |
||||
|
jedis: |
||||
|
pool: |
||||
|
max-active: 200 |
||||
|
max-idle: 10 |
||||
|
max-wait: -1 |
||||
|
min-idle: 0 |
||||
|
password: '' |
||||
|
port: 6379 |
||||
|
timeout: 1000 |
||||
|
eureka: |
||||
|
instance: |
||||
|
ip-address: 127.0.0.1 |
||||
|
|
||||
|
file: |
||||
|
path: /home/diplomatist/service/uploads/ |
||||
|
domain: https://test.tall.wiki/gateway/dh_diplomatist |
||||
|
imgDomain: https://test.tall.wiki/gateway/dh_diplomatist/uploads/ |
@ -0,0 +1,4 @@ |
|||||
|
spring: |
||||
|
profiles: |
||||
|
active: dev |
||||
|
include: common, util-dev |
@ -0,0 +1,34 @@ |
|||||
|
spring: |
||||
|
datasource: |
||||
|
druid: |
||||
|
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
||||
|
driverClassName: com.mysql.cj.jdbc.Driver |
||||
|
dynamicUrl: jdbc:mysql://localhost:3306/${schema} |
||||
|
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' |
||||
|
filterName: druidFilter |
||||
|
filterProfileEnable: true |
||||
|
filterUrlPattern: /* |
||||
|
filters: stat,wall |
||||
|
initialSize: 5 |
||||
|
maxActive: 20 |
||||
|
maxPoolPreparedStatementPerConnectionSize: 20 |
||||
|
maxWait: 60000 |
||||
|
minEvictableIdleTimeMillis: 300000 |
||||
|
minIdle: 5 |
||||
|
# password: |
||||
|
password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473 |
||||
|
poolPreparedStatements: true |
||||
|
servletLogSlowSql: true |
||||
|
servletLoginPassword: 111111 |
||||
|
servletLoginUsername: druid |
||||
|
servletName: druidServlet |
||||
|
servletResetEnable: true |
||||
|
servletUrlMapping: /druid/* |
||||
|
testOnBorrow: false |
||||
|
testOnReturn: false |
||||
|
testWhileIdle: true |
||||
|
timeBetweenEvictionRunsMillis: 60000 |
||||
|
url: jdbc:mysql://101.201.226.163:3306/tall_dh?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true |
||||
|
username: root |
||||
|
validationQuery: SELECT 1 FROM DUAL |
||||
|
env: CCSENS_TALL |
@ -0,0 +1,35 @@ |
|||||
|
spring: |
||||
|
datasource: |
||||
|
druid: |
||||
|
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
||||
|
driverClassName: com.mysql.cj.jdbc.Driver |
||||
|
dynamicUrl: jdbc:mysql://localhost:3306/${schema} |
||||
|
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' |
||||
|
filterName: druidFilter |
||||
|
filterProfileEnable: true |
||||
|
filterUrlPattern: /* |
||||
|
filters: stat,wall |
||||
|
initialSize: 5 |
||||
|
maxActive: 20 |
||||
|
maxPoolPreparedStatementPerConnectionSize: 20 |
||||
|
maxWait: 60000 |
||||
|
minEvictableIdleTimeMillis: 300000 |
||||
|
minIdle: 5 |
||||
|
# password: |
||||
|
password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473 |
||||
|
poolPreparedStatements: true |
||||
|
servletLogSlowSql: true |
||||
|
servletLoginPassword: 111111 |
||||
|
servletLoginUsername: druid |
||||
|
servletName: druidServlet |
||||
|
servletResetEnable: true |
||||
|
servletUrlMapping: /druid/* |
||||
|
testOnBorrow: false |
||||
|
testOnReturn: false |
||||
|
testWhileIdle: true |
||||
|
timeBetweenEvictionRunsMillis: 60000 |
||||
|
# url: jdbc:mysql://127.0.0.1/defaultwbs?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true |
||||
|
url: jdbc:mysql://101.201.226.163:3306/tall_dm?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true |
||||
|
username: root |
||||
|
validationQuery: SELECT 1 FROM DUAL |
||||
|
env: CCSENS_TALL |
@ -0,0 +1,34 @@ |
|||||
|
spring: |
||||
|
datasource: |
||||
|
druid: |
||||
|
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
||||
|
driverClassName: com.mysql.cj.jdbc.Driver |
||||
|
dynamicUrl: jdbc:mysql://localhost:3306/${schema} |
||||
|
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' |
||||
|
filterName: druidFilter |
||||
|
filterProfileEnable: true |
||||
|
filterUrlPattern: /* |
||||
|
filters: stat,wall |
||||
|
initialSize: 5 |
||||
|
maxActive: 20 |
||||
|
maxPoolPreparedStatementPerConnectionSize: 20 |
||||
|
maxWait: 60000 |
||||
|
minEvictableIdleTimeMillis: 300000 |
||||
|
minIdle: 5 |
||||
|
# password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473 |
||||
|
password: |
||||
|
poolPreparedStatements: true |
||||
|
servletLogSlowSql: true |
||||
|
servletLoginPassword: 111111 |
||||
|
servletLoginUsername: druid |
||||
|
servletName: druidServlet |
||||
|
servletResetEnable: true |
||||
|
servletUrlMapping: /druid/* |
||||
|
testOnBorrow: false |
||||
|
testOnReturn: false |
||||
|
testWhileIdle: true |
||||
|
timeBetweenEvictionRunsMillis: 60000 |
||||
|
url: jdbc:mysql://101.201.226.163:3306/tall_dh?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true |
||||
|
username: root |
||||
|
validationQuery: SELECT 1 FROM DUAL |
||||
|
env: CCSENS_TALL |
@ -0,0 +1,196 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 --> |
||||
|
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true --> |
||||
|
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 --> |
||||
|
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 --> |
||||
|
<configuration scan="true" scanPeriod="10 seconds"> |
||||
|
|
||||
|
<!--<include resource="org/springframework/boot/logging/logback/base.xml" />--> |
||||
|
|
||||
|
<contextName>logback</contextName> |
||||
|
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 --> |
||||
|
<property name="log.path" value="/home/diplomatist/service/log/" /> |
||||
|
|
||||
|
<!-- 彩色日志 --> |
||||
|
<!-- 彩色日志依赖的渲染类 --> |
||||
|
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> |
||||
|
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> |
||||
|
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> |
||||
|
<!-- 彩色日志格式 --> |
||||
|
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
||||
|
|
||||
|
|
||||
|
<!--输出到控制台--> |
||||
|
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
||||
|
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
|
<level>info</level> |
||||
|
</filter> |
||||
|
<encoder> |
||||
|
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
||||
|
<!-- 设置字符集 --> |
||||
|
<charset>UTF-8</charset> |
||||
|
</encoder> |
||||
|
</appender> |
||||
|
|
||||
|
|
||||
|
<!--输出到文件--> |
||||
|
|
||||
|
<!-- 时间滚动输出 level为 DEBUG 日志 --> |
||||
|
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
|
<file>${log.path}/log_debug.log</file> |
||||
|
<!--日志文件输出格式--> |
||||
|
<encoder> |
||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
||||
|
<charset>UTF-8</charset> <!-- 设置字符集 --> |
||||
|
</encoder> |
||||
|
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
<!-- 日志归档 --> |
||||
|
<fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
|
<maxFileSize>100MB</maxFileSize> |
||||
|
</timeBasedFileNamingAndTriggeringPolicy> |
||||
|
<!--日志文件保留天数--> |
||||
|
<maxHistory>15</maxHistory> |
||||
|
</rollingPolicy> |
||||
|
<!-- 此日志文件只记录debug级别的 --> |
||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
||||
|
<level>debug</level> |
||||
|
<onMatch>ACCEPT</onMatch> |
||||
|
<onMismatch>DENY</onMismatch> |
||||
|
</filter> |
||||
|
</appender> |
||||
|
|
||||
|
<!-- 时间滚动输出 level为 INFO 日志 --> |
||||
|
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
|
<file>${log.path}/log_info.log</file> |
||||
|
<!--日志文件输出格式--> |
||||
|
<encoder> |
||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
||||
|
<charset>UTF-8</charset> |
||||
|
</encoder> |
||||
|
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
<!-- 每天日志归档路径以及格式 --> |
||||
|
<fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
|
<maxFileSize>100MB</maxFileSize> |
||||
|
</timeBasedFileNamingAndTriggeringPolicy> |
||||
|
<!--日志文件保留天数--> |
||||
|
<maxHistory>15</maxHistory> |
||||
|
</rollingPolicy> |
||||
|
<!-- 此日志文件只记录info级别的 --> |
||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
||||
|
<level>info</level> |
||||
|
<onMatch>ACCEPT</onMatch> |
||||
|
<onMismatch>DENY</onMismatch> |
||||
|
</filter> |
||||
|
</appender> |
||||
|
|
||||
|
<!-- 时间滚动输出 level为 WARN 日志 --> |
||||
|
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
|
<file>${log.path}/log_warn.log</file> |
||||
|
<!--日志文件输出格式--> |
||||
|
<encoder> |
||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
||||
|
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
||||
|
</encoder> |
||||
|
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
<fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
|
<maxFileSize>100MB</maxFileSize> |
||||
|
</timeBasedFileNamingAndTriggeringPolicy> |
||||
|
<!--日志文件保留天数--> |
||||
|
<maxHistory>15</maxHistory> |
||||
|
</rollingPolicy> |
||||
|
<!-- 此日志文件只记录warn级别的 --> |
||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
||||
|
<level>warn</level> |
||||
|
<onMatch>ACCEPT</onMatch> |
||||
|
<onMismatch>DENY</onMismatch> |
||||
|
</filter> |
||||
|
</appender> |
||||
|
|
||||
|
|
||||
|
<!-- 时间滚动输出 level为 ERROR 日志 --> |
||||
|
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
|
<file>${log.path}/log_error.log</file> |
||||
|
<!--日志文件输出格式--> |
||||
|
<encoder> |
||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
||||
|
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
||||
|
</encoder> |
||||
|
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
<fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
|
<maxFileSize>100MB</maxFileSize> |
||||
|
</timeBasedFileNamingAndTriggeringPolicy> |
||||
|
<!--日志文件保留天数--> |
||||
|
<maxHistory>15</maxHistory> |
||||
|
</rollingPolicy> |
||||
|
<!-- 此日志文件只记录ERROR级别的 --> |
||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
||||
|
<level>ERROR</level> |
||||
|
<onMatch>ACCEPT</onMatch> |
||||
|
<onMismatch>DENY</onMismatch> |
||||
|
</filter> |
||||
|
</appender> |
||||
|
|
||||
|
<!-- |
||||
|
<logger>用来设置某一个包或者具体的某一个类的日志打印级别、 |
||||
|
以及指定<appender>。<logger>仅有一个name属性, |
||||
|
一个可选的level和一个可选的addtivity属性。 |
||||
|
name:用来指定受此logger约束的某一个包或者具体的某一个类。 |
||||
|
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, |
||||
|
还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。 |
||||
|
如果未设置此属性,那么当前logger将会继承上级的级别。 |
||||
|
addtivity:是否向上级logger传递打印信息。默认是true。 |
||||
|
--> |
||||
|
<!--<logger name="org.springframework.web" level="info"/>--> |
||||
|
<!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>--> |
||||
|
<!-- |
||||
|
使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作: |
||||
|
第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息 |
||||
|
第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别: |
||||
|
--> |
||||
|
|
||||
|
|
||||
|
<!-- |
||||
|
root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性 |
||||
|
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, |
||||
|
不能设置为INHERITED或者同义词NULL。默认是DEBUG |
||||
|
可以包含零个或多个元素,标识这个appender将会添加到这个logger。 |
||||
|
--> |
||||
|
|
||||
|
<!--开发环境:打印控制台--> |
||||
|
<springProfile name="dev"> |
||||
|
<logger name="com.ccsens.ptpro.persist.*" level="debug"/> |
||||
|
</springProfile> |
||||
|
|
||||
|
<root level="info"> |
||||
|
<appender-ref ref="CONSOLE" /> |
||||
|
<appender-ref ref="DEBUG_FILE" /> |
||||
|
<appender-ref ref="INFO_FILE" /> |
||||
|
<appender-ref ref="WARN_FILE" /> |
||||
|
<appender-ref ref="ERROR_FILE" /> |
||||
|
</root> |
||||
|
|
||||
|
<!--生产环境:输出到文件--> |
||||
|
<!--<springProfile name="pro">--> |
||||
|
<!--<root level="info">--> |
||||
|
<!--<appender-ref ref="CONSOLE" />--> |
||||
|
<!--<appender-ref ref="DEBUG_FILE" />--> |
||||
|
<!--<appender-ref ref="INFO_FILE" />--> |
||||
|
<!--<appender-ref ref="ERROR_FILE" />--> |
||||
|
<!--<appender-ref ref="WARN_FILE" />--> |
||||
|
<!--</root>--> |
||||
|
<!--</springProfile>--> |
||||
|
|
||||
|
</configuration> |
@ -0,0 +1,47 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.dh_diplomatist.persist.dao.IdcDomainDao"> |
||||
|
|
||||
|
|
||||
|
<select id="getByCode" resultType="com.ccsens.dh_diplomatist.bean.po.IdcDomain"> |
||||
|
SELECT * FROM `t_idc_domain` WHERE `code` = #{code} and rec_status = 0 limit 1 |
||||
|
</select> |
||||
|
<select id="getOneself" resultType="com.ccsens.dh_diplomatist.bean.po.IdcDomain"> |
||||
|
SELECT * FROM `t_idc_domain` WHERE self = 1 and rec_status = 0 limit 1 |
||||
|
</select> |
||||
|
<select id="getPolling" resultType="com.ccsens.dh_diplomatist.bean.po.IdcDomain"> |
||||
|
SELECT |
||||
|
`id`, |
||||
|
`name`, |
||||
|
`code`, |
||||
|
`url`, |
||||
|
`host`, |
||||
|
`last_update_time` as lastUpdateTime, |
||||
|
`last_ask_time` as lastAskTime, |
||||
|
`last_answer_time` as lastAnswerTime, |
||||
|
`public_key` as publicKey |
||||
|
FROM |
||||
|
`t_idc_domain` |
||||
|
WHERE |
||||
|
polling = 1 |
||||
|
and self = 0 |
||||
|
and rec_status = 0 |
||||
|
</select> |
||||
|
<select id="queryAllDomain" resultType="com.ccsens.dh_diplomatist.bean.vo.DomainVo$DomainInfo"> |
||||
|
SELECT |
||||
|
`id`, |
||||
|
`name`, |
||||
|
`code`, |
||||
|
`url`, |
||||
|
`host`, |
||||
|
`intro`, |
||||
|
`public_key` as publicKey |
||||
|
FROM |
||||
|
`t_idc_domain` |
||||
|
WHERE |
||||
|
rec_status = 0 |
||||
|
</select> |
||||
|
<select id="getPubDomain" resultType="com.ccsens.dh_diplomatist.bean.po.IdcDomain"> |
||||
|
SELECT * FROM `t_idc_domain` WHERE pub = 1 and rec_status = 0 limit 1 |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,275 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.dh_diplomatist.persist.mapper.IdcBusinessMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.ccsens.dh_diplomatist.bean.po.IdcBusiness"> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="name" jdbcType="VARCHAR" property="name" /> |
||||
|
<result column="code" jdbcType="VARCHAR" property="code" /> |
||||
|
<result column="description" jdbcType="VARCHAR" property="description" /> |
||||
|
<result column="creator_id" jdbcType="BIGINT" property="creatorId" /> |
||||
|
<result column="operator" jdbcType="BIGINT" property="operator" /> |
||||
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> |
||||
|
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> |
||||
|
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, name, code, description, creator_id, operator, created_at, updated_at, rec_status |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcBusinessExample" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_idc_business |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_idc_business |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
||||
|
delete from t_idc_business |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcBusinessExample"> |
||||
|
delete from t_idc_business |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcBusiness"> |
||||
|
insert into t_idc_business (id, name, code, |
||||
|
description, creator_id, operator, |
||||
|
created_at, updated_at, rec_status |
||||
|
) |
||||
|
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, |
||||
|
#{description,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT}, #{operator,jdbcType=BIGINT}, |
||||
|
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} |
||||
|
) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcBusiness"> |
||||
|
insert into t_idc_business |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="name != null"> |
||||
|
name, |
||||
|
</if> |
||||
|
<if test="code != null"> |
||||
|
code, |
||||
|
</if> |
||||
|
<if test="description != null"> |
||||
|
description, |
||||
|
</if> |
||||
|
<if test="creatorId != null"> |
||||
|
creator_id, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
operator, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="name != null"> |
||||
|
#{name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="code != null"> |
||||
|
#{code,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="description != null"> |
||||
|
#{description,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="creatorId != null"> |
||||
|
#{creatorId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
#{operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
#{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
#{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
#{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcBusinessExample" resultType="java.lang.Long"> |
||||
|
select count(*) from t_idc_business |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
update t_idc_business |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.name != null"> |
||||
|
name = #{record.name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.code != null"> |
||||
|
code = #{record.code,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.description != null"> |
||||
|
description = #{record.description,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.creatorId != null"> |
||||
|
creator_id = #{record.creatorId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.operator != null"> |
||||
|
operator = #{record.operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.createdAt != null"> |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.updatedAt != null"> |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.recStatus != null"> |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
update t_idc_business |
||||
|
set id = #{record.id,jdbcType=BIGINT}, |
||||
|
name = #{record.name,jdbcType=VARCHAR}, |
||||
|
code = #{record.code,jdbcType=VARCHAR}, |
||||
|
description = #{record.description,jdbcType=VARCHAR}, |
||||
|
creator_id = #{record.creatorId,jdbcType=BIGINT}, |
||||
|
operator = #{record.operator,jdbcType=BIGINT}, |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcBusiness"> |
||||
|
update t_idc_business |
||||
|
<set> |
||||
|
<if test="name != null"> |
||||
|
name = #{name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="code != null"> |
||||
|
code = #{code,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="description != null"> |
||||
|
description = #{description,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="creatorId != null"> |
||||
|
creator_id = #{creatorId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
operator = #{operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcBusiness"> |
||||
|
update t_idc_business |
||||
|
set name = #{name,jdbcType=VARCHAR}, |
||||
|
code = #{code,jdbcType=VARCHAR}, |
||||
|
description = #{description,jdbcType=VARCHAR}, |
||||
|
creator_id = #{creatorId,jdbcType=BIGINT}, |
||||
|
operator = #{operator,jdbcType=BIGINT}, |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT} |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
</mapper> |
@ -0,0 +1,291 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.dh_diplomatist.persist.mapper.IdcDomainBusinessMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.ccsens.dh_diplomatist.bean.po.IdcDomainBusiness"> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="domain_id" jdbcType="BIGINT" property="domainId" /> |
||||
|
<result column="business_id" jdbcType="BIGINT" property="businessId" /> |
||||
|
<result column="url" jdbcType="VARCHAR" property="url" /> |
||||
|
<result column="app_id" jdbcType="VARCHAR" property="appId" /> |
||||
|
<result column="secret" jdbcType="VARCHAR" property="secret" /> |
||||
|
<result column="operator" jdbcType="BIGINT" property="operator" /> |
||||
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> |
||||
|
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> |
||||
|
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, domain_id, business_id, url, app_id, secret, operator, created_at, updated_at, |
||||
|
rec_status |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomainBusinessExample" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_idc_domain_business |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_idc_domain_business |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
||||
|
delete from t_idc_domain_business |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomainBusinessExample"> |
||||
|
delete from t_idc_domain_business |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomainBusiness"> |
||||
|
insert into t_idc_domain_business (id, domain_id, business_id, |
||||
|
url, app_id, secret, |
||||
|
operator, created_at, updated_at, |
||||
|
rec_status) |
||||
|
values (#{id,jdbcType=BIGINT}, #{domainId,jdbcType=BIGINT}, #{businessId,jdbcType=BIGINT}, |
||||
|
#{url,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, #{secret,jdbcType=VARCHAR}, |
||||
|
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
#{recStatus,jdbcType=TINYINT}) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomainBusiness"> |
||||
|
insert into t_idc_domain_business |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="domainId != null"> |
||||
|
domain_id, |
||||
|
</if> |
||||
|
<if test="businessId != null"> |
||||
|
business_id, |
||||
|
</if> |
||||
|
<if test="url != null"> |
||||
|
url, |
||||
|
</if> |
||||
|
<if test="appId != null"> |
||||
|
app_id, |
||||
|
</if> |
||||
|
<if test="secret != null"> |
||||
|
secret, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
operator, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="domainId != null"> |
||||
|
#{domainId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="businessId != null"> |
||||
|
#{businessId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="url != null"> |
||||
|
#{url,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="appId != null"> |
||||
|
#{appId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="secret != null"> |
||||
|
#{secret,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
#{operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
#{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
#{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
#{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomainBusinessExample" resultType="java.lang.Long"> |
||||
|
select count(*) from t_idc_domain_business |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
update t_idc_domain_business |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.domainId != null"> |
||||
|
domain_id = #{record.domainId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.businessId != null"> |
||||
|
business_id = #{record.businessId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.url != null"> |
||||
|
url = #{record.url,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.appId != null"> |
||||
|
app_id = #{record.appId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.secret != null"> |
||||
|
secret = #{record.secret,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.operator != null"> |
||||
|
operator = #{record.operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.createdAt != null"> |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.updatedAt != null"> |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.recStatus != null"> |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
update t_idc_domain_business |
||||
|
set id = #{record.id,jdbcType=BIGINT}, |
||||
|
domain_id = #{record.domainId,jdbcType=BIGINT}, |
||||
|
business_id = #{record.businessId,jdbcType=BIGINT}, |
||||
|
url = #{record.url,jdbcType=VARCHAR}, |
||||
|
app_id = #{record.appId,jdbcType=VARCHAR}, |
||||
|
secret = #{record.secret,jdbcType=VARCHAR}, |
||||
|
operator = #{record.operator,jdbcType=BIGINT}, |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomainBusiness"> |
||||
|
update t_idc_domain_business |
||||
|
<set> |
||||
|
<if test="domainId != null"> |
||||
|
domain_id = #{domainId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="businessId != null"> |
||||
|
business_id = #{businessId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="url != null"> |
||||
|
url = #{url,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="appId != null"> |
||||
|
app_id = #{appId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="secret != null"> |
||||
|
secret = #{secret,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
operator = #{operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomainBusiness"> |
||||
|
update t_idc_domain_business |
||||
|
set domain_id = #{domainId,jdbcType=BIGINT}, |
||||
|
business_id = #{businessId,jdbcType=BIGINT}, |
||||
|
url = #{url,jdbcType=VARCHAR}, |
||||
|
app_id = #{appId,jdbcType=VARCHAR}, |
||||
|
secret = #{secret,jdbcType=VARCHAR}, |
||||
|
operator = #{operator,jdbcType=BIGINT}, |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT} |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
</mapper> |
@ -0,0 +1,432 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.dh_diplomatist.persist.mapper.IdcDomainMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.ccsens.dh_diplomatist.bean.po.IdcDomain"> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="name" jdbcType="VARCHAR" property="name" /> |
||||
|
<result column="code" jdbcType="VARCHAR" property="code" /> |
||||
|
<result column="intro" jdbcType="VARCHAR" property="intro" /> |
||||
|
<result column="url" jdbcType="VARCHAR" property="url" /> |
||||
|
<result column="host" jdbcType="VARCHAR" property="host" /> |
||||
|
<result column="self" jdbcType="TINYINT" property="self" /> |
||||
|
<result column="pub" jdbcType="TINYINT" property="pub" /> |
||||
|
<result column="polling" jdbcType="TINYINT" property="polling" /> |
||||
|
<result column="answer" jdbcType="TINYINT" property="answer" /> |
||||
|
<result column="last_update_time" jdbcType="BIGINT" property="lastUpdateTime" /> |
||||
|
<result column="last_ask_time" jdbcType="BIGINT" property="lastAskTime" /> |
||||
|
<result column="last_answer_time" jdbcType="BIGINT" property="lastAnswerTime" /> |
||||
|
<result column="public_key" jdbcType="VARCHAR" property="publicKey" /> |
||||
|
<result column="private_key" jdbcType="VARCHAR" property="privateKey" /> |
||||
|
<result column="operator" jdbcType="BIGINT" property="operator" /> |
||||
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> |
||||
|
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> |
||||
|
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, name, code, intro, url, host, self, pub, polling, answer, last_update_time, last_ask_time, |
||||
|
last_answer_time, public_key, private_key, operator, created_at, updated_at, rec_status |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomainExample" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_idc_domain |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_idc_domain |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
||||
|
delete from t_idc_domain |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomainExample"> |
||||
|
delete from t_idc_domain |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomain"> |
||||
|
insert into t_idc_domain (id, name, code, |
||||
|
intro, url, host, self, |
||||
|
pub, polling, answer, |
||||
|
last_update_time, last_ask_time, last_answer_time, |
||||
|
public_key, private_key, operator, |
||||
|
created_at, updated_at, rec_status |
||||
|
) |
||||
|
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, |
||||
|
#{intro,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{host,jdbcType=VARCHAR}, #{self,jdbcType=TINYINT}, |
||||
|
#{pub,jdbcType=TINYINT}, #{polling,jdbcType=TINYINT}, #{answer,jdbcType=TINYINT}, |
||||
|
#{lastUpdateTime,jdbcType=BIGINT}, #{lastAskTime,jdbcType=BIGINT}, #{lastAnswerTime,jdbcType=BIGINT}, |
||||
|
#{publicKey,jdbcType=VARCHAR}, #{privateKey,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, |
||||
|
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} |
||||
|
) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomain"> |
||||
|
insert into t_idc_domain |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="name != null"> |
||||
|
name, |
||||
|
</if> |
||||
|
<if test="code != null"> |
||||
|
code, |
||||
|
</if> |
||||
|
<if test="intro != null"> |
||||
|
intro, |
||||
|
</if> |
||||
|
<if test="url != null"> |
||||
|
url, |
||||
|
</if> |
||||
|
<if test="host != null"> |
||||
|
host, |
||||
|
</if> |
||||
|
<if test="self != null"> |
||||
|
self, |
||||
|
</if> |
||||
|
<if test="pub != null"> |
||||
|
pub, |
||||
|
</if> |
||||
|
<if test="polling != null"> |
||||
|
polling, |
||||
|
</if> |
||||
|
<if test="answer != null"> |
||||
|
answer, |
||||
|
</if> |
||||
|
<if test="lastUpdateTime != null"> |
||||
|
last_update_time, |
||||
|
</if> |
||||
|
<if test="lastAskTime != null"> |
||||
|
last_ask_time, |
||||
|
</if> |
||||
|
<if test="lastAnswerTime != null"> |
||||
|
last_answer_time, |
||||
|
</if> |
||||
|
<if test="publicKey != null"> |
||||
|
public_key, |
||||
|
</if> |
||||
|
<if test="privateKey != null"> |
||||
|
private_key, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
operator, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="name != null"> |
||||
|
#{name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="code != null"> |
||||
|
#{code,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="intro != null"> |
||||
|
#{intro,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="url != null"> |
||||
|
#{url,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="host != null"> |
||||
|
#{host,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="self != null"> |
||||
|
#{self,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="pub != null"> |
||||
|
#{pub,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="polling != null"> |
||||
|
#{polling,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="answer != null"> |
||||
|
#{answer,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="lastUpdateTime != null"> |
||||
|
#{lastUpdateTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="lastAskTime != null"> |
||||
|
#{lastAskTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="lastAnswerTime != null"> |
||||
|
#{lastAnswerTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="publicKey != null"> |
||||
|
#{publicKey,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="privateKey != null"> |
||||
|
#{privateKey,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
#{operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
#{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
#{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
#{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomainExample" resultType="java.lang.Long"> |
||||
|
select count(*) from t_idc_domain |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
update t_idc_domain |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.name != null"> |
||||
|
name = #{record.name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.code != null"> |
||||
|
code = #{record.code,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.intro != null"> |
||||
|
intro = #{record.intro,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.url != null"> |
||||
|
url = #{record.url,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.host != null"> |
||||
|
host = #{record.host,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.self != null"> |
||||
|
self = #{record.self,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="record.pub != null"> |
||||
|
pub = #{record.pub,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="record.polling != null"> |
||||
|
polling = #{record.polling,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="record.answer != null"> |
||||
|
answer = #{record.answer,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="record.lastUpdateTime != null"> |
||||
|
last_update_time = #{record.lastUpdateTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.lastAskTime != null"> |
||||
|
last_ask_time = #{record.lastAskTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.lastAnswerTime != null"> |
||||
|
last_answer_time = #{record.lastAnswerTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.publicKey != null"> |
||||
|
public_key = #{record.publicKey,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.privateKey != null"> |
||||
|
private_key = #{record.privateKey,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.operator != null"> |
||||
|
operator = #{record.operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.createdAt != null"> |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.updatedAt != null"> |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.recStatus != null"> |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
update t_idc_domain |
||||
|
set id = #{record.id,jdbcType=BIGINT}, |
||||
|
name = #{record.name,jdbcType=VARCHAR}, |
||||
|
code = #{record.code,jdbcType=VARCHAR}, |
||||
|
intro = #{record.intro,jdbcType=VARCHAR}, |
||||
|
url = #{record.url,jdbcType=VARCHAR}, |
||||
|
host = #{record.host,jdbcType=VARCHAR}, |
||||
|
self = #{record.self,jdbcType=TINYINT}, |
||||
|
pub = #{record.pub,jdbcType=TINYINT}, |
||||
|
polling = #{record.polling,jdbcType=TINYINT}, |
||||
|
answer = #{record.answer,jdbcType=TINYINT}, |
||||
|
last_update_time = #{record.lastUpdateTime,jdbcType=BIGINT}, |
||||
|
last_ask_time = #{record.lastAskTime,jdbcType=BIGINT}, |
||||
|
last_answer_time = #{record.lastAnswerTime,jdbcType=BIGINT}, |
||||
|
public_key = #{record.publicKey,jdbcType=VARCHAR}, |
||||
|
private_key = #{record.privateKey,jdbcType=VARCHAR}, |
||||
|
operator = #{record.operator,jdbcType=BIGINT}, |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomain"> |
||||
|
update t_idc_domain |
||||
|
<set> |
||||
|
<if test="name != null"> |
||||
|
name = #{name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="code != null"> |
||||
|
code = #{code,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="intro != null"> |
||||
|
intro = #{intro,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="url != null"> |
||||
|
url = #{url,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="host != null"> |
||||
|
host = #{host,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="self != null"> |
||||
|
self = #{self,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="pub != null"> |
||||
|
pub = #{pub,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="polling != null"> |
||||
|
polling = #{polling,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="answer != null"> |
||||
|
answer = #{answer,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="lastUpdateTime != null"> |
||||
|
last_update_time = #{lastUpdateTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="lastAskTime != null"> |
||||
|
last_ask_time = #{lastAskTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="lastAnswerTime != null"> |
||||
|
last_answer_time = #{lastAnswerTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="publicKey != null"> |
||||
|
public_key = #{publicKey,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="privateKey != null"> |
||||
|
private_key = #{privateKey,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
operator = #{operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcDomain"> |
||||
|
update t_idc_domain |
||||
|
set name = #{name,jdbcType=VARCHAR}, |
||||
|
code = #{code,jdbcType=VARCHAR}, |
||||
|
intro = #{intro,jdbcType=VARCHAR}, |
||||
|
url = #{url,jdbcType=VARCHAR}, |
||||
|
host = #{host,jdbcType=VARCHAR}, |
||||
|
self = #{self,jdbcType=TINYINT}, |
||||
|
pub = #{pub,jdbcType=TINYINT}, |
||||
|
polling = #{polling,jdbcType=TINYINT}, |
||||
|
answer = #{answer,jdbcType=TINYINT}, |
||||
|
last_update_time = #{lastUpdateTime,jdbcType=BIGINT}, |
||||
|
last_ask_time = #{lastAskTime,jdbcType=BIGINT}, |
||||
|
last_answer_time = #{lastAnswerTime,jdbcType=BIGINT}, |
||||
|
public_key = #{publicKey,jdbcType=VARCHAR}, |
||||
|
private_key = #{privateKey,jdbcType=VARCHAR}, |
||||
|
operator = #{operator,jdbcType=BIGINT}, |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT} |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
</mapper> |
@ -0,0 +1,353 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.dh_diplomatist.persist.mapper.IdcUserDomainMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.ccsens.dh_diplomatist.bean.po.IdcUserDomain"> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="user_id" jdbcType="BIGINT" property="userId" /> |
||||
|
<result column="domain_id" jdbcType="BIGINT" property="domainId" /> |
||||
|
<result column="domain_user_id" jdbcType="BIGINT" property="domainUserId" /> |
||||
|
<result column="name" jdbcType="VARCHAR" property="name" /> |
||||
|
<result column="gender" jdbcType="TINYINT" property="gender" /> |
||||
|
<result column="avatar_url" jdbcType="VARCHAR" property="avatarUrl" /> |
||||
|
<result column="country" jdbcType="VARCHAR" property="country" /> |
||||
|
<result column="province" jdbcType="VARCHAR" property="province" /> |
||||
|
<result column="city" jdbcType="VARCHAR" property="city" /> |
||||
|
<result column="operator" jdbcType="BIGINT" property="operator" /> |
||||
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> |
||||
|
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> |
||||
|
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, user_id, domain_id, domain_user_id, name, gender, avatar_url, country, province, |
||||
|
city, operator, created_at, updated_at, rec_status |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUserDomainExample" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_idc_user_domain |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_idc_user_domain |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
||||
|
delete from t_idc_user_domain |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUserDomainExample"> |
||||
|
delete from t_idc_user_domain |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUserDomain"> |
||||
|
insert into t_idc_user_domain (id, user_id, domain_id, |
||||
|
domain_user_id, name, gender, |
||||
|
avatar_url, country, province, |
||||
|
city, operator, created_at, |
||||
|
updated_at, rec_status) |
||||
|
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{domainId,jdbcType=BIGINT}, |
||||
|
#{domainUserId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=TINYINT}, |
||||
|
#{avatarUrl,jdbcType=VARCHAR}, #{country,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, |
||||
|
#{city,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUserDomain"> |
||||
|
insert into t_idc_user_domain |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="userId != null"> |
||||
|
user_id, |
||||
|
</if> |
||||
|
<if test="domainId != null"> |
||||
|
domain_id, |
||||
|
</if> |
||||
|
<if test="domainUserId != null"> |
||||
|
domain_user_id, |
||||
|
</if> |
||||
|
<if test="name != null"> |
||||
|
name, |
||||
|
</if> |
||||
|
<if test="gender != null"> |
||||
|
gender, |
||||
|
</if> |
||||
|
<if test="avatarUrl != null"> |
||||
|
avatar_url, |
||||
|
</if> |
||||
|
<if test="country != null"> |
||||
|
country, |
||||
|
</if> |
||||
|
<if test="province != null"> |
||||
|
province, |
||||
|
</if> |
||||
|
<if test="city != null"> |
||||
|
city, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
operator, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="userId != null"> |
||||
|
#{userId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="domainId != null"> |
||||
|
#{domainId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="domainUserId != null"> |
||||
|
#{domainUserId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="name != null"> |
||||
|
#{name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="gender != null"> |
||||
|
#{gender,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="avatarUrl != null"> |
||||
|
#{avatarUrl,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="country != null"> |
||||
|
#{country,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="province != null"> |
||||
|
#{province,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="city != null"> |
||||
|
#{city,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
#{operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
#{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
#{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
#{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUserDomainExample" resultType="java.lang.Long"> |
||||
|
select count(*) from t_idc_user_domain |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
update t_idc_user_domain |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.userId != null"> |
||||
|
user_id = #{record.userId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.domainId != null"> |
||||
|
domain_id = #{record.domainId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.domainUserId != null"> |
||||
|
domain_user_id = #{record.domainUserId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.name != null"> |
||||
|
name = #{record.name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.gender != null"> |
||||
|
gender = #{record.gender,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="record.avatarUrl != null"> |
||||
|
avatar_url = #{record.avatarUrl,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.country != null"> |
||||
|
country = #{record.country,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.province != null"> |
||||
|
province = #{record.province,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.city != null"> |
||||
|
city = #{record.city,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.operator != null"> |
||||
|
operator = #{record.operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.createdAt != null"> |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.updatedAt != null"> |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.recStatus != null"> |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
update t_idc_user_domain |
||||
|
set id = #{record.id,jdbcType=BIGINT}, |
||||
|
user_id = #{record.userId,jdbcType=BIGINT}, |
||||
|
domain_id = #{record.domainId,jdbcType=BIGINT}, |
||||
|
domain_user_id = #{record.domainUserId,jdbcType=BIGINT}, |
||||
|
name = #{record.name,jdbcType=VARCHAR}, |
||||
|
gender = #{record.gender,jdbcType=TINYINT}, |
||||
|
avatar_url = #{record.avatarUrl,jdbcType=VARCHAR}, |
||||
|
country = #{record.country,jdbcType=VARCHAR}, |
||||
|
province = #{record.province,jdbcType=VARCHAR}, |
||||
|
city = #{record.city,jdbcType=VARCHAR}, |
||||
|
operator = #{record.operator,jdbcType=BIGINT}, |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUserDomain"> |
||||
|
update t_idc_user_domain |
||||
|
<set> |
||||
|
<if test="userId != null"> |
||||
|
user_id = #{userId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="domainId != null"> |
||||
|
domain_id = #{domainId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="domainUserId != null"> |
||||
|
domain_user_id = #{domainUserId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="name != null"> |
||||
|
name = #{name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="gender != null"> |
||||
|
gender = #{gender,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="avatarUrl != null"> |
||||
|
avatar_url = #{avatarUrl,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="country != null"> |
||||
|
country = #{country,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="province != null"> |
||||
|
province = #{province,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="city != null"> |
||||
|
city = #{city,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
operator = #{operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUserDomain"> |
||||
|
update t_idc_user_domain |
||||
|
set user_id = #{userId,jdbcType=BIGINT}, |
||||
|
domain_id = #{domainId,jdbcType=BIGINT}, |
||||
|
domain_user_id = #{domainUserId,jdbcType=BIGINT}, |
||||
|
name = #{name,jdbcType=VARCHAR}, |
||||
|
gender = #{gender,jdbcType=TINYINT}, |
||||
|
avatar_url = #{avatarUrl,jdbcType=VARCHAR}, |
||||
|
country = #{country,jdbcType=VARCHAR}, |
||||
|
province = #{province,jdbcType=VARCHAR}, |
||||
|
city = #{city,jdbcType=VARCHAR}, |
||||
|
operator = #{operator,jdbcType=BIGINT}, |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT} |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
</mapper> |
@ -0,0 +1,243 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.dh_diplomatist.persist.mapper.IdcUserMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.ccsens.dh_diplomatist.bean.po.IdcUser"> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="id_card" jdbcType="VARCHAR" property="idCard" /> |
||||
|
<result column="phone" jdbcType="VARCHAR" property="phone" /> |
||||
|
<result column="operator" jdbcType="BIGINT" property="operator" /> |
||||
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> |
||||
|
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> |
||||
|
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, id_card, phone, operator, created_at, updated_at, rec_status |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUserExample" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_idc_user |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_idc_user |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
||||
|
delete from t_idc_user |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUserExample"> |
||||
|
delete from t_idc_user |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUser"> |
||||
|
insert into t_idc_user (id, id_card, phone, |
||||
|
operator, created_at, updated_at, |
||||
|
rec_status) |
||||
|
values (#{id,jdbcType=BIGINT}, #{idCard,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, |
||||
|
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
#{recStatus,jdbcType=TINYINT}) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUser"> |
||||
|
insert into t_idc_user |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="idCard != null"> |
||||
|
id_card, |
||||
|
</if> |
||||
|
<if test="phone != null"> |
||||
|
phone, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
operator, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="idCard != null"> |
||||
|
#{idCard,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="phone != null"> |
||||
|
#{phone,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
#{operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
#{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
#{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
#{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUserExample" resultType="java.lang.Long"> |
||||
|
select count(*) from t_idc_user |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
update t_idc_user |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.idCard != null"> |
||||
|
id_card = #{record.idCard,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.phone != null"> |
||||
|
phone = #{record.phone,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.operator != null"> |
||||
|
operator = #{record.operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.createdAt != null"> |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.updatedAt != null"> |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.recStatus != null"> |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
update t_idc_user |
||||
|
set id = #{record.id,jdbcType=BIGINT}, |
||||
|
id_card = #{record.idCard,jdbcType=VARCHAR}, |
||||
|
phone = #{record.phone,jdbcType=VARCHAR}, |
||||
|
operator = #{record.operator,jdbcType=BIGINT}, |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUser"> |
||||
|
update t_idc_user |
||||
|
<set> |
||||
|
<if test="idCard != null"> |
||||
|
id_card = #{idCard,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="phone != null"> |
||||
|
phone = #{phone,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="operator != null"> |
||||
|
operator = #{operator,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.ccsens.dh_diplomatist.bean.po.IdcUser"> |
||||
|
update t_idc_user |
||||
|
set id_card = #{idCard,jdbcType=VARCHAR}, |
||||
|
phone = #{phone,jdbcType=VARCHAR}, |
||||
|
operator = #{operator,jdbcType=BIGINT}, |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT} |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
</mapper> |
@ -0,0 +1,62 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE configuration |
||||
|
PUBLIC "-//mybatis.org//DTD Config 3.0//EN" |
||||
|
"http://mybatis.org/dtd/mybatis-3-config.dtd"> |
||||
|
|
||||
|
<configuration> |
||||
|
<!-- 全局参数 --> |
||||
|
<settings> |
||||
|
<!-- 打印SQL语句 --> |
||||
|
<setting name="logImpl" value="STDOUT_LOGGING" /> |
||||
|
<!-- 使全局的映射器启用或禁用缓存。 --> |
||||
|
<setting name="cacheEnabled" value="true"/> |
||||
|
<!-- 全局启用或禁用延迟加载。当禁用时,所有关联对象都会即时加载。 --> |
||||
|
<setting name="lazyLoadingEnabled" value="true"/> |
||||
|
<!-- 当启用时,有延迟加载属性的对象在被调用时将会完全加载任意属性。否则,每种属性将会按需要加载。 --> |
||||
|
<setting name="aggressiveLazyLoading" value="true"/> |
||||
|
<!-- 是否允许单条sql 返回多个数据集 (取决于驱动的兼容性) default:true --> |
||||
|
<setting name="multipleResultSetsEnabled" value="true"/> |
||||
|
<!-- 是否可以使用列的别名 (取决于驱动的兼容性) default:true --> |
||||
|
<setting name="useColumnLabel" value="true"/> |
||||
|
<!-- 允许JDBC 生成主键。需要驱动器支持。如果设为了true,这个设置将强制使用被生成的主键,有一些驱动器不兼容不过仍然可以执行。 default:false --> |
||||
|
<setting name="useGeneratedKeys" value="true"/> |
||||
|
<!-- 指定 MyBatis 如何自动映射 数据基表的列 NONE:不隐射 PARTIAL:部分 FULL:全部 --> |
||||
|
<setting name="autoMappingBehavior" value="PARTIAL"/> |
||||
|
<!-- 这是默认的执行类型 (SIMPLE: 简单; REUSE: 执行器可能重复使用prepared statements语句;BATCH: 执行器可以重复执行语句和批量更新) --> |
||||
|
<setting name="defaultExecutorType" value="SIMPLE"/> |
||||
|
<!-- 使用驼峰命名法转换字段。 --> |
||||
|
<setting name="mapUnderscoreToCamelCase" value="true"/> |
||||
|
<!-- 设置本地缓存范围 session:就会有数据的共享 statement:语句范围 (这样就不会有数据的共享 ) defalut:session --> |
||||
|
<setting name="localCacheScope" value="SESSION"/> |
||||
|
<!-- 设置但JDBC类型为空时,某些驱动程序 要指定值,default:OTHER,插入空值时不需要指定类型 --> |
||||
|
<setting name="jdbcTypeForNull" value="NULL"/> |
||||
|
</settings> |
||||
|
|
||||
|
<typeAliases> |
||||
|
<typeAlias alias="Integer" type="java.lang.Integer" /> |
||||
|
<typeAlias alias="Long" type="java.lang.Long" /> |
||||
|
<typeAlias alias="HashMap" type="java.util.HashMap" /> |
||||
|
<typeAlias alias="LinkedHashMap" type="java.util.LinkedHashMap" /> |
||||
|
<typeAlias alias="ArrayList" type="java.util.ArrayList" /> |
||||
|
<typeAlias alias="LinkedList" type="java.util.LinkedList" /> |
||||
|
<typeAlias alias="String" type="java.lang.String" /> |
||||
|
</typeAliases> |
||||
|
|
||||
|
<plugins> |
||||
|
<!-- com.github.pagehelper为PageHelper类所在包名 --> |
||||
|
<plugin interceptor="com.github.pagehelper.PageHelper"> |
||||
|
<property name="dialect" value="mysql"/> |
||||
|
<!-- 该参数默认为false --> |
||||
|
<!-- 设置为true时,会将RowBounds第一个参数offset当成pageNum页码使用 --> |
||||
|
<!-- 和startPage中的pageNum效果一样--> |
||||
|
<property name="offsetAsPageNum" value="false"/> |
||||
|
<!-- 该参数默认为false --> |
||||
|
<!-- 设置为true时,使用RowBounds分页会进行count查询 --> |
||||
|
<property name="rowBoundsWithCount" value="false"/> |
||||
|
<property name="pageSizeZero" value="true"/> |
||||
|
<property name="reasonable" value="false"/> |
||||
|
<property name="supportMethodsArguments" value="false"/> |
||||
|
<property name="returnPageInfo" value="none"/> |
||||
|
</plugin> |
||||
|
</plugins> |
||||
|
</configuration> |
@ -0,0 +1,33 @@ |
|||||
|
HELP.md |
||||
|
target/ |
||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||
|
!**/src/main/**/target/ |
||||
|
!**/src/test/**/target/ |
||||
|
|
||||
|
### STS ### |
||||
|
.apt_generated |
||||
|
.classpath |
||||
|
.factorypath |
||||
|
.project |
||||
|
.settings |
||||
|
.springBeans |
||||
|
.sts4-cache |
||||
|
|
||||
|
### IntelliJ IDEA ### |
||||
|
.idea |
||||
|
*.iws |
||||
|
*.iml |
||||
|
*.ipr |
||||
|
|
||||
|
### NetBeans ### |
||||
|
/nbproject/private/ |
||||
|
/nbbuild/ |
||||
|
/dist/ |
||||
|
/nbdist/ |
||||
|
/.nb-gradle/ |
||||
|
build/ |
||||
|
!**/src/main/**/build/ |
||||
|
!**/src/test/**/build/ |
||||
|
|
||||
|
### VS Code ### |
||||
|
.vscode/ |
@ -0,0 +1,322 @@ |
|||||
|
#!/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 |
||||
|
# |
||||
|
# https://www.apache.org/licenses/LICENSE-2.0 |
||||
|
# |
||||
|
# Unless required by applicable law or agreed to in writing, |
||||
|
# software distributed under the License is distributed on an |
||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
||||
|
# KIND, either express or implied. See the License for the |
||||
|
# specific language governing permissions and limitations |
||||
|
# under the License. |
||||
|
# ---------------------------------------------------------------------------- |
||||
|
|
||||
|
# ---------------------------------------------------------------------------- |
||||
|
# Maven 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 |
||||
|
))" |
||||
|
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 |
||||
|
if [ -n "$MVNW_REPOURL" ]; then |
||||
|
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" |
||||
|
else |
||||
|
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" |
||||
|
fi |
||||
|
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 $cygwin; then |
||||
|
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") |
||||
|
fi |
||||
|
|
||||
|
if command -v wget >/dev/null; then |
||||
|
if [ "$MVNW_VERBOSE" = true ]; then |
||||
|
echo "Found wget ... using wget" |
||||
|
fi |
||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then |
||||
|
wget "$jarUrl" -O "$wrapperJarPath" |
||||
|
else |
||||
|
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" |
||||
|
fi |
||||
|
elif command -v curl >/dev/null; then |
||||
|
if [ "$MVNW_VERBOSE" = true ]; then |
||||
|
echo "Found curl ... using curl" |
||||
|
fi |
||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then |
||||
|
curl -o "$wrapperJarPath" "$jarUrl" -f |
||||
|
else |
||||
|
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f |
||||
|
fi |
||||
|
|
||||
|
else |
||||
|
if [ "$MVNW_VERBOSE" = true ]; then |
||||
|
echo "Falling back to using Java to download" |
||||
|
fi |
||||
|
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" |
||||
|
# For Cygwin, switch paths to Windows format before running javac |
||||
|
if $cygwin; then |
||||
|
javaClass=$(cygpath --path --windows "$javaClass") |
||||
|
fi |
||||
|
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 |
||||
|
|
||||
|
# Provide a "standardized" way to retrieve the CLI args that will |
||||
|
# work with both Windows and non-Windows executions. |
||||
|
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" |
||||
|
export MAVEN_CMD_LINE_ARGS |
||||
|
|
||||
|
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 "$@" |
@ -0,0 +1,182 @@ |
|||||
|
@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 https://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 Maven 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 keystroke 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 by 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.5.6/maven-wrapper-0.5.6.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% ( |
||||
|
if "%MVNW_VERBOSE%" == "true" ( |
||||
|
echo Found %WRAPPER_JAR% |
||||
|
) |
||||
|
) else ( |
||||
|
if not "%MVNW_REPOURL%" == "" ( |
||||
|
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" |
||||
|
) |
||||
|
if "%MVNW_VERBOSE%" == "true" ( |
||||
|
echo Couldn't find %WRAPPER_JAR%, downloading it ... |
||||
|
echo Downloading from: %DOWNLOAD_URL% |
||||
|
) |
||||
|
|
||||
|
powershell -Command "&{"^ |
||||
|
"$webclient = new-object System.Net.WebClient;"^ |
||||
|
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ |
||||
|
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ |
||||
|
"}"^ |
||||
|
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ |
||||
|
"}" |
||||
|
if "%MVNW_VERBOSE%" == "true" ( |
||||
|
echo Finished downloading %WRAPPER_JAR% |
||||
|
) |
||||
|
) |
||||
|
@REM End of extension |
||||
|
|
||||
|
@REM Provide a "standardized" way to retrieve the CLI args that will |
||||
|
@REM work with both Windows and non-Windows executions. |
||||
|
set MAVEN_CMD_LINE_ARGS=%* |
||||
|
|
||||
|
%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% |
@ -0,0 +1,84 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
<parent> |
||||
|
<artifactId>ccsens_dh</artifactId> |
||||
|
<groupId>com.ccsens</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</parent> |
||||
|
|
||||
|
<artifactId>dh_ht</artifactId> |
||||
|
|
||||
|
<version>0.0.1-SNAPSHOT</version> |
||||
|
|
||||
|
<name>dh_ht</name> |
||||
|
|
||||
|
<description>Demo project for Spring Boot</description> |
||||
|
<properties> |
||||
|
<java.version>1.8</java.version> |
||||
|
</properties> |
||||
|
|
||||
|
<dependencies> |
||||
|
<!--cloud 工具类--> |
||||
|
<dependency> |
||||
|
<artifactId>cloudutil</artifactId> |
||||
|
<groupId>com.ccsens</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>com.ccsens</groupId> |
||||
|
<artifactId>util</artifactId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
<scope>compile</scope> |
||||
|
</dependency> |
||||
|
<!--微信工具包--> |
||||
|
<dependency> |
||||
|
<artifactId>wechatutil</artifactId> |
||||
|
<groupId>com.ccsens</groupId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
</dependency> |
||||
|
|
||||
|
|
||||
|
</dependencies> |
||||
|
|
||||
|
<build> |
||||
|
<plugins> |
||||
|
<plugin> |
||||
|
<groupId>org.mybatis.generator</groupId> |
||||
|
<artifactId>mybatis-generator-maven-plugin</artifactId> |
||||
|
<version>1.3.7</version> |
||||
|
<configuration> |
||||
|
<configurationFile>${basedir}/src/main/resources/mbg.xml</configurationFile> |
||||
|
<overwrite>true</overwrite> |
||||
|
</configuration> |
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>mysql</groupId> |
||||
|
<artifactId>mysql-connector-java</artifactId> |
||||
|
<version>5.1.34</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
</plugin> |
||||
|
<plugin> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
|
<configuration> |
||||
|
<mainClass>com.ccsens.dh_ht.DhHtApplication</mainClass> |
||||
|
<!--<skip>true</skip>--> |
||||
|
</configuration> |
||||
|
<executions> |
||||
|
<execution> |
||||
|
<goals> |
||||
|
<goal>repackage</goal> |
||||
|
</goals> |
||||
|
</execution> |
||||
|
</executions> |
||||
|
</plugin> |
||||
|
|
||||
|
</plugins> |
||||
|
</build> |
||||
|
|
||||
|
|
||||
|
</project> |
@ -0,0 +1,31 @@ |
|||||
|
package com.ccsens.dh_ht; |
||||
|
|
||||
|
import com.ccsens.cloudutil.ribbon.RibbonConfiguration; |
||||
|
import org.mybatis.spring.annotation.MapperScan; |
||||
|
import org.springframework.boot.SpringApplication; |
||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
|
import org.springframework.boot.web.servlet.ServletComponentScan; |
||||
|
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; |
||||
|
import org.springframework.cloud.openfeign.EnableFeignClients; |
||||
|
import org.springframework.context.annotation.ComponentScan; |
||||
|
import org.springframework.context.annotation.FilterType; |
||||
|
import org.springframework.scheduling.annotation.EnableAsync; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@MapperScan(basePackages = {"com.ccsens.dh_ht.persist.*","com.ccsens.common.persist.*"}) |
||||
|
@ServletComponentScan |
||||
|
@EnableAsync |
||||
|
//开启断路器功能
|
||||
|
@EnableCircuitBreaker |
||||
|
@EnableFeignClients(basePackages = "com.ccsens.cloudutil.feign") |
||||
|
@SpringBootApplication |
||||
|
@ComponentScan(basePackages = "com.ccsens", excludeFilters = { @ComponentScan.Filter(type= FilterType.ASSIGNABLE_TYPE, value = RibbonConfiguration.class)}) |
||||
|
public class DhHtApplication { |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
SpringApplication.run(DhHtApplication.class, args); |
||||
|
} |
||||
|
|
||||
|
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue