证书类接口暂存
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
package com.sunyard.chsm.controller;
|
||||
|
||||
|
||||
import com.sunyard.chsm.constant.AuditLogConst;
|
||||
import com.sunyard.chsm.model.R;
|
||||
import com.sunyard.chsm.model.dto.CertDTO;
|
||||
import com.sunyard.chsm.param.*;
|
||||
import com.sunyard.chsm.service.AppCertService;
|
||||
import com.sunyard.chsm.service.CertService;
|
||||
import com.sunyard.ssp.common.annotation.AuditControllerLog;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
|
||||
/**
|
||||
* 证书管理类接口
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cert")
|
||||
public class CertController {
|
||||
|
||||
|
||||
@Resource
|
||||
private AppCertService appCertService;
|
||||
|
||||
@Resource
|
||||
private CertService certService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取证书信息
|
||||
*
|
||||
* @param certString 证书内容
|
||||
*/
|
||||
@GetMapping ("/info")
|
||||
public R<CertInfoResp> getCertInfo(@RequestParam String certString) {
|
||||
CertInfoResp certInfo = certService.getCertInfo(certString);
|
||||
return R.data(certInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取证书拓展信息
|
||||
*
|
||||
* @param certString 证书内容
|
||||
*/
|
||||
@GetMapping ("/exinfo")
|
||||
public R<CertExinfoResp> getCertExinfo(@RequestParam String certString) {
|
||||
CertExinfoResp certExinfo = certService.getCertExinfo(certString);
|
||||
return R.data(certExinfo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 验证证书
|
||||
*
|
||||
* @param certString 证书内容
|
||||
*/
|
||||
@GetMapping ("/check")
|
||||
public R<Boolean> certCheck(@RequestParam String certString) {
|
||||
Boolean res = certService.checkCert(certString);
|
||||
return R.data(res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 导入证书
|
||||
*
|
||||
* @param importCert 证书
|
||||
*/
|
||||
@GetMapping ("/import")
|
||||
public R<Void> importCert(@Valid @RequestBody CertDTO.ImportCert importCert) {
|
||||
appCertService.importCert(importCert);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除证书
|
||||
*
|
||||
* @param id id
|
||||
* @return void
|
||||
*/
|
||||
@DeleteMapping
|
||||
@AuditControllerLog(description = "删除证书", operateType = AuditLogConst.DELETE)
|
||||
public R<Void> delete(Long id) {
|
||||
appCertService.delete(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user