|
@@ -1,7 +1,11 @@
|
|
|
package com.judong.chuanyiserver.controller;
|
|
|
|
|
|
+import com.judong.chuanyiserver.annotation.WebLog;
|
|
|
import com.judong.chuanyiserver.entity.ChannelSetting;
|
|
|
+import com.judong.chuanyiserver.enums.ModelEnum;
|
|
|
+import com.judong.chuanyiserver.enums.OperationEnum;
|
|
|
import com.judong.chuanyiserver.enums.ResultEnum;
|
|
|
+import com.judong.chuanyiserver.enums.ServerEnum;
|
|
|
import com.judong.chuanyiserver.service.ChannelSettingService;
|
|
|
import com.judong.chuanyiserver.util.Blank;
|
|
|
import com.judong.chuanyiserver.util.Result;
|
|
@@ -25,8 +29,9 @@ public class ChannelSettingController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/channelSetting")
|
|
|
+ @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.PASSAGEWAY, OperationEnum = OperationEnum.ADD)
|
|
|
public Result channelSetting(@RequestBody ChannelSetting channelSetting) {
|
|
|
- if (Blank.isEmpty(channelSetting, channelSetting.getServerId(), channelSetting.getChannelName())) {
|
|
|
+ if (Blank.isEmpty(channelSetting, channelSetting.getServerId(), channelSetting.getChannelName(), channelSetting.getReadMechanism(), channelSetting.getReadPolicy(), channelSetting.getPolicyValue())) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
|
}
|
|
|
return channelSettingService.channelSetting(channelSetting);
|
|
@@ -40,6 +45,7 @@ public class ChannelSettingController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getChannelSetting")
|
|
|
+ @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.PASSAGEWAY, OperationEnum = OperationEnum.SELECT)
|
|
|
public Result getChannelSetting(Integer serverId, String channelName) {
|
|
|
if (Blank.isEmpty(serverId, channelName)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
@@ -54,6 +60,7 @@ public class ChannelSettingController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getConnectTree")
|
|
|
+ @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.CONFIGURE, OperationEnum = OperationEnum.SELECT)
|
|
|
public Result getConnectTree(Integer serverId) throws Exception {
|
|
|
if (Blank.isEmpty(serverId)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
@@ -68,6 +75,7 @@ public class ChannelSettingController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/assignChannelSettingList")
|
|
|
+ @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.CONFIGURE, OperationEnum = OperationEnum.ADD)
|
|
|
public Result assignChannelSettingList(@RequestBody ChannelSetting channelSetting) {
|
|
|
if (Blank.isEmpty(channelSetting, channelSetting.getServerId(), channelSetting.getChannelNameList(), channelSetting.getConfigName())) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
@@ -83,6 +91,7 @@ public class ChannelSettingController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/renameConfig")
|
|
|
+ @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.CONFIGURE, OperationEnum = OperationEnum.UPDATE)
|
|
|
public Result renameConfig(Integer configId, String configName) {
|
|
|
if (Blank.isEmpty(configId, configName)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
@@ -97,6 +106,7 @@ public class ChannelSettingController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/selectConfig/{configId}")
|
|
|
+ @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.CONFIGURE, OperationEnum = OperationEnum.SELECT)
|
|
|
public Result selectConfig(@PathVariable Integer configId) {
|
|
|
if (Blank.isEmpty(configId)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
@@ -111,6 +121,7 @@ public class ChannelSettingController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/deleteConfig/{configId}")
|
|
|
+ @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.CONFIGURE, OperationEnum = OperationEnum.DELETE)
|
|
|
public Result deleteConfig(@PathVariable Integer configId) {
|
|
|
if (Blank.isEmpty(configId)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
@@ -126,10 +137,27 @@ public class ChannelSettingController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/runConfigById")
|
|
|
+ @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.RUNNING, OperationEnum = OperationEnum.READ)
|
|
|
public Result runConfigById(Integer configId, Integer runState) throws Exception {
|
|
|
if (Blank.isEmpty(configId, runState)) {
|
|
|
return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
|
}
|
|
|
return channelSettingService.runConfigById(configId, runState);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 传入服务器id从新获取配置信息
|
|
|
+ *
|
|
|
+ * @param serverId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getConfigList")
|
|
|
+ @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.CONFIGURE, OperationEnum = OperationEnum.SELECT)
|
|
|
+ public Result getConfigList(Integer serverId) {
|
|
|
+ if (Blank.isEmpty(serverId)) {
|
|
|
+ return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), ResultEnum.REQUEST_WRONGPARAMS.getRespMsg());
|
|
|
+ }
|
|
|
+ return channelSettingService.getConfigList(serverId);
|
|
|
+ }
|
|
|
+
|
|
|
}
|