Showing
100 changed files
with
526 additions
and
483 deletions
Too many changes to show.
To preserve performance only 100 of 162 files are displayed.
@@ -920,7 +920,7 @@ public abstract class BaseController { | @@ -920,7 +920,7 @@ public abstract class BaseController { | ||
920 | if(transportType ==null || DeviceTransportType.DEFAULT.name().equals(transportType)){ | 920 | if(transportType ==null || DeviceTransportType.DEFAULT.name().equals(transportType)){ |
921 | deviceProfileData.setTransportConfiguration(new DefaultDeviceProfileTransportConfiguration()); | 921 | deviceProfileData.setTransportConfiguration(new DefaultDeviceProfileTransportConfiguration()); |
922 | }else if(DeviceTransportType.TCP.name().equals(transportType)){ | 922 | }else if(DeviceTransportType.TCP.name().equals(transportType)){ |
923 | - YtTcpDeviceProfileTransportConfiguration tcpDeviceProfileTransportConfiguration = (YtTcpDeviceProfileTransportConfiguration) deviceProfileData.getTransportConfiguration(); | 923 | + TkTcpDeviceProfileTransportConfiguration tcpDeviceProfileTransportConfiguration = (TkTcpDeviceProfileTransportConfiguration) deviceProfileData.getTransportConfiguration(); |
924 | tcpDeviceProfileTransportConfiguration.setScriptText(scriptText); | 924 | tcpDeviceProfileTransportConfiguration.setScriptText(scriptText); |
925 | deviceProfileData.setTransportConfiguration(tcpDeviceProfileTransportConfiguration); | 925 | deviceProfileData.setTransportConfiguration(tcpDeviceProfileTransportConfiguration); |
926 | }else{ | 926 | }else{ |
@@ -11,7 +11,7 @@ import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | @@ -11,7 +11,7 @@ import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | ||
11 | import org.thingsboard.server.common.data.yunteng.dto.AlarmProfileDTO; | 11 | import org.thingsboard.server.common.data.yunteng.dto.AlarmProfileDTO; |
12 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 12 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
13 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 13 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
14 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 14 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
15 | import org.thingsboard.server.controller.BaseController; | 15 | import org.thingsboard.server.controller.BaseController; |
16 | import org.thingsboard.server.dao.yunteng.service.AlarmProfileService; | 16 | import org.thingsboard.server.dao.yunteng.service.AlarmProfileService; |
17 | 17 | ||
@@ -32,7 +32,7 @@ public class AlarmProfileController extends BaseController { | @@ -32,7 +32,7 @@ public class AlarmProfileController extends BaseController { | ||
32 | 32 | ||
33 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 33 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
34 | @ApiOperation("分页") | 34 | @ApiOperation("分页") |
35 | - public YtPageData<AlarmProfileDTO> pageAlarmProfile( | 35 | + public TkPageData<AlarmProfileDTO> pageAlarmProfile( |
36 | @RequestParam(PAGE_SIZE) int pageSize, | 36 | @RequestParam(PAGE_SIZE) int pageSize, |
37 | @RequestParam(PAGE) int page, | 37 | @RequestParam(PAGE) int page, |
38 | @RequestParam(value = "status", required = false) Integer status, | 38 | @RequestParam(value = "status", required = false) Integer status, |
@@ -16,9 +16,8 @@ import org.thingsboard.server.common.data.yunteng.dto.HomePageLeftTopDTO; | @@ -16,9 +16,8 @@ import org.thingsboard.server.common.data.yunteng.dto.HomePageLeftTopDTO; | ||
16 | import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; | 16 | import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; |
17 | import org.thingsboard.server.common.data.yunteng.dto.TenantTransportMessageDTO; | 17 | import org.thingsboard.server.common.data.yunteng.dto.TenantTransportMessageDTO; |
18 | import org.thingsboard.server.common.data.yunteng.dto.statistics.HomePageAppDTO; | 18 | import org.thingsboard.server.common.data.yunteng.dto.statistics.HomePageAppDTO; |
19 | -import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; | ||
20 | import org.thingsboard.server.common.data.yunteng.enums.TrendType; | 19 | import org.thingsboard.server.common.data.yunteng.enums.TrendType; |
21 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 20 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
22 | import org.thingsboard.server.controller.BaseController; | 21 | import org.thingsboard.server.controller.BaseController; |
23 | import org.thingsboard.server.dao.exception.DataValidationException; | 22 | import org.thingsboard.server.dao.exception.DataValidationException; |
24 | import org.thingsboard.server.dao.yunteng.service.HomePageService; | 23 | import org.thingsboard.server.dao.yunteng.service.HomePageService; |
@@ -54,7 +53,7 @@ public class HomePageController extends BaseController { | @@ -54,7 +53,7 @@ public class HomePageController extends BaseController { | ||
54 | @GetMapping("right/overdue") | 53 | @GetMapping("right/overdue") |
55 | @ApiOperation(value = "获取右侧过期租户信息") | 54 | @ApiOperation(value = "获取右侧过期租户信息") |
56 | @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{})") | 55 | @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{})") |
57 | - public ResponseEntity<YtPageData<TenantDTO>> getRightTopInfo( | 56 | + public ResponseEntity<TkPageData<TenantDTO>> getRightTopInfo( |
58 | @RequestParam(PAGE) int page, @RequestParam(PAGE_SIZE) int pageSize) { | 57 | @RequestParam(PAGE) int page, @RequestParam(PAGE_SIZE) int pageSize) { |
59 | HashMap<String, Object> queryMap = new HashMap<>(); | 58 | HashMap<String, Object> queryMap = new HashMap<>(); |
60 | queryMap.put(PAGE_SIZE, pageSize); | 59 | queryMap.put(PAGE_SIZE, pageSize); |
@@ -12,13 +12,13 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; | @@ -12,13 +12,13 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; | ||
12 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; | 12 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
13 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; | 13 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
14 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 14 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
15 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 15 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
16 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 16 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
17 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 17 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
18 | import org.thingsboard.server.common.data.yunteng.dto.SysJobDTO; | 18 | import org.thingsboard.server.common.data.yunteng.dto.SysJobDTO; |
19 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 19 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
20 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 20 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
21 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 21 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
22 | import org.thingsboard.server.controller.BaseController; | 22 | import org.thingsboard.server.controller.BaseController; |
23 | import org.thingsboard.server.dao.util.yunteng.CronUtils; | 23 | import org.thingsboard.server.dao.util.yunteng.CronUtils; |
24 | import org.thingsboard.server.dao.util.yunteng.ScheduleUtils; | 24 | import org.thingsboard.server.dao.util.yunteng.ScheduleUtils; |
@@ -43,7 +43,7 @@ public class SysJobController extends BaseController { | @@ -43,7 +43,7 @@ public class SysJobController extends BaseController { | ||
43 | path = "/page", | 43 | path = "/page", |
44 | params = {PAGE_SIZE, PAGE}) | 44 | params = {PAGE_SIZE, PAGE}) |
45 | @ApiOperation(value = "分页") | 45 | @ApiOperation(value = "分页") |
46 | - public YtPageData<SysJobDTO> pageJob( | 46 | + public TkPageData<SysJobDTO> pageJob( |
47 | @RequestParam(PAGE_SIZE) int pageSize, | 47 | @RequestParam(PAGE_SIZE) int pageSize, |
48 | @RequestParam(PAGE) int page, | 48 | @RequestParam(PAGE) int page, |
49 | @RequestParam(value = "jobName", required = false) String jobName, | 49 | @RequestParam(value = "jobName", required = false) String jobName, |
@@ -91,7 +91,7 @@ public class SysJobController extends BaseController { | @@ -91,7 +91,7 @@ public class SysJobController extends BaseController { | ||
91 | public ResponseResult<Boolean> run(@PathVariable("id") String id) throws SchedulerException { | 91 | public ResponseResult<Boolean> run(@PathVariable("id") String id) throws SchedulerException { |
92 | SysJobDTO jobDTO = jobService.selectJobById(id); | 92 | SysJobDTO jobDTO = jobService.selectJobById(id); |
93 | if(null == jobDTO){ | 93 | if(null == jobDTO){ |
94 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | 94 | + throw new TkDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); |
95 | } | 95 | } |
96 | boolean result = jobService.run(jobDTO); | 96 | boolean result = jobService.run(jobDTO); |
97 | return ResponseResult.success( | 97 | return ResponseResult.success( |
@@ -104,7 +104,7 @@ public class SysJobController extends BaseController { | @@ -104,7 +104,7 @@ public class SysJobController extends BaseController { | ||
104 | public ResponseResult<SysJobDTO> save(@RequestBody @Validated(AddGroup.class) SysJobDTO job) | 104 | public ResponseResult<SysJobDTO> save(@RequestBody @Validated(AddGroup.class) SysJobDTO job) |
105 | throws SchedulerException, ThingsboardException { | 105 | throws SchedulerException, ThingsboardException { |
106 | if (StringUtils.isNotEmpty(job.getId())) { | 106 | if (StringUtils.isNotEmpty(job.getId())) { |
107 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 107 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
108 | } | 108 | } |
109 | return saveOrUpdate(job); | 109 | return saveOrUpdate(job); |
110 | } | 110 | } |
@@ -115,7 +115,7 @@ public class SysJobController extends BaseController { | @@ -115,7 +115,7 @@ public class SysJobController extends BaseController { | ||
115 | public ResponseResult<SysJobDTO> update(@RequestBody @Validated(UpdateGroup.class) SysJobDTO job) | 115 | public ResponseResult<SysJobDTO> update(@RequestBody @Validated(UpdateGroup.class) SysJobDTO job) |
116 | throws SchedulerException, ThingsboardException { | 116 | throws SchedulerException, ThingsboardException { |
117 | if (StringUtils.isEmpty(job.getId())) { | 117 | if (StringUtils.isEmpty(job.getId())) { |
118 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 118 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
119 | } | 119 | } |
120 | return saveOrUpdate(job); | 120 | return saveOrUpdate(job); |
121 | } | 121 | } |
@@ -125,7 +125,7 @@ public class SysJobController extends BaseController { | @@ -125,7 +125,7 @@ public class SysJobController extends BaseController { | ||
125 | @ApiOperation(value = "校验cron表达式是否有效") | 125 | @ApiOperation(value = "校验cron表达式是否有效") |
126 | public boolean checkCronExpressionIsValid(@PathVariable("cronExpression") String cronExpression) { | 126 | public boolean checkCronExpressionIsValid(@PathVariable("cronExpression") String cronExpression) { |
127 | if (StringUtils.isEmpty(cronExpression)) { | 127 | if (StringUtils.isEmpty(cronExpression)) { |
128 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 128 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
129 | } | 129 | } |
130 | return jobService.checkCronExpressionIsValid(cronExpression); | 130 | return jobService.checkCronExpressionIsValid(cronExpression); |
131 | } | 131 | } |
@@ -136,7 +136,7 @@ public class SysJobController extends BaseController { | @@ -136,7 +136,7 @@ public class SysJobController extends BaseController { | ||
136 | @ApiOperation(value = "查询cron表达式近5次的执行时间") | 136 | @ApiOperation(value = "查询cron表达式近5次的执行时间") |
137 | public ResponseResult queryCronExpression(@PathVariable("cronExpression") String cronExpression) { | 137 | public ResponseResult queryCronExpression(@PathVariable("cronExpression") String cronExpression) { |
138 | if (!jobService.checkCronExpressionIsValid(cronExpression)) { | 138 | if (!jobService.checkCronExpressionIsValid(cronExpression)) { |
139 | - throw new YtDataValidationException(ErrorMessage.CRON_INVALID.getMessage()); | 139 | + throw new TkDataValidationException(ErrorMessage.CRON_INVALID.getMessage()); |
140 | } | 140 | } |
141 | List<String> dateList = CronUtils.getRecentTriggerTime(cronExpression); | 141 | List<String> dateList = CronUtils.getRecentTriggerTime(cronExpression); |
142 | return ResponseResult.success(dateList); | 142 | return ResponseResult.success(dateList); |
@@ -146,28 +146,28 @@ public class SysJobController extends BaseController { | @@ -146,28 +146,28 @@ public class SysJobController extends BaseController { | ||
146 | throws SchedulerException{ | 146 | throws SchedulerException{ |
147 | String message = StringUtils.isEmpty(job.getId()) ? "新增任务'" : "修改任务'"; | 147 | String message = StringUtils.isEmpty(job.getId()) ? "新增任务'" : "修改任务'"; |
148 | if (!CronUtils.isValid(job.getCronExpression())) { | 148 | if (!CronUtils.isValid(job.getCronExpression())) { |
149 | - throw new YtDataValidationException(message + job.getJobName() + "'失败,Cron表达式不正确"); | 149 | + throw new TkDataValidationException(message + job.getJobName() + "'失败,Cron表达式不正确"); |
150 | } else if (StringUtils.containsIgnoreCase( | 150 | } else if (StringUtils.containsIgnoreCase( |
151 | job.getInvokeTarget(), FastIotConstants.ScheduleConstants.LOOKUP_RMI)) { | 151 | job.getInvokeTarget(), FastIotConstants.ScheduleConstants.LOOKUP_RMI)) { |
152 | - throw new YtDataValidationException(message + job.getJobName() + "'失败,目标字符串不允许'rmi'调用"); | 152 | + throw new TkDataValidationException(message + job.getJobName() + "'失败,目标字符串不允许'rmi'调用"); |
153 | } else if (ScheduleUtils.containsAnyIgnoreCase( | 153 | } else if (ScheduleUtils.containsAnyIgnoreCase( |
154 | job.getInvokeTarget(), | 154 | job.getInvokeTarget(), |
155 | new String[] { | 155 | new String[] { |
156 | FastIotConstants.ScheduleConstants.LOOKUP_LDAP, | 156 | FastIotConstants.ScheduleConstants.LOOKUP_LDAP, |
157 | FastIotConstants.ScheduleConstants.LOOKUP_LDAPS | 157 | FastIotConstants.ScheduleConstants.LOOKUP_LDAPS |
158 | })) { | 158 | })) { |
159 | - throw new YtDataValidationException(message + job.getJobName() + "'失败,目标字符串不允许'ldap(s)'调用"); | 159 | + throw new TkDataValidationException(message + job.getJobName() + "'失败,目标字符串不允许'ldap(s)'调用"); |
160 | } else if (ScheduleUtils.containsAnyIgnoreCase( | 160 | } else if (ScheduleUtils.containsAnyIgnoreCase( |
161 | job.getInvokeTarget(), | 161 | job.getInvokeTarget(), |
162 | new String[] { | 162 | new String[] { |
163 | FastIotConstants.ScheduleConstants.HTTP, FastIotConstants.ScheduleConstants.HTTPS | 163 | FastIotConstants.ScheduleConstants.HTTP, FastIotConstants.ScheduleConstants.HTTPS |
164 | })) { | 164 | })) { |
165 | - throw new YtDataValidationException(message + job.getJobName() + "'失败,目标字符串不允许'http(s)'调用"); | 165 | + throw new TkDataValidationException(message + job.getJobName() + "'失败,目标字符串不允许'http(s)'调用"); |
166 | } else if (ScheduleUtils.containsAnyIgnoreCase( | 166 | } else if (ScheduleUtils.containsAnyIgnoreCase( |
167 | job.getInvokeTarget(), FastIotConstants.ScheduleConstants.JOB_ERROR_STR)) { | 167 | job.getInvokeTarget(), FastIotConstants.ScheduleConstants.JOB_ERROR_STR)) { |
168 | - throw new YtDataValidationException(message + job.getJobName() + "'失败,目标字符串存在违规"); | 168 | + throw new TkDataValidationException(message + job.getJobName() + "'失败,目标字符串存在违规"); |
169 | } else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) { | 169 | } else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) { |
170 | - throw new YtDataValidationException(message + job.getJobName() + "'失败,目标字符串不在白名单内"); | 170 | + throw new TkDataValidationException(message + job.getJobName() + "'失败,目标字符串不在白名单内"); |
171 | } | 171 | } |
172 | return ResponseResult.success(jobService.saveOrUpdateJob(job)); | 172 | return ResponseResult.success(jobService.saveOrUpdateJob(job)); |
173 | } | 173 | } |
@@ -11,7 +11,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | @@ -11,7 +11,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | ||
11 | import org.thingsboard.server.common.data.yunteng.dto.SysJobLogDTO; | 11 | import org.thingsboard.server.common.data.yunteng.dto.SysJobLogDTO; |
12 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 12 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
13 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 13 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
14 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 14 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
15 | import org.thingsboard.server.controller.BaseController; | 15 | import org.thingsboard.server.controller.BaseController; |
16 | import org.thingsboard.server.dao.yunteng.service.TkSysJobLogService; | 16 | import org.thingsboard.server.dao.yunteng.service.TkSysJobLogService; |
17 | 17 | ||
@@ -37,7 +37,7 @@ public class SysJobLogController extends BaseController { | @@ -37,7 +37,7 @@ public class SysJobLogController extends BaseController { | ||
37 | path = "/page", | 37 | path = "/page", |
38 | params = {PAGE_SIZE, PAGE}) | 38 | params = {PAGE_SIZE, PAGE}) |
39 | @ApiOperation(value = "分页") | 39 | @ApiOperation(value = "分页") |
40 | - public YtPageData<SysJobLogDTO> page( | 40 | + public TkPageData<SysJobLogDTO> page( |
41 | @RequestParam(PAGE_SIZE) int pageSize, | 41 | @RequestParam(PAGE_SIZE) int pageSize, |
42 | @RequestParam(PAGE) int page, | 42 | @RequestParam(PAGE) int page, |
43 | @RequestParam(value = "jobName", required = false) String jobName, | 43 | @RequestParam(value = "jobName", required = false) String jobName, |
@@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; | @@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; | ||
13 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; | 13 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
14 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | 14 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
15 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; | 15 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
16 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 16 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
17 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 17 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
18 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 18 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
19 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; | 19 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; |
@@ -21,7 +21,7 @@ import org.thingsboard.server.common.data.yunteng.dto.ThingsModelDTO; | @@ -21,7 +21,7 @@ import org.thingsboard.server.common.data.yunteng.dto.ThingsModelDTO; | ||
21 | import org.thingsboard.server.common.data.yunteng.enums.FunctionTypeEnum; | 21 | import org.thingsboard.server.common.data.yunteng.enums.FunctionTypeEnum; |
22 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 22 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
23 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; | 23 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; |
24 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 24 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
25 | import org.thingsboard.server.controller.BaseController; | 25 | import org.thingsboard.server.controller.BaseController; |
26 | import org.thingsboard.server.dao.yunteng.service.ThingsModelService; | 26 | import org.thingsboard.server.dao.yunteng.service.ThingsModelService; |
27 | import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; | 27 | import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; |
@@ -44,7 +44,7 @@ public class ThingsModelController extends BaseController { | @@ -44,7 +44,7 @@ public class ThingsModelController extends BaseController { | ||
44 | path = "/page", | 44 | path = "/page", |
45 | params = {PAGE_SIZE, PAGE}) | 45 | params = {PAGE_SIZE, PAGE}) |
46 | @ApiOperation(value = "分页") | 46 | @ApiOperation(value = "分页") |
47 | - public YtPageData<ThingsModelDTO> page( | 47 | + public TkPageData<ThingsModelDTO> page( |
48 | @RequestParam("deviceProfileId") String deviceProfileId, | 48 | @RequestParam("deviceProfileId") String deviceProfileId, |
49 | @RequestParam(PAGE_SIZE) int pageSize, | 49 | @RequestParam(PAGE_SIZE) int pageSize, |
50 | @RequestParam(PAGE) int page, | 50 | @RequestParam(PAGE) int page, |
@@ -54,7 +54,7 @@ public class ThingsModelController extends BaseController { | @@ -54,7 +54,7 @@ public class ThingsModelController extends BaseController { | ||
54 | @RequestParam(value = ORDER_TYPE, required = false) OrderTypeEnum orderType) | 54 | @RequestParam(value = ORDER_TYPE, required = false) OrderTypeEnum orderType) |
55 | throws ThingsboardException { | 55 | throws ThingsboardException { |
56 | if (StringUtils.isEmpty(deviceProfileId)) { | 56 | if (StringUtils.isEmpty(deviceProfileId)) { |
57 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 57 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
58 | } | 58 | } |
59 | HashMap<String, Object> queryMap = new HashMap<>(); | 59 | HashMap<String, Object> queryMap = new HashMap<>(); |
60 | queryMap.put("nameOrIdentifier", nameOrIdentifier); | 60 | queryMap.put("nameOrIdentifier", nameOrIdentifier); |
@@ -117,7 +117,7 @@ public class ThingsModelController extends BaseController { | @@ -117,7 +117,7 @@ public class ThingsModelController extends BaseController { | ||
117 | String tenantId = getCurrentUser().getCurrentTenantId(); | 117 | String tenantId = getCurrentUser().getCurrentTenantId(); |
118 | DeviceProfileDTO dto = tkDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); | 118 | DeviceProfileDTO dto = tkDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); |
119 | if (null == dto) { | 119 | if (null == dto) { |
120 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 120 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
121 | } | 121 | } |
122 | return ResponseEntity.ok( | 122 | return ResponseEntity.ok( |
123 | thingsModelService.changeTSLStatus( | 123 | thingsModelService.changeTSLStatus( |
@@ -131,7 +131,7 @@ public class ThingsModelController extends BaseController { | @@ -131,7 +131,7 @@ public class ThingsModelController extends BaseController { | ||
131 | String tenantId = getCurrentUser().getCurrentTenantId(); | 131 | String tenantId = getCurrentUser().getCurrentTenantId(); |
132 | DeviceProfileDTO dto = tkDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); | 132 | DeviceProfileDTO dto = tkDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); |
133 | if (null == dto) { | 133 | if (null == dto) { |
134 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 134 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
135 | } | 135 | } |
136 | return ResponseEntity.ok( | 136 | return ResponseEntity.ok( |
137 | thingsModelService.selectByDeviceProfileId( | 137 | thingsModelService.selectByDeviceProfileId( |
@@ -144,7 +144,7 @@ public class ThingsModelController extends BaseController { | @@ -144,7 +144,7 @@ public class ThingsModelController extends BaseController { | ||
144 | DeviceProfileDTO deviceProfileDTO = | 144 | DeviceProfileDTO deviceProfileDTO = |
145 | tkDeviceProfileService.findDeviceProfileById(tenantId, thingsModelDTO.getDeviceProfileId()); | 145 | tkDeviceProfileService.findDeviceProfileById(tenantId, thingsModelDTO.getDeviceProfileId()); |
146 | if (null == deviceProfileDTO) { | 146 | if (null == deviceProfileDTO) { |
147 | - throw new YtDataValidationException(ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); | 147 | + throw new TkDataValidationException(ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); |
148 | } | 148 | } |
149 | thingsModelDTO.setTenantId(tenantId); | 149 | thingsModelDTO.setTenantId(tenantId); |
150 | return thingsModelService.saveOrUpdate(thingsModelDTO); | 150 | return thingsModelService.saveOrUpdate(thingsModelDTO); |
@@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; | @@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; | ||
26 | import org.thingsboard.server.common.data.yunteng.dto.UserDTO; | 26 | import org.thingsboard.server.common.data.yunteng.dto.UserDTO; |
27 | import org.thingsboard.server.common.data.yunteng.dto.request.TenantReqDTO; | 27 | import org.thingsboard.server.common.data.yunteng.dto.request.TenantReqDTO; |
28 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 28 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
29 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 29 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
30 | import org.thingsboard.server.controller.BaseController; | 30 | import org.thingsboard.server.controller.BaseController; |
31 | import org.thingsboard.server.dao.tenant.TenantService; | 31 | import org.thingsboard.server.dao.tenant.TenantService; |
32 | import org.thingsboard.server.dao.user.UserService; | 32 | import org.thingsboard.server.dao.user.UserService; |
@@ -75,7 +75,7 @@ public class TkAdminController extends BaseController { | @@ -75,7 +75,7 @@ public class TkAdminController extends BaseController { | ||
75 | @GetMapping( | 75 | @GetMapping( |
76 | path = "tenant/page", | 76 | path = "tenant/page", |
77 | params = {PAGE_SIZE, PAGE}) | 77 | params = {PAGE_SIZE, PAGE}) |
78 | - public YtPageData<TenantDTO> pageUser( | 78 | + public TkPageData<TenantDTO> pageUser( |
79 | @RequestParam(PAGE_SIZE) int pageSize, | 79 | @RequestParam(PAGE_SIZE) int pageSize, |
80 | @RequestParam(PAGE) int page, | 80 | @RequestParam(PAGE) int page, |
81 | @RequestParam(value = "tenantName", required = false) String tenantName, | 81 | @RequestParam(value = "tenantName", required = false) String tenantName, |
@@ -13,11 +13,11 @@ import org.springframework.web.servlet.support.ServletUriComponentsBuilder; | @@ -13,11 +13,11 @@ import org.springframework.web.servlet.support.ServletUriComponentsBuilder; | ||
13 | import org.thingsboard.server.common.data.exception.ThingsboardException; | 13 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
14 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; | 14 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
15 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 15 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
16 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 16 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
17 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 17 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
18 | import org.thingsboard.server.common.data.yunteng.dto.AlarmContactDTO; | 18 | import org.thingsboard.server.common.data.yunteng.dto.AlarmContactDTO; |
19 | import org.thingsboard.server.common.data.yunteng.dto.AlarmProfileDTO; | 19 | import org.thingsboard.server.common.data.yunteng.dto.AlarmProfileDTO; |
20 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 20 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
21 | import org.thingsboard.server.controller.BaseController; | 21 | import org.thingsboard.server.controller.BaseController; |
22 | import org.thingsboard.server.dao.yunteng.service.AlarmProfileService; | 22 | import org.thingsboard.server.dao.yunteng.service.AlarmProfileService; |
23 | import org.thingsboard.server.dao.yunteng.service.TkAlarmContactService; | 23 | import org.thingsboard.server.dao.yunteng.service.TkAlarmContactService; |
@@ -87,7 +87,7 @@ public class TkAlarmContactController extends BaseController { | @@ -87,7 +87,7 @@ public class TkAlarmContactController extends BaseController { | ||
87 | @ApiOperation(value = "分页查询") | 87 | @ApiOperation(value = "分页查询") |
88 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") | 88 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") |
89 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 89 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
90 | - public YtPageData<AlarmContactDTO> pageAlarm( | 90 | + public TkPageData<AlarmContactDTO> pageAlarm( |
91 | @RequestParam(PAGE_SIZE) int pageSize, | 91 | @RequestParam(PAGE_SIZE) int pageSize, |
92 | @RequestParam(PAGE) int page, | 92 | @RequestParam(PAGE) int page, |
93 | @RequestParam(value = "username", required = false) String username, | 93 | @RequestParam(value = "username", required = false) String username, |
@@ -115,7 +115,7 @@ public class TkAlarmContactController extends BaseController { | @@ -115,7 +115,7 @@ public class TkAlarmContactController extends BaseController { | ||
115 | "@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{'api:yt:alarmContact:delete'})") | 115 | "@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{'api:yt:alarmContact:delete'})") |
116 | public void deleteById(@RequestBody String[] ids) throws ThingsboardException { | 116 | public void deleteById(@RequestBody String[] ids) throws ThingsboardException { |
117 | if (ids.length == 0) { | 117 | if (ids.length == 0) { |
118 | - throw new YtDataValidationException("please provide alarm ids to delete"); | 118 | + throw new TkDataValidationException("please provide alarm ids to delete"); |
119 | } | 119 | } |
120 | // 检查告警联系人是否被告警配置使用 | 120 | // 检查告警联系人是否被告警配置使用 |
121 | for (String id : ids) { | 121 | for (String id : ids) { |
@@ -125,7 +125,7 @@ public class TkAlarmContactController extends BaseController { | @@ -125,7 +125,7 @@ public class TkAlarmContactController extends BaseController { | ||
125 | if (null != list && list.size() > FastIotConstants.MagicNumber.ZERO) { | 125 | if (null != list && list.size() > FastIotConstants.MagicNumber.ZERO) { |
126 | StringBuilder configName = new StringBuilder(); | 126 | StringBuilder configName = new StringBuilder(); |
127 | list.forEach(i -> configName.append("," + i.getName())); | 127 | list.forEach(i -> configName.append("," + i.getName())); |
128 | - throw new YtDataValidationException( | 128 | + throw new TkDataValidationException( |
129 | String.format( | 129 | String.format( |
130 | ErrorMessage.CONTACT_ALREADY_ASSOCIATED.getMessage(), configName.substring(1))); | 130 | ErrorMessage.CONTACT_ALREADY_ASSOCIATED.getMessage(), configName.substring(1))); |
131 | } | 131 | } |
@@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; | @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; | ||
16 | import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; | 16 | import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; |
17 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; | 17 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
18 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 18 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
19 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 19 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
20 | import org.thingsboard.server.controller.BaseController; | 20 | import org.thingsboard.server.controller.BaseController; |
21 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmEntity; | 21 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmEntity; |
22 | import org.thingsboard.server.dao.yunteng.service.TkAlarmInfoService; | 22 | import org.thingsboard.server.dao.yunteng.service.TkAlarmInfoService; |
@@ -46,7 +46,7 @@ public class TkAlarmInfoController extends BaseController { | @@ -46,7 +46,7 @@ public class TkAlarmInfoController extends BaseController { | ||
46 | @ApiOperation(value = "查询") | 46 | @ApiOperation(value = "查询") |
47 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") | 47 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") |
48 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 48 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
49 | - public YtPageData<TkAlarmEntity> pageAlarmInfo( | 49 | + public TkPageData<TkAlarmEntity> pageAlarmInfo( |
50 | @RequestParam(PAGE_SIZE) int pageSize, | 50 | @RequestParam(PAGE_SIZE) int pageSize, |
51 | @RequestParam(PAGE) int page, | 51 | @RequestParam(PAGE) int page, |
52 | @RequestParam(value = "status", required = false) List<AlarmStatus> status, | 52 | @RequestParam(value = "status", required = false) List<AlarmStatus> status, |
@@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.dto.ConfigurationCenterDTO; | @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.dto.ConfigurationCenterDTO; | ||
16 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 16 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
17 | import org.thingsboard.server.common.data.yunteng.dto.request.ConfigurationContentInfoDTO; | 17 | import org.thingsboard.server.common.data.yunteng.dto.request.ConfigurationContentInfoDTO; |
18 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 18 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
19 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 19 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
20 | import org.thingsboard.server.controller.BaseController; | 20 | import org.thingsboard.server.controller.BaseController; |
21 | import org.thingsboard.server.dao.yunteng.service.TkConfigurationCenterService; | 21 | import org.thingsboard.server.dao.yunteng.service.TkConfigurationCenterService; |
22 | 22 | ||
@@ -35,7 +35,7 @@ public class TkConfigurationCenterController extends BaseController { | @@ -35,7 +35,7 @@ public class TkConfigurationCenterController extends BaseController { | ||
35 | 35 | ||
36 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 36 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
37 | @ApiOperation("分页") | 37 | @ApiOperation("分页") |
38 | - public YtPageData<ConfigurationCenterDTO> page( | 38 | + public TkPageData<ConfigurationCenterDTO> page( |
39 | @RequestParam(PAGE_SIZE) int pageSize, | 39 | @RequestParam(PAGE_SIZE) int pageSize, |
40 | @RequestParam(PAGE) int page, | 40 | @RequestParam(PAGE) int page, |
41 | @RequestParam(value = "name", required = false) String name, | 41 | @RequestParam(value = "name", required = false) String name, |
@@ -22,14 +22,14 @@ import org.thingsboard.server.common.data.rule.*; | @@ -22,14 +22,14 @@ import org.thingsboard.server.common.data.rule.*; | ||
22 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | 22 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
23 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; | 23 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
24 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 24 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
25 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 25 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
26 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 26 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
27 | import org.thingsboard.server.common.data.yunteng.dto.ConvertConfigDTO; | 27 | import org.thingsboard.server.common.data.yunteng.dto.ConvertConfigDTO; |
28 | import org.thingsboard.server.common.data.yunteng.dto.ConvertConfigReqDTO; | 28 | import org.thingsboard.server.common.data.yunteng.dto.ConvertConfigReqDTO; |
29 | import org.thingsboard.server.common.data.yunteng.dto.ConvertReqDTO; | 29 | import org.thingsboard.server.common.data.yunteng.dto.ConvertReqDTO; |
30 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 30 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
31 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 31 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
32 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 32 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
33 | import org.thingsboard.server.controller.BaseController; | 33 | import org.thingsboard.server.controller.BaseController; |
34 | import org.thingsboard.server.dao.yunteng.service.ConvertConfigService; | 34 | import org.thingsboard.server.dao.yunteng.service.ConvertConfigService; |
35 | import org.thingsboard.server.dao.yunteng.service.SceneLinkageService; | 35 | import org.thingsboard.server.dao.yunteng.service.SceneLinkageService; |
@@ -63,7 +63,7 @@ public class TkConvertDataToController extends BaseController { | @@ -63,7 +63,7 @@ public class TkConvertDataToController extends BaseController { | ||
63 | 63 | ||
64 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 64 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
65 | @ApiOperation("分页查询") | 65 | @ApiOperation("分页查询") |
66 | - public YtPageData<ConvertConfigDTO> pageMessageConfig( | 66 | + public TkPageData<ConvertConfigDTO> pageMessageConfig( |
67 | @RequestParam(PAGE_SIZE) int pageSize, | 67 | @RequestParam(PAGE_SIZE) int pageSize, |
68 | @RequestParam(PAGE) int page, | 68 | @RequestParam(PAGE) int page, |
69 | @ApiParam(value = "0:转换脚本 1:数据流转") @RequestParam(value = "nodeType") Integer nodeType, | 69 | @ApiParam(value = "0:转换脚本 1:数据流转") @RequestParam(value = "nodeType") Integer nodeType, |
@@ -113,7 +113,7 @@ public class TkConvertDataToController extends BaseController { | @@ -113,7 +113,7 @@ public class TkConvertDataToController extends BaseController { | ||
113 | String type = checkParam.get("type"); | 113 | String type = checkParam.get("type"); |
114 | String name = checkParam.get("name"); | 114 | String name = checkParam.get("name"); |
115 | if (StringUtils.isEmpty(type) || StringUtils.isEmpty(name)) { | 115 | if (StringUtils.isEmpty(type) || StringUtils.isEmpty(name)) { |
116 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 116 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
117 | } | 117 | } |
118 | return ResponseEntity.ok( | 118 | return ResponseEntity.ok( |
119 | convertConfigService.checkConvertConfigNameExist( | 119 | convertConfigService.checkConvertConfigNameExist( |
@@ -145,7 +145,7 @@ public class TkConvertDataToController extends BaseController { | @@ -145,7 +145,7 @@ public class TkConvertDataToController extends BaseController { | ||
145 | convertConfigReqDTO.getConvertIds(), | 145 | convertConfigReqDTO.getConvertIds(), |
146 | convertConfigReqDTO.getStatus(), | 146 | convertConfigReqDTO.getStatus(), |
147 | getCurrentUser().getCurrentTenantId())) { | 147 | getCurrentUser().getCurrentTenantId())) { |
148 | - throw new YtDataValidationException(ErrorMessage.DATA_ALREADY_EXISTS.getMessage()); | 148 | + throw new TkDataValidationException(ErrorMessage.DATA_ALREADY_EXISTS.getMessage()); |
149 | } | 149 | } |
150 | List<String> ids = convertConfigReqDTO.getConvertIds(); | 150 | List<String> ids = convertConfigReqDTO.getConvertIds(); |
151 | int status = convertConfigReqDTO.getStatus(); | 151 | int status = convertConfigReqDTO.getStatus(); |
@@ -169,7 +169,7 @@ public class TkConvertDataToController extends BaseController { | @@ -169,7 +169,7 @@ public class TkConvertDataToController extends BaseController { | ||
169 | int status = convertJSReqDTO.getStatus(); | 169 | int status = convertJSReqDTO.getStatus(); |
170 | if (status == FastIotConstants.StateValue.ENABLE | 170 | if (status == FastIotConstants.StateValue.ENABLE |
171 | && convertConfigService.checkConvertJSStatusEnable(getCurrentUser().getCurrentTenantId())) { | 171 | && convertConfigService.checkConvertJSStatusEnable(getCurrentUser().getCurrentTenantId())) { |
172 | - throw new YtDataValidationException(ErrorMessage.CONVERT_JS_IS_ALONE.getMessage()); | 172 | + throw new TkDataValidationException(ErrorMessage.CONVERT_JS_IS_ALONE.getMessage()); |
173 | } | 173 | } |
174 | List<String> ids = new ArrayList<>(); | 174 | List<String> ids = new ArrayList<>(); |
175 | ids.add(convertJSReqDTO.getId()); | 175 | ids.add(convertJSReqDTO.getId()); |
@@ -12,14 +12,14 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; | @@ -12,14 +12,14 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; | ||
12 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; | 12 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
13 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | 13 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
14 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; | 14 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
15 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 15 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
16 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 16 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
17 | import org.thingsboard.server.common.data.yunteng.dto.DataBoardDTO; | 17 | import org.thingsboard.server.common.data.yunteng.dto.DataBoardDTO; |
18 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 18 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
19 | import org.thingsboard.server.common.data.yunteng.dto.board.ComponentLayoutDTO; | 19 | import org.thingsboard.server.common.data.yunteng.dto.board.ComponentLayoutDTO; |
20 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 20 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
21 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 21 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
22 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 22 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
23 | import org.thingsboard.server.controller.BaseController; | 23 | import org.thingsboard.server.controller.BaseController; |
24 | import org.thingsboard.server.dao.yunteng.service.TkDataBoardService; | 24 | import org.thingsboard.server.dao.yunteng.service.TkDataBoardService; |
25 | 25 | ||
@@ -39,7 +39,7 @@ public class TkDataBoardController extends BaseController { | @@ -39,7 +39,7 @@ public class TkDataBoardController extends BaseController { | ||
39 | 39 | ||
40 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 40 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
41 | @ApiOperation("分页查询") | 41 | @ApiOperation("分页查询") |
42 | - public YtPageData<DataBoardDTO> page( | 42 | + public TkPageData<DataBoardDTO> page( |
43 | @RequestParam(PAGE_SIZE) int pageSize, | 43 | @RequestParam(PAGE_SIZE) int pageSize, |
44 | @RequestParam(PAGE) int page, | 44 | @RequestParam(PAGE) int page, |
45 | @RequestParam(value = ORDER_FILED, required = false) String orderBy, | 45 | @RequestParam(value = ORDER_FILED, required = false) String orderBy, |
@@ -79,7 +79,7 @@ public class TkDataBoardController extends BaseController { | @@ -79,7 +79,7 @@ public class TkDataBoardController extends BaseController { | ||
79 | @RequestBody @Validated(AddGroup.class) DataBoardDTO dataBoard) | 79 | @RequestBody @Validated(AddGroup.class) DataBoardDTO dataBoard) |
80 | throws SchedulerException, ThingsboardException { | 80 | throws SchedulerException, ThingsboardException { |
81 | if (StringUtils.isNotEmpty(dataBoard.getId())) { | 81 | if (StringUtils.isNotEmpty(dataBoard.getId())) { |
82 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 82 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
83 | } | 83 | } |
84 | return saveOrUpdate(dataBoard); | 84 | return saveOrUpdate(dataBoard); |
85 | } | 85 | } |
@@ -91,7 +91,7 @@ public class TkDataBoardController extends BaseController { | @@ -91,7 +91,7 @@ public class TkDataBoardController extends BaseController { | ||
91 | @RequestBody @Validated(UpdateGroup.class) DataBoardDTO dataBoard) | 91 | @RequestBody @Validated(UpdateGroup.class) DataBoardDTO dataBoard) |
92 | throws SchedulerException, ThingsboardException { | 92 | throws SchedulerException, ThingsboardException { |
93 | if (StringUtils.isEmpty(dataBoard.getId())) { | 93 | if (StringUtils.isEmpty(dataBoard.getId())) { |
94 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 94 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
95 | } | 95 | } |
96 | return saveOrUpdate(dataBoard); | 96 | return saveOrUpdate(dataBoard); |
97 | } | 97 | } |
@@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.yunteng.common.AddGroup; | @@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.yunteng.common.AddGroup; | ||
13 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | 13 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
14 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; | 14 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
15 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 15 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
16 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 16 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
17 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 17 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
18 | import org.thingsboard.server.common.data.yunteng.dto.DataBoardDTO; | 18 | import org.thingsboard.server.common.data.yunteng.dto.DataBoardDTO; |
19 | import org.thingsboard.server.common.data.yunteng.dto.DataComponentDTO; | 19 | import org.thingsboard.server.common.data.yunteng.dto.DataComponentDTO; |
@@ -62,7 +62,7 @@ public class TkDataComponentController extends BaseController { | @@ -62,7 +62,7 @@ public class TkDataComponentController extends BaseController { | ||
62 | @RequestBody @Validated(AddGroup.class) DataComponentDTO dataComponent) | 62 | @RequestBody @Validated(AddGroup.class) DataComponentDTO dataComponent) |
63 | throws SchedulerException, ThingsboardException { | 63 | throws SchedulerException, ThingsboardException { |
64 | if (StringUtils.isNotEmpty(dataComponent.getId())) { | 64 | if (StringUtils.isNotEmpty(dataComponent.getId())) { |
65 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 65 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
66 | } | 66 | } |
67 | String tenantId = getCurrentUser().getCurrentTenantId(); | 67 | String tenantId = getCurrentUser().getCurrentTenantId(); |
68 | checkDataBoardInfo(boardId); | 68 | checkDataBoardInfo(boardId); |
@@ -80,7 +80,7 @@ public class TkDataComponentController extends BaseController { | @@ -80,7 +80,7 @@ public class TkDataComponentController extends BaseController { | ||
80 | || null == defaultLayout.getW() | 80 | || null == defaultLayout.getW() |
81 | || null == defaultLayout.getX() | 81 | || null == defaultLayout.getX() |
82 | || null == defaultLayout.getY()) { | 82 | || null == defaultLayout.getY()) { |
83 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 83 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
84 | } | 84 | } |
85 | } | 85 | } |
86 | listLayout.add(defaultLayout); | 86 | listLayout.add(defaultLayout); |
@@ -97,7 +97,7 @@ public class TkDataComponentController extends BaseController { | @@ -97,7 +97,7 @@ public class TkDataComponentController extends BaseController { | ||
97 | @RequestBody @Validated(UpdateGroup.class) DataComponentDTO dataComponent) | 97 | @RequestBody @Validated(UpdateGroup.class) DataComponentDTO dataComponent) |
98 | throws SchedulerException, ThingsboardException { | 98 | throws SchedulerException, ThingsboardException { |
99 | if (StringUtils.isEmpty(dataComponent.getId())) { | 99 | if (StringUtils.isEmpty(dataComponent.getId())) { |
100 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 100 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
101 | } | 101 | } |
102 | checkDataBoardInfo(boardId); | 102 | checkDataBoardInfo(boardId); |
103 | dataComponent.setDataBoardId(boardId); | 103 | dataComponent.setDataBoardId(boardId); |
@@ -118,7 +118,7 @@ public class TkDataComponentController extends BaseController { | @@ -118,7 +118,7 @@ public class TkDataComponentController extends BaseController { | ||
118 | 118 | ||
119 | DataBoardDTO dataBoardDTO = ytDataBoardService.findDataBoardInfoById(dataBoardId, tenantId); | 119 | DataBoardDTO dataBoardDTO = ytDataBoardService.findDataBoardInfoById(dataBoardId, tenantId); |
120 | if (null == dataBoardDTO) { | 120 | if (null == dataBoardDTO) { |
121 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 121 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
122 | } | 122 | } |
123 | int deleteNum = ytDataComponentService.deleteDataComponent(deleteDTO); | 123 | int deleteNum = ytDataComponentService.deleteDataComponent(deleteDTO); |
124 | 124 | ||
@@ -156,7 +156,7 @@ public class TkDataComponentController extends BaseController { | @@ -156,7 +156,7 @@ public class TkDataComponentController extends BaseController { | ||
156 | DataBoardDTO dto = | 156 | DataBoardDTO dto = |
157 | ytDataBoardService.findDataBoardInfoById(boardId, getCurrentUser().getCurrentTenantId()); | 157 | ytDataBoardService.findDataBoardInfoById(boardId, getCurrentUser().getCurrentTenantId()); |
158 | if (null == dto) { | 158 | if (null == dto) { |
159 | - throw new YtDataValidationException(ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); | 159 | + throw new TkDataValidationException(ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); |
160 | } | 160 | } |
161 | return dto; | 161 | return dto; |
162 | } | 162 | } |
@@ -28,7 +28,7 @@ import org.thingsboard.server.common.data.security.DeviceCredentials; | @@ -28,7 +28,7 @@ import org.thingsboard.server.common.data.security.DeviceCredentials; | ||
28 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; | 28 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
29 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | 29 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
30 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 30 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
31 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 31 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
32 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 32 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
33 | import org.thingsboard.server.common.data.yunteng.dto.*; | 33 | import org.thingsboard.server.common.data.yunteng.dto.*; |
34 | import org.thingsboard.server.common.data.yunteng.enums.DataTypeEnum; | 34 | import org.thingsboard.server.common.data.yunteng.enums.DataTypeEnum; |
@@ -36,7 +36,7 @@ import org.thingsboard.server.common.data.yunteng.enums.DeviceState; | @@ -36,7 +36,7 @@ import org.thingsboard.server.common.data.yunteng.enums.DeviceState; | ||
36 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; | 36 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
37 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 37 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
38 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 38 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
39 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 39 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
40 | import org.thingsboard.server.controller.BaseController; | 40 | import org.thingsboard.server.controller.BaseController; |
41 | import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; | 41 | import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; |
42 | import org.thingsboard.server.dao.yunteng.service.TkDeviceService; | 42 | import org.thingsboard.server.dao.yunteng.service.TkDeviceService; |
@@ -80,7 +80,7 @@ public class TkDeviceController extends BaseController { | @@ -80,7 +80,7 @@ public class TkDeviceController extends BaseController { | ||
80 | tkdeviceService.checkDeviceByTenantIdAndDeviceId( | 80 | tkdeviceService.checkDeviceByTenantIdAndDeviceId( |
81 | getCurrentUser().getCurrentTenantId(), gatewayId); | 81 | getCurrentUser().getCurrentTenantId(), gatewayId); |
82 | if (null == gateWay) { | 82 | if (null == gateWay) { |
83 | - throw new YtDataValidationException( | 83 | + throw new TkDataValidationException( |
84 | ErrorMessage.DEVICE_NOT_EXISTENCE_IN_TENANT.getMessage()); | 84 | ErrorMessage.DEVICE_NOT_EXISTENCE_IN_TENANT.getMessage()); |
85 | } | 85 | } |
86 | } | 86 | } |
@@ -210,7 +210,7 @@ public class TkDeviceController extends BaseController { | @@ -210,7 +210,7 @@ public class TkDeviceController extends BaseController { | ||
210 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") | 210 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") |
211 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 211 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
212 | @ApiOperation("查询") | 212 | @ApiOperation("查询") |
213 | - public YtPageData<DeviceDTO> pageDevice( | 213 | + public TkPageData<DeviceDTO> pageDevice( |
214 | @RequestParam(PAGE_SIZE) int pageSize, | 214 | @RequestParam(PAGE_SIZE) int pageSize, |
215 | @RequestParam(PAGE) int page, | 215 | @RequestParam(PAGE) int page, |
216 | @RequestParam(value = "name", required = false) String name, | 216 | @RequestParam(value = "name", required = false) String name, |
@@ -257,7 +257,7 @@ public class TkDeviceController extends BaseController { | @@ -257,7 +257,7 @@ public class TkDeviceController extends BaseController { | ||
257 | path = {"/relation"}, | 257 | path = {"/relation"}, |
258 | params = {PAGE_SIZE, PAGE}) | 258 | params = {PAGE_SIZE, PAGE}) |
259 | @ApiOperation("子设备查询") | 259 | @ApiOperation("子设备查询") |
260 | - public YtPageData<RelationDeviceDTO> pageRelationDevice( | 260 | + public TkPageData<RelationDeviceDTO> pageRelationDevice( |
261 | @RequestParam(PAGE_SIZE) int pageSize, | 261 | @RequestParam(PAGE_SIZE) int pageSize, |
262 | @RequestParam(PAGE) int page, | 262 | @RequestParam(PAGE) int page, |
263 | @RequestParam(value = "name", required = false) String name, | 263 | @RequestParam(value = "name", required = false) String name, |
@@ -438,6 +438,13 @@ public class TkDeviceController extends BaseController { | @@ -438,6 +438,13 @@ public class TkDeviceController extends BaseController { | ||
438 | getCurrentUser().getCurrentTenantId(), tbDeviceId); | 438 | getCurrentUser().getCurrentTenantId(), tbDeviceId); |
439 | } | 439 | } |
440 | 440 | ||
441 | + @GetMapping("/device/relation") | ||
442 | + public String getDeviceRelation( | ||
443 | + @ApiParam(value = "网关子设备:true 非网关子设备:false") @RequestParam(value = "isSlave") boolean isSlave, | ||
444 | + @ApiParam(value = "设备ID") @RequestParam(value = "deviceId") String deviceId) { | ||
445 | + return tkdeviceService.getDeviceRelation(isSlave, deviceId); | ||
446 | + } | ||
447 | + | ||
441 | private Device buildTbDeviceFromDeviceDTO(TenantId tenantId, DeviceDTO deviceDTO) { | 448 | private Device buildTbDeviceFromDeviceDTO(TenantId tenantId, DeviceDTO deviceDTO) { |
442 | Device tbDevice = new Device(); | 449 | Device tbDevice = new Device(); |
443 | String deviceId = deviceDTO.getTbDeviceId(); | 450 | String deviceId = deviceDTO.getTbDeviceId(); |
@@ -518,7 +525,7 @@ public class TkDeviceController extends BaseController { | @@ -518,7 +525,7 @@ public class TkDeviceController extends BaseController { | ||
518 | String tenantId = getCurrentUser().getCurrentTenantId(); | 525 | String tenantId = getCurrentUser().getCurrentTenantId(); |
519 | DeviceProfileDTO dto = ytDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); | 526 | DeviceProfileDTO dto = ytDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); |
520 | if (null == dto) { | 527 | if (null == dto) { |
521 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 528 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
522 | } | 529 | } |
523 | return ResponseEntity.ok( | 530 | return ResponseEntity.ok( |
524 | tkdeviceService.getDeviceAttributes(deviceProfileId, tenantId, dataType)); | 531 | tkdeviceService.getDeviceAttributes(deviceProfileId, tenantId, dataType)); |
@@ -24,15 +24,15 @@ import org.thingsboard.server.common.data.plugin.ComponentLifecycleEvent; | @@ -24,15 +24,15 @@ import org.thingsboard.server.common.data.plugin.ComponentLifecycleEvent; | ||
24 | import org.thingsboard.server.common.data.rule.RuleChain; | 24 | import org.thingsboard.server.common.data.rule.RuleChain; |
25 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | 25 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
26 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 26 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
27 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 27 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
28 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 28 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
29 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 29 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
30 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; | 30 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; |
31 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; | 31 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
32 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 32 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
33 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 33 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
34 | import org.thingsboard.server.common.msg.queue.ServiceQueue; | 34 | import org.thingsboard.server.common.msg.queue.ServiceQueue; |
35 | -import org.thingsboard.server.common.yunteng.script.YtScriptFactory; | 35 | +import org.thingsboard.server.common.yunteng.script.TkScriptFactory; |
36 | import org.thingsboard.server.controller.BaseController; | 36 | import org.thingsboard.server.controller.BaseController; |
37 | import org.thingsboard.server.dao.yunteng.service.TkDeviceScriptService; | 37 | import org.thingsboard.server.dao.yunteng.service.TkDeviceScriptService; |
38 | import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; | 38 | import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; |
@@ -95,7 +95,7 @@ public class TkDeviceProfileController extends BaseController { | @@ -95,7 +95,7 @@ public class TkDeviceProfileController extends BaseController { | ||
95 | } | 95 | } |
96 | if (FastIotConstants.ASSERT_DEFAULT_NAME.equals(oldDeviceProfile.getName()) | 96 | if (FastIotConstants.ASSERT_DEFAULT_NAME.equals(oldDeviceProfile.getName()) |
97 | && !Objects.equals(deviceProfile.getName(), oldDeviceProfile.getName())) { | 97 | && !Objects.equals(deviceProfile.getName(), oldDeviceProfile.getName())) { |
98 | - throw new YtDataValidationException( | 98 | + throw new TkDataValidationException( |
99 | ErrorMessage.ASSERT_DEFAULT_NAME_NO_CHANGED.getMessage()); | 99 | ErrorMessage.ASSERT_DEFAULT_NAME_NO_CHANGED.getMessage()); |
100 | } | 100 | } |
101 | } | 101 | } |
@@ -138,7 +138,7 @@ public class TkDeviceProfileController extends BaseController { | @@ -138,7 +138,7 @@ public class TkDeviceProfileController extends BaseController { | ||
138 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 138 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
139 | @ApiOperation("查询") | 139 | @ApiOperation("查询") |
140 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") | 140 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") |
141 | - public YtPageData<DeviceProfileDTO> pageDeviceProfile( | 141 | + public TkPageData<DeviceProfileDTO> pageDeviceProfile( |
142 | @RequestParam(PAGE_SIZE) int pageSize, | 142 | @RequestParam(PAGE_SIZE) int pageSize, |
143 | @RequestParam(PAGE) int page, | 143 | @RequestParam(PAGE) int page, |
144 | @RequestParam(value = "name", required = false) String name, | 144 | @RequestParam(value = "name", required = false) String name, |
@@ -276,7 +276,7 @@ public class TkDeviceProfileController extends BaseController { | @@ -276,7 +276,7 @@ public class TkDeviceProfileController extends BaseController { | ||
276 | ruleChainService.findRuleChainById(TenantId.SYS_TENANT_ID, new RuleChainId(chainId)); | 276 | ruleChainService.findRuleChainById(TenantId.SYS_TENANT_ID, new RuleChainId(chainId)); |
277 | if (chain == null | 277 | if (chain == null |
278 | || !deviceProfileDTO.getTenantId().equals(chain.getTenantId().getId().toString())) { | 278 | || !deviceProfileDTO.getTenantId().equals(chain.getTenantId().getId().toString())) { |
279 | - throw new YtDataValidationException(ErrorMessage.RULE_CHAIN_NOT_ENABLE.getMessage()); | 279 | + throw new TkDataValidationException(ErrorMessage.RULE_CHAIN_NOT_ENABLE.getMessage()); |
280 | } | 280 | } |
281 | tbDeviceProfile.setDefaultRuleChainId(new RuleChainId(chainId)); | 281 | tbDeviceProfile.setDefaultRuleChainId(new RuleChainId(chainId)); |
282 | } | 282 | } |
@@ -294,8 +294,8 @@ public class TkDeviceProfileController extends BaseController { | @@ -294,8 +294,8 @@ public class TkDeviceProfileController extends BaseController { | ||
294 | } | 294 | } |
295 | 295 | ||
296 | if (DeviceTransportType.TCP.name().equals(transportType)) { | 296 | if (DeviceTransportType.TCP.name().equals(transportType)) { |
297 | - YtTcpDeviceProfileTransportConfiguration tcpDeviceProfileTransportConfiguration = | ||
298 | - (YtTcpDeviceProfileTransportConfiguration) | 297 | + TkTcpDeviceProfileTransportConfiguration tcpDeviceProfileTransportConfiguration = |
298 | + (TkTcpDeviceProfileTransportConfiguration) | ||
299 | deviceProfileDTO.getProfileData().getTransportConfiguration(); | 299 | deviceProfileDTO.getProfileData().getTransportConfiguration(); |
300 | String scriptId = tcpDeviceProfileTransportConfiguration.getScriptId(); | 300 | String scriptId = tcpDeviceProfileTransportConfiguration.getScriptId(); |
301 | scriptText = javaScriptService.getScriptText(deviceProfileDTO.getTenantId(), scriptId); | 301 | scriptText = javaScriptService.getScriptText(deviceProfileDTO.getTenantId(), scriptId); |
@@ -303,7 +303,7 @@ public class TkDeviceProfileController extends BaseController { | @@ -303,7 +303,7 @@ public class TkDeviceProfileController extends BaseController { | ||
303 | } | 303 | } |
304 | 304 | ||
305 | tbDeviceProfile.setProfileData( | 305 | tbDeviceProfile.setProfileData( |
306 | - buildDeviceProfileData(transportType, deviceProfileDTO.getProfileData(), scriptText == null? YtScriptFactory.INCLUD_ORIGINAL_DATA:scriptText)); | 306 | + buildDeviceProfileData(transportType, deviceProfileDTO.getProfileData(), scriptText == null? TkScriptFactory.INCLUD_ORIGINAL_DATA:scriptText)); |
307 | return tbDeviceProfile; | 307 | return tbDeviceProfile; |
308 | } | 308 | } |
309 | } | 309 | } |
@@ -30,17 +30,17 @@ import org.thingsboard.server.common.data.id.TenantId; | @@ -30,17 +30,17 @@ import org.thingsboard.server.common.data.id.TenantId; | ||
30 | import org.thingsboard.server.common.data.plugin.ComponentLifecycleEvent; | 30 | import org.thingsboard.server.common.data.plugin.ComponentLifecycleEvent; |
31 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | 31 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
32 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 32 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
33 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 33 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
34 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 34 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
35 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 35 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
36 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; | 36 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; |
37 | import org.thingsboard.server.common.data.yunteng.dto.TkDeviceScriptDTO; | 37 | import org.thingsboard.server.common.data.yunteng.dto.TkDeviceScriptDTO; |
38 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 38 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
39 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 39 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
40 | import org.thingsboard.server.common.msg.queue.ServiceQueue; | 40 | import org.thingsboard.server.common.msg.queue.ServiceQueue; |
41 | -import org.thingsboard.server.common.yunteng.script.YtScriptFactory; | ||
42 | -import org.thingsboard.server.common.yunteng.script.YtScriptInvokeService; | ||
43 | -import org.thingsboard.server.common.yunteng.script.YtScriptType; | 41 | +import org.thingsboard.server.common.yunteng.script.TkScriptFactory; |
42 | +import org.thingsboard.server.common.yunteng.script.TkScriptInvokeService; | ||
43 | +import org.thingsboard.server.common.yunteng.script.TkScriptType; | ||
44 | import org.thingsboard.server.controller.BaseController; | 44 | import org.thingsboard.server.controller.BaseController; |
45 | import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; | 45 | import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; |
46 | import org.thingsboard.server.dao.yunteng.service.TkDeviceScriptService; | 46 | import org.thingsboard.server.dao.yunteng.service.TkDeviceScriptService; |
@@ -62,7 +62,7 @@ public class TkDeviceScriptController extends BaseController { | @@ -62,7 +62,7 @@ public class TkDeviceScriptController extends BaseController { | ||
62 | private static final ObjectMapper objectMapper = new ObjectMapper(); | 62 | private static final ObjectMapper objectMapper = new ObjectMapper(); |
63 | private final TkDeviceScriptService scriptService; | 63 | private final TkDeviceScriptService scriptService; |
64 | private final TkDeviceProfileService ytDeviceProfileService; | 64 | private final TkDeviceProfileService ytDeviceProfileService; |
65 | - private final YtScriptInvokeService jsEngine; | 65 | + private final TkScriptInvokeService jsEngine; |
66 | 66 | ||
67 | @PostMapping() | 67 | @PostMapping() |
68 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN'},{'api:yt:js:post','api:yt:js:update'})") | 68 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN'},{'api:yt:js:post','api:yt:js:update'})") |
@@ -94,7 +94,7 @@ public class TkDeviceScriptController extends BaseController { | @@ -94,7 +94,7 @@ public class TkDeviceScriptController extends BaseController { | ||
94 | if(scriptDTO ==null || scriptDTO.getStatus().equals(status)){ | 94 | if(scriptDTO ==null || scriptDTO.getStatus().equals(status)){ |
95 | return ResponseEntity.ok(false); | 95 | return ResponseEntity.ok(false); |
96 | } | 96 | } |
97 | - String convertJs = YtScriptFactory.INCLUD_ORIGINAL_DATA; | 97 | + String convertJs = TkScriptFactory.INCLUD_ORIGINAL_DATA; |
98 | 98 | ||
99 | if(1 == status){ | 99 | if(1 == status){ |
100 | if(scriptDTO.isSaveOriginalData()){ | 100 | if(scriptDTO.isSaveOriginalData()){ |
@@ -135,7 +135,7 @@ public class TkDeviceScriptController extends BaseController { | @@ -135,7 +135,7 @@ public class TkDeviceScriptController extends BaseController { | ||
135 | } | 135 | } |
136 | if (FastIotConstants.ASSERT_DEFAULT_NAME.equals(oldDeviceProfile.getName()) | 136 | if (FastIotConstants.ASSERT_DEFAULT_NAME.equals(oldDeviceProfile.getName()) |
137 | && !Objects.equals(deviceProfile.getName(), oldDeviceProfile.getName())) { | 137 | && !Objects.equals(deviceProfile.getName(), oldDeviceProfile.getName())) { |
138 | - throw new YtDataValidationException(ErrorMessage.ASSERT_DEFAULT_NAME_NO_CHANGED.getMessage()); | 138 | + throw new TkDataValidationException(ErrorMessage.ASSERT_DEFAULT_NAME_NO_CHANGED.getMessage()); |
139 | } | 139 | } |
140 | 140 | ||
141 | DeviceProfile savedDeviceProfile = | 141 | DeviceProfile savedDeviceProfile = |
@@ -166,7 +166,7 @@ public class TkDeviceScriptController extends BaseController { | @@ -166,7 +166,7 @@ public class TkDeviceScriptController extends BaseController { | ||
166 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 166 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
167 | @ApiOperation("分页查询") | 167 | @ApiOperation("分页查询") |
168 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") | 168 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") |
169 | - public YtPageData<TkDeviceScriptDTO> pageDeviceScript( | 169 | + public TkPageData<TkDeviceScriptDTO> pageDeviceScript( |
170 | @RequestParam(PAGE_SIZE) int pageSize, | 170 | @RequestParam(PAGE_SIZE) int pageSize, |
171 | @RequestParam(PAGE) int page, | 171 | @RequestParam(PAGE) int page, |
172 | @RequestParam(value = ORDER_FILED, required = false) String orderFiled, | 172 | @RequestParam(value = ORDER_FILED, required = false) String orderFiled, |
@@ -188,7 +188,7 @@ public class TkDeviceScriptController extends BaseController { | @@ -188,7 +188,7 @@ public class TkDeviceScriptController extends BaseController { | ||
188 | } | 188 | } |
189 | if(null != startTime && null!=endTime){ | 189 | if(null != startTime && null!=endTime){ |
190 | if (startTime > endTime) { | 190 | if (startTime > endTime) { |
191 | - throw new YtDataValidationException( | 191 | + throw new TkDataValidationException( |
192 | ErrorMessage.START_TIME_NOT_MORE_THAN_END_TIME.getMessage()); | 192 | ErrorMessage.START_TIME_NOT_MORE_THAN_END_TIME.getMessage()); |
193 | } | 193 | } |
194 | queryMap.put("startTime", new Timestamp(startTime).toLocalDateTime()); | 194 | queryMap.put("startTime", new Timestamp(startTime).toLocalDateTime()); |
@@ -228,7 +228,7 @@ public class TkDeviceScriptController extends BaseController { | @@ -228,7 +228,7 @@ public class TkDeviceScriptController extends BaseController { | ||
228 | String errorText = ""; | 228 | String errorText = ""; |
229 | ScriptEngine engine = null; | 229 | ScriptEngine engine = null; |
230 | try { | 230 | try { |
231 | - UUID scriptId = jsEngine.eval(YtScriptType.TCP_TRANSPORT_SCRIPT, script).get(); | 231 | + UUID scriptId = jsEngine.eval(TkScriptType.TCP_TRANSPORT_SCRIPT, script).get(); |
232 | ListenableFuture<String> result = | 232 | ListenableFuture<String> result = |
233 | Futures.transformAsync( | 233 | Futures.transformAsync( |
234 | jsEngine.invokeFunction(scriptId, jsParam), | 234 | jsEngine.invokeFunction(scriptId, jsParam), |
@@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | @@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | ||
13 | import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; |
14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
15 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 15 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
16 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 16 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
17 | import org.thingsboard.server.controller.BaseController; | 17 | import org.thingsboard.server.controller.BaseController; |
18 | import org.thingsboard.server.dao.yunteng.service.SysDictService; | 18 | import org.thingsboard.server.dao.yunteng.service.SysDictService; |
19 | 19 | ||
@@ -29,7 +29,7 @@ public class TkDictController extends BaseController { | @@ -29,7 +29,7 @@ public class TkDictController extends BaseController { | ||
29 | private final SysDictService sysDictService; | 29 | private final SysDictService sysDictService; |
30 | 30 | ||
31 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 31 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
32 | - public YtPageData<SysDictDTO> pageSysDict( | 32 | + public TkPageData<SysDictDTO> pageSysDict( |
33 | @RequestParam(PAGE_SIZE) int pageSize, | 33 | @RequestParam(PAGE_SIZE) int pageSize, |
34 | @RequestParam(PAGE) int page, | 34 | @RequestParam(PAGE) int page, |
35 | @RequestParam(value = "dictName", required = false) String dictName, | 35 | @RequestParam(value = "dictName", required = false) String dictName, |
@@ -14,7 +14,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | @@ -14,7 +14,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | ||
14 | import org.thingsboard.server.common.data.yunteng.dto.SysDictItemDTO; | 14 | import org.thingsboard.server.common.data.yunteng.dto.SysDictItemDTO; |
15 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 15 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
16 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 16 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
17 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 17 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
18 | import org.thingsboard.server.controller.BaseController; | 18 | import org.thingsboard.server.controller.BaseController; |
19 | import org.thingsboard.server.dao.yunteng.service.SysDictItemService; | 19 | import org.thingsboard.server.dao.yunteng.service.SysDictItemService; |
20 | 20 | ||
@@ -32,7 +32,7 @@ public class TkDictItemController extends BaseController { | @@ -32,7 +32,7 @@ public class TkDictItemController extends BaseController { | ||
32 | 32 | ||
33 | @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{})") | 33 | @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{})") |
34 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 34 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
35 | - public YtPageData<SysDictItemDTO> pageSysDictItem( | 35 | + public TkPageData<SysDictItemDTO> pageSysDictItem( |
36 | @RequestParam(PAGE_SIZE) int pageSize, | 36 | @RequestParam(PAGE_SIZE) int pageSize, |
37 | @RequestParam(PAGE) int page, | 37 | @RequestParam(PAGE) int page, |
38 | @RequestParam(value = "dictId", required = false) String dictId, | 38 | @RequestParam(value = "dictId", required = false) String dictId, |
@@ -7,7 +7,7 @@ import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | @@ -7,7 +7,7 @@ import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | ||
7 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 7 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
8 | import org.thingsboard.server.common.data.yunteng.dto.MailLogDTO; | 8 | import org.thingsboard.server.common.data.yunteng.dto.MailLogDTO; |
9 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 9 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
10 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 10 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
11 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 11 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
12 | import org.thingsboard.server.controller.BaseController; | 12 | import org.thingsboard.server.controller.BaseController; |
13 | import org.thingsboard.server.dao.yunteng.service.TkMailLogService; | 13 | import org.thingsboard.server.dao.yunteng.service.TkMailLogService; |
@@ -24,7 +24,7 @@ public class TkMailLogController extends BaseController { | @@ -24,7 +24,7 @@ public class TkMailLogController extends BaseController { | ||
24 | private final TkMailLogService mailLogService; | 24 | private final TkMailLogService mailLogService; |
25 | 25 | ||
26 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 26 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
27 | - public YtPageData<MailLogDTO> pageMessageConfig( | 27 | + public TkPageData<MailLogDTO> pageMessageConfig( |
28 | @RequestParam(PAGE_SIZE) int pageSize, | 28 | @RequestParam(PAGE_SIZE) int pageSize, |
29 | @RequestParam(PAGE) int page, | 29 | @RequestParam(PAGE) int page, |
30 | @RequestParam(value = "emailSubject", required = false) String emailSubject, | 30 | @RequestParam(value = "emailSubject", required = false) String emailSubject, |
@@ -8,7 +8,7 @@ import org.springframework.util.Assert; | @@ -8,7 +8,7 @@ import org.springframework.util.Assert; | ||
8 | import org.springframework.web.bind.annotation.*; | 8 | import org.springframework.web.bind.annotation.*; |
9 | import org.springframework.web.servlet.support.ServletUriComponentsBuilder; | 9 | import org.springframework.web.servlet.support.ServletUriComponentsBuilder; |
10 | import org.thingsboard.server.common.data.exception.ThingsboardException; | 10 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
11 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 11 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
12 | import org.thingsboard.server.common.data.yunteng.dto.MenuDTO; | 12 | import org.thingsboard.server.common.data.yunteng.dto.MenuDTO; |
13 | import org.thingsboard.server.controller.BaseController; | 13 | import org.thingsboard.server.controller.BaseController; |
14 | import org.thingsboard.server.dao.yunteng.service.MenuService; | 14 | import org.thingsboard.server.dao.yunteng.service.MenuService; |
@@ -84,7 +84,7 @@ public class TkMenuController extends BaseController { | @@ -84,7 +84,7 @@ public class TkMenuController extends BaseController { | ||
84 | @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{})") | 84 | @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{})") |
85 | public void deleteMenus(@RequestBody String[] ids) throws ThingsboardException { | 85 | public void deleteMenus(@RequestBody String[] ids) throws ThingsboardException { |
86 | if (ids.length == 0) { | 86 | if (ids.length == 0) { |
87 | - throw new YtDataValidationException("需要删除的菜单不能为空"); | 87 | + throw new TkDataValidationException("需要删除的菜单不能为空"); |
88 | } | 88 | } |
89 | menuService.deleteMenus(getCurrentUser().getCurrentTenantId(), ids); | 89 | menuService.deleteMenus(getCurrentUser().getCurrentTenantId(), ids); |
90 | } | 90 | } |
@@ -14,7 +14,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | @@ -14,7 +14,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | ||
14 | import org.thingsboard.server.common.data.yunteng.dto.MessageConfigDTO; | 14 | import org.thingsboard.server.common.data.yunteng.dto.MessageConfigDTO; |
15 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 15 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
16 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 16 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
17 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 17 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
18 | import org.thingsboard.server.controller.BaseController; | 18 | import org.thingsboard.server.controller.BaseController; |
19 | import org.thingsboard.server.dao.yunteng.service.TkMessageConfigService; | 19 | import org.thingsboard.server.dao.yunteng.service.TkMessageConfigService; |
20 | 20 | ||
@@ -31,7 +31,7 @@ public class TkMessageConfigController extends BaseController { | @@ -31,7 +31,7 @@ public class TkMessageConfigController extends BaseController { | ||
31 | private final TkMessageConfigService messageConfigService; | 31 | private final TkMessageConfigService messageConfigService; |
32 | 32 | ||
33 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 33 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
34 | - public YtPageData<MessageConfigDTO> pageMessageConfig( | 34 | + public TkPageData<MessageConfigDTO> pageMessageConfig( |
35 | @RequestParam(PAGE_SIZE) int pageSize, | 35 | @RequestParam(PAGE_SIZE) int pageSize, |
36 | @RequestParam(PAGE) int page, | 36 | @RequestParam(PAGE) int page, |
37 | @RequestParam(value = "platformType", required = false) String platformType, | 37 | @RequestParam(value = "platformType", required = false) String platformType, |
application/src/main/java/org/thingsboard/server/controller/yunteng/TkMessageTemplateController.java
@@ -10,7 +10,7 @@ import org.thingsboard.server.common.data.yunteng.common.AddGroup; | @@ -10,7 +10,7 @@ import org.thingsboard.server.common.data.yunteng.common.AddGroup; | ||
10 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | 10 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
11 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; | 11 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
12 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 12 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
13 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 13 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
14 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 14 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
15 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 15 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
16 | import org.thingsboard.server.common.data.yunteng.dto.MessageTemplateDTO; | 16 | import org.thingsboard.server.common.data.yunteng.dto.MessageTemplateDTO; |
@@ -20,7 +20,7 @@ import org.thingsboard.server.common.data.yunteng.enums.AssetStatusEnum; | @@ -20,7 +20,7 @@ import org.thingsboard.server.common.data.yunteng.enums.AssetStatusEnum; | ||
20 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 20 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
21 | import org.thingsboard.server.common.data.yunteng.enums.ResponseCodeEnum; | 21 | import org.thingsboard.server.common.data.yunteng.enums.ResponseCodeEnum; |
22 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 22 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
23 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 23 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
24 | import org.thingsboard.server.controller.BaseController; | 24 | import org.thingsboard.server.controller.BaseController; |
25 | import org.thingsboard.server.dao.yunteng.service.TkMailService; | 25 | import org.thingsboard.server.dao.yunteng.service.TkMailService; |
26 | import org.thingsboard.server.dao.yunteng.service.TkMessageTemplateService; | 26 | import org.thingsboard.server.dao.yunteng.service.TkMessageTemplateService; |
@@ -42,7 +42,7 @@ public class TkMessageTemplateController extends BaseController { | @@ -42,7 +42,7 @@ public class TkMessageTemplateController extends BaseController { | ||
42 | private final TkMailService mailService; | 42 | private final TkMailService mailService; |
43 | 43 | ||
44 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 44 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
45 | - public YtPageData<MessageTemplateDTO> pageMessageTemplate( | 45 | + public TkPageData<MessageTemplateDTO> pageMessageTemplate( |
46 | @RequestParam(PAGE_SIZE) int pageSize, | 46 | @RequestParam(PAGE_SIZE) int pageSize, |
47 | @RequestParam(PAGE) int page, | 47 | @RequestParam(PAGE) int page, |
48 | @RequestParam(value = "templateCode", required = false) String templateCode, | 48 | @RequestParam(value = "templateCode", required = false) String templateCode, |
@@ -95,7 +95,7 @@ public class TkMessageTemplateController extends BaseController { | @@ -95,7 +95,7 @@ public class TkMessageTemplateController extends BaseController { | ||
95 | @Validated({AddGroup.class}) @RequestBody SmsReqDTO smsReqDTO) { | 95 | @Validated({AddGroup.class}) @RequestBody SmsReqDTO smsReqDTO) { |
96 | boolean result = smsService.sendSms(smsReqDTO); | 96 | boolean result = smsService.sendSms(smsReqDTO); |
97 | if(!result){ | 97 | if(!result){ |
98 | - throw new YtDataValidationException(ErrorMessage.MESSAGE_SEND_FAILED.getMessage()); | 98 | + throw new TkDataValidationException(ErrorMessage.MESSAGE_SEND_FAILED.getMessage()); |
99 | } | 99 | } |
100 | return ResponseResult.success(ResponseCodeEnum.SUCCESS.name() ); | 100 | return ResponseResult.success(ResponseCodeEnum.SUCCESS.name() ); |
101 | } | 101 | } |
@@ -105,7 +105,7 @@ public class TkMessageTemplateController extends BaseController { | @@ -105,7 +105,7 @@ public class TkMessageTemplateController extends BaseController { | ||
105 | @Validated({AddGroup.class}) @RequestBody EmailReqDTO emailReqDTO) { | 105 | @Validated({AddGroup.class}) @RequestBody EmailReqDTO emailReqDTO) { |
106 | boolean result = mailService.sendEmail(emailReqDTO); | 106 | boolean result = mailService.sendEmail(emailReqDTO); |
107 | if(!result){ | 107 | if(!result){ |
108 | - throw new YtDataValidationException(ErrorMessage.MESSAGE_SEND_FAILED.getMessage()); | 108 | + throw new TkDataValidationException(ErrorMessage.MESSAGE_SEND_FAILED.getMessage()); |
109 | } | 109 | } |
110 | return ResponseResult.success(ResponseCodeEnum.SUCCESS.name() ); | 110 | return ResponseResult.success(ResponseCodeEnum.SUCCESS.name() ); |
111 | } | 111 | } |
@@ -7,7 +7,7 @@ import lombok.RequiredArgsConstructor; | @@ -7,7 +7,7 @@ import lombok.RequiredArgsConstructor; | ||
7 | import org.springframework.util.Assert; | 7 | import org.springframework.util.Assert; |
8 | import org.springframework.web.bind.annotation.*; | 8 | import org.springframework.web.bind.annotation.*; |
9 | import org.thingsboard.server.common.data.exception.ThingsboardException; | 9 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
10 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 10 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
12 | import org.thingsboard.server.common.data.yunteng.dto.DataBoardDTO; | 12 | import org.thingsboard.server.common.data.yunteng.dto.DataBoardDTO; |
13 | import org.thingsboard.server.common.data.yunteng.dto.DataComponentDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.DataComponentDTO; |
@@ -68,13 +68,13 @@ public class TkNoAuthController { | @@ -68,13 +68,13 @@ public class TkNoAuthController { | ||
68 | Optional.ofNullable(params) | 68 | Optional.ofNullable(params) |
69 | .map(param -> params.get("op").asText()) | 69 | .map(param -> params.get("op").asText()) |
70 | .orElseThrow( | 70 | .orElseThrow( |
71 | - () -> new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | 71 | + () -> new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); |
72 | ObjectNode objectNode = JacksonUtil.newObjectNode(); | 72 | ObjectNode objectNode = JacksonUtil.newObjectNode(); |
73 | ObjectNode content = | 73 | ObjectNode content = |
74 | Optional.ofNullable(params.get("content")) | 74 | Optional.ofNullable(params.get("content")) |
75 | .map(data -> JacksonUtil.convertValue(params.get("content"), ObjectNode.class)) | 75 | .map(data -> JacksonUtil.convertValue(params.get("content"), ObjectNode.class)) |
76 | .orElseThrow( | 76 | .orElseThrow( |
77 | - () -> new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | 77 | + () -> new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); |
78 | String sn = null; | 78 | String sn = null; |
79 | FrpInfoDTO queryFrpInfoDTO = null; | 79 | FrpInfoDTO queryFrpInfoDTO = null; |
80 | if (!value.equals(FrpPluginsEnum.Login.name()) && !value.equals(FrpPluginsEnum.Ping.name())) { | 80 | if (!value.equals(FrpPluginsEnum.Login.name()) && !value.equals(FrpPluginsEnum.Ping.name())) { |
@@ -82,7 +82,7 @@ public class TkNoAuthController { | @@ -82,7 +82,7 @@ public class TkNoAuthController { | ||
82 | Optional.ofNullable(content.get("proxy_name")) | 82 | Optional.ofNullable(content.get("proxy_name")) |
83 | .map(proxyName -> content.get("proxy_name").asText()) | 83 | .map(proxyName -> content.get("proxy_name").asText()) |
84 | .orElseThrow( | 84 | .orElseThrow( |
85 | - () -> new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | 85 | + () -> new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); |
86 | queryFrpInfoDTO = frpInfoService.findFrpInfoByProxyName(sn); | 86 | queryFrpInfoDTO = frpInfoService.findFrpInfoByProxyName(sn); |
87 | } | 87 | } |
88 | 88 | ||
@@ -119,10 +119,10 @@ public class TkNoAuthController { | @@ -119,10 +119,10 @@ public class TkNoAuthController { | ||
119 | DataBoardDTO dto = | 119 | DataBoardDTO dto = |
120 | ytDataBoardService.findDataBoardInfoById(boardId, tenantId); | 120 | ytDataBoardService.findDataBoardInfoById(boardId, tenantId); |
121 | if (null == dto) { | 121 | if (null == dto) { |
122 | - throw new YtDataValidationException(ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); | 122 | + throw new TkDataValidationException(ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); |
123 | } | 123 | } |
124 | if(dto.getViewType() == ViewType.PRIVATE_VIEW){ | 124 | if(dto.getViewType() == ViewType.PRIVATE_VIEW){ |
125 | - throw new YtDataValidationException(ErrorMessage.DATA_BOARD_IS_PRIVATE.getMessage()); | 125 | + throw new TkDataValidationException(ErrorMessage.DATA_BOARD_IS_PRIVATE.getMessage()); |
126 | } | 126 | } |
127 | MoreDataComponentInfoDTO moreDataComponentInfoDTO = new MoreDataComponentInfoDTO(); | 127 | MoreDataComponentInfoDTO moreDataComponentInfoDTO = new MoreDataComponentInfoDTO(); |
128 | List<DataComponentDTO> data = | 128 | List<DataComponentDTO> data = |
@@ -15,7 +15,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | @@ -15,7 +15,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | ||
15 | import org.thingsboard.server.common.data.yunteng.dto.SysNoticeDTO; | 15 | import org.thingsboard.server.common.data.yunteng.dto.SysNoticeDTO; |
16 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 16 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
17 | import org.thingsboard.server.common.data.yunteng.enums.SysNoticeTypeEnum; | 17 | import org.thingsboard.server.common.data.yunteng.enums.SysNoticeTypeEnum; |
18 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 18 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
19 | import org.thingsboard.server.controller.BaseController; | 19 | import org.thingsboard.server.controller.BaseController; |
20 | import org.thingsboard.server.dao.yunteng.service.SysNoticeService; | 20 | import org.thingsboard.server.dao.yunteng.service.SysNoticeService; |
21 | 21 | ||
@@ -41,7 +41,7 @@ public class TkNoticeController extends BaseController { | @@ -41,7 +41,7 @@ public class TkNoticeController extends BaseController { | ||
41 | path = "page", | 41 | path = "page", |
42 | params = {PAGE_SIZE, PAGE}) | 42 | params = {PAGE_SIZE, PAGE}) |
43 | @ApiOperation("分页") | 43 | @ApiOperation("分页") |
44 | - public YtPageData<SysNoticeDTO> page( | 44 | + public TkPageData<SysNoticeDTO> page( |
45 | @RequestParam(value = "type", required = false) SysNoticeTypeEnum type, | 45 | @RequestParam(value = "type", required = false) SysNoticeTypeEnum type, |
46 | @RequestParam(PAGE_SIZE) int pageSize, | 46 | @RequestParam(PAGE_SIZE) int pageSize, |
47 | @RequestParam(PAGE) int page, | 47 | @RequestParam(PAGE) int page, |
@@ -4,13 +4,12 @@ import io.swagger.annotations.ApiOperation; | @@ -4,13 +4,12 @@ import io.swagger.annotations.ApiOperation; | ||
4 | import lombok.RequiredArgsConstructor; | 4 | import lombok.RequiredArgsConstructor; |
5 | import org.jetbrains.annotations.NotNull; | 5 | import org.jetbrains.annotations.NotNull; |
6 | import org.springframework.http.ResponseEntity; | 6 | import org.springframework.http.ResponseEntity; |
7 | -import org.springframework.security.access.prepost.PreAuthorize; | ||
8 | import org.springframework.web.bind.annotation.*; | 7 | import org.springframework.web.bind.annotation.*; |
9 | import org.thingsboard.server.common.data.exception.ThingsboardException; | 8 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
10 | import org.thingsboard.server.common.data.yunteng.dto.SysNoticeUserDTO; | 9 | import org.thingsboard.server.common.data.yunteng.dto.SysNoticeUserDTO; |
11 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 10 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
12 | import org.thingsboard.server.common.data.yunteng.enums.SysNoticeTypeEnum; | 11 | import org.thingsboard.server.common.data.yunteng.enums.SysNoticeTypeEnum; |
13 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 12 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
14 | import org.thingsboard.server.controller.BaseController; | 13 | import org.thingsboard.server.controller.BaseController; |
15 | import org.thingsboard.server.dao.yunteng.service.SysNoticeUserService; | 14 | import org.thingsboard.server.dao.yunteng.service.SysNoticeUserService; |
16 | 15 | ||
@@ -35,7 +34,7 @@ public class TkNoticeUserController extends BaseController { | @@ -35,7 +34,7 @@ public class TkNoticeUserController extends BaseController { | ||
35 | path = "read", | 34 | path = "read", |
36 | params = {PAGE_SIZE, PAGE}) | 35 | params = {PAGE_SIZE, PAGE}) |
37 | @ApiOperation("查看人员阅读情况分页") | 36 | @ApiOperation("查看人员阅读情况分页") |
38 | - public YtPageData<SysNoticeUserDTO> read( | 37 | + public TkPageData<SysNoticeUserDTO> read( |
39 | @RequestParam(PAGE_SIZE) int pageSize, | 38 | @RequestParam(PAGE_SIZE) int pageSize, |
40 | @RequestParam(PAGE) int page, | 39 | @RequestParam(PAGE) int page, |
41 | @RequestParam(value = ORDER_FILED, required = false) String orderBy, | 40 | @RequestParam(value = ORDER_FILED, required = false) String orderBy, |
@@ -48,7 +47,7 @@ public class TkNoticeUserController extends BaseController { | @@ -48,7 +47,7 @@ public class TkNoticeUserController extends BaseController { | ||
48 | path = "page", | 47 | path = "page", |
49 | params = {PAGE_SIZE, PAGE}) | 48 | params = {PAGE_SIZE, PAGE}) |
50 | @ApiOperation("我的通知分页") | 49 | @ApiOperation("我的通知分页") |
51 | - public YtPageData<SysNoticeUserDTO> page( | 50 | + public TkPageData<SysNoticeUserDTO> page( |
52 | @RequestParam(value = "type", required = false) SysNoticeTypeEnum type, | 51 | @RequestParam(value = "type", required = false) SysNoticeTypeEnum type, |
53 | @RequestParam(PAGE_SIZE) int pageSize, | 52 | @RequestParam(PAGE_SIZE) int pageSize, |
54 | @RequestParam(PAGE) int page, | 53 | @RequestParam(PAGE) int page, |
@@ -68,7 +67,7 @@ public class TkNoticeUserController extends BaseController { | @@ -68,7 +67,7 @@ public class TkNoticeUserController extends BaseController { | ||
68 | path = "page/{noticeId}", | 67 | path = "page/{noticeId}", |
69 | params = {PAGE_SIZE, PAGE}) | 68 | params = {PAGE_SIZE, PAGE}) |
70 | @ApiOperation("通知用户分页") | 69 | @ApiOperation("通知用户分页") |
71 | - public YtPageData<SysNoticeUserDTO> pageByNoticeId ( | 70 | + public TkPageData<SysNoticeUserDTO> pageByNoticeId ( |
72 | @PathVariable("noticeId") String noticeId, | 71 | @PathVariable("noticeId") String noticeId, |
73 | @RequestParam(PAGE_SIZE) int pageSize, | 72 | @RequestParam(PAGE_SIZE) int pageSize, |
74 | @RequestParam(PAGE) int page, | 73 | @RequestParam(PAGE) int page, |
@@ -12,7 +12,7 @@ import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | @@ -12,7 +12,7 @@ import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | ||
12 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 12 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
13 | import org.thingsboard.server.common.data.yunteng.dto.TkOpinionDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.TkOpinionDTO; |
14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
15 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 15 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
16 | import org.thingsboard.server.controller.BaseController; | 16 | import org.thingsboard.server.controller.BaseController; |
17 | import org.thingsboard.server.dao.yunteng.entities.TkOpinionEntity; | 17 | import org.thingsboard.server.dao.yunteng.entities.TkOpinionEntity; |
18 | import org.thingsboard.server.dao.yunteng.service.TkOpinionService; | 18 | import org.thingsboard.server.dao.yunteng.service.TkOpinionService; |
@@ -30,7 +30,7 @@ public class TkOpinionController extends BaseController { | @@ -30,7 +30,7 @@ public class TkOpinionController extends BaseController { | ||
30 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 30 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
31 | @ApiOperation("分页") | 31 | @ApiOperation("分页") |
32 | @PreAuthorize("hasAnyAuthority('PLATFORM_ADMIN','SYS_ADMIN')") | 32 | @PreAuthorize("hasAnyAuthority('PLATFORM_ADMIN','SYS_ADMIN')") |
33 | - public YtPageData<TkOpinionDTO> pageAlarmProfile( | 33 | + public TkPageData<TkOpinionDTO> pageAlarmProfile( |
34 | @RequestParam(PAGE_SIZE) int pageSize, | 34 | @RequestParam(PAGE_SIZE) int pageSize, |
35 | @RequestParam(PAGE) int page, | 35 | @RequestParam(PAGE) int page, |
36 | @RequestParam(value = "status", required = false) Boolean status, | 36 | @RequestParam(value = "status", required = false) Boolean status, |
@@ -13,13 +13,13 @@ import org.thingsboard.server.common.data.yunteng.common.AddGroup; | @@ -13,13 +13,13 @@ import org.thingsboard.server.common.data.yunteng.common.AddGroup; | ||
13 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | 13 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
14 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; | 14 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
15 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 15 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
16 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 16 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
17 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 17 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
18 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 18 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
19 | import org.thingsboard.server.common.data.yunteng.dto.ReportFormConfigDTO; | 19 | import org.thingsboard.server.common.data.yunteng.dto.ReportFormConfigDTO; |
20 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 20 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
21 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 21 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
22 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 22 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
23 | import org.thingsboard.server.controller.BaseController; | 23 | import org.thingsboard.server.controller.BaseController; |
24 | import org.thingsboard.server.dao.yunteng.service.TkReportFormConfigService; | 24 | import org.thingsboard.server.dao.yunteng.service.TkReportFormConfigService; |
25 | 25 | ||
@@ -40,7 +40,7 @@ public class TkReportFormConfigController extends BaseController { | @@ -40,7 +40,7 @@ public class TkReportFormConfigController extends BaseController { | ||
40 | 40 | ||
41 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 41 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
42 | @ApiOperation("分页") | 42 | @ApiOperation("分页") |
43 | - public YtPageData<ReportFormConfigDTO> page( | 43 | + public TkPageData<ReportFormConfigDTO> page( |
44 | @RequestParam(PAGE_SIZE) int pageSize, | 44 | @RequestParam(PAGE_SIZE) int pageSize, |
45 | @RequestParam(PAGE) int page, | 45 | @RequestParam(PAGE) int page, |
46 | @RequestParam(value = "name", required = false) String name, | 46 | @RequestParam(value = "name", required = false) String name, |
@@ -66,7 +66,7 @@ public class TkReportFormConfigController extends BaseController { | @@ -66,7 +66,7 @@ public class TkReportFormConfigController extends BaseController { | ||
66 | queryMap.put("userId",getCurrentUser().getCurrentUserId()); | 66 | queryMap.put("userId",getCurrentUser().getCurrentUserId()); |
67 | if (null != startTime && null != endTime) { | 67 | if (null != startTime && null != endTime) { |
68 | if (startTime > endTime) { | 68 | if (startTime > endTime) { |
69 | - throw new YtDataValidationException( | 69 | + throw new TkDataValidationException( |
70 | ErrorMessage.START_TIME_NOT_MORE_THAN_END_TIME.getMessage()); | 70 | ErrorMessage.START_TIME_NOT_MORE_THAN_END_TIME.getMessage()); |
71 | } | 71 | } |
72 | queryMap.put("startTime", new Timestamp(startTime).toLocalDateTime()); | 72 | queryMap.put("startTime", new Timestamp(startTime).toLocalDateTime()); |
@@ -82,7 +82,7 @@ public class TkReportFormConfigController extends BaseController { | @@ -82,7 +82,7 @@ public class TkReportFormConfigController extends BaseController { | ||
82 | @Validated({AddGroup.class}) @RequestBody ReportFormConfigDTO configDTO) | 82 | @Validated({AddGroup.class}) @RequestBody ReportFormConfigDTO configDTO) |
83 | throws ThingsboardException, SchedulerException { | 83 | throws ThingsboardException, SchedulerException { |
84 | if (StringUtils.isNotEmpty(configDTO.getId())) { | 84 | if (StringUtils.isNotEmpty(configDTO.getId())) { |
85 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 85 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
86 | } | 86 | } |
87 | return saveOrUpdate(configDTO); | 87 | return saveOrUpdate(configDTO); |
88 | } | 88 | } |
@@ -131,14 +131,14 @@ public class TkReportFormConfigController extends BaseController { | @@ -131,14 +131,14 @@ public class TkReportFormConfigController extends BaseController { | ||
131 | Long startTs = configDTO.getQueryCondition().getStartTs(); | 131 | Long startTs = configDTO.getQueryCondition().getStartTs(); |
132 | Long endTs = configDTO.getQueryCondition().getEndTs(); | 132 | Long endTs = configDTO.getQueryCondition().getEndTs(); |
133 | if (null == startTs || null == endTs) { | 133 | if (null == startTs || null == endTs) { |
134 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 134 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
135 | } | 135 | } |
136 | if (startTs < 946656000000L || endTs < 946656000000L) { | 136 | if (startTs < 946656000000L || endTs < 946656000000L) { |
137 | - throw new YtDataValidationException( | 137 | + throw new TkDataValidationException( |
138 | ErrorMessage.START_TIME_OR_END_TIME_EXCEPTION.getMessage()); | 138 | ErrorMessage.START_TIME_OR_END_TIME_EXCEPTION.getMessage()); |
139 | } | 139 | } |
140 | if (startTs > endTs) { | 140 | if (startTs > endTs) { |
141 | - throw new YtDataValidationException( | 141 | + throw new TkDataValidationException( |
142 | ErrorMessage.START_TIME_NOT_MORE_THAN_END_TIME.getMessage()); | 142 | ErrorMessage.START_TIME_NOT_MORE_THAN_END_TIME.getMessage()); |
143 | } | 143 | } |
144 | ReportFormConfigDTO newDTO = reportFormConfigService.saveOrUpdateReportFormConfig(configDTO); | 144 | ReportFormConfigDTO newDTO = reportFormConfigService.saveOrUpdateReportFormConfig(configDTO); |
@@ -12,7 +12,7 @@ import org.thingsboard.common.util.JacksonUtil; | @@ -12,7 +12,7 @@ import org.thingsboard.common.util.JacksonUtil; | ||
12 | import org.thingsboard.server.common.data.exception.ThingsboardException; | 12 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
13 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | 13 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
14 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 14 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
15 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 15 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
16 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 16 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
17 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 17 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
18 | import org.thingsboard.server.common.data.yunteng.dto.ReportGenerateRecordDTO; | 18 | import org.thingsboard.server.common.data.yunteng.dto.ReportGenerateRecordDTO; |
@@ -20,7 +20,7 @@ import org.thingsboard.server.common.data.yunteng.dto.request.ExecuteAttributesD | @@ -20,7 +20,7 @@ import org.thingsboard.server.common.data.yunteng.dto.request.ExecuteAttributesD | ||
20 | import org.thingsboard.server.common.data.yunteng.dto.request.QueryConditionDTO; | 20 | import org.thingsboard.server.common.data.yunteng.dto.request.QueryConditionDTO; |
21 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 21 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
22 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 22 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
23 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 23 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
24 | import org.thingsboard.server.controller.BaseController; | 24 | import org.thingsboard.server.controller.BaseController; |
25 | import org.thingsboard.server.dao.yunteng.service.TkReportFormConfigService; | 25 | import org.thingsboard.server.dao.yunteng.service.TkReportFormConfigService; |
26 | import org.thingsboard.server.dao.yunteng.service.TkReportGenerateRecordService; | 26 | import org.thingsboard.server.dao.yunteng.service.TkReportGenerateRecordService; |
@@ -45,7 +45,7 @@ public class TkReportGenerateRecordController extends BaseController { | @@ -45,7 +45,7 @@ public class TkReportGenerateRecordController extends BaseController { | ||
45 | 45 | ||
46 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 46 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
47 | @ApiOperation("分页") | 47 | @ApiOperation("分页") |
48 | - public YtPageData<ReportGenerateRecordDTO> page( | 48 | + public TkPageData<ReportGenerateRecordDTO> page( |
49 | @RequestParam(PAGE_SIZE) int pageSize, | 49 | @RequestParam(PAGE_SIZE) int pageSize, |
50 | @RequestParam(PAGE) int page, | 50 | @RequestParam(PAGE) int page, |
51 | @RequestParam(value = "reportConfigName", required = false) String reportConfigName, | 51 | @RequestParam(value = "reportConfigName", required = false) String reportConfigName, |
@@ -59,7 +59,7 @@ public class TkReportGenerateRecordController extends BaseController { | @@ -59,7 +59,7 @@ public class TkReportGenerateRecordController extends BaseController { | ||
59 | HashMap<String, Object> queryMap = new HashMap<>(); | 59 | HashMap<String, Object> queryMap = new HashMap<>(); |
60 | if (null != startTime && null != endTime) { | 60 | if (null != startTime && null != endTime) { |
61 | if (startTime > endTime) { | 61 | if (startTime > endTime) { |
62 | - throw new YtDataValidationException( | 62 | + throw new TkDataValidationException( |
63 | ErrorMessage.START_TIME_NOT_MORE_THAN_END_TIME.getMessage()); | 63 | ErrorMessage.START_TIME_NOT_MORE_THAN_END_TIME.getMessage()); |
64 | } | 64 | } |
65 | 65 |
1 | package org.thingsboard.server.controller.yunteng; | 1 | package org.thingsboard.server.controller.yunteng; |
2 | 2 | ||
3 | - | ||
4 | import lombok.RequiredArgsConstructor; | 3 | import lombok.RequiredArgsConstructor; |
5 | import org.springframework.security.access.prepost.PreAuthorize; | 4 | import org.springframework.security.access.prepost.PreAuthorize; |
6 | import org.springframework.util.Assert; | 5 | import org.springframework.util.Assert; |
7 | import org.springframework.web.bind.annotation.*; | 6 | import org.springframework.web.bind.annotation.*; |
7 | +import org.thingsboard.server.common.data.exception.ThingsboardErrorCode; | ||
8 | import org.thingsboard.server.common.data.exception.ThingsboardException; | 8 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
9 | +import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | ||
9 | import org.thingsboard.server.common.data.yunteng.dto.RoleDTO; | 10 | import org.thingsboard.server.common.data.yunteng.dto.RoleDTO; |
10 | import org.thingsboard.server.common.data.yunteng.dto.request.RoleReqDTO; | 11 | import org.thingsboard.server.common.data.yunteng.dto.request.RoleReqDTO; |
11 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 12 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
12 | import org.thingsboard.server.common.data.yunteng.enums.RoleEnum; | 13 | import org.thingsboard.server.common.data.yunteng.enums.RoleEnum; |
13 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 14 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
14 | import org.thingsboard.server.controller.BaseController; | 15 | import org.thingsboard.server.controller.BaseController; |
15 | import org.thingsboard.server.dao.yunteng.service.RoleService; | 16 | import org.thingsboard.server.dao.yunteng.service.RoleService; |
16 | 17 | ||
@@ -20,7 +21,6 @@ import java.util.Set; | @@ -20,7 +21,6 @@ import java.util.Set; | ||
20 | 21 | ||
21 | import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*; | 22 | import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*; |
22 | 23 | ||
23 | - | ||
24 | @RestController | 24 | @RestController |
25 | @RequestMapping("api/yt/role") | 25 | @RequestMapping("api/yt/role") |
26 | @RequiredArgsConstructor | 26 | @RequiredArgsConstructor |
@@ -29,56 +29,73 @@ public class TkRoleController extends BaseController { | @@ -29,56 +29,73 @@ public class TkRoleController extends BaseController { | ||
29 | private final RoleService roleService; | 29 | private final RoleService roleService; |
30 | 30 | ||
31 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 31 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
32 | - @PreAuthorize("hasAnyAuthority('SYS_ADMIN','PLATFORM_ADMIN','TENANT_ADMIN')") | ||
33 | - public YtPageData<RoleDTO> pageRole( | 32 | + @PreAuthorize("hasAnyAuthority('SYS_ADMIN','TENANT_ADMIN')") |
33 | + public TkPageData<RoleDTO> pageRole( | ||
34 | @RequestParam(PAGE_SIZE) int pageSize, | 34 | @RequestParam(PAGE_SIZE) int pageSize, |
35 | @RequestParam(PAGE) int page, | 35 | @RequestParam(PAGE) int page, |
36 | @RequestParam(value = "roleName", required = false) String roleName, | 36 | @RequestParam(value = "roleName", required = false) String roleName, |
37 | @RequestParam(value = "status", required = false) Integer status, | 37 | @RequestParam(value = "status", required = false) Integer status, |
38 | - @RequestParam(value = "roleType", required = false) RoleEnum roleType, | ||
39 | @RequestParam(value = ORDER_FILED, required = false) String orderBy, | 38 | @RequestParam(value = ORDER_FILED, required = false) String orderBy, |
40 | - @RequestParam(value = ORDER_TYPE, required = false) OrderTypeEnum orderType) throws ThingsboardException { | ||
41 | - HashMap<String, Object> queryMap = new HashMap<>(); | ||
42 | - queryMap.put(PAGE_SIZE, pageSize); | ||
43 | - queryMap.put(PAGE, page); | ||
44 | - queryMap.put(ORDER_FILED, orderBy); | ||
45 | - queryMap.put("roleName", roleName); | ||
46 | - if (status != null) { | ||
47 | - queryMap.put("status", status == 1); | ||
48 | - } | ||
49 | - if (getCurrentUser().isPtAdmin()){ | ||
50 | - roleType = RoleEnum.TENANT_ADMIN; | ||
51 | - } | ||
52 | - if(roleType !=null){ | ||
53 | - queryMap.put("roleType", roleType.name()); | ||
54 | - } | ||
55 | - if (orderType != null) { | ||
56 | - queryMap.put(ORDER_TYPE, orderType.name()); | ||
57 | - } | 39 | + @RequestParam(value = ORDER_TYPE, required = false) OrderTypeEnum orderType) |
40 | + throws ThingsboardException { | ||
41 | + HashMap<String, Object> queryMap = | ||
42 | + buildQueryParam(page, pageSize, orderBy, orderType, status, roleName); | ||
43 | + return roleService.page(getCurrentUser().getCurrentTenantId(), queryMap); | ||
44 | + } | ||
45 | + | ||
46 | + @GetMapping( | ||
47 | + path = "/tenant", | ||
48 | + params = {PAGE_SIZE, PAGE}) | ||
49 | + @PreAuthorize("hasAnyAuthority('SYS_ADMIN','PLATFORM_ADMIN')") | ||
50 | + public TkPageData<RoleDTO> pageTenantRole( | ||
51 | + @RequestParam(PAGE_SIZE) int pageSize, | ||
52 | + @RequestParam(PAGE) int page, | ||
53 | + @RequestParam(value = "roleName", required = false) String roleName, | ||
54 | + @RequestParam(value = "status", required = false) Integer status, | ||
55 | + @RequestParam(value = ORDER_FILED, required = false) String orderBy, | ||
56 | + @RequestParam(value = ORDER_TYPE, required = false) OrderTypeEnum orderType) | ||
57 | + throws ThingsboardException { | ||
58 | + HashMap<String, Object> queryMap = | ||
59 | + buildQueryParam(page, pageSize, orderBy, orderType, status, roleName); | ||
60 | + queryMap.put("roleType", RoleEnum.TENANT_ADMIN.name()); | ||
58 | return roleService.page(getCurrentUser().getCurrentTenantId(), queryMap); | 61 | return roleService.page(getCurrentUser().getCurrentTenantId(), queryMap); |
59 | } | 62 | } |
60 | 63 | ||
61 | @DeleteMapping | 64 | @DeleteMapping |
62 | - @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN','TENANT_ADMIN'},{'api:yt:role:delete'})") | 65 | + @PreAuthorize( |
66 | + "@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN','TENANT_ADMIN'},{'api:yt:role:delete'})") | ||
63 | public void deleteRole(@RequestBody String[] ids) throws ThingsboardException { | 67 | public void deleteRole(@RequestBody String[] ids) throws ThingsboardException { |
64 | - roleService.deleteRole(ids,getCurrentUser().getCurrentTenantId()); | 68 | + roleService.deleteRole(ids, getCurrentUser().getCurrentTenantId()); |
65 | } | 69 | } |
66 | 70 | ||
67 | @GetMapping("/me/permissions") | 71 | @GetMapping("/me/permissions") |
68 | public Set<String> getPermissions() throws ThingsboardException { | 72 | public Set<String> getPermissions() throws ThingsboardException { |
69 | - return roleService.getPermissions(getCurrentUser().isPtSysadmin(), getCurrentUser().isPtTenantAdmin(), getCurrentUser().getCurrentTenantId(), getCurrentUser().getCurrentUserId()); | 73 | + return roleService.getPermissions( |
74 | + getCurrentUser().isPtSysadmin(), | ||
75 | + getCurrentUser().isPtTenantAdmin(), | ||
76 | + getCurrentUser().getCurrentTenantId(), | ||
77 | + getCurrentUser().getCurrentUserId()); | ||
70 | } | 78 | } |
71 | 79 | ||
72 | @PutMapping("update_status/{roleId}/{status}") | 80 | @PutMapping("update_status/{roleId}/{status}") |
73 | public void updateRoleStatus( | 81 | public void updateRoleStatus( |
74 | - @PathVariable("roleId") String roleId, @PathVariable("status") int status) throws ThingsboardException { | 82 | + @PathVariable("roleId") String roleId, @PathVariable("status") int status) |
83 | + throws ThingsboardException { | ||
75 | Assert.isTrue(status == 0 || status == 1, "role status is not correct"); | 84 | Assert.isTrue(status == 0 || status == 1, "role status is not correct"); |
76 | - roleService.updateRoleStatus(roleId, status, getCurrentUser().isPtSysadmin() ,getCurrentUser().getCurrentTenantId()); | 85 | + roleService.updateRoleStatus( |
86 | + roleId, status, getCurrentUser().isPtSysadmin(), getCurrentUser().getCurrentTenantId()); | ||
77 | } | 87 | } |
78 | 88 | ||
79 | @PostMapping("save_with_menu") | 89 | @PostMapping("save_with_menu") |
80 | - @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN','TENANT_ADMIN'},{'api:yt:role:saveOrUpdateRoleInfoWithMenu:post','api:yt:role:saveOrUpdateRoleInfoWithMenu:update'})") | ||
81 | - public RoleDTO saveOrUpdateRoleInfoWithMenu(@RequestBody RoleReqDTO roleReqDTO) throws ThingsboardException { | 90 | + @PreAuthorize( |
91 | + "@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN','TENANT_ADMIN'},{'api:yt:role:saveOrUpdateRoleInfoWithMenu:post','api:yt:role:saveOrUpdateRoleInfoWithMenu:update'})") | ||
92 | + public RoleDTO saveOrUpdateRoleInfoWithMenu(@RequestBody RoleReqDTO roleReqDTO) | ||
93 | + throws ThingsboardException { | ||
94 | + if (getCurrentUser().isPtAdmin() && null == roleReqDTO.getRoleType()) { | ||
95 | + // 添加的平台角色 | ||
96 | + throw new ThingsboardException( | ||
97 | + ErrorMessage.NOT_HAVE_PERMISSION.getMessage(), ThingsboardErrorCode.PERMISSION_DENIED); | ||
98 | + } | ||
82 | return roleService.saveOrUpdateRoleInfoWithMenu( | 99 | return roleService.saveOrUpdateRoleInfoWithMenu( |
83 | roleReqDTO, | 100 | roleReqDTO, |
84 | getCurrentUser().isPtSysadmin(), | 101 | getCurrentUser().isPtSysadmin(), |
@@ -88,6 +105,31 @@ public class TkRoleController extends BaseController { | @@ -88,6 +105,31 @@ public class TkRoleController extends BaseController { | ||
88 | 105 | ||
89 | @PostMapping("/find/list") | 106 | @PostMapping("/find/list") |
90 | public List<RoleDTO> findRoleInfoList(@RequestBody RoleDTO roleDTO) throws ThingsboardException { | 107 | public List<RoleDTO> findRoleInfoList(@RequestBody RoleDTO roleDTO) throws ThingsboardException { |
91 | - return roleService.findRoleInfo(getCurrentUser().isPtTenantAdmin(), getCurrentUser().getCurrentTenantId(),getCurrentUser().getCurrentUserId(), roleDTO); | 108 | + return roleService.findRoleInfo( |
109 | + getCurrentUser().isPtTenantAdmin(), | ||
110 | + getCurrentUser().getCurrentTenantId(), | ||
111 | + getCurrentUser().getCurrentUserId(), | ||
112 | + roleDTO); | ||
113 | + } | ||
114 | + | ||
115 | + private HashMap<String, Object> buildQueryParam( | ||
116 | + int page, | ||
117 | + int pageSize, | ||
118 | + String orderBy, | ||
119 | + OrderTypeEnum orderType, | ||
120 | + Integer status, | ||
121 | + String roleName) { | ||
122 | + HashMap<String, Object> queryMap = new HashMap<>(); | ||
123 | + queryMap.put(PAGE_SIZE, pageSize); | ||
124 | + queryMap.put(PAGE, page); | ||
125 | + queryMap.put(ORDER_FILED, orderBy); | ||
126 | + queryMap.put("roleName", roleName); | ||
127 | + if (status != null) { | ||
128 | + queryMap.put("status", status == 1); | ||
129 | + } | ||
130 | + if (orderType != null) { | ||
131 | + queryMap.put(ORDER_TYPE, orderType.name()); | ||
132 | + } | ||
133 | + return queryMap; | ||
92 | } | 134 | } |
93 | } | 135 | } |
@@ -12,7 +12,7 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; | @@ -12,7 +12,7 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; | ||
12 | import org.thingsboard.server.common.data.rpc.RpcStatus; | 12 | import org.thingsboard.server.common.data.rpc.RpcStatus; |
13 | import org.thingsboard.server.common.data.yunteng.dto.TkRpcRecordDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.TkRpcRecordDTO; |
14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
15 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 15 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
16 | import org.thingsboard.server.controller.BaseController; | 16 | import org.thingsboard.server.controller.BaseController; |
17 | import org.thingsboard.server.dao.yunteng.entities.TkRpcRecordEntity; | 17 | import org.thingsboard.server.dao.yunteng.entities.TkRpcRecordEntity; |
18 | import org.thingsboard.server.dao.yunteng.service.TkRpcRecordService; | 18 | import org.thingsboard.server.dao.yunteng.service.TkRpcRecordService; |
@@ -31,7 +31,7 @@ public class TkRpcRecordController extends BaseController { | @@ -31,7 +31,7 @@ public class TkRpcRecordController extends BaseController { | ||
31 | 31 | ||
32 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 32 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
33 | @ApiOperation("分页") | 33 | @ApiOperation("分页") |
34 | - public YtPageData<TkRpcRecordDTO> pageAlarmProfile( | 34 | + public TkPageData<TkRpcRecordDTO> pageAlarmProfile( |
35 | @RequestParam(PAGE_SIZE) int pageSize, | 35 | @RequestParam(PAGE_SIZE) int pageSize, |
36 | @RequestParam(PAGE) int page, | 36 | @RequestParam(PAGE) int page, |
37 | @RequestParam(value = "status", required = false) RpcStatus status, | 37 | @RequestParam(value = "status", required = false) RpcStatus status, |
@@ -21,7 +21,7 @@ import org.thingsboard.server.common.data.yunteng.dto.SceneLinkageDTO; | @@ -21,7 +21,7 @@ import org.thingsboard.server.common.data.yunteng.dto.SceneLinkageDTO; | ||
21 | import org.thingsboard.server.common.data.yunteng.dto.TriggerDTO; | 21 | import org.thingsboard.server.common.data.yunteng.dto.TriggerDTO; |
22 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; | 22 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
23 | import org.thingsboard.server.common.data.yunteng.id.SceneId; | 23 | import org.thingsboard.server.common.data.yunteng.id.SceneId; |
24 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 24 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
25 | import org.thingsboard.server.controller.BaseController; | 25 | import org.thingsboard.server.controller.BaseController; |
26 | import org.thingsboard.server.controller.yunteng.aspect.annotation.AutoLog; | 26 | import org.thingsboard.server.controller.yunteng.aspect.annotation.AutoLog; |
27 | import org.thingsboard.server.dao.model.ModelConstants; | 27 | import org.thingsboard.server.dao.model.ModelConstants; |
@@ -90,7 +90,7 @@ public class TkSceneLinkageController extends BaseController { | @@ -90,7 +90,7 @@ public class TkSceneLinkageController extends BaseController { | ||
90 | 90 | ||
91 | @ApiOperation("查询(分页列表)") | 91 | @ApiOperation("查询(分页列表)") |
92 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 92 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
93 | - public YtPageData<SceneLinkageDTO> page( | 93 | + public TkPageData<SceneLinkageDTO> page( |
94 | @RequestParam(PAGE_SIZE) int pageSize, | 94 | @RequestParam(PAGE_SIZE) int pageSize, |
95 | @RequestParam(PAGE) int page, | 95 | @RequestParam(PAGE) int page, |
96 | @RequestParam(value = "name", required = false) String name, | 96 | @RequestParam(value = "name", required = false) String name, |
@@ -9,7 +9,7 @@ import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | @@ -9,7 +9,7 @@ import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | ||
9 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 9 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
10 | import org.thingsboard.server.common.data.yunteng.dto.SmsLogDTO; | 10 | import org.thingsboard.server.common.data.yunteng.dto.SmsLogDTO; |
11 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 11 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
12 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 12 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
13 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 13 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
14 | import org.thingsboard.server.controller.BaseController; | 14 | import org.thingsboard.server.controller.BaseController; |
15 | import org.thingsboard.server.dao.yunteng.service.SmsLogService; | 15 | import org.thingsboard.server.dao.yunteng.service.SmsLogService; |
@@ -26,7 +26,7 @@ public class TkSmsLogController extends BaseController { | @@ -26,7 +26,7 @@ public class TkSmsLogController extends BaseController { | ||
26 | private final SmsLogService smsLogService; | 26 | private final SmsLogService smsLogService; |
27 | 27 | ||
28 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 28 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
29 | - public YtPageData<SmsLogDTO> pageMessageConfig( | 29 | + public TkPageData<SmsLogDTO> pageMessageConfig( |
30 | @RequestParam(PAGE_SIZE) int pageSize, | 30 | @RequestParam(PAGE_SIZE) int pageSize, |
31 | @RequestParam(PAGE) int page, | 31 | @RequestParam(PAGE) int page, |
32 | @RequestParam(value = "toPhone", required = false) String toPhone, | 32 | @RequestParam(value = "toPhone", required = false) String toPhone, |
@@ -12,7 +12,7 @@ import org.thingsboard.server.common.data.audit.ActionType; | @@ -12,7 +12,7 @@ import org.thingsboard.server.common.data.audit.ActionType; | ||
12 | import org.thingsboard.server.common.data.exception.ThingsboardException; | 12 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
13 | import org.thingsboard.server.common.data.yunteng.dto.SysLogDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.SysLogDTO; |
14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
15 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 15 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
16 | import org.thingsboard.server.controller.BaseController; | 16 | import org.thingsboard.server.controller.BaseController; |
17 | import org.thingsboard.server.dao.model.ModelConstants; | 17 | import org.thingsboard.server.dao.model.ModelConstants; |
18 | import org.thingsboard.server.dao.yunteng.entities.SysLogEntity; | 18 | import org.thingsboard.server.dao.yunteng.entities.SysLogEntity; |
@@ -39,7 +39,7 @@ public class TkSyslogController extends BaseController { | @@ -39,7 +39,7 @@ public class TkSyslogController extends BaseController { | ||
39 | @GetMapping(value = "exception", params = {PAGE_SIZE, PAGE}) | 39 | @GetMapping(value = "exception", params = {PAGE_SIZE, PAGE}) |
40 | @ApiOperation("异常日志列表") | 40 | @ApiOperation("异常日志列表") |
41 | @PreAuthorize("@check.checkPermissions({},{})") | 41 | @PreAuthorize("@check.checkPermissions({},{})") |
42 | - public YtPageData<SysLogDTO> pageExceptions( | 42 | + public TkPageData<SysLogDTO> pageExceptions( |
43 | @RequestParam(PAGE_SIZE) int pageSize, | 43 | @RequestParam(PAGE_SIZE) int pageSize, |
44 | @RequestParam(PAGE) int page, | 44 | @RequestParam(PAGE) int page, |
45 | @RequestParam(value = "startTime", required = false) Long startTime, | 45 | @RequestParam(value = "startTime", required = false) Long startTime, |
@@ -63,7 +63,7 @@ public class TkSyslogController extends BaseController { | @@ -63,7 +63,7 @@ public class TkSyslogController extends BaseController { | ||
63 | @GetMapping(value = "operate", params = {PAGE_SIZE, PAGE}) | 63 | @GetMapping(value = "operate", params = {PAGE_SIZE, PAGE}) |
64 | @ApiOperation("操作日志列表") | 64 | @ApiOperation("操作日志列表") |
65 | @PreAuthorize("@check.checkPermissions({},{})") | 65 | @PreAuthorize("@check.checkPermissions({},{})") |
66 | - public YtPageData<SysLogDTO> pageOperate( | 66 | + public TkPageData<SysLogDTO> pageOperate( |
67 | @RequestParam(PAGE_SIZE) int pageSize, | 67 | @RequestParam(PAGE_SIZE) int pageSize, |
68 | @RequestParam(PAGE) int page, | 68 | @RequestParam(PAGE) int page, |
69 | @RequestParam(value = "startTime", required = false) Long startTime, | 69 | @RequestParam(value = "startTime", required = false) Long startTime, |
@@ -86,7 +86,7 @@ public class TkSyslogController extends BaseController { | @@ -86,7 +86,7 @@ public class TkSyslogController extends BaseController { | ||
86 | @GetMapping(value = "user", params = {PAGE_SIZE, PAGE}) | 86 | @GetMapping(value = "user", params = {PAGE_SIZE, PAGE}) |
87 | @ApiOperation("登录登出列表") | 87 | @ApiOperation("登录登出列表") |
88 | @PreAuthorize("@check.checkPermissions({},{})") | 88 | @PreAuthorize("@check.checkPermissions({},{})") |
89 | - public YtPageData<SysLogDTO> pageLogin( | 89 | + public TkPageData<SysLogDTO> pageLogin( |
90 | @RequestParam(PAGE_SIZE) int pageSize, | 90 | @RequestParam(PAGE_SIZE) int pageSize, |
91 | @RequestParam(PAGE) int page, | 91 | @RequestParam(PAGE) int page, |
92 | @RequestParam(value = "startTime", required = false) Long startTime, | 92 | @RequestParam(value = "startTime", required = false) Long startTime, |
@@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.*; | @@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.*; | ||
7 | import org.thingsboard.server.common.data.exception.ThingsboardException; | 7 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
8 | import org.thingsboard.server.common.data.id.TenantId; | 8 | import org.thingsboard.server.common.data.id.TenantId; |
9 | import org.thingsboard.server.common.data.id.UserId; | 9 | import org.thingsboard.server.common.data.id.UserId; |
10 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 10 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
12 | import org.thingsboard.server.common.data.yunteng.core.utils.AccountProperties; | 12 | import org.thingsboard.server.common.data.yunteng.core.utils.AccountProperties; |
13 | import org.thingsboard.server.common.data.yunteng.dto.UserDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.UserDTO; |
@@ -42,7 +42,7 @@ public class TkTenantController extends AbstractUserAccount { | @@ -42,7 +42,7 @@ public class TkTenantController extends AbstractUserAccount { | ||
42 | //check is tenant account | 42 | //check is tenant account |
43 | UserDTO userDTO = userService.checkAccount(userId,2); | 43 | UserDTO userDTO = userService.checkAccount(userId,2); |
44 | if(null == userDTO){ | 44 | if(null == userDTO){ |
45 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 45 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
46 | } | 46 | } |
47 | //update | 47 | //update |
48 | String resetPassword = accountProperties.getDefaultPassword(); | 48 | String resetPassword = accountProperties.getDefaultPassword(); |
@@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.page.PageData; | @@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.page.PageData; | ||
13 | import org.thingsboard.server.common.data.page.PageLink; | 13 | import org.thingsboard.server.common.data.page.PageLink; |
14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
15 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; | 15 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; |
16 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 16 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
17 | import org.thingsboard.server.controller.BaseController; | 17 | import org.thingsboard.server.controller.BaseController; |
18 | 18 | ||
19 | import java.util.List; | 19 | import java.util.List; |
@@ -30,7 +30,7 @@ public class TkTenantProfilesController extends BaseController { | @@ -30,7 +30,7 @@ public class TkTenantProfilesController extends BaseController { | ||
30 | @GetMapping( | 30 | @GetMapping( |
31 | name = "page", | 31 | name = "page", |
32 | params = {PAGE_SIZE, PAGE}) | 32 | params = {PAGE_SIZE, PAGE}) |
33 | - public YtPageData<TenantProfile> pageDevice( | 33 | + public TkPageData<TenantProfile> pageDevice( |
34 | @RequestParam(PAGE_SIZE) int pageSize, | 34 | @RequestParam(PAGE_SIZE) int pageSize, |
35 | @RequestParam(PAGE) int page, | 35 | @RequestParam(PAGE) int page, |
36 | @RequestParam(value = "textSearch", required = false) String textSearch, | 36 | @RequestParam(value = "textSearch", required = false) String textSearch, |
@@ -54,7 +54,7 @@ public class TkTenantProfilesController extends BaseController { | @@ -54,7 +54,7 @@ public class TkTenantProfilesController extends BaseController { | ||
54 | tenantProfileService.findTenantProfiles(tenantId, pageLink); | 54 | tenantProfileService.findTenantProfiles(tenantId, pageLink); |
55 | List<TenantProfile> targetList = | 55 | List<TenantProfile> targetList = |
56 | ReflectUtils.sourceToTarget(tenantProfilePageData.getData(), TenantProfile.class); | 56 | ReflectUtils.sourceToTarget(tenantProfilePageData.getData(), TenantProfile.class); |
57 | - return new YtPageData<>(targetList, tenantProfilePageData.getTotalElements()); | 57 | + return new TkPageData<>(targetList, tenantProfilePageData.getTotalElements()); |
58 | } catch (Exception e) { | 58 | } catch (Exception e) { |
59 | throw handleException(e); | 59 | throw handleException(e); |
60 | } | 60 | } |
@@ -20,14 +20,14 @@ import org.thingsboard.server.common.data.yunteng.dto.UserDetailsDTO; | @@ -20,14 +20,14 @@ import org.thingsboard.server.common.data.yunteng.dto.UserDetailsDTO; | ||
20 | import org.thingsboard.server.common.data.yunteng.dto.TkThirdUserDTO; | 20 | import org.thingsboard.server.common.data.yunteng.dto.TkThirdUserDTO; |
21 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 21 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
22 | import org.thingsboard.server.common.data.yunteng.enums.ThirdPlatformEnum; | 22 | import org.thingsboard.server.common.data.yunteng.enums.ThirdPlatformEnum; |
23 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 23 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
24 | import org.thingsboard.server.controller.BaseController; | 24 | import org.thingsboard.server.controller.BaseController; |
25 | import org.thingsboard.server.dao.exception.DataValidationException; | 25 | import org.thingsboard.server.dao.exception.DataValidationException; |
26 | import org.thingsboard.server.dao.yunteng.entities.TkThirdUserEntity; | 26 | import org.thingsboard.server.dao.yunteng.entities.TkThirdUserEntity; |
27 | import org.thingsboard.server.dao.yunteng.service.TkThirdPlatformService; | 27 | import org.thingsboard.server.dao.yunteng.service.TkThirdPlatformService; |
28 | import org.thingsboard.server.dao.yunteng.service.TkUserService; | 28 | import org.thingsboard.server.dao.yunteng.service.TkUserService; |
29 | import org.thingsboard.server.service.security.auth.jwt.RefreshTokenRepository; | 29 | import org.thingsboard.server.service.security.auth.jwt.RefreshTokenRepository; |
30 | -import org.thingsboard.server.service.security.auth.yunteng.YtLoginResponse; | 30 | +import org.thingsboard.server.service.security.auth.yunteng.TkLoginResponse; |
31 | import org.thingsboard.server.service.security.model.SecurityUser; | 31 | import org.thingsboard.server.service.security.model.SecurityUser; |
32 | import org.thingsboard.server.service.security.model.UserPrincipal; | 32 | import org.thingsboard.server.service.security.model.UserPrincipal; |
33 | import org.thingsboard.server.service.security.model.token.JwtTokenFactory; | 33 | import org.thingsboard.server.service.security.model.token.JwtTokenFactory; |
@@ -53,7 +53,7 @@ public class TkThirdPlatformController extends BaseController { | @@ -53,7 +53,7 @@ public class TkThirdPlatformController extends BaseController { | ||
53 | 53 | ||
54 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 54 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
55 | @ApiOperation("分页") | 55 | @ApiOperation("分页") |
56 | - public YtPageData<TkThirdUserDTO> pageAlarmProfile( | 56 | + public TkPageData<TkThirdUserDTO> pageAlarmProfile( |
57 | @RequestParam(PAGE_SIZE) int pageSize, | 57 | @RequestParam(PAGE_SIZE) int pageSize, |
58 | @RequestParam(PAGE) int page, | 58 | @RequestParam(PAGE) int page, |
59 | @RequestParam(value = "platformName", required = false) ThirdPlatformEnum platformName, | 59 | @RequestParam(value = "platformName", required = false) ThirdPlatformEnum platformName, |
@@ -69,7 +69,7 @@ public class TkThirdPlatformController extends BaseController { | @@ -69,7 +69,7 @@ public class TkThirdPlatformController extends BaseController { | ||
69 | 69 | ||
70 | @PostMapping("bind") | 70 | @PostMapping("bind") |
71 | @ApiOperation("绑定") | 71 | @ApiOperation("绑定") |
72 | - public YtLoginResponse saveOrUpdateAlarmProfile( | 72 | + public TkLoginResponse saveOrUpdateAlarmProfile( |
73 | @Validated @RequestBody TkThirdUserDTO dto) throws ThingsboardException { | 73 | @Validated @RequestBody TkThirdUserDTO dto) throws ThingsboardException { |
74 | UserDTO userDto = thirdService.bindUser(dto); | 74 | UserDTO userDto = thirdService.bindUser(dto); |
75 | return buildJwtToken(userDto, dto.getThirdUserId()); | 75 | return buildJwtToken(userDto, dto.getThirdUserId()); |
@@ -91,23 +91,23 @@ public class TkThirdPlatformController extends BaseController { | @@ -91,23 +91,23 @@ public class TkThirdPlatformController extends BaseController { | ||
91 | 91 | ||
92 | @GetMapping("login/{loginCode}") | 92 | @GetMapping("login/{loginCode}") |
93 | @ApiOperation("第三方登录") | 93 | @ApiOperation("第三方登录") |
94 | - public YtLoginResponse codeLogin(@PathVariable("loginCode") String loginCode) | 94 | + public TkLoginResponse codeLogin(@PathVariable("loginCode") String loginCode) |
95 | throws ThingsboardException { | 95 | throws ThingsboardException { |
96 | String thirdUserId = thirdService.thirdLogin(loginCode); | 96 | String thirdUserId = thirdService.thirdLogin(loginCode); |
97 | UserDTO userDto = thirdService.login(thirdUserId); | 97 | UserDTO userDto = thirdService.login(thirdUserId); |
98 | if (userDto == null) { | 98 | if (userDto == null) { |
99 | - return new YtLoginResponse().setThirdUserId(thirdUserId); | 99 | + return new TkLoginResponse().setThirdUserId(thirdUserId); |
100 | } | 100 | } |
101 | return buildJwtToken(userDto, thirdUserId); | 101 | return buildJwtToken(userDto, thirdUserId); |
102 | } | 102 | } |
103 | 103 | ||
104 | @GetMapping("login/id/{userId}") | 104 | @GetMapping("login/id/{userId}") |
105 | @ApiOperation("组态用户认证") | 105 | @ApiOperation("组态用户认证") |
106 | - public YtLoginResponse unionidLogin(@PathVariable("userId") String userId) | 106 | + public TkLoginResponse unionidLogin(@PathVariable("userId") String userId) |
107 | throws ThingsboardException { | 107 | throws ThingsboardException { |
108 | UserDTO userDto = tkUserService.findUserInfoById(userId); | 108 | UserDTO userDto = tkUserService.findUserInfoById(userId); |
109 | if (userDto == null) { | 109 | if (userDto == null) { |
110 | - return new YtLoginResponse().setThirdUserId(userId); | 110 | + return new TkLoginResponse().setThirdUserId(userId); |
111 | } | 111 | } |
112 | return buildJwtToken(userDto, userId); | 112 | return buildJwtToken(userDto, userId); |
113 | } | 113 | } |
@@ -116,20 +116,20 @@ public class TkThirdPlatformController extends BaseController { | @@ -116,20 +116,20 @@ public class TkThirdPlatformController extends BaseController { | ||
116 | private String authrizeSecret="zhiyun"; | 116 | private String authrizeSecret="zhiyun"; |
117 | @PostMapping("authorize") | 117 | @PostMapping("authorize") |
118 | @ApiOperation("授权客户获取用户访问令牌") | 118 | @ApiOperation("授权客户获取用户访问令牌") |
119 | - public YtLoginResponse authorizeLogin(@Validated @RequestBody AuthorizeDTO dto) | 119 | + public TkLoginResponse authorizeLogin(@Validated @RequestBody AuthorizeDTO dto) |
120 | throws ThingsboardException { | 120 | throws ThingsboardException { |
121 | if(!authrizeKey.equals(dto.getAuthrizeKey()) || !authrizeSecret.equals(dto.getAuthrizeSecret())){ | 121 | if(!authrizeKey.equals(dto.getAuthrizeKey()) || !authrizeSecret.equals(dto.getAuthrizeSecret())){ |
122 | throw new DataValidationException( ErrorMessage.NO_PERMISSION.getMessage()); | 122 | throw new DataValidationException( ErrorMessage.NO_PERMISSION.getMessage()); |
123 | } | 123 | } |
124 | UserDTO userDto = tkUserService.accountExist(dto.getUserName()); | 124 | UserDTO userDto = tkUserService.accountExist(dto.getUserName()); |
125 | if (userDto == null) { | 125 | if (userDto == null) { |
126 | - return new YtLoginResponse().setThirdUserId(dto.getAuthrizeKey()); | 126 | + return new TkLoginResponse().setThirdUserId(dto.getAuthrizeKey()); |
127 | } | 127 | } |
128 | return buildJwtToken(userDto, dto.getAuthrizeKey()); | 128 | return buildJwtToken(userDto, dto.getAuthrizeKey()); |
129 | } | 129 | } |
130 | 130 | ||
131 | @NotNull | 131 | @NotNull |
132 | - private YtLoginResponse buildJwtToken(UserDTO userDto, String thirdUserId) { | 132 | + private TkLoginResponse buildJwtToken(UserDTO userDto, String thirdUserId) { |
133 | String accessToken = ""; | 133 | String accessToken = ""; |
134 | String refreshToken = ""; | 134 | String refreshToken = ""; |
135 | if (userDto != null && StringUtils.isNotEmpty(userDto.getTbUser())) { | 135 | if (userDto != null && StringUtils.isNotEmpty(userDto.getTbUser())) { |
@@ -148,7 +148,7 @@ public class TkThirdPlatformController extends BaseController { | @@ -148,7 +148,7 @@ public class TkThirdPlatformController extends BaseController { | ||
148 | refreshToken = refreshTokenRepository.requestRefreshToken(securityUser).getToken(); | 148 | refreshToken = refreshTokenRepository.requestRefreshToken(securityUser).getToken(); |
149 | 149 | ||
150 | } | 150 | } |
151 | - YtLoginResponse result = new YtLoginResponse(); | 151 | + TkLoginResponse result = new TkLoginResponse(); |
152 | result.setToken(accessToken); | 152 | result.setToken(accessToken); |
153 | result.setRefreshToken(refreshToken); | 153 | result.setRefreshToken(refreshToken); |
154 | return result.setThirdUserId(thirdUserId); | 154 | return result.setThirdUserId(thirdUserId); |
@@ -24,7 +24,7 @@ import org.thingsboard.server.common.data.security.UserCredentials; | @@ -24,7 +24,7 @@ import org.thingsboard.server.common.data.security.UserCredentials; | ||
24 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; | 24 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
25 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | 25 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
26 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; | 26 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
27 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 27 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
28 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 28 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
29 | import org.thingsboard.server.common.data.yunteng.core.utils.AccountProperties; | 29 | import org.thingsboard.server.common.data.yunteng.core.utils.AccountProperties; |
30 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 30 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
@@ -37,7 +37,7 @@ import org.thingsboard.server.common.data.yunteng.enums.RoleEnum; | @@ -37,7 +37,7 @@ import org.thingsboard.server.common.data.yunteng.enums.RoleEnum; | ||
37 | import org.thingsboard.server.common.data.yunteng.utils.Demo; | 37 | import org.thingsboard.server.common.data.yunteng.utils.Demo; |
38 | import org.thingsboard.server.common.data.yunteng.utils.ExcelUtil; | 38 | import org.thingsboard.server.common.data.yunteng.utils.ExcelUtil; |
39 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 39 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
40 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 40 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
41 | import org.thingsboard.server.dao.user.UserService; | 41 | import org.thingsboard.server.dao.user.UserService; |
42 | import org.thingsboard.server.dao.yunteng.entities.SysUserEntity; | 42 | import org.thingsboard.server.dao.yunteng.entities.SysUserEntity; |
43 | import org.thingsboard.server.dao.yunteng.service.TkUserService; | 43 | import org.thingsboard.server.dao.yunteng.service.TkUserService; |
@@ -98,7 +98,7 @@ public class TkUserController extends AbstractUserAccount { | @@ -98,7 +98,7 @@ public class TkUserController extends AbstractUserAccount { | ||
98 | path = "page", | 98 | path = "page", |
99 | params = {PAGE_SIZE, PAGE}) | 99 | params = {PAGE_SIZE, PAGE}) |
100 | @ApiOperation(value = "获取用户分页数据") | 100 | @ApiOperation(value = "获取用户分页数据") |
101 | - public YtPageData<UserDTO> pageUser( | 101 | + public TkPageData<UserDTO> pageUser( |
102 | @RequestParam(PAGE_SIZE) int pageSize, | 102 | @RequestParam(PAGE_SIZE) int pageSize, |
103 | @RequestParam(PAGE) int page, | 103 | @RequestParam(PAGE) int page, |
104 | @RequestParam(value = "tenantId", required = false) String tenantId, | 104 | @RequestParam(value = "tenantId", required = false) String tenantId, |
@@ -133,7 +133,7 @@ public class TkUserController extends AbstractUserAccount { | @@ -133,7 +133,7 @@ public class TkUserController extends AbstractUserAccount { | ||
133 | path = "/tenant/page", | 133 | path = "/tenant/page", |
134 | params = {PAGE_SIZE, PAGE}) | 134 | params = {PAGE_SIZE, PAGE}) |
135 | @ApiOperation(value = "获取租户管理员分页数据") | 135 | @ApiOperation(value = "获取租户管理员分页数据") |
136 | - public YtPageData<UserDTO> tenantPage( | 136 | + public TkPageData<UserDTO> tenantPage( |
137 | @RequestParam(PAGE_SIZE) int pageSize, | 137 | @RequestParam(PAGE_SIZE) int pageSize, |
138 | @RequestParam(PAGE) int page, | 138 | @RequestParam(PAGE) int page, |
139 | @RequestParam(value = ORDER_FILED, required = false) String orderBy, | 139 | @RequestParam(value = ORDER_FILED, required = false) String orderBy, |
@@ -148,7 +148,7 @@ public class TkUserController extends AbstractUserAccount { | @@ -148,7 +148,7 @@ public class TkUserController extends AbstractUserAccount { | ||
148 | } | 148 | } |
149 | queryMap.put(ORDER_FILED, orderBy); | 149 | queryMap.put(ORDER_FILED, orderBy); |
150 | if (StringUtils.isEmpty(tenantId)) { | 150 | if (StringUtils.isEmpty(tenantId)) { |
151 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 151 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
152 | } | 152 | } |
153 | return userService.tenantPage(queryMap, tenantId); | 153 | return userService.tenantPage(queryMap, tenantId); |
154 | } | 154 | } |
@@ -212,7 +212,7 @@ public class TkUserController extends AbstractUserAccount { | @@ -212,7 +212,7 @@ public class TkUserController extends AbstractUserAccount { | ||
212 | public UserDTO saveTenantAdmin(@Validated(AddGroup.class) @RequestBody UserDTO userDTO) | 212 | public UserDTO saveTenantAdmin(@Validated(AddGroup.class) @RequestBody UserDTO userDTO) |
213 | throws ThingsboardException { | 213 | throws ThingsboardException { |
214 | if (StringUtils.isEmpty(userDTO.getTenantId())) { | 214 | if (StringUtils.isEmpty(userDTO.getTenantId())) { |
215 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 215 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
216 | } | 216 | } |
217 | userService.validateUserNameAndPhoneNumberAndEmail(userDTO); | 217 | userService.validateUserNameAndPhoneNumberAndEmail(userDTO); |
218 | userService.validateTenantRole(userDTO.getTenantId()); | 218 | userService.validateTenantRole(userDTO.getTenantId()); |
@@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | @@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | ||
13 | import org.thingsboard.server.common.data.yunteng.dto.TkVideoDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.TkVideoDTO; |
14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
15 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 15 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
16 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 16 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
17 | import org.thingsboard.server.controller.BaseController; | 17 | import org.thingsboard.server.controller.BaseController; |
18 | import org.thingsboard.server.dao.yunteng.entities.TkVideoEntity; | 18 | import org.thingsboard.server.dao.yunteng.entities.TkVideoEntity; |
19 | import org.thingsboard.server.dao.yunteng.service.TkVideoService; | 19 | import org.thingsboard.server.dao.yunteng.service.TkVideoService; |
@@ -34,7 +34,7 @@ public class TkVideoController extends BaseController { | @@ -34,7 +34,7 @@ public class TkVideoController extends BaseController { | ||
34 | 34 | ||
35 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 35 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
36 | @ApiOperation("分页") | 36 | @ApiOperation("分页") |
37 | - public YtPageData<TkVideoDTO> pageAlarmProfile( | 37 | + public TkPageData<TkVideoDTO> pageAlarmProfile( |
38 | @RequestParam(PAGE_SIZE) int pageSize, | 38 | @RequestParam(PAGE_SIZE) int pageSize, |
39 | @RequestParam(PAGE) int page, | 39 | @RequestParam(PAGE) int page, |
40 | @RequestParam(value = "status", required = false) Boolean status, | 40 | @RequestParam(value = "status", required = false) Boolean status, |
@@ -12,7 +12,7 @@ import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | @@ -12,7 +12,7 @@ import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; | ||
12 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 12 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
13 | import org.thingsboard.server.common.data.yunteng.dto.TkVideoPlatformDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.TkVideoPlatformDTO; |
14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
15 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 15 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
16 | import org.thingsboard.server.controller.BaseController; | 16 | import org.thingsboard.server.controller.BaseController; |
17 | import org.thingsboard.server.dao.yunteng.entities.TkVideoPlatformEntity; | 17 | import org.thingsboard.server.dao.yunteng.entities.TkVideoPlatformEntity; |
18 | import org.thingsboard.server.dao.yunteng.service.TkVideoPlatformService; | 18 | import org.thingsboard.server.dao.yunteng.service.TkVideoPlatformService; |
@@ -32,7 +32,7 @@ public class TkVideoPlatformController extends BaseController { | @@ -32,7 +32,7 @@ public class TkVideoPlatformController extends BaseController { | ||
32 | 32 | ||
33 | @GetMapping(params = {PAGE_SIZE, PAGE}) | 33 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
34 | @ApiOperation("分页") | 34 | @ApiOperation("分页") |
35 | - public YtPageData<TkVideoPlatformDTO> pageVideoPlatform( | 35 | + public TkPageData<TkVideoPlatformDTO> pageVideoPlatform( |
36 | @RequestParam(PAGE_SIZE) int pageSize, | 36 | @RequestParam(PAGE_SIZE) int pageSize, |
37 | @RequestParam(PAGE) int page, | 37 | @RequestParam(PAGE) int page, |
38 | @RequestParam(value = "host", required = false) String host, | 38 | @RequestParam(value = "host", required = false) String host, |
application/src/main/java/org/thingsboard/server/service/security/auth/yunteng/TkLoginResponse.java
renamed from
application/src/main/java/org/thingsboard/server/service/security/auth/yunteng/YtLoginResponse.java
1 | package org.thingsboard.server.service.security.auth.yunteng; | 1 | package org.thingsboard.server.service.security.auth.yunteng; |
2 | - | ||
3 | -import lombok.AllArgsConstructor; | ||
4 | import lombok.Data; | 2 | import lombok.Data; |
5 | -import lombok.EqualsAndHashCode; | ||
6 | import lombok.experimental.Accessors; | 3 | import lombok.experimental.Accessors; |
7 | import org.thingsboard.server.service.security.auth.rest.LoginResponse; | 4 | import org.thingsboard.server.service.security.auth.rest.LoginResponse; |
8 | 5 | ||
@@ -19,6 +16,6 @@ import org.thingsboard.server.service.security.auth.rest.LoginResponse; | @@ -19,6 +16,6 @@ import org.thingsboard.server.service.security.auth.rest.LoginResponse; | ||
19 | 16 | ||
20 | @Data | 17 | @Data |
21 | @Accessors(chain = true) | 18 | @Accessors(chain = true) |
22 | -public class YtLoginResponse extends LoginResponse { | 19 | +public class TkLoginResponse extends LoginResponse { |
23 | private String thirdUserId; | 20 | private String thirdUserId; |
24 | } | 21 | } |
@@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; | @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; | ||
21 | import com.fasterxml.jackson.annotation.JsonTypeInfo; | 21 | import com.fasterxml.jackson.annotation.JsonTypeInfo; |
22 | import io.swagger.annotations.ApiModel; | 22 | import io.swagger.annotations.ApiModel; |
23 | import org.thingsboard.server.common.data.DeviceTransportType; | 23 | import org.thingsboard.server.common.data.DeviceTransportType; |
24 | -import org.thingsboard.server.common.data.device.profile.YtTcpDeviceProfileTransportConfiguration; | ||
25 | 24 | ||
26 | import java.io.Serializable; | 25 | import java.io.Serializable; |
27 | 26 | ||
@@ -34,7 +33,7 @@ import java.io.Serializable; | @@ -34,7 +33,7 @@ import java.io.Serializable; | ||
34 | @JsonSubTypes({ | 33 | @JsonSubTypes({ |
35 | @JsonSubTypes.Type(value = DefaultDeviceTransportConfiguration.class, name = "DEFAULT"), | 34 | @JsonSubTypes.Type(value = DefaultDeviceTransportConfiguration.class, name = "DEFAULT"), |
36 | @JsonSubTypes.Type(value = MqttDeviceTransportConfiguration.class, name = "MQTT"), | 35 | @JsonSubTypes.Type(value = MqttDeviceTransportConfiguration.class, name = "MQTT"), |
37 | - @JsonSubTypes.Type(value = YtTcpDeviceTransportConfiguration.class, name = "TCP"), | 36 | + @JsonSubTypes.Type(value = TkTcpDeviceTransportConfiguration.class, name = "TCP"), |
38 | @JsonSubTypes.Type(value = CoapDeviceTransportConfiguration.class, name = "COAP"), | 37 | @JsonSubTypes.Type(value = CoapDeviceTransportConfiguration.class, name = "COAP"), |
39 | @JsonSubTypes.Type(value = Lwm2mDeviceTransportConfiguration.class, name = "LWM2M"), | 38 | @JsonSubTypes.Type(value = Lwm2mDeviceTransportConfiguration.class, name = "LWM2M"), |
40 | @JsonSubTypes.Type(value = SnmpDeviceTransportConfiguration.class, name = "SNMP")}) | 39 | @JsonSubTypes.Type(value = SnmpDeviceTransportConfiguration.class, name = "SNMP")}) |
common/data/src/main/java/org/thingsboard/server/common/data/device/data/TkTcpDeviceTransportConfiguration.java
renamed from
common/data/src/main/java/org/thingsboard/server/common/data/device/data/YtTcpDeviceTransportConfiguration.java
@@ -14,18 +14,11 @@ | @@ -14,18 +14,11 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | package org.thingsboard.server.common.data.device.data; | 16 | package org.thingsboard.server.common.data.device.data; |
17 | - | ||
18 | -import com.fasterxml.jackson.annotation.JsonAnyGetter; | ||
19 | -import com.fasterxml.jackson.annotation.JsonAnySetter; | ||
20 | -import com.fasterxml.jackson.annotation.JsonIgnore; | ||
21 | import lombok.Data; | 17 | import lombok.Data; |
22 | import org.thingsboard.server.common.data.DeviceTransportType; | 18 | import org.thingsboard.server.common.data.DeviceTransportType; |
23 | 19 | ||
24 | -import java.util.HashMap; | ||
25 | -import java.util.Map; | ||
26 | - | ||
27 | @Data | 20 | @Data |
28 | -public class YtTcpDeviceTransportConfiguration implements DeviceTransportConfiguration { | 21 | +public class TkTcpDeviceTransportConfiguration implements DeviceTransportConfiguration { |
29 | 22 | ||
30 | 23 | ||
31 | @Override | 24 | @Override |
@@ -31,7 +31,7 @@ import java.io.Serializable; | @@ -31,7 +31,7 @@ import java.io.Serializable; | ||
31 | @JsonSubTypes({ | 31 | @JsonSubTypes({ |
32 | @JsonSubTypes.Type(value = DefaultDeviceProfileTransportConfiguration.class, name = "DEFAULT"), | 32 | @JsonSubTypes.Type(value = DefaultDeviceProfileTransportConfiguration.class, name = "DEFAULT"), |
33 | @JsonSubTypes.Type(value = MqttDeviceProfileTransportConfiguration.class, name = "MQTT"), | 33 | @JsonSubTypes.Type(value = MqttDeviceProfileTransportConfiguration.class, name = "MQTT"), |
34 | - @JsonSubTypes.Type(value = YtTcpDeviceProfileTransportConfiguration.class, name = "TCP"), | 34 | + @JsonSubTypes.Type(value = TkTcpDeviceProfileTransportConfiguration.class, name = "TCP"), |
35 | @JsonSubTypes.Type(value = Lwm2mDeviceProfileTransportConfiguration.class, name = "LWM2M"), | 35 | @JsonSubTypes.Type(value = Lwm2mDeviceProfileTransportConfiguration.class, name = "LWM2M"), |
36 | @JsonSubTypes.Type(value = CoapDeviceProfileTransportConfiguration.class, name = "COAP"), | 36 | @JsonSubTypes.Type(value = CoapDeviceProfileTransportConfiguration.class, name = "COAP"), |
37 | @JsonSubTypes.Type(value = SnmpDeviceProfileTransportConfiguration.class, name = "SNMP") | 37 | @JsonSubTypes.Type(value = SnmpDeviceProfileTransportConfiguration.class, name = "SNMP") |
common/data/src/main/java/org/thingsboard/server/common/data/device/profile/TkTcpDeviceProfileTransportConfiguration.java
renamed from
common/data/src/main/java/org/thingsboard/server/common/data/device/profile/YtTcpDeviceProfileTransportConfiguration.java
@@ -21,7 +21,7 @@ import org.thingsboard.server.common.data.validation.NoXss; | @@ -21,7 +21,7 @@ import org.thingsboard.server.common.data.validation.NoXss; | ||
21 | import org.thingsboard.server.common.data.yunteng.enums.TcpDataTypeEnum; | 21 | import org.thingsboard.server.common.data.yunteng.enums.TcpDataTypeEnum; |
22 | 22 | ||
23 | @Data | 23 | @Data |
24 | -public class YtTcpDeviceProfileTransportConfiguration implements DeviceProfileTransportConfiguration { | 24 | +public class TkTcpDeviceProfileTransportConfiguration implements DeviceProfileTransportConfiguration { |
25 | 25 | ||
26 | @NoXss | 26 | @NoXss |
27 | private TcpDataTypeEnum dataFormat = TcpDataTypeEnum.HEX; | 27 | private TcpDataTypeEnum dataFormat = TcpDataTypeEnum.HEX; |
@@ -18,7 +18,7 @@ import org.thingsboard.server.common.data.yunteng.dto.SysDictItemDTO; | @@ -18,7 +18,7 @@ import org.thingsboard.server.common.data.yunteng.dto.SysDictItemDTO; | ||
18 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; | 18 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; |
19 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; | 19 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; |
20 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; | 20 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
21 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 21 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
22 | 22 | ||
23 | import java.lang.reflect.Field; | 23 | import java.lang.reflect.Field; |
24 | import java.util.ArrayList; | 24 | import java.util.ArrayList; |
@@ -69,17 +69,17 @@ public class SysDictAspect { | @@ -69,17 +69,17 @@ public class SysDictAspect { | ||
69 | returnObject = ResponseResult.success(objectNode); | 69 | returnObject = ResponseResult.success(objectNode); |
70 | } | 70 | } |
71 | } | 71 | } |
72 | - if (returnObject instanceof YtPageData) { | 72 | + if (returnObject instanceof TkPageData) { |
73 | Object object = returnObject; | 73 | Object object = returnObject; |
74 | List<ObjectNode> list = new ArrayList<>(); | 74 | List<ObjectNode> list = new ArrayList<>(); |
75 | - for (Object obj : ((YtPageData<?>) object).getItems()) { | 75 | + for (Object obj : ((TkPageData<?>) object).getItems()) { |
76 | ObjectNode objectNode = getObjectNode(obj, obj); | 76 | ObjectNode objectNode = getObjectNode(obj, obj); |
77 | if(null == objectNode){ | 77 | if(null == objectNode){ |
78 | return returnObject; | 78 | return returnObject; |
79 | } | 79 | } |
80 | list.add(objectNode); | 80 | list.add(objectNode); |
81 | } | 81 | } |
82 | - returnObject =new YtPageData<>(list, ((YtPageData<?>) object).getTotal()); | 82 | + returnObject =new TkPageData<>(list, ((TkPageData<?>) object).getTotal()); |
83 | } | 83 | } |
84 | return returnObject; | 84 | return returnObject; |
85 | } | 85 | } |
@@ -2,7 +2,7 @@ package org.thingsboard.server.common.data.yunteng.config.sms; | @@ -2,7 +2,7 @@ package org.thingsboard.server.common.data.yunteng.config.sms; | ||
2 | 2 | ||
3 | import lombok.extern.slf4j.Slf4j; | 3 | import lombok.extern.slf4j.Slf4j; |
4 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 4 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
5 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 5 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
6 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 6 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
7 | 7 | ||
8 | @Slf4j | 8 | @Slf4j |
@@ -11,7 +11,7 @@ public abstract class AbstractSmsSender implements SmsSender { | @@ -11,7 +11,7 @@ public abstract class AbstractSmsSender implements SmsSender { | ||
11 | protected void validatePhoneNumber(String phoneNumber) { | 11 | protected void validatePhoneNumber(String phoneNumber) { |
12 | phoneNumber = phoneNumber.trim(); | 12 | phoneNumber = phoneNumber.trim(); |
13 | if (!FastIotConstants.CHINA_MOBILE_PATTERN.matcher(phoneNumber).matches()) { | 13 | if (!FastIotConstants.CHINA_MOBILE_PATTERN.matcher(phoneNumber).matches()) { |
14 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 14 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
15 | } | 15 | } |
16 | } | 16 | } |
17 | } | 17 | } |
common/data/src/main/java/org/thingsboard/server/common/data/yunteng/config/sms/TkDefaultSmsSenderFactory.java
renamed from
common/data/src/main/java/org/thingsboard/server/common/data/yunteng/config/sms/YtDefaultSmsSenderFactory.java
@@ -7,7 +7,7 @@ import org.thingsboard.server.common.data.yunteng.config.sms.tencent.TencentSmsP | @@ -7,7 +7,7 @@ import org.thingsboard.server.common.data.yunteng.config.sms.tencent.TencentSmsP | ||
7 | import org.thingsboard.server.common.data.yunteng.config.sms.tencent.TencentSmsSender; | 7 | import org.thingsboard.server.common.data.yunteng.config.sms.tencent.TencentSmsSender; |
8 | 8 | ||
9 | @Component | 9 | @Component |
10 | -public class YtDefaultSmsSenderFactory implements SmsSenderFactory { | 10 | +public class TkDefaultSmsSenderFactory implements SmsSenderFactory { |
11 | @Override | 11 | @Override |
12 | public SmsSender createSmsSender( | 12 | public SmsSender createSmsSender( |
13 | SmsProviderConfiguration config) { | 13 | SmsProviderConfiguration config) { |
@@ -11,7 +11,7 @@ import com.aliyuncs.profile.IClientProfile; | @@ -11,7 +11,7 @@ import com.aliyuncs.profile.IClientProfile; | ||
11 | import lombok.extern.slf4j.Slf4j; | 11 | import lombok.extern.slf4j.Slf4j; |
12 | import org.apache.commons.lang3.StringUtils; | 12 | import org.apache.commons.lang3.StringUtils; |
13 | import org.thingsboard.server.common.data.yunteng.config.sms.AbstractSmsSender; | 13 | import org.thingsboard.server.common.data.yunteng.config.sms.AbstractSmsSender; |
14 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 14 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
15 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 15 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
16 | import org.thingsboard.server.common.data.yunteng.enums.ResponseCodeEnum; | 16 | import org.thingsboard.server.common.data.yunteng.enums.ResponseCodeEnum; |
17 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; | 17 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; |
@@ -29,7 +29,7 @@ public class AliSmsSender extends AbstractSmsSender { | @@ -29,7 +29,7 @@ public class AliSmsSender extends AbstractSmsSender { | ||
29 | public AliSmsSender(AliSmsProviderConfiguration config) { | 29 | public AliSmsSender(AliSmsProviderConfiguration config) { |
30 | if (StringUtils.isEmpty(config.getAccessKeyId()) | 30 | if (StringUtils.isEmpty(config.getAccessKeyId()) |
31 | || StringUtils.isEmpty(config.getAccessKeyId())) { | 31 | || StringUtils.isEmpty(config.getAccessKeyId())) { |
32 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 32 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
33 | } | 33 | } |
34 | this.config = config; | 34 | this.config = config; |
35 | initProfile(); | 35 | initProfile(); |
common/data/src/main/java/org/thingsboard/server/common/data/yunteng/core/exception/TkDataValidationException.java
renamed from
common/data/src/main/java/org/thingsboard/server/common/data/yunteng/core/exception/YtDataValidationException.java
@@ -4,16 +4,16 @@ import lombok.Getter; | @@ -4,16 +4,16 @@ import lombok.Getter; | ||
4 | import org.springframework.http.HttpStatus; | 4 | import org.springframework.http.HttpStatus; |
5 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 5 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
6 | 6 | ||
7 | -public class YtDataValidationException extends ThingsKitException { | 7 | +public class TkDataValidationException extends ThingsKitException { |
8 | private static final long serialVersionUID = 3556952261254572635L; | 8 | private static final long serialVersionUID = 3556952261254572635L; |
9 | 9 | ||
10 | @Getter public boolean log = false; | 10 | @Getter public boolean log = false; |
11 | 11 | ||
12 | - public YtDataValidationException(String message) { | 12 | + public TkDataValidationException(String message) { |
13 | super(ErrorMessage.BAD_PARAMETER.setMessage(message)); | 13 | super(ErrorMessage.BAD_PARAMETER.setMessage(message)); |
14 | } | 14 | } |
15 | 15 | ||
16 | - public YtDataValidationException(String message, boolean log) { | 16 | + public TkDataValidationException(String message, boolean log) { |
17 | super(ErrorMessage.BAD_PARAMETER.setMessage(message)); | 17 | super(ErrorMessage.BAD_PARAMETER.setMessage(message)); |
18 | this.log = log; | 18 | this.log = log; |
19 | } | 19 | } |
@@ -3,7 +3,7 @@ package org.thingsboard.server.common.data.yunteng.dto; | @@ -3,7 +3,7 @@ package org.thingsboard.server.common.data.yunteng.dto; | ||
3 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
4 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
5 | import lombok.Data; | 5 | import lombok.Data; |
6 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 6 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
7 | 7 | ||
8 | import java.util.List; | 8 | import java.util.List; |
9 | 9 | ||
@@ -15,5 +15,5 @@ public class HomePageRightDTO { | @@ -15,5 +15,5 @@ public class HomePageRightDTO { | ||
15 | private List<TenantTransportMessageDTO> top10; | 15 | private List<TenantTransportMessageDTO> top10; |
16 | 16 | ||
17 | @ApiModelProperty("本月即将过期租户") | 17 | @ApiModelProperty("本月即将过期租户") |
18 | - private YtPageData<TenantDTO> expireTenant; | 18 | + private TkPageData<TenantDTO> expireTenant; |
19 | } | 19 | } |
@@ -2,6 +2,7 @@ package org.thingsboard.server.common.data.yunteng.dto.board; | @@ -2,6 +2,7 @@ package org.thingsboard.server.common.data.yunteng.dto.board; | ||
2 | 2 | ||
3 | import io.swagger.annotations.ApiModelProperty; | 3 | import io.swagger.annotations.ApiModelProperty; |
4 | import lombok.Data; | 4 | import lombok.Data; |
5 | +import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; | ||
5 | 6 | ||
6 | import java.io.Serializable; | 7 | import java.io.Serializable; |
7 | 8 | ||
@@ -17,6 +18,9 @@ public class DataSourceInfoDTO implements Serializable { | @@ -17,6 +18,9 @@ public class DataSourceInfoDTO implements Serializable { | ||
17 | @ApiModelProperty(value = "设备ID", required = true) | 18 | @ApiModelProperty(value = "设备ID", required = true) |
18 | private String deviceId; | 19 | private String deviceId; |
19 | 20 | ||
21 | + @ApiModelProperty(value = "组织ID", required = true) | ||
22 | + private DeviceTypeEnum deviceType; | ||
23 | + | ||
20 | @ApiModelProperty(value = "属性", required = true) | 24 | @ApiModelProperty(value = "属性", required = true) |
21 | private String attribute; | 25 | private String attribute; |
22 | 26 |
@@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode; | @@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode; | ||
6 | import com.hikvision.artemis.sdk.ArtemisHttpUtil; | 6 | import com.hikvision.artemis.sdk.ArtemisHttpUtil; |
7 | import com.hikvision.artemis.sdk.config.ArtemisConfig; | 7 | import com.hikvision.artemis.sdk.config.ArtemisConfig; |
8 | import org.apache.commons.lang3.StringUtils; | 8 | import org.apache.commons.lang3.StringUtils; |
9 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 9 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
10 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 10 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
11 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; | 11 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; |
12 | 12 | ||
@@ -36,7 +36,7 @@ public class HikVisionArtemisPostUtils { | @@ -36,7 +36,7 @@ public class HikVisionArtemisPostUtils { | ||
36 | public static String getCameraPreviewURL(String host, String appKey, String appSecret, int ssl, String cameraIndexCode, | 36 | public static String getCameraPreviewURL(String host, String appKey, String appSecret, int ssl, String cameraIndexCode, |
37 | ProtocolType protocolType, int streamType) { | 37 | ProtocolType protocolType, int streamType) { |
38 | if (StringUtils.isEmpty(host) || StringUtils.isEmpty(appKey) || StringUtils.isEmpty(appSecret)) { | 38 | if (StringUtils.isEmpty(host) || StringUtils.isEmpty(appKey) || StringUtils.isEmpty(appSecret)) { |
39 | - throw new YtDataValidationException(ErrorMessage.VIDEO_PLATFORM_CONFIG_LACK.getMessage()); | 39 | + throw new TkDataValidationException(ErrorMessage.VIDEO_PLATFORM_CONFIG_LACK.getMessage()); |
40 | } | 40 | } |
41 | ArtemisConfig.host = host; | 41 | ArtemisConfig.host = host; |
42 | ArtemisConfig.appKey = appKey; | 42 | ArtemisConfig.appKey = appKey; |
@@ -77,11 +77,11 @@ public class HikVisionArtemisPostUtils { | @@ -77,11 +77,11 @@ public class HikVisionArtemisPostUtils { | ||
77 | ProtocolType.HLSS.getValue())){ | 77 | ProtocolType.HLSS.getValue())){ |
78 | message = ErrorMessage.VIDEO_PLATFORM_NEED_ENABLE_HLS_HTTPS.getMessage(); | 78 | message = ErrorMessage.VIDEO_PLATFORM_NEED_ENABLE_HLS_HTTPS.getMessage(); |
79 | } | 79 | } |
80 | - throw new YtDataValidationException(message); | 80 | + throw new TkDataValidationException(message); |
81 | } | 81 | } |
82 | return json.get("url").textValue(); | 82 | return json.get("url").textValue(); |
83 | } else { | 83 | } else { |
84 | - throw new YtDataValidationException(ErrorMessage.VIDEO_PLATFORM_CONFIG_ERROR.getMessage()); | 84 | + throw new TkDataValidationException(ErrorMessage.VIDEO_PLATFORM_CONFIG_ERROR.getMessage()); |
85 | } | 85 | } |
86 | } | 86 | } |
87 | } | 87 | } |
common/data/src/main/java/org/thingsboard/server/common/data/yunteng/utils/tools/TkPageData.java
renamed from
common/data/src/main/java/org/thingsboard/server/common/data/yunteng/utils/tools/YtPageData.java
@@ -8,12 +8,12 @@ import java.util.Collection; | @@ -8,12 +8,12 @@ import java.util.Collection; | ||
8 | 8 | ||
9 | @Data | 9 | @Data |
10 | @NoArgsConstructor | 10 | @NoArgsConstructor |
11 | -public class YtPageData<T> implements Serializable { | 11 | +public class TkPageData<T> implements Serializable { |
12 | private static final long serialVersionUID = -5385636733740491124L; | 12 | private static final long serialVersionUID = -5385636733740491124L; |
13 | private int total; | 13 | private int total; |
14 | private Collection<T> items; | 14 | private Collection<T> items; |
15 | 15 | ||
16 | - public YtPageData(Collection<T> list, long total) { | 16 | + public TkPageData(Collection<T> list, long total) { |
17 | this.items = list; | 17 | this.items = list; |
18 | this.total = (int) total; | 18 | this.total = (int) total; |
19 | } | 19 | } |
common/transport/tcp/src/main/java/org/thingsboard/server/transport/tcp/adaptors/JsonTcpAdaptor.java
@@ -31,8 +31,8 @@ import org.springframework.util.StringUtils; | @@ -31,8 +31,8 @@ import org.springframework.util.StringUtils; | ||
31 | import org.thingsboard.server.common.data.ota.OtaPackageType; | 31 | import org.thingsboard.server.common.data.ota.OtaPackageType; |
32 | import org.thingsboard.server.common.transport.adaptor.AdaptorException; | 32 | import org.thingsboard.server.common.transport.adaptor.AdaptorException; |
33 | import org.thingsboard.server.common.transport.adaptor.JsonConverter; | 33 | import org.thingsboard.server.common.transport.adaptor.JsonConverter; |
34 | -import org.thingsboard.server.common.yunteng.script.YtScriptInvokeService; | ||
35 | -import org.thingsboard.server.common.yunteng.script.YtScriptType; | 34 | +import org.thingsboard.server.common.yunteng.script.TkScriptInvokeService; |
35 | +import org.thingsboard.server.common.yunteng.script.TkScriptType; | ||
36 | import org.thingsboard.server.gen.transport.TransportProtos; | 36 | import org.thingsboard.server.gen.transport.TransportProtos; |
37 | import org.thingsboard.server.transport.tcp.session.TCPMessage; | 37 | import org.thingsboard.server.transport.tcp.session.TCPMessage; |
38 | import org.thingsboard.server.transport.tcp.session.TcpDeviceWareSessionContext; | 38 | import org.thingsboard.server.transport.tcp.session.TcpDeviceWareSessionContext; |
@@ -53,7 +53,7 @@ public class JsonTcpAdaptor implements TcpTransportAdaptor { | @@ -53,7 +53,7 @@ public class JsonTcpAdaptor implements TcpTransportAdaptor { | ||
53 | 53 | ||
54 | protected static final Charset UTF8 = StandardCharsets.UTF_8; | 54 | protected static final Charset UTF8 = StandardCharsets.UTF_8; |
55 | @Autowired | 55 | @Autowired |
56 | - private YtScriptInvokeService jsEngine; | 56 | + private TkScriptInvokeService jsEngine; |
57 | private static final JsonParser parser = new JsonParser(); | 57 | private static final JsonParser parser = new JsonParser(); |
58 | 58 | ||
59 | @Override | 59 | @Override |
@@ -73,7 +73,7 @@ public class JsonTcpAdaptor implements TcpTransportAdaptor { | @@ -73,7 +73,7 @@ public class JsonTcpAdaptor implements TcpTransportAdaptor { | ||
73 | 73 | ||
74 | @Override | 74 | @Override |
75 | public UUID getJsScriptEngineFunctionId(String scriptBody, String... argNames) throws ExecutionException, InterruptedException { | 75 | public UUID getJsScriptEngineFunctionId(String scriptBody, String... argNames) throws ExecutionException, InterruptedException { |
76 | - return jsEngine.eval(YtScriptType.TCP_TRANSPORT_SCRIPT, scriptBody, argNames).get(); | 76 | + return jsEngine.eval(TkScriptType.TCP_TRANSPORT_SCRIPT, scriptBody, argNames).get(); |
77 | } | 77 | } |
78 | 78 | ||
79 | @Override | 79 | @Override |
@@ -21,12 +21,12 @@ import lombok.Getter; | @@ -21,12 +21,12 @@ import lombok.Getter; | ||
21 | import lombok.extern.slf4j.Slf4j; | 21 | import lombok.extern.slf4j.Slf4j; |
22 | import org.thingsboard.server.common.data.DeviceProfile; | 22 | import org.thingsboard.server.common.data.DeviceProfile; |
23 | import org.thingsboard.server.common.data.device.profile.DeviceProfileTransportConfiguration; | 23 | import org.thingsboard.server.common.data.device.profile.DeviceProfileTransportConfiguration; |
24 | -import org.thingsboard.server.common.data.device.profile.YtTcpDeviceProfileTransportConfiguration; | 24 | +import org.thingsboard.server.common.data.device.profile.TkTcpDeviceProfileTransportConfiguration; |
25 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 25 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
26 | import org.thingsboard.server.common.data.yunteng.enums.TcpDataTypeEnum; | 26 | import org.thingsboard.server.common.data.yunteng.enums.TcpDataTypeEnum; |
27 | import org.thingsboard.server.common.transport.auth.TransportDeviceInfo; | 27 | import org.thingsboard.server.common.transport.auth.TransportDeviceInfo; |
28 | import org.thingsboard.server.common.transport.session.DeviceAwareSessionContext; | 28 | import org.thingsboard.server.common.transport.session.DeviceAwareSessionContext; |
29 | -import org.thingsboard.server.common.yunteng.script.YtScriptFactory; | 29 | +import org.thingsboard.server.common.yunteng.script.TkScriptFactory; |
30 | import org.thingsboard.server.gen.transport.TransportProtos; | 30 | import org.thingsboard.server.gen.transport.TransportProtos; |
31 | import org.thingsboard.server.transport.tcp.TcpTransportContext; | 31 | import org.thingsboard.server.transport.tcp.TcpTransportContext; |
32 | import org.thingsboard.server.transport.tcp.adaptors.TcpTransportAdaptor; | 32 | import org.thingsboard.server.transport.tcp.adaptors.TcpTransportAdaptor; |
@@ -111,7 +111,7 @@ public abstract class TcpDeviceWareSessionContext extends DeviceAwareSessionCont | @@ -111,7 +111,7 @@ public abstract class TcpDeviceWareSessionContext extends DeviceAwareSessionCont | ||
111 | private void updateDeviceSessionConfiguration(DeviceProfile deviceProfile){ | 111 | private void updateDeviceSessionConfiguration(DeviceProfile deviceProfile){ |
112 | DeviceProfileTransportConfiguration transportConfiguration = deviceProfile.getProfileData().getTransportConfiguration(); | 112 | DeviceProfileTransportConfiguration transportConfiguration = deviceProfile.getProfileData().getTransportConfiguration(); |
113 | 113 | ||
114 | - YtTcpDeviceProfileTransportConfiguration tcpConfiguration = (YtTcpDeviceProfileTransportConfiguration) transportConfiguration; | 114 | + TkTcpDeviceProfileTransportConfiguration tcpConfiguration = (TkTcpDeviceProfileTransportConfiguration) transportConfiguration; |
115 | payloadType = tcpConfiguration.getDataFormat(); | 115 | payloadType = tcpConfiguration.getDataFormat(); |
116 | if (TcpDataTypeEnum.ASCII.equals(payloadType)) { | 116 | if (TcpDataTypeEnum.ASCII.equals(payloadType)) { |
117 | payloadType = TcpDataTypeEnum.ASCII; | 117 | payloadType = TcpDataTypeEnum.ASCII; |
@@ -123,7 +123,7 @@ public abstract class TcpDeviceWareSessionContext extends DeviceAwareSessionCont | @@ -123,7 +123,7 @@ public abstract class TcpDeviceWareSessionContext extends DeviceAwareSessionCont | ||
123 | this.toDeviceRpcResponseTopicFilter = tcpConfiguration.getRpcTopic(); | 123 | this.toDeviceRpcResponseTopicFilter = tcpConfiguration.getRpcTopic(); |
124 | String scriptBody = tcpConfiguration.getScriptText(); | 124 | String scriptBody = tcpConfiguration.getScriptText(); |
125 | try { | 125 | try { |
126 | - this.scriptId = this.adaptor.getJsScriptEngineFunctionId(scriptBody==null? YtScriptFactory.INCLUD_ORIGINAL_DATA:scriptBody); | 126 | + this.scriptId = this.adaptor.getJsScriptEngineFunctionId(scriptBody==null? TkScriptFactory.INCLUD_ORIGINAL_DATA:scriptBody); |
127 | } catch (ExecutionException e) { | 127 | } catch (ExecutionException e) { |
128 | log.warn("设备配置【{}】的脚本【{}】解析异常",deviceProfile.getSearchText(),scriptBody); | 128 | log.warn("设备配置【{}】的脚本【{}】解析异常",deviceProfile.getSearchText(),scriptBody); |
129 | throw new RuntimeException(e); | 129 | throw new RuntimeException(e); |
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/AbstractNashornTkScriptInvokeService.java
renamed from
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/AbstractNashornYtScriptInvokeService.java
@@ -26,9 +26,6 @@ import lombok.extern.slf4j.Slf4j; | @@ -26,9 +26,6 @@ import lombok.extern.slf4j.Slf4j; | ||
26 | import org.springframework.beans.factory.annotation.Value; | 26 | import org.springframework.beans.factory.annotation.Value; |
27 | import org.springframework.scheduling.annotation.Scheduled; | 27 | import org.springframework.scheduling.annotation.Scheduled; |
28 | import org.thingsboard.common.util.ThingsBoardExecutors; | 28 | import org.thingsboard.common.util.ThingsBoardExecutors; |
29 | -import org.thingsboard.server.common.yunteng.script.AbstractYtScriptInvokeService; | ||
30 | -import org.thingsboard.server.common.yunteng.script.YtScriptExecutorService; | ||
31 | -import org.thingsboard.server.common.yunteng.script.YtScriptStatCallback; | ||
32 | import org.thingsboard.server.queue.usagestats.TbApiUsageClient; | 29 | import org.thingsboard.server.queue.usagestats.TbApiUsageClient; |
33 | 30 | ||
34 | import javax.annotation.PostConstruct; | 31 | import javax.annotation.PostConstruct; |
@@ -45,7 +42,7 @@ import java.util.concurrent.atomic.AtomicInteger; | @@ -45,7 +42,7 @@ import java.util.concurrent.atomic.AtomicInteger; | ||
45 | import java.util.concurrent.locks.ReentrantLock; | 42 | import java.util.concurrent.locks.ReentrantLock; |
46 | 43 | ||
47 | @Slf4j | 44 | @Slf4j |
48 | -public abstract class AbstractNashornYtScriptInvokeService extends AbstractYtScriptInvokeService { | 45 | +public abstract class AbstractNashornTkScriptInvokeService extends AbstractTkScriptInvokeService { |
49 | 46 | ||
50 | private NashornSandbox sandbox; | 47 | private NashornSandbox sandbox; |
51 | private ScriptEngine engine; | 48 | private ScriptEngine engine; |
@@ -56,13 +53,13 @@ public abstract class AbstractNashornYtScriptInvokeService extends AbstractYtScr | @@ -56,13 +53,13 @@ public abstract class AbstractNashornYtScriptInvokeService extends AbstractYtScr | ||
56 | private final AtomicInteger jsEvalMsgs = new AtomicInteger(0); | 53 | private final AtomicInteger jsEvalMsgs = new AtomicInteger(0); |
57 | private final AtomicInteger jsFailedMsgs = new AtomicInteger(0); | 54 | private final AtomicInteger jsFailedMsgs = new AtomicInteger(0); |
58 | private final AtomicInteger jsTimeoutMsgs = new AtomicInteger(0); | 55 | private final AtomicInteger jsTimeoutMsgs = new AtomicInteger(0); |
59 | - private final FutureCallback<UUID> evalCallback = new YtScriptStatCallback<>(jsEvalMsgs, jsTimeoutMsgs, jsFailedMsgs); | ||
60 | - private final FutureCallback<Object> invokeCallback = new YtScriptStatCallback<>(jsInvokeMsgs, jsTimeoutMsgs, jsFailedMsgs); | 56 | + private final FutureCallback<UUID> evalCallback = new TkScriptStatCallback<>(jsEvalMsgs, jsTimeoutMsgs, jsFailedMsgs); |
57 | + private final FutureCallback<Object> invokeCallback = new TkScriptStatCallback<>(jsInvokeMsgs, jsTimeoutMsgs, jsFailedMsgs); | ||
61 | 58 | ||
62 | private final ReentrantLock evalLock = new ReentrantLock(); | 59 | private final ReentrantLock evalLock = new ReentrantLock(); |
63 | 60 | ||
64 | @Getter | 61 | @Getter |
65 | - private final YtScriptExecutorService jsExecutor; | 62 | + private final TkScriptExecutorService jsExecutor; |
66 | 63 | ||
67 | @Value("${js.local.max_requests_timeout:0}") | 64 | @Value("${js.local.max_requests_timeout:0}") |
68 | private long maxRequestsTimeout; | 65 | private long maxRequestsTimeout; |
@@ -70,7 +67,7 @@ public abstract class AbstractNashornYtScriptInvokeService extends AbstractYtScr | @@ -70,7 +67,7 @@ public abstract class AbstractNashornYtScriptInvokeService extends AbstractYtScr | ||
70 | @Value("${js.local.stats.enabled:false}") | 67 | @Value("${js.local.stats.enabled:false}") |
71 | private boolean statsEnabled; | 68 | private boolean statsEnabled; |
72 | 69 | ||
73 | - public AbstractNashornYtScriptInvokeService(TbApiUsageClient apiUsageClient, YtScriptExecutorService jsExecutor) { | 70 | + public AbstractNashornTkScriptInvokeService(TbApiUsageClient apiUsageClient, TkScriptExecutorService jsExecutor) { |
74 | super(); | 71 | super(); |
75 | this.jsExecutor = jsExecutor; | 72 | this.jsExecutor = jsExecutor; |
76 | } | 73 | } |
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/AbstractTkScriptInvokeService.java
renamed from
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/AbstractYtScriptInvokeService.java
@@ -31,7 +31,7 @@ import java.util.concurrent.atomic.AtomicInteger; | @@ -31,7 +31,7 @@ import java.util.concurrent.atomic.AtomicInteger; | ||
31 | * Created by ashvayka on 26.09.18. | 31 | * Created by ashvayka on 26.09.18. |
32 | */ | 32 | */ |
33 | @Slf4j | 33 | @Slf4j |
34 | -public abstract class AbstractYtScriptInvokeService implements YtScriptInvokeService { | 34 | +public abstract class AbstractTkScriptInvokeService implements TkScriptInvokeService { |
35 | 35 | ||
36 | 36 | ||
37 | 37 | ||
@@ -54,7 +54,7 @@ public abstract class AbstractYtScriptInvokeService implements YtScriptInvokeSer | @@ -54,7 +54,7 @@ public abstract class AbstractYtScriptInvokeService implements YtScriptInvokeSer | ||
54 | } | 54 | } |
55 | 55 | ||
56 | @Override | 56 | @Override |
57 | - public ListenableFuture<UUID> eval(YtScriptType scriptType, String scriptBody, String... argNames) { | 57 | + public ListenableFuture<UUID> eval(TkScriptType scriptType, String scriptBody, String... argNames) { |
58 | UUID scriptId = UUID.randomUUID(); | 58 | UUID scriptId = UUID.randomUUID(); |
59 | String functionName = "invokeInternal_" + scriptId.toString().replace('-', '_'); | 59 | String functionName = "invokeInternal_" + scriptId.toString().replace('-', '_'); |
60 | String jsScript = generateJsScript(scriptType, functionName, scriptBody, argNames); | 60 | String jsScript = generateJsScript(scriptType, functionName, scriptBody, argNames); |
@@ -109,9 +109,9 @@ public abstract class AbstractYtScriptInvokeService implements YtScriptInvokeSer | @@ -109,9 +109,9 @@ public abstract class AbstractYtScriptInvokeService implements YtScriptInvokeSer | ||
109 | disableListInfo.incrementAndGet(); | 109 | disableListInfo.incrementAndGet(); |
110 | } | 110 | } |
111 | 111 | ||
112 | - private String generateJsScript(YtScriptType scriptType, String functionName, String scriptBody, String... argNames) { | ||
113 | - if (scriptType == YtScriptType.TCP_TRANSPORT_SCRIPT) { | ||
114 | - return YtScriptFactory.generateRuleNodeScript(functionName, scriptBody, argNames); | 112 | + private String generateJsScript(TkScriptType scriptType, String functionName, String scriptBody, String... argNames) { |
113 | + if (scriptType == TkScriptType.TCP_TRANSPORT_SCRIPT) { | ||
114 | + return TkScriptFactory.generateRuleNodeScript(functionName, scriptBody, argNames); | ||
115 | 115 | ||
116 | } | 116 | } |
117 | throw new RuntimeException("No script factory implemented for scriptType: " + scriptType); | 117 | throw new RuntimeException("No script factory implemented for scriptType: " + scriptType); |
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/NashornTkScriptInvokeService.java
renamed from
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/NashornYtScriptInvokeService.java
@@ -19,8 +19,6 @@ import lombok.extern.slf4j.Slf4j; | @@ -19,8 +19,6 @@ import lombok.extern.slf4j.Slf4j; | ||
19 | import org.springframework.beans.factory.annotation.Value; | 19 | import org.springframework.beans.factory.annotation.Value; |
20 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | 20 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
21 | import org.springframework.stereotype.Service; | 21 | import org.springframework.stereotype.Service; |
22 | -import org.thingsboard.server.common.yunteng.script.AbstractNashornYtScriptInvokeService; | ||
23 | -import org.thingsboard.server.common.yunteng.script.YtScriptExecutorService; | ||
24 | import org.thingsboard.server.queue.usagestats.TbApiUsageClient; | 22 | import org.thingsboard.server.queue.usagestats.TbApiUsageClient; |
25 | 23 | ||
26 | import java.util.concurrent.TimeUnit; | 24 | import java.util.concurrent.TimeUnit; |
@@ -29,7 +27,7 @@ import java.util.concurrent.TimeUnit; | @@ -29,7 +27,7 @@ import java.util.concurrent.TimeUnit; | ||
29 | @ConditionalOnProperty(prefix = "js", value = "evaluator", havingValue = "local", matchIfMissing = true) | 27 | @ConditionalOnProperty(prefix = "js", value = "evaluator", havingValue = "local", matchIfMissing = true) |
30 | @Service | 28 | @Service |
31 | public class | 29 | public class |
32 | -NashornYtScriptInvokeService extends AbstractNashornYtScriptInvokeService { | 30 | +NashornTkScriptInvokeService extends AbstractNashornTkScriptInvokeService { |
33 | 31 | ||
34 | @Value("${js.local.use_js_sandbox}") | 32 | @Value("${js.local.use_js_sandbox}") |
35 | private boolean useJsSandbox; | 33 | private boolean useJsSandbox; |
@@ -46,7 +44,7 @@ NashornYtScriptInvokeService extends AbstractNashornYtScriptInvokeService { | @@ -46,7 +44,7 @@ NashornYtScriptInvokeService extends AbstractNashornYtScriptInvokeService { | ||
46 | @Value("${js.local.max_black_list_duration_sec:60}") | 44 | @Value("${js.local.max_black_list_duration_sec:60}") |
47 | private int maxBlackListDurationSec; | 45 | private int maxBlackListDurationSec; |
48 | 46 | ||
49 | - public NashornYtScriptInvokeService(TbApiUsageClient apiUsageClient, YtScriptExecutorService jsExecutor) { | 47 | + public NashornTkScriptInvokeService(TbApiUsageClient apiUsageClient, TkScriptExecutorService jsExecutor) { |
50 | super(apiUsageClient, jsExecutor); | 48 | super(apiUsageClient, jsExecutor); |
51 | } | 49 | } |
52 | 50 |
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/TkRemoteJsInvokeService.java
renamed from
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/YtRemoteJsInvokeService.java
@@ -44,7 +44,7 @@ import java.util.concurrent.atomic.AtomicInteger; | @@ -44,7 +44,7 @@ import java.util.concurrent.atomic.AtomicInteger; | ||
44 | @Slf4j | 44 | @Slf4j |
45 | @ConditionalOnExpression("'${js.evaluator:null}'=='remote' && ('${service.type:null}'=='monolith' || '${service.type:null}'=='tb-core' || '${service.type:null}'=='tb-transport')") | 45 | @ConditionalOnExpression("'${js.evaluator:null}'=='remote' && ('${service.type:null}'=='monolith' || '${service.type:null}'=='tb-core' || '${service.type:null}'=='tb-transport')") |
46 | @Service | 46 | @Service |
47 | -public class YtRemoteJsInvokeService extends AbstractYtScriptInvokeService { | 47 | +public class TkRemoteJsInvokeService extends AbstractTkScriptInvokeService { |
48 | 48 | ||
49 | @Value("${queue.js.max_eval_requests_timeout}") | 49 | @Value("${queue.js.max_eval_requests_timeout}") |
50 | private long maxEvalRequestsTimeout; | 50 | private long maxEvalRequestsTimeout; |
@@ -70,7 +70,7 @@ public class YtRemoteJsInvokeService extends AbstractYtScriptInvokeService { | @@ -70,7 +70,7 @@ public class YtRemoteJsInvokeService extends AbstractYtScriptInvokeService { | ||
70 | private final ExecutorService callbackExecutor = Executors.newFixedThreadPool( | 70 | private final ExecutorService callbackExecutor = Executors.newFixedThreadPool( |
71 | Runtime.getRuntime().availableProcessors(), ThingsBoardThreadFactory.forName("js-executor-remote-callback")); | 71 | Runtime.getRuntime().availableProcessors(), ThingsBoardThreadFactory.forName("js-executor-remote-callback")); |
72 | 72 | ||
73 | - public YtRemoteJsInvokeService(TbApiUsageClient apiUsageClient) { | 73 | + public TkRemoteJsInvokeService(TbApiUsageClient apiUsageClient) { |
74 | super(); | 74 | super(); |
75 | } | 75 | } |
76 | 76 |
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/TkScriptExecutorService.java
renamed from
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/YtScriptExecutorService.java
@@ -20,7 +20,7 @@ import org.springframework.stereotype.Component; | @@ -20,7 +20,7 @@ import org.springframework.stereotype.Component; | ||
20 | import org.thingsboard.common.util.AbstractListeningExecutor; | 20 | import org.thingsboard.common.util.AbstractListeningExecutor; |
21 | 21 | ||
22 | @Component | 22 | @Component |
23 | -public class YtScriptExecutorService extends AbstractListeningExecutor { | 23 | +public class TkScriptExecutorService extends AbstractListeningExecutor { |
24 | 24 | ||
25 | @Value("${actors.rule.js_thread_pool_size}") | 25 | @Value("${actors.rule.js_thread_pool_size}") |
26 | private int jsExecutorThreadPoolSize; | 26 | private int jsExecutorThreadPoolSize; |
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/TkScriptFactory.java
renamed from
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/YtScriptFactory.java
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | */ | 15 | */ |
16 | package org.thingsboard.server.common.yunteng.script; | 16 | package org.thingsboard.server.common.yunteng.script; |
17 | 17 | ||
18 | -public class YtScriptFactory { | 18 | +public class TkScriptFactory { |
19 | 19 | ||
20 | public static final String MSG = "params"; | 20 | public static final String MSG = "params"; |
21 | 21 |
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/TkScriptInvokeRequest.java
renamed from
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/YtScriptInvokeRequest.java
@@ -20,7 +20,7 @@ import java.util.List; | @@ -20,7 +20,7 @@ import java.util.List; | ||
20 | /** | 20 | /** |
21 | * Created by ashvayka on 25.09.18. | 21 | * Created by ashvayka on 25.09.18. |
22 | */ | 22 | */ |
23 | -public class YtScriptInvokeRequest { | 23 | +public class TkScriptInvokeRequest { |
24 | 24 | ||
25 | private String scriptId; | 25 | private String scriptId; |
26 | private String scriptBody; | 26 | private String scriptBody; |
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/TkScriptInvokeResponse.java
renamed from
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/YtScriptInvokeResponse.java
@@ -20,7 +20,7 @@ import java.util.List; | @@ -20,7 +20,7 @@ import java.util.List; | ||
20 | /** | 20 | /** |
21 | * Created by ashvayka on 25.09.18. | 21 | * Created by ashvayka on 25.09.18. |
22 | */ | 22 | */ |
23 | -public class YtScriptInvokeResponse { | 23 | +public class TkScriptInvokeResponse { |
24 | 24 | ||
25 | private String scriptId; | 25 | private String scriptId; |
26 | private String scriptBody; | 26 | private String scriptBody; |
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/TkScriptInvokeService.java
renamed from
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/YtScriptInvokeService.java
@@ -19,9 +19,9 @@ import com.google.common.util.concurrent.ListenableFuture; | @@ -19,9 +19,9 @@ import com.google.common.util.concurrent.ListenableFuture; | ||
19 | 19 | ||
20 | import java.util.UUID; | 20 | import java.util.UUID; |
21 | 21 | ||
22 | -public interface YtScriptInvokeService { | 22 | +public interface TkScriptInvokeService { |
23 | 23 | ||
24 | - ListenableFuture<UUID> eval(YtScriptType scriptType, String scriptBody, String... argNames); | 24 | + ListenableFuture<UUID> eval(TkScriptType scriptType, String scriptBody, String... argNames); |
25 | 25 | ||
26 | ListenableFuture<Object> invokeFunction(UUID scriptId, Object... args); | 26 | ListenableFuture<Object> invokeFunction(UUID scriptId, Object... args); |
27 | 27 |
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/TkScriptStatCallback.java
renamed from
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/YtScriptStatCallback.java
@@ -23,7 +23,7 @@ import java.util.concurrent.TimeoutException; | @@ -23,7 +23,7 @@ import java.util.concurrent.TimeoutException; | ||
23 | import java.util.concurrent.atomic.AtomicInteger; | 23 | import java.util.concurrent.atomic.AtomicInteger; |
24 | 24 | ||
25 | @AllArgsConstructor | 25 | @AllArgsConstructor |
26 | -public class YtScriptStatCallback<T> implements FutureCallback<T> { | 26 | +public class TkScriptStatCallback<T> implements FutureCallback<T> { |
27 | 27 | ||
28 | private final AtomicInteger jsSuccessMsgs; | 28 | private final AtomicInteger jsSuccessMsgs; |
29 | private final AtomicInteger jsTimeoutMsgs; | 29 | private final AtomicInteger jsTimeoutMsgs; |
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/TkScriptType.java
renamed from
common/transport/transport-api/src/main/java/org/thingsboard/server/common/yunteng/script/YtScriptType.java
@@ -36,7 +36,7 @@ import org.thingsboard.server.common.data.id.DeviceProfileId; | @@ -36,7 +36,7 @@ import org.thingsboard.server.common.data.id.DeviceProfileId; | ||
36 | import org.thingsboard.server.common.data.id.TenantId; | 36 | import org.thingsboard.server.common.data.id.TenantId; |
37 | import org.thingsboard.server.common.data.page.PageData; | 37 | import org.thingsboard.server.common.data.page.PageData; |
38 | import org.thingsboard.server.common.data.page.PageLink; | 38 | import org.thingsboard.server.common.data.page.PageLink; |
39 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 39 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
40 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 40 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
41 | import org.thingsboard.server.dao.entity.AbstractEntityService; | 41 | import org.thingsboard.server.dao.entity.AbstractEntityService; |
42 | import org.thingsboard.server.dao.exception.DataValidationException; | 42 | import org.thingsboard.server.dao.exception.DataValidationException; |
@@ -114,7 +114,7 @@ public class DeviceProfileServiceImpl extends AbstractEntityService implements D | @@ -114,7 +114,7 @@ public class DeviceProfileServiceImpl extends AbstractEntityService implements D | ||
114 | } catch (Exception t) { | 114 | } catch (Exception t) { |
115 | ConstraintViolationException e = extractConstraintViolationException(t).orElse(null); | 115 | ConstraintViolationException e = extractConstraintViolationException(t).orElse(null); |
116 | if (e != null && e.getConstraintName() != null && e.getConstraintName().equalsIgnoreCase("device_profile_name_unq_key")) { | 116 | if (e != null && e.getConstraintName() != null && e.getConstraintName().equalsIgnoreCase("device_profile_name_unq_key")) { |
117 | - throw new YtDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); | 117 | + throw new TkDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); |
118 | } else if (e != null && e.getConstraintName() != null && e.getConstraintName().equalsIgnoreCase("device_provision_key_unq_key")) { | 118 | } else if (e != null && e.getConstraintName() != null && e.getConstraintName().equalsIgnoreCase("device_provision_key_unq_key")) { |
119 | throw new DataValidationException("Device profile with such provision device key already exists!"); | 119 | throw new DataValidationException("Device profile with such provision device key already exists!"); |
120 | } else { | 120 | } else { |
@@ -266,7 +266,7 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe | @@ -266,7 +266,7 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe | ||
266 | 266 | ||
267 | //Thingskit function | 267 | //Thingskit function |
268 | case TCP: | 268 | case TCP: |
269 | - deviceData.setTransportConfiguration(new YtTcpDeviceTransportConfiguration()); | 269 | + deviceData.setTransportConfiguration(new TkTcpDeviceTransportConfiguration()); |
270 | break; | 270 | break; |
271 | 271 | ||
272 | } | 272 | } |
@@ -4,7 +4,7 @@ package org.thingsboard.server.dao.util.yunteng; | @@ -4,7 +4,7 @@ package org.thingsboard.server.dao.util.yunteng; | ||
4 | import org.apache.commons.lang3.StringUtils; | 4 | import org.apache.commons.lang3.StringUtils; |
5 | import org.quartz.*; | 5 | import org.quartz.*; |
6 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 6 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
7 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 7 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
8 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; | 8 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; |
9 | import org.thingsboard.server.common.data.yunteng.utils.SpringBeanUtils; | 9 | import org.thingsboard.server.common.data.yunteng.utils.SpringBeanUtils; |
10 | import org.thingsboard.server.dao.yunteng.entities.SysJobEntity; | 10 | import org.thingsboard.server.dao.yunteng.entities.SysJobEntity; |
@@ -82,7 +82,7 @@ public class ScheduleUtils { | @@ -82,7 +82,7 @@ public class ScheduleUtils { | ||
82 | 82 | ||
83 | /** 设置定时任务策略 */ | 83 | /** 设置定时任务策略 */ |
84 | public static CronScheduleBuilder handleCronScheduleMisfirePolicy( | 84 | public static CronScheduleBuilder handleCronScheduleMisfirePolicy( |
85 | - SysJobEntity job, CronScheduleBuilder cb) throws YtDataValidationException { | 85 | + SysJobEntity job, CronScheduleBuilder cb) throws TkDataValidationException { |
86 | switch (job.getMisfirePolicy()) { | 86 | switch (job.getMisfirePolicy()) { |
87 | case FastIotConstants.ScheduleConstants.MISFIRE_DEFAULT: | 87 | case FastIotConstants.ScheduleConstants.MISFIRE_DEFAULT: |
88 | return cb; | 88 | return cb; |
@@ -93,7 +93,7 @@ public class ScheduleUtils { | @@ -93,7 +93,7 @@ public class ScheduleUtils { | ||
93 | case FastIotConstants.ScheduleConstants.MISFIRE_DO_NOTHING: | 93 | case FastIotConstants.ScheduleConstants.MISFIRE_DO_NOTHING: |
94 | return cb.withMisfireHandlingInstructionDoNothing(); | 94 | return cb.withMisfireHandlingInstructionDoNothing(); |
95 | default: | 95 | default: |
96 | - throw new YtDataValidationException( | 96 | + throw new TkDataValidationException( |
97 | "The task misfire policy '" | 97 | "The task misfire policy '" |
98 | + job.getMisfirePolicy() | 98 | + job.getMisfirePolicy() |
99 | + "' cannot be used in cron schedule tasks"); | 99 | + "' cannot be used in cron schedule tasks"); |
@@ -117,7 +117,7 @@ public class ScheduleUtils { | @@ -117,7 +117,7 @@ public class ScheduleUtils { | ||
117 | try{ | 117 | try{ |
118 | obj = SpringBeanUtils.getBean(StringUtils.split(invokeTarget, ".")[0]); | 118 | obj = SpringBeanUtils.getBean(StringUtils.split(invokeTarget, ".")[0]); |
119 | }catch (Exception e){ | 119 | }catch (Exception e){ |
120 | - throw new YtDataValidationException("调用方法【"+invokeTarget+"】不存在"); | 120 | + throw new TkDataValidationException("调用方法【"+invokeTarget+"】不存在"); |
121 | } | 121 | } |
122 | return containsAnyIgnoreCase( | 122 | return containsAnyIgnoreCase( |
123 | obj.getClass().getPackage().getName(), | 123 | obj.getClass().getPackage().getName(), |
@@ -8,7 +8,7 @@ import org.springframework.stereotype.Service; | @@ -8,7 +8,7 @@ import org.springframework.stereotype.Service; | ||
8 | import org.springframework.transaction.annotation.Transactional; | 8 | import org.springframework.transaction.annotation.Transactional; |
9 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 9 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
10 | import org.thingsboard.server.common.data.yunteng.dto.SysDictItemDTO; | 10 | import org.thingsboard.server.common.data.yunteng.dto.SysDictItemDTO; |
11 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 11 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
12 | import org.thingsboard.server.dao.exception.DataValidationException; | 12 | import org.thingsboard.server.dao.exception.DataValidationException; |
13 | import org.thingsboard.server.dao.yunteng.entities.SysDictItemEntity; | 13 | import org.thingsboard.server.dao.yunteng.entities.SysDictItemEntity; |
14 | import org.thingsboard.server.dao.yunteng.mapper.SysDictItemMapper; | 14 | import org.thingsboard.server.dao.yunteng.mapper.SysDictItemMapper; |
@@ -26,7 +26,7 @@ public class SysDictItemServiceImpl extends AbstractBaseService<SysDictItemMappe | @@ -26,7 +26,7 @@ public class SysDictItemServiceImpl extends AbstractBaseService<SysDictItemMappe | ||
26 | implements SysDictItemService { | 26 | implements SysDictItemService { |
27 | 27 | ||
28 | @Override | 28 | @Override |
29 | - public YtPageData<SysDictItemDTO> page(Map<String, Object> queryMap) { | 29 | + public TkPageData<SysDictItemDTO> page(Map<String, Object> queryMap) { |
30 | if (StringUtils.isEmpty((CharSequence) queryMap.get("dictId"))) { | 30 | if (StringUtils.isEmpty((CharSequence) queryMap.get("dictId"))) { |
31 | throw new DataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 31 | throw new DataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
32 | } | 32 | } |
@@ -7,11 +7,11 @@ import lombok.extern.slf4j.Slf4j; | @@ -7,11 +7,11 @@ import lombok.extern.slf4j.Slf4j; | ||
7 | import org.springframework.stereotype.Service; | 7 | import org.springframework.stereotype.Service; |
8 | import org.springframework.transaction.annotation.Transactional; | 8 | import org.springframework.transaction.annotation.Transactional; |
9 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 9 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
10 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 10 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
12 | import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; | 12 | import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; |
13 | import org.thingsboard.server.common.data.yunteng.dto.SysDictItemDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.SysDictItemDTO; |
14 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 14 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
15 | import org.thingsboard.server.dao.yunteng.entities.SysDictEntity; | 15 | import org.thingsboard.server.dao.yunteng.entities.SysDictEntity; |
16 | import org.thingsboard.server.dao.yunteng.mapper.SysDictItemMapper; | 16 | import org.thingsboard.server.dao.yunteng.mapper.SysDictItemMapper; |
17 | import org.thingsboard.server.dao.yunteng.mapper.SysDictMapper; | 17 | import org.thingsboard.server.dao.yunteng.mapper.SysDictMapper; |
@@ -31,7 +31,7 @@ public class SysDictServiceImpl extends AbstractBaseService<SysDictMapper, SysDi | @@ -31,7 +31,7 @@ public class SysDictServiceImpl extends AbstractBaseService<SysDictMapper, SysDi | ||
31 | private final SysDictItemMapper sysDictItemMapper; | 31 | private final SysDictItemMapper sysDictItemMapper; |
32 | 32 | ||
33 | @Override | 33 | @Override |
34 | - public YtPageData<SysDictDTO> page(Map<String, Object> queryMap) { | 34 | + public TkPageData<SysDictDTO> page(Map<String, Object> queryMap) { |
35 | IPage<SysDictEntity> iPage = | 35 | IPage<SysDictEntity> iPage = |
36 | baseMapper.selectPage( | 36 | baseMapper.selectPage( |
37 | getPage(queryMap, "create_time", false), | 37 | getPage(queryMap, "create_time", false), |
@@ -54,7 +54,7 @@ public class SysDictServiceImpl extends AbstractBaseService<SysDictMapper, SysDi | @@ -54,7 +54,7 @@ public class SysDictServiceImpl extends AbstractBaseService<SysDictMapper, SysDi | ||
54 | // 新增之前先判断该租户是否已添加 | 54 | // 新增之前先判断该租户是否已添加 |
55 | SysDictDTO querySysDict = baseMapper.getDictInfoByCode(tenantId, sysDictDTO.getDictCode()); | 55 | SysDictDTO querySysDict = baseMapper.getDictInfoByCode(tenantId, sysDictDTO.getDictCode()); |
56 | if (querySysDict != null) { | 56 | if (querySysDict != null) { |
57 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 57 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
58 | } | 58 | } |
59 | SysDictEntity sysDict = new SysDictEntity(); | 59 | SysDictEntity sysDict = new SysDictEntity(); |
60 | sysDictDTO.copyToEntity(sysDict); | 60 | sysDictDTO.copyToEntity(sysDict); |
@@ -70,7 +70,7 @@ public class SysDictServiceImpl extends AbstractBaseService<SysDictMapper, SysDi | @@ -70,7 +70,7 @@ public class SysDictServiceImpl extends AbstractBaseService<SysDictMapper, SysDi | ||
70 | for (String id : sysDictIds) { | 70 | for (String id : sysDictIds) { |
71 | List<SysDictItemDTO> sysDictItemDTO = sysDictItemMapper.getDictItemInfo(id, null); | 71 | List<SysDictItemDTO> sysDictItemDTO = sysDictItemMapper.getDictItemInfo(id, null); |
72 | if (sysDictItemDTO != null && sysDictItemDTO.size() > FastIotConstants.MagicNumber.ZERO) { | 72 | if (sysDictItemDTO != null && sysDictItemDTO.size() > FastIotConstants.MagicNumber.ZERO) { |
73 | - throw new YtDataValidationException(ErrorMessage.EXIST_LEADER_MEMBER_RELATION.getMessage()); | 73 | + throw new TkDataValidationException(ErrorMessage.EXIST_LEADER_MEMBER_RELATION.getMessage()); |
74 | } | 74 | } |
75 | } | 75 | } |
76 | return baseMapper.deleteBatchIds(sysDictIds) > 0; | 76 | return baseMapper.deleteBatchIds(sysDictIds) > 0; |
@@ -5,7 +5,7 @@ import lombok.RequiredArgsConstructor; | @@ -5,7 +5,7 @@ import lombok.RequiredArgsConstructor; | ||
5 | import lombok.extern.slf4j.Slf4j; | 5 | import lombok.extern.slf4j.Slf4j; |
6 | import org.springframework.stereotype.Service; | 6 | import org.springframework.stereotype.Service; |
7 | import org.springframework.transaction.annotation.Transactional; | 7 | import org.springframework.transaction.annotation.Transactional; |
8 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 8 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
9 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 9 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
10 | import org.thingsboard.server.common.data.yunteng.dto.SysAreaDTO; | 10 | import org.thingsboard.server.common.data.yunteng.dto.SysAreaDTO; |
11 | import org.thingsboard.server.common.data.yunteng.dto.SysEnterpriseDTO; | 11 | import org.thingsboard.server.common.data.yunteng.dto.SysEnterpriseDTO; |
@@ -36,7 +36,7 @@ public class SysEnterpriseServiceImpl | @@ -36,7 +36,7 @@ public class SysEnterpriseServiceImpl | ||
36 | baseMapper.selectOne( | 36 | baseMapper.selectOne( |
37 | new LambdaQueryWrapper<SysEnterpriseEntity>().eq(SysEnterpriseEntity::getTenantId, tenantId)); | 37 | new LambdaQueryWrapper<SysEnterpriseEntity>().eq(SysEnterpriseEntity::getTenantId, tenantId)); |
38 | if (null != checkSysEnterprise) { | 38 | if (null != checkSysEnterprise) { |
39 | - throw new YtDataValidationException(ErrorMessage.DATA_ALREADY_EXISTS.getMessage()); | 39 | + throw new TkDataValidationException(ErrorMessage.DATA_ALREADY_EXISTS.getMessage()); |
40 | } | 40 | } |
41 | SysEnterpriseEntity entity = sysAppDesignDTO.getEntity(SysEnterpriseEntity.class); | 41 | SysEnterpriseEntity entity = sysAppDesignDTO.getEntity(SysEnterpriseEntity.class); |
42 | entity.setTenantId(tenantId); | 42 | entity.setTenantId(tenantId); |
@@ -8,11 +8,11 @@ import org.apache.commons.lang3.StringUtils; | @@ -8,11 +8,11 @@ import org.apache.commons.lang3.StringUtils; | ||
8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
9 | import org.springframework.transaction.annotation.Transactional; | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
11 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 11 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
14 | import org.thingsboard.server.common.data.yunteng.dto.SysJobLogDTO; | 14 | import org.thingsboard.server.common.data.yunteng.dto.SysJobLogDTO; |
15 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 15 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
16 | import org.thingsboard.server.dao.yunteng.entities.SysJobLogEntity; | 16 | import org.thingsboard.server.dao.yunteng.entities.SysJobLogEntity; |
17 | import org.thingsboard.server.dao.yunteng.mapper.SysJobLogMapper; | 17 | import org.thingsboard.server.dao.yunteng.mapper.SysJobLogMapper; |
18 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; | 18 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
@@ -28,7 +28,7 @@ public class SysJobLogServiceImpl extends AbstractBaseService<SysJobLogMapper, S | @@ -28,7 +28,7 @@ public class SysJobLogServiceImpl extends AbstractBaseService<SysJobLogMapper, S | ||
28 | implements TkSysJobLogService { | 28 | implements TkSysJobLogService { |
29 | 29 | ||
30 | @Override | 30 | @Override |
31 | - public YtPageData<SysJobLogDTO> sysJobLogPageByJobId(Map<String, Object> queryMap) { | 31 | + public TkPageData<SysJobLogDTO> sysJobLogPageByJobId(Map<String, Object> queryMap) { |
32 | String jobName = queryMap.get("jobName") != null ? queryMap.get("jobName").toString() : null; | 32 | String jobName = queryMap.get("jobName") != null ? queryMap.get("jobName").toString() : null; |
33 | String jobGroup = queryMap.get("jobGroup") != null ? queryMap.get("jobGroup").toString() : null; | 33 | String jobGroup = queryMap.get("jobGroup") != null ? queryMap.get("jobGroup").toString() : null; |
34 | String jobId = queryMap.get("jobId") != null ? queryMap.get("jobId").toString() : null; | 34 | String jobId = queryMap.get("jobId") != null ? queryMap.get("jobId").toString() : null; |
@@ -48,7 +48,7 @@ public class SysJobLogServiceImpl extends AbstractBaseService<SysJobLogMapper, S | @@ -48,7 +48,7 @@ public class SysJobLogServiceImpl extends AbstractBaseService<SysJobLogMapper, S | ||
48 | @Override | 48 | @Override |
49 | public SysJobLogDTO findSysJobLogById(String jobId, String id) { | 49 | public SysJobLogDTO findSysJobLogById(String jobId, String id) { |
50 | if (StringUtils.isEmpty(id)) { | 50 | if (StringUtils.isEmpty(id)) { |
51 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 51 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
52 | } | 52 | } |
53 | SysJobLogEntity sysJobLog = baseMapper.selectById(id); | 53 | SysJobLogEntity sysJobLog = baseMapper.selectById(id); |
54 | return Optional.ofNullable(sysJobLog) | 54 | return Optional.ofNullable(sysJobLog) |
@@ -57,12 +57,12 @@ public class SysJobLogServiceImpl extends AbstractBaseService<SysJobLogMapper, S | @@ -57,12 +57,12 @@ public class SysJobLogServiceImpl extends AbstractBaseService<SysJobLogMapper, S | ||
57 | if (obj.getJobId().equals(jobId)) { | 57 | if (obj.getJobId().equals(jobId)) { |
58 | return obj.getDTO(SysJobLogDTO.class); | 58 | return obj.getDTO(SysJobLogDTO.class); |
59 | } else { | 59 | } else { |
60 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 60 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
61 | } | 61 | } |
62 | }) | 62 | }) |
63 | .orElseThrow( | 63 | .orElseThrow( |
64 | () -> { | 64 | () -> { |
65 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 65 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
66 | }); | 66 | }); |
67 | } | 67 | } |
68 | 68 | ||
@@ -78,7 +78,7 @@ public class SysJobLogServiceImpl extends AbstractBaseService<SysJobLogMapper, S | @@ -78,7 +78,7 @@ public class SysJobLogServiceImpl extends AbstractBaseService<SysJobLogMapper, S | ||
78 | .map(job -> baseMapper.updateById(jobLog)) | 78 | .map(job -> baseMapper.updateById(jobLog)) |
79 | .orElseThrow( | 79 | .orElseThrow( |
80 | () -> { | 80 | () -> { |
81 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 81 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
82 | }); | 82 | }); |
83 | } | 83 | } |
84 | return jobLogDTO; | 84 | return jobLogDTO; |
@@ -8,11 +8,11 @@ import org.quartz.*; | @@ -8,11 +8,11 @@ import org.quartz.*; | ||
8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
9 | import org.springframework.transaction.annotation.Transactional; | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
11 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 11 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | import org.thingsboard.server.common.data.yunteng.dto.*; | 13 | import org.thingsboard.server.common.data.yunteng.dto.*; |
14 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; | 14 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; |
15 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 15 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
16 | import org.thingsboard.server.dao.util.yunteng.CronUtils; | 16 | import org.thingsboard.server.dao.util.yunteng.CronUtils; |
17 | import org.thingsboard.server.dao.util.yunteng.ScheduleUtils; | 17 | import org.thingsboard.server.dao.util.yunteng.ScheduleUtils; |
18 | import org.thingsboard.server.dao.yunteng.entities.SysJobEntity; | 18 | import org.thingsboard.server.dao.yunteng.entities.SysJobEntity; |
@@ -42,7 +42,7 @@ public class SysJobServiceImpl extends AbstractBaseService<SysJobMapper, SysJobE | @@ -42,7 +42,7 @@ public class SysJobServiceImpl extends AbstractBaseService<SysJobMapper, SysJobE | ||
42 | } | 42 | } |
43 | 43 | ||
44 | @Override | 44 | @Override |
45 | - public YtPageData<SysJobDTO> sysJobPage(Map<String, Object> queryMap) { | 45 | + public TkPageData<SysJobDTO> sysJobPage(Map<String, Object> queryMap) { |
46 | String jobGroup = queryMap.get("jobGroup") != null ? queryMap.get("jobGroup").toString() : null; | 46 | String jobGroup = queryMap.get("jobGroup") != null ? queryMap.get("jobGroup").toString() : null; |
47 | String jobName = queryMap.get("jobName") != null ? queryMap.get("jobName").toString() : null; | 47 | String jobName = queryMap.get("jobName") != null ? queryMap.get("jobName").toString() : null; |
48 | Integer status = | 48 | Integer status = |
@@ -71,7 +71,7 @@ public class SysJobServiceImpl extends AbstractBaseService<SysJobMapper, SysJobE | @@ -71,7 +71,7 @@ public class SysJobServiceImpl extends AbstractBaseService<SysJobMapper, SysJobE | ||
71 | .map(obj -> obj.getDTO(SysJobDTO.class)) | 71 | .map(obj -> obj.getDTO(SysJobDTO.class)) |
72 | .orElseThrow( | 72 | .orElseThrow( |
73 | () -> { | 73 | () -> { |
74 | - throw new YtDataValidationException( | 74 | + throw new TkDataValidationException( |
75 | ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); | 75 | ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); |
76 | }); | 76 | }); |
77 | } | 77 | } |
@@ -200,7 +200,7 @@ public class SysJobServiceImpl extends AbstractBaseService<SysJobMapper, SysJobE | @@ -200,7 +200,7 @@ public class SysJobServiceImpl extends AbstractBaseService<SysJobMapper, SysJobE | ||
200 | SysJobEntity job = baseMapper.selectById(jobDTO.getId()); | 200 | SysJobEntity job = baseMapper.selectById(jobDTO.getId()); |
201 | SysJobEntity newJob = jobDTO.getEntity(SysJobEntity.class); | 201 | SysJobEntity newJob = jobDTO.getEntity(SysJobEntity.class); |
202 | if (null == job) { | 202 | if (null == job) { |
203 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 203 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
204 | } | 204 | } |
205 | newJob.setSourceId(job.getSourceId()); | 205 | newJob.setSourceId(job.getSourceId()); |
206 | newJob.setTenantId(job.getTenantId()); | 206 | newJob.setTenantId(job.getTenantId()); |
@@ -7,7 +7,7 @@ import org.springframework.stereotype.Service; | @@ -7,7 +7,7 @@ import org.springframework.stereotype.Service; | ||
7 | import org.thingsboard.server.common.data.EntityType; | 7 | import org.thingsboard.server.common.data.EntityType; |
8 | import org.thingsboard.server.common.data.audit.ActionType; | 8 | import org.thingsboard.server.common.data.audit.ActionType; |
9 | import org.thingsboard.server.common.data.yunteng.dto.SysLogDTO; | 9 | import org.thingsboard.server.common.data.yunteng.dto.SysLogDTO; |
10 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 10 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
11 | import org.thingsboard.server.dao.yunteng.entities.SysLogEntity; | 11 | import org.thingsboard.server.dao.yunteng.entities.SysLogEntity; |
12 | import org.thingsboard.server.dao.yunteng.mapper.SysLogMapper; | 12 | import org.thingsboard.server.dao.yunteng.mapper.SysLogMapper; |
13 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; | 13 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
@@ -29,7 +29,7 @@ public class SysLogServiceImpl extends AbstractBaseService<SysLogMapper, SysLogE | @@ -29,7 +29,7 @@ public class SysLogServiceImpl extends AbstractBaseService<SysLogMapper, SysLogE | ||
29 | } | 29 | } |
30 | 30 | ||
31 | @Override | 31 | @Override |
32 | - public YtPageData<SysLogDTO> exceptionPage(IPage<SysLogEntity> pageInfrom, Long startTime, Long endTime, String tenantId, String customerId, ActionType actionType) { | 32 | + public TkPageData<SysLogDTO> exceptionPage(IPage<SysLogEntity> pageInfrom, Long startTime, Long endTime, String tenantId, String customerId, ActionType actionType) { |
33 | IPage<SysLogDTO> page = | 33 | IPage<SysLogDTO> page = |
34 | baseMapper.getPageDatasMatched(pageInfrom, tenantId, customerId, startTime, endTime, EntityType.RUNNING_EXCEPTION, actionType); | 34 | baseMapper.getPageDatasMatched(pageInfrom, tenantId, customerId, startTime, endTime, EntityType.RUNNING_EXCEPTION, actionType); |
35 | return getPageData(page, SysLogDTO.class); | 35 | return getPageData(page, SysLogDTO.class); |
@@ -37,7 +37,7 @@ public class SysLogServiceImpl extends AbstractBaseService<SysLogMapper, SysLogE | @@ -37,7 +37,7 @@ public class SysLogServiceImpl extends AbstractBaseService<SysLogMapper, SysLogE | ||
37 | 37 | ||
38 | 38 | ||
39 | @Override | 39 | @Override |
40 | - public YtPageData<SysLogDTO> operatePage(IPage<SysLogEntity> pageInfrom, Long startTime, Long endTime, String tenantId, String customerId, EntityType entityType, ActionType actionType) { | 40 | + public TkPageData<SysLogDTO> operatePage(IPage<SysLogEntity> pageInfrom, Long startTime, Long endTime, String tenantId, String customerId, EntityType entityType, ActionType actionType) { |
41 | List<EntityType> entityTypes = new ArrayList<>(); | 41 | List<EntityType> entityTypes = new ArrayList<>(); |
42 | entityTypes.add(EntityType.RUNNING_EXCEPTION); | 42 | entityTypes.add(EntityType.RUNNING_EXCEPTION); |
43 | entityTypes.add(EntityType.USER); | 43 | entityTypes.add(EntityType.USER); |
@@ -61,7 +61,7 @@ public class SysLogServiceImpl extends AbstractBaseService<SysLogMapper, SysLogE | @@ -61,7 +61,7 @@ public class SysLogServiceImpl extends AbstractBaseService<SysLogMapper, SysLogE | ||
61 | } | 61 | } |
62 | 62 | ||
63 | @Override | 63 | @Override |
64 | - public YtPageData<SysLogDTO> loginPage(IPage<SysLogEntity> pageInfrom, Long startTime, Long endTime, String tenantId, String customerId, ActionType actionType) { | 64 | + public TkPageData<SysLogDTO> loginPage(IPage<SysLogEntity> pageInfrom, Long startTime, Long endTime, String tenantId, String customerId, ActionType actionType) { |
65 | IPage<SysLogDTO> page = | 65 | IPage<SysLogDTO> page = |
66 | baseMapper.getPageDatasMatched(pageInfrom, tenantId, customerId, startTime, endTime, EntityType.USER, actionType); | 66 | baseMapper.getPageDatasMatched(pageInfrom, tenantId, customerId, startTime, endTime, EntityType.USER, actionType); |
67 | return getPageData(page, SysLogDTO.class); | 67 | return getPageData(page, SysLogDTO.class); |
@@ -11,7 +11,7 @@ import org.springframework.stereotype.Service; | @@ -11,7 +11,7 @@ import org.springframework.stereotype.Service; | ||
11 | import org.springframework.transaction.annotation.Transactional; | 11 | import org.springframework.transaction.annotation.Transactional; |
12 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 12 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
13 | import org.thingsboard.server.common.data.yunteng.core.cache.CacheUtils; | 13 | import org.thingsboard.server.common.data.yunteng.core.cache.CacheUtils; |
14 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 14 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
15 | import org.thingsboard.server.common.data.yunteng.dto.MenuDTO; | 15 | import org.thingsboard.server.common.data.yunteng.dto.MenuDTO; |
16 | import org.thingsboard.server.common.data.yunteng.enums.MenuTypeEnum; | 16 | import org.thingsboard.server.common.data.yunteng.enums.MenuTypeEnum; |
17 | import org.thingsboard.server.dao.yunteng.entities.SysMenuEntity; | 17 | import org.thingsboard.server.dao.yunteng.entities.SysMenuEntity; |
@@ -91,13 +91,13 @@ public class SysMenuServiceImpl extends AbstractBaseService<MenuMapper, SysMenuE | @@ -91,13 +91,13 @@ public class SysMenuServiceImpl extends AbstractBaseService<MenuMapper, SysMenuE | ||
91 | } | 91 | } |
92 | if (menuDTO.getType().equals(MenuTypeEnum.CUSTOM) | 92 | if (menuDTO.getType().equals(MenuTypeEnum.CUSTOM) |
93 | && StringUtils.isEmpty(menuDTO.getName())) { | 93 | && StringUtils.isEmpty(menuDTO.getName())) { |
94 | - throw new YtDataValidationException("menu name is required when save custom menu"); | 94 | + throw new TkDataValidationException("menu name is required when save custom menu"); |
95 | } | 95 | } |
96 | int count = | 96 | int count = |
97 | baseMapper.selectCount( | 97 | baseMapper.selectCount( |
98 | new QueryWrapper<SysMenuEntity>().lambda().eq(SysMenuEntity::getPath, menuDTO.getPath())); | 98 | new QueryWrapper<SysMenuEntity>().lambda().eq(SysMenuEntity::getPath, menuDTO.getPath())); |
99 | if (count > 0) { | 99 | if (count > 0) { |
100 | - throw new YtDataValidationException("menu with path " + menuDTO + " already exist"); | 100 | + throw new TkDataValidationException("menu with path " + menuDTO + " already exist"); |
101 | } | 101 | } |
102 | menuDTO.setTenantId(tenantId); | 102 | menuDTO.setTenantId(tenantId); |
103 | SysMenuEntity menu = menuDTO.getEntity(SysMenuEntity.class); | 103 | SysMenuEntity menu = menuDTO.getEntity(SysMenuEntity.class); |
@@ -120,7 +120,7 @@ public class SysMenuServiceImpl extends AbstractBaseService<MenuMapper, SysMenuE | @@ -120,7 +120,7 @@ public class SysMenuServiceImpl extends AbstractBaseService<MenuMapper, SysMenuE | ||
120 | public MenuDTO updateMenu(String tenantId, boolean isSysAdmin, MenuDTO menuDTO) { | 120 | public MenuDTO updateMenu(String tenantId, boolean isSysAdmin, MenuDTO menuDTO) { |
121 | SysMenuEntity oldMenu = baseMapper.selectById(menuDTO.getId()); | 121 | SysMenuEntity oldMenu = baseMapper.selectById(menuDTO.getId()); |
122 | if (oldMenu == null) { | 122 | if (oldMenu == null) { |
123 | - throw new YtDataValidationException("cannot find menu to update"); | 123 | + throw new TkDataValidationException("cannot find menu to update"); |
124 | } else { | 124 | } else { |
125 | if (!isSysAdmin) { | 125 | if (!isSysAdmin) { |
126 | if (!tenantId.equals(menuDTO.getTenantId())) { | 126 | if (!tenantId.equals(menuDTO.getTenantId())) { |
@@ -158,7 +158,7 @@ public class SysMenuServiceImpl extends AbstractBaseService<MenuMapper, SysMenuE | @@ -158,7 +158,7 @@ public class SysMenuServiceImpl extends AbstractBaseService<MenuMapper, SysMenuE | ||
158 | int menuCountInDB = | 158 | int menuCountInDB = |
159 | baseMapper.selectCount(new QueryWrapper<SysMenuEntity>().lambda().in(SysMenuEntity::getId, ids)); | 159 | baseMapper.selectCount(new QueryWrapper<SysMenuEntity>().lambda().in(SysMenuEntity::getId, ids)); |
160 | if (menuCountInDB != menuId.length) { | 160 | if (menuCountInDB != menuId.length) { |
161 | - throw new YtDataValidationException("please ensure all menu id are valid"); | 161 | + throw new TkDataValidationException("please ensure all menu id are valid"); |
162 | } | 162 | } |
163 | Set<String> existMenus = baseMapper.selectTenantMenuIds(tenantId); | 163 | Set<String> existMenus = baseMapper.selectTenantMenuIds(tenantId); |
164 | Set<String> toDel = Sets.difference(existMenus, ids); | 164 | Set<String> toDel = Sets.difference(existMenus, ids); |
@@ -185,7 +185,7 @@ public class SysMenuServiceImpl extends AbstractBaseService<MenuMapper, SysMenuE | @@ -185,7 +185,7 @@ public class SysMenuServiceImpl extends AbstractBaseService<MenuMapper, SysMenuE | ||
185 | int menuCountInDB = | 185 | int menuCountInDB = |
186 | baseMapper.selectCount(new QueryWrapper<SysMenuEntity>().lambda().in(SysMenuEntity::getId, ids)); | 186 | baseMapper.selectCount(new QueryWrapper<SysMenuEntity>().lambda().in(SysMenuEntity::getId, ids)); |
187 | if (menuCountInDB != menuId.length) { | 187 | if (menuCountInDB != menuId.length) { |
188 | - throw new YtDataValidationException("please ensure all menu id are valid"); | 188 | + throw new TkDataValidationException("please ensure all menu id are valid"); |
189 | } | 189 | } |
190 | } | 190 | } |
191 | Set<String> existMenus = baseMapper.selectRoleMenuIds(roleId); | 191 | Set<String> existMenus = baseMapper.selectRoleMenuIds(roleId); |
@@ -11,7 +11,7 @@ import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | @@ -11,7 +11,7 @@ import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | ||
11 | import org.thingsboard.server.common.data.yunteng.core.exception.EntityCreationException; | 11 | import org.thingsboard.server.common.data.yunteng.core.exception.EntityCreationException; |
12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | import org.thingsboard.server.common.data.yunteng.dto.SysNoticeDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.SysNoticeDTO; |
14 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 14 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
15 | import org.thingsboard.server.dao.yunteng.entities.SysNoticeEntity; | 15 | import org.thingsboard.server.dao.yunteng.entities.SysNoticeEntity; |
16 | import org.thingsboard.server.dao.yunteng.entities.SysUserEntity; | 16 | import org.thingsboard.server.dao.yunteng.entities.SysUserEntity; |
17 | import org.thingsboard.server.dao.yunteng.mapper.SysNoticeMapper; | 17 | import org.thingsboard.server.dao.yunteng.mapper.SysNoticeMapper; |
@@ -42,7 +42,7 @@ public class SysNoticeServiceImpl extends AbstractBaseService<SysNoticeMapper, S | @@ -42,7 +42,7 @@ public class SysNoticeServiceImpl extends AbstractBaseService<SysNoticeMapper, S | ||
42 | private final SysNoticeUserService noticeUserService; | 42 | private final SysNoticeUserService noticeUserService; |
43 | 43 | ||
44 | @Override | 44 | @Override |
45 | - public YtPageData<SysNoticeDTO> page(Map<String, Object> queryMap) { | 45 | + public TkPageData<SysNoticeDTO> page(Map<String, Object> queryMap) { |
46 | IPage<SysNoticeEntity> page = getPage(queryMap, FastIotConstants.DefaultOrder.CREATE_TIME, false); | 46 | IPage<SysNoticeEntity> page = getPage(queryMap, FastIotConstants.DefaultOrder.CREATE_TIME, false); |
47 | IPage<SysNoticeDTO> pageDto = baseMapper.page(page, queryMap); | 47 | IPage<SysNoticeDTO> pageDto = baseMapper.page(page, queryMap); |
48 | return getPageData(pageDto, SysNoticeDTO.class); | 48 | return getPageData(pageDto, SysNoticeDTO.class); |
@@ -7,10 +7,10 @@ import lombok.RequiredArgsConstructor; | @@ -7,10 +7,10 @@ import lombok.RequiredArgsConstructor; | ||
7 | import org.apache.commons.lang3.StringUtils; | 7 | import org.apache.commons.lang3.StringUtils; |
8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
9 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 9 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
10 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 10 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
12 | import org.thingsboard.server.common.data.yunteng.dto.SysNoticeUserDTO; | 12 | import org.thingsboard.server.common.data.yunteng.dto.SysNoticeUserDTO; |
13 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 13 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
14 | import org.thingsboard.server.dao.yunteng.entities.SysNoticeUserEntity; | 14 | import org.thingsboard.server.dao.yunteng.entities.SysNoticeUserEntity; |
15 | import org.thingsboard.server.dao.yunteng.entities.SysUserEntity; | 15 | import org.thingsboard.server.dao.yunteng.entities.SysUserEntity; |
16 | import org.thingsboard.server.dao.yunteng.mapper.SysNoticeUserMapper; | 16 | import org.thingsboard.server.dao.yunteng.mapper.SysNoticeUserMapper; |
@@ -37,17 +37,17 @@ public class SysNoticeUserServiceImpl | @@ -37,17 +37,17 @@ public class SysNoticeUserServiceImpl | ||
37 | private final UserMapper userMapper; | 37 | private final UserMapper userMapper; |
38 | 38 | ||
39 | @Override | 39 | @Override |
40 | - public YtPageData<SysNoticeUserDTO> page(Map<String, Object> queryMap) { | 40 | + public TkPageData<SysNoticeUserDTO> page(Map<String, Object> queryMap) { |
41 | return getPage(queryMap); | 41 | return getPage(queryMap); |
42 | } | 42 | } |
43 | 43 | ||
44 | @Override | 44 | @Override |
45 | - public YtPageData<SysNoticeUserDTO> pageByNoticeId(Map<String, Object> queryMap) { | 45 | + public TkPageData<SysNoticeUserDTO> pageByNoticeId(Map<String, Object> queryMap) { |
46 | return getPage(queryMap); | 46 | return getPage(queryMap); |
47 | } | 47 | } |
48 | 48 | ||
49 | @Override | 49 | @Override |
50 | - public YtPageData<SysNoticeUserDTO> read(Map<String, Object> queryMap, String currentUserId) { | 50 | + public TkPageData<SysNoticeUserDTO> read(Map<String, Object> queryMap, String currentUserId) { |
51 | queryMap.put("creator", currentUserId); | 51 | queryMap.put("creator", currentUserId); |
52 | return getPage(queryMap); | 52 | return getPage(queryMap); |
53 | } | 53 | } |
@@ -96,7 +96,7 @@ public class SysNoticeUserServiceImpl | @@ -96,7 +96,7 @@ public class SysNoticeUserServiceImpl | ||
96 | @Override | 96 | @Override |
97 | public List<String> getSysNoticeUserIdsByNoticeId(String noticeId) { | 97 | public List<String> getSysNoticeUserIdsByNoticeId(String noticeId) { |
98 | if (StringUtils.isEmpty(noticeId)) { | 98 | if (StringUtils.isEmpty(noticeId)) { |
99 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.name()); | 99 | + throw new TkDataValidationException(ErrorMessage.INTERNAL_ERROR.name()); |
100 | } | 100 | } |
101 | return baseMapper | 101 | return baseMapper |
102 | .selectList( | 102 | .selectList( |
@@ -109,7 +109,7 @@ public class SysNoticeUserServiceImpl | @@ -109,7 +109,7 @@ public class SysNoticeUserServiceImpl | ||
109 | @Override | 109 | @Override |
110 | public boolean updateSysNoticeUsersStatusByNoticeId(String id, Integer status) { | 110 | public boolean updateSysNoticeUsersStatusByNoticeId(String id, Integer status) { |
111 | if (StringUtils.isEmpty(id) || status == null) { | 111 | if (StringUtils.isEmpty(id) || status == null) { |
112 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.name()); | 112 | + throw new TkDataValidationException(ErrorMessage.INTERNAL_ERROR.name()); |
113 | } | 113 | } |
114 | return baseMapper.updateSysNoticeUsersStatusByNoticeId(id, status); | 114 | return baseMapper.updateSysNoticeUsersStatusByNoticeId(id, status); |
115 | } | 115 | } |
@@ -122,7 +122,7 @@ public class SysNoticeUserServiceImpl | @@ -122,7 +122,7 @@ public class SysNoticeUserServiceImpl | ||
122 | > 0; | 122 | > 0; |
123 | } | 123 | } |
124 | 124 | ||
125 | - private YtPageData<SysNoticeUserDTO> getPage(Map<String, Object> queryMap) { | 125 | + private TkPageData<SysNoticeUserDTO> getPage(Map<String, Object> queryMap) { |
126 | IPage<SysNoticeUserEntity> page = getPage(queryMap, FastIotConstants.DefaultOrder.CREATE_TIME, false); | 126 | IPage<SysNoticeUserEntity> page = getPage(queryMap, FastIotConstants.DefaultOrder.CREATE_TIME, false); |
127 | IPage<SysNoticeUserDTO> pageDto = baseMapper.page(page, queryMap); | 127 | IPage<SysNoticeUserDTO> pageDto = baseMapper.page(page, queryMap); |
128 | return getPageData(pageDto, SysNoticeUserDTO.class); | 128 | return getPageData(pageDto, SysNoticeUserDTO.class); |
@@ -12,12 +12,12 @@ import org.springframework.stereotype.Service; | @@ -12,12 +12,12 @@ import org.springframework.stereotype.Service; | ||
12 | import org.springframework.transaction.annotation.Transactional; | 12 | import org.springframework.transaction.annotation.Transactional; |
13 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 13 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
14 | import org.thingsboard.server.common.data.yunteng.core.cache.CacheUtils; | 14 | import org.thingsboard.server.common.data.yunteng.core.cache.CacheUtils; |
15 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 15 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
16 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 16 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
17 | import org.thingsboard.server.common.data.yunteng.dto.RoleDTO; | 17 | import org.thingsboard.server.common.data.yunteng.dto.RoleDTO; |
18 | import org.thingsboard.server.common.data.yunteng.dto.request.RoleReqDTO; | 18 | import org.thingsboard.server.common.data.yunteng.dto.request.RoleReqDTO; |
19 | import org.thingsboard.server.common.data.yunteng.enums.RoleEnum; | 19 | import org.thingsboard.server.common.data.yunteng.enums.RoleEnum; |
20 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 20 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
21 | import org.thingsboard.server.dao.yunteng.entities.SysRoleEntity; | 21 | import org.thingsboard.server.dao.yunteng.entities.SysRoleEntity; |
22 | import org.thingsboard.server.dao.yunteng.entities.SysTenantMenuEntity; | 22 | import org.thingsboard.server.dao.yunteng.entities.SysTenantMenuEntity; |
23 | import org.thingsboard.server.dao.yunteng.entities.SysTenantRoleEntity; | 23 | import org.thingsboard.server.dao.yunteng.entities.SysTenantRoleEntity; |
@@ -43,7 +43,7 @@ public class SysRoleServiceImpl extends AbstractBaseService<RoleMapper, SysRoleE | @@ -43,7 +43,7 @@ public class SysRoleServiceImpl extends AbstractBaseService<RoleMapper, SysRoleE | ||
43 | private final UserRoleMapper userRoleMapper; | 43 | private final UserRoleMapper userRoleMapper; |
44 | 44 | ||
45 | @Override | 45 | @Override |
46 | - public YtPageData<RoleDTO> page(String tenantId, Map<String, Object> queryMap) { | 46 | + public TkPageData<RoleDTO> page(String tenantId, Map<String, Object> queryMap) { |
47 | IPage<SysRoleEntity> roleIPage = | 47 | IPage<SysRoleEntity> roleIPage = |
48 | baseMapper.selectPage( | 48 | baseMapper.selectPage( |
49 | getPage(queryMap, "create_time", false), | 49 | getPage(queryMap, "create_time", false), |
@@ -73,7 +73,7 @@ public class SysRoleServiceImpl extends AbstractBaseService<RoleMapper, SysRoleE | @@ -73,7 +73,7 @@ public class SysRoleServiceImpl extends AbstractBaseService<RoleMapper, SysRoleE | ||
73 | // 判断该角色下面是否有用户 | 73 | // 判断该角色下面是否有用户 |
74 | Set<String> userIds = baseMapper.checkRoleUserMappingByRoleIds(ids); | 74 | Set<String> userIds = baseMapper.checkRoleUserMappingByRoleIds(ids); |
75 | if (null != userIds && userIds.size() > 0) { | 75 | if (null != userIds && userIds.size() > 0) { |
76 | - throw new YtDataValidationException(ErrorMessage.ROLE_IN_USE.getMessage()); | 76 | + throw new TkDataValidationException(ErrorMessage.ROLE_IN_USE.getMessage()); |
77 | } | 77 | } |
78 | // delete sys_role_menu mapping | 78 | // delete sys_role_menu mapping |
79 | baseMapper.deleteRoleMenuMappingByRoleIds(ids); | 79 | baseMapper.deleteRoleMenuMappingByRoleIds(ids); |
dao/src/main/java/org/thingsboard/server/dao/yunteng/impl/SysUserOrganizationMappingServiceImpl.java
@@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils; | @@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils; | ||
8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
9 | import org.springframework.transaction.annotation.Transactional; | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
11 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 11 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | import org.thingsboard.server.common.data.yunteng.dto.BaseDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.BaseDTO; |
14 | import org.thingsboard.server.common.data.yunteng.dto.OrganizationDTO; | 14 | import org.thingsboard.server.common.data.yunteng.dto.OrganizationDTO; |
@@ -63,7 +63,7 @@ public class SysUserOrganizationMappingServiceImpl implements UserOrganizationMa | @@ -63,7 +63,7 @@ public class SysUserOrganizationMappingServiceImpl implements UserOrganizationMa | ||
63 | public void addOrUpdateUserOrganizationMapping( | 63 | public void addOrUpdateUserOrganizationMapping( |
64 | String userId, List<String> organizationIds, boolean isUpdate) { | 64 | String userId, List<String> organizationIds, boolean isUpdate) { |
65 | if (StringUtils.isEmpty(userId) || null == organizationIds || organizationIds.size() < 1) { | 65 | if (StringUtils.isEmpty(userId) || null == organizationIds || organizationIds.size() < 1) { |
66 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 66 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
67 | } | 67 | } |
68 | if (isUpdate) { | 68 | if (isUpdate) { |
69 | // 先删除,再新增 | 69 | // 先删除,再新增 |
@@ -77,7 +77,7 @@ public class SysUserOrganizationMappingServiceImpl implements UserOrganizationMa | @@ -77,7 +77,7 @@ public class SysUserOrganizationMappingServiceImpl implements UserOrganizationMa | ||
77 | @Override | 77 | @Override |
78 | public List<String> getOrganizationIdsByUserId(String userId) { | 78 | public List<String> getOrganizationIdsByUserId(String userId) { |
79 | if (StringUtils.isEmpty(userId)) { | 79 | if (StringUtils.isEmpty(userId)) { |
80 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | 80 | + throw new TkDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); |
81 | } | 81 | } |
82 | return userOrganizationMappingMapper | 82 | return userOrganizationMappingMapper |
83 | .selectList( | 83 | .selectList( |
@@ -108,7 +108,7 @@ public class SysUserOrganizationMappingServiceImpl implements UserOrganizationMa | @@ -108,7 +108,7 @@ public class SysUserOrganizationMappingServiceImpl implements UserOrganizationMa | ||
108 | organizationMapper.findOrganizationTreeList( | 108 | organizationMapper.findOrganizationTreeList( |
109 | tenantId, new HashSet<>(List.of(organizationId))); | 109 | tenantId, new HashSet<>(List.of(organizationId))); |
110 | if (organizationList.size() == FastIotConstants.MagicNumber.ZERO) { | 110 | if (organizationList.size() == FastIotConstants.MagicNumber.ZERO) { |
111 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 111 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
112 | } | 112 | } |
113 | organizationIds = | 113 | organizationIds = |
114 | organizationList.stream().map(BaseDTO::getId).distinct().collect(Collectors.toList()); | 114 | organizationList.stream().map(BaseDTO::getId).distinct().collect(Collectors.toList()); |
@@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.security.UserCredentials; | @@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.security.UserCredentials; | ||
26 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 26 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
27 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; | 27 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; |
28 | import org.thingsboard.server.common.data.yunteng.core.cache.CacheUtils; | 28 | import org.thingsboard.server.common.data.yunteng.core.cache.CacheUtils; |
29 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 29 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
30 | import org.thingsboard.server.common.data.yunteng.core.exception.NoneTenantAssetException; | 30 | import org.thingsboard.server.common.data.yunteng.core.exception.NoneTenantAssetException; |
31 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 31 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
32 | import org.thingsboard.server.common.data.yunteng.core.utils.AccountProperties; | 32 | import org.thingsboard.server.common.data.yunteng.core.utils.AccountProperties; |
@@ -36,7 +36,7 @@ import org.thingsboard.server.common.data.yunteng.enums.MessageTypeEnum; | @@ -36,7 +36,7 @@ import org.thingsboard.server.common.data.yunteng.enums.MessageTypeEnum; | ||
36 | import org.thingsboard.server.common.data.yunteng.enums.MsgTemplatePurposeEnum; | 36 | import org.thingsboard.server.common.data.yunteng.enums.MsgTemplatePurposeEnum; |
37 | import org.thingsboard.server.common.data.yunteng.enums.UserStatusEnum; | 37 | import org.thingsboard.server.common.data.yunteng.enums.UserStatusEnum; |
38 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; | 38 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; |
39 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 39 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
40 | import org.thingsboard.server.dao.user.UserService; | 40 | import org.thingsboard.server.dao.user.UserService; |
41 | import org.thingsboard.server.dao.yunteng.entities.*; | 41 | import org.thingsboard.server.dao.yunteng.entities.*; |
42 | import org.thingsboard.server.dao.yunteng.mapper.*; | 42 | import org.thingsboard.server.dao.yunteng.mapper.*; |
@@ -94,11 +94,11 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -94,11 +94,11 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
94 | UserDTO userDTO, boolean sendEmail, boolean sendMsg, boolean isTenantAdmin, String tenantId) { | 94 | UserDTO userDTO, boolean sendEmail, boolean sendMsg, boolean isTenantAdmin, String tenantId) { |
95 | boolean isTenantAdminOperate = isTenantAdmin; | 95 | boolean isTenantAdminOperate = isTenantAdmin; |
96 | if (sendMsg && StringUtils.isEmpty(userDTO.getPhoneNumber())) { | 96 | if (sendMsg && StringUtils.isEmpty(userDTO.getPhoneNumber())) { |
97 | - throw new YtDataValidationException( | 97 | + throw new TkDataValidationException( |
98 | "you must specify user phone number if you want send activate email to this user"); | 98 | "you must specify user phone number if you want send activate email to this user"); |
99 | } | 99 | } |
100 | if (sendEmail && StringUtils.isEmpty(userDTO.getEmail())) { | 100 | if (sendEmail && StringUtils.isEmpty(userDTO.getEmail())) { |
101 | - throw new YtDataValidationException( | 101 | + throw new TkDataValidationException( |
102 | "you must specify user email if you want send activate email to this user"); | 102 | "you must specify user email if you want send activate email to this user"); |
103 | } | 103 | } |
104 | SysUserEntity user = new SysUserEntity(); | 104 | SysUserEntity user = new SysUserEntity(); |
@@ -117,7 +117,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -117,7 +117,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
117 | .eq(SysUserEntity::getTenantId, tenantId)) | 117 | .eq(SysUserEntity::getTenantId, tenantId)) |
118 | > 0; | 118 | > 0; |
119 | if (userExist) { | 119 | if (userExist) { |
120 | - throw new YtDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); | 120 | + throw new TkDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); |
121 | } else { | 121 | } else { |
122 | user.setTenantId(tenantId); | 122 | user.setTenantId(tenantId); |
123 | user.setLevel( | 123 | user.setLevel( |
@@ -148,21 +148,21 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -148,21 +148,21 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
148 | new LambdaQueryWrapper<SysUserEntity>() | 148 | new LambdaQueryWrapper<SysUserEntity>() |
149 | .eq(SysUserEntity::getUsername, userDTO.getUsername())); | 149 | .eq(SysUserEntity::getUsername, userDTO.getUsername())); |
150 | if (null != existUser) { | 150 | if (null != existUser) { |
151 | - throw new YtDataValidationException(ErrorMessage.USER_NAME_ALREADY_EXISTS.getMessage()); | 151 | + throw new TkDataValidationException(ErrorMessage.USER_NAME_ALREADY_EXISTS.getMessage()); |
152 | } | 152 | } |
153 | } | 153 | } |
154 | if (StringUtils.isNotBlank(userDTO.getPhoneNumber())) { | 154 | if (StringUtils.isNotBlank(userDTO.getPhoneNumber())) { |
155 | if (!CHINA_MOBILE_PATTERN.matcher(userDTO.getPhoneNumber()).matches()) { | 155 | if (!CHINA_MOBILE_PATTERN.matcher(userDTO.getPhoneNumber()).matches()) { |
156 | - throw new YtDataValidationException(ErrorMessage.PROVIDE_CORRECT_PHONE_NUMBER.getMessage()); | 156 | + throw new TkDataValidationException(ErrorMessage.PROVIDE_CORRECT_PHONE_NUMBER.getMessage()); |
157 | } | 157 | } |
158 | } | 158 | } |
159 | if (StringUtils.isNotBlank(userDTO.getEmail())) { | 159 | if (StringUtils.isNotBlank(userDTO.getEmail())) { |
160 | if (!EMAIL_PATTERN.matcher(userDTO.getEmail()).matches()) { | 160 | if (!EMAIL_PATTERN.matcher(userDTO.getEmail()).matches()) { |
161 | - throw new YtDataValidationException(ErrorMessage.PROVIDE_CORRECT_EMAIL.getMessage()); | 161 | + throw new TkDataValidationException(ErrorMessage.PROVIDE_CORRECT_EMAIL.getMessage()); |
162 | } | 162 | } |
163 | } | 163 | } |
164 | if (StringUtils.isEmpty(userDTO.getEmail()) && StringUtils.isEmpty(userDTO.getPhoneNumber())) { | 164 | if (StringUtils.isEmpty(userDTO.getEmail()) && StringUtils.isEmpty(userDTO.getPhoneNumber())) { |
165 | - throw new YtDataValidationException(ErrorMessage.PHONE_NUMBER_OR_EMAIL_REQUIRED.getMessage()); | 165 | + throw new TkDataValidationException(ErrorMessage.PHONE_NUMBER_OR_EMAIL_REQUIRED.getMessage()); |
166 | } | 166 | } |
167 | boolean needCheck = true; | 167 | boolean needCheck = true; |
168 | if (null != userDTO.getId()) { | 168 | if (null != userDTO.getId()) { |
@@ -189,7 +189,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -189,7 +189,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
189 | }); | 189 | }); |
190 | List<SysUserEntity> existPhoneOrEmail = baseMapper.selectList(queryWrapper); | 190 | List<SysUserEntity> existPhoneOrEmail = baseMapper.selectList(queryWrapper); |
191 | if (null != existPhoneOrEmail && existPhoneOrEmail.size() > 0) { | 191 | if (null != existPhoneOrEmail && existPhoneOrEmail.size() > 0) { |
192 | - throw new YtDataValidationException(ErrorMessage.PHONE_OR_EMAIL_HAS_REGISTER.getMessage()); | 192 | + throw new TkDataValidationException(ErrorMessage.PHONE_OR_EMAIL_HAS_REGISTER.getMessage()); |
193 | } | 193 | } |
194 | } | 194 | } |
195 | } | 195 | } |
@@ -197,7 +197,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -197,7 +197,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
197 | @Override | 197 | @Override |
198 | public UserDTO findUserInfoById(String id) { | 198 | public UserDTO findUserInfoById(String id) { |
199 | if (StringUtils.isEmpty(id)) { | 199 | if (StringUtils.isEmpty(id)) { |
200 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 200 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
201 | } | 201 | } |
202 | SysUserEntity user = baseMapper.selectById(id); | 202 | SysUserEntity user = baseMapper.selectById(id); |
203 | return null != user ? user.getDTO(UserDTO.class) : null; | 203 | return null != user ? user.getDTO(UserDTO.class) : null; |
@@ -211,7 +211,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -211,7 +211,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
211 | "you don't have permission to get activation link for this user"); | 211 | "you don't have permission to get activation link for this user"); |
212 | } | 212 | } |
213 | if (StringUtils.isEmpty(user.getActivateToken())) { | 213 | if (StringUtils.isEmpty(user.getActivateToken())) { |
214 | - throw new YtDataValidationException("user already activated"); | 214 | + throw new TkDataValidationException("user already activated"); |
215 | } | 215 | } |
216 | try { | 216 | try { |
217 | List<SysAdminSettingEntity> generalSetting = | 217 | List<SysAdminSettingEntity> generalSetting = |
@@ -296,7 +296,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -296,7 +296,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
296 | throw new NoneTenantAssetException(ErrorMessage.NOT_BELONG_CURRENT_TENANT); | 296 | throw new NoneTenantAssetException(ErrorMessage.NOT_BELONG_CURRENT_TENANT); |
297 | } | 297 | } |
298 | if (!user.getUsername().equals(userDTO.getUsername())) { | 298 | if (!user.getUsername().equals(userDTO.getUsername())) { |
299 | - throw new YtDataValidationException(ErrorMessage.USERNAME_IS_IMMUTABLE.getMessage()); | 299 | + throw new TkDataValidationException(ErrorMessage.USERNAME_IS_IMMUTABLE.getMessage()); |
300 | } | 300 | } |
301 | validateUserNameAndPhoneNumberAndEmail(userDTO); | 301 | validateUserNameAndPhoneNumberAndEmail(userDTO); |
302 | user.setRealName(userDTO.getRealName()); | 302 | user.setRealName(userDTO.getRealName()); |
@@ -320,7 +320,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -320,7 +320,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
320 | } | 320 | } |
321 | 321 | ||
322 | @Override | 322 | @Override |
323 | - public YtPageData<UserDTO> page( | 323 | + public TkPageData<UserDTO> page( |
324 | Map<String, Object> queryMap, boolean isPtSysadmin, boolean isTenantAdmin) { | 324 | Map<String, Object> queryMap, boolean isPtSysadmin, boolean isTenantAdmin) { |
325 | String tenantId = (String) queryMap.get("tenantId"); | 325 | String tenantId = (String) queryMap.get("tenantId"); |
326 | IPage<UserDTO> userPage = null; | 326 | IPage<UserDTO> userPage = null; |
@@ -360,7 +360,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -360,7 +360,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
360 | } | 360 | } |
361 | 361 | ||
362 | @Override | 362 | @Override |
363 | - public YtPageData<UserDTO> tenantPage(Map<String, Object> queryMap, String tenantId) { | 363 | + public TkPageData<UserDTO> tenantPage(Map<String, Object> queryMap, String tenantId) { |
364 | IPage<SysUserEntity> userIPage = getPage(queryMap, "create_time", false); | 364 | IPage<SysUserEntity> userIPage = getPage(queryMap, "create_time", false); |
365 | IPage<UserDTO> userPage = baseMapper.getTenantAdminPage(userIPage, tenantId); | 365 | IPage<UserDTO> userPage = baseMapper.getTenantAdminPage(userIPage, tenantId); |
366 | if (null != userPage) { | 366 | if (null != userPage) { |
@@ -445,7 +445,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -445,7 +445,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
445 | .lambda() | 445 | .lambda() |
446 | .eq(SysUserEntity::getUsername, userDTO.getUsername())); | 446 | .eq(SysUserEntity::getUsername, userDTO.getUsername())); |
447 | if (!users.isEmpty()) { | 447 | if (!users.isEmpty()) { |
448 | - throw new YtDataValidationException("用户已存在"); | 448 | + throw new TkDataValidationException("用户已存在"); |
449 | } | 449 | } |
450 | baseMapper.insert(user); | 450 | baseMapper.insert(user); |
451 | List<SysTenantRoleEntity> tenantRoleList = validateTenantRole(userDTO.getTenantId()); | 451 | List<SysTenantRoleEntity> tenantRoleList = validateTenantRole(userDTO.getTenantId()); |
@@ -465,7 +465,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -465,7 +465,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
465 | .eq(SysTenantRoleEntity::getTenantId, tenantId)); | 465 | .eq(SysTenantRoleEntity::getTenantId, tenantId)); |
466 | // 保存用户与角色的映射信息 | 466 | // 保存用户与角色的映射信息 |
467 | if (null == tenantRoleList || tenantRoleList.size() == 0) { | 467 | if (null == tenantRoleList || tenantRoleList.size() == 0) { |
468 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 468 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
469 | } | 469 | } |
470 | return tenantRoleList; | 470 | return tenantRoleList; |
471 | } | 471 | } |
@@ -475,7 +475,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -475,7 +475,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
475 | public void resetPassword(String userId, String tenantId, String password) { | 475 | public void resetPassword(String userId, String tenantId, String password) { |
476 | UserDTO userDTO = findUserInfoById(userId); | 476 | UserDTO userDTO = findUserInfoById(userId); |
477 | if (null == userDTO) { | 477 | if (null == userDTO) { |
478 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 478 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
479 | } | 479 | } |
480 | userDTO.setPassword(passwordEncoder.encode(password)); | 480 | userDTO.setPassword(passwordEncoder.encode(password)); |
481 | userDTO.setActivateToken(null); | 481 | userDTO.setActivateToken(null); |
@@ -504,11 +504,11 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -504,11 +504,11 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
504 | }) | 504 | }) |
505 | .orElse(false); | 505 | .orElse(false); |
506 | if (!correct) { | 506 | if (!correct) { |
507 | - throw new YtDataValidationException(ErrorMessage.MSG_CODE_NOT_MATCHED.getMessage()); | 507 | + throw new TkDataValidationException(ErrorMessage.MSG_CODE_NOT_MATCHED.getMessage()); |
508 | } | 508 | } |
509 | String pwd = forget.getPassword(); | 509 | String pwd = forget.getPassword(); |
510 | if (StringUtils.isEmpty(pwd)) { | 510 | if (StringUtils.isEmpty(pwd)) { |
511 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 511 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
512 | } | 512 | } |
513 | 513 | ||
514 | SysUserEntity user = | 514 | SysUserEntity user = |
@@ -542,7 +542,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -542,7 +542,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
542 | // 通过用户ID查询用户信息 | 542 | // 通过用户ID查询用户信息 |
543 | SysUserEntity user = baseMapper.selectById(msg.getUserId()); | 543 | SysUserEntity user = baseMapper.selectById(msg.getUserId()); |
544 | if (null == user) { | 544 | if (null == user) { |
545 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 545 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
546 | } | 546 | } |
547 | 547 | ||
548 | // 通过模板用途和状态查询模板信息 | 548 | // 通过模板用途和状态查询模板信息 |
@@ -555,7 +555,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -555,7 +555,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
555 | List<MessageTemplateDTO> templateDTOList = | 555 | List<MessageTemplateDTO> templateDTOList = |
556 | messageTemplateService.findMessageTemplate(messageTemplateDTO); | 556 | messageTemplateService.findMessageTemplate(messageTemplateDTO); |
557 | if (null == templateDTOList || templateDTOList.size() < 1) { | 557 | if (null == templateDTOList || templateDTOList.size() < 1) { |
558 | - throw new YtDataValidationException( | 558 | + throw new TkDataValidationException( |
559 | ErrorMessage.TARGET_TEMPLATE_NOT_EXISTS_SELF_NOTICE.getMessage()); | 559 | ErrorMessage.TARGET_TEMPLATE_NOT_EXISTS_SELF_NOTICE.getMessage()); |
560 | } | 560 | } |
561 | if (messageType.equalsIgnoreCase(MessageTypeEnum.PHONE_MESSAGE.name())) { | 561 | if (messageType.equalsIgnoreCase(MessageTypeEnum.PHONE_MESSAGE.name())) { |
@@ -586,7 +586,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -586,7 +586,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
586 | public String[] getUserRoleOrOrganization(RoleOrOrganizationReqDTO roleOrGroupReqDTO) { | 586 | public String[] getUserRoleOrOrganization(RoleOrOrganizationReqDTO roleOrGroupReqDTO) { |
587 | String userId = roleOrGroupReqDTO.getUserId(); | 587 | String userId = roleOrGroupReqDTO.getUserId(); |
588 | if (StringUtils.isEmpty(userId)) { | 588 | if (StringUtils.isEmpty(userId)) { |
589 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 589 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
590 | } | 590 | } |
591 | if (roleOrGroupReqDTO.isQueryRole()) { | 591 | if (roleOrGroupReqDTO.isQueryRole()) { |
592 | List<String> roleIds = | 592 | List<String> roleIds = |
@@ -633,11 +633,11 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -633,11 +633,11 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
633 | @Override | 633 | @Override |
634 | public String findUserCustomerIdById(String id) { | 634 | public String findUserCustomerIdById(String id) { |
635 | if (StringUtils.isEmpty(id)) { | 635 | if (StringUtils.isEmpty(id)) { |
636 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 636 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
637 | } | 637 | } |
638 | String customerId = baseMapper.findUserCustomerIdById(id); | 638 | String customerId = baseMapper.findUserCustomerIdById(id); |
639 | if (null == customerId) { | 639 | if (null == customerId) { |
640 | - throw new YtDataValidationException(ErrorMessage.USER_NOT_EXISTS.getMessage()); | 640 | + throw new TkDataValidationException(ErrorMessage.USER_NOT_EXISTS.getMessage()); |
641 | } | 641 | } |
642 | return customerId; | 642 | return customerId; |
643 | } | 643 | } |
@@ -658,7 +658,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -658,7 +658,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
658 | public List<UserDTO> getMyCustomers( | 658 | public List<UserDTO> getMyCustomers( |
659 | String organizationId, String tenantId, boolean isTenantAdmin) { | 659 | String organizationId, String tenantId, boolean isTenantAdmin) { |
660 | if (StringUtils.isEmpty(organizationId)) { | 660 | if (StringUtils.isEmpty(organizationId)) { |
661 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 661 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
662 | } | 662 | } |
663 | if (isTenantAdmin) { | 663 | if (isTenantAdmin) { |
664 | List<String> userList = | 664 | List<String> userList = |
@@ -694,7 +694,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -694,7 +694,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
694 | @Override | 694 | @Override |
695 | public UserDTO accountExist(String userName) { | 695 | public UserDTO accountExist(String userName) { |
696 | if (StringUtils.isEmpty(userName)) { | 696 | if (StringUtils.isEmpty(userName)) { |
697 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 697 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
698 | } | 698 | } |
699 | UserDTO userDTO = new UserDTO(); | 699 | UserDTO userDTO = new UserDTO(); |
700 | userDTO.setUsername(userName); | 700 | userDTO.setUsername(userName); |
@@ -710,7 +710,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -710,7 +710,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
710 | @Override | 710 | @Override |
711 | public UserDTO findUserByPhoneNumber(String phoneNumber) { | 711 | public UserDTO findUserByPhoneNumber(String phoneNumber) { |
712 | if (StringUtils.isEmpty(phoneNumber)) { | 712 | if (StringUtils.isEmpty(phoneNumber)) { |
713 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 713 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
714 | } | 714 | } |
715 | UserDTO userDTO = new UserDTO(); | 715 | UserDTO userDTO = new UserDTO(); |
716 | userDTO.setPhoneNumber(phoneNumber); | 716 | userDTO.setPhoneNumber(phoneNumber); |
@@ -729,12 +729,12 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -729,12 +729,12 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
729 | if (null == user | 729 | if (null == user |
730 | || StringUtils.isEmpty(accountReqDTO.getPassword()) | 730 | || StringUtils.isEmpty(accountReqDTO.getPassword()) |
731 | || StringUtils.isEmpty(accountReqDTO.getResetPassword())) { | 731 | || StringUtils.isEmpty(accountReqDTO.getResetPassword())) { |
732 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 732 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
733 | } | 733 | } |
734 | // 判断用户密码是否正确 | 734 | // 判断用户密码是否正确 |
735 | boolean isMatch = passwordEncoder.matches(accountReqDTO.getPassword(), user.getPassword()); | 735 | boolean isMatch = passwordEncoder.matches(accountReqDTO.getPassword(), user.getPassword()); |
736 | if (!isMatch) { | 736 | if (!isMatch) { |
737 | - throw new YtDataValidationException(ErrorMessage.PASSWORD_INCORRECT.getMessage()); | 737 | + throw new TkDataValidationException(ErrorMessage.PASSWORD_INCORRECT.getMessage()); |
738 | } | 738 | } |
739 | user.setPassword(accountReqDTO.getResetPassword()); | 739 | user.setPassword(accountReqDTO.getResetPassword()); |
740 | } | 740 | } |
@@ -747,7 +747,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -747,7 +747,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
747 | */ | 747 | */ |
748 | private void deleteAndAddUserRole(String userId, List<String> roleIds) { | 748 | private void deleteAndAddUserRole(String userId, List<String> roleIds) { |
749 | if (StringUtils.isEmpty(userId) || null == roleIds || roleIds.size() < 1) { | 749 | if (StringUtils.isEmpty(userId) || null == roleIds || roleIds.size() < 1) { |
750 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 750 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
751 | } | 751 | } |
752 | // 先删除用户与角色的关系,再添加用户与角色的关系 | 752 | // 先删除用户与角色的关系,再添加用户与角色的关系 |
753 | List<String> userIds = new ArrayList<>(); | 753 | List<String> userIds = new ArrayList<>(); |
@@ -10,7 +10,7 @@ import org.springframework.beans.BeanUtils; | @@ -10,7 +10,7 @@ import org.springframework.beans.BeanUtils; | ||
10 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
11 | import org.springframework.transaction.annotation.Transactional; | 11 | import org.springframework.transaction.annotation.Transactional; |
12 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 12 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
13 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 13 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
14 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 14 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
15 | import org.thingsboard.server.common.data.yunteng.dto.*; | 15 | import org.thingsboard.server.common.data.yunteng.dto.*; |
16 | import org.thingsboard.server.common.data.yunteng.enums.DataTypeEnum; | 16 | import org.thingsboard.server.common.data.yunteng.enums.DataTypeEnum; |
@@ -18,7 +18,7 @@ import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; | @@ -18,7 +18,7 @@ import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; | ||
18 | import org.thingsboard.server.common.data.yunteng.enums.FunctionTypeEnum; | 18 | import org.thingsboard.server.common.data.yunteng.enums.FunctionTypeEnum; |
19 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; | 19 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; |
20 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; | 20 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; |
21 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 21 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
22 | import org.thingsboard.server.dao.yunteng.entities.TkThingsModelEntity; | 22 | import org.thingsboard.server.dao.yunteng.entities.TkThingsModelEntity; |
23 | import org.thingsboard.server.dao.yunteng.mapper.ThingsModelMapper; | 23 | import org.thingsboard.server.dao.yunteng.mapper.ThingsModelMapper; |
24 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; | 24 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
@@ -36,7 +36,7 @@ public class ThingsModelServiceImpl | @@ -36,7 +36,7 @@ public class ThingsModelServiceImpl | ||
36 | private final TkDeviceProfileService ytDeviceProfileService; | 36 | private final TkDeviceProfileService ytDeviceProfileService; |
37 | 37 | ||
38 | @Override | 38 | @Override |
39 | - public YtPageData<ThingsModelDTO> page( | 39 | + public TkPageData<ThingsModelDTO> page( |
40 | Map<String, Object> queryMap, String tenantId, String deviceProfileId) { | 40 | Map<String, Object> queryMap, String tenantId, String deviceProfileId) { |
41 | String nameOrIdentifier = | 41 | String nameOrIdentifier = |
42 | null != queryMap.get("nameOrIdentifier") ? (String) queryMap.get("nameOrIdentifier") : null; | 42 | null != queryMap.get("nameOrIdentifier") ? (String) queryMap.get("nameOrIdentifier") : null; |
@@ -71,7 +71,7 @@ public class ThingsModelServiceImpl | @@ -71,7 +71,7 @@ public class ThingsModelServiceImpl | ||
71 | thingsModelDTO.getIdentifier(), | 71 | thingsModelDTO.getIdentifier(), |
72 | isAdd, | 72 | isAdd, |
73 | thingsModelId)) { | 73 | thingsModelId)) { |
74 | - throw new YtDataValidationException(ErrorMessage.DUPLICATE_IDENTIFIERS_EXIST.getMessage()); | 74 | + throw new TkDataValidationException(ErrorMessage.DUPLICATE_IDENTIFIERS_EXIST.getMessage()); |
75 | } | 75 | } |
76 | TkThingsModelEntity entity = thingsModelDTO.getEntity(TkThingsModelEntity.class); | 76 | TkThingsModelEntity entity = thingsModelDTO.getEntity(TkThingsModelEntity.class); |
77 | if (isAdd) { | 77 | if (isAdd) { |
@@ -85,7 +85,7 @@ public class ThingsModelServiceImpl | @@ -85,7 +85,7 @@ public class ThingsModelServiceImpl | ||
85 | .eq(TkThingsModelEntity::getTenantId, thingsModelDTO.getTenantId()) | 85 | .eq(TkThingsModelEntity::getTenantId, thingsModelDTO.getTenantId()) |
86 | .eq(TkThingsModelEntity::getId, thingsModelDTO.getId())); | 86 | .eq(TkThingsModelEntity::getId, thingsModelDTO.getId())); |
87 | if (null == result) { | 87 | if (null == result) { |
88 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 88 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
89 | } | 89 | } |
90 | baseMapper.updateById(entity); | 90 | baseMapper.updateById(entity); |
91 | } | 91 | } |
@@ -111,7 +111,7 @@ public class ThingsModelServiceImpl | @@ -111,7 +111,7 @@ public class ThingsModelServiceImpl | ||
111 | .eq(TkThingsModelEntity::getTenantId, dto.getTenantId()) | 111 | .eq(TkThingsModelEntity::getTenantId, dto.getTenantId()) |
112 | .in(TkThingsModelEntity::getId, dto.getIds())); | 112 | .in(TkThingsModelEntity::getId, dto.getIds())); |
113 | if (result > FastIotConstants.MagicNumber.ZERO && result != dto.getIds().size()) { | 113 | if (result > FastIotConstants.MagicNumber.ZERO && result != dto.getIds().size()) { |
114 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 114 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
115 | } | 115 | } |
116 | return result > FastIotConstants.MagicNumber.ZERO; | 116 | return result > FastIotConstants.MagicNumber.ZERO; |
117 | } | 117 | } |
@@ -125,7 +125,7 @@ public class ThingsModelServiceImpl | @@ -125,7 +125,7 @@ public class ThingsModelServiceImpl | ||
125 | .eq(TkThingsModelEntity::getTenantId, tenantId) | 125 | .eq(TkThingsModelEntity::getTenantId, tenantId) |
126 | .eq(TkThingsModelEntity::getDeviceProfileId, deviceProfileId)); | 126 | .eq(TkThingsModelEntity::getDeviceProfileId, deviceProfileId)); |
127 | if (result == FastIotConstants.MagicNumber.ZERO) { | 127 | if (result == FastIotConstants.MagicNumber.ZERO) { |
128 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 128 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
129 | } | 129 | } |
130 | return true; | 130 | return true; |
131 | } | 131 | } |
@@ -155,7 +155,7 @@ public class ThingsModelServiceImpl | @@ -155,7 +155,7 @@ public class ThingsModelServiceImpl | ||
155 | DeviceProfileDTO deviceProfileDTO = | 155 | DeviceProfileDTO deviceProfileDTO = |
156 | ytDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); | 156 | ytDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); |
157 | if (null == deviceProfileDTO) { | 157 | if (null == deviceProfileDTO) { |
158 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 158 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
159 | } | 159 | } |
160 | List<ThingsModelDTO> thingsModelDTOS = | 160 | List<ThingsModelDTO> thingsModelDTOS = |
161 | selectByDeviceProfileId(typeEnum, tenantId, deviceProfileId); | 161 | selectByDeviceProfileId(typeEnum, tenantId, deviceProfileId); |
@@ -8,13 +8,13 @@ import org.apache.commons.lang3.StringUtils; | @@ -8,13 +8,13 @@ import org.apache.commons.lang3.StringUtils; | ||
8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
9 | import org.springframework.transaction.annotation.Transactional; | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
11 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 11 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | import org.thingsboard.server.common.data.yunteng.dto.AlarmContactDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.AlarmContactDTO; |
14 | import org.thingsboard.server.common.data.yunteng.dto.BaseDTO; | 14 | import org.thingsboard.server.common.data.yunteng.dto.BaseDTO; |
15 | import org.thingsboard.server.common.data.yunteng.dto.OrganizationDTO; | 15 | import org.thingsboard.server.common.data.yunteng.dto.OrganizationDTO; |
16 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; | 16 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; |
17 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 17 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
18 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmContactEntity; | 18 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmContactEntity; |
19 | import org.thingsboard.server.dao.yunteng.mapper.AlarmContactMapper; | 19 | import org.thingsboard.server.dao.yunteng.mapper.AlarmContactMapper; |
20 | import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper; | 20 | import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper; |
@@ -73,7 +73,7 @@ public class TkAlarmContactServiceImpl extends AbstractBaseService<AlarmContactM | @@ -73,7 +73,7 @@ public class TkAlarmContactServiceImpl extends AbstractBaseService<AlarmContactM | ||
73 | List<OrganizationDTO> organizationDTOS = | 73 | List<OrganizationDTO> organizationDTOS = |
74 | ytOrganizationMapper.findOrganizationTreeList(tenantId, ids); | 74 | ytOrganizationMapper.findOrganizationTreeList(tenantId, ids); |
75 | if (null == organizationDTOS || organizationDTOS.size() == 0) { | 75 | if (null == organizationDTOS || organizationDTOS.size() == 0) { |
76 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 76 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
77 | } | 77 | } |
78 | List<String> organizationIds = | 78 | List<String> organizationIds = |
79 | organizationDTOS.stream().map(BaseDTO::getId).collect(Collectors.toList()); | 79 | organizationDTOS.stream().map(BaseDTO::getId).collect(Collectors.toList()); |
@@ -108,12 +108,12 @@ public class TkAlarmContactServiceImpl extends AbstractBaseService<AlarmContactM | @@ -108,12 +108,12 @@ public class TkAlarmContactServiceImpl extends AbstractBaseService<AlarmContactM | ||
108 | tenantWapper(tenantId).eq(TkAlarmContactEntity::getUsername, alarmContactDTO.getUsername()); | 108 | tenantWapper(tenantId).eq(TkAlarmContactEntity::getUsername, alarmContactDTO.getUsername()); |
109 | int Count = baseMapper.selectCount(Wrapper); | 109 | int Count = baseMapper.selectCount(Wrapper); |
110 | if (Count > 0) { | 110 | if (Count > 0) { |
111 | - throw new YtDataValidationException( | 111 | + throw new TkDataValidationException( |
112 | String.format(ErrorMessage.NAME_EXISTED.getMessage(), alarmContactDTO.getUsername())); | 112 | String.format(ErrorMessage.NAME_EXISTED.getMessage(), alarmContactDTO.getUsername())); |
113 | } | 113 | } |
114 | if (checkPhoneEmail(tenantId, alarmContactDTO.getPhone(), alarmContactDTO.getEmail()).size() | 114 | if (checkPhoneEmail(tenantId, alarmContactDTO.getPhone(), alarmContactDTO.getEmail()).size() |
115 | > 0) { | 115 | > 0) { |
116 | - throw new YtDataValidationException(ErrorMessage.PHONE_OR_EMAIL_HAS_REGISTER.getMessage()); | 116 | + throw new TkDataValidationException(ErrorMessage.PHONE_OR_EMAIL_HAS_REGISTER.getMessage()); |
117 | } | 117 | } |
118 | alarmContactDTO.setTenantId(tenantId); | 118 | alarmContactDTO.setTenantId(tenantId); |
119 | TkAlarmContactEntity alarmContact = alarmContactDTO.getEntity(TkAlarmContactEntity.class); | 119 | TkAlarmContactEntity alarmContact = alarmContactDTO.getEntity(TkAlarmContactEntity.class); |
@@ -152,13 +152,13 @@ public class TkAlarmContactServiceImpl extends AbstractBaseService<AlarmContactM | @@ -152,13 +152,13 @@ public class TkAlarmContactServiceImpl extends AbstractBaseService<AlarmContactM | ||
152 | // 得到对象 | 152 | // 得到对象 |
153 | TkAlarmContactEntity alarmContact = baseMapper.selectById(alarmContactDTO.getId()); | 153 | TkAlarmContactEntity alarmContact = baseMapper.selectById(alarmContactDTO.getId()); |
154 | if (alarmContact == null) { | 154 | if (alarmContact == null) { |
155 | - throw new YtDataValidationException("此数据不存在"); | 155 | + throw new TkDataValidationException("此数据不存在"); |
156 | } | 156 | } |
157 | if (checkPhoneEmail( | 157 | if (checkPhoneEmail( |
158 | alarmContact.getTenantId(), alarmContactDTO.getPhone(), alarmContactDTO.getEmail()) | 158 | alarmContact.getTenantId(), alarmContactDTO.getPhone(), alarmContactDTO.getEmail()) |
159 | .size() | 159 | .size() |
160 | > 1) { | 160 | > 1) { |
161 | - throw new YtDataValidationException(ErrorMessage.PHONE_OR_EMAIL_HAS_REGISTER.getMessage()); | 161 | + throw new TkDataValidationException(ErrorMessage.PHONE_OR_EMAIL_HAS_REGISTER.getMessage()); |
162 | } | 162 | } |
163 | TkAlarmContactEntity entity = alarmContactDTO.getEntity(TkAlarmContactEntity.class); | 163 | TkAlarmContactEntity entity = alarmContactDTO.getEntity(TkAlarmContactEntity.class); |
164 | System.out.println(alarmContact); | 164 | System.out.println(alarmContact); |
@@ -188,7 +188,7 @@ public class TkAlarmContactServiceImpl extends AbstractBaseService<AlarmContactM | @@ -188,7 +188,7 @@ public class TkAlarmContactServiceImpl extends AbstractBaseService<AlarmContactM | ||
188 | * @return PageData | 188 | * @return PageData |
189 | */ | 189 | */ |
190 | @Override | 190 | @Override |
191 | - public YtPageData<AlarmContactDTO> page( | 191 | + public TkPageData<AlarmContactDTO> page( |
192 | String tenantId, | 192 | String tenantId, |
193 | boolean isPtTenantAdmin, | 193 | boolean isPtTenantAdmin, |
194 | String currentUserId, | 194 | String currentUserId, |
@@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; | @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; | ||
16 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; | 16 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
17 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | 17 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
18 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; | 18 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; |
19 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 19 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
20 | import org.thingsboard.server.dao.model.ModelConstants; | 20 | import org.thingsboard.server.dao.model.ModelConstants; |
21 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmEntity; | 21 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmEntity; |
22 | import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper; | 22 | import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper; |
@@ -42,7 +42,7 @@ public class TkAlarmInfoServiceImpl implements TkAlarmInfoService { | @@ -42,7 +42,7 @@ public class TkAlarmInfoServiceImpl implements TkAlarmInfoService { | ||
42 | private final OrganizationMapper organizationMapper; | 42 | private final OrganizationMapper organizationMapper; |
43 | 43 | ||
44 | @Override | 44 | @Override |
45 | - public YtPageData<TkAlarmEntity> alarmPage(Map<String, Object> pageMap, TenantId tenantId, UUID customerId, AlarmSeverity severity, String alarmType, Long startTime, Long endTime, List<AlarmStatus> status, String deviceId, DeviceTypeEnum deviceType, EntityType originatorType, String organizationId) { | 45 | + public TkPageData<TkAlarmEntity> alarmPage(Map<String, Object> pageMap, TenantId tenantId, UUID customerId, AlarmSeverity severity, String alarmType, Long startTime, Long endTime, List<AlarmStatus> status, String deviceId, DeviceTypeEnum deviceType, EntityType originatorType, String organizationId) { |
46 | StringBuilder defaultOrderFields = new StringBuilder("ack_ts asc,clear_ts asc,"); | 46 | StringBuilder defaultOrderFields = new StringBuilder("ack_ts asc,clear_ts asc,"); |
47 | defaultOrderFields.append(ModelConstants.CREATED_TIME_PROPERTY); | 47 | defaultOrderFields.append(ModelConstants.CREATED_TIME_PROPERTY); |
48 | IPage<TkAlarmEntity> page = getPage(pageMap, defaultOrderFields.toString(), OrderTypeEnum.DESC); | 48 | IPage<TkAlarmEntity> page = getPage(pageMap, defaultOrderFields.toString(), OrderTypeEnum.DESC); |
@@ -58,7 +58,7 @@ public class TkAlarmInfoServiceImpl implements TkAlarmInfoService { | @@ -58,7 +58,7 @@ public class TkAlarmInfoServiceImpl implements TkAlarmInfoService { | ||
58 | } | 58 | } |
59 | 59 | ||
60 | IPage<TkAlarmEntity> tbDatas = ytJpaAarmDao.alarmPage(page, tenantId.getId(), customerId, severity, alarmType, startTime, endTime, status, deviceId, deviceType, originatorType, ids.size() > 0 ? ids : null); | 60 | IPage<TkAlarmEntity> tbDatas = ytJpaAarmDao.alarmPage(page, tenantId.getId(), customerId, severity, alarmType, startTime, endTime, status, deviceId, deviceType, originatorType, ids.size() > 0 ? ids : null); |
61 | - YtPageData<TkAlarmEntity> result = new YtPageData<>(tbDatas.getRecords(), tbDatas.getTotal()); | 61 | + TkPageData<TkAlarmEntity> result = new TkPageData<>(tbDatas.getRecords(), tbDatas.getTotal()); |
62 | return result; | 62 | return result; |
63 | } | 63 | } |
64 | 64 |
@@ -10,11 +10,11 @@ import org.springframework.transaction.annotation.Transactional; | @@ -10,11 +10,11 @@ import org.springframework.transaction.annotation.Transactional; | ||
10 | import org.thingsboard.server.common.data.StringUtils; | 10 | import org.thingsboard.server.common.data.StringUtils; |
11 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 11 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
12 | import org.thingsboard.server.common.data.yunteng.core.exception.NoneTenantAssetException; | 12 | import org.thingsboard.server.common.data.yunteng.core.exception.NoneTenantAssetException; |
13 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 13 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
14 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 14 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
15 | import org.thingsboard.server.common.data.yunteng.dto.*; | 15 | import org.thingsboard.server.common.data.yunteng.dto.*; |
16 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; | 16 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; |
17 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 17 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
18 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmProfileEntity; | 18 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmProfileEntity; |
19 | import org.thingsboard.server.dao.yunteng.entities.TkSceneLinkageEntity; | 19 | import org.thingsboard.server.dao.yunteng.entities.TkSceneLinkageEntity; |
20 | import org.thingsboard.server.dao.yunteng.mapper.AlarmProfileMapper; | 20 | import org.thingsboard.server.dao.yunteng.mapper.AlarmProfileMapper; |
@@ -41,7 +41,7 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM | @@ -41,7 +41,7 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM | ||
41 | private final SceneLinkageMapper sceneLinkageMapper; | 41 | private final SceneLinkageMapper sceneLinkageMapper; |
42 | 42 | ||
43 | @Override | 43 | @Override |
44 | - public YtPageData<AlarmProfileDTO> page( | 44 | + public TkPageData<AlarmProfileDTO> page( |
45 | boolean isPtTenantAdmin, | 45 | boolean isPtTenantAdmin, |
46 | String tenantId, | 46 | String tenantId, |
47 | String currentUserId, | 47 | String currentUserId, |
@@ -73,14 +73,14 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM | @@ -73,14 +73,14 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM | ||
73 | if (StringUtils.isNotEmpty(alarmProfileDTO.getId())) { | 73 | if (StringUtils.isNotEmpty(alarmProfileDTO.getId())) { |
74 | TkAlarmProfileEntity alarmProfile = baseMapper.selectById(alarmProfileDTO.getId()); | 74 | TkAlarmProfileEntity alarmProfile = baseMapper.selectById(alarmProfileDTO.getId()); |
75 | if (null == alarmProfile) { | 75 | if (null == alarmProfile) { |
76 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | 76 | + throw new TkDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); |
77 | } | 77 | } |
78 | if (!alarmProfile.getOrganizationId().equals(alarmProfileDTO.getOrganizationId())) { | 78 | if (!alarmProfile.getOrganizationId().equals(alarmProfileDTO.getOrganizationId())) { |
79 | Set<String> profiles = new HashSet<>(); | 79 | Set<String> profiles = new HashSet<>(); |
80 | profiles.add(alarmProfileDTO.getId()); | 80 | profiles.add(alarmProfileDTO.getId()); |
81 | Set<String>names = alarmProfileUsed(alarmProfileDTO.getTenantId(), profiles); | 81 | Set<String>names = alarmProfileUsed(alarmProfileDTO.getTenantId(), profiles); |
82 | if(!names.isEmpty()){ | 82 | if(!names.isEmpty()){ |
83 | - throw new YtDataValidationException(String.format(ErrorMessage.SCENE_REACT_USED_ALARM_PROFILE.getMessage(), names)); | 83 | + throw new TkDataValidationException(String.format(ErrorMessage.SCENE_REACT_USED_ALARM_PROFILE.getMessage(), names)); |
84 | } | 84 | } |
85 | } | 85 | } |
86 | baseMapper.updateById(alarmProfileDTO.getEntity(TkAlarmProfileEntity.class)); | 86 | baseMapper.updateById(alarmProfileDTO.getEntity(TkAlarmProfileEntity.class)); |
@@ -96,7 +96,7 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM | @@ -96,7 +96,7 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM | ||
96 | String alarmProfileId, String tenantId, Integer status) { | 96 | String alarmProfileId, String tenantId, Integer status) { |
97 | TkAlarmProfileEntity alarmProfile = baseMapper.selectById(alarmProfileId); | 97 | TkAlarmProfileEntity alarmProfile = baseMapper.selectById(alarmProfileId); |
98 | if (null == alarmProfile) { | 98 | if (null == alarmProfile) { |
99 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | 99 | + throw new TkDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); |
100 | } | 100 | } |
101 | if (!alarmProfile.getTenantId().equals(tenantId)) { | 101 | if (!alarmProfile.getTenantId().equals(tenantId)) { |
102 | throw new NoneTenantAssetException(ErrorMessage.NOT_BELONG_CURRENT_TENANT); | 102 | throw new NoneTenantAssetException(ErrorMessage.NOT_BELONG_CURRENT_TENANT); |
@@ -111,7 +111,7 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM | @@ -111,7 +111,7 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM | ||
111 | public boolean deleteAlarmProFile(DeleteDTO deleteDTO) { | 111 | public boolean deleteAlarmProFile(DeleteDTO deleteDTO) { |
112 | Set<String>names = alarmProfileUsed(deleteDTO.getTenantId(), deleteDTO.getIds()); | 112 | Set<String>names = alarmProfileUsed(deleteDTO.getTenantId(), deleteDTO.getIds()); |
113 | if(!names.isEmpty()){ | 113 | if(!names.isEmpty()){ |
114 | - throw new YtDataValidationException(String.format(ErrorMessage.SCENE_REACT_USED_ALARM_PROFILE.getMessage(), names)); | 114 | + throw new TkDataValidationException(String.format(ErrorMessage.SCENE_REACT_USED_ALARM_PROFILE.getMessage(), names)); |
115 | } | 115 | } |
116 | return baseMapper.deleteBatchIds(deleteDTO.getIds()) > 0; | 116 | return baseMapper.deleteBatchIds(deleteDTO.getIds()) > 0; |
117 | } | 117 | } |
@@ -144,7 +144,7 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM | @@ -144,7 +144,7 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM | ||
144 | ytOrganizationMapper.findOrganizationTreeList( | 144 | ytOrganizationMapper.findOrganizationTreeList( |
145 | tenantId, new HashSet<>(List.of(organizationId))); | 145 | tenantId, new HashSet<>(List.of(organizationId))); |
146 | if (organizationList.size() == FastIotConstants.MagicNumber.ZERO) { | 146 | if (organizationList.size() == FastIotConstants.MagicNumber.ZERO) { |
147 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 147 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
148 | } | 148 | } |
149 | Set<String> organizationIds = | 149 | Set<String> organizationIds = |
150 | organizationList.stream().map(BaseDTO::getId).collect(Collectors.toSet()); | 150 | organizationList.stream().map(BaseDTO::getId).collect(Collectors.toSet()); |
@@ -8,11 +8,11 @@ import org.apache.commons.lang3.StringUtils; | @@ -8,11 +8,11 @@ import org.apache.commons.lang3.StringUtils; | ||
8 | import org.springframework.security.access.AccessDeniedException; | 8 | import org.springframework.security.access.AccessDeniedException; |
9 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
10 | import org.springframework.transaction.annotation.Transactional; | 10 | import org.springframework.transaction.annotation.Transactional; |
11 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 11 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | import org.thingsboard.server.common.data.yunteng.dto.AlarmContactDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.AlarmContactDTO; |
14 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; | 14 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; |
15 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 15 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
16 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmContactEntity; | 16 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmContactEntity; |
17 | import org.thingsboard.server.dao.yunteng.mapper.AlarmContactMapper; | 17 | import org.thingsboard.server.dao.yunteng.mapper.AlarmContactMapper; |
18 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; | 18 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
@@ -71,7 +71,7 @@ public class TkAlarmServiceImpl extends AbstractBaseService<AlarmContactMapper, | @@ -71,7 +71,7 @@ public class TkAlarmServiceImpl extends AbstractBaseService<AlarmContactMapper, | ||
71 | .eq( TkAlarmContactEntity::getUsername, alarmContactDTO.getUsername()); | 71 | .eq( TkAlarmContactEntity::getUsername, alarmContactDTO.getUsername()); |
72 | int Count = baseMapper.selectCount(Wrapper); | 72 | int Count = baseMapper.selectCount(Wrapper); |
73 | if (Count > 0) { | 73 | if (Count > 0) { |
74 | - throw new YtDataValidationException("department for this name is exited"); | 74 | + throw new TkDataValidationException("department for this name is exited"); |
75 | } | 75 | } |
76 | alarmContactDTO.setTenantId(tenantId); | 76 | alarmContactDTO.setTenantId(tenantId); |
77 | TkAlarmContactEntity alarmContact = alarmContactDTO.getEntity(TkAlarmContactEntity.class); | 77 | TkAlarmContactEntity alarmContact = alarmContactDTO.getEntity(TkAlarmContactEntity.class); |
@@ -112,7 +112,7 @@ public class TkAlarmServiceImpl extends AbstractBaseService<AlarmContactMapper, | @@ -112,7 +112,7 @@ public class TkAlarmServiceImpl extends AbstractBaseService<AlarmContactMapper, | ||
112 | TkAlarmContactEntity alarmContact = alarmContactMapper.selectById(alarmContactDTO.getId()); | 112 | TkAlarmContactEntity alarmContact = alarmContactMapper.selectById(alarmContactDTO.getId()); |
113 | if (alarmContact == null) { | 113 | if (alarmContact == null) { |
114 | //为空则抛出无效参数的异常 | 114 | //为空则抛出无效参数的异常 |
115 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 115 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
116 | } else { | 116 | } else { |
117 | if (!istenantAdmin) { | 117 | if (!istenantAdmin) { |
118 | if (!tenantId.equals(alarmContactDTO.getTenantId())) { | 118 | if (!tenantId.equals(alarmContactDTO.getTenantId())) { |
@@ -133,7 +133,7 @@ public class TkAlarmServiceImpl extends AbstractBaseService<AlarmContactMapper, | @@ -133,7 +133,7 @@ public class TkAlarmServiceImpl extends AbstractBaseService<AlarmContactMapper, | ||
133 | */ | 133 | */ |
134 | @Override | 134 | @Override |
135 | @Transactional | 135 | @Transactional |
136 | - public YtPageData<AlarmContactDTO> page(Map<String, Object> queryMap) { | 136 | + public TkPageData<AlarmContactDTO> page(Map<String, Object> queryMap) { |
137 | //查询分页,加入条模糊条件查询 | 137 | //查询分页,加入条模糊条件查询 |
138 | IPage<TkAlarmContactEntity> iPage = alarmContactMapper.selectPage(getPage(queryMap, "create_time", false), | 138 | IPage<TkAlarmContactEntity> iPage = alarmContactMapper.selectPage(getPage(queryMap, "create_time", false), |
139 | new QueryWrapper<TkAlarmContactEntity>().lambda(). | 139 | new QueryWrapper<TkAlarmContactEntity>().lambda(). |
@@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils; | @@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils; | ||
8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
9 | import org.springframework.transaction.annotation.Transactional; | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
11 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 11 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | import org.thingsboard.server.common.data.yunteng.dto.ConfigurationActDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.ConfigurationActDTO; |
14 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationActEntity; | 14 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationActEntity; |
@@ -42,7 +42,7 @@ public class TkConfigurationActServiceImpl | @@ -42,7 +42,7 @@ public class TkConfigurationActServiceImpl | ||
42 | newData.setEnabled(false); | 42 | newData.setEnabled(false); |
43 | baseMapper.insert(newData); | 43 | baseMapper.insert(newData); |
44 | } else if(!actDTO.getTenantId().equals(old.getTenantId())){ | 44 | } else if(!actDTO.getTenantId().equals(old.getTenantId())){ |
45 | - throw new YtDataValidationException(ErrorMessage.HAVE_NO_PERMISSION.getMessage()); | 45 | + throw new TkDataValidationException(ErrorMessage.HAVE_NO_PERMISSION.getMessage()); |
46 | } else { | 46 | } else { |
47 | baseMapper.update(newData, filter); | 47 | baseMapper.update(newData, filter); |
48 | } | 48 | } |
@@ -65,7 +65,7 @@ public class TkConfigurationActServiceImpl | @@ -65,7 +65,7 @@ public class TkConfigurationActServiceImpl | ||
65 | public List<ConfigurationActDTO> listConfigurationAct(String tenantId,String levelType,String levelId) { | 65 | public List<ConfigurationActDTO> listConfigurationAct(String tenantId,String levelType,String levelId) { |
66 | if(!FastIotConstants.ConfigureLevel.CONTENT.equals(levelType) | 66 | if(!FastIotConstants.ConfigureLevel.CONTENT.equals(levelType) |
67 | && !FastIotConstants.ConfigureLevel.NODE.equals(levelType)){ | 67 | && !FastIotConstants.ConfigureLevel.NODE.equals(levelType)){ |
68 | - throw new YtDataValidationException("please provide correct levelType!"); | 68 | + throw new TkDataValidationException("please provide correct levelType!"); |
69 | } | 69 | } |
70 | LambdaQueryWrapper<TkConfigurationActEntity> filter = new QueryWrapper<TkConfigurationActEntity>().lambda() | 70 | LambdaQueryWrapper<TkConfigurationActEntity> filter = new QueryWrapper<TkConfigurationActEntity>().lambda() |
71 | .eq(TkConfigurationActEntity::getTenantId,tenantId) | 71 | .eq(TkConfigurationActEntity::getTenantId,tenantId) |
@@ -7,11 +7,11 @@ import lombok.extern.slf4j.Slf4j; | @@ -7,11 +7,11 @@ import lombok.extern.slf4j.Slf4j; | ||
7 | import org.springframework.stereotype.Service; | 7 | import org.springframework.stereotype.Service; |
8 | import org.springframework.transaction.annotation.Transactional; | 8 | import org.springframework.transaction.annotation.Transactional; |
9 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 9 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
10 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 10 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
12 | import org.thingsboard.server.common.data.yunteng.dto.*; | 12 | import org.thingsboard.server.common.data.yunteng.dto.*; |
13 | import org.thingsboard.server.common.data.yunteng.dto.request.ConfigurationContentInfoDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.request.ConfigurationContentInfoDTO; |
14 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 14 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
15 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationCenterEntity; | 15 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationCenterEntity; |
16 | import org.thingsboard.server.dao.yunteng.mapper.ConfigurationCenterMapper; | 16 | import org.thingsboard.server.dao.yunteng.mapper.ConfigurationCenterMapper; |
17 | import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper; | 17 | import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper; |
@@ -35,7 +35,7 @@ public class TkConfigurationCenterServiceImpl | @@ -35,7 +35,7 @@ public class TkConfigurationCenterServiceImpl | ||
35 | private final UserOrganizationMappingService userOrganizationMappingService; | 35 | private final UserOrganizationMappingService userOrganizationMappingService; |
36 | 36 | ||
37 | @Override | 37 | @Override |
38 | - public YtPageData<ConfigurationCenterDTO> page( | 38 | + public TkPageData<ConfigurationCenterDTO> page( |
39 | Map<String, Object> queryMap, boolean tenantAdmin) { | 39 | Map<String, Object> queryMap, boolean tenantAdmin) { |
40 | List<String> organizationIds = null; | 40 | List<String> organizationIds = null; |
41 | if (null != queryMap.get("organizationId")) { | 41 | if (null != queryMap.get("organizationId")) { |
@@ -44,7 +44,7 @@ public class TkConfigurationCenterServiceImpl | @@ -44,7 +44,7 @@ public class TkConfigurationCenterServiceImpl | ||
44 | organizationMapper.findOrganizationTreeList( | 44 | organizationMapper.findOrganizationTreeList( |
45 | (String) queryMap.get("tenantId"), new HashSet<>(List.of(organizationId))); | 45 | (String) queryMap.get("tenantId"), new HashSet<>(List.of(organizationId))); |
46 | if (organizationList.size() == FastIotConstants.MagicNumber.ZERO) { | 46 | if (organizationList.size() == FastIotConstants.MagicNumber.ZERO) { |
47 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 47 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
48 | } | 48 | } |
49 | organizationIds = | 49 | organizationIds = |
50 | organizationList.stream().map(BaseDTO::getId).distinct().collect(Collectors.toList()); | 50 | organizationList.stream().map(BaseDTO::getId).distinct().collect(Collectors.toList()); |
@@ -86,7 +86,7 @@ public class TkConfigurationCenterServiceImpl | @@ -86,7 +86,7 @@ public class TkConfigurationCenterServiceImpl | ||
86 | public ConfigurationCenterDTO updateConfiguration(ConfigurationCenterDTO configurationCenterDTO) { | 86 | public ConfigurationCenterDTO updateConfiguration(ConfigurationCenterDTO configurationCenterDTO) { |
87 | TkConfigurationCenterEntity configurationCenter = baseMapper.selectById(configurationCenterDTO.getId()); | 87 | TkConfigurationCenterEntity configurationCenter = baseMapper.selectById(configurationCenterDTO.getId()); |
88 | if (!configurationCenter.getTenantId().equals(configurationCenterDTO.getTenantId())) { | 88 | if (!configurationCenter.getTenantId().equals(configurationCenterDTO.getTenantId())) { |
89 | - throw new YtDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); | 89 | + throw new TkDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); |
90 | } | 90 | } |
91 | baseMapper.updateById(configurationCenterDTO.getEntity(TkConfigurationCenterEntity.class)); | 91 | baseMapper.updateById(configurationCenterDTO.getEntity(TkConfigurationCenterEntity.class)); |
92 | return configurationCenterDTO; | 92 | return configurationCenterDTO; |
@@ -101,7 +101,7 @@ public class TkConfigurationCenterServiceImpl | @@ -101,7 +101,7 @@ public class TkConfigurationCenterServiceImpl | ||
101 | .in(TkConfigurationCenterEntity::getId, deleteDTO.getIds())); | 101 | .in(TkConfigurationCenterEntity::getId, deleteDTO.getIds())); |
102 | for (TkConfigurationCenterEntity center : centerList) { | 102 | for (TkConfigurationCenterEntity center : centerList) { |
103 | if (!center.getTenantId().equals(deleteDTO.getTenantId())) { | 103 | if (!center.getTenantId().equals(deleteDTO.getTenantId())) { |
104 | - throw new YtDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); | 104 | + throw new TkDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); |
105 | } | 105 | } |
106 | } | 106 | } |
107 | ytConfigurationContentService.deleteConfigurationContentByCenterId(deleteDTO.getIds()); | 107 | ytConfigurationContentService.deleteConfigurationContentByCenterId(deleteDTO.getIds()); |
@@ -7,7 +7,7 @@ import lombok.extern.slf4j.Slf4j; | @@ -7,7 +7,7 @@ import lombok.extern.slf4j.Slf4j; | ||
7 | import org.springframework.stereotype.Service; | 7 | import org.springframework.stereotype.Service; |
8 | import org.springframework.transaction.annotation.Transactional; | 8 | import org.springframework.transaction.annotation.Transactional; |
9 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 9 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
10 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 10 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
12 | import org.thingsboard.server.common.data.yunteng.dto.*; | 12 | import org.thingsboard.server.common.data.yunteng.dto.*; |
13 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationActEntity; | 13 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationActEntity; |
@@ -93,7 +93,7 @@ public class TkConfigurationContentServiceImpl | @@ -93,7 +93,7 @@ public class TkConfigurationContentServiceImpl | ||
93 | TkConfigurationContentEntity configurationContent = | 93 | TkConfigurationContentEntity configurationContent = |
94 | baseMapper.selectById(configurationContentDTO.getId()); | 94 | baseMapper.selectById(configurationContentDTO.getId()); |
95 | if (!configurationContent.getTenantId().equals(configurationContentDTO.getTenantId())) { | 95 | if (!configurationContent.getTenantId().equals(configurationContentDTO.getTenantId())) { |
96 | - throw new YtDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); | 96 | + throw new TkDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); |
97 | } | 97 | } |
98 | freshNodeData(configurationContentDTO.getTenantId(), configurationContentDTO.getContentId(), configurationContentDTO.getNodeIds()); | 98 | freshNodeData(configurationContentDTO.getTenantId(), configurationContentDTO.getContentId(), configurationContentDTO.getNodeIds()); |
99 | baseMapper.updateById(configurationContentDTO.getEntity(TkConfigurationContentEntity.class)); | 99 | baseMapper.updateById(configurationContentDTO.getEntity(TkConfigurationContentEntity.class)); |
@@ -109,7 +109,7 @@ public class TkConfigurationContentServiceImpl | @@ -109,7 +109,7 @@ public class TkConfigurationContentServiceImpl | ||
109 | .in(TkConfigurationContentEntity::getId, deleteDTO.getIds())); | 109 | .in(TkConfigurationContentEntity::getId, deleteDTO.getIds())); |
110 | for (TkConfigurationContentEntity center : centerList) { | 110 | for (TkConfigurationContentEntity center : centerList) { |
111 | if (!center.getTenantId().equals(deleteDTO.getTenantId())) { | 111 | if (!center.getTenantId().equals(deleteDTO.getTenantId())) { |
112 | - throw new YtDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); | 112 | + throw new TkDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | deleteNodeDatas(null,deleteDTO.getIds()); | 115 | deleteNodeDatas(null,deleteDTO.getIds()); |
@@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils; | @@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils; | ||
8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
9 | import org.springframework.transaction.annotation.Transactional; | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
11 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 11 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | import org.thingsboard.server.common.data.yunteng.dto.ConfigurationDatasourceDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.ConfigurationDatasourceDTO; |
14 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationDatasourceEntity; | 14 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationDatasourceEntity; |
@@ -40,7 +40,7 @@ public class TkConfigurationDatasourceServiceImpl | @@ -40,7 +40,7 @@ public class TkConfigurationDatasourceServiceImpl | ||
40 | newData.setEnabled(false); | 40 | newData.setEnabled(false); |
41 | baseMapper.insert(newData); | 41 | baseMapper.insert(newData); |
42 | } else if(!sourceDTO.getTenantId().equals(old.getTenantId())){ | 42 | } else if(!sourceDTO.getTenantId().equals(old.getTenantId())){ |
43 | - throw new YtDataValidationException(ErrorMessage.HAVE_NO_PERMISSION.getMessage()); | 43 | + throw new TkDataValidationException(ErrorMessage.HAVE_NO_PERMISSION.getMessage()); |
44 | } else { | 44 | } else { |
45 | baseMapper.update(newData, filter); | 45 | baseMapper.update(newData, filter); |
46 | } | 46 | } |
@@ -63,7 +63,7 @@ public class TkConfigurationDatasourceServiceImpl | @@ -63,7 +63,7 @@ public class TkConfigurationDatasourceServiceImpl | ||
63 | public List<ConfigurationDatasourceDTO> listConfigurationDatasource(String tenantId,String levelType,String levelId) { | 63 | public List<ConfigurationDatasourceDTO> listConfigurationDatasource(String tenantId,String levelType,String levelId) { |
64 | if(!FastIotConstants.ConfigureLevel.CONTENT.equals(levelType) | 64 | if(!FastIotConstants.ConfigureLevel.CONTENT.equals(levelType) |
65 | && !FastIotConstants.ConfigureLevel.NODE.equals(levelType)){ | 65 | && !FastIotConstants.ConfigureLevel.NODE.equals(levelType)){ |
66 | - throw new YtDataValidationException("please provide correct levelType!"); | 66 | + throw new TkDataValidationException("please provide correct levelType!"); |
67 | } | 67 | } |
68 | LambdaQueryWrapper<TkConfigurationDatasourceEntity> filter = new QueryWrapper<TkConfigurationDatasourceEntity>().lambda() | 68 | LambdaQueryWrapper<TkConfigurationDatasourceEntity> filter = new QueryWrapper<TkConfigurationDatasourceEntity>().lambda() |
69 | .eq(TkConfigurationDatasourceEntity::getTenantId,tenantId) | 69 | .eq(TkConfigurationDatasourceEntity::getTenantId,tenantId) |
@@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils; | @@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils; | ||
8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
9 | import org.springframework.transaction.annotation.Transactional; | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
11 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 11 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | import org.thingsboard.server.common.data.yunteng.dto.ConfigurationEventDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.ConfigurationEventDTO; |
14 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationEventEntity; | 14 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationEventEntity; |
@@ -42,7 +42,7 @@ public class TkConfigurationEventServiceImpl | @@ -42,7 +42,7 @@ public class TkConfigurationEventServiceImpl | ||
42 | newData.setEnabled(false); | 42 | newData.setEnabled(false); |
43 | baseMapper.insert(newData); | 43 | baseMapper.insert(newData); |
44 | } else if(!eventDTO.getTenantId().equals(old.getTenantId())){ | 44 | } else if(!eventDTO.getTenantId().equals(old.getTenantId())){ |
45 | - throw new YtDataValidationException(ErrorMessage.HAVE_NO_PERMISSION.getMessage()); | 45 | + throw new TkDataValidationException(ErrorMessage.HAVE_NO_PERMISSION.getMessage()); |
46 | } else { | 46 | } else { |
47 | baseMapper.update(newData, filter); | 47 | baseMapper.update(newData, filter); |
48 | } | 48 | } |
@@ -65,7 +65,7 @@ public class TkConfigurationEventServiceImpl | @@ -65,7 +65,7 @@ public class TkConfigurationEventServiceImpl | ||
65 | public List<ConfigurationEventDTO> listConfigurationEvent(String tenantId,String levelType,String levelId) { | 65 | public List<ConfigurationEventDTO> listConfigurationEvent(String tenantId,String levelType,String levelId) { |
66 | if(!FastIotConstants.ConfigureLevel.CONTENT.equals(levelType) | 66 | if(!FastIotConstants.ConfigureLevel.CONTENT.equals(levelType) |
67 | && !FastIotConstants.ConfigureLevel.NODE.equals(levelType)){ | 67 | && !FastIotConstants.ConfigureLevel.NODE.equals(levelType)){ |
68 | - throw new YtDataValidationException("please provide correct levelType!"); | 68 | + throw new TkDataValidationException("please provide correct levelType!"); |
69 | } | 69 | } |
70 | LambdaQueryWrapper<TkConfigurationEventEntity> filter = new QueryWrapper<TkConfigurationEventEntity>().lambda() | 70 | LambdaQueryWrapper<TkConfigurationEventEntity> filter = new QueryWrapper<TkConfigurationEventEntity>().lambda() |
71 | .eq(TkConfigurationEventEntity::getTenantId,tenantId) | 71 | .eq(TkConfigurationEventEntity::getTenantId,tenantId) |
@@ -15,11 +15,11 @@ import org.thingsboard.server.common.data.rule.RuleChainMetaData; | @@ -15,11 +15,11 @@ import org.thingsboard.server.common.data.rule.RuleChainMetaData; | ||
15 | import org.thingsboard.server.common.data.rule.RuleNode; | 15 | import org.thingsboard.server.common.data.rule.RuleNode; |
16 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 16 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
17 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; | 17 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; |
18 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 18 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
19 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 19 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
20 | import org.thingsboard.server.common.data.yunteng.dto.ConvertConfigDTO; | 20 | import org.thingsboard.server.common.data.yunteng.dto.ConvertConfigDTO; |
21 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 21 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
22 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 22 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
23 | import org.thingsboard.server.dao.yunteng.ConvertConfig; | 23 | import org.thingsboard.server.dao.yunteng.ConvertConfig; |
24 | import org.thingsboard.server.dao.yunteng.mapper.ConvertConfigMapper; | 24 | import org.thingsboard.server.dao.yunteng.mapper.ConvertConfigMapper; |
25 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; | 25 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
@@ -41,7 +41,7 @@ public class TkConvertConfigServiceImpl | @@ -41,7 +41,7 @@ public class TkConvertConfigServiceImpl | ||
41 | private final String convertNodeName = "dataConvert@thingskit"; | 41 | private final String convertNodeName = "dataConvert@thingskit"; |
42 | 42 | ||
43 | @Override | 43 | @Override |
44 | - public YtPageData<ConvertConfigDTO> page(String tenantId, Map<String, Object> queryMap) { | 44 | + public TkPageData<ConvertConfigDTO> page(String tenantId, Map<String, Object> queryMap) { |
45 | IPage<ConvertConfig> iPage = | 45 | IPage<ConvertConfig> iPage = |
46 | baseMapper.selectPage( | 46 | baseMapper.selectPage( |
47 | getPage(queryMap, FastIotConstants.DefaultOrder.CREATE_TIME, false), | 47 | getPage(queryMap, FastIotConstants.DefaultOrder.CREATE_TIME, false), |
@@ -71,7 +71,7 @@ public class TkConvertConfigServiceImpl | @@ -71,7 +71,7 @@ public class TkConvertConfigServiceImpl | ||
71 | .eq(ConvertConfig::getId, convertConfig.getId()) | 71 | .eq(ConvertConfig::getId, convertConfig.getId()) |
72 | .eq(ConvertConfig::getTenantId, convertConfig.getTenantId())); | 72 | .eq(ConvertConfig::getTenantId, convertConfig.getTenantId())); |
73 | if (null == checkConfig) { | 73 | if (null == checkConfig) { |
74 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 74 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
75 | } | 75 | } |
76 | if (!checkConfig.getName().equals(config.getName())) { | 76 | if (!checkConfig.getName().equals(config.getName())) { |
77 | // Check Name | 77 | // Check Name |
@@ -79,7 +79,7 @@ public class TkConvertConfigServiceImpl | @@ -79,7 +79,7 @@ public class TkConvertConfigServiceImpl | ||
79 | checkConvertConfigNameExist( | 79 | checkConvertConfigNameExist( |
80 | convertConfig.getId(), config.getName(), config.getType(), config.getTenantId()); | 80 | convertConfig.getId(), config.getName(), config.getType(), config.getTenantId()); |
81 | if (result) { | 81 | if (result) { |
82 | - throw new YtDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); | 82 | + throw new TkDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); |
83 | } | 83 | } |
84 | } | 84 | } |
85 | // 修改不改状态 | 85 | // 修改不改状态 |
@@ -91,7 +91,7 @@ public class TkConvertConfigServiceImpl | @@ -91,7 +91,7 @@ public class TkConvertConfigServiceImpl | ||
91 | checkConvertConfigNameExist( | 91 | checkConvertConfigNameExist( |
92 | null, config.getName(), config.getType(), config.getTenantId()); | 92 | null, config.getName(), config.getType(), config.getTenantId()); |
93 | if (result) { | 93 | if (result) { |
94 | - throw new YtDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); | 94 | + throw new TkDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); |
95 | } | 95 | } |
96 | // DEFAULT DISABLE | 96 | // DEFAULT DISABLE |
97 | config.setStatus(FastIotConstants.StateValue.DISABLE); | 97 | config.setStatus(FastIotConstants.StateValue.DISABLE); |
@@ -120,7 +120,7 @@ public class TkConvertConfigServiceImpl | @@ -120,7 +120,7 @@ public class TkConvertConfigServiceImpl | ||
120 | public List<RuleNode> getRuleNodesByConvertConfigIds( | 120 | public List<RuleNode> getRuleNodesByConvertConfigIds( |
121 | List<String> ids, Integer status, Integer nodeType) { | 121 | List<String> ids, Integer status, Integer nodeType) { |
122 | if (null == ids || ids.isEmpty()) { | 122 | if (null == ids || ids.isEmpty()) { |
123 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 123 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
124 | } | 124 | } |
125 | List<RuleNode> ruleNodes = new ArrayList<>(); | 125 | List<RuleNode> ruleNodes = new ArrayList<>(); |
126 | List<ConvertConfig> configList = | 126 | List<ConvertConfig> configList = |
@@ -6,7 +6,7 @@ import org.springframework.beans.BeanUtils; | @@ -6,7 +6,7 @@ import org.springframework.beans.BeanUtils; | ||
6 | import org.springframework.stereotype.Service; | 6 | import org.springframework.stereotype.Service; |
7 | import org.thingsboard.server.common.data.StringUtils; | 7 | import org.thingsboard.server.common.data.StringUtils; |
8 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 8 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
9 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 9 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
10 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 10 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
11 | import org.thingsboard.server.common.data.yunteng.dto.TkCustomerDeviceDTO; | 11 | import org.thingsboard.server.common.data.yunteng.dto.TkCustomerDeviceDTO; |
12 | import org.thingsboard.server.dao.yunteng.entities.TkCustomerDeviceEntity; | 12 | import org.thingsboard.server.dao.yunteng.entities.TkCustomerDeviceEntity; |
@@ -24,7 +24,7 @@ public class TkCustomerDeviceImpl implements TkCustomerDevice { | @@ -24,7 +24,7 @@ public class TkCustomerDeviceImpl implements TkCustomerDevice { | ||
24 | @Override | 24 | @Override |
25 | public List<TkCustomerDeviceDTO> getMappingByCustomerId(String customerId) { | 25 | public List<TkCustomerDeviceDTO> getMappingByCustomerId(String customerId) { |
26 | if (StringUtils.isEmpty(customerId)) { | 26 | if (StringUtils.isEmpty(customerId)) { |
27 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 27 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
28 | } | 28 | } |
29 | List<TkCustomerDeviceEntity> entities = | 29 | List<TkCustomerDeviceEntity> entities = |
30 | tkCustomerDeviceMapper.selectList( | 30 | tkCustomerDeviceMapper.selectList( |
@@ -48,7 +48,7 @@ public class TkCustomerDeviceImpl implements TkCustomerDevice { | @@ -48,7 +48,7 @@ public class TkCustomerDeviceImpl implements TkCustomerDevice { | ||
48 | public TkCustomerDeviceDTO saveCustomerDeviceMapping(TkCustomerDeviceDTO tkCustomerDeviceDTO) { | 48 | public TkCustomerDeviceDTO saveCustomerDeviceMapping(TkCustomerDeviceDTO tkCustomerDeviceDTO) { |
49 | if (StringUtils.isEmpty(tkCustomerDeviceDTO.getCustomerId()) | 49 | if (StringUtils.isEmpty(tkCustomerDeviceDTO.getCustomerId()) |
50 | || StringUtils.isEmpty(tkCustomerDeviceDTO.getDeviceId())) { | 50 | || StringUtils.isEmpty(tkCustomerDeviceDTO.getDeviceId())) { |
51 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 51 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
52 | } | 52 | } |
53 | TkCustomerDeviceEntity entity = new TkCustomerDeviceEntity(); | 53 | TkCustomerDeviceEntity entity = new TkCustomerDeviceEntity(); |
54 | BeanUtils.copyProperties(tkCustomerDeviceDTO, entity); | 54 | BeanUtils.copyProperties(tkCustomerDeviceDTO, entity); |
@@ -59,7 +59,7 @@ public class TkCustomerDeviceImpl implements TkCustomerDevice { | @@ -59,7 +59,7 @@ public class TkCustomerDeviceImpl implements TkCustomerDevice { | ||
59 | @Override | 59 | @Override |
60 | public boolean deleteCustomerDeviceMapping(List<String> deviceList) { | 60 | public boolean deleteCustomerDeviceMapping(List<String> deviceList) { |
61 | if (null == deviceList || deviceList.isEmpty()) { | 61 | if (null == deviceList || deviceList.isEmpty()) { |
62 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 62 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
63 | } | 63 | } |
64 | return tkCustomerDeviceMapper.delete( | 64 | return tkCustomerDeviceMapper.delete( |
65 | new LambdaQueryWrapper<TkCustomerDeviceEntity>() | 65 | new LambdaQueryWrapper<TkCustomerDeviceEntity>() |
@@ -8,12 +8,12 @@ import org.apache.commons.lang3.StringUtils; | @@ -8,12 +8,12 @@ import org.apache.commons.lang3.StringUtils; | ||
8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
9 | import org.springframework.transaction.annotation.Transactional; | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 10 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
11 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 11 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | import org.thingsboard.server.common.data.yunteng.dto.*; | 13 | import org.thingsboard.server.common.data.yunteng.dto.*; |
14 | import org.thingsboard.server.common.data.yunteng.dto.board.ComponentLayoutDTO; | 14 | import org.thingsboard.server.common.data.yunteng.dto.board.ComponentLayoutDTO; |
15 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; | 15 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; |
16 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 16 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
17 | import org.thingsboard.server.dao.yunteng.entities.TkDataBoardEntity; | 17 | import org.thingsboard.server.dao.yunteng.entities.TkDataBoardEntity; |
18 | import org.thingsboard.server.dao.yunteng.entities.TkDataComponentEntity; | 18 | import org.thingsboard.server.dao.yunteng.entities.TkDataComponentEntity; |
19 | import org.thingsboard.server.dao.yunteng.mapper.DataBoardMapper; | 19 | import org.thingsboard.server.dao.yunteng.mapper.DataBoardMapper; |
@@ -35,7 +35,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | @@ -35,7 +35,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | ||
35 | private final DataComponentMapper dataComponentMapper; | 35 | private final DataComponentMapper dataComponentMapper; |
36 | 36 | ||
37 | @Override | 37 | @Override |
38 | - public YtPageData<DataBoardDTO> dataBoardPage(Map<String, Object> queryMap, boolean tenantAdmin) { | 38 | + public TkPageData<DataBoardDTO> dataBoardPage(Map<String, Object> queryMap, boolean tenantAdmin) { |
39 | int zero = FastIotConstants.MagicNumber.ZERO; | 39 | int zero = FastIotConstants.MagicNumber.ZERO; |
40 | String name = null != queryMap.get("name") ? queryMap.get("name").toString() : null; | 40 | String name = null != queryMap.get("name") ? queryMap.get("name").toString() : null; |
41 | String tenantId = | 41 | String tenantId = |
@@ -43,7 +43,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | @@ -43,7 +43,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | ||
43 | .map(Object::toString) | 43 | .map(Object::toString) |
44 | .orElseThrow( | 44 | .orElseThrow( |
45 | () -> { | 45 | () -> { |
46 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 46 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
47 | }); | 47 | }); |
48 | String organizationId = | 48 | String organizationId = |
49 | null != queryMap.get("organizationId") ? queryMap.get("organizationId").toString() : null; | 49 | null != queryMap.get("organizationId") ? queryMap.get("organizationId").toString() : null; |
@@ -53,7 +53,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | @@ -53,7 +53,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | ||
53 | organizationMapper.findOrganizationTreeList( | 53 | organizationMapper.findOrganizationTreeList( |
54 | (String) queryMap.get("tenantId"), new HashSet<>(List.of(organizationId))); | 54 | (String) queryMap.get("tenantId"), new HashSet<>(List.of(organizationId))); |
55 | if (list.size() == zero) { | 55 | if (list.size() == zero) { |
56 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 56 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
57 | } | 57 | } |
58 | organizationIds = list.stream().map(BaseDTO::getId).distinct().collect(Collectors.toList()); | 58 | organizationIds = list.stream().map(BaseDTO::getId).distinct().collect(Collectors.toList()); |
59 | } | 59 | } |
@@ -101,7 +101,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | @@ -101,7 +101,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | ||
101 | .map(obj -> baseMapper.updateById(dataBoard)) | 101 | .map(obj -> baseMapper.updateById(dataBoard)) |
102 | .orElseThrow( | 102 | .orElseThrow( |
103 | () -> { | 103 | () -> { |
104 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | 104 | + throw new TkDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); |
105 | }); | 105 | }); |
106 | } | 106 | } |
107 | return dataBoard.getDTO(DataBoardDTO.class); | 107 | return dataBoard.getDTO(DataBoardDTO.class); |
@@ -139,7 +139,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | @@ -139,7 +139,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | ||
139 | }) | 139 | }) |
140 | .orElseThrow( | 140 | .orElseThrow( |
141 | () -> { | 141 | () -> { |
142 | - throw new YtDataValidationException( | 142 | + throw new TkDataValidationException( |
143 | ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); | 143 | ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); |
144 | }); | 144 | }); |
145 | } | 145 | } |
@@ -5,7 +5,7 @@ import com.fasterxml.jackson.databind.JsonNode; | @@ -5,7 +5,7 @@ import com.fasterxml.jackson.databind.JsonNode; | ||
5 | import org.apache.commons.lang3.StringUtils; | 5 | import org.apache.commons.lang3.StringUtils; |
6 | import org.springframework.stereotype.Service; | 6 | import org.springframework.stereotype.Service; |
7 | import org.springframework.transaction.annotation.Transactional; | 7 | import org.springframework.transaction.annotation.Transactional; |
8 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 8 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
9 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 9 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
10 | import org.thingsboard.server.common.data.yunteng.dto.DataComponentDTO; | 10 | import org.thingsboard.server.common.data.yunteng.dto.DataComponentDTO; |
11 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 11 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
@@ -60,7 +60,7 @@ public class TkDataComponentServiceImpl | @@ -60,7 +60,7 @@ public class TkDataComponentServiceImpl | ||
60 | .map(obj -> baseMapper.updateById(dataComponent)) | 60 | .map(obj -> baseMapper.updateById(dataComponent)) |
61 | .orElseThrow( | 61 | .orElseThrow( |
62 | () -> { | 62 | () -> { |
63 | - throw new YtDataValidationException( | 63 | + throw new TkDataValidationException( |
64 | ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); | 64 | ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); |
65 | }); | 65 | }); |
66 | } | 66 | } |
@@ -15,13 +15,13 @@ import org.thingsboard.server.common.data.id.TenantId; | @@ -15,13 +15,13 @@ import org.thingsboard.server.common.data.id.TenantId; | ||
15 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 15 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
16 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; | 16 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; |
17 | import org.thingsboard.server.common.data.yunteng.constant.QueryConstant; | 17 | import org.thingsboard.server.common.data.yunteng.constant.QueryConstant; |
18 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 18 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
19 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 19 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
20 | import org.thingsboard.server.common.data.yunteng.dto.*; | 20 | import org.thingsboard.server.common.data.yunteng.dto.*; |
21 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; | 21 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
22 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 22 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
23 | import org.thingsboard.server.dao.yunteng.entities.*; | 23 | import org.thingsboard.server.dao.yunteng.entities.*; |
24 | -import org.thingsboard.server.dao.yunteng.jpa.dao.YtJpaDeviceProfileDao; | 24 | +import org.thingsboard.server.dao.yunteng.jpa.dao.TkJpaDeviceProfileDao; |
25 | import org.thingsboard.server.dao.yunteng.mapper.DeviceMapper; | 25 | import org.thingsboard.server.dao.yunteng.mapper.DeviceMapper; |
26 | import org.thingsboard.server.dao.yunteng.mapper.TkDeviceProfileMapper; | 26 | import org.thingsboard.server.dao.yunteng.mapper.TkDeviceProfileMapper; |
27 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; | 27 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
@@ -39,7 +39,7 @@ public class TkDeviceProfileServiceImpl | @@ -39,7 +39,7 @@ public class TkDeviceProfileServiceImpl | ||
39 | 39 | ||
40 | private final DeviceMapper deviceMapper; | 40 | private final DeviceMapper deviceMapper; |
41 | 41 | ||
42 | - private final YtJpaDeviceProfileDao deviceProfileDao; | 42 | + private final TkJpaDeviceProfileDao deviceProfileDao; |
43 | 43 | ||
44 | @Override | 44 | @Override |
45 | public boolean validateFormData(DeviceProfileDTO ytDeviceProfileDTO) { | 45 | public boolean validateFormData(DeviceProfileDTO ytDeviceProfileDTO) { |
@@ -49,13 +49,13 @@ public class TkDeviceProfileServiceImpl | @@ -49,13 +49,13 @@ public class TkDeviceProfileServiceImpl | ||
49 | 49 | ||
50 | DeviceProfile profile = deviceProfileDao.findByName(tenantId, ytDeviceProfileDTO.getName()); | 50 | DeviceProfile profile = deviceProfileDao.findByName(tenantId, ytDeviceProfileDTO.getName()); |
51 | if (profile != null) { | 51 | if (profile != null) { |
52 | - throw new YtDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); | 52 | + throw new TkDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); |
53 | } | 53 | } |
54 | } else { | 54 | } else { |
55 | UUID profileId = UUID.fromString(ytDeviceProfileDTO.getId()); | 55 | UUID profileId = UUID.fromString(ytDeviceProfileDTO.getId()); |
56 | DeviceProfile profile = deviceProfileDao.findById(tenantId, profileId); | 56 | DeviceProfile profile = deviceProfileDao.findById(tenantId, profileId); |
57 | if (profile == null) { | 57 | if (profile == null) { |
58 | - throw new YtDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); | 58 | + throw new TkDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
@@ -147,7 +147,7 @@ public class TkDeviceProfileServiceImpl | @@ -147,7 +147,7 @@ public class TkDeviceProfileServiceImpl | ||
147 | deviceMapper.selectCount( | 147 | deviceMapper.selectCount( |
148 | new QueryWrapper<TkDeviceEntity>().lambda().in(TkDeviceEntity::getProfileId, ids)); | 148 | new QueryWrapper<TkDeviceEntity>().lambda().in(TkDeviceEntity::getProfileId, ids)); |
149 | if (count > 0) { | 149 | if (count > 0) { |
150 | - throw new YtDataValidationException("有设备使用待删除配置,请先删除设备或者修改设备配置"); | 150 | + throw new TkDataValidationException("有设备使用待删除配置,请先删除设备或者修改设备配置"); |
151 | } | 151 | } |
152 | } | 152 | } |
153 | 153 | ||
@@ -157,7 +157,7 @@ public class TkDeviceProfileServiceImpl | @@ -157,7 +157,7 @@ public class TkDeviceProfileServiceImpl | ||
157 | } | 157 | } |
158 | 158 | ||
159 | @Override | 159 | @Override |
160 | - public YtPageData<DeviceProfileDTO> page(Map<String, Object> queryMap, boolean isTenantAdmin) { | 160 | + public TkPageData<DeviceProfileDTO> page(Map<String, Object> queryMap, boolean isTenantAdmin) { |
161 | String tenantIdStr = | 161 | String tenantIdStr = |
162 | Optional.ofNullable(queryMap.get(QueryConstant.TENANT_ID)) | 162 | Optional.ofNullable(queryMap.get(QueryConstant.TENANT_ID)) |
163 | .map(Object::toString) | 163 | .map(Object::toString) |
@@ -237,7 +237,7 @@ public class TkDeviceProfileServiceImpl | @@ -237,7 +237,7 @@ public class TkDeviceProfileServiceImpl | ||
237 | @Override | 237 | @Override |
238 | public List<DeviceProfileDTO> findDeviceProfileByIds(String tenantId, List<String> ids) { | 238 | public List<DeviceProfileDTO> findDeviceProfileByIds(String tenantId, List<String> ids) { |
239 | if (StringUtils.isEmpty(tenantId) || null == ids) { | 239 | if (StringUtils.isEmpty(tenantId) || null == ids) { |
240 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 240 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
241 | } | 241 | } |
242 | List<TkDeviceProfileEntity> entities = | 242 | List<TkDeviceProfileEntity> entities = |
243 | baseMapper.selectList( | 243 | baseMapper.selectList( |
@@ -11,13 +11,13 @@ import org.springframework.transaction.annotation.Transactional; | @@ -11,13 +11,13 @@ import org.springframework.transaction.annotation.Transactional; | ||
11 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 11 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
12 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; | 12 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; |
13 | import org.thingsboard.server.common.data.yunteng.constant.QueryConstant; | 13 | import org.thingsboard.server.common.data.yunteng.constant.QueryConstant; |
14 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 14 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
15 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 15 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
16 | import org.thingsboard.server.common.data.yunteng.dto.DeviceDTO; | 16 | import org.thingsboard.server.common.data.yunteng.dto.DeviceDTO; |
17 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; | 17 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; |
18 | import org.thingsboard.server.common.data.yunteng.dto.TkCustomerDeviceDTO; | 18 | import org.thingsboard.server.common.data.yunteng.dto.TkCustomerDeviceDTO; |
19 | import org.thingsboard.server.common.data.yunteng.dto.TkDeviceScriptDTO; | 19 | import org.thingsboard.server.common.data.yunteng.dto.TkDeviceScriptDTO; |
20 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 20 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
21 | import org.thingsboard.server.dao.yunteng.entities.TkDeviceProfileEntity; | 21 | import org.thingsboard.server.dao.yunteng.entities.TkDeviceProfileEntity; |
22 | import org.thingsboard.server.dao.yunteng.entities.TkDeviceScriptEntity; | 22 | import org.thingsboard.server.dao.yunteng.entities.TkDeviceScriptEntity; |
23 | import org.thingsboard.server.dao.yunteng.mapper.TkDeviceProfileMapper; | 23 | import org.thingsboard.server.dao.yunteng.mapper.TkDeviceProfileMapper; |
@@ -52,7 +52,7 @@ public class TkDeviceScriptServiceImpl | @@ -52,7 +52,7 @@ public class TkDeviceScriptServiceImpl | ||
52 | .eq(TkDeviceScriptEntity::getName, scriptDTO.getName()); | 52 | .eq(TkDeviceScriptEntity::getName, scriptDTO.getName()); |
53 | int results = baseMapper.selectCount(queryWrapper); | 53 | int results = baseMapper.selectCount(queryWrapper); |
54 | if (results > 0) { | 54 | if (results > 0) { |
55 | - throw new YtDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); | 55 | + throw new TkDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); |
56 | } | 56 | } |
57 | } else { | 57 | } else { |
58 | LambdaQueryWrapper<TkDeviceScriptEntity> queryWrapper = | 58 | LambdaQueryWrapper<TkDeviceScriptEntity> queryWrapper = |
@@ -69,10 +69,10 @@ public class TkDeviceScriptServiceImpl | @@ -69,10 +69,10 @@ public class TkDeviceScriptServiceImpl | ||
69 | for (TkDeviceScriptEntity item : results) { | 69 | for (TkDeviceScriptEntity item : results) { |
70 | if (item.getId().equals(scriptDTO.getId()) | 70 | if (item.getId().equals(scriptDTO.getId()) |
71 | && !item.getTenantId().equals(scriptDTO.getTenantId())) { | 71 | && !item.getTenantId().equals(scriptDTO.getTenantId())) { |
72 | - throw new YtDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); | 72 | + throw new TkDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); |
73 | } | 73 | } |
74 | if (!item.getId().equals(scriptDTO.getId()) && item.getName().equals(scriptDTO.getName())) { | 74 | if (!item.getId().equals(scriptDTO.getId()) && item.getName().equals(scriptDTO.getName())) { |
75 | - throw new YtDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); | 75 | + throw new TkDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); |
76 | } | 76 | } |
77 | } | 77 | } |
78 | } | 78 | } |
@@ -84,14 +84,14 @@ public class TkDeviceScriptServiceImpl | @@ -84,14 +84,14 @@ public class TkDeviceScriptServiceImpl | ||
84 | @Transactional | 84 | @Transactional |
85 | public boolean updateScriptStatus(String tenantId, String id, Integer status) { | 85 | public boolean updateScriptStatus(String tenantId, String id, Integer status) { |
86 | if (StringUtils.isEmpty(tenantId) || StringUtils.isEmpty(id) || null == status) { | 86 | if (StringUtils.isEmpty(tenantId) || StringUtils.isEmpty(id) || null == status) { |
87 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 87 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
88 | } | 88 | } |
89 | TkDeviceScriptEntity entity = baseMapper.selectById(id); | 89 | TkDeviceScriptEntity entity = baseMapper.selectById(id); |
90 | if (null == entity) { | 90 | if (null == entity) { |
91 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 91 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
92 | } | 92 | } |
93 | if (!entity.getTenantId().equals(tenantId)) { | 93 | if (!entity.getTenantId().equals(tenantId)) { |
94 | - throw new YtDataValidationException(ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); | 94 | + throw new TkDataValidationException(ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); |
95 | } | 95 | } |
96 | entity.setStatus(status); | 96 | entity.setStatus(status); |
97 | return baseMapper.updateById(entity) > FastIotConstants.MagicNumber.ZERO; | 97 | return baseMapper.updateById(entity) > FastIotConstants.MagicNumber.ZERO; |
@@ -127,7 +127,7 @@ public class TkDeviceScriptServiceImpl | @@ -127,7 +127,7 @@ public class TkDeviceScriptServiceImpl | ||
127 | .in(TkDeviceProfileEntity::getScriptId, ids)); | 127 | .in(TkDeviceProfileEntity::getScriptId, ids)); |
128 | if (usedList != null && usedList.size() > 0) { | 128 | if (usedList != null && usedList.size() > 0) { |
129 | List<String> names = usedList.stream().map(TkDeviceProfileEntity::getName).collect(Collectors.toList()); | 129 | List<String> names = usedList.stream().map(TkDeviceProfileEntity::getName).collect(Collectors.toList()); |
130 | - throw new YtDataValidationException( | 130 | + throw new TkDataValidationException( |
131 | String.format(ErrorMessage.PROJECT_USED_SCRIPT.getMessage(), names)); | 131 | String.format(ErrorMessage.PROJECT_USED_SCRIPT.getMessage(), names)); |
132 | } | 132 | } |
133 | } | 133 | } |
@@ -191,7 +191,7 @@ public class TkDeviceScriptServiceImpl | @@ -191,7 +191,7 @@ public class TkDeviceScriptServiceImpl | ||
191 | } | 191 | } |
192 | 192 | ||
193 | @Override | 193 | @Override |
194 | - public YtPageData<TkDeviceScriptDTO> page(Map<String, Object> queryMap, boolean isTenantAdmin) { | 194 | + public TkPageData<TkDeviceScriptDTO> page(Map<String, Object> queryMap, boolean isTenantAdmin) { |
195 | 195 | ||
196 | String tenantId = | 196 | String tenantId = |
197 | Optional.ofNullable(queryMap.get(QueryConstant.TENANT_ID)) | 197 | Optional.ofNullable(queryMap.get(QueryConstant.TENANT_ID)) |
@@ -213,7 +213,7 @@ public class TkDeviceScriptServiceImpl | @@ -213,7 +213,7 @@ public class TkDeviceScriptServiceImpl | ||
213 | scriptIds = getCustomerScripts(customerId, tenantId); | 213 | scriptIds = getCustomerScripts(customerId, tenantId); |
214 | } | 214 | } |
215 | if (!isTenantAdmin && (null == scriptIds || scriptIds.isEmpty())) { | 215 | if (!isTenantAdmin && (null == scriptIds || scriptIds.isEmpty())) { |
216 | - return new YtPageData<>(new ArrayList<>(), 0); | 216 | + return new TkPageData<>(new ArrayList<>(), 0); |
217 | } | 217 | } |
218 | LambdaQueryWrapper<TkDeviceScriptEntity> queryWrapper = | 218 | LambdaQueryWrapper<TkDeviceScriptEntity> queryWrapper = |
219 | new QueryWrapper<TkDeviceScriptEntity>() | 219 | new QueryWrapper<TkDeviceScriptEntity>() |
@@ -232,7 +232,7 @@ public class TkDeviceScriptServiceImpl | @@ -232,7 +232,7 @@ public class TkDeviceScriptServiceImpl | ||
232 | scripts.getRecords().stream() | 232 | scripts.getRecords().stream() |
233 | .map(entity -> entity.getDTO(TkDeviceScriptDTO.class)) | 233 | .map(entity -> entity.getDTO(TkDeviceScriptDTO.class)) |
234 | .collect(Collectors.toList()); | 234 | .collect(Collectors.toList()); |
235 | - return new YtPageData<>(records, scripts.getTotal()); | 235 | + return new TkPageData<>(records, scripts.getTotal()); |
236 | } | 236 | } |
237 | 237 | ||
238 | @Override | 238 | @Override |
@@ -18,7 +18,7 @@ import org.thingsboard.server.common.data.id.EntityId; | @@ -18,7 +18,7 @@ import org.thingsboard.server.common.data.id.EntityId; | ||
18 | import org.thingsboard.server.common.data.id.TenantId; | 18 | import org.thingsboard.server.common.data.id.TenantId; |
19 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; | 19 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
20 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; | 20 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; |
21 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 21 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
22 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 22 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
23 | import org.thingsboard.server.common.data.yunteng.dto.*; | 23 | import org.thingsboard.server.common.data.yunteng.dto.*; |
24 | import org.thingsboard.server.common.data.yunteng.enums.DataTypeEnum; | 24 | import org.thingsboard.server.common.data.yunteng.enums.DataTypeEnum; |
@@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; | @@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; | ||
26 | import org.thingsboard.server.common.data.yunteng.enums.FunctionTypeEnum; | 26 | import org.thingsboard.server.common.data.yunteng.enums.FunctionTypeEnum; |
27 | import org.thingsboard.server.common.data.yunteng.enums.ScopeEnum; | 27 | import org.thingsboard.server.common.data.yunteng.enums.ScopeEnum; |
28 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; | 28 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; |
29 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 29 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
30 | import org.thingsboard.server.dao.device.DeviceProfileDao; | 30 | import org.thingsboard.server.dao.device.DeviceProfileDao; |
31 | import org.thingsboard.server.dao.yunteng.entities.*; | 31 | import org.thingsboard.server.dao.yunteng.entities.*; |
32 | import org.thingsboard.server.dao.yunteng.mapper.*; | 32 | import org.thingsboard.server.dao.yunteng.mapper.*; |
@@ -87,7 +87,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -87,7 +87,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
87 | 87 | ||
88 | private void validateUpdate(DeviceDTO deviceDTO) { | 88 | private void validateUpdate(DeviceDTO deviceDTO) { |
89 | if (StringUtils.isEmpty(deviceDTO.getName())) { | 89 | if (StringUtils.isEmpty(deviceDTO.getName())) { |
90 | - throw new YtDataValidationException("device name must be specific"); | 90 | + throw new TkDataValidationException("device name must be specific"); |
91 | } | 91 | } |
92 | } | 92 | } |
93 | 93 | ||
@@ -96,16 +96,16 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -96,16 +96,16 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
96 | boolean insert = StringUtils.isBlank(deviceDTO.getId()); | 96 | boolean insert = StringUtils.isBlank(deviceDTO.getId()); |
97 | String deviceTenantId; | 97 | String deviceTenantId; |
98 | if (StringUtils.isBlank(deviceDTO.getName())) { | 98 | if (StringUtils.isBlank(deviceDTO.getName())) { |
99 | - throw new YtDataValidationException("设备名称不能为空"); | 99 | + throw new TkDataValidationException("设备名称不能为空"); |
100 | } | 100 | } |
101 | // validate IOT DB | 101 | // validate IOT DB |
102 | if (StringUtils.isBlank(deviceDTO.getProfileId())) { | 102 | if (StringUtils.isBlank(deviceDTO.getProfileId())) { |
103 | - throw new YtDataValidationException("设备配置不能为空"); | 103 | + throw new TkDataValidationException("设备配置不能为空"); |
104 | } | 104 | } |
105 | 105 | ||
106 | // 验证设备名称是否已经存在 如果此处直接使用deviceDTO 将有误 | 106 | // 验证设备名称是否已经存在 如果此处直接使用deviceDTO 将有误 |
107 | if (deviceNameUsed(currentTenantId, deviceDTO.getName(), deviceDTO.getId())) { | 107 | if (deviceNameUsed(currentTenantId, deviceDTO.getName(), deviceDTO.getId())) { |
108 | - throw new YtDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); | 108 | + throw new TkDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); |
109 | } | 109 | } |
110 | if (insert) { | 110 | if (insert) { |
111 | deviceTenantId = currentTenantId; | 111 | deviceTenantId = currentTenantId; |
@@ -114,10 +114,10 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -114,10 +114,10 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
114 | deviceTenantId = deviceDTO.getTenantId(); | 114 | deviceTenantId = deviceDTO.getTenantId(); |
115 | TkDeviceEntity device = baseMapper.selectById(deviceDTO.getId()); | 115 | TkDeviceEntity device = baseMapper.selectById(deviceDTO.getId()); |
116 | if (device == null) { | 116 | if (device == null) { |
117 | - throw new YtDataValidationException("设备不存在!"); | 117 | + throw new TkDataValidationException("设备不存在!"); |
118 | } | 118 | } |
119 | if (!device.getTenantId().equals(currentTenantId)) { | 119 | if (!device.getTenantId().equals(currentTenantId)) { |
120 | - throw new YtDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); | 120 | + throw new TkDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); |
121 | } | 121 | } |
122 | String oldOrganizationId = device.getOrganizationId(); | 122 | String oldOrganizationId = device.getOrganizationId(); |
123 | if (!oldOrganizationId.equals(deviceDTO.getOrganizationId())) { | 123 | if (!oldOrganizationId.equals(deviceDTO.getOrganizationId())) { |
@@ -132,9 +132,9 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -132,9 +132,9 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
132 | TkOrganizationEntity organization = | 132 | TkOrganizationEntity organization = |
133 | tkOrganizationMapper.selectById(deviceDTO.getOrganizationId()); | 133 | tkOrganizationMapper.selectById(deviceDTO.getOrganizationId()); |
134 | if (null == deviceProfile || null == organization) { | 134 | if (null == deviceProfile || null == organization) { |
135 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 135 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
136 | } else if (!organization.getTenantId().equals(deviceTenantId)) { | 136 | } else if (!organization.getTenantId().equals(deviceTenantId)) { |
137 | - throw new YtDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); | 137 | + throw new TkDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage()); |
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
@@ -204,7 +204,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -204,7 +204,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
204 | } | 204 | } |
205 | } | 205 | } |
206 | if (sceneNames.size() > 0) { | 206 | if (sceneNames.size() > 0) { |
207 | - throw new YtDataValidationException( | 207 | + throw new TkDataValidationException( |
208 | String.format(ErrorMessage.DEVICE_USED_SCENE_REACT.getMessage(), sceneNames)); | 208 | String.format(ErrorMessage.DEVICE_USED_SCENE_REACT.getMessage(), sceneNames)); |
209 | } | 209 | } |
210 | } | 210 | } |
@@ -256,7 +256,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -256,7 +256,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
256 | String deviceProfileId) { | 256 | String deviceProfileId) { |
257 | List<String> orgIds = organizationAllIds(tenantId, organizationId); | 257 | List<String> orgIds = organizationAllIds(tenantId, organizationId); |
258 | if (orgIds.isEmpty()) { | 258 | if (orgIds.isEmpty()) { |
259 | - throw new YtDataValidationException(ErrorMessage.ORGANIZATION_NOT_EXTIED.getMessage()); | 259 | + throw new TkDataValidationException(ErrorMessage.ORGANIZATION_NOT_EXTIED.getMessage()); |
260 | } | 260 | } |
261 | return ReflectUtils.sourceToTarget( | 261 | return ReflectUtils.sourceToTarget( |
262 | baseMapper.selectList( | 262 | baseMapper.selectList( |
@@ -276,7 +276,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -276,7 +276,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
276 | String tenantId, String organizationId, DeviceTransportType transportType) { | 276 | String tenantId, String organizationId, DeviceTransportType transportType) { |
277 | List<String> orgIds = organizationAllIds(tenantId, organizationId); | 277 | List<String> orgIds = organizationAllIds(tenantId, organizationId); |
278 | if (orgIds.isEmpty()) { | 278 | if (orgIds.isEmpty()) { |
279 | - throw new YtDataValidationException(ErrorMessage.ORGANIZATION_NOT_EXTIED.getMessage()); | 279 | + throw new TkDataValidationException(ErrorMessage.ORGANIZATION_NOT_EXTIED.getMessage()); |
280 | } | 280 | } |
281 | List<String> deviceProfileIds = null; | 281 | List<String> deviceProfileIds = null; |
282 | if (null != transportType) { | 282 | if (null != transportType) { |
@@ -286,12 +286,12 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -286,12 +286,12 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
286 | baseMapper.selectList( | 286 | baseMapper.selectList( |
287 | new LambdaQueryWrapper<TkDeviceEntity>() | 287 | new LambdaQueryWrapper<TkDeviceEntity>() |
288 | .eq(TkDeviceEntity::getTenantId, tenantId) | 288 | .eq(TkDeviceEntity::getTenantId, tenantId) |
289 | - .eq(TkDeviceEntity::getDeviceType,DeviceTypeEnum.GATEWAY) | 289 | + .eq(TkDeviceEntity::getDeviceType, DeviceTypeEnum.GATEWAY) |
290 | .in(TkDeviceEntity::getOrganizationId, orgIds)); | 290 | .in(TkDeviceEntity::getOrganizationId, orgIds)); |
291 | - if(null != deviceProfileIds && !deviceProfileIds.isEmpty()){ | 291 | + if (null != deviceProfileIds && !deviceProfileIds.isEmpty()) { |
292 | List<TkDeviceEntity> result = new ArrayList<>(); | 292 | List<TkDeviceEntity> result = new ArrayList<>(); |
293 | - for (TkDeviceEntity entity :entities){ | ||
294 | - if(deviceProfileIds.contains(entity.getDeviceProfileId())){ | 293 | + for (TkDeviceEntity entity : entities) { |
294 | + if (deviceProfileIds.contains(entity.getDeviceProfileId())) { | ||
295 | result.add(entity); | 295 | result.add(entity); |
296 | } | 296 | } |
297 | } | 297 | } |
@@ -306,7 +306,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -306,7 +306,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
306 | @Override | 306 | @Override |
307 | public DeviceDTO checkDeviceByTenantIdAndDeviceId(String tenantId, String deviceId) { | 307 | public DeviceDTO checkDeviceByTenantIdAndDeviceId(String tenantId, String deviceId) { |
308 | if (StringUtils.isEmpty(tenantId) || StringUtils.isEmpty(deviceId)) { | 308 | if (StringUtils.isEmpty(tenantId) || StringUtils.isEmpty(deviceId)) { |
309 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 309 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
310 | } | 310 | } |
311 | return baseMapper.selectDetail(tenantId, deviceId); | 311 | return baseMapper.selectDetail(tenantId, deviceId); |
312 | } | 312 | } |
@@ -321,7 +321,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -321,7 +321,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
321 | public DeviceDTO checkDeviceByTenantIdAndId( | 321 | public DeviceDTO checkDeviceByTenantIdAndId( |
322 | String tenantId, String deviceId, boolean isTbDeviceId) { | 322 | String tenantId, String deviceId, boolean isTbDeviceId) { |
323 | if (StringUtils.isEmpty(deviceId) || StringUtils.isEmpty(tenantId)) { | 323 | if (StringUtils.isEmpty(deviceId) || StringUtils.isEmpty(tenantId)) { |
324 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 324 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
325 | } | 325 | } |
326 | TkDeviceEntity device = | 326 | TkDeviceEntity device = |
327 | baseMapper.selectOne( | 327 | baseMapper.selectOne( |
@@ -331,7 +331,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -331,7 +331,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
331 | .eq(!isTbDeviceId, TkDeviceEntity::getId, deviceId)); | 331 | .eq(!isTbDeviceId, TkDeviceEntity::getId, deviceId)); |
332 | DeviceDTO deviceDTO = null != device ? device.getDTO(DeviceDTO.class) : null; | 332 | DeviceDTO deviceDTO = null != device ? device.getDTO(DeviceDTO.class) : null; |
333 | if (null == deviceDTO) { | 333 | if (null == deviceDTO) { |
334 | - throw new YtDataValidationException(ErrorMessage.DEVICE_NOT_EXISTENCE_IN_TENANT.getMessage()); | 334 | + throw new TkDataValidationException(ErrorMessage.DEVICE_NOT_EXISTENCE_IN_TENANT.getMessage()); |
335 | } | 335 | } |
336 | return deviceDTO; | 336 | return deviceDTO; |
337 | } | 337 | } |
@@ -354,7 +354,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -354,7 +354,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
354 | } | 354 | } |
355 | 355 | ||
356 | @Override | 356 | @Override |
357 | - public YtPageData<DeviceDTO> page(String tenantId, Map<String, Object> queryMap) { | 357 | + public TkPageData<DeviceDTO> page(String tenantId, Map<String, Object> queryMap) { |
358 | queryMap.put("tenantId", tenantId); | 358 | queryMap.put("tenantId", tenantId); |
359 | String organizationId = (String) queryMap.get("organizationId"); | 359 | String organizationId = (String) queryMap.get("organizationId"); |
360 | if (!StringUtils.isEmpty(organizationId)) { | 360 | if (!StringUtils.isEmpty(organizationId)) { |
@@ -372,7 +372,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -372,7 +372,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
372 | deviceDTO.setCustomerId(null); | 372 | deviceDTO.setCustomerId(null); |
373 | } | 373 | } |
374 | }); | 374 | }); |
375 | - return new YtPageData<>(records, deviceIPage.getTotal()); | 375 | + return new TkPageData<>(records, deviceIPage.getTotal()); |
376 | } | 376 | } |
377 | 377 | ||
378 | /** | 378 | /** |
@@ -399,11 +399,11 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -399,11 +399,11 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
399 | } | 399 | } |
400 | 400 | ||
401 | @Override | 401 | @Override |
402 | - public YtPageData<RelationDeviceDTO> pageRelation(Map<String, Object> queryMap) { | 402 | + public TkPageData<RelationDeviceDTO> pageRelation(Map<String, Object> queryMap) { |
403 | IPage<TkDeviceEntity> page = getPage(queryMap, "last_online_time", false); | 403 | IPage<TkDeviceEntity> page = getPage(queryMap, "last_online_time", false); |
404 | IPage<RelationDeviceDTO> deviceIPage = baseMapper.getRelationDevicePage(page, queryMap); | 404 | IPage<RelationDeviceDTO> deviceIPage = baseMapper.getRelationDevicePage(page, queryMap); |
405 | List<RelationDeviceDTO> records = deviceIPage.getRecords(); | 405 | List<RelationDeviceDTO> records = deviceIPage.getRecords(); |
406 | - return new YtPageData<>(records, deviceIPage.getTotal()); | 406 | + return new TkPageData<>(records, deviceIPage.getTotal()); |
407 | } | 407 | } |
408 | 408 | ||
409 | @Override | 409 | @Override |
@@ -449,7 +449,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -449,7 +449,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
449 | public String otherUsing(String deviceId, String tenantId) { | 449 | public String otherUsing(String deviceId, String tenantId) { |
450 | TkDeviceEntity device = baseMapper.selectById(deviceId); | 450 | TkDeviceEntity device = baseMapper.selectById(deviceId); |
451 | if (device == null) { | 451 | if (device == null) { |
452 | - throw new YtDataValidationException(ErrorMessage.DEVICE_NOT_EXTIED.getMessage()); | 452 | + throw new TkDataValidationException(ErrorMessage.DEVICE_NOT_EXTIED.getMessage()); |
453 | } | 453 | } |
454 | String tbDeviceId = device.getTbDeviceId(); | 454 | String tbDeviceId = device.getTbDeviceId(); |
455 | 455 | ||
@@ -565,7 +565,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -565,7 +565,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
565 | @Override | 565 | @Override |
566 | public List<DeviceDTO> findDevicesInfoByIds(String tenantId, Set<String> ids) { | 566 | public List<DeviceDTO> findDevicesInfoByIds(String tenantId, Set<String> ids) { |
567 | if (StringUtils.isEmpty(tenantId) || null == ids) { | 567 | if (StringUtils.isEmpty(tenantId) || null == ids) { |
568 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 568 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
569 | } | 569 | } |
570 | List<TkDeviceEntity> entities = | 570 | List<TkDeviceEntity> entities = |
571 | baseMapper.selectList( | 571 | baseMapper.selectList( |
@@ -590,7 +590,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -590,7 +590,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
590 | .map(obj -> obj.getDTO(DeviceDTO.class)) | 590 | .map(obj -> obj.getDTO(DeviceDTO.class)) |
591 | .orElseThrow( | 591 | .orElseThrow( |
592 | () -> { | 592 | () -> { |
593 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 593 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
594 | }); | 594 | }); |
595 | } | 595 | } |
596 | 596 | ||
@@ -625,4 +625,12 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -625,4 +625,12 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
625 | } | 625 | } |
626 | return jsonNode; | 626 | return jsonNode; |
627 | } | 627 | } |
628 | + | ||
629 | + @Override | ||
630 | + public String getDeviceRelation(boolean isSlave, String deviceId) { | ||
631 | + if (StringUtils.isEmpty(deviceId)) { | ||
632 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | ||
633 | + } | ||
634 | + return baseMapper.getDeviceRelation(isSlave, deviceId); | ||
635 | + } | ||
628 | } | 636 | } |
@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | @@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
4 | import org.apache.commons.lang3.StringUtils; | 4 | import org.apache.commons.lang3.StringUtils; |
5 | import org.springframework.stereotype.Service; | 5 | import org.springframework.stereotype.Service; |
6 | import org.springframework.transaction.annotation.Transactional; | 6 | import org.springframework.transaction.annotation.Transactional; |
7 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 7 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
8 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 8 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
9 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 9 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
10 | import org.thingsboard.server.common.data.yunteng.dto.DeviceTypeDTO; | 10 | import org.thingsboard.server.common.data.yunteng.dto.DeviceTypeDTO; |
@@ -24,7 +24,7 @@ public class TkDeviceTypeServiceImpl extends AbstractBaseService<DeviceTypeMappe | @@ -24,7 +24,7 @@ public class TkDeviceTypeServiceImpl extends AbstractBaseService<DeviceTypeMappe | ||
24 | public List<DeviceTypeDTO> getDeviceTypeTree(String tenantId) { | 24 | public List<DeviceTypeDTO> getDeviceTypeTree(String tenantId) { |
25 | if (StringUtils.isEmpty(tenantId)) { | 25 | if (StringUtils.isEmpty(tenantId)) { |
26 | if (StringUtils.isEmpty(tenantId)) { | 26 | if (StringUtils.isEmpty(tenantId)) { |
27 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 27 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
28 | } | 28 | } |
29 | } | 29 | } |
30 | List<TkDeviceTypeEntity> typeList = baseMapper.selectList( | 30 | List<TkDeviceTypeEntity> typeList = baseMapper.selectList( |
@@ -6,13 +6,13 @@ import com.fasterxml.jackson.databind.node.ObjectNode; | @@ -6,13 +6,13 @@ import com.fasterxml.jackson.databind.node.ObjectNode; | ||
6 | import lombok.RequiredArgsConstructor; | 6 | import lombok.RequiredArgsConstructor; |
7 | import org.apache.commons.lang3.StringUtils; | 7 | import org.apache.commons.lang3.StringUtils; |
8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
9 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | 9 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
10 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 10 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
11 | import org.thingsboard.server.common.data.yunteng.core.utils.FrpServerProperties; | 11 | import org.thingsboard.server.common.data.yunteng.core.utils.FrpServerProperties; |
12 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; | 12 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
13 | import org.thingsboard.server.common.data.yunteng.dto.FrpInfoDTO; | 13 | import org.thingsboard.server.common.data.yunteng.dto.FrpInfoDTO; |
14 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; | 14 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; |
15 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | 15 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
16 | import org.thingsboard.server.dao.yunteng.entities.TkFrpInfoEntity; | 16 | import org.thingsboard.server.dao.yunteng.entities.TkFrpInfoEntity; |
17 | import org.thingsboard.server.dao.yunteng.mapper.FrpInfoMapper; | 17 | import org.thingsboard.server.dao.yunteng.mapper.FrpInfoMapper; |
18 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; | 18 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
@@ -31,7 +31,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | @@ -31,7 +31,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | ||
31 | private final FrpServerProperties frpServerProperties; | 31 | private final FrpServerProperties frpServerProperties; |
32 | 32 | ||
33 | @Override | 33 | @Override |
34 | - public YtPageData<FrpInfoDTO> page(Map<String, Object> queryMap) { | 34 | + public TkPageData<FrpInfoDTO> page(Map<String, Object> queryMap) { |
35 | String proxyName = | 35 | String proxyName = |
36 | queryMap.get("proxyName") != null ? queryMap.get("proxyName").toString() : null; | 36 | queryMap.get("proxyName") != null ? queryMap.get("proxyName").toString() : null; |
37 | IPage<TkFrpInfoEntity> frpInfoIPage = | 37 | IPage<TkFrpInfoEntity> frpInfoIPage = |
@@ -45,7 +45,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | @@ -45,7 +45,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | ||
45 | @Override | 45 | @Override |
46 | public FrpInfoDTO saveOrUpdateFrpInfo(FrpInfoDTO frpInfoDTO) { | 46 | public FrpInfoDTO saveOrUpdateFrpInfo(FrpInfoDTO frpInfoDTO) { |
47 | if (null == frpInfoDTO) { | 47 | if (null == frpInfoDTO) { |
48 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 48 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
49 | } | 49 | } |
50 | if (StringUtils.isEmpty(frpInfoDTO.getId())) { | 50 | if (StringUtils.isEmpty(frpInfoDTO.getId())) { |
51 | frpInfoDTO.setCreateTime(LocalDateTime.now()); | 51 | frpInfoDTO.setCreateTime(LocalDateTime.now()); |
@@ -59,7 +59,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | @@ -59,7 +59,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | ||
59 | .map(info -> baseMapper.updateById(frpInfoDTO.getEntity(TkFrpInfoEntity.class))) | 59 | .map(info -> baseMapper.updateById(frpInfoDTO.getEntity(TkFrpInfoEntity.class))) |
60 | .orElseThrow( | 60 | .orElseThrow( |
61 | () -> | 61 | () -> |
62 | - new YtDataValidationException( | 62 | + new TkDataValidationException( |
63 | ErrorMessage.INVALID_PARAMETER_OR_NOT_MATCH_TENANT.getMessage())); | 63 | ErrorMessage.INVALID_PARAMETER_OR_NOT_MATCH_TENANT.getMessage())); |
64 | } | 64 | } |
65 | return frpInfoDTO; | 65 | return frpInfoDTO; |
@@ -68,7 +68,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | @@ -68,7 +68,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | ||
68 | @Override | 68 | @Override |
69 | public boolean deleteFrpInfo(DeleteDTO deleteDTO) { | 69 | public boolean deleteFrpInfo(DeleteDTO deleteDTO) { |
70 | if (deleteDTO.getIds().isEmpty()) { | 70 | if (deleteDTO.getIds().isEmpty()) { |
71 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 71 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
72 | } | 72 | } |
73 | return baseMapper.deleteBatchIds(deleteDTO.getIds()) > 0; | 73 | return baseMapper.deleteBatchIds(deleteDTO.getIds()) > 0; |
74 | } | 74 | } |
@@ -76,7 +76,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | @@ -76,7 +76,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | ||
76 | @Override | 76 | @Override |
77 | public FrpInfoDTO findFrpInfoById(String id) { | 77 | public FrpInfoDTO findFrpInfoById(String id) { |
78 | if (StringUtils.isEmpty(id)) { | 78 | if (StringUtils.isEmpty(id)) { |
79 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 79 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
80 | } | 80 | } |
81 | TkFrpInfoEntity frpInfo = | 81 | TkFrpInfoEntity frpInfo = |
82 | baseMapper.selectOne(new LambdaQueryWrapper<TkFrpInfoEntity>().eq(TkFrpInfoEntity::getId, id)); | 82 | baseMapper.selectOne(new LambdaQueryWrapper<TkFrpInfoEntity>().eq(TkFrpInfoEntity::getId, id)); |
@@ -84,14 +84,14 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | @@ -84,14 +84,14 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | ||
84 | .map(info -> frpInfo.getDTO(FrpInfoDTO.class)) | 84 | .map(info -> frpInfo.getDTO(FrpInfoDTO.class)) |
85 | .orElseThrow( | 85 | .orElseThrow( |
86 | () -> | 86 | () -> |
87 | - new YtDataValidationException( | 87 | + new TkDataValidationException( |
88 | ErrorMessage.INVALID_PARAMETER_OR_NOT_MATCH_TENANT.getMessage())); | 88 | ErrorMessage.INVALID_PARAMETER_OR_NOT_MATCH_TENANT.getMessage())); |
89 | } | 89 | } |
90 | 90 | ||
91 | @Override | 91 | @Override |
92 | public FrpInfoDTO findFrpInfoByProxyName(String proxyName) { | 92 | public FrpInfoDTO findFrpInfoByProxyName(String proxyName) { |
93 | if (StringUtils.isEmpty(proxyName)) { | 93 | if (StringUtils.isEmpty(proxyName)) { |
94 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | 94 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
95 | } | 95 | } |
96 | TkFrpInfoEntity frpInfo = | 96 | TkFrpInfoEntity frpInfo = |
97 | baseMapper.selectOne( | 97 | baseMapper.selectOne( |
@@ -107,12 +107,12 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | @@ -107,12 +107,12 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF | ||
107 | Optional.ofNullable(content.get("user")) | 107 | Optional.ofNullable(content.get("user")) |
108 | .map(user -> content.get("user").get("run_id").asText()) | 108 | .map(user -> content.get("user").get("run_id").asText()) |
109 | .orElseThrow( | 109 | .orElseThrow( |
110 | - () -> new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | 110 | + () -> new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); |
111 | Integer remotePort = | 111 | Integer remotePort = |
112 | Optional.ofNullable(content.get("remote_port")) | 112 | Optional.ofNullable(content.get("remote_port")) |
113 | .map(remote -> content.get("remote_port").asInt()) | 113 | .map(remote -> content.get("remote_port").asInt()) |
114 | .orElseThrow( | 114 | .orElseThrow( |
115 | - () -> new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | 115 | + () -> new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); |
116 | 116 | ||
117 | FrpInfoDTO saveFrpInfoDTO = new FrpInfoDTO(); | 117 | FrpInfoDTO saveFrpInfoDTO = new FrpInfoDTO(); |
118 | if (null == queryFrpInfoDTO) { | 118 | if (null == queryFrpInfoDTO) { |