ZnddStatusController.java
1.75 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
package com.bsth.controller.zndd;
import com.bsth.common.ResponseCode;
import com.bsth.controller.BaseController;
import com.bsth.entity.zndd.znddStatus;
import com.bsth.service.zndd.ZnddStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("znnd_status")
public class ZnddStatusController extends BaseController<znddStatus, Integer> {
@Autowired
ZnddStatusService znddStatusService;
/**
*新增类型
* */
@RequestMapping(value = "/add", method = RequestMethod.POST)
public Map<String, Object> add(znddStatus zs) {
Map<String, Object> result = new HashMap<>();
try {
znddStatusService.add(zs);
result.put("status", ResponseCode.SUCCESS);
} catch (Exception e) {
result.put("status", ResponseCode.ERROR);
result.put("msg", e.getMessage());
}
return result;
}
/**
*新增类型
* */
@RequestMapping(value = "/update", method = RequestMethod.POST)
public Map<String, Object> update(@RequestParam Integer id, @RequestParam Integer openStatus) {
Map<String, Object> result = new HashMap<>();
try {
znddStatusService.update(id,openStatus);
result.put("status", ResponseCode.SUCCESS);
} catch (Exception e) {
result.put("status", ResponseCode.ERROR);
result.put("msg", e.getMessage());
}
return result;
}
}