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
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
63
64
65
66
67
68
69
70
71
72
73
74
package cn.autoform.web.controller.forminterface;
 
import java.util.List;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
 
import cn.autoform.db.entity.FormInterfaceEntity;
import cn.autoform.fw.exception.RestResult;
import cn.autoform.fw.utility.RestResultGenerator;
import cn.autoform.web.service.forminterface.FormInterfaceService;
 
/**
 * 
 * @author liumy
 *
 * @param <T>
 */
@RestController
public class FormInterfaceController<T> {
    
    @Autowired
    private FormInterfaceService formInterfaceService = null;
    
    /**
     * 新增一个接口
     * @param tenantID
     * @param formID
     * @param interfaceName
     * @param createUser
     * @param interfacemethod
     * @param customInterfacemethod
     * @return
     */
    @RequestMapping(value = "${requset.forminterface01}", method = RequestMethod.POST)
    public RestResult<String> createFormInterfaceService(@RequestBody FormInterfaceEntity formInterfaceEntity) {
        
        int nRs = formInterfaceService.createFormInterface(formInterfaceEntity);
        return RestResultGenerator.genSuccessResult(String.valueOf(nRs));
    }
    
    /**
     * 表单接口管理表中取出数据
     * @param tenantID
     * @param formID
     * @return
     */
    @RequestMapping(value = "${requset.forminterface02}", method = RequestMethod.GET)
    public RestResult<List<FormInterfaceEntity>> getFormInterfaceListService(String tenantID, String formID) {
        List<FormInterfaceEntity> rsList = formInterfaceService.getFormInterfaceList(tenantID, formID);
        
        return RestResultGenerator.genSuccessResult(rsList);
    }
    
    /**
     * 删除一个接口
     * @param tenantID
     * @param formID
     * @param interfaceName
     * @return
     */
    @RequestMapping(value = "${requset.forminterface03}", method = RequestMethod.GET)
    public  RestResult<String> deleteFormInterfaceService(String tenantID, String formID, String interfaceName) {
        
        int nRs = formInterfaceService.deleteFormInterface(tenantID, formID, interfaceName);
        
        return RestResultGenerator.genSuccessResult(String.valueOf(nRs)); 
    }
    
    
}