|
@@ -1,12 +1,13 @@
|
|
|
package com.onemap.apply.controller.gw;
|
|
|
|
|
|
import com.onemap.apply.service.gw.GwService;
|
|
|
-import com.onemap.common.core.web.domain.MsgResult;
|
|
|
import com.onemap.common.core.web.domain.RequestResult;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import javax.validation.Valid;
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
@@ -16,9 +17,14 @@ public class GwController {
|
|
|
GwService gwService;
|
|
|
|
|
|
@RequestMapping("/GetInfo")
|
|
|
- public RequestResult GetList(Integer type, String key) {
|
|
|
+ public RequestResult GetList(@Valid @NotNull Integer type, String key) {
|
|
|
+ if (type != null && (type != 1 && type != 2)) {
|
|
|
+ return RequestResult.error("查询类型错误");
|
|
|
+ }
|
|
|
Map<String, Object> data = gwService.getData(type, key);
|
|
|
-
|
|
|
+ if(data==null){
|
|
|
+ return RequestResult.error("查询失败");
|
|
|
+ }
|
|
|
return RequestResult.success("查询成功", data);
|
|
|
}
|
|
|
}
|