feat: 新增用户登录日志

pull/14/head
Carina 3 years ago
parent 644866a392
commit 935b3bb986

File diff suppressed because one or more lines are too long

@ -0,0 +1,60 @@
/**
* Copyright 2020 OPSLI https://www.opsli.com
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.opsli.api.web.system.logs;
import org.opsli.api.base.result.ResultVo;
import org.opsli.api.wrapper.system.logs.LogsModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
/**
* API
*
* API @GetMapping @PostMapping
* Mapping Controller
*
*
*
* @author Parker
* @date 2020-09-13 17:40
*/
public interface LoginLogsApi {
/** 标题 */
String TITLE = "登录日志管理";
/** 子标题 */
String SUB_TITLE = "登录日志";
/**
*
* @param pageNo
* @param pageSize
* @param request request
* @return ResultVo
*/
@GetMapping("/findPage")
ResultVo<?> findPage(
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest request
);
}

@ -38,9 +38,9 @@ import javax.servlet.http.HttpServletRequest;
public interface LogsApi {
/** 标题 */
String TITLE = "日志管理";
String TITLE = "操作日志管理";
/** 子标题 */
String SUB_TITLE = "日志";
String SUB_TITLE = "操作日志";
/**
*
@ -64,13 +64,6 @@ public interface LogsApi {
HttpServletRequest request
);
/**
*
* @return ResultVo
*/
@PostMapping("/emptyByOneMonth")
ResultVo<?> emptyByOneMonth();
/**
*

@ -0,0 +1,74 @@
/**
* Copyright 2020 OPSLI https://www.opsli.com
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.opsli.api.wrapper.system.logs;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.opsli.api.base.warpper.ApiWrapper;
/**
*
*
* @author Parker
* @date 2020-09-16 17:33
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class LoginLogsModel extends ApiWrapper {
/**
*
*/
private String tenantId;
/**
* ID xxx,xxx
*/
private String orgIds;
/**
*
*/
@ApiModelProperty(value = "用户名称")
private String username;
/**
*
*/
@ApiModelProperty(value = "真实姓名")
private String realName;
/**
*
* 1 :
* 2 :
*/
@ApiModelProperty(value = "日志类型")
private String type;
/**
* IP
*/
@ApiModelProperty(value = "操作IP地址")
private String remoteAddr;
/**
*
*/
@ApiModelProperty(value = "用户代理")
private String userAgent;
}

