Search in sources :

Example 1 with Logs

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

the class IndexController method index.

/**
     * 仪表盘
     */
@Route(value = { "/", "index" }, method = HttpMethod.GET)
public String index(Request request) {
    List<Comments> comments = siteService.recentComments(5);
    List<Contents> contents = siteService.getContens(Types.RECENT_ARTICLE, 5);
    Statistics statistics = siteService.getStatistics();
    // 取最新的20条日志
    List<Logs> logs = logService.getLogs(1, 20);
    request.attribute("comments", comments);
    request.attribute("articles", contents);
    request.attribute("statistics", statistics);
    request.attribute("logs", logs);
    return "admin/index";
}
Also used : Contents(com.tale.model.Contents) Comments(com.tale.model.Comments) Logs(com.tale.model.Logs) Statistics(com.tale.dto.Statistics) Route(com.blade.mvc.annotation.Route)

Example 2 with Logs

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

the class LogServiceImpl method save.

@Override
public void save(String action, String data, String ip, Integer author_id) {
    Logs logs = new Logs();
    logs.setAction(action);
    logs.setData(data);
    logs.setIp(ip);
    logs.setAuthor_id(author_id);
    logs.setCreated(DateKit.getCurrentUnixTime());
    activeRecord.insert(logs);
}
Also used : Logs(com.tale.model.Logs)

Aggregations

Logs (com.tale.model.Logs)2 Route (com.blade.mvc.annotation.Route)1 Statistics (com.tale.dto.Statistics)1 Comments (com.tale.model.Comments)1 Contents (com.tale.model.Contents)1