Search in sources :

Example 1 with Logs

use of com.tale.model.entity.Logs in project tale by otale.

the class BaseWebHook method after.

@Override
public boolean after(RouteContext context) {
    if (null != TaleUtils.getLoginUser()) {
        SysLog sysLog = context.routeAction().getAnnotation(SysLog.class);
        if (null != sysLog) {
            Logs logs = new Logs();
            logs.setAction(sysLog.value());
            logs.setAuthorId(TaleUtils.getLoginUser().getUid());
            logs.setIp(context.request().address());
            if (!context.request().uri().contains("upload")) {
                logs.setData(context.request().bodyToString());
            }
            logs.setCreated(DateKit.nowUnix());
            logs.save();
        }
    }
    return true;
}
Also used : SysLog(com.tale.annotation.SysLog) Logs(com.tale.model.entity.Logs)

Aggregations

SysLog (com.tale.annotation.SysLog)1 Logs (com.tale.model.entity.Logs)1