@ -43,6 +43,10 @@ public enum DictType {
DATA_SCOPE_DEPT_AND_UNDER("role_data_scope","2", "本部门及以下数据"),
DATA_SCOPE_ALL("role_data_scope","3", "全部数据"),
/** 登入登出日志类型 */
LOGIN_LOG_TYPE_LOGIN("login_log_type","1", "登入"),
LOGIN_LOG_TYPE_LOGOUT("login_log_type","2", "登出")
;

@ -55,6 +55,8 @@ import org.opsli.core.utils.UserUtil;
import org.opsli.plugins.excel.exception.ExcelPluginException;
import org.opsli.plugins.excel.listener.BatchExcelListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
@ -92,6 +94,18 @@ public abstract class BaseRestController <T extends BaseEntity, E extends ApiWra
@Autowired(required = false)
protected S IService;
/**
*
* id
*
* @param id id
* @return E
*/
@ModelAttribute
public E get(@RequestParam(required=false) String id) {
return IService.get(id);
}
/**
* Excel
* @param request request

@ -77,10 +77,7 @@ public class GenTableRestController extends BaseRestController<GenTable, GenTabl
// 判断代码生成器 是否启用
GeneratorHandleUtil.judgeGeneratorEnable(super.globalProperties);
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
GenTableAndColumnModel currModel = WrapperUtil.transformInstance(
model, GenTableAndColumnModel.class

@ -71,10 +71,7 @@ public class GenTemplateDetailRestController extends BaseRestController<GenTempl
// 判断代码生成器 是否启用
GeneratorHandleUtil.judgeGeneratorEnable(super.globalProperties);
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
return ResultVo.success(model);
}

@ -70,10 +70,7 @@ public class GenTemplateRestController extends BaseRestController<GenTemplate, G
// 判断代码生成器 是否启用
GeneratorHandleUtil.judgeGeneratorEnable(super.globalProperties);
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
return ResultVo.success(model);
}

@ -87,10 +87,7 @@ public class SysAreaRestController extends BaseRestController<SysArea, SysAreaMo
@RequiresPermissions("system_area_select")
@Override
public ResultVo<SysAreaModel> get(SysAreaModel model) {
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
return ResultVo.success(model);
}

@ -72,10 +72,7 @@ public class DictDetailRestController extends BaseRestController<SysDictDetail,
@ApiOperation(value = "获得单条字典明细数据", notes = "获得单条字典明细数据 - ID")
@Override
public ResultVo<DictDetailModel> get(DictDetailModel model) {
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
return ResultVo.success(model);
}

@ -74,10 +74,7 @@ public class DictRestController extends BaseRestController<SysDict, DictModel, I
@ApiOperation(value = "获得单条字典数据", notes = "获得单条字典数据 - ID")
@Override
public ResultVo<DictModel> get(DictModel model) {
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
return ResultVo.success(model);
}

@ -22,6 +22,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.opsli.api.base.result.ResultVo;
import org.opsli.api.wrapper.system.logs.LoginLogsModel;
import org.opsli.api.wrapper.system.menu.MenuModel;
import org.opsli.api.wrapper.system.options.OptionsModel;
import org.opsli.api.wrapper.system.tenant.TenantModel;
@ -39,6 +40,8 @@ import org.opsli.core.holder.UserContextHolder;
import org.opsli.core.msg.TokenMsg;
import org.opsli.core.utils.*;
import org.opsli.modulars.system.login.entity.LoginForm;
import org.opsli.modulars.system.logs.factory.UserLoginLogFactory;
import org.opsli.modulars.system.logs.service.ILoginLogsService;
import org.opsli.modulars.system.user.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -68,6 +71,8 @@ public class LoginRestController {
@Autowired
private IUserService iUserService;
@Autowired
private ILoginLogsService iLoginLogsService;
/**
*
@ -171,11 +176,10 @@ public class LoginRestController {
user.setLoginIp(clientIpAddress);
iUserService.updateLoginIp(user);
// TODO
// 记录用户登录日志 如果系统较大 可考虑 Elastic 的 filebeat
// 小系统 直接存在 mysql就好
LoginLogsModel userLoginModel = UserLoginLogFactory.getUserLoginModel(request, user, true);
iLoginLogsService.insert(userLoginModel);
});
normalExecutor.execute();
}
@ -189,7 +193,7 @@ public class LoginRestController {
@Limiter
@ApiOperation(value = "登出", notes = "登出")
@PostMapping("/system/logout")
public ResultVo<?> logout() {
public ResultVo<?> logout(HttpServletRequest request) {
String token = UserContextHolder.getToken().orElseThrow(() -> new TokenException(
TokenMsg.EXCEPTION_TOKEN_LOSE_EFFICACY));
@ -197,6 +201,18 @@ public class LoginRestController {
if(StringUtils.isEmpty(token)){
return ResultVo.error(TokenMsg.EXCEPTION_LOGOUT_ERROR.getMessage());
}
// 异步记录信息
AsyncProcessExecutor normalExecutor = AsyncProcessExecutorFactory.createNormalExecutor();
UserModel user = UserUtil.getUser();
normalExecutor.put(()->{
// 记录用户登录日志 如果系统较大 可考虑 Elastic 的 filebeat
// 小系统 直接存在 mysql就好
LoginLogsModel userLoginModel = UserLoginLogFactory.getUserLoginModel(request, user, false);
iLoginLogsService.insert(userLoginModel);
});
normalExecutor.execute();
UserTokenUtil.logout(token);
return ResultVo.success(TokenMsg.EXCEPTION_LOGOUT_SUCCESS.getMessage());
}

@ -0,0 +1,67 @@
/**
* Copyright 2020 OPSLI https://www.opsli.com
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.opsli.modulars.system.logs.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.opsli.core.base.entity.BaseEntity;
/**
*
*
* @author
* @date 202231817:45:18
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class SysLoginLogs extends BaseEntity {
/**
*
*/
private String tenantId;
/**
* ID xxx,xxx
*/
private String orgIds;
/**
*
*/
private String username;
/**
*
*/
private String realName;
/**
*
* 1 :
* 2 :
*/
private String type;
/**
* IP
*/
private String remoteAddr;
/**
*
*/
private String userAgent;
}

@ -39,6 +39,14 @@ public class SysLogs extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private String tenantId;
/**
* ID xxx,xxx
*/
private String orgIds;
/** 日志类型1接入日志2错误日志 */
private String type;

