Commit bb55cc0b authored by Quxl's avatar Quxl

x

parent b27912f3
package com.egolm.film.api.service;
import java.util.List;
import java.util.Map;
import com.egolm.common.jdbc.Page;
public interface LogService {
List<Map<String, Object>> queryLogList(String type, Page page);
}
package com.egolm.film.api.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.LogService;
@Service
public class LogServiceImpl implements LogService {
@Autowired
JdbcTemplate jdbcTemplate;
@Override
public List<Map<String, Object>> queryLogList(String type, Page page) {
return jdbcTemplate.limit("select l.*, le.ext from fc_log l left join fc_log_ext le on le.path = l.path", page);
}
}
package com.egolm.film.api.web.admin;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.LogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api
@Controller
@RequestMapping("admin/log")
public class AdminLogController {
@Autowired
LogService service;
@ResponseBody
@PostMapping("list")
@ApiOperation("查询日志")
public Object list(String type, Long index, Long limit) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
Page page = new Page(index, limit);
List<Map<String, Object>> list = service.queryLogList(type, page);
return Rjx.jsonOk().setData(list);
}
}
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