BpmFreeProcessDefController.java
2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.hotent.runtime.controller;
import org.springframework.web.bind.annotation.GetMapping;
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.RequestParam;
import com.hotent.base.model.CommonResult;
import com.hotent.base.util.StringUtil;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.RestController;
import com.hotent.base.controller.BaseController;
import com.hotent.bpm.model.BpmFreeProcessDef;
import com.hotent.bpm.persistence.manager.BpmFreeProcessDefManager;
/**
* 自由流程定义备份表 前端控制器
*
* @company 广州宏天软件股份有限公司
* @author 超级管理员
* @since 2022-12-02
*/
@RestController
@RequestMapping("/bpmFreeProcessDef/v1/")
public class BpmFreeProcessDefController extends BaseController<BpmFreeProcessDefManager, BpmFreeProcessDef> {
/**
* 根据id获取自由流程定义备份表数据详情
* @param id
* @return
* @throws Exception
* ModelAndView
*/
@GetMapping(value="/getDetail")
@ApiOperation(value="根据id获取自由流程定义备份表数据详情",httpMethod = "GET",notes = "根据id获取自由流程定义备份表数据详情")
public CommonResult<BpmFreeProcessDef> getDetail(@ApiParam(name="id",value="业务对象主键", required = true)@RequestParam(required=true) String id) throws Exception{
return CommonResult.<BpmFreeProcessDef>ok().value(baseService.getDetail(id));
}
/**
* 新增,更新自由流程定义备份表
* @param bpmFreeProcessDef
* @throws Exception
* @return
* @exception
*/
@PostMapping(value="/save")
@ApiOperation(value = "新增,更新自由流程定义备份表数据", httpMethod = "POST", notes = "新增,更新自由流程定义备份表数据")
public CommonResult<String> save(@ApiParam(name="BpmFreeProcessDef",value="自由流程定义备份表对象", required = true)@RequestBody BpmFreeProcessDef bpmFreeProcessDef) throws Exception{
String msg = StringUtil.isEmpty(bpmFreeProcessDef.getId()) ? "添加自由流程定义备份表成功" : "更新自由流程定义备份表成功";
baseService.createOrUpdate(bpmFreeProcessDef);
return CommonResult.<String>ok().message(msg);
}
}