Commit 3c7e85d2 authored by Quxl's avatar Quxl

x

parent ae9869f8
......@@ -6,6 +6,7 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.LogService;
......@@ -18,7 +19,7 @@ public class LogServiceImpl implements LogService {
@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);
return jdbcTemplate.limit("select l.*, le.ext from fc_log l left join fc_log_ext le on le.path = l.path" + (StringUtil.isNotBlank(type) ? " where l.type = '" + type.toUpperCase() + "'" : ""), page);
}
}
......@@ -14,6 +14,8 @@ import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.LogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@Api
......@@ -27,6 +29,11 @@ public class AdminLogController {
@ResponseBody
@PostMapping("list")
@ApiOperation("查询日志")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="string", required=false, name="type", value="ADMIN,MEMBER,USER"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="index", value="分页编号"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="limit", value="分页大小"),
})
public Object list(String type, Long index, Long limit) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
......
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