1. 完善业务逻辑
2. 与kafka对接
This commit is contained in:
parent
3567a3f35b
commit
ef7276e465
4
pom.xml
4
pom.xml
@ -67,6 +67,10 @@
|
||||
<version>1.18.16</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.kafka</groupId>
|
||||
<artifactId>spring-kafka</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- wgink start -->
|
||||
<dependency>
|
||||
|
@ -2,15 +2,17 @@ package ink.wgink.gatewaymanage.controller.api.api;
|
||||
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.api.ApiDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.examine.ExamineDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.api.ApiVO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.examine.ExamineVO;
|
||||
import ink.wgink.gatewaymanage.service.api.IApiService;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.api.ApiDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.api.ApiVO;
|
||||
import ink.wgink.gatewaymanage.service.api.IApiService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -45,7 +47,7 @@ public class ApiController extends DefaultBaseController {
|
||||
|
||||
@ApiOperation(value = "删除接口", notes = "删除接口接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@DeleteMapping("remove/{ids}")
|
||||
@ -56,7 +58,7 @@ public class ApiController extends DefaultBaseController {
|
||||
|
||||
@ApiOperation(value = "修改接口", notes = "修改接口接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "apiId", value = "接口ID", paramType = "path")
|
||||
@ApiImplicitParam(name = "apiId", value = "接口ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("update/{apiId}")
|
||||
@ -66,13 +68,25 @@ public class ApiController extends DefaultBaseController {
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "审核接口", notes = "审核接口接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "apiId", value = "接口ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("update-examine/{apiId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult updateExamine(@PathVariable("apiId") String apiId, @RequestBody ExamineVO examineVO) {
|
||||
apiService.updateExamine(apiId, examineVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "接口详情", notes = "接口详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "apiId", value = "接口ID", paramType = "path")
|
||||
@ApiImplicitParam(name = "apiId", value = "接口ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/{apiId}")
|
||||
public ApiDTO get(@PathVariable("apiId") String apiId) {
|
||||
public ApiDTO get(@PathVariable("apiId") String apiId) {
|
||||
return apiService.get(apiId);
|
||||
}
|
||||
|
||||
@ -86,11 +100,11 @@ public class ApiController extends DefaultBaseController {
|
||||
|
||||
@ApiOperation(value = "接口分页列表", notes = "接口分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage")
|
||||
@ -108,4 +122,25 @@ public class ApiController extends DefaultBaseController {
|
||||
return new SuccessResultData<>(apiService.count(params));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取审核结果", notes = "获取审核结果接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "systemId", value = "系统ID", paramType = "path"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get-examine-result/{apiId}")
|
||||
public ExamineDTO getExamineResult(@PathVariable("apiId") String apiId) {
|
||||
return apiService.getExamineResult(apiId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "发布接口", notes = "发布接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "apiId", value = "接口ID", paramType = "path"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("publish/{apiId}")
|
||||
public SuccessResult publish(@PathVariable("apiId") String apiId) {
|
||||
apiService.publish(apiId);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package ink.wgink.gatewaymanage.controller.api.api.permission;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.exceptions.ParamsException;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.api.ApiDTO;
|
||||
import ink.wgink.gatewaymanage.service.api.permission.IApiPermissionService;
|
||||
import ink.wgink.gatewaymanage.service.claim.IClaimService;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: ApiController
|
||||
* @Description: api数据权限业务
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-08-16 14:50:40
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "接口数据权限接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.API_PREFIX + "/api/permission")
|
||||
public class ApiPermissionController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IApiPermissionService apiPermissionService;
|
||||
|
||||
@ApiOperation(value = "接口列表", notes = "接口列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<ApiDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return apiPermissionService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "接口分页列表", notes = "接口分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage")
|
||||
public SuccessResultList<List<ApiDTO>> listPage(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return apiPermissionService.listPage(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "接口认领分页列表", notes = "接口认领分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage-claim/{claimType}")
|
||||
public SuccessResultList<List<ApiDTO>> listPageClaim(@PathVariable("claimType") String claimType, ListPage page) {
|
||||
if (!StringUtils.equals(IClaimService.CLAIM_TYPE_ALL, claimType) &&
|
||||
!StringUtils.equals(IClaimService.CLAIM_TYPE_CLAIM, claimType) &&
|
||||
!StringUtils.equals(IClaimService.CLAIM_TYPE_UNCLAIMED, claimType)) {
|
||||
throw new ParamsException("认领类型只能是,all、claim和unclaimed");
|
||||
}
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return apiPermissionService.listPageClaim(claimType, page);
|
||||
}
|
||||
|
||||
}
|
@ -2,15 +2,16 @@ package ink.wgink.gatewaymanage.controller.api.claim;
|
||||
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.claim.ClaimDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.claim.ClaimVO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.examine.ExamineVO;
|
||||
import ink.wgink.gatewaymanage.service.claim.IClaimService;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.claim.ClaimDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.claim.ClaimVO;
|
||||
import ink.wgink.gatewaymanage.service.claim.IClaimService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -66,6 +67,18 @@ public class ClaimController extends DefaultBaseController {
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "审核接口认领", notes = "审核接口认领接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "apiId", value = "接口ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("update-examine/{claimId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult updateExamine(@PathVariable("claimId") String claimId, @RequestBody ExamineVO examineVO) {
|
||||
claimService.updateExamine(claimId, examineVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "接口认领详情", notes = "接口认领详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "claimId", value = "接口认领ID", paramType = "path")
|
||||
|
@ -0,0 +1,74 @@
|
||||
package ink.wgink.gatewaymanage.controller.api.claim.permission;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.claim.ClaimDTO;
|
||||
import ink.wgink.gatewaymanage.service.claim.permission.IClaimPermissionService;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: ClaimController
|
||||
* @Description: 接口认领
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-08-16 14:58:13
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "接口认领接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.API_PREFIX + "/claim/permission")
|
||||
public class ClaimPermissionController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IClaimPermissionService claimPermissionService;
|
||||
|
||||
@ApiOperation(value = "接口认领列表", notes = "接口认领列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<ClaimDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return claimPermissionService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "接口认领分页列表", notes = "接口认领分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage")
|
||||
public SuccessResultList<List<ClaimDTO>> listPage(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return claimPermissionService.listPage(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "接口认领审核分页列表", notes = "接口认领审核分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage-examine")
|
||||
public SuccessResultList<List<ClaimDTO>> listPageExamine(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return claimPermissionService.listPageExamine(page);
|
||||
}
|
||||
|
||||
}
|
@ -2,6 +2,8 @@ package ink.wgink.gatewaymanage.controller.api.system;
|
||||
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.examine.ExamineDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.examine.ExamineVO;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
@ -66,6 +68,18 @@ public class SystemController extends DefaultBaseController {
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "审核接口系统", notes = "审核接口系统接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "systemId", value = "接口系统ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("update-examine/{systemId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult updateExamine(@PathVariable("systemId") String systemId, @RequestBody ExamineVO examineVO) {
|
||||
systemService.updateExamine(systemId, examineVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "接口系统详情", notes = "接口系统详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "systemId", value = "接口系统ID", paramType = "path")
|
||||
@ -108,4 +122,14 @@ public class SystemController extends DefaultBaseController {
|
||||
return new SuccessResultData<>(systemService.count(params));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取审核结果", notes = "获取审核结果接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "systemId", value = "系统ID", paramType = "path"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get-examine-result/{systemId}")
|
||||
public ExamineDTO getExamineResult(@PathVariable("systemId") String systemId) {
|
||||
return systemService.getExamineResult(systemId);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package ink.wgink.gatewaymanage.controller.api.system.permission;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.system.SystemDTO;
|
||||
import ink.wgink.gatewaymanage.service.system.permission.ISystemPermissionService;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: SystemController
|
||||
* @Description: 接口系统数据权限
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-08-16 15:03:18
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "接口系统数据权限接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.API_PREFIX + "/system/permission")
|
||||
public class SystemPermissionController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private ISystemPermissionService systemPermissionService;
|
||||
|
||||
@ApiOperation(value = "接口系统列表", notes = "接口系统列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<SystemDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return systemPermissionService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "接口系统分页列表", notes = "接口系统分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage")
|
||||
public SuccessResultList<List<SystemDTO>> listPage(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return systemPermissionService.listPage(page);
|
||||
}
|
||||
|
||||
}
|
@ -5,8 +5,10 @@ import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.exceptions.UpdateException;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.api.ApiBO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.examine.ExamineDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.api.ApiPO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.api.ApiDTO;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@ -20,7 +22,7 @@ import java.util.Map;
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Repository
|
||||
public interface IApiDao {
|
||||
public interface IApiDao extends IInitBaseTable {
|
||||
|
||||
/**
|
||||
* 新增接口
|
||||
@ -54,6 +56,14 @@ public interface IApiDao {
|
||||
*/
|
||||
void update(Map<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 修改审核接口
|
||||
*
|
||||
* @param params
|
||||
* @throws UpdateException
|
||||
*/
|
||||
void updateExamine(Map<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 接口详情
|
||||
*
|
||||
@ -117,4 +127,12 @@ public interface IApiDao {
|
||||
*/
|
||||
Integer count(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 获取审核结果
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
ExamineDTO getExamineResult(Map<String, Object> params) throws SearchException;
|
||||
}
|
@ -5,8 +5,9 @@ import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.exceptions.UpdateException;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.claim.ClaimBO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.claim.ClaimPO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.claim.ClaimDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.claim.ClaimPO;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@ -20,7 +21,7 @@ import java.util.Map;
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Repository
|
||||
public interface IClaimDao {
|
||||
public interface IClaimDao extends IInitBaseTable {
|
||||
|
||||
/**
|
||||
* 新增接口认领
|
||||
@ -54,6 +55,14 @@ public interface IClaimDao {
|
||||
*/
|
||||
void update(Map<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 审核接口认领
|
||||
*
|
||||
* @param params
|
||||
* @throws UpdateException
|
||||
*/
|
||||
void updateExamine(Map<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 接口认领详情
|
||||
*
|
||||
|
@ -5,8 +5,9 @@ import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.exceptions.UpdateException;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.header.HeaderBO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.header.HeaderPO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.header.HeaderDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.header.HeaderPO;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@ -20,7 +21,7 @@ import java.util.Map;
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Repository
|
||||
public interface IHeaderDao {
|
||||
public interface IHeaderDao extends IInitBaseTable {
|
||||
|
||||
/**
|
||||
* 新增请求头
|
||||
|
@ -5,8 +5,9 @@ import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.exceptions.UpdateException;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.requestparams.RequestParamsBO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.requestparams.RequestParamsPO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.requestparams.RequestParamsDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.requestparams.RequestParamsPO;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@ -20,7 +21,7 @@ import java.util.Map;
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Repository
|
||||
public interface IRequestParamsDao {
|
||||
public interface IRequestParamsDao extends IInitBaseTable {
|
||||
|
||||
/**
|
||||
* 新增请求参数
|
||||
|
@ -5,8 +5,9 @@ import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.exceptions.UpdateException;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.responseparams.ResponseParamsBO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.responseparams.ResponseParamsPO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.responseparams.ResponseParamsDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.responseparams.ResponseParamsPO;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@ -20,7 +21,7 @@ import java.util.Map;
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Repository
|
||||
public interface IResponseParamsDao {
|
||||
public interface IResponseParamsDao extends IInitBaseTable {
|
||||
|
||||
/**
|
||||
* 新增响应参数
|
||||
|
@ -5,8 +5,10 @@ import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.exceptions.UpdateException;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.system.SystemBO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.system.SystemPO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.examine.ExamineDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.system.SystemDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.system.SystemPO;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@ -20,7 +22,7 @@ import java.util.Map;
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Repository
|
||||
public interface ISystemDao {
|
||||
public interface ISystemDao extends IInitBaseTable {
|
||||
|
||||
/**
|
||||
* 新增接口系统
|
||||
@ -54,6 +56,14 @@ public interface ISystemDao {
|
||||
*/
|
||||
void update(Map<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 修改接口系统审核状态
|
||||
*
|
||||
* @param params
|
||||
* @throws UpdateException
|
||||
*/
|
||||
void updateExamine(Map<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 接口系统详情
|
||||
*
|
||||
@ -117,4 +127,12 @@ public interface ISystemDao {
|
||||
*/
|
||||
Integer count(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 获取审核结果
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
ExamineDTO getExamineResult(Map<String, Object> params) throws SearchException;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package ink.wgink.gatewaymanage.enums;
|
||||
|
||||
/**
|
||||
* @ClassName: AuditStatusEnum
|
||||
* @Description: 审核状态
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/8/21 11:58 上午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public enum AuditStatusEnum {
|
||||
NONE("none", "未审核"),
|
||||
PASS("pass", "通过"),
|
||||
UN_PASS("unPass", "不通过");
|
||||
|
||||
private String value;
|
||||
private String summary;
|
||||
|
||||
AuditStatusEnum(String value, String summary) {
|
||||
this.value = value;
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value == null ? "" : value.trim();
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary == null ? "" : summary.trim();
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package ink.wgink.gatewaymanage.pojo.dtos.api;
|
||||
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.claim.ClaimDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@ -18,6 +19,8 @@ public class ApiDTO {
|
||||
private String apiId;
|
||||
@ApiModelProperty(name = "systemId", value = "系统ID")
|
||||
private String systemId;
|
||||
@ApiModelProperty(name = "systemName", value = "系统名称")
|
||||
private String systemName;
|
||||
@ApiModelProperty(name = "title", value = "标题")
|
||||
private String title;
|
||||
@ApiModelProperty(name = "summary", value = "说明")
|
||||
@ -54,6 +57,8 @@ public class ApiDTO {
|
||||
private String gmtCreate;
|
||||
@ApiModelProperty(name = "gmtModified", value = "修改时间")
|
||||
private String gmtModified;
|
||||
@ApiModelProperty(name = "claim", value = "认领情况")
|
||||
private ClaimDTO claim;
|
||||
|
||||
public String getApiId() {
|
||||
return apiId == null ? "" : apiId.trim();
|
||||
@ -71,6 +76,14 @@ public class ApiDTO {
|
||||
this.systemId = systemId;
|
||||
}
|
||||
|
||||
public String getSystemName() {
|
||||
return systemName == null ? "" : systemName.trim();
|
||||
}
|
||||
|
||||
public void setSystemName(String systemName) {
|
||||
this.systemName = systemName;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title == null ? "" : title.trim();
|
||||
}
|
||||
@ -215,5 +228,11 @@ public class ApiDTO {
|
||||
this.gmtModified = gmtModified;
|
||||
}
|
||||
|
||||
public ClaimDTO getClaim() {
|
||||
return claim == null ? new ClaimDTO() : claim;
|
||||
}
|
||||
|
||||
public void setClaim(ClaimDTO claim) {
|
||||
this.claim = claim;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,11 @@
|
||||
package ink.wgink.gatewaymanage.pojo.dtos.claim;
|
||||
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.api.ApiDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.system.SystemDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -11,6 +15,8 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
* @Date: 2021-08-16 14:58:13
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Data
|
||||
@ToString
|
||||
@ApiModel
|
||||
public class ClaimDTO {
|
||||
|
||||
@ -32,6 +38,10 @@ public class ClaimDTO {
|
||||
private String auditReason;
|
||||
@ApiModelProperty(name = "gmtCreate", value = "创建时间")
|
||||
private String gmtCreate;
|
||||
@ApiModelProperty(name = "system", value = "api系统")
|
||||
private SystemDTO system;
|
||||
@ApiModelProperty(name = "api", value = "接口")
|
||||
private ApiDTO api;
|
||||
|
||||
public String getClaimId() {
|
||||
return claimId == null ? "" : claimId.trim();
|
||||
@ -105,5 +115,19 @@ public class ClaimDTO {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public SystemDTO getSystem() {
|
||||
return system;
|
||||
}
|
||||
|
||||
public void setSystem(SystemDTO system) {
|
||||
this.system = system;
|
||||
}
|
||||
|
||||
public ApiDTO getApi() {
|
||||
return api;
|
||||
}
|
||||
|
||||
public void setApi(ApiDTO api) {
|
||||
this.api = api;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
package ink.wgink.gatewaymanage.pojo.dtos.examine;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @ClassName: ExamineDTO
|
||||
* @Description: 审核
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/8/21 9:06 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@ApiModel
|
||||
public class ExamineDTO {
|
||||
|
||||
@ApiModelProperty(name = "auditStatus", value = "审核状态")
|
||||
private String auditStatus;
|
||||
@ApiModelProperty(name = "auditTime", value = "审核时间")
|
||||
private String auditTime;
|
||||
@ApiModelProperty(name = "auditor", value = "审核人")
|
||||
private String auditor;
|
||||
@ApiModelProperty(name = "auditReason", value = "审核原因")
|
||||
private String auditReason;
|
||||
|
||||
}
|
@ -1,12 +1,10 @@
|
||||
package ink.wgink.gatewaymanage.pojo.vos.claim;
|
||||
|
||||
import ink.wgink.annotation.CheckEmptyAnnotation;
|
||||
import ink.wgink.annotation.CheckNumberAnnotation;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ClassName: ClaimVO
|
||||
* @Description: 接口认领
|
||||
* @Author: CodeFactory
|
||||
@ -17,8 +15,10 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
public class ClaimVO {
|
||||
|
||||
@ApiModelProperty(name = "systemId", value = "系统ID")
|
||||
@CheckEmptyAnnotation(name = "系统ID")
|
||||
private String systemId;
|
||||
@ApiModelProperty(name = "apiId", value = "APIID")
|
||||
@CheckEmptyAnnotation(name = "APIID")
|
||||
private String apiId;
|
||||
|
||||
public String getSystemId() {
|
||||
|
@ -0,0 +1,29 @@
|
||||
package ink.wgink.gatewaymanage.pojo.vos.examine;
|
||||
|
||||
import ink.wgink.annotation.CheckEmptyAnnotation;
|
||||
import ink.wgink.annotation.CheckNumberAnnotation;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @ClassName: ExamineVO
|
||||
* @Description: 审核
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/8/21 11:53 上午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@ApiModel
|
||||
public class ExamineVO {
|
||||
|
||||
@ApiModelProperty(name = "isPass", value = "是否通过")
|
||||
@CheckNumberAnnotation(name = "是否通过", types = {"0", "1"})
|
||||
private Integer isPass;
|
||||
@ApiModelProperty(name = "reason", value = "说明")
|
||||
@CheckEmptyAnnotation(name = "说明")
|
||||
private String reason;
|
||||
|
||||
}
|
@ -1,11 +1,13 @@
|
||||
package ink.wgink.gatewaymanage.service.api;
|
||||
|
||||
import ink.wgink.gatewaymanage.pojo.bos.api.ApiBO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.api.ApiDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.examine.ExamineDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.api.ApiPO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.api.ApiVO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.examine.ExamineVO;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.api.ApiDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.api.ApiVO;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.api.ApiBO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.api.ApiPO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -66,11 +68,18 @@ public interface IApiService {
|
||||
* 删除接口
|
||||
*
|
||||
* @param token
|
||||
* @param ids id列表
|
||||
* @param ids id列表
|
||||
* @return
|
||||
*/
|
||||
void remove(String token, List<String> ids);
|
||||
|
||||
/**
|
||||
* 删除接口
|
||||
*
|
||||
* @param systemIds 系统ID列表
|
||||
*/
|
||||
void removeBySystemIds(List<String> systemIds);
|
||||
|
||||
/**
|
||||
* 删除接口(物理删除)
|
||||
*
|
||||
@ -78,6 +87,13 @@ public interface IApiService {
|
||||
*/
|
||||
void delete(List<String> ids);
|
||||
|
||||
/**
|
||||
* 删除接口(物理删除)
|
||||
*
|
||||
* @param systemIds
|
||||
*/
|
||||
void deleteBySystemIds(List<String> systemIds);
|
||||
|
||||
/**
|
||||
* 修改接口
|
||||
*
|
||||
@ -97,6 +113,14 @@ public interface IApiService {
|
||||
*/
|
||||
void update(String token, String apiId, ApiVO apiVO);
|
||||
|
||||
/**
|
||||
* 审核接口
|
||||
*
|
||||
* @param apiId
|
||||
* @param examineVO
|
||||
*/
|
||||
void updateExamine(String apiId, ExamineVO examineVO);
|
||||
|
||||
/**
|
||||
* 接口详情
|
||||
*
|
||||
@ -145,6 +169,14 @@ public interface IApiService {
|
||||
*/
|
||||
ApiPO getPO(String apiId);
|
||||
|
||||
/**
|
||||
* 接口列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<ApiDTO> list(List<String> apiIds);
|
||||
|
||||
/**
|
||||
* 接口列表
|
||||
*
|
||||
@ -161,6 +193,14 @@ public interface IApiService {
|
||||
*/
|
||||
List<ApiBO> listBO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 接口列表
|
||||
*
|
||||
* @param apiIds
|
||||
* @return
|
||||
*/
|
||||
List<ApiPO> listPO(List<String> apiIds);
|
||||
|
||||
/**
|
||||
* 接口列表
|
||||
*
|
||||
@ -185,4 +225,18 @@ public interface IApiService {
|
||||
*/
|
||||
Integer count(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 获取审核结果
|
||||
*
|
||||
* @param apiId
|
||||
* @return
|
||||
*/
|
||||
ExamineDTO getExamineResult(String apiId);
|
||||
|
||||
/**
|
||||
* 发布接口
|
||||
*
|
||||
* @param apiId
|
||||
*/
|
||||
void publish(String apiId);
|
||||
}
|
@ -1,21 +1,30 @@
|
||||
package ink.wgink.gatewaymanage.service.api.impl;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.map.HashMapUtil;
|
||||
import ink.wgink.util.UUIDUtil;
|
||||
import ink.wgink.gatewaymanage.dao.api.IApiDao;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.api.ApiDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.api.ApiVO;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.api.ApiBO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.api.ApiPO;
|
||||
import ink.wgink.gatewaymanage.service.api.IApiService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.gatewaymanage.dao.api.IApiDao;
|
||||
import ink.wgink.gatewaymanage.enums.AuditStatusEnum;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.api.ApiBO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.api.ApiDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.examine.ExamineDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.system.SystemDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.api.ApiPO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.system.SystemPO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.api.ApiVO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.examine.ExamineVO;
|
||||
import ink.wgink.gatewaymanage.service.api.IApiService;
|
||||
import ink.wgink.gatewaymanage.service.system.ISystemService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.UUIDUtil;
|
||||
import ink.wgink.util.date.DateUtil;
|
||||
import ink.wgink.util.map.HashMapUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.kafka.core.KafkaTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
@ -32,6 +41,10 @@ public class ApiServiceImpl extends DefaultBaseService implements IApiService {
|
||||
|
||||
@Autowired
|
||||
private IApiDao apiDao;
|
||||
@Autowired
|
||||
private ISystemService systemService;
|
||||
@Autowired
|
||||
private KafkaTemplate<String, Object> kafkaTemplate;
|
||||
|
||||
@Override
|
||||
public void save(ApiVO apiVO) {
|
||||
@ -79,6 +92,14 @@ public class ApiServiceImpl extends DefaultBaseService implements IApiService {
|
||||
apiDao.remove(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBySystemIds(List<String> systemIds) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("systemIds", systemIds);
|
||||
setUpdateInfo(params);
|
||||
apiDao.remove(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(List<String> ids) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
@ -86,6 +107,13 @@ public class ApiServiceImpl extends DefaultBaseService implements IApiService {
|
||||
apiDao.delete(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBySystemIds(List<String> systemIds) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("systemIds", systemIds);
|
||||
apiDao.delete(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(String apiId, ApiVO apiVO) {
|
||||
update(null, apiId, apiVO);
|
||||
@ -103,6 +131,17 @@ public class ApiServiceImpl extends DefaultBaseService implements IApiService {
|
||||
apiDao.update(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExamine(String apiId, ExamineVO examineVO) {
|
||||
Map<String, Object> params = getHashMap(10);
|
||||
params.put("apiId", apiId);
|
||||
params.put("auditStatus", examineVO.getIsPass() == 1 ? AuditStatusEnum.PASS.getValue() : AuditStatusEnum.UN_PASS.getValue());
|
||||
params.put("auditTime", DateUtil.getTime());
|
||||
params.put("auditor", securityComponent.getCurrentUser().getUserId());
|
||||
params.put("auditReason", examineVO.getReason());
|
||||
apiDao.updateExamine(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiDTO get(Map<String, Object> params) {
|
||||
return apiDao.get(params);
|
||||
@ -139,9 +178,19 @@ public class ApiServiceImpl extends DefaultBaseService implements IApiService {
|
||||
return getPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApiDTO> list(List<String> apiIds) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("apiIds", apiIds);
|
||||
return list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApiDTO> list(Map<String, Object> params) {
|
||||
return apiDao.list(params);
|
||||
List<ApiDTO> apiDTOs = apiDao.list(params);
|
||||
setSystemInfos(apiDTOs);
|
||||
setAuditor(apiDTOs);
|
||||
return apiDTOs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -149,6 +198,13 @@ public class ApiServiceImpl extends DefaultBaseService implements IApiService {
|
||||
return apiDao.listBO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApiPO> listPO(List<String> apiIds) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("apiIds", apiIds);
|
||||
return listPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApiPO> listPO(Map<String, Object> params) {
|
||||
return apiDao.listPO(params);
|
||||
@ -168,4 +224,78 @@ public class ApiServiceImpl extends DefaultBaseService implements IApiService {
|
||||
return count == null ? 0 : count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExamineDTO getExamineResult(String apiId) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("apiId", apiId);
|
||||
return apiDao.getExamineResult(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void publish(String apiId) {
|
||||
ApiPO apiPO = getPO(apiId);
|
||||
if (!StringUtils.equals(apiPO.getAuditStatus(), AuditStatusEnum.PASS.getValue())) {
|
||||
throw new SearchException("接口未审核通过");
|
||||
}
|
||||
if (apiPO.getIsPublish() == 0) {
|
||||
throw new SearchException("接口未发布");
|
||||
}
|
||||
SystemPO systemPO = systemService.getPO(apiPO.getSystemId());
|
||||
if (!StringUtils.equals(systemPO.getAuditStatus(), AuditStatusEnum.PASS.getValue())) {
|
||||
throw new SearchException("系统未审核通过");
|
||||
}
|
||||
JSONObject apiObj = new JSONObject();
|
||||
apiObj.put("system", systemPO);
|
||||
apiObj.put("api", apiPO);
|
||||
kafkaTemplate.send("apiPublish", apiObj.toJSONString()).addCallback(success -> {
|
||||
// 消息发送到的topic
|
||||
String topic = success.getRecordMetadata().topic();
|
||||
// 消息发送到的分区
|
||||
int partition = success.getRecordMetadata().partition();
|
||||
// 消息在分区内的offset
|
||||
long offset = success.getRecordMetadata().offset();
|
||||
System.out.println("发送消息成功:" + topic + "-" + partition + "-" + offset);
|
||||
}, failure -> {
|
||||
System.out.println("发送消息失败:" + failure.getMessage());
|
||||
});
|
||||
}
|
||||
|
||||
private void setSystemInfos(List<ApiDTO> apiDTOs) {
|
||||
if (apiDTOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Set<String> systemIds = new HashSet<>();
|
||||
for (ApiDTO apiDTO : apiDTOs) {
|
||||
systemIds.add(apiDTO.getSystemId());
|
||||
}
|
||||
List<SystemDTO> systemDTOs = systemService.list(new ArrayList<>(systemIds));
|
||||
for (ApiDTO apiDTO : apiDTOs) {
|
||||
for (SystemDTO systemDTO : systemDTOs) {
|
||||
if (StringUtils.equals(apiDTO.getSystemId(), systemDTO.getSystemId())) {
|
||||
apiDTO.setSystemName(systemDTO.getName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置审核人
|
||||
*
|
||||
* @param apiDTOs
|
||||
*/
|
||||
private void setAuditor(List<ApiDTO> apiDTOs) {
|
||||
if (apiDTOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (ApiDTO apiDTO : apiDTOs) {
|
||||
if (StringUtils.isBlank(apiDTO.getAuditor())) {
|
||||
continue;
|
||||
}
|
||||
if (StringUtils.equals(apiDTO.getAuditor(), "1")) {
|
||||
apiDTO.setAuditor("管理员");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package ink.wgink.gatewaymanage.service.api.permission;
|
||||
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.api.ApiDTO;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: IApiPermissionService
|
||||
* @Description: api数据权限业务
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/8/21 10:14 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public interface IApiPermissionService {
|
||||
|
||||
/**
|
||||
* 接口列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<ApiDTO> list(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 接口分页列表
|
||||
*
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<ApiDTO>> listPage(ListPage page);
|
||||
|
||||
/**
|
||||
* 接口认领情况列表
|
||||
*
|
||||
* @param claimType
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<ApiDTO>> listPageClaim(String claimType, ListPage page);
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package ink.wgink.gatewaymanage.service.api.permission.impl;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.api.ApiDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.claim.ClaimDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.claim.ClaimPO;
|
||||
import ink.wgink.gatewaymanage.service.api.IApiService;
|
||||
import ink.wgink.gatewaymanage.service.api.permission.IApiPermissionService;
|
||||
import ink.wgink.gatewaymanage.service.claim.IClaimService;
|
||||
import ink.wgink.gatewaymanage.service.claim.permission.IClaimPermissionService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @ClassName: ApiPermissionServiceImpl
|
||||
* @Description: api数据权限业务
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/8/21 10:14 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Service
|
||||
public class ApiPermissionServiceImpl extends DefaultBaseService implements IApiPermissionService {
|
||||
|
||||
@Autowired
|
||||
private IApiService apiService;
|
||||
@Autowired
|
||||
private IClaimService claimService;
|
||||
@Autowired
|
||||
private IClaimPermissionService claimPermissionService;
|
||||
|
||||
@Override
|
||||
public List<ApiDTO> list(Map<String, Object> params) {
|
||||
params.put("creator", securityComponent.getCurrentUser().getUserId());
|
||||
return apiService.list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<ApiDTO>> listPage(ListPage page) {
|
||||
page.getParams().put("creator", securityComponent.getCurrentUser().getUserId());
|
||||
return apiService.listPage(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<ApiDTO>> listPageClaim(String claimType, ListPage page) {
|
||||
// 我的认领列表
|
||||
List<ClaimPO> claimPOs = claimPermissionService.listPO();
|
||||
Set<String> apiIds = new HashSet<>();
|
||||
for (ClaimPO claimPO : claimPOs) {
|
||||
apiIds.add(claimPO.getApiId());
|
||||
}
|
||||
if (StringUtils.equals(IClaimService.CLAIM_TYPE_CLAIM, claimType)) {
|
||||
if (claimPOs.isEmpty()) {
|
||||
return new SuccessResultList<List<ApiDTO>>(new ArrayList<>(), 1, 0L);
|
||||
}
|
||||
page.getParams().put("claimApiIds", new ArrayList<>(apiIds));
|
||||
} else if (StringUtils.equals(IClaimService.CLAIM_TYPE_UNCLAIMED, claimType)) {
|
||||
page.getParams().put("unclaimedApiIds", new ArrayList<>(apiIds));
|
||||
}
|
||||
page.getParams().put("auditStatus", "pass");
|
||||
SuccessResultList<List<ApiDTO>> listSuccessResultList = apiService.listPage(page);
|
||||
List<ClaimDTO> claimDTOs = new ArrayList<>();
|
||||
for (ApiDTO apiDTO : listSuccessResultList.getRows()) {
|
||||
for (ClaimPO claimPO : claimPOs) {
|
||||
if (StringUtils.equals(apiDTO.getApiId(), claimPO.getApiId())) {
|
||||
ClaimDTO claimDTO = new ClaimDTO();
|
||||
BeanUtils.copyProperties(claimPO, claimDTO);
|
||||
apiDTO.setClaim(claimDTO);
|
||||
claimDTOs.add(claimDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
claimService.setAuditor(claimDTOs);
|
||||
return listSuccessResultList;
|
||||
}
|
||||
}
|
@ -1,11 +1,12 @@
|
||||
package ink.wgink.gatewaymanage.service.claim;
|
||||
|
||||
import ink.wgink.gatewaymanage.pojo.bos.claim.ClaimBO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.claim.ClaimDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.claim.ClaimPO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.claim.ClaimVO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.examine.ExamineVO;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.claim.ClaimDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.claim.ClaimVO;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.claim.ClaimBO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.claim.ClaimPO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -19,6 +20,19 @@ import java.util.Map;
|
||||
**/
|
||||
public interface IClaimService {
|
||||
|
||||
/**
|
||||
* 已认领
|
||||
*/
|
||||
String CLAIM_TYPE_CLAIM = "claim";
|
||||
/**
|
||||
* 未认领
|
||||
*/
|
||||
String CLAIM_TYPE_UNCLAIMED = "unclaimed";
|
||||
/**
|
||||
* 全部
|
||||
*/
|
||||
String CLAIM_TYPE_ALL = "all";
|
||||
|
||||
/**
|
||||
* 新增接口认领
|
||||
*
|
||||
@ -66,7 +80,7 @@ public interface IClaimService {
|
||||
* 删除接口认领
|
||||
*
|
||||
* @param token
|
||||
* @param ids id列表
|
||||
* @param ids id列表
|
||||
* @return
|
||||
*/
|
||||
void remove(String token, List<String> ids);
|
||||
@ -97,6 +111,14 @@ public interface IClaimService {
|
||||
*/
|
||||
void update(String token, String claimId, ClaimVO claimVO);
|
||||
|
||||
/**
|
||||
* 审核接口认领
|
||||
*
|
||||
* @param claimId
|
||||
* @param examineVO
|
||||
*/
|
||||
void updateExamine(String claimId, ExamineVO examineVO);
|
||||
|
||||
/**
|
||||
* 接口认领详情
|
||||
*
|
||||
@ -185,4 +207,10 @@ public interface IClaimService {
|
||||
*/
|
||||
Integer count(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 设置审核人
|
||||
*
|
||||
* @param claimDTOs
|
||||
*/
|
||||
void setAuditor(List<ClaimDTO> claimDTOs);
|
||||
}
|
@ -1,20 +1,29 @@
|
||||
package ink.wgink.gatewaymanage.service.claim.impl;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.map.HashMapUtil;
|
||||
import ink.wgink.util.UUIDUtil;
|
||||
import ink.wgink.gatewaymanage.dao.claim.IClaimDao;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.claim.ClaimDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.claim.ClaimVO;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.claim.ClaimBO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.claim.ClaimPO;
|
||||
import ink.wgink.gatewaymanage.service.claim.IClaimService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.gatewaymanage.dao.claim.IClaimDao;
|
||||
import ink.wgink.gatewaymanage.enums.AuditStatusEnum;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.claim.ClaimBO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.api.ApiDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.claim.ClaimDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.system.SystemDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.api.ApiPO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.claim.ClaimPO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.system.SystemPO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.claim.ClaimVO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.examine.ExamineVO;
|
||||
import ink.wgink.gatewaymanage.service.api.IApiService;
|
||||
import ink.wgink.gatewaymanage.service.claim.IClaimService;
|
||||
import ink.wgink.gatewaymanage.service.system.ISystemService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.UUIDUtil;
|
||||
import ink.wgink.util.date.DateUtil;
|
||||
import ink.wgink.util.map.HashMapUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -32,6 +41,10 @@ public class ClaimServiceImpl extends DefaultBaseService implements IClaimServic
|
||||
|
||||
@Autowired
|
||||
private IClaimDao claimDao;
|
||||
@Autowired
|
||||
private ISystemService systemService;
|
||||
@Autowired
|
||||
private IApiService apiService;
|
||||
|
||||
@Override
|
||||
public void save(ClaimVO claimVO) {
|
||||
@ -53,11 +66,9 @@ public class ClaimServiceImpl extends DefaultBaseService implements IClaimServic
|
||||
String claimId = UUIDUtil.getUUID();
|
||||
Map<String, Object> params = HashMapUtil.beanToMap(claimVO);
|
||||
params.put("claimId", claimId);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
setSaveInfo(params);
|
||||
} else {
|
||||
setAppSaveInfo(token, params);
|
||||
}
|
||||
params.put("userId", securityComponent.getCurrentUser().getUserId());
|
||||
params.put("auditStatus", "none");
|
||||
params.put("gmtCreate", DateUtil.getTime());
|
||||
claimDao.save(params);
|
||||
return claimId;
|
||||
}
|
||||
@ -103,6 +114,17 @@ public class ClaimServiceImpl extends DefaultBaseService implements IClaimServic
|
||||
claimDao.update(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExamine(String claimId, ExamineVO examineVO) {
|
||||
Map<String, Object> params = getHashMap(10);
|
||||
params.put("claimId", claimId);
|
||||
params.put("auditStatus", examineVO.getIsPass() == 1 ? AuditStatusEnum.PASS.getValue() : AuditStatusEnum.UN_PASS.getValue());
|
||||
params.put("auditTime", DateUtil.getTime());
|
||||
params.put("auditor", securityComponent.getCurrentUser().getUserId());
|
||||
params.put("auditReason", examineVO.getReason());
|
||||
claimDao.updateExamine(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClaimDTO get(Map<String, Object> params) {
|
||||
return claimDao.get(params);
|
||||
@ -141,7 +163,10 @@ public class ClaimServiceImpl extends DefaultBaseService implements IClaimServic
|
||||
|
||||
@Override
|
||||
public List<ClaimDTO> list(Map<String, Object> params) {
|
||||
return claimDao.list(params);
|
||||
List<ClaimDTO> claimDTOs = claimDao.list(params);
|
||||
setSystemApiInfo(claimDTOs);
|
||||
setAuditor(claimDTOs);
|
||||
return claimDTOs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -168,4 +193,58 @@ public class ClaimServiceImpl extends DefaultBaseService implements IClaimServic
|
||||
return count == null ? 0 : count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAuditor(List<ClaimDTO> claimDTOs) {
|
||||
if (claimDTOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (ClaimDTO claimDTO : claimDTOs) {
|
||||
if (StringUtils.isBlank(claimDTO.getAuditor())) {
|
||||
continue;
|
||||
}
|
||||
if (StringUtils.equals(claimDTO.getAuditor(), "1")) {
|
||||
claimDTO.setAuditor("管理员");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置系统和API
|
||||
*
|
||||
* @param claimDTOs
|
||||
*/
|
||||
private void setSystemApiInfo(List<ClaimDTO> claimDTOs) {
|
||||
if (claimDTOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Set<String> systemIdSet = new HashSet<>();
|
||||
Set<String> apiSet = new HashSet<>();
|
||||
for (ClaimDTO claimDTO : claimDTOs) {
|
||||
systemIdSet.add(claimDTO.getSystemId());
|
||||
systemIdSet.add(claimDTO.getApiId());
|
||||
}
|
||||
|
||||
List<SystemPO> systemPOs = systemService.listPO(new ArrayList<>(systemIdSet));
|
||||
List<ApiPO> apiPOs = apiService.listPO(new ArrayList<>(apiSet));
|
||||
|
||||
for (ClaimDTO claimDTO : claimDTOs) {
|
||||
for (SystemPO systemPO : systemPOs) {
|
||||
if (StringUtils.equals(claimDTO.getSystemId(), systemPO.getSystemId())) {
|
||||
SystemDTO systemDTO = new SystemDTO();
|
||||
BeanUtils.copyProperties(systemPO, systemDTO);
|
||||
claimDTO.setSystem(systemDTO);
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (ApiPO apiPO : apiPOs) {
|
||||
if (StringUtils.equals(claimDTO.getApiId(), apiPO.getApiId())) {
|
||||
ApiDTO apiDTO = new ApiDTO();
|
||||
BeanUtils.copyProperties(apiPO, apiDTO);
|
||||
claimDTO.setApi(apiDTO);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package ink.wgink.gatewaymanage.service.claim.permission;
|
||||
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.claim.ClaimDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.claim.ClaimPO;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: IClaimPermissionService
|
||||
* @Description: 接口认领数据权限业务
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/8/21 11:36 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public interface IClaimPermissionService {
|
||||
|
||||
/**
|
||||
* 接口认领列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ClaimDTO> list();
|
||||
|
||||
/**
|
||||
* 接口认领列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<ClaimDTO> list(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 接口认领列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ClaimPO> listPO();
|
||||
|
||||
/**
|
||||
* 接口认领列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<ClaimPO> listPO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 接口认领分页列表
|
||||
*
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<ClaimDTO>> listPage(ListPage page);
|
||||
|
||||
/**
|
||||
* 接口认领审核分页列表
|
||||
*
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<ClaimDTO>> listPageExamine(ListPage page);
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package ink.wgink.gatewaymanage.service.claim.permission.impl;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.claim.ClaimDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.claim.ClaimPO;
|
||||
import ink.wgink.gatewaymanage.service.claim.IClaimService;
|
||||
import ink.wgink.gatewaymanage.service.claim.permission.IClaimPermissionService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: ClaimPermissionServiceImpl
|
||||
* @Description: 接口认领数据权限服务
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/8/21 11:36 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Service
|
||||
public class ClaimPermissionServiceImpl extends DefaultBaseService implements IClaimPermissionService {
|
||||
|
||||
@Autowired
|
||||
private IClaimService claimService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<ClaimDTO> list() {
|
||||
return list(getHashMap(2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ClaimDTO> list(Map<String, Object> params) {
|
||||
params.put("userId", securityComponent.getCurrentUser().getUserId());
|
||||
return claimService.list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ClaimPO> listPO() {
|
||||
return listPO(getHashMap(2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ClaimPO> listPO(Map<String, Object> params) {
|
||||
params.put("userId", securityComponent.getCurrentUser().getUserId());
|
||||
return claimService.listPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<ClaimDTO>> listPage(ListPage page) {
|
||||
page.getParams().put("userId", securityComponent.getCurrentUser().getUserId());
|
||||
return claimService.listPage(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<ClaimDTO>> listPageExamine(ListPage page) {
|
||||
return claimService.listPage(page);
|
||||
}
|
||||
}
|
@ -1,11 +1,13 @@
|
||||
package ink.wgink.gatewaymanage.service.system;
|
||||
|
||||
import ink.wgink.gatewaymanage.pojo.bos.system.SystemBO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.examine.ExamineDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.system.SystemDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.system.SystemPO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.examine.ExamineVO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.system.SystemVO;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.system.SystemDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.system.SystemVO;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.system.SystemBO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.system.SystemPO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -66,7 +68,7 @@ public interface ISystemService {
|
||||
* 删除接口系统
|
||||
*
|
||||
* @param token
|
||||
* @param ids id列表
|
||||
* @param ids id列表
|
||||
* @return
|
||||
*/
|
||||
void remove(String token, List<String> ids);
|
||||
@ -97,6 +99,13 @@ public interface ISystemService {
|
||||
*/
|
||||
void update(String token, String systemId, SystemVO systemVO);
|
||||
|
||||
/**
|
||||
* 审核接口系统
|
||||
* @param systemId
|
||||
* @param examineVO
|
||||
*/
|
||||
void updateExamine(String systemId, ExamineVO examineVO);
|
||||
|
||||
/**
|
||||
* 接口系统详情
|
||||
*
|
||||
@ -153,6 +162,14 @@ public interface ISystemService {
|
||||
*/
|
||||
List<SystemDTO> list(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 接口系统列表
|
||||
*
|
||||
* @param systemIds 系统ID列表
|
||||
* @return
|
||||
*/
|
||||
List<SystemDTO> list(List<String> systemIds);
|
||||
|
||||
/**
|
||||
* 接口系统列表
|
||||
*
|
||||
@ -161,6 +178,14 @@ public interface ISystemService {
|
||||
*/
|
||||
List<SystemBO> listBO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 接口系统列表
|
||||
*
|
||||
* @param systemIds
|
||||
* @return
|
||||
*/
|
||||
List<SystemPO> listPO(List<String> systemIds);
|
||||
|
||||
/**
|
||||
* 接口系统列表
|
||||
*
|
||||
@ -185,4 +210,11 @@ public interface ISystemService {
|
||||
*/
|
||||
Integer count(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 获取审核结果
|
||||
*
|
||||
* @param systemId
|
||||
* @return
|
||||
*/
|
||||
ExamineDTO getExamineResult(String systemId);
|
||||
}
|
@ -1,24 +1,29 @@
|
||||
package ink.wgink.gatewaymanage.service.system.impl;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.map.HashMapUtil;
|
||||
import ink.wgink.util.UUIDUtil;
|
||||
import ink.wgink.gatewaymanage.dao.system.ISystemDao;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.system.SystemDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.system.SystemVO;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.system.SystemBO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.system.SystemPO;
|
||||
import ink.wgink.gatewaymanage.service.system.ISystemService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.gatewaymanage.dao.system.ISystemDao;
|
||||
import ink.wgink.gatewaymanage.enums.AuditStatusEnum;
|
||||
import ink.wgink.gatewaymanage.pojo.bos.system.SystemBO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.examine.ExamineDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.system.SystemDTO;
|
||||
import ink.wgink.gatewaymanage.pojo.pos.system.SystemPO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.examine.ExamineVO;
|
||||
import ink.wgink.gatewaymanage.pojo.vos.system.SystemVO;
|
||||
import ink.wgink.gatewaymanage.service.api.IApiService;
|
||||
import ink.wgink.gatewaymanage.service.system.ISystemService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.UUIDUtil;
|
||||
import ink.wgink.util.date.DateUtil;
|
||||
import ink.wgink.util.map.HashMapUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: SystemServiceImpl
|
||||
@ -32,6 +37,8 @@ public class SystemServiceImpl extends DefaultBaseService implements ISystemServ
|
||||
|
||||
@Autowired
|
||||
private ISystemDao systemDao;
|
||||
@Autowired
|
||||
private IApiService apiService;
|
||||
|
||||
@Override
|
||||
public void save(SystemVO systemVO) {
|
||||
@ -77,6 +84,7 @@ public class SystemServiceImpl extends DefaultBaseService implements ISystemServ
|
||||
setAppUpdateInfo(token, params);
|
||||
}
|
||||
systemDao.remove(params);
|
||||
removeDependency(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -84,6 +92,7 @@ public class SystemServiceImpl extends DefaultBaseService implements ISystemServ
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("systemIds", ids);
|
||||
systemDao.delete(params);
|
||||
deleteDependency(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -103,6 +112,17 @@ public class SystemServiceImpl extends DefaultBaseService implements ISystemServ
|
||||
systemDao.update(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExamine(String systemId, ExamineVO examineVO) {
|
||||
Map<String, Object> params = getHashMap(10);
|
||||
params.put("systemId", systemId);
|
||||
params.put("auditStatus", examineVO.getIsPass() == 1 ? AuditStatusEnum.PASS.getValue() : AuditStatusEnum.UN_PASS.getValue());
|
||||
params.put("auditTime", DateUtil.getTime());
|
||||
params.put("auditor", securityComponent.getCurrentUser().getUserId());
|
||||
params.put("auditReason", examineVO.getReason());
|
||||
systemDao.updateExamine(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SystemDTO get(Map<String, Object> params) {
|
||||
return systemDao.get(params);
|
||||
@ -141,7 +161,16 @@ public class SystemServiceImpl extends DefaultBaseService implements ISystemServ
|
||||
|
||||
@Override
|
||||
public List<SystemDTO> list(Map<String, Object> params) {
|
||||
return systemDao.list(params);
|
||||
List<SystemDTO> systemDTOs = systemDao.list(params);
|
||||
setAuditor(systemDTOs);
|
||||
return systemDTOs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SystemDTO> list(List<String> systemIds) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("systemIds", systemIds);
|
||||
return list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -149,6 +178,13 @@ public class SystemServiceImpl extends DefaultBaseService implements ISystemServ
|
||||
return systemDao.listBO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SystemPO> listPO(List<String> systemIds) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("systemIds", systemIds);
|
||||
return listPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SystemPO> listPO(Map<String, Object> params) {
|
||||
return systemDao.listPO(params);
|
||||
@ -168,4 +204,54 @@ public class SystemServiceImpl extends DefaultBaseService implements ISystemServ
|
||||
return count == null ? 0 : count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExamineDTO getExamineResult(String systemId) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("systemId", systemId);
|
||||
return systemDao.getExamineResult(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除依赖
|
||||
*
|
||||
* @param systemIds
|
||||
*/
|
||||
private void removeDependency(List<String> systemIds) {
|
||||
if (systemIds.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
apiService.removeBySystemIds(systemIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除依赖
|
||||
*
|
||||
* @param systemIds
|
||||
*/
|
||||
private void deleteDependency(List<String> systemIds) {
|
||||
if (systemIds.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
apiService.deleteBySystemIds(systemIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置审核人
|
||||
*
|
||||
* @param systemDTOs
|
||||
*/
|
||||
private void setAuditor(List<SystemDTO> systemDTOs) {
|
||||
if (systemDTOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (SystemDTO systemDTO : systemDTOs) {
|
||||
if (StringUtils.isBlank(systemDTO.getAuditor())) {
|
||||
continue;
|
||||
}
|
||||
if (StringUtils.equals(systemDTO.getAuditor(), "1")) {
|
||||
systemDTO.setAuditor("管理员");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package ink.wgink.gatewaymanage.service.system.permission;
|
||||
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.system.SystemDTO;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: ISystemPermissionService
|
||||
* @Description: api系统数据权限业务
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/8/21 10:17 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public interface ISystemPermissionService {
|
||||
|
||||
/**
|
||||
* 接口系统列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<SystemDTO> list(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 接口系统分页列表
|
||||
*
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<SystemDTO>> listPage(ListPage page);
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package ink.wgink.gatewaymanage.service.system.permission.impl;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.gatewaymanage.pojo.dtos.system.SystemDTO;
|
||||
import ink.wgink.gatewaymanage.service.system.ISystemService;
|
||||
import ink.wgink.gatewaymanage.service.system.permission.ISystemPermissionService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: SystemPermissionServiceImpl
|
||||
* @Description: api系统数据权限业务
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/8/21 10:18 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Service
|
||||
public class SystemPermissionServiceImpl extends DefaultBaseService implements ISystemPermissionService {
|
||||
|
||||
@Autowired
|
||||
private ISystemService systemService;
|
||||
|
||||
@Override
|
||||
public List<SystemDTO> list(Map<String, Object> params) {
|
||||
params.put("creator", securityComponent.getCurrentUser().getUserId());
|
||||
return systemService.list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<SystemDTO>> listPage(ListPage page) {
|
||||
page.getParams().put("creator", securityComponent.getCurrentUser().getUserId());
|
||||
return systemService.listPage(page);
|
||||
}
|
||||
}
|
128
src/main/resources/application-prod.yml
Normal file
128
src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,128 @@
|
||||
server:
|
||||
port: 7009
|
||||
url: http://172.74.3.59:7009/gateway-manage
|
||||
system-title: 网关管理系统
|
||||
system-sub-title: 网关管理系统
|
||||
# default-index-page:
|
||||
# default-home-page: route/system/default
|
||||
servlet:
|
||||
context-path: /gateway-manage
|
||||
|
||||
spring:
|
||||
login-url: /oauth/login
|
||||
login-failure: /oauth/login?error
|
||||
login-process: /userlogin
|
||||
assets-matchers: /assets/**
|
||||
thymeleaf:
|
||||
prefix: classpath:/templates/
|
||||
suffix: .html
|
||||
mode: HTML5
|
||||
encoding: UTF-8
|
||||
cache: false
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 1GB
|
||||
max-request-size: 1GB
|
||||
datasource:
|
||||
druid:
|
||||
url: jdbc:mysql://172.74.3.62:3306/db_gateway_manage?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC
|
||||
db-type: mysql
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
username: yjhlq
|
||||
password: cmxx0471
|
||||
initial-size: 2
|
||||
min-idle: 2
|
||||
max-active: 5
|
||||
max-wait: 60000
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 300000
|
||||
validation-query: SELECT 1 FROM DUAL
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
pool-prepared-statements: true
|
||||
max-pool-prepared-statement-per-connection-size: 10
|
||||
filter:
|
||||
commons-log:
|
||||
connection-logger-name: stat,wall,log4j
|
||||
stat:
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 2000
|
||||
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
||||
use-global-data-source-stat: true
|
||||
kafka:
|
||||
bootstrap-servers: localhost:9092
|
||||
producer:
|
||||
# 写入失败时,重试次数。当leader节点失效,一个repli节点会替代成为leader节点,此时可能出现写入失败,
|
||||
# 当retris为0时,produce不会重复。retirs重发,此时repli节点完全成为leader节点,不会产生消息丢失。
|
||||
retries: 0
|
||||
#procedure要求leader在考虑完成请求之前收到的确认数,用于控制发送记录在服务端的持久化,其值可以为如下:
|
||||
#acks = 0 如果设置为零,则生产者将不会等待来自服务器的任何确认,该记录将立即添加到套接字缓冲区并视为已发送。在这种情况下,无法保证服务器已收到记录,并且重试配置将不会生效(因为客户端通常不会知道任何故障),为每条记录返回的偏移量始终设置为-1。
|
||||
#acks = 1 这意味着leader会将记录写入其本地日志,但无需等待所有副本服务器的完全确认即可做出回应,在这种情况下,如果leader在确认记录后立即失败,但在将数据复制到所有的副本服务器之前,则记录将会丢失。
|
||||
#acks = all 这意味着leader将等待完整的同步副本集以确认记录,这保证了只要至少一个同步副本服务器仍然存活,记录就不会丢失,这是最强有力的保证,这相当于acks = -1的设置。
|
||||
#可以设置的值为:all, -1, 0, 1
|
||||
acks: 1
|
||||
consumer:
|
||||
group-id: WgGateway
|
||||
# smallest和largest才有效,如果smallest重新0开始读取,如果是largest从logfile的offset读取。一般情况下我们都是设置smallest
|
||||
auto-offset-reset: earliest
|
||||
# 设置自动提交offset
|
||||
enable-auto-commit: true
|
||||
# 如果'enable.auto.commit'为true,则消费者偏移自动提交给Kafka的频率(以毫秒为单位),默认值为5000。
|
||||
auto-commit-interval: 100
|
||||
max-poll-records: 5
|
||||
|
||||
|
||||
# 数据库
|
||||
mybatis:
|
||||
config-location: classpath:mybatis/mybatis-config.xml
|
||||
mapper-locations: classpath*:mybatis/mapper/**/*.xml
|
||||
|
||||
# 文档
|
||||
swagger:
|
||||
base-package-list: ink.wgink
|
||||
|
||||
# 访问控制
|
||||
access-control:
|
||||
role-permission: false
|
||||
|
||||
# 文件
|
||||
file:
|
||||
# 文件的保存路径
|
||||
upload-path: E:\project\uploadFiles/
|
||||
# 图片类型
|
||||
image-types: png,jpg,jpeg,gif,blob
|
||||
# 视频类型
|
||||
video-types: mp4,rmvb
|
||||
# 音频类型
|
||||
audio-types: mp3,wmv,amr
|
||||
# 文件类型
|
||||
file-types: doc,docx,xls,xlsx,ppt,pptx,txt,zip,rar,apk,pdf
|
||||
# 同时上传最大支持数
|
||||
max-file-count: 6
|
||||
# 图片输出压缩质量,大于0,默认0.4
|
||||
image-output-quality: 0.4
|
||||
# 媒体最大时长(单位:秒)
|
||||
media-max-duration:
|
||||
# 后台
|
||||
backend:
|
||||
video: 0
|
||||
audio: 0
|
||||
# 微信
|
||||
wechat:
|
||||
video: 0
|
||||
audio: 0
|
||||
# app
|
||||
app:
|
||||
video: 0
|
||||
audio: 0
|
||||
|
||||
# 日志
|
||||
logging:
|
||||
file:
|
||||
name: E:\project\gateway\gateway-manage-logs.log
|
||||
level:
|
||||
org.springframework: debug
|
||||
ink.wgink: debug
|
@ -52,6 +52,28 @@ spring:
|
||||
slow-sql-millis: 2000
|
||||
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
||||
use-global-data-source-stat: true
|
||||
kafka:
|
||||
bootstrap-servers: localhost:9092
|
||||
producer:
|
||||
# 写入失败时,重试次数。当leader节点失效,一个repli节点会替代成为leader节点,此时可能出现写入失败,
|
||||
# 当retris为0时,produce不会重复。retirs重发,此时repli节点完全成为leader节点,不会产生消息丢失。
|
||||
retries: 0
|
||||
#procedure要求leader在考虑完成请求之前收到的确认数,用于控制发送记录在服务端的持久化,其值可以为如下:
|
||||
#acks = 0 如果设置为零,则生产者将不会等待来自服务器的任何确认,该记录将立即添加到套接字缓冲区并视为已发送。在这种情况下,无法保证服务器已收到记录,并且重试配置将不会生效(因为客户端通常不会知道任何故障),为每条记录返回的偏移量始终设置为-1。
|
||||
#acks = 1 这意味着leader会将记录写入其本地日志,但无需等待所有副本服务器的完全确认即可做出回应,在这种情况下,如果leader在确认记录后立即失败,但在将数据复制到所有的副本服务器之前,则记录将会丢失。
|
||||
#acks = all 这意味着leader将等待完整的同步副本集以确认记录,这保证了只要至少一个同步副本服务器仍然存活,记录就不会丢失,这是最强有力的保证,这相当于acks = -1的设置。
|
||||
#可以设置的值为:all, -1, 0, 1
|
||||
acks: 1
|
||||
consumer:
|
||||
group-id: WgGateway
|
||||
# smallest和largest才有效,如果smallest重新0开始读取,如果是largest从logfile的offset读取。一般情况下我们都是设置smallest
|
||||
auto-offset-reset: earliest
|
||||
# 设置自动提交offset
|
||||
enable-auto-commit: true
|
||||
# 如果'enable.auto.commit'为true,则消费者偏移自动提交给Kafka的频率(以毫秒为单位),默认值为5000。
|
||||
auto-commit-interval: 100
|
||||
max-poll-records: 5
|
||||
|
||||
|
||||
# 数据库
|
||||
mybatis:
|
||||
@ -102,7 +124,5 @@ logging:
|
||||
file:
|
||||
name: /projects/logs/study/gateway-manage-logs.log
|
||||
level:
|
||||
root: error
|
||||
org.springframework.boot.autoconfigure.security.servlet: debug
|
||||
org.springframework: debug
|
||||
ink.wgink: debug
|
||||
com.cm: debug
|
@ -77,6 +77,45 @@
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="examineDTO" type="ink.wgink.gatewaymanage.pojo.dtos.examine.ExamineDTO">
|
||||
<result column="audit_status" property="auditStatus"/>
|
||||
<result column="audit_time" property="auditTime"/>
|
||||
<result column="auditor" property="auditor"/>
|
||||
<result column="audit_reason" property="auditReason"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="createTable">
|
||||
CREATE TABLE IF NOT EXISTS `api_api` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`api_id` char(36) NOT NULL COMMENT '主键',
|
||||
`system_id` char(36) NOT NULL COMMENT '系统ID',
|
||||
`title` varchar(255) NOT NULL COMMENT '标题',
|
||||
`summary` varchar(500) DEFAULT NULL COMMENT '说明',
|
||||
`url` varchar(1000) NOT NULL COMMENT '请求地址',
|
||||
`method` varchar(255) NOT NULL COMMENT '方法',
|
||||
`request_example_url` text COMMENT '请求示例',
|
||||
`request_example_body` longtext COMMENT '请求正文',
|
||||
`response_success_example` longtext COMMENT '响应成功示例',
|
||||
`response_fail_example` longtext COMMENT '响应失败示例',
|
||||
`audit_status` varchar(100) DEFAULT 'none' COMMENT '审核状态',
|
||||
`audit_time` varchar(20) DEFAULT NULL COMMENT '审核时间',
|
||||
`auditor` char(36) DEFAULT NULL COMMENT '审核人',
|
||||
`audit_reason` text COMMENT '审核原因',
|
||||
`is_publish` int(11) NOT NULL DEFAULT '0' COMMENT '是否发布',
|
||||
`publish_time` varchar(255) DEFAULT NULL COMMENT '发布时间',
|
||||
`is_can_claim` int(1) NOT NULL DEFAULT '1' COMMENT '是否可认领',
|
||||
`is_usable` int(1) NOT NULL DEFAULT '0' COMMENT '是否可用',
|
||||
`gmt_create` datetime NOT NULL COMMENT '创建时间',
|
||||
`creator` char(36) NOT NULL COMMENT '创建人',
|
||||
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
|
||||
`modifier` char(36) NOT NULL COMMENT '修改人',
|
||||
`is_delete` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `api_id` (`api_id`) USING BTREE,
|
||||
KEY `system_id` (`system_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='接口';
|
||||
</insert>
|
||||
|
||||
<!-- 新增接口 -->
|
||||
<insert id="save" parameterType="map">
|
||||
INSERT INTO api_api(
|
||||
@ -139,10 +178,18 @@
|
||||
modifier = #{modifier},
|
||||
is_delete = 1
|
||||
WHERE
|
||||
<if test="apiIds != null and apiIds.size > 0">
|
||||
api_id IN
|
||||
<foreach collection="apiIds" index="index" open="(" separator="," close=")">
|
||||
#{apiIds[${index}]}
|
||||
</foreach>
|
||||
<foreach collection="apiIds" index="index" open="(" separator="," close=")">
|
||||
#{apiIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="systemIds != null and systemId.size > 0">
|
||||
system_id IN
|
||||
<foreach collection="systemIds" index="index" open="(" separator="," close=")">
|
||||
#{systemIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- 删除接口(物理) -->
|
||||
@ -150,10 +197,18 @@
|
||||
DELETE FROM
|
||||
api_api
|
||||
WHERE
|
||||
<if test="apiIds != null and apiIds.size > 0">
|
||||
api_id IN
|
||||
<foreach collection="apiIds" index="index" open="(" separator="," close=")">
|
||||
#{apiIds[${index}]}
|
||||
</foreach>
|
||||
<foreach collection="apiIds" index="index" open="(" separator="," close=")">
|
||||
#{apiIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="systemIds != null and systemId.size > 0">
|
||||
system_id IN
|
||||
<foreach collection="systemIds" index="index" open="(" separator="," close=")">
|
||||
#{systemIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- 修改接口 -->
|
||||
@ -204,6 +259,19 @@
|
||||
api_id = #{apiId}
|
||||
</update>
|
||||
|
||||
<!-- 修改审核接口 -->
|
||||
<update id="updateExamine" parameterType="map">
|
||||
UPDATE
|
||||
api_api
|
||||
SET
|
||||
audit_status = #{auditStatus},
|
||||
audit_time = #{auditTime},
|
||||
auditor = #{auditor},
|
||||
audit_reason = #{auditReason}
|
||||
WHERE
|
||||
api_id = #{apiId}
|
||||
</update>
|
||||
|
||||
<!-- 接口详情 -->
|
||||
<select id="get" parameterType="map" resultMap="apiDTO">
|
||||
SELECT
|
||||
@ -324,16 +392,14 @@
|
||||
t1.is_can_claim,
|
||||
t1.is_usable,
|
||||
t1.gmt_create,
|
||||
t1.gmt_modified,
|
||||
1
|
||||
t1.gmt_modified
|
||||
FROM
|
||||
api_api t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND (
|
||||
<!-- 这里添加其他条件 -->
|
||||
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||||
t1.title LIKE CONCAT('%', #{keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
@ -344,6 +410,18 @@
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="auditStartTime != null and auditStartTime != ''">
|
||||
AND
|
||||
LEFT(t1.audit_time, 10) <![CDATA[ >= ]]> #{auditStartTime}
|
||||
</if>
|
||||
<if test="auditEndTime != null and auditEndTime != ''">
|
||||
AND
|
||||
LEFT(t1.audit_time, 10) <![CDATA[ <= ]]> #{auditEndTime}
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus">
|
||||
AND
|
||||
t1.audit_status = #{auditStatus}
|
||||
</if>
|
||||
<if test="apiIds != null and apiIds.size > 0">
|
||||
AND
|
||||
t1.api_id IN
|
||||
@ -351,6 +429,24 @@
|
||||
#{apiIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
AND
|
||||
t1.creator = #{creator}
|
||||
</if>
|
||||
<if test="claimApiIds != null and claimApiIds.size > 0">
|
||||
AND
|
||||
t1.api_id IN
|
||||
<foreach collection="claimApiIds" index="index" open="(" separator="," close=")">
|
||||
#{claimApiIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="unclaimedApiIds != null and unclaimedApiIds.size > 0">
|
||||
AND
|
||||
t1.api_id NOT IN
|
||||
<foreach collection="unclaimedApiIds" index="index" open="(" separator="," close=")">
|
||||
#{unclaimedApiIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 接口列表 -->
|
||||
@ -469,4 +565,17 @@
|
||||
t1.is_delete = 0
|
||||
</select>
|
||||
|
||||
<!-- 获取审核结果 -->
|
||||
<select id="getExamineResult" parameterType="map" resultMap="examineDTO">
|
||||
SELECT
|
||||
t1.audit_status,
|
||||
t1.audit_time,
|
||||
t1.auditor,
|
||||
t1.audit_reason
|
||||
FROM
|
||||
api_api t1
|
||||
WHERE
|
||||
t1.api_id = #{apiId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -38,6 +38,26 @@
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="createTable">
|
||||
CREATE TABLE IF NOT EXISTS `api_claim` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`claim_id` char(36) NOT NULL COMMENT '主键',
|
||||
`system_id` char(36) NOT NULL COMMENT '系统ID',
|
||||
`api_id` char(36) NOT NULL COMMENT 'APIID',
|
||||
`user_id` char(36) NOT NULL COMMENT '申请人ID',
|
||||
`audit_status` varchar(100) DEFAULT 'none' COMMENT '审核状态',
|
||||
`audit_time` varchar(20) DEFAULT NULL COMMENT '审核时间',
|
||||
`auditor` char(36) DEFAULT NULL COMMENT '审核人',
|
||||
`audit_reason` text COMMENT '审核原因',
|
||||
`gmt_create` datetime NOT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `claim_id` (`claim_id`),
|
||||
KEY `system_id` (`system_id`),
|
||||
KEY `api_id` (`api_id`),
|
||||
KEY `user_id` (`user_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='接口认领';
|
||||
</insert>
|
||||
|
||||
<!-- 新增接口认领 -->
|
||||
<insert id="save" parameterType="map">
|
||||
INSERT INTO api_claim(
|
||||
@ -91,6 +111,19 @@
|
||||
claim_id = #{claimId}
|
||||
</update>
|
||||
|
||||
<!-- 审核接口认领 -->
|
||||
<update id="updateExamine" parameterType="map">
|
||||
UPDATE
|
||||
api_claim
|
||||
SET
|
||||
audit_status = #{auditStatus},
|
||||
audit_time = #{auditTime},
|
||||
auditor = #{auditor},
|
||||
audit_reason = #{auditReason}
|
||||
WHERE
|
||||
claim_id = #{claimId}
|
||||
</update>
|
||||
|
||||
<!-- 接口认领详情 -->
|
||||
<select id="get" parameterType="map" resultMap="claimDTO">
|
||||
SELECT
|
||||
@ -162,24 +195,16 @@
|
||||
t1.audit_time,
|
||||
t1.auditor,
|
||||
t1.audit_reason,
|
||||
t1.gmt_create,
|
||||
1
|
||||
t1.gmt_create
|
||||
FROM
|
||||
api_claim t1
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND (
|
||||
<!-- 这里添加其他条件 -->
|
||||
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
<where>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="claimIds != null and claimIds.size > 0">
|
||||
@ -189,6 +214,15 @@
|
||||
#{claimIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
AND
|
||||
t1.user_id = #{userId}
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus != ''">
|
||||
AND
|
||||
t1.audit_status = #{auditStatus}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 接口认领列表 -->
|
||||
@ -267,6 +301,10 @@
|
||||
#{claimIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
AND
|
||||
t1.user_id = #{userId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 接口认领统计 -->
|
||||
|
@ -29,6 +29,22 @@
|
||||
<result column="summary" property="summary"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="createTable">
|
||||
CREATE TABLE IF NOT EXISTS `api_header` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`header_id` char(36) NOT NULL COMMENT '主键',
|
||||
`system_id` char(36) NOT NULL COMMENT '系统ID',
|
||||
`api_id` char(36) NOT NULL COMMENT '接口ID',
|
||||
`header_name` varchar(255) NOT NULL COMMENT '键名',
|
||||
`header_value` varchar(500) NOT NULL COMMENT '键值',
|
||||
`summary` varchar(500) DEFAULT NULL COMMENT '说明',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `header_id` (`header_id`) USING BTREE,
|
||||
KEY `system_id` (`system_id`),
|
||||
KEY `api_id` (`api_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='请求头';
|
||||
</insert>
|
||||
|
||||
<!-- 新增请求头 -->
|
||||
<insert id="save" parameterType="map">
|
||||
INSERT INTO api_header(
|
||||
|
@ -38,6 +38,25 @@
|
||||
<result column="params_example" property="paramsExample"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="createTable">
|
||||
CREATE TABLE IF NOT EXISTS `api_request_params` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`request_params_id` char(36) NOT NULL COMMENT '主键',
|
||||
`system_id` char(36) NOT NULL COMMENT '系统ID',
|
||||
`api_id` char(36) NOT NULL COMMENT '接口ID',
|
||||
`params_name` varchar(255) NOT NULL COMMENT '参数名',
|
||||
`params_summary` varchar(255) DEFAULT NULL COMMENT '参数说明',
|
||||
`params_type` varchar(255) NOT NULL DEFAULT 'query' COMMENT '参数类型',
|
||||
`params_data_type` varchar(255) DEFAULT 'String' COMMENT '参数数据类型',
|
||||
`params_is_required` int(1) NOT NULL DEFAULT '0' COMMENT '是否必填',
|
||||
`params_example` varchar(255) DEFAULT '' COMMENT '参数示例',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `request_params_id` (`request_params_id`) USING BTREE,
|
||||
KEY `system_id` (`system_id`),
|
||||
KEY `api_id` (`api_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='请求参数';
|
||||
</insert>
|
||||
|
||||
<!-- 新增请求参数 -->
|
||||
<insert id="save" parameterType="map">
|
||||
INSERT INTO api_request_params(
|
||||
|
@ -35,6 +35,24 @@
|
||||
<result column="params_example" property="paramsExample"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="createTable">
|
||||
CREATE TABLE IF NOT EXISTS `api_response_params` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`response_params_id` char(36) NOT NULL COMMENT '主键',
|
||||
`system_id` char(36) NOT NULL COMMENT '系统ID',
|
||||
`api_id` char(36) NOT NULL COMMENT '接口ID',
|
||||
`params_name` varchar(255) NOT NULL COMMENT '参数名',
|
||||
`params_summary` varchar(255) DEFAULT NULL COMMENT '参数说明',
|
||||
`params_data_type` varchar(255) DEFAULT 'String' COMMENT '参数数据类型',
|
||||
`params_is_required` int(1) NOT NULL DEFAULT '0' COMMENT '是否必填',
|
||||
`params_example` varchar(255) DEFAULT '' COMMENT '参数示例',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `response_params_id` (`response_params_id`) USING BTREE,
|
||||
KEY `system_id` (`system_id`),
|
||||
KEY `api_id` (`api_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='响应参数';
|
||||
</insert>
|
||||
|
||||
<!-- 新增响应参数 -->
|
||||
<insert id="save" parameterType="map">
|
||||
INSERT INTO api_response_params(
|
||||
|
@ -58,6 +58,38 @@
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="examineDTO" type="ink.wgink.gatewaymanage.pojo.dtos.examine.ExamineDTO">
|
||||
<result column="audit_status" property="auditStatus"/>
|
||||
<result column="audit_time" property="auditTime"/>
|
||||
<result column="auditor" property="auditor"/>
|
||||
<result column="audit_reason" property="auditReason"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="createTable">
|
||||
CREATE TABLE IF NOT EXISTS `api_system` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`system_id` char(36) NOT NULL,
|
||||
`name` varchar(255) NOT NULL COMMENT '名称',
|
||||
`summary` varchar(500) DEFAULT NULL COMMENT '描述',
|
||||
`logo` varchar(255) DEFAULT NULL COMMENT 'logo',
|
||||
`gateway_context` varchar(255) NOT NULL COMMENT '网关上下文',
|
||||
`request_schema` varchar(255) NOT NULL DEFAULT 'http' COMMENT '请求方式',
|
||||
`ip_address` varchar(255) NOT NULL COMMENT '系统地址',
|
||||
`system_context` varchar(255) NOT NULL COMMENT '系统上下文',
|
||||
`audit_status` varchar(20) DEFAULT 'none' COMMENT '审核状态',
|
||||
`audit_time` varchar(20) DEFAULT NULL COMMENT '审核时间',
|
||||
`auditor` char(36) DEFAULT NULL COMMENT '审核人',
|
||||
`audit_reason` text COMMENT '审核原因',
|
||||
`gmt_create` datetime NOT NULL COMMENT '创建时间',
|
||||
`creator` char(36) NOT NULL COMMENT '创建人',
|
||||
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
|
||||
`modifier` char(36) NOT NULL COMMENT '修改人',
|
||||
`is_delete` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `system_id` (`system_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='接口系统';
|
||||
</insert>
|
||||
|
||||
<!-- 新增接口系统 -->
|
||||
<insert id="save" parameterType="map">
|
||||
INSERT INTO api_system(
|
||||
@ -158,6 +190,19 @@
|
||||
system_id = #{systemId}
|
||||
</update>
|
||||
|
||||
<!-- 修改接口系统审核状态 -->
|
||||
<update id="updateExamine" parameterType="map">
|
||||
UPDATE
|
||||
api_system
|
||||
SET
|
||||
audit_status = #{auditStatus},
|
||||
audit_time = #{auditTime},
|
||||
auditor = #{auditor},
|
||||
audit_reason = #{auditReason}
|
||||
WHERE
|
||||
system_id = #{systemId}
|
||||
</update>
|
||||
|
||||
<!-- 接口系统详情 -->
|
||||
<select id="get" parameterType="map" resultMap="systemDTO">
|
||||
SELECT
|
||||
@ -254,16 +299,14 @@
|
||||
t1.audit_time,
|
||||
t1.auditor,
|
||||
t1.audit_reason,
|
||||
t1.gmt_create,
|
||||
1
|
||||
t1.gmt_create
|
||||
FROM
|
||||
api_system t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND (
|
||||
<!-- 这里添加其他条件 -->
|
||||
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||||
t1.name LIKE CONCAT('%', #{keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
@ -274,6 +317,18 @@
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="auditStartTime != null and auditStartTime != ''">
|
||||
AND
|
||||
LEFT(t1.audit_time, 10) <![CDATA[ >= ]]> #{auditStartTime}
|
||||
</if>
|
||||
<if test="auditEndTime != null and auditEndTime != ''">
|
||||
AND
|
||||
LEFT(t1.audit_time, 10) <![CDATA[ <= ]]> #{auditEndTime}
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus">
|
||||
AND
|
||||
t1.audit_status = #{auditStatus}
|
||||
</if>
|
||||
<if test="systemIds != null and systemIds.size > 0">
|
||||
AND
|
||||
t1.system_id IN
|
||||
@ -281,6 +336,10 @@
|
||||
#{systemIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
AND
|
||||
t1.creator = #{creator}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 接口系统列表 -->
|
||||
@ -387,4 +446,17 @@
|
||||
t1.is_delete = 0
|
||||
</select>
|
||||
|
||||
<!-- 获取审核结果 -->
|
||||
<select id="getExamineResult" parameterType="map" resultMap="examineDTO">
|
||||
SELECT
|
||||
t1.audit_status,
|
||||
t1.audit_time,
|
||||
t1.auditor,
|
||||
t1.audit_reason
|
||||
FROM
|
||||
api_system t1
|
||||
WHERE
|
||||
t1.system_id = #{systemId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
90
src/main/resources/static/route/api/get-examine-result.html
Normal file
90
src/main/resources/static/route/api/get-examine-result.html
Normal file
@ -0,0 +1,90 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/gateway-manage/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
<style>
|
||||
.layui-form-label {width: 120px !important;}
|
||||
.layui-form-pane .layui-form-text .layui-form-label {width: 100% !important;}
|
||||
.layui-form-pane .layui-input-block {margin-left: 120px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">审核结果</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="auditReason" name="auditReason" class="layui-textarea" placeholder="请输入说明" lay-verify="required" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var apiId = top.restAjax.params(window.location.href).apiId;
|
||||
var viewerObj = {};
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/api/get-examine-result/{systemId}', [apiId]), {}, null, function(code, data) {
|
||||
var dataFormData = {};
|
||||
for(var i in data) {
|
||||
dataFormData[i] = data[i] +'';
|
||||
}
|
||||
form.val('dataForm', dataFormData);
|
||||
form.render(null, 'dataForm');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
}
|
||||
initData();
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// 校验
|
||||
form.verify({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
108
src/main/resources/static/route/api/get-example.html
Normal file
108
src/main/resources/static/route/api/get-example.html
Normal file
@ -0,0 +1,108 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/gateway-manage/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
<style>
|
||||
.layui-form-label {width: 120px !important;}
|
||||
.layui-form-pane .layui-form-text .layui-form-label {width: 100% !important;}
|
||||
.layui-form-pane .layui-input-block {margin-left: 120px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">审核结果</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="requestExampleUrl" name="requestExampleUrl" class="layui-textarea" placeholder="请求示例" lay-verify="required" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">请求正文</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="requestExampleBody" name="requestExampleBody" class="layui-textarea" rows="15" placeholder="请求正文" lay-verify="required" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">响应成功示例</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="responseSuccessExample" name="responseSuccessExample" class="layui-textarea" placeholder="响应成功示例" lay-verify="required" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">响应失败示例</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="responseFailExample" name="responseFailExample" class="layui-textarea" placeholder="响应失败示例" lay-verify="required" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var apiId = top.restAjax.params(window.location.href).apiId;
|
||||
var viewerObj = {};
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/api/get/{apiId}', [apiId]), {}, null, function(code, data) {
|
||||
var dataFormData = {};
|
||||
for(var i in data) {
|
||||
dataFormData[i] = data[i] +'';
|
||||
}
|
||||
form.val('dataForm', dataFormData);
|
||||
form.render(null, 'dataForm');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
}
|
||||
initData();
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// 校验
|
||||
form.verify({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
273
src/main/resources/static/route/api/list-claim.html
Normal file
273
src/main/resources/static/route/api/list-claim.html
Normal file
@ -0,0 +1,273 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/gateway-manage/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item search-item-width-100" placeholder="输入接口名称">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item search-item-width-100" placeholder="开始时间" readonly>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item search-item-width-100" placeholder="结束时间" readonly>
|
||||
</div>
|
||||
<div class="layui-inline layui-form search-item">
|
||||
<select id="claimType" name="claimType">
|
||||
<option value="unclaimed" selected>未认领</option>
|
||||
<option value="claim">已认领</option>
|
||||
<option value="all">全部</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/api/permission/listpage-claim/{unclaimed}';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, ['unclaimed']),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
toolbar: '#headerToolBar',
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'systemName', width: 180, title: '系统名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'title', width: 180, title: '标题', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'summary', width: 180, title: '说明', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'url', width: 180, title: '请求地址', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'method', width: 180, title: '方法', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'claimAuditStatus', width: 100, title: '审核状态', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row.claim.auditStatus;
|
||||
if(typeof(rowData) === 'undefined' || rowData == null) {
|
||||
return '-';
|
||||
}
|
||||
if(rowData == 'none') {
|
||||
return '<span class="layui-badge">未审核</span>';
|
||||
}
|
||||
if(rowData == 'unPass') {
|
||||
return '<span class="layui-badge layui-bg-gray">未审核</span>';
|
||||
}
|
||||
if(rowData == 'pass') {
|
||||
return '<span class="layui-badge layui-bg-green">通过</span>';
|
||||
}
|
||||
return '错误';
|
||||
}
|
||||
},
|
||||
{field: 'claimAuditTime', width: 180, title: '审核时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row.claim.auditTime;
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'claimAuditor', width: 180, title: '审核人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row.claim.auditor;
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'claimAuditReason', width: 100, title: '审核原因', align:'center',
|
||||
templet: function(row) {
|
||||
if(!row.claim.auditReason) {
|
||||
return '未审核';
|
||||
}
|
||||
return '<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs" lay-event="auditReasonEvent">点击查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'operate', width: 100, title: '操作', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
var rowData = row.claim.auditStatus;
|
||||
if(rowData == 'none') {
|
||||
return '正在审核'
|
||||
}
|
||||
if(rowData == 'pass') {
|
||||
return '已认领';
|
||||
}
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="claimEvent">认领</button>';
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, [$('#claimType').val()]),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 90,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var event = obj.event;
|
||||
var data = obj.data;
|
||||
if(event === 'claimEvent') {
|
||||
top.dialog.confirm('确认认领该接口码?', function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.post(top.restAjax.path('api/claim/save', []), {
|
||||
systemId: data.systemId,
|
||||
apiId: data.apiId
|
||||
}, null, function(code, data) {
|
||||
top.dialog.msg('认领成功,等待审核');
|
||||
reloadTable();
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
})
|
||||
} else if(event === 'auditReasonEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/api/get-examine-result.html?apiId={apiId}', [data.apiId]),
|
||||
title: '审核结果',
|
||||
width: '500px',
|
||||
height: '400px',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
458
src/main/resources/static/route/api/list-examine.html
Normal file
458
src/main/resources/static/route/api/list-examine.html
Normal file
@ -0,0 +1,458 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/gateway-manage/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item search-item-width-100" placeholder="输入关键字">
|
||||
</div>
|
||||
审核时间段
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item search-item-width-100" placeholder="开始时间" readonly>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item search-item-width-100" placeholder="结束时间" readonly>
|
||||
</div>
|
||||
<div class="layui-inline layui-form search-item">
|
||||
<select id="auditStatus" name="auditStatus">
|
||||
<option value="none" selected>未审核</option>
|
||||
<option value="pass">审核通过</option>
|
||||
<option value="unPass">审核不通过</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/api/listpage?auditStatus={auditStatus}';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, ['none']),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'systemName', width: 180, title: '系统名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'title', width: 180, title: '标题', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'summary', width: 180, title: '说明', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'url', width: 180, title: '请求地址', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'method', width: 180, title: '方法', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'requestExampleUrl', width: 100, title: '请求示例', align:'center',
|
||||
templet: function(row) {
|
||||
return '<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs" lay-event="requestExampleUrlEvent">点击查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'requestExampleBody', width: 100, title: '请求正文', align:'center',
|
||||
templet: function(row) {
|
||||
return '<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs" lay-event="requestExampleBodyEvent">点击查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'responseSuccessExample', width: 120, title: '响应成功示例', align:'center',
|
||||
templet: function(row) {
|
||||
return '<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs" lay-event="responseSuccessExampleEvent">点击查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'responseFailExample', width: 120, title: '响应失败示例', align:'center',
|
||||
templet: function(row) {
|
||||
return '<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs" lay-event="responseFailExampleEvent">点击查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'auditStatus', width: 100, title: '审核状态', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null) {
|
||||
return '-';
|
||||
}
|
||||
if(rowData == 'none') {
|
||||
return '<span class="layui-badge">未审核</span>';
|
||||
}
|
||||
if(rowData == 'unPass') {
|
||||
return '<span class="layui-badge layui-bg-gray">未审核</span>';
|
||||
}
|
||||
if(rowData == 'pass') {
|
||||
return '<span class="layui-badge layui-bg-green">通过</span>';
|
||||
}
|
||||
return '错误';
|
||||
}
|
||||
},
|
||||
{field: 'auditTime', width: 180, title: '审核时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'auditor', width: 180, title: '审核人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'auditReason', width: 100, title: '审核原因', align:'center',
|
||||
templet: function(row) {
|
||||
if(row.auditStatus == 'none') {
|
||||
return '未审核';
|
||||
}
|
||||
return '<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs" lay-event="auditReasonEvent">点击查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'isPublish', width: 100, title: '是否发布', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null) {
|
||||
return '-';
|
||||
}
|
||||
if(rowData == 0) {
|
||||
return '<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="isPublishNoEvent">否</button>';
|
||||
}
|
||||
if(rowData == 1) {
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="isPublishYesEvent">是</button>';
|
||||
}
|
||||
return '错误';
|
||||
}
|
||||
},
|
||||
{field: 'publishTime', width: 180, title: '发布时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isCanClaim', width: 100, title: '可认领', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
if(rowData == 0) {
|
||||
return '<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="isCanClaimNoEvent">否</button>';
|
||||
}
|
||||
if(rowData == 1) {
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="isCanClaimYesEvent">是</button>';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isUsable', width: 100, title: '是否可用', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
if(rowData == 0) {
|
||||
return '<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="isUsableNoEvent">否</button>';
|
||||
}
|
||||
if(rowData == 1) {
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="isUsableYesEvent">是</button>';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gmtCreate', width: 180, title: '创建时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'headerParams', width: 80, title: '头参数', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="headerParamsEvent">查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'requestParams', width: 90, title: '请求参数', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="requestParamsEvent">查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'responseParams', width: 90, title: '响应参数', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="responseParamsEvent">查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'option', width: 80, title: '操作', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
if(row.auditStatus == 'none') {
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="examineEvent">审核</button>';
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, [$('#auditStatus').val()]),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
auditStartTime: $('#startTime').val(),
|
||||
auditEndTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 90,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
// 删除
|
||||
function removeData(ids) {
|
||||
top.dialog.msg(top.dataMessage.delete, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function (index) {
|
||||
top.dialog.close(index);
|
||||
var layIndex;
|
||||
top.restAjax.delete(top.restAjax.path('api/api/remove/{ids}', [ids]), {}, null, function (code, data) {
|
||||
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
|
||||
reloadTable();
|
||||
}, function (code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function () {
|
||||
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function () {
|
||||
top.dialog.close(layIndex);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
// 事件 - 增删改
|
||||
table.on('toolbar(dataTable)', function(obj) {
|
||||
var layEvent = obj.event;
|
||||
var checkStatus = table.checkStatus('dataTable');
|
||||
var checkDatas = checkStatus.data;
|
||||
if(layEvent === 'saveEvent') {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/api/save.html', []),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
} else if(layEvent === 'updateEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectEdit);
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg(top.dataMessage.table.selectOneEdit);
|
||||
} else {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/api/update.html?apiId={apiId}', [checkDatas[0].apiId]),
|
||||
end: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if(layEvent === 'removeEvent') {
|
||||
if(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectDelete);
|
||||
} else {
|
||||
var ids = '';
|
||||
for(var i = 0, item; item = checkDatas[i++];) {
|
||||
if(i > 1) {
|
||||
ids += '_';
|
||||
}
|
||||
ids += item['apiId'];
|
||||
}
|
||||
removeData(ids);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var event = obj.event;
|
||||
var data = obj.data;
|
||||
if(event === 'headerParamsEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/header/list-preview.html?systemId={systemId}&apiId={apiId}', [data.systemId, data.apiId]),
|
||||
title: '头参数列表',
|
||||
width: '70%',
|
||||
height: '70%',
|
||||
onClose: function() {}
|
||||
});
|
||||
} else if(event === 'requestParamsEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/requestparams/list-preview.html?systemId={systemId}&apiId={apiId}', [data.systemId, data.apiId]),
|
||||
title: '请求参数列表',
|
||||
width: '70%',
|
||||
height: '70%',
|
||||
onClose: function() {}
|
||||
});
|
||||
} else if(event === 'responseParamsEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/responseparams/list-preview.html?systemId={systemId}&apiId={apiId}', [data.systemId, data.apiId]),
|
||||
title: '响应参数列表',
|
||||
width: '70%',
|
||||
height: '70%',
|
||||
onClose: function() {}
|
||||
});
|
||||
} else if(event === 'examineEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/api/update-examine.html?apiId={apiId}', [data.apiId]),
|
||||
title: '审核接口',
|
||||
width: '500px',
|
||||
height: '400px',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
} else if(event === 'auditReasonEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/api/get-examine-result.html?apiId={apiId}', [data.apiId]),
|
||||
title: '审核结果',
|
||||
width: '500px',
|
||||
height: '400px',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -65,7 +65,7 @@
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/api/listpage';
|
||||
var tableUrl = 'api/api/permission/listpage';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
@ -86,16 +86,7 @@
|
||||
[
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'apiId', width: 180, title: '主键', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'systemId', width: 180, title: '系统ID', align:'center',
|
||||
{field: 'systemName', width: 180, title: '系统名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
@ -140,49 +131,27 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'requestExampleUrl', width: 180, title: '请求示例', align:'center',
|
||||
{field: 'example', width: 100, title: '示例', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
return '<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs" lay-event="exampleEvent">点击查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'requestExampleBody', width: 180, title: '请求正文', align:'center',
|
||||
{field: 'auditStatus', width: 100, title: '审核状态', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
if(typeof(rowData) === 'undefined' || rowData == null) {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'responseSuccessExample', width: 180, title: '响应成功示例', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
if(rowData == 'none') {
|
||||
return '<span class="layui-badge">未审核</span>';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'responseFailExample', width: 180, title: '响应失败示例', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
if(rowData == 'unPass') {
|
||||
return '<span class="layui-badge layui-bg-gray">未审核</span>';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'auditStatus', width: 180, title: '审核状态', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
if(rowData == 'pass') {
|
||||
return '<span class="layui-badge layui-bg-green">通过</span>';
|
||||
}
|
||||
return rowData;
|
||||
return '错误';
|
||||
}
|
||||
},
|
||||
{field: 'auditTime', width: 180, title: '审核时间', align:'center',
|
||||
@ -203,22 +172,27 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'auditReason', width: 180, title: '审核原因', align:'center',
|
||||
{field: 'auditReason', width: 100, title: '审核原因', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
if(row.auditStatus == 'none') {
|
||||
return '未审核';
|
||||
}
|
||||
return rowData;
|
||||
return '<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs" lay-event="auditReasonEvent">点击查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'isPublish', width: 180, title: '是否发布', align:'center',
|
||||
{field: 'isPublish', width: 100, title: '是否发布', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
if(typeof(rowData) === 'undefined' || rowData == null) {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
if(rowData == 0) {
|
||||
return '<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="isPublishNoEvent">否</button>';
|
||||
}
|
||||
if(rowData == 1) {
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="isPublishYesEvent">是</button>';
|
||||
}
|
||||
return '错误';
|
||||
}
|
||||
},
|
||||
{field: 'publishTime', width: 180, title: '发布时间', align:'center',
|
||||
@ -230,21 +204,33 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isCanClaim', width: 180, title: '是否可认领', align:'center',
|
||||
{field: 'isCanClaim', width: 100, title: '可认领', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
if(rowData == 0) {
|
||||
return '<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="isCanClaimNoEvent">否</button>';
|
||||
}
|
||||
if(rowData == 1) {
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="isCanClaimYesEvent">是</button>';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isUsable', width: 180, title: '是否可用', align:'center',
|
||||
{field: 'isUsable', width: 100, title: '是否可用', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
if(rowData == 0) {
|
||||
return '<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="isUsableNoEvent">否</button>';
|
||||
}
|
||||
if(rowData == 1) {
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="isUsableYesEvent">是</button>';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
@ -257,28 +243,27 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gmtModified', width: 180, title: '修改时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'headerParams', width: 80, title: '头参数', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
return '<button class="layui-btn layui-btn-sm" lay-event="headerParamsEvent">查看</button>';
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="headerParamsEvent">查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'requestParams', width: 90, title: '请求参数', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
return '<button class="layui-btn layui-btn-sm" lay-event="requestParamsEvent">查看</button>';
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="requestParamsEvent">查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'responseParams', width: 90, title: '响应参数', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
return '<button class="layui-btn layui-btn-sm" lay-event="responseParamsEvent">查看</button>';
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="responseParamsEvent">查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'operate', width: 90, title: '操作', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
if(row.auditStatus == 'pass' && row.isUsable == '1') {
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="publishEvent">发布</button>';
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
]
|
||||
@ -412,30 +397,62 @@
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var event = obj.event;
|
||||
var data = obj.data;
|
||||
if(event === 'headerParamsEvent') {
|
||||
if(event === 'exampleEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/api/get-example.html?apiId={apiId}', [data.apiId]),
|
||||
title: '头参数列表',
|
||||
width: '70%',
|
||||
height: '70%',
|
||||
onClose: function() {}
|
||||
});
|
||||
} else if(event === 'headerParamsEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/header/list.html?systemId={systemId}&apiId={apiId}', [data.systemId, data.apiId]),
|
||||
title: '头参数列表',
|
||||
width: '500px',
|
||||
height: '400px',
|
||||
width: '70%',
|
||||
height: '70%',
|
||||
onClose: function() {}
|
||||
});
|
||||
} else if(event === 'requestParamsEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/requestparams/list.html?systemId={systemId}&apiId={apiId}', [data.systemId, data.apiId]),
|
||||
title: '请求参数列表',
|
||||
width: '500px',
|
||||
height: '400px',
|
||||
width: '70%',
|
||||
height: '70%',
|
||||
onClose: function() {}
|
||||
});
|
||||
} else if(event === 'responseParamsEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/responseparams/list.html?systemId={systemId}&apiId={apiId}', [data.systemId, data.apiId]),
|
||||
title: '响应参数列表',
|
||||
width: '500px',
|
||||
height: '400px',
|
||||
width: '70%',
|
||||
height: '70%',
|
||||
onClose: function() {}
|
||||
});
|
||||
} else if(event === 'auditReasonEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/api/get-examine-result.html?apiId={apiId}', [data.apiId]),
|
||||
title: '审核结果',
|
||||
width: '500px',
|
||||
height: '400px',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
} else if(event === 'publishEvent') {
|
||||
top.dialog.confirm('确定发布该接口码?', function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/api/publish/{apiId}', [data.apiId]), {}, null, function(code, data) {
|
||||
top.dialog.msg('发布成功');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -162,7 +162,7 @@
|
||||
|
||||
// 初始化系统ID
|
||||
function initSystemId() {
|
||||
top.restAjax.get(top.restAjax.path('api/system/list', []), {}, null, function(code, data, args) {
|
||||
top.restAjax.get(top.restAjax.path('api/system/list?auditStatus=pass', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('systemIdTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('systemIdTemplateBox').innerHTML = html;
|
||||
});
|
||||
|
@ -10,34 +10,40 @@
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
<style>
|
||||
.layui-form-label {width: 120px !important;}
|
||||
.layui-form-pane .layui-form-text .layui-form-label {width: 100% !important;}
|
||||
.layui-form-pane .layui-input-block {margin-left: 120px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
|
||||
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
|
||||
<a href="javascript:void(0);"><cite>新增内容</cite></a>
|
||||
<a href="javascript:void(0);"><cite>编辑内容</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">系统ID</label>
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">审核状态 *</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="systemId" name="systemId" class="layui-input" value="" placeholder="请输入系统ID" maxlength="36">
|
||||
<input type="radio" name="isPass" value="0" title="否">
|
||||
<input type="radio" name="isPass" value="1" title="是" checked>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">APIID</label>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">说明</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="apiId" name="apiId" class="layui-input" value="" placeholder="请输入APIID" maxlength="36">
|
||||
<textarea id="reason" name="reason" class="layui-textarea" placeholder="请输入请求示例" lay-verify="required"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交新增</button>
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交审核</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -46,8 +52,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
|
||||
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
@ -60,77 +64,20 @@
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var wangEditor = window.wangEditor;
|
||||
var wangEditorObj = {};
|
||||
var apiId = top.restAjax.params(window.location.href).apiId;
|
||||
var viewerObj = {};
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
function refreshDownloadTemplet(fileName, file) {
|
||||
var dataRander = {};
|
||||
dataRander[fileName] = file;
|
||||
|
||||
laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) {
|
||||
document.getElementById(fileName +'FileBox').innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化文件列表
|
||||
function initFileList(fileName, ids, callback) {
|
||||
var dataForm = {};
|
||||
dataForm[fileName] = ids;
|
||||
form.val('dataForm', dataForm);
|
||||
|
||||
if(!ids) {
|
||||
refreshDownloadTemplet(fileName, []);
|
||||
if(callback) {
|
||||
callback(fileName, []);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
top.restAjax.get(top.restAjax.path('api/file/list', []), {
|
||||
ids: ids
|
||||
}, null, function(code, data) {
|
||||
refreshDownloadTemplet(fileName, data);
|
||||
if(callback) {
|
||||
callback(fileName, data);
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化视频
|
||||
function initVideo(fileName, data) {
|
||||
for(var i = 0, item; item = data[i++];) {
|
||||
var player = new ckplayer({
|
||||
container: '#'+ fileName + i,
|
||||
variable: 'player',
|
||||
flashplayer: false,
|
||||
video: {
|
||||
file: 'route/file/download/true/'+ item.fileId,
|
||||
type: 'video/mp4'
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
}
|
||||
initData();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.post(top.restAjax.path('api/claim/save', []), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
|
||||
top.restAjax.put(top.restAjax.path('api/api/update-examine/{apiId}', [apiId]), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
@ -9,7 +9,8 @@
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/codemirror.css">
|
||||
<link rel="stylesheet" href="assets/js/vendor/codemirror/theme/dracula.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
@ -159,7 +160,7 @@
|
||||
|
||||
// 初始化系统ID
|
||||
function initSystemId(joinValue) {
|
||||
top.restAjax.get(top.restAjax.path('api/system/list', []), {}, null, function(code, data, args) {
|
||||
top.restAjax.get(top.restAjax.path('api/system/list?auditStatus=pass', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('systemIdTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('systemIdTemplateBox').innerHTML = html;
|
||||
});
|
||||
|
262
src/main/resources/static/route/claim/list-examine.html
Normal file
262
src/main/resources/static/route/claim/list-examine.html
Normal file
@ -0,0 +1,262 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/gateway-manage/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item search-item-width-100" placeholder="输入接口名称">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item search-item-width-100" placeholder="开始时间" readonly>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item search-item-width-100" placeholder="结束时间" readonly>
|
||||
</div>
|
||||
<div class="layui-inline layui-form search-item">
|
||||
<select id="auditStatus" name="auditStatus">
|
||||
<option value="none" selected>未审核</option>
|
||||
<option value="pass">已通过</option>
|
||||
<option value="unPass">未通过</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/claim/permission/listpage-examine?auditStatus={auditStatus}';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, ['none']),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
toolbar: '#headerToolBar',
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'systemName', width: 180, title: '系统名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row.system.name;
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'title', width: 180, title: '标题', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row.api.title;
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'summary', width: 180, title: '说明', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row.api.summary;
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'url', width: 180, title: '请求地址', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row.api.url;
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'method', width: 180, title: '方法', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row.api.method;
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'auditStatus', width: 100, title: '审核状态', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null) {
|
||||
return '-';
|
||||
}
|
||||
if(rowData == 'none') {
|
||||
return '<span class="layui-badge">未审核</span>';
|
||||
}
|
||||
if(rowData == 'unPass') {
|
||||
return '<span class="layui-badge layui-bg-gray">未审核</span>';
|
||||
}
|
||||
if(rowData == 'pass') {
|
||||
return '<span class="layui-badge layui-bg-green">通过</span>';
|
||||
}
|
||||
return '错误';
|
||||
}
|
||||
},
|
||||
{field: 'auditTime', width: 180, title: '审核时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'auditor', width: 180, title: '审核人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'auditReason', width: 100, title: '审核原因', align:'center',
|
||||
templet: function(row) {
|
||||
if(!row.auditReason) {
|
||||
return '未审核';
|
||||
}
|
||||
return '<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs" lay-event="auditReasonEvent">点击查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'operate', width: 100, title: '操作', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
var rowData = row.auditStatus;
|
||||
if(rowData == 'pass') {
|
||||
return '-'
|
||||
}
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="examineEvent">审核</button>';
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, [$('#auditStatus').val()]),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 90,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var event = obj.event;
|
||||
var data = obj.data;
|
||||
if(event === 'examineEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/claim/update-examine.html?claimId={claimId}', [data.claimId]),
|
||||
title: '审核接口系统',
|
||||
width: '500px',
|
||||
height: '400px',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
} else if(event === 'auditReasonEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/system/get-examine-result.html?systemId={systemId}', [data.systemId]),
|
||||
title: '审核结果',
|
||||
width: '500px',
|
||||
height: '400px',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -10,9 +10,14 @@
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
<style>
|
||||
.layui-form-label {width: 120px !important;}
|
||||
.layui-form-pane .layui-form-text .layui-form-label {width: 100% !important;}
|
||||
.layui-form-pane .layui-input-block {margin-left: 120px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
|
||||
@ -22,22 +27,23 @@
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">系统ID</label>
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">审核状态 *</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="systemId" name="systemId" class="layui-input" value="" placeholder="请输入系统ID" maxlength="36">
|
||||
<input type="radio" name="isPass" value="0" title="否">
|
||||
<input type="radio" name="isPass" value="1" title="是" checked>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">APIID</label>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">说明</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="apiId" name="apiId" class="layui-input" value="" placeholder="请输入APIID" maxlength="36">
|
||||
<textarea id="reason" name="reason" class="layui-textarea" placeholder="请输入说明" lay-verify="required"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交编辑</button>
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交审核</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -46,8 +52,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
|
||||
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
@ -61,92 +65,18 @@
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var claimId = top.restAjax.params(window.location.href).claimId;
|
||||
|
||||
var wangEditor = window.wangEditor;
|
||||
var wangEditorObj = {};
|
||||
var viewerObj = {};
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
function refreshDownloadTemplet(fileName, file) {
|
||||
var dataRander = {};
|
||||
dataRander[fileName] = file;
|
||||
|
||||
laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) {
|
||||
document.getElementById(fileName +'FileBox').innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化文件列表
|
||||
function initFileList(fileName, ids, callback) {
|
||||
var dataForm = {};
|
||||
dataForm[fileName] = ids;
|
||||
form.val('dataForm', dataForm);
|
||||
|
||||
if(!ids) {
|
||||
refreshDownloadTemplet(fileName, []);
|
||||
if(callback) {
|
||||
callback(fileName, []);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
top.restAjax.get(top.restAjax.path('api/file/list', []), {
|
||||
ids: ids
|
||||
}, null, function(code, data) {
|
||||
refreshDownloadTemplet(fileName, data);
|
||||
if(callback) {
|
||||
callback(fileName, data);
|
||||
}
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化视频
|
||||
function initVideo(fileName, data) {
|
||||
for(var i = 0, item; item = data[i++];) {
|
||||
var player = new ckplayer({
|
||||
container: '#'+ fileName + i,
|
||||
variable: 'player',
|
||||
flashplayer: false,
|
||||
video: {
|
||||
file: 'route/file/download/true/'+ item.fileId,
|
||||
type: 'video/mp4'
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/claim/get/{claimId}', [claimId]), {}, null, function(code, data) {
|
||||
var dataFormData = {};
|
||||
for(var i in data) {
|
||||
dataFormData[i] = data[i] +'';
|
||||
}
|
||||
form.val('dataForm', dataFormData);
|
||||
form.render(null, 'dataForm');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
}
|
||||
initData();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.put(top.restAjax.path('api/claim/update/{claimId}', [claimId]), formData.field, null, function(code, data) {
|
||||
top.restAjax.put(top.restAjax.path('api/claim/update-examine/{claimId}', [claimId]), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
142
src/main/resources/static/route/header/list-preview.html
Normal file
142
src/main/resources/static/route/header/list-preview.html
Normal file
@ -0,0 +1,142 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/gateway-manage/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/header/listpage';
|
||||
|
||||
var params = top.restAjax.params(window.location.href);
|
||||
var systemId = params.systemId;
|
||||
var apiId = params.apiId;
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 20,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'headerName', width: 180, title: '键名', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'headerValue', width: 180, title: '键值', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'summary', width: 180, title: '说明', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 20,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
169
src/main/resources/static/route/requestparams/list-preview.html
Normal file
169
src/main/resources/static/route/requestparams/list-preview.html
Normal file
@ -0,0 +1,169 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/gateway-manage/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/requestparams/listpage';
|
||||
|
||||
var params = top.restAjax.params(window.location.href);
|
||||
var systemId = params.systemId;
|
||||
var apiId = params.apiId;
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 20,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'paramsName', width: 180, title: '参数名', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'paramsSummary', width: 180, title: '参数说明', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'paramsType', width: 180, title: '参数类型', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'paramsDataType', width: 180, title: '参数数据类型', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'paramsIsRequired', width: 180, title: '是否必填', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'paramsExample', width: 180, title: '参数示例', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 20,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
175
src/main/resources/static/route/responseparams/list-preview.html
Normal file
175
src/main/resources/static/route/responseparams/list-preview.html
Normal file
@ -0,0 +1,175 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/gateway-manage/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/responseparams/listpage';
|
||||
|
||||
var params = top.restAjax.params(window.location.href);
|
||||
var systemId = params.systemId;
|
||||
var apiId = params.apiId;
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 20,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'paramsName', width: 180, title: '参数名', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'paramsSummary', width: 180, title: '参数说明', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'paramsType', width: 180, title: '参数类型', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'paramsDataType', width: 180, title: '参数数据类型', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'paramsIsRequired', width: 180, title: '是否必填', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null) {
|
||||
return '-';
|
||||
}
|
||||
if(rowData === 0) {
|
||||
return '否';
|
||||
}
|
||||
if(rowData === 1) {
|
||||
return '是';
|
||||
}
|
||||
return '错误';
|
||||
}
|
||||
},
|
||||
{field: 'paramsExample', width: 180, title: '参数示例', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 20,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -142,10 +142,16 @@
|
||||
{field: 'paramsIsRequired', width: 180, title: '是否必填', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
if(typeof(rowData) === 'undefined' || rowData == null) {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
if(rowData === 0) {
|
||||
return '否';
|
||||
}
|
||||
if(rowData === 1) {
|
||||
return '是';
|
||||
}
|
||||
return '错误';
|
||||
}
|
||||
},
|
||||
{field: 'paramsExample', width: 180, title: '参数示例', align:'center',
|
||||
|
@ -0,0 +1,90 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/gateway-manage/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
<style>
|
||||
.layui-form-label {width: 120px !important;}
|
||||
.layui-form-pane .layui-form-text .layui-form-label {width: 100% !important;}
|
||||
.layui-form-pane .layui-input-block {margin-left: 120px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">审核结果</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="auditReason" name="auditReason" class="layui-textarea" placeholder="请输入说明" lay-verify="required" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var systemId = top.restAjax.params(window.location.href).systemId;
|
||||
var viewerObj = {};
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/system/get-examine-result/{systemId}', [systemId]), {}, null, function(code, data) {
|
||||
var dataFormData = {};
|
||||
for(var i in data) {
|
||||
dataFormData[i] = data[i] +'';
|
||||
}
|
||||
form.val('dataForm', dataFormData);
|
||||
form.render(null, 'dataForm');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
}
|
||||
initData();
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// 校验
|
||||
form.verify({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
318
src/main/resources/static/route/system/list-examine.html
Normal file
318
src/main/resources/static/route/system/list-examine.html
Normal file
@ -0,0 +1,318 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/gateway-manage/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item search-item-width-100" placeholder="输入系统名称 `">
|
||||
</div>
|
||||
审核时间段
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item search-item-width-100" placeholder="开始时间" readonly>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item search-item-width-100" placeholder="结束时间" readonly>
|
||||
</div>
|
||||
<div class="layui-inline layui-form search-item">
|
||||
<select id="auditStatus" name="auditStatus">
|
||||
<option value="none" selected>未审核</option>
|
||||
<option value="pass">审核通过</option>
|
||||
<option value="unPass">审核不通过</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/system/listpage?auditStatus={auditStatus}';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, ['none']),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'name', width: 180, title: '名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'summary', width: 180, title: '描述', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'logo', width: 180, title: 'logo', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
var downloadFile = '';
|
||||
var datas = rowData.split(',');
|
||||
for(var i = 0, item = datas[i]; item = datas[i++];) {
|
||||
if(downloadFile.length > 0) {
|
||||
downloadFile += ' | ';
|
||||
}
|
||||
downloadFile += '<a href="route/file/download/false/'+ item +'" target="_blank">点击下载</a>'
|
||||
}
|
||||
return downloadFile;
|
||||
}
|
||||
},
|
||||
{field: 'gatewayContext', width: 180, title: '网关上下文', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'requestSchema', width: 100, title: '请求方式', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'ipAddress', width: 180, title: '系统地址', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'systemContext', width: 180, title: '系统上下文', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'auditStatus', width: 100, title: '审核状态', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null) {
|
||||
return '-';
|
||||
}
|
||||
if(rowData == 'none') {
|
||||
return '<span class="layui-badge">未审核</span>';
|
||||
}
|
||||
if(rowData == 'unPass') {
|
||||
return '<span class="layui-badge layui-bg-gray">未审核</span>';
|
||||
}
|
||||
if(rowData == 'pass') {
|
||||
return '<span class="layui-badge layui-bg-green">通过</span>';
|
||||
}
|
||||
return '错误';
|
||||
}
|
||||
},
|
||||
{field: 'auditTime', width: 180, title: '审核时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'auditor', width: 180, title: '审核人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'auditReason', width: 100, title: '审核原因', align:'center',
|
||||
templet: function(row) {
|
||||
if(row.auditStatus == 'none') {
|
||||
return '未审核';
|
||||
}
|
||||
return '<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs" lay-event="auditReasonEvent">点击查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'gmtCreate', width: 180, title: '创建时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'option', width: 80, title: '操作', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
if(row.auditStatus == 'none') {
|
||||
return '<button class="layui-btn layui-btn-xs" lay-event="examineEvent">审核</button>';
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, [$('#auditStatus').val()]),
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
auditStartTime: $('#startTime').val(),
|
||||
auditEndTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 90,
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
// 删除
|
||||
function removeData(ids) {
|
||||
top.dialog.msg(top.dataMessage.delete, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function (index) {
|
||||
top.dialog.close(index);
|
||||
var layIndex;
|
||||
top.restAjax.delete(top.restAjax.path('api/system/remove/{ids}', [ids]), {}, null, function (code, data) {
|
||||
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
|
||||
reloadTable();
|
||||
}, function (code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function () {
|
||||
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function () {
|
||||
top.dialog.close(layIndex);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var data = obj.data;
|
||||
var event = obj.event;
|
||||
if(event === 'examineEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/system/update-examine.html?systemId={systemId}', [data.systemId]),
|
||||
title: '审核接口系统',
|
||||
width: '500px',
|
||||
height: '400px',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
} else if(event === 'auditReasonEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/system/get-examine-result.html?systemId={systemId}', [data.systemId]),
|
||||
title: '审核结果',
|
||||
width: '500px',
|
||||
height: '400px',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -18,13 +18,13 @@
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
|
||||
<input type="text" id="keywords" class="layui-input search-item search-item-width-100" placeholder="输入关键字">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item" placeholder="开始时间" readonly>
|
||||
<input type="text" id="startTime" class="layui-input search-item search-item-width-100" placeholder="开始时间" readonly>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly>
|
||||
<input type="text" id="endTime" class="layui-input search-item search-item-width-100" placeholder="结束时间" readonly>
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
@ -65,7 +65,7 @@
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/system/listpage';
|
||||
var tableUrl = 'api/system/permission/listpage';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
@ -130,7 +130,7 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'requestSchema', width: 180, title: '请求方式', align:'center',
|
||||
{field: 'requestSchema', width: 100, title: '请求方式', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
@ -157,13 +157,22 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'auditStatus', width: 180, title: '审核状态', align:'center',
|
||||
{field: 'auditStatus', width: 100, title: '审核状态', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
if(typeof(rowData) === 'undefined' || rowData == null) {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
if(rowData == 'none') {
|
||||
return '<span class="layui-badge">未审核</span>';
|
||||
}
|
||||
if(rowData == 'unPass') {
|
||||
return '<span class="layui-badge layui-bg-gray">未审核</span>';
|
||||
}
|
||||
if(rowData == 'pass') {
|
||||
return '<span class="layui-badge layui-bg-green">通过</span>';
|
||||
}
|
||||
return '错误';
|
||||
}
|
||||
},
|
||||
{field: 'auditTime', width: 180, title: '审核时间', align:'center',
|
||||
@ -184,13 +193,12 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'auditReason', width: 180, title: '审核原因', align:'center',
|
||||
{field: 'auditReason', width: 100, title: '审核原因', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
if(row.auditStatus == 'none') {
|
||||
return '未审核';
|
||||
}
|
||||
return rowData;
|
||||
return '<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs" lay-event="auditReasonEvent">点击查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'gmtCreate', width: 180, title: '创建时间', align:'center',
|
||||
@ -202,42 +210,6 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'creator', width: 180, title: '创建人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gmtModified', width: 180, title: '修改时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'modifier', width: 180, title: '修改人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isDelete', width: 180, title: '是否删除', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
@ -365,6 +337,22 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var data = obj.data;
|
||||
var event = obj.event;
|
||||
if(event === 'auditReasonEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/system/get-examine-result.html?systemId={systemId}', [data.systemId]),
|
||||
title: '审核结果',
|
||||
width: '500px',
|
||||
height: '400px',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
@ -30,7 +30,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">名称 *</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="name" name="name" class="layui-input" value="" placeholder="请输入名称" maxlength="255">
|
||||
<input type="text" id="name" name="name" class="layui-input" value="" placeholder="请输入名称" maxlength="255" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
|
113
src/main/resources/static/route/system/update-examine.html
Normal file
113
src/main/resources/static/route/system/update-examine.html
Normal file
@ -0,0 +1,113 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/gateway-manage/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
<style>
|
||||
.layui-form-label {width: 120px !important;}
|
||||
.layui-form-pane .layui-form-text .layui-form-label {width: 100% !important;}
|
||||
.layui-form-pane .layui-input-block {margin-left: 120px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
|
||||
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
|
||||
<a href="javascript:void(0);"><cite>编辑内容</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">审核状态 *</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="isPass" value="0" title="否">
|
||||
<input type="radio" name="isPass" value="1" title="是" checked>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">说明</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="reason" name="reason" class="layui-textarea" placeholder="请输入说明" lay-verify="required"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交审核</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var systemId = top.restAjax.params(window.location.href).systemId;
|
||||
var viewerObj = {};
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.put(top.restAjax.path('api/system/update-examine/{systemId}', [systemId]), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function(index) {
|
||||
top.dialog.close(index);
|
||||
window.location.reload();
|
||||
},
|
||||
btn2: function() {
|
||||
closeBox();
|
||||
}
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// 校验
|
||||
form.verify({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -30,7 +30,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">名称 *</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="name" name="name" class="layui-input" value="" placeholder="请输入名称" maxlength="255">
|
||||
<input type="text" id="name" name="name" class="layui-input" value="" placeholder="请输入名称" maxlength="255" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
|
32
src/test/java/ink/wgink/wggatewaymanage/DataDemo.java
Normal file
32
src/test/java/ink/wgink/wggatewaymanage/DataDemo.java
Normal file
@ -0,0 +1,32 @@
|
||||
package ink.wgink.wggatewaymanage;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @ClassName: DataDemo
|
||||
* @Description: 数据
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/8/23 8:41 上午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class DataDemo {
|
||||
|
||||
@Test
|
||||
public void demoDataTest() throws IOException {
|
||||
long startTime = System.currentTimeMillis();
|
||||
FileWriter fileWriter = new FileWriter(new File("/Users/wanggeng/Desktop/data.txt"));
|
||||
fileWriter.write("name;sex;phone\n");
|
||||
for (int i = 0; i < 100000000; i++) {
|
||||
fileWriter.write(String.format("%s;%s;%s\n", "姓名" + i, i % 2 == 0 ? "男" : "女", String.format("138000%05d", i)));
|
||||
fileWriter.flush();
|
||||
}
|
||||
fileWriter.close();
|
||||
long endTime = System.currentTimeMillis();
|
||||
System.out.println("执行成功,耗时:" + (endTime - startTime) + "ms");
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user