| | |
| | | package com.moral.controller;
|
| | |
|
| | | import static com.moral.common.util.WebUtils.getParametersStartingWith;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.web.bind.annotation.CrossOrigin;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestParam;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | |
|
| | | import com.moral.common.bean.ResultBean;
|
| | |
| | | * @return the install devices by operate user
|
| | | */
|
| | | @GetMapping(value = "myRelease")
|
| | | public ResultBean<List<Device>> getInstallDevicesByOperateUser(Integer uid, Integer pageIndex, Integer pageSize) {
|
| | | public ResultBean<List<Device>> getInstallDevicesByOperateUser(@RequestParam(value="uid", required=true)Integer uid, @RequestParam(defaultValue="0")Integer pageIndex, @RequestParam(defaultValue="0")Integer pageSize) {
|
| | | List<Device> devices = deviceService.getInstallDevicesByOperateUser(uid,pageIndex,pageSize);
|
| | | return new ResultBean<List<Device>>(devices);
|
| | | }
|
| | |
| | | * @return the device by mac
|
| | | */
|
| | | @GetMapping(value = "getEquInfoByMac")
|
| | | public ResultBean<Device> getDeviceByMac(String mac) {
|
| | | public ResultBean<Device> getDeviceByMac(@RequestParam(value="mac", required=true)String mac) {
|
| | | Device device = deviceService.getDeviceByMac(mac);
|
| | | return new ResultBean<Device>(device);
|
| | | }
|
| | |
| | | * @return the monitor points by area name
|
| | | */
|
| | | @GetMapping(value = "getMpointsByAreaName")
|
| | | public ResultBean<List<MonitorPoint>> getMonitorPointsByAreaName(String areaName) {
|
| | | List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsByAreaName(areaName);
|
| | | public ResultBean<List<MonitorPoint>> getMonitorPointsByAreaName(HttpServletRequest request) {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsByAreaName(parameters);
|
| | | return new ResultBean<List<MonitorPoint>>(monitorPoints);
|
| | | }
|
| | |
|
| | |
| | | * @return the organizations by area name
|
| | | */
|
| | | @GetMapping(value = "getOrgsByAreaName")
|
| | | public ResultBean<List<Organization>> getOrganizationsByAreaName(String areaName) {
|
| | | List<Organization> organizations = organizationService.getOrganizationsByAreaName(areaName);
|
| | | public ResultBean<List<Organization>> getOrganizationsByAreaName(HttpServletRequest request) {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | List<Organization> organizations = organizationService.getOrganizationsByAreaName(parameters);
|
| | | return new ResultBean<List<Organization>>(organizations);
|
| | | }
|
| | | }
|