UcBatchSyncController.java
2.31 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
56
57
58
59
60
61
62
package com.hotent.uds.controller;
import com.hotent.uds.manager.UserSync;
import org.springframework.web.bind.annotation.*;
import com.hotent.base.model.CommonResult;
import com.hotent.base.util.StringUtil;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.hotent.base.controller.BaseController;
import com.hotent.uds.model.UcBatchSync;
import com.hotent.uds.manager.UcBatchSyncManager;
import javax.annotation.Resource;
import java.util.Map;
/**
* UDS同步记录表 前端控制器
*
* @company 广州宏天软件股份有限公司
* @author 欧阳高龙
* @since 2022-12-29
*/
@RestController
@RequestMapping("/api/sync/v1/")
public class UcBatchSyncController extends BaseController<UcBatchSyncManager, UcBatchSync> {
@Resource
private UserSync userSync;
/**
* 根据id获取UDS同步记录表数据详情
* @param id
* @return
* @throws Exception
* ModelAndView
*/
@GetMapping(value="/getDetail")
@ApiOperation(value="根据id获取UDS同步记录表数据详情",httpMethod = "GET",notes = "根据id获取UDS同步记录表数据详情")
public CommonResult<UcBatchSync> getDetail(@ApiParam(name="id",value="业务对象主键", required = true)@RequestParam(required=true) String id) throws Exception{
return CommonResult.<UcBatchSync>ok().value(baseService.getDetail(id));
}
/**
* 新增,更新UDS同步记录表
* @param ucBatchSync
* @throws Exception
* @return
* @exception
*/
@PostMapping(value="/save")
@ApiOperation(value = "新增,更新UDS同步记录表数据", httpMethod = "POST", notes = "新增,更新UDS同步记录表数据")
public CommonResult<String> save(@ApiParam(name="UcBatchSync",value="UDS同步记录表对象", required = true)@RequestBody UcBatchSync ucBatchSync) throws Exception{
String msg = StringUtil.isEmpty(ucBatchSync.getId()) ? "添加UDS同步记录表成功" : "更新UDS同步记录表成功";
baseService.createOrUpdate(ucBatchSync);
return CommonResult.<String>ok().message(msg);
}
@RequestMapping(value="execute",method= RequestMethod.POST, produces = { "application/json; charset=utf-8" })
public CommonResult<String> executeOne(@RequestBody(required = false) Map<String, Object> args) throws Exception{
userSync.executeOne(args);
return new CommonResult<>(true,"执行一次同步成功!");
}
}