CertDictController.java 2.96 KB
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.cert.AddCertDTO;
import com.subsidy.dto.cert.GetAllCertsDTO;
import com.subsidy.dto.cert.GetOneCertDTO;
import com.subsidy.model.CertDictDO;
import com.subsidy.service.CertDictService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;

/**
 * <p>
 * 证书字典表 前端控制器
 * </p>
 *
 * @author DengMin
 * @since 2022-05-11
 */
@RestController
@Api(tags = "证书字典表")
@RequestMapping("/certDict")
public class CertDictController {

    @Autowired
    private CertDictService certDictService;

    @PostMapping("addCert")
    @ApiOperation("添加证书  certName price coverPage title副标题  scribePrice 划线价格 certDesc 证书简介  detail  chargeAndSubsidy 学费和补贴  serviceProcess服务流程 refundGuarantee 退费流程  typeIds[] 类型id requirementDesc 条件说明 submitDesc 提交说明")
    public ResponseVO addCert(@RequestBody AddCertDTO addCertDTO){
        return ResponseData.generateCreatedResponse(0,certDictService.addCert(addCertDTO));
    }

    @PostMapping("deleteCert")
    @ApiOperation("删除证书 id ")
    public ResponseVO deleteCert(@RequestBody CertDictDO certDictDO){
        return ResponseData.generateCreatedResponse(0,certDictService.deleteCert(certDictDO));
    }

    @PostMapping("updateCert")
    @ApiOperation("编辑证书 id  certName price coverPage title副标题  scribePrice 划线价格 划线价格 detail  chargeAndSubsidy 学费和补贴  serviceProcess服务流程 refundGuarantee 退费流程 typeId 类型id requirementDesc 条件说明 submitDesc 提交说明")
    public ResponseVO updateCert(@RequestBody AddCertDTO addCertDTO){
        return ResponseData.generateCreatedResponse(0,certDictService.updateCert(addCertDTO));
    }

    @PostMapping("getOneCert")
    @ApiOperation("获取一个证书 id  userId")
    public ResponseVO getOneCert(@RequestBody GetOneCertDTO getOneCertDTO){
        return ResponseData.generateCreatedResponse(0,certDictService.getOneCert(getOneCertDTO));
    }

    @PostMapping("getAllCerts")
    @ApiOperation("获取全部的证书(包含项目类型) typeId  certName  pageSize  pageNum  ")
    public ResponseVO getAllCerts(@RequestBody GetAllCertsDTO getAllCertsDTO){
        return ResponseData.generateCreatedResponse(0,certDictService.getAllCerts(getAllCertsDTO));
    }

    @PostMapping("getAllCertsWithoutType")
    @ApiOperation("获取所有证书(下拉列表用)")
    public ResponseVO getAllCertsWithoutType(){
        return ResponseData.generateCreatedResponse(0,certDictService.getAllCertsWithoutType());
    }

}