LineVersionsController.java
2.66 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package com.bsth.controller;
import java.util.List;
import java.util.Map;
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 com.bsth.entity.LineVersions;
import com.bsth.repository.LineRepository;
import com.bsth.service.LineVersionsService;
/**
*
* @ClassName: LineController(线路版本控制器)
*
* @Extends : BaseController
*
* @Description: TODO(线路版本版控制层)
*
* @Author bsth@lq
*
* @Version 公交调度系统BS版 0.1
*
*/
@RestController
@RequestMapping("lineVersions")
public class LineVersionsController extends BaseController<LineVersions, Integer> {
@Autowired
private LineVersionsService service;
@Autowired
LineRepository lineRepository;
/**
* 获取线路所有版本
*/
@RequestMapping(value = "findLineVersionsMax", method = RequestMethod.GET)
public LineVersions findLineVersionsMax(@RequestParam(defaultValue = "lineId") int lineId) {
return service.findLineVersionsMax(lineId);
}
/**
* 获取线路所有版本
*
*/
@RequestMapping(value = "findByLineId", method = RequestMethod.GET)
public List<LineVersions> getLineCode(@RequestParam(defaultValue = "lineId") int lineId) {
return service.findByLineCode(lineId);
}
/**
* 根据id查询线路版本信息
*
*/
@RequestMapping(value = "findById", method = RequestMethod.GET)
public LineVersions findOne(@RequestParam(defaultValue = "id") int id) {
return service.findById(id);
}
/**
* 根据id修改线路版本信息
*
*/
@RequestMapping(value = "update", method = RequestMethod.POST)
public Map<String, Object> update(@RequestParam Map<String, Object> map) {
return service.update(map);
}
@RequestMapping(value = "add", method = RequestMethod.POST)
public Map<String, Object> add(@RequestParam Map<String, Object> map) {
return service.add(map);
}
/**
* 根据线路id获取当前版本号
*
*/
@RequestMapping(value = "findCurrentVersion", method = RequestMethod.GET)
public Integer findCurrentVersion(@RequestParam(defaultValue = "lineId") int lineId) {
return service.findCurrentVersion(lineId);
}
/**
* 根据id发布版本号(修改isupdate字段)
*/
@RequestMapping(value = "issueVersion", method = RequestMethod.POST)
public Map<String, Object> issueVersion(@RequestParam(defaultValue = "id") int id) {
return service.issueVersion(id);
}
}