|
@@ -0,0 +1,170 @@
|
|
|
+/*
|
|
|
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
|
|
|
+ *
|
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
|
+ * modification, are permitted provided that the following conditions are met:
|
|
|
+ *
|
|
|
+ * Redistributions of source code must retain the above copyright notice,
|
|
|
+ * this list of conditions and the following disclaimer.
|
|
|
+ * Redistributions in binary form must reproduce the above copyright
|
|
|
+ * notice, this list of conditions and the following disclaimer in the
|
|
|
+ * documentation and/or other materials provided with the distribution.
|
|
|
+ * Neither the name of the dreamlu.net developer nor the names of its
|
|
|
+ * contributors may be used to endorse or promote products derived from
|
|
|
+ * this software without specific prior written permission.
|
|
|
+ * Author: Chill 庄骞 (smallchill@163.com)
|
|
|
+ */
|
|
|
+package org.springblade.manager.controller;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import javax.validation.Valid;
|
|
|
+
|
|
|
+import org.springblade.core.mp.support.Condition;
|
|
|
+import org.springblade.core.mp.support.Query;
|
|
|
+import org.springblade.core.tool.api.R;
|
|
|
+import org.springblade.core.tool.utils.Func;
|
|
|
+import org.springblade.manager.entity.ProjectInfo;
|
|
|
+import org.springblade.manager.service.IProjectInfoService;
|
|
|
+import org.springblade.manager.vo.SingPfxManagementVO;
|
|
|
+import org.springblade.system.feign.ISysClient;
|
|
|
+import org.springblade.system.vo.RoleVO;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import org.springblade.manager.entity.SignPfxFile;
|
|
|
+import org.springblade.manager.vo.SignPfxFileVO;
|
|
|
+import org.springblade.manager.service.ISignPfxFileService;
|
|
|
+import org.springblade.core.boot.ctrl.BladeController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 个人/企业证书信息表 控制器
|
|
|
+ *
|
|
|
+ * @author BladeX
|
|
|
+ * @since 2022-06-24
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@AllArgsConstructor
|
|
|
+@RequestMapping("/signPfxFile")
|
|
|
+@Api(value = "个人/企业证书信息表", tags = "个人/企业证书信息表接口")
|
|
|
+public class SignPfxFileController extends BladeController {
|
|
|
+
|
|
|
+ private final ISignPfxFileService signPfxFileService;
|
|
|
+
|
|
|
+ private final IProjectInfoService projectInfoService;
|
|
|
+
|
|
|
+ private final ISysClient sysClient;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取系统所有角色划分
|
|
|
+ */
|
|
|
+ @GetMapping("/queryAllRoleList")
|
|
|
+ @ApiOperationSupport(order = 9)
|
|
|
+ @ApiOperation(value = "获取系统所有角色划分")
|
|
|
+ public R<List<RoleVO>> queryAllRoleList(){
|
|
|
+ return this.sysClient.search(null, null);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取所有有效项目
|
|
|
+ */
|
|
|
+ @GetMapping("/queryProjectList")
|
|
|
+ @ApiOperationSupport(order = 8)
|
|
|
+ @ApiOperation(value = "获取所有有效项目")
|
|
|
+ public R<List<ProjectInfo>> queryProjectList(){
|
|
|
+ return R.data(this.projectInfoService.list(Wrappers.<ProjectInfo>lambdaQuery().eq(ProjectInfo::getIsDeleted, 0)));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 证书管理分页
|
|
|
+ */
|
|
|
+ @PostMapping("/singPfxManagementPage")
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
|
+ @ApiOperation(value = "证书管理分页")
|
|
|
+ @ApiImplicitParam(name = "vo", value = "必传current、size, 选传projectId")
|
|
|
+ public R<IPage<SingPfxManagementVO>> singPfxManagementPage(SingPfxManagementVO vo){
|
|
|
+ Query query = new Query();
|
|
|
+ query.setSize(vo.getSize());
|
|
|
+ query.setCurrent(vo.getCurrent());
|
|
|
+
|
|
|
+ return R.data(this.signPfxFileService.singPfxManagementPage(Condition.getPage(query), vo));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 详情
|
|
|
+ */
|
|
|
+ @PostMapping("/getById")
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
+ @ApiOperation(value = "获取详情数据")
|
|
|
+ @ApiImplicitParam(name = "id", value = "列表数据主键ID", required = true)
|
|
|
+ public R<SignPfxFile> getById(Long id){
|
|
|
+ return R.data(this.signPfxFileService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 注册证书
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @PostMapping("/goRegister")
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperation(value = "注册(先对接接口,功能未完成)")
|
|
|
+ @ApiImplicitParam(name = "id", value = "列表数据主键ID", required = true)
|
|
|
+ public R<Boolean> goRegister(Long id){
|
|
|
+ return this.signPfxFileService.goRegister(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 自定义分页 个人/企业证书信息表
|
|
|
+ */
|
|
|
+ @GetMapping("/page")
|
|
|
+ @ApiOperationSupport(order = 1)
|
|
|
+ @ApiOperation(value = "分页")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "current", value = "当前页", required = true),
|
|
|
+ @ApiImplicitParam(name = "size", value = "当前页数量", required = true)
|
|
|
+ })
|
|
|
+ public R<IPage<SignPfxFileVO>> page(SignPfxFileVO vo) {
|
|
|
+ Query query = new Query();
|
|
|
+ query.setSize(vo.getSize());
|
|
|
+ query.setCurrent(vo.getCurrent());
|
|
|
+
|
|
|
+ IPage<SignPfxFileVO> pages = this.signPfxFileService.selectSignPfxFilePage(Condition.getPage(query), vo);
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增 个人/企业证书信息表
|
|
|
+ */
|
|
|
+ @PostMapping("/save")
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
+ @ApiOperation(value = "新增", notes = "传入signPfxFile")
|
|
|
+ public R save(@Valid @RequestBody SignPfxFile signPfxFile) {
|
|
|
+ return R.status(this.signPfxFileService.save(signPfxFile));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改 个人/企业证书信息表
|
|
|
+ */
|
|
|
+ @PostMapping("/update")
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
+ @ApiOperation(value = "修改", notes = "传入signPfxFile")
|
|
|
+ public R update(@Valid @RequestBody SignPfxFile signPfxFile) {
|
|
|
+ return R.status(this.signPfxFileService.updateById(signPfxFile));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除 个人/企业证书信息表
|
|
|
+ */
|
|
|
+ @PostMapping("/remove")
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
+ @ApiOperation(value = "逻辑删除", notes = "传入ids")
|
|
|
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
|
+ return R.status(this.signPfxFileService.deleteLogic(Func.toLongList(ids)));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|