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
56
57
58
59
package org.rcisoft.business.bfile.controller;
/*固定导入*/
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.rcisoft.common.controller.PaginationController;
import org.rcisoft.common.model.GridModel;
import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.Result;
import org.springframework.validation.BindingResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import org.rcisoft.business.bfile.entity.BPFile;
import org.rcisoft.business.bfile.service.BPFileService;
/**
* Created by on 2020-7-1 18:57:28.
*/
@RestController
@RequestMapping("/bpfile")
public class BPFileController extends PaginationController<BPFile> {
@Autowired
private BPFileService bPFileServiceImpl;
@ApiOperation(value="添加平台记录企业文件表", notes="添加平台记录企业文件表")
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping(value = "/add")
public Result add(@Valid BPFile bPFile, BindingResult bindingResult) {
PersistModel data = bPFileServiceImpl.save(bPFile);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bPFile);
}
@ApiOperation(value="删除平台记录企业文件表", notes="删除平台记录企业文件表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@DeleteMapping("/delete/{businessId:\\w+}")
public Result delete(@PathVariable String businessId,BPFile bPFile) {
bPFile.setBusinessId(businessId);
PersistModel data = bPFileServiceImpl.remove(bPFile);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
businessId);
}
}