Commit c5b3f90b by songxiang

增加错题本相关的配置

parent 5af88616
......@@ -94,4 +94,7 @@ product.parentTutor.proLabelId = 7461
book.group.qrcode.domain = https://qrcode.5rs.me
ownAgentIds = 2,1362
\ No newline at end of file
ownAgentIds = 2,1362
## \u9519\u9898\u672C\u73AF\u5883\u57DF\u540D
papercut.domain = papercut.5rs.me
\ No newline at end of file
......@@ -95,4 +95,7 @@ product.parentTutor.proLabelId = 812
book.group.qrcode.domain = https://qrcode.raysyun.com
ownAgentIds = 12829
\ No newline at end of file
ownAgentIds = 12829
## \u9519\u9898\u672C\u73AF\u5883\u57DF\u540D
papercut.domain = papercut.raysyun.com
\ No newline at end of file
/**
*
*
*/
package com.pcloud.common.core.aspect;
......@@ -20,7 +20,6 @@ import com.alibaba.fastjson.JSON;
import com.pcloud.common.utils.string.StringUtil;
/**
*
* @author:songx
* @date:2018年4月26日,下午2:32:36
*/
......@@ -28,79 +27,80 @@ import com.pcloud.common.utils.string.StringUtil;
@Configuration
public class ParamLogAspect {
/**
*
*/
private final static Logger LOGGER = LoggerFactory.getLogger("");
/**
*
*/
private final static Logger LOGGER = LoggerFactory.getLogger("");
@Pointcut("execution(* com.pcloud..*(..))")
public void bizPoint() {
}
@Pointcut("execution(* com.pcloud..*(..))")
public void bizPoint() {
}
/**
* 方法执行前以后执行
*
* @param joinPoint
*/
@Before("bizPoint()")
public void doBefore(JoinPoint joinPoint) {
ParamLog paramLog = checkAnnotation(joinPoint);
if (paramLog == null) {
return;
}
Signature signature = joinPoint.getSignature();
String methodName = signature.getName();
String description = paramLog.description();
description = StringUtil.isEmpty(description) ? paramLog.value() : description;
StringBuffer msg = new StringBuffer(signature.getDeclaringTypeName()).append(" 【" + methodName + " before】");
if (!StringUtil.isEmpty(description)) {
msg.append(description);
}
if (!paramLog.isBefore()) {
LOGGER.info(msg.toString());
} else {
String argsJson = JSON.toJSONString(joinPoint.getArgs());
LOGGER.info(msg.append(",[Args]=").append(argsJson).toString());
}
}
/**
* 方法执行前以后执行
*
* @param joinPoint
*/
@Before("bizPoint()")
public void doBefore(JoinPoint joinPoint) {
ParamLog paramLog = checkAnnotation(joinPoint);
if (paramLog == null) {
return;
}
Signature signature = joinPoint.getSignature();
String methodName = signature.getName();
String description = paramLog.description();
description = StringUtil.isEmpty(description) ? paramLog.value() : description;
StringBuffer msg = new StringBuffer(signature.getDeclaringTypeName()).append(" 【" + methodName + " before】");
if (!StringUtil.isEmpty(description)) {
msg.append(description);
}
if (!paramLog.isBefore()) {
LOGGER.info(msg.toString());
} else {
String argsJson = JSON.toJSONString(joinPoint.getArgs());
LOGGER.info(msg.append(",[Args]=").append(argsJson).toString());
}
}
/**
* 方法执行完以后执行
*
* @param object
*/
@AfterReturning(pointcut = "bizPoint()", returning = "result")
public void doAfterReturn(JoinPoint joinPoint, Object result) {
ParamLog paramLog = checkAnnotation(joinPoint);
if (paramLog == null) {
return;
}
Signature signature = joinPoint.getSignature();
String methodName = signature.getName();
String description = paramLog.description();
description = StringUtil.isEmpty(description) ? paramLog.value() : description;
StringBuffer msg = new StringBuffer(signature.getDeclaringTypeName())
.append(" 【" + methodName + " afterReturn】");
if (!StringUtil.isEmpty(description)) {
msg.append(description);
}
if (!paramLog.isAfterReturn()) {
LOGGER.info(msg.toString());
} else {
String resultJson = JSON.toJSONString(result);
LOGGER.info(msg.append(",[result]=").append(resultJson).toString());
}
}
/**
* 方法执行完以后执行
*
* @param joinPoint
* @param result
*/
@AfterReturning(pointcut = "bizPoint()", returning = "result")
public void doAfterReturn(JoinPoint joinPoint, Object result) {
ParamLog paramLog = checkAnnotation(joinPoint);
if (paramLog == null) {
return;
}
Signature signature = joinPoint.getSignature();
String methodName = signature.getName();
String description = paramLog.description();
description = StringUtil.isEmpty(description) ? paramLog.value() : description;
StringBuffer msg = new StringBuffer(signature.getDeclaringTypeName())
.append(" 【" + methodName + " afterReturn】");
if (!StringUtil.isEmpty(description)) {
msg.append(description);
}
if (!paramLog.isAfterReturn()) {
LOGGER.info(msg.toString());
} else {
String resultJson = JSON.toJSONString(result);
LOGGER.info(msg.append(",[result]=").append(resultJson).toString());
}
}
private static ParamLog checkAnnotation(JoinPoint joinPoint) {
// 获取方法签名
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
// java reflect相关类,通过反射得到注解
Method method = signature.getMethod();
if (!method.isAnnotationPresent(ParamLog.class)) {
return null;
}
return method.getAnnotation(ParamLog.class);
}
private static ParamLog checkAnnotation(JoinPoint joinPoint) {
// 获取方法签名
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
// java reflect相关类,通过反射得到注解
Method method = signature.getMethod();
if (!method.isAnnotationPresent(ParamLog.class)) {
return null;
}
return method.getAnnotation(ParamLog.class);
}
}
......@@ -9,62 +9,72 @@ package com.pcloud.common.core.enums;
*/
public enum TranscodeFromEnum {
/**
* 内容中心,office
*/
CONTENT_OFFICE("CONTENT_OFFICE"),
/**
* 内容中心,office
*/
CONTENT_OFFICE("CONTENT_OFFICE"),
/**
* 内容中心,PDF
*/
CONTENT_PDF("CONTENT_PDF"),
/**
* 内容中心,PDF
*/
CONTENT_PDF("CONTENT_PDF"),
/**
* 内容中心,好文PDF
*/
CONTENT_ARTICLE_PDF("CONTENT_ARTICLE_PDF"),
/**
* 内容中心,好文PDF
*/
CONTENT_ARTICLE_PDF("CONTENT_ARTICLE_PDF"),
/**
* 圈子应用
*/
GROUPAPP_PDF_OR_OFFICE("GROUPAPP_PDF_OR_OFFICE"),
/**
* 圈子应用
*/
GROUPAPP_PDF_OR_OFFICE("GROUPAPP_PDF_OR_OFFICE"),
/**
* 帮助中心
*/
HELPCENTER_PDF("HELPCENTER_PDF"),
/**
* 帮助中心
*/
HELPCENTER_PDF("HELPCENTER_PDF"),
/**
* 直播
*/
LIVE_PPT("LIVE_PPT"),
/**
* 直播
*/
LIVE_PPT("LIVE_PPT"),
/**
* 直播
*/
LIVE_HOMEWORD("LIVE_HOMEWORD"),
/**
* 直播
*/
LIVE_HOMEWORD("LIVE_HOMEWORD"),
/**
* 音频
*/
AUDIOAPP_PDF("AUDIOAPP_PDF"),
/**
* 音频
*/
AUDIOAPP_PDF("AUDIOAPP_PDF"),
/**
* 文件管理中心
*/
CONVERT_PDF("CONVERT_PDF");
/**
* 文件管理中心
*/
CONVERT_PDF("CONVERT_PDF"),
/**
* 值
*/
public final String code;
/**
* 错题本-题目
*/
NOTE_SUBJECT("NOTE_SUBJECT"),
/**
* 构造
*
* @param code
*/
private TranscodeFromEnum(String code) {
this.code = code;
}
/**
* 错题本-答案
*/
NOTE_ANSWER("NOTE_ANSWER");
/**
* 值
*/
public final String code;
/**
* 构造
*
* @param code
*/
private TranscodeFromEnum(String code) {
this.code = code;
}
}
......@@ -1693,7 +1693,6 @@ public class OssUtils {
style.append(",image_" + new String(Base64.encodeBase64URLSafe(watermarkImageUrl.getBytes())));
// 水印颜色,位置,偏移量
style.append(",g_nw,x_20,y_10");
System.out.println(style.toString());
String result = imageWatermarkHandle(fileUrl, style.toString());
LOGGER.info("【aliOSS】图片增加水印(图片),<END>.[result]=" + result);
return result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment