部门分页、url前缀改为ucs-admin

This commit is contained in:
lizhicheng 2022-10-31 14:55:36 +08:00
parent fd7b66bba9
commit ddd1c3196a
3 changed files with 31 additions and 5 deletions

View File

@ -56,14 +56,14 @@ public class SysLogOperationServiceImpl extends BaseServiceImpl<SysLogOperationD
.like(StringUtils.isNotBlank(operation), "operation", operation) .like(StringUtils.isNotBlank(operation), "operation", operation)
.between(StringUtils.isNotBlank(startDate), "create_date", startDate, endDate); .between(StringUtils.isNotBlank(startDate), "create_date", startDate, endDate);
if (params.containsKey("operationType")) { if (params.containsKey("operationType")) {
queryWrapper.ne("request_uri", "/renren-admin/resource/updateVisits"); queryWrapper.ne("request_uri", "/ucs-admin/resource/updateVisits");
if ("all".equals(operationType)) { if ("all".equals(operationType)) {
queryWrapper.and(wrapper -> queryWrapper.and(wrapper ->
wrapper.like("request_uri", "/renren-admin/resource%/insert") wrapper.like("request_uri", "/ucs-admin/resource%/insert")
.or() .or()
.like("request_uri", "/renren-admin/resource%/update") .like("request_uri", "/ucs-admin/resource%/update")
.or() .or()
.like("request_uri", "/renren-admin/resource%/delete")); .like("request_uri", "/ucs-admin/resource%/delete"));
} else { } else {
queryWrapper.like(StringUtils.isNotBlank(operationType), "request_uri", operationType); queryWrapper.like(StringUtils.isNotBlank(operationType), "request_uri", operationType);
} }

View File

@ -1,6 +1,8 @@
package io.renren.modules.sys.controller; package io.renren.modules.sys.controller;
import io.renren.common.annotation.LogOperation; import io.renren.common.annotation.LogOperation;
import io.renren.common.constant.Constant;
import io.renren.common.page.PageData;
import io.renren.common.utils.Result; import io.renren.common.utils.Result;
import io.renren.common.validator.AssertUtils; import io.renren.common.validator.AssertUtils;
import io.renren.common.validator.ValidatorUtils; import io.renren.common.validator.ValidatorUtils;
@ -15,14 +17,18 @@ import io.renren.modules.sys.enums.SuperAdminEnum;
import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysDeptService;
import io.renren.modules.sys.service.SysUserService; import io.renren.modules.sys.service.SysUserService;
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;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 部门管理 * 部门管理
@ -48,6 +54,26 @@ public class SysDeptController {
return new Result<List<SysDeptDTO>>().ok(list); return new Result<List<SysDeptDTO>>().ok(list);
} }
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int")
})
public Result<PageData<SysDeptDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
long curPage = 1;
long limit = 10;
if (params.get(Constant.PAGE) != null) {
curPage = Long.parseLong((String) params.get(Constant.PAGE));
}
if (params.get(Constant.LIMIT) != null) {
limit = Long.parseLong((String) params.get(Constant.LIMIT));
}
List<SysDeptDTO> dtoList = sysDeptService.list(new HashMap<>(1));
List<SysDeptDTO> result = dtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList());
return new Result<PageData<SysDeptDTO>>().ok(new PageData(result, dtoList.size()));
}
@GetMapping("listForRegion") @GetMapping("listForRegion")
@ApiOperation("查询区域管理员管理的部门") @ApiOperation("查询区域管理员管理的部门")
@LogOperation("查询区域管理员管理的部门") @LogOperation("查询区域管理员管理的部门")

View File

@ -36,7 +36,7 @@ server:
min-spare: 30 min-spare: 30
port: 9090 port: 9090
servlet: servlet:
context-path: /renren-admin context-path: /ucs-admin
session: session:
cookie: cookie:
http-only: true http-only: true