package com.gkhy.assess.admin.controller.web;
|
|
|
import com.gkhy.assess.common.annotation.RepeatSubmit;
|
import com.gkhy.assess.common.api.CommonResult;
|
import com.gkhy.assess.system.domain.AssContract;
|
import com.gkhy.assess.system.service.AssContractService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.*;
|
|
/**
|
* <p>
|
* 合同管理表 前端控制器
|
* </p>
|
*
|
* @author kzy
|
* @since 2023-12-12 10:46:54
|
*/
|
@Api(tags = "合同管理前端控制器")
|
@RestController
|
@RequestMapping("/manage/contract")
|
public class AssContractController {
|
@Autowired
|
private AssContractService contractService;
|
|
@ApiOperation(value = "根据id获取合同详情")
|
@GetMapping("/detail/{contractId}")
|
public CommonResult contractDetail(@PathVariable(value = "contractId") Long contractId){
|
return CommonResult.success(contractService.getContractById(contractId));
|
}
|
|
@ApiOperation(value = "根据项目id获取合同详情")
|
@GetMapping("/getContractByProjectId")
|
public CommonResult getContractByProjectId( Long projectId){
|
return CommonResult.success(contractService.getContractByProjectId(projectId));
|
}
|
|
@RepeatSubmit
|
@ApiOperation(value = "创建合同")
|
@PostMapping("/add")
|
public CommonResult addContract(@Validated @RequestBody AssContract contract){
|
return CommonResult.success(contractService.addContract(contract));
|
}
|
|
@RepeatSubmit
|
@ApiOperation(value = "编辑合同")
|
@PutMapping("/edit")
|
public CommonResult editContract(@Validated @RequestBody AssContract contract){
|
return CommonResult.success(contractService.editContract(contract));
|
}
|
|
|
}
|