Commit 3c7e85d2 authored by Quxl's avatar Quxl

x

parent ae9869f8
...@@ -6,6 +6,7 @@ import java.util.Map; ...@@ -6,6 +6,7 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.LogService; import com.egolm.film.api.service.LogService;
...@@ -18,7 +19,7 @@ public class LogServiceImpl implements LogService { ...@@ -18,7 +19,7 @@ public class LogServiceImpl implements LogService {
@Override @Override
public List<Map<String, Object>> queryLogList(String type, Page page) { 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; ...@@ -14,6 +14,8 @@ import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.LogService; import com.egolm.film.api.service.LogService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@Api @Api
...@@ -27,6 +29,11 @@ public class AdminLogController { ...@@ -27,6 +29,11 @@ public class AdminLogController {
@ResponseBody @ResponseBody
@PostMapping("list") @PostMapping("list")
@ApiOperation("查询日志") @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) { public Object list(String type, Long index, Long limit) {
index = index == null ? 1 : index; index = index == null ? 1 : index;
limit = limit == null ? 20 : limit; 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