Commit 9036d67184415b8c0f6410a50e4268b18aa318b5
Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing
1 changed file
with
16 additions
and
0 deletions
src/main/java/com/bsth/controller/LineController.java
| @@ -77,6 +77,22 @@ public class LineController extends BaseController<Line, Integer> { | @@ -77,6 +77,22 @@ public class LineController extends BaseController<Line, Integer> { | ||
| 77 | return service.save(t); | 77 | return service.save(t); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | + /** | ||
| 81 | + * | ||
| 82 | + * 更改 | ||
| 83 | + * | ||
| 84 | + */ | ||
| 85 | + @RequestMapping(value="/update", method = RequestMethod.POST) | ||
| 86 | + public Map<String, Object> update(Line l){ | ||
| 87 | + Map<String, Object> map = new HashMap<>(); | ||
| 88 | + if((l.getId().toString().length()) > 6 || service.lineCodeVerification(l.getLineCode()).equals("true") ) { | ||
| 89 | + | ||
| 90 | + map.put("status", ResponseCode.ERROR); | ||
| 91 | + return map; | ||
| 92 | + } | ||
| 93 | + return service.save(l); | ||
| 94 | + } | ||
| 95 | + | ||
| 80 | @RequestMapping(value ="/findById" , method = RequestMethod.GET) | 96 | @RequestMapping(value ="/findById" , method = RequestMethod.GET) |
| 81 | Line findByID(@RequestParam(defaultValue = "id") Integer id){ | 97 | Line findByID(@RequestParam(defaultValue = "id") Integer id){ |
| 82 | return service.findById(id); | 98 | return service.findById(id); |