zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
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
package cn.autoform.web.controller.formLock;
 
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.RestController;
 
import cn.autoform.bean.FormLockEntity;
import cn.autoform.fw.exception.RestResult;
import cn.autoform.fw.utility.RestResultGenerator;
import cn.autoform.web.controller.resumable.redis.FormLock;
 
@RestController
public class FormLockController {
    
    @Autowired
    private FormLock formLock;
    
    
    @PostMapping("${request.formlock01}")
    public RestResult<String> getLock(@RequestBody FormLockEntity lock){
        return RestResultGenerator.genSuccessResult(formLock.getLock(lock.getFormId(), lock.getDataRowNum(), lock.getTenantId(), lock.getCompanyId()));
    }
    @PostMapping("${request.formlock02}")
    public RestResult<String> getKey(@RequestBody FormLockEntity lock){
        return RestResultGenerator.genSuccessResult(formLock.getKey(lock.getFormId(), lock.getDataRowNum(), lock.getTenantId(), lock.getCompanyId(), lock.getLock()));
    }
    @PostMapping("${request.formlock03}")
    public RestResult<String> unLock(@RequestBody FormLockEntity lock){
        formLock.unLock(lock.getFormId(), lock.getDataRowNum(), lock.getTenantId(), lock.getCompanyId(), lock.getLock(), lock.getLockInfo());
        return RestResultGenerator.genSuccessResult(null);
    }
 
}