@ -0,0 +1,49 @@
package org.opsli.modulars.system.logs.factory;
import cn.hutool.core.util.StrUtil;
import org.opsli.api.wrapper.system.logs.LoginLogsModel;
import org.opsli.api.wrapper.system.user.UserModel;
import org.opsli.api.wrapper.system.user.UserOrgRefModel;
import org.opsli.common.enums.DictType;
import org.opsli.core.utils.UserUtil;
import org.springframework.util.ObjectUtils;
import javax.servlet.http.HttpServletRequest;
/**
* @author
* @date 2022/3/18 14:34
*/
public final class UserLoginLogFactory {
/**
*
* @param user
* @return
*/
public static LoginLogsModel getUserLoginModel(HttpServletRequest request, UserModel user, boolean isLogin){
//记录登入登出日志
LoginLogsModel loginInfo = new LoginLogsModel();
loginInfo.setUsername(user.getUsername());
loginInfo.setRealName(user.getRealName());
// *** 需要确保 user对象的ip信息是有值的
loginInfo.setRemoteAddr(user.getLoginIp());
String header = request.getHeader("User-Agent");
loginInfo.setUserAgent(header);
loginInfo.setIzManual(true);
loginInfo.setCreateBy(user.getId());
loginInfo.setUpdateBy(user.getId());
UserOrgRefModel orgByUserId = UserUtil.getUserDefOrgByUserId(user.getId());
loginInfo.setOrgIds(ObjectUtils.isEmpty(orgByUserId)? null : orgByUserId.getOrgIds() );
loginInfo.setTenantId(StrUtil.blankToDefault(user.getTenantId(),null));
if(isLogin){
loginInfo.setType(DictType.LOGIN_LOG_TYPE_LOGIN.getValue());
}else {
loginInfo.setType(DictType.LOGIN_LOG_TYPE_LOGOUT.getValue());
}
return loginInfo;
}
}

@ -0,0 +1,31 @@
/**
* Copyright 2020 OPSLI https://www.opsli.com
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.opsli.modulars.system.logs.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.opsli.modulars.system.logs.entity.SysLoginLogs;
/**
* Mapper
*
* @author Parker
* @date 2020-11-28 18:59:59
*/
@Mapper
public interface SysLoginLogsMapper extends BaseMapper<SysLoginLogs> {
}

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.opsli.modulars.system.logs.mapper.SysLoginLogsMapper">
</mapper>

@ -0,0 +1,32 @@
/**
* Copyright 2020 OPSLI https://www.opsli.com
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.opsli.modulars.system.logs.service;
import org.opsli.api.wrapper.system.logs.LoginLogsModel;
import org.opsli.core.base.service.interfaces.CrudServiceInterface;
import org.opsli.modulars.system.logs.entity.SysLoginLogs;
/**
* Service
*
* @author Parker
* @date 2020-11-28 18:59:59
*/
public interface ILoginLogsService extends CrudServiceInterface<SysLoginLogs, LoginLogsModel> {
}

@ -0,0 +1,42 @@
/**
* Copyright 2020 OPSLI https://www.opsli.com
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.opsli.modulars.system.logs.service.impl;
import org.opsli.api.wrapper.system.logs.LoginLogsModel;
import org.opsli.core.base.service.impl.CrudServiceImpl;
import org.opsli.modulars.system.logs.entity.SysLoginLogs;
import org.opsli.modulars.system.logs.mapper.SysLoginLogsMapper;
import org.opsli.modulars.system.logs.service.ILoginLogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Service Impl
*
* @author Parker
* @date 2020-11-28 18:59:59
*/
@Service
public class LoginLogsServiceImpl extends CrudServiceImpl<SysLoginLogsMapper, SysLoginLogs, LoginLogsModel>
implements ILoginLogsService {
@Autowired
private SysLoginLogsMapper mapper;
}

