|
|
@ -4,6 +4,7 @@ import a8k.app.service.setting.AppSettingsMgrService; |
|
|
|
import a8k.app.dao.db.type.AppSetting; |
|
|
|
import a8k.app.dao.db.type.appsetting.settingenum.*; |
|
|
|
import a8k.app.a8ktype.ui.ApiRet; |
|
|
|
import a8k.app.service.statemgr.GStateMgrService; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
import jakarta.annotation.Resource; |
|
|
@ -23,6 +24,9 @@ public class AppSettingControler { |
|
|
|
@Resource |
|
|
|
AppSettingsMgrService appSettingsMgrService; |
|
|
|
|
|
|
|
@Resource |
|
|
|
GStateMgrService gstate; |
|
|
|
|
|
|
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
|
|
// EXT FUNC |
|
|
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
|
@ -129,4 +133,36 @@ public class AppSettingControler { |
|
|
|
return ApiRet.success(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "设置DHCP") |
|
|
|
@PostMapping("/setDHCCP") |
|
|
|
public ApiRet<Void> setDHCP(Boolean val) { |
|
|
|
appSettingsMgrService.setDHCP(val); |
|
|
|
return ApiRet.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@Operation(summary = "设置本地IP") |
|
|
|
@PostMapping("/setLocalIp") |
|
|
|
public ApiRet<Void> setLocalIp(String val) { |
|
|
|
appSettingsMgrService.setLocalIp(val); |
|
|
|
return ApiRet.success(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static class DeviceInfo { |
|
|
|
public String appVersion; |
|
|
|
public String mcuVersion; |
|
|
|
public String sn; |
|
|
|
} |
|
|
|
|
|
|
|
@Operation(summary = "获取设备信息") |
|
|
|
@PostMapping("/getDeviceInfo") |
|
|
|
public ApiRet<DeviceInfo> getDeviceInfo() { |
|
|
|
DeviceInfo info = new DeviceInfo(); |
|
|
|
info.appVersion = gstate.getAppVersion(); |
|
|
|
info.mcuVersion = gstate.getMcuVersion(); |
|
|
|
info.sn = gstate.getSn(); |
|
|
|
return ApiRet.success(info); |
|
|
|
} |
|
|
|
|
|
|
|
} |