Browse Source

增加节点接口

zhuhaiwen 3 years ago
parent
commit
ae072d11a7

+ 76 - 2
oa-app/src/main/java/com/css/oa/exam/node/controller/NodeController.java

3
import com.css.oa.exam.base.BaseController;
3
import com.css.oa.exam.base.BaseController;
4
import com.css.oa.exam.constants.BoolState;
4
import com.css.oa.exam.constants.BoolState;
5
import com.css.oa.exam.node.repository.Node;
5
import com.css.oa.exam.node.repository.Node;
6
import com.css.oa.exam.node.service.NodeQueryService;
6
import com.css.oa.exam.node.service.NodeService;
7
import com.css.oa.exam.node.service.NodeService;
7
import com.css.oa.utils.Result;
8
import com.css.oa.utils.Result;
8
import io.swagger.annotations.Api;
9
import io.swagger.annotations.Api;
41
    public Result update(@RequestBody Node obj) {
42
    public Result update(@RequestBody Node obj) {
42
        Result<Map> result;
43
        Result<Map> result;
43
        try {
44
        try {
44
            if(TextUtils.isEmpty(obj.uuid)){
45
            if (TextUtils.isEmpty(obj.uuid)) {
45
                return setErr("uuid不能为空");
46
                return setErr("uuid不能为空");
46
            }
47
            }
47
            if(obj.is_open == BoolState.DEFULT){
48
            if (obj.is_open == BoolState.DEFULT) {
48
                return setErr("is_open不能为空");
49
                return setErr("is_open不能为空");
49
            }
50
            }
50
            mService.update(obj);
51
            mService.update(obj);
88
        return result;
89
        return result;
89
    }
90
    }
90
91
92
    @Autowired
93
    NodeQueryService nodeQueryService;
94
95
    @ApiOperation(value = "报名节点是否已经关闭")
96
    @GetMapping("/enrollIsClose")
97
    public Result enrollIsClose() {
98
        Result<Map> result;
99
        try {
100
            boolean b = nodeQueryService.enrollIsClose();
101
            result = setResult("" + b);
102
        } catch (Exception e) {
103
            result = setErr(e.getMessage());
104
            e.printStackTrace();
105
        }
106
        return result;
107
    }
108
109
    @ApiOperation(value = "缴费节点是否已经关闭")
110
    @GetMapping("/payIsClose")
111
    public Result payIsClose() {
112
        Result<Map> result;
113
        try {
114
            boolean b = nodeQueryService.payIsClose();
115
            result = setResult("" + b);
116
        } catch (Exception e) {
117
            result = setErr(e.getMessage());
118
            e.printStackTrace();
119
        }
120
        return result;
121
    }
122
123
    @ApiOperation(value = "报名节点是否已经关闭")
124
    @GetMapping("/printAdmissionIsClose")
125
    public Result printAdmissionIsClose() {
126
        Result<Map> result;
127
        try {
128
            boolean b = nodeQueryService.printAdmissionIsClose();
129
            result = setResult("" + b);
130
        } catch (Exception e) {
131
            result = setErr(e.getMessage());
132
            e.printStackTrace();
133
        }
134
        return result;
135
    }
136
137
    @ApiOperation(value = "报名节点是否已经关闭")
138
    @GetMapping("/joinExamIsClose")
139
    public Result joinExamIsClose() {
140
        Result<Map> result;
141
        try {
142
            boolean b = nodeQueryService.joinExamIsClose();
143
            result = setResult("" + b);
144
        } catch (Exception e) {
145
            result = setErr(e.getMessage());
146
            e.printStackTrace();
147
        }
148
        return result;
149
    }
150
151
    @ApiOperation(value = "报名节点是否已经关闭")
152
    @GetMapping("/queryScoreIsClose")
153
    public Result queryScoreIsClose() {
154
        Result<Map> result;
155
        try {
156
            boolean b = nodeQueryService.queryScoreIsClose();
157
            result = setResult("" + b);
158
        } catch (Exception e) {
159
            result = setErr(e.getMessage());
160
            e.printStackTrace();
161
        }
162
        return result;
163
    }
164
91
}
165
}