@ -0,0 +1,73 @@
/**
* Copyright 2020 OPSLI https://www.opsli.com
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.opsli.modulars.system.logs.web;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.opsli.api.base.result.ResultVo;
import org.opsli.api.web.system.logs.LoginLogsApi;
import org.opsli.api.web.system.logs.LogsApi;
import org.opsli.api.wrapper.system.logs.LoginLogsModel;
import org.opsli.api.wrapper.system.logs.LogsModel;
import org.opsli.common.annotation.ApiRestController;
import org.opsli.common.annotation.EnableLog;
import org.opsli.core.base.controller.BaseRestController;
import org.opsli.core.persistence.Page;
import org.opsli.core.persistence.querybuilder.QueryBuilder;
import org.opsli.core.persistence.querybuilder.WebQueryBuilder;
import org.opsli.modulars.system.logs.entity.SysLoginLogs;
import org.opsli.modulars.system.logs.entity.SysLogs;
import org.opsli.modulars.system.logs.service.ILoginLogsService;
import org.opsli.modulars.system.logs.service.ILogsService;
import javax.servlet.http.HttpServletRequest;
/**
* Controller
*
* @author Parker
* @date 2020-11-28 18:59:59
*/
@Api(tags = LoginLogsApi.TITLE)
@Slf4j
@ApiRestController("/{ver}/system/login-logs")
public class LoginLogsRestController extends BaseRestController<SysLoginLogs, LoginLogsModel, ILoginLogsService>
implements LoginLogsApi {
/**
*
* @param pageNo
* @param pageSize
* @param request request
* @return ResultVo
*/
@ApiOperation(value = "获得分页数据", notes = "获得分页数据 - 查询构造器")
@RequiresPermissions("devops_login_logs_select")
@Override
public ResultVo<?> findPage(Integer pageNo, Integer pageSize, HttpServletRequest request) {
QueryBuilder<SysLoginLogs> queryBuilder = new WebQueryBuilder<>(entityClazz, request.getParameterMap());
Page<SysLoginLogs, LoginLogsModel> page = new Page<>(pageNo, pageSize);
page.setQueryWrapper(queryBuilder.build());
page = IService.findPage(page);
return ResultVo.success(page.getPageData());
}
}

@ -56,10 +56,7 @@ public class LogsRestController extends BaseRestController<SysLogs, LogsModel, I
@RequiresPermissions("devops_logs_select")
@Override
public ResultVo<LogsModel> get(LogsModel model) {
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
return ResultVo.success(model);
}
@ -84,20 +81,6 @@ public class LogsRestController extends BaseRestController<SysLogs, LogsModel, I
}
/**
*
* @return ResultVo
*/
@ApiOperation(value = "清空一个月前的日志", notes = "清空一个月前的日志")
@RequiresPermissions("devops_logs_delete")
@EnableLog
@Override
public ResultVo<?> emptyByOneMonth(){
IService.emptyByOneMonth();
return ResultVo.success("清空日志成功");
}
@Override
public ResultVo<?> insert(LogsModel model) {
IService.insert(model);

@ -284,10 +284,7 @@ public class MenuRestController extends BaseRestController<SysMenu, MenuModel, I
// 生成根节点菜单
model = getGenMenuModel();
}else{
// 如果系统内部调用 则直接查数据库
if (model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
}
}

@ -74,10 +74,7 @@ public class SysOptionsRestController extends BaseRestController<SysOptions, Opt
@RequiresPermissions("system_options_select")
@Override
public ResultVo<OptionsModel> get(OptionsModel model) {
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
return ResultVo.success(model);
}

@ -311,10 +311,7 @@ public class SysOrgRestController extends BaseRestController<SysOrg, SysOrgModel
// 生成根节点组织
model = getGenOrgModel();
}else{
// 如果系统内部调用 则直接查数据库
if (model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
}
}

@ -62,10 +62,7 @@ public class RoleRestController extends BaseRestController<SysRole, RoleModel, I
@RequiresPermissions("system_role_select")
@Override
public ResultVo<RoleModel> get(RoleModel model) {
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
return ResultVo.success(model);
}

@ -86,10 +86,7 @@ public class TenantRestController extends BaseRestController<SysTenant, TenantMo
@RequiresPermissions("system_tenant_select")
@Override
public ResultVo<TenantModel> get(TenantModel model) {
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
return ResultVo.success(model);
}

@ -325,10 +325,7 @@ public class UserRestController extends BaseRestController<SysUser, UserModel, I
//@RequiresPermissions("system_user_select")
@Override
public ResultVo<UserModel> get(UserModel model) {
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
return ResultVo.success(model);
}

@ -61,10 +61,7 @@ public class TestCarRestController extends BaseRestController<TestCar, TestCarMo
@RequiresPermissions("gentest_carinfo_select")
@Override
public ResultVo<TestCarModel> get(TestCarModel model) {
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
return ResultVo.success(model);
}

@ -62,10 +62,7 @@ public class TestUserRestController extends BaseRestController<TestUser, TestUse
@RequiresPermissions("gentest_user_select")
@Override
public ResultVo<TestUserModel> get(TestUserModel model) {
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
return ResultVo.success(model);
}

@ -45,10 +45,7 @@ public class TestRestController extends BaseRestController<TestEntity, TestModel
@RequiresPermissions("gentest_test_select")
@Override
public ResultVo<TestModel> get(TestModel model) {
// 如果系统内部调用 则直接查数据库
if(model != null && model.getIzApi() != null && model.getIzApi()){
model = IService.get(model);
}
model = IService.get(model);
return ResultVo.success(model);
}

Loading…
Cancel
Save