Showing
159 changed files
with
644 additions
and
664 deletions
... | ... | @@ -920,7 +920,7 @@ public abstract class BaseController { |
920 | 920 | if(transportType ==null || DeviceTransportType.DEFAULT.name().equals(transportType)){ |
921 | 921 | deviceProfileData.setTransportConfiguration(new DefaultDeviceProfileTransportConfiguration()); |
922 | 922 | }else if(DeviceTransportType.TCP.name().equals(transportType)){ |
923 | - YtTcpDeviceProfileTransportConfiguration tcpDeviceProfileTransportConfiguration = (YtTcpDeviceProfileTransportConfiguration) deviceProfileData.getTransportConfiguration(); | |
923 | + TkTcpDeviceProfileTransportConfiguration tcpDeviceProfileTransportConfiguration = (TkTcpDeviceProfileTransportConfiguration) deviceProfileData.getTransportConfiguration(); | |
924 | 924 | tcpDeviceProfileTransportConfiguration.setScriptText(scriptText); |
925 | 925 | deviceProfileData.setTransportConfiguration(tcpDeviceProfileTransportConfiguration); |
926 | 926 | }else{ | ... | ... |
... | ... | @@ -11,7 +11,7 @@ import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.dto.AlarmProfileDTO; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
13 | 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 | 15 | import org.thingsboard.server.controller.BaseController; |
16 | 16 | import org.thingsboard.server.dao.yunteng.service.AlarmProfileService; |
17 | 17 | |
... | ... | @@ -32,7 +32,7 @@ public class AlarmProfileController extends BaseController { |
32 | 32 | |
33 | 33 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
34 | 34 | @ApiOperation("分页") |
35 | - public YtPageData<AlarmProfileDTO> pageAlarmProfile( | |
35 | + public TkPageData<AlarmProfileDTO> pageAlarmProfile( | |
36 | 36 | @RequestParam(PAGE_SIZE) int pageSize, |
37 | 37 | @RequestParam(PAGE) int page, |
38 | 38 | @RequestParam(value = "status", required = false) Integer status, | ... | ... |
... | ... | @@ -16,9 +16,8 @@ import org.thingsboard.server.common.data.yunteng.dto.HomePageLeftTopDTO; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.dto.TenantTransportMessageDTO; |
18 | 18 | import org.thingsboard.server.common.data.yunteng.dto.statistics.HomePageAppDTO; |
19 | -import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; | |
20 | 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 | 21 | import org.thingsboard.server.controller.BaseController; |
23 | 22 | import org.thingsboard.server.dao.exception.DataValidationException; |
24 | 23 | import org.thingsboard.server.dao.yunteng.service.HomePageService; |
... | ... | @@ -54,7 +53,7 @@ public class HomePageController extends BaseController { |
54 | 53 | @GetMapping("right/overdue") |
55 | 54 | @ApiOperation(value = "获取右侧过期租户信息") |
56 | 55 | @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{})") |
57 | - public ResponseEntity<YtPageData<TenantDTO>> getRightTopInfo( | |
56 | + public ResponseEntity<TkPageData<TenantDTO>> getRightTopInfo( | |
58 | 57 | @RequestParam(PAGE) int page, @RequestParam(PAGE_SIZE) int pageSize) { |
59 | 58 | HashMap<String, Object> queryMap = new HashMap<>(); |
60 | 59 | queryMap.put(PAGE_SIZE, pageSize); | ... | ... |
... | ... | @@ -12,13 +12,13 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
14 | 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 | 16 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
18 | 18 | import org.thingsboard.server.common.data.yunteng.dto.SysJobDTO; |
19 | 19 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
20 | 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 | import org.thingsboard.server.controller.BaseController; |
23 | 23 | import org.thingsboard.server.dao.util.yunteng.CronUtils; |
24 | 24 | import org.thingsboard.server.dao.util.yunteng.ScheduleUtils; |
... | ... | @@ -43,7 +43,7 @@ public class SysJobController extends BaseController { |
43 | 43 | path = "/page", |
44 | 44 | params = {PAGE_SIZE, PAGE}) |
45 | 45 | @ApiOperation(value = "分页") |
46 | - public YtPageData<SysJobDTO> pageJob( | |
46 | + public TkPageData<SysJobDTO> pageJob( | |
47 | 47 | @RequestParam(PAGE_SIZE) int pageSize, |
48 | 48 | @RequestParam(PAGE) int page, |
49 | 49 | @RequestParam(value = "jobName", required = false) String jobName, |
... | ... | @@ -91,7 +91,7 @@ public class SysJobController extends BaseController { |
91 | 91 | public ResponseResult<Boolean> run(@PathVariable("id") String id) throws SchedulerException { |
92 | 92 | SysJobDTO jobDTO = jobService.selectJobById(id); |
93 | 93 | if(null == jobDTO){ |
94 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | |
94 | + throw new TkDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | |
95 | 95 | } |
96 | 96 | boolean result = jobService.run(jobDTO); |
97 | 97 | return ResponseResult.success( |
... | ... | @@ -104,7 +104,7 @@ public class SysJobController extends BaseController { |
104 | 104 | public ResponseResult<SysJobDTO> save(@RequestBody @Validated(AddGroup.class) SysJobDTO job) |
105 | 105 | throws SchedulerException, ThingsboardException { |
106 | 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 | 109 | return saveOrUpdate(job); |
110 | 110 | } |
... | ... | @@ -115,7 +115,7 @@ public class SysJobController extends BaseController { |
115 | 115 | public ResponseResult<SysJobDTO> update(@RequestBody @Validated(UpdateGroup.class) SysJobDTO job) |
116 | 116 | throws SchedulerException, ThingsboardException { |
117 | 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 | 120 | return saveOrUpdate(job); |
121 | 121 | } |
... | ... | @@ -125,7 +125,7 @@ public class SysJobController extends BaseController { |
125 | 125 | @ApiOperation(value = "校验cron表达式是否有效") |
126 | 126 | public boolean checkCronExpressionIsValid(@PathVariable("cronExpression") String cronExpression) { |
127 | 127 | if (StringUtils.isEmpty(cronExpression)) { |
128 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
128 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
129 | 129 | } |
130 | 130 | return jobService.checkCronExpressionIsValid(cronExpression); |
131 | 131 | } |
... | ... | @@ -136,7 +136,7 @@ public class SysJobController extends BaseController { |
136 | 136 | @ApiOperation(value = "查询cron表达式近5次的执行时间") |
137 | 137 | public ResponseResult queryCronExpression(@PathVariable("cronExpression") String cronExpression) { |
138 | 138 | if (!jobService.checkCronExpressionIsValid(cronExpression)) { |
139 | - throw new YtDataValidationException(ErrorMessage.CRON_INVALID.getMessage()); | |
139 | + throw new TkDataValidationException(ErrorMessage.CRON_INVALID.getMessage()); | |
140 | 140 | } |
141 | 141 | List<String> dateList = CronUtils.getRecentTriggerTime(cronExpression); |
142 | 142 | return ResponseResult.success(dateList); |
... | ... | @@ -146,28 +146,28 @@ public class SysJobController extends BaseController { |
146 | 146 | throws SchedulerException{ |
147 | 147 | String message = StringUtils.isEmpty(job.getId()) ? "新增任务'" : "修改任务'"; |
148 | 148 | if (!CronUtils.isValid(job.getCronExpression())) { |
149 | - throw new YtDataValidationException(message + job.getJobName() + "'失败,Cron表达式不正确"); | |
149 | + throw new TkDataValidationException(message + job.getJobName() + "'失败,Cron表达式不正确"); | |
150 | 150 | } else if (StringUtils.containsIgnoreCase( |
151 | 151 | job.getInvokeTarget(), FastIotConstants.ScheduleConstants.LOOKUP_RMI)) { |
152 | - throw new YtDataValidationException(message + job.getJobName() + "'失败,目标字符串不允许'rmi'调用"); | |
152 | + throw new TkDataValidationException(message + job.getJobName() + "'失败,目标字符串不允许'rmi'调用"); | |
153 | 153 | } else if (ScheduleUtils.containsAnyIgnoreCase( |
154 | 154 | job.getInvokeTarget(), |
155 | 155 | new String[] { |
156 | 156 | FastIotConstants.ScheduleConstants.LOOKUP_LDAP, |
157 | 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 | 160 | } else if (ScheduleUtils.containsAnyIgnoreCase( |
161 | 161 | job.getInvokeTarget(), |
162 | 162 | new String[] { |
163 | 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 | 166 | } else if (ScheduleUtils.containsAnyIgnoreCase( |
167 | 167 | job.getInvokeTarget(), FastIotConstants.ScheduleConstants.JOB_ERROR_STR)) { |
168 | - throw new YtDataValidationException(message + job.getJobName() + "'失败,目标字符串存在违规"); | |
168 | + throw new TkDataValidationException(message + job.getJobName() + "'失败,目标字符串存在违规"); | |
169 | 169 | } else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) { |
170 | - throw new YtDataValidationException(message + job.getJobName() + "'失败,目标字符串不在白名单内"); | |
170 | + throw new TkDataValidationException(message + job.getJobName() + "'失败,目标字符串不在白名单内"); | |
171 | 171 | } |
172 | 172 | return ResponseResult.success(jobService.saveOrUpdateJob(job)); |
173 | 173 | } | ... | ... |
... | ... | @@ -11,7 +11,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.dto.SysJobLogDTO; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
13 | 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 | 15 | import org.thingsboard.server.controller.BaseController; |
16 | 16 | import org.thingsboard.server.dao.yunteng.service.TkSysJobLogService; |
17 | 17 | |
... | ... | @@ -37,7 +37,7 @@ public class SysJobLogController extends BaseController { |
37 | 37 | path = "/page", |
38 | 38 | params = {PAGE_SIZE, PAGE}) |
39 | 39 | @ApiOperation(value = "分页") |
40 | - public YtPageData<SysJobLogDTO> page( | |
40 | + public TkPageData<SysJobLogDTO> page( | |
41 | 41 | @RequestParam(PAGE_SIZE) int pageSize, |
42 | 42 | @RequestParam(PAGE) int page, |
43 | 43 | @RequestParam(value = "jobName", required = false) String jobName, | ... | ... |
... | ... | @@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
15 | 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 | 17 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
18 | 18 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
19 | 19 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; |
... | ... | @@ -21,7 +21,7 @@ import org.thingsboard.server.common.data.yunteng.dto.ThingsModelDTO; |
21 | 21 | import org.thingsboard.server.common.data.yunteng.enums.FunctionTypeEnum; |
22 | 22 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
23 | 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 | 25 | import org.thingsboard.server.controller.BaseController; |
26 | 26 | import org.thingsboard.server.dao.yunteng.service.ThingsModelService; |
27 | 27 | import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; |
... | ... | @@ -44,7 +44,7 @@ public class ThingsModelController extends BaseController { |
44 | 44 | path = "/page", |
45 | 45 | params = {PAGE_SIZE, PAGE}) |
46 | 46 | @ApiOperation(value = "分页") |
47 | - public YtPageData<ThingsModelDTO> page( | |
47 | + public TkPageData<ThingsModelDTO> page( | |
48 | 48 | @RequestParam("deviceProfileId") String deviceProfileId, |
49 | 49 | @RequestParam(PAGE_SIZE) int pageSize, |
50 | 50 | @RequestParam(PAGE) int page, |
... | ... | @@ -54,7 +54,7 @@ public class ThingsModelController extends BaseController { |
54 | 54 | @RequestParam(value = ORDER_TYPE, required = false) OrderTypeEnum orderType) |
55 | 55 | throws ThingsboardException { |
56 | 56 | if (StringUtils.isEmpty(deviceProfileId)) { |
57 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
57 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
58 | 58 | } |
59 | 59 | HashMap<String, Object> queryMap = new HashMap<>(); |
60 | 60 | queryMap.put("nameOrIdentifier", nameOrIdentifier); |
... | ... | @@ -117,7 +117,7 @@ public class ThingsModelController extends BaseController { |
117 | 117 | String tenantId = getCurrentUser().getCurrentTenantId(); |
118 | 118 | DeviceProfileDTO dto = tkDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); |
119 | 119 | if (null == dto) { |
120 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
120 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
121 | 121 | } |
122 | 122 | return ResponseEntity.ok( |
123 | 123 | thingsModelService.changeTSLStatus( |
... | ... | @@ -131,7 +131,7 @@ public class ThingsModelController extends BaseController { |
131 | 131 | String tenantId = getCurrentUser().getCurrentTenantId(); |
132 | 132 | DeviceProfileDTO dto = tkDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); |
133 | 133 | if (null == dto) { |
134 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
134 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
135 | 135 | } |
136 | 136 | return ResponseEntity.ok( |
137 | 137 | thingsModelService.selectByDeviceProfileId( |
... | ... | @@ -144,7 +144,7 @@ public class ThingsModelController extends BaseController { |
144 | 144 | DeviceProfileDTO deviceProfileDTO = |
145 | 145 | tkDeviceProfileService.findDeviceProfileById(tenantId, thingsModelDTO.getDeviceProfileId()); |
146 | 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 | 149 | thingsModelDTO.setTenantId(tenantId); |
150 | 150 | return thingsModelService.saveOrUpdate(thingsModelDTO); | ... | ... |
... | ... | @@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; |
26 | 26 | import org.thingsboard.server.common.data.yunteng.dto.UserDTO; |
27 | 27 | import org.thingsboard.server.common.data.yunteng.dto.request.TenantReqDTO; |
28 | 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 | 30 | import org.thingsboard.server.controller.BaseController; |
31 | 31 | import org.thingsboard.server.dao.tenant.TenantService; |
32 | 32 | import org.thingsboard.server.dao.user.UserService; |
... | ... | @@ -75,7 +75,7 @@ public class TkAdminController extends BaseController { |
75 | 75 | @GetMapping( |
76 | 76 | path = "tenant/page", |
77 | 77 | params = {PAGE_SIZE, PAGE}) |
78 | - public YtPageData<TenantDTO> pageUser( | |
78 | + public TkPageData<TenantDTO> pageUser( | |
79 | 79 | @RequestParam(PAGE_SIZE) int pageSize, |
80 | 80 | @RequestParam(PAGE) int page, |
81 | 81 | @RequestParam(value = "tenantName", required = false) String tenantName, | ... | ... |
... | ... | @@ -13,11 +13,11 @@ import org.springframework.web.servlet.support.ServletUriComponentsBuilder; |
13 | 13 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
15 | 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 | 17 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
18 | 18 | import org.thingsboard.server.common.data.yunteng.dto.AlarmContactDTO; |
19 | 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 | 21 | import org.thingsboard.server.controller.BaseController; |
22 | 22 | import org.thingsboard.server.dao.yunteng.service.AlarmProfileService; |
23 | 23 | import org.thingsboard.server.dao.yunteng.service.TkAlarmContactService; |
... | ... | @@ -87,7 +87,7 @@ public class TkAlarmContactController extends BaseController { |
87 | 87 | @ApiOperation(value = "分页查询") |
88 | 88 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") |
89 | 89 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
90 | - public YtPageData<AlarmContactDTO> pageAlarm( | |
90 | + public TkPageData<AlarmContactDTO> pageAlarm( | |
91 | 91 | @RequestParam(PAGE_SIZE) int pageSize, |
92 | 92 | @RequestParam(PAGE) int page, |
93 | 93 | @RequestParam(value = "username", required = false) String username, |
... | ... | @@ -115,7 +115,7 @@ public class TkAlarmContactController extends BaseController { |
115 | 115 | "@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{'api:yt:alarmContact:delete'})") |
116 | 116 | public void deleteById(@RequestBody String[] ids) throws ThingsboardException { |
117 | 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 | 121 | for (String id : ids) { |
... | ... | @@ -125,7 +125,7 @@ public class TkAlarmContactController extends BaseController { |
125 | 125 | if (null != list && list.size() > FastIotConstants.MagicNumber.ZERO) { |
126 | 126 | StringBuilder configName = new StringBuilder(); |
127 | 127 | list.forEach(i -> configName.append("," + i.getName())); |
128 | - throw new YtDataValidationException( | |
128 | + throw new TkDataValidationException( | |
129 | 129 | String.format( |
130 | 130 | ErrorMessage.CONTACT_ALREADY_ASSOCIATED.getMessage(), configName.substring(1))); |
131 | 131 | } | ... | ... |
... | ... | @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
18 | 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 | 20 | import org.thingsboard.server.controller.BaseController; |
21 | 21 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmEntity; |
22 | 22 | import org.thingsboard.server.dao.yunteng.service.TkAlarmInfoService; |
... | ... | @@ -46,7 +46,7 @@ public class TkAlarmInfoController extends BaseController { |
46 | 46 | @ApiOperation(value = "查询") |
47 | 47 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") |
48 | 48 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
49 | - public YtPageData<TkAlarmEntity> pageAlarmInfo( | |
49 | + public TkPageData<TkAlarmEntity> pageAlarmInfo( | |
50 | 50 | @RequestParam(PAGE_SIZE) int pageSize, |
51 | 51 | @RequestParam(PAGE) int page, |
52 | 52 | @RequestParam(value = "status", required = false) List<AlarmStatus> status, | ... | ... |
... | ... | @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.dto.ConfigurationCenterDTO; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.dto.request.ConfigurationContentInfoDTO; |
18 | 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 | 20 | import org.thingsboard.server.controller.BaseController; |
21 | 21 | import org.thingsboard.server.dao.yunteng.service.TkConfigurationCenterService; |
22 | 22 | |
... | ... | @@ -35,7 +35,7 @@ public class TkConfigurationCenterController extends BaseController { |
35 | 35 | |
36 | 36 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
37 | 37 | @ApiOperation("分页") |
38 | - public YtPageData<ConfigurationCenterDTO> page( | |
38 | + public TkPageData<ConfigurationCenterDTO> page( | |
39 | 39 | @RequestParam(PAGE_SIZE) int pageSize, |
40 | 40 | @RequestParam(PAGE) int page, |
41 | 41 | @RequestParam(value = "name", required = false) String name, | ... | ... |
... | ... | @@ -22,14 +22,14 @@ import org.thingsboard.server.common.data.rule.*; |
22 | 22 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
23 | 23 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
24 | 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 | 26 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
27 | 27 | import org.thingsboard.server.common.data.yunteng.dto.ConvertConfigDTO; |
28 | 28 | import org.thingsboard.server.common.data.yunteng.dto.ConvertConfigReqDTO; |
29 | 29 | import org.thingsboard.server.common.data.yunteng.dto.ConvertReqDTO; |
30 | 30 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
31 | 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 | 33 | import org.thingsboard.server.controller.BaseController; |
34 | 34 | import org.thingsboard.server.dao.yunteng.service.ConvertConfigService; |
35 | 35 | import org.thingsboard.server.dao.yunteng.service.SceneLinkageService; |
... | ... | @@ -63,7 +63,7 @@ public class TkConvertDataToController extends BaseController { |
63 | 63 | |
64 | 64 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
65 | 65 | @ApiOperation("分页查询") |
66 | - public YtPageData<ConvertConfigDTO> pageMessageConfig( | |
66 | + public TkPageData<ConvertConfigDTO> pageMessageConfig( | |
67 | 67 | @RequestParam(PAGE_SIZE) int pageSize, |
68 | 68 | @RequestParam(PAGE) int page, |
69 | 69 | @ApiParam(value = "0:转换脚本 1:数据流转") @RequestParam(value = "nodeType") Integer nodeType, |
... | ... | @@ -113,7 +113,7 @@ public class TkConvertDataToController extends BaseController { |
113 | 113 | String type = checkParam.get("type"); |
114 | 114 | String name = checkParam.get("name"); |
115 | 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 | 118 | return ResponseEntity.ok( |
119 | 119 | convertConfigService.checkConvertConfigNameExist( |
... | ... | @@ -145,7 +145,7 @@ public class TkConvertDataToController extends BaseController { |
145 | 145 | convertConfigReqDTO.getConvertIds(), |
146 | 146 | convertConfigReqDTO.getStatus(), |
147 | 147 | getCurrentUser().getCurrentTenantId())) { |
148 | - throw new YtDataValidationException(ErrorMessage.DATA_ALREADY_EXISTS.getMessage()); | |
148 | + throw new TkDataValidationException(ErrorMessage.DATA_ALREADY_EXISTS.getMessage()); | |
149 | 149 | } |
150 | 150 | List<String> ids = convertConfigReqDTO.getConvertIds(); |
151 | 151 | int status = convertConfigReqDTO.getStatus(); |
... | ... | @@ -169,7 +169,7 @@ public class TkConvertDataToController extends BaseController { |
169 | 169 | int status = convertJSReqDTO.getStatus(); |
170 | 170 | if (status == FastIotConstants.StateValue.ENABLE |
171 | 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 | 174 | List<String> ids = new ArrayList<>(); |
175 | 175 | ids.add(convertJSReqDTO.getId()); | ... | ... |
... | ... | @@ -12,14 +12,14 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
14 | 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 | 16 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.dto.DataBoardDTO; |
18 | 18 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
19 | 19 | import org.thingsboard.server.common.data.yunteng.dto.board.ComponentLayoutDTO; |
20 | 20 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
21 | 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 | 23 | import org.thingsboard.server.controller.BaseController; |
24 | 24 | import org.thingsboard.server.dao.yunteng.service.TkDataBoardService; |
25 | 25 | |
... | ... | @@ -39,7 +39,7 @@ public class TkDataBoardController extends BaseController { |
39 | 39 | |
40 | 40 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
41 | 41 | @ApiOperation("分页查询") |
42 | - public YtPageData<DataBoardDTO> page( | |
42 | + public TkPageData<DataBoardDTO> page( | |
43 | 43 | @RequestParam(PAGE_SIZE) int pageSize, |
44 | 44 | @RequestParam(PAGE) int page, |
45 | 45 | @RequestParam(value = ORDER_FILED, required = false) String orderBy, |
... | ... | @@ -79,7 +79,7 @@ public class TkDataBoardController extends BaseController { |
79 | 79 | @RequestBody @Validated(AddGroup.class) DataBoardDTO dataBoard) |
80 | 80 | throws SchedulerException, ThingsboardException { |
81 | 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 | 84 | return saveOrUpdate(dataBoard); |
85 | 85 | } |
... | ... | @@ -91,7 +91,7 @@ public class TkDataBoardController extends BaseController { |
91 | 91 | @RequestBody @Validated(UpdateGroup.class) DataBoardDTO dataBoard) |
92 | 92 | throws SchedulerException, ThingsboardException { |
93 | 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 | 96 | return saveOrUpdate(dataBoard); |
97 | 97 | } | ... | ... |
... | ... | @@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
15 | 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 | 17 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
18 | 18 | import org.thingsboard.server.common.data.yunteng.dto.DataBoardDTO; |
19 | 19 | import org.thingsboard.server.common.data.yunteng.dto.DataComponentDTO; |
... | ... | @@ -62,7 +62,7 @@ public class TkDataComponentController extends BaseController { |
62 | 62 | @RequestBody @Validated(AddGroup.class) DataComponentDTO dataComponent) |
63 | 63 | throws SchedulerException, ThingsboardException { |
64 | 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 | 67 | String tenantId = getCurrentUser().getCurrentTenantId(); |
68 | 68 | checkDataBoardInfo(boardId); |
... | ... | @@ -80,7 +80,7 @@ public class TkDataComponentController extends BaseController { |
80 | 80 | || null == defaultLayout.getW() |
81 | 81 | || null == defaultLayout.getX() |
82 | 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 | 86 | listLayout.add(defaultLayout); |
... | ... | @@ -97,7 +97,7 @@ public class TkDataComponentController extends BaseController { |
97 | 97 | @RequestBody @Validated(UpdateGroup.class) DataComponentDTO dataComponent) |
98 | 98 | throws SchedulerException, ThingsboardException { |
99 | 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 | 102 | checkDataBoardInfo(boardId); |
103 | 103 | dataComponent.setDataBoardId(boardId); |
... | ... | @@ -118,7 +118,7 @@ public class TkDataComponentController extends BaseController { |
118 | 118 | |
119 | 119 | DataBoardDTO dataBoardDTO = ytDataBoardService.findDataBoardInfoById(dataBoardId, tenantId); |
120 | 120 | if (null == dataBoardDTO) { |
121 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
121 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
122 | 122 | } |
123 | 123 | int deleteNum = ytDataComponentService.deleteDataComponent(deleteDTO); |
124 | 124 | |
... | ... | @@ -156,7 +156,7 @@ public class TkDataComponentController extends BaseController { |
156 | 156 | DataBoardDTO dto = |
157 | 157 | ytDataBoardService.findDataBoardInfoById(boardId, getCurrentUser().getCurrentTenantId()); |
158 | 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 | 161 | return dto; |
162 | 162 | } | ... | ... |
... | ... | @@ -28,7 +28,7 @@ import org.thingsboard.server.common.data.security.DeviceCredentials; |
28 | 28 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
29 | 29 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
30 | 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 | 32 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
33 | 33 | import org.thingsboard.server.common.data.yunteng.dto.*; |
34 | 34 | import org.thingsboard.server.common.data.yunteng.enums.DataTypeEnum; |
... | ... | @@ -36,7 +36,7 @@ import org.thingsboard.server.common.data.yunteng.enums.DeviceState; |
36 | 36 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
37 | 37 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
38 | 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 | 40 | import org.thingsboard.server.controller.BaseController; |
41 | 41 | import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; |
42 | 42 | import org.thingsboard.server.dao.yunteng.service.TkDeviceService; |
... | ... | @@ -80,7 +80,7 @@ public class TkDeviceController extends BaseController { |
80 | 80 | tkdeviceService.checkDeviceByTenantIdAndDeviceId( |
81 | 81 | getCurrentUser().getCurrentTenantId(), gatewayId); |
82 | 82 | if (null == gateWay) { |
83 | - throw new YtDataValidationException( | |
83 | + throw new TkDataValidationException( | |
84 | 84 | ErrorMessage.DEVICE_NOT_EXISTENCE_IN_TENANT.getMessage()); |
85 | 85 | } |
86 | 86 | } |
... | ... | @@ -210,7 +210,7 @@ public class TkDeviceController extends BaseController { |
210 | 210 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") |
211 | 211 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
212 | 212 | @ApiOperation("查询") |
213 | - public YtPageData<DeviceDTO> pageDevice( | |
213 | + public TkPageData<DeviceDTO> pageDevice( | |
214 | 214 | @RequestParam(PAGE_SIZE) int pageSize, |
215 | 215 | @RequestParam(PAGE) int page, |
216 | 216 | @RequestParam(value = "name", required = false) String name, |
... | ... | @@ -257,7 +257,7 @@ public class TkDeviceController extends BaseController { |
257 | 257 | path = {"/relation"}, |
258 | 258 | params = {PAGE_SIZE, PAGE}) |
259 | 259 | @ApiOperation("子设备查询") |
260 | - public YtPageData<RelationDeviceDTO> pageRelationDevice( | |
260 | + public TkPageData<RelationDeviceDTO> pageRelationDevice( | |
261 | 261 | @RequestParam(PAGE_SIZE) int pageSize, |
262 | 262 | @RequestParam(PAGE) int page, |
263 | 263 | @RequestParam(value = "name", required = false) String name, |
... | ... | @@ -516,7 +516,7 @@ public class TkDeviceController extends BaseController { |
516 | 516 | String tenantId = getCurrentUser().getCurrentTenantId(); |
517 | 517 | DeviceProfileDTO dto = ytDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); |
518 | 518 | if (null == dto) { |
519 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
519 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
520 | 520 | } |
521 | 521 | return ResponseEntity.ok( |
522 | 522 | tkdeviceService.getDeviceAttributes(deviceProfileId, tenantId, dataType)); | ... | ... |
... | ... | @@ -24,15 +24,15 @@ import org.thingsboard.server.common.data.plugin.ComponentLifecycleEvent; |
24 | 24 | import org.thingsboard.server.common.data.rule.RuleChain; |
25 | 25 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
26 | 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 | 28 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
29 | 29 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
30 | 30 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; |
31 | 31 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
32 | 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 | 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 | 36 | import org.thingsboard.server.controller.BaseController; |
37 | 37 | import org.thingsboard.server.dao.yunteng.service.TkDeviceScriptService; |
38 | 38 | import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; |
... | ... | @@ -95,7 +95,7 @@ public class TkDeviceProfileController extends BaseController { |
95 | 95 | } |
96 | 96 | if (FastIotConstants.ASSERT_DEFAULT_NAME.equals(oldDeviceProfile.getName()) |
97 | 97 | && !Objects.equals(deviceProfile.getName(), oldDeviceProfile.getName())) { |
98 | - throw new YtDataValidationException( | |
98 | + throw new TkDataValidationException( | |
99 | 99 | ErrorMessage.ASSERT_DEFAULT_NAME_NO_CHANGED.getMessage()); |
100 | 100 | } |
101 | 101 | } |
... | ... | @@ -138,7 +138,7 @@ public class TkDeviceProfileController extends BaseController { |
138 | 138 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
139 | 139 | @ApiOperation("查询") |
140 | 140 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") |
141 | - public YtPageData<DeviceProfileDTO> pageDeviceProfile( | |
141 | + public TkPageData<DeviceProfileDTO> pageDeviceProfile( | |
142 | 142 | @RequestParam(PAGE_SIZE) int pageSize, |
143 | 143 | @RequestParam(PAGE) int page, |
144 | 144 | @RequestParam(value = "name", required = false) String name, |
... | ... | @@ -276,7 +276,7 @@ public class TkDeviceProfileController extends BaseController { |
276 | 276 | ruleChainService.findRuleChainById(TenantId.SYS_TENANT_ID, new RuleChainId(chainId)); |
277 | 277 | if (chain == null |
278 | 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 | 281 | tbDeviceProfile.setDefaultRuleChainId(new RuleChainId(chainId)); |
282 | 282 | } |
... | ... | @@ -294,8 +294,8 @@ public class TkDeviceProfileController extends BaseController { |
294 | 294 | } |
295 | 295 | |
296 | 296 | if (DeviceTransportType.TCP.name().equals(transportType)) { |
297 | - YtTcpDeviceProfileTransportConfiguration tcpDeviceProfileTransportConfiguration = | |
298 | - (YtTcpDeviceProfileTransportConfiguration) | |
297 | + TkTcpDeviceProfileTransportConfiguration tcpDeviceProfileTransportConfiguration = | |
298 | + (TkTcpDeviceProfileTransportConfiguration) | |
299 | 299 | deviceProfileDTO.getProfileData().getTransportConfiguration(); |
300 | 300 | String scriptId = tcpDeviceProfileTransportConfiguration.getScriptId(); |
301 | 301 | scriptText = javaScriptService.getScriptText(deviceProfileDTO.getTenantId(), scriptId); |
... | ... | @@ -303,7 +303,7 @@ public class TkDeviceProfileController extends BaseController { |
303 | 303 | } |
304 | 304 | |
305 | 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 | 307 | return tbDeviceProfile; |
308 | 308 | } |
309 | 309 | } | ... | ... |
... | ... | @@ -30,17 +30,17 @@ import org.thingsboard.server.common.data.id.TenantId; |
30 | 30 | import org.thingsboard.server.common.data.plugin.ComponentLifecycleEvent; |
31 | 31 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
32 | 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 | 34 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
35 | 35 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
36 | 36 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; |
37 | 37 | import org.thingsboard.server.common.data.yunteng.dto.TkDeviceScriptDTO; |
38 | 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 | 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 | 44 | import org.thingsboard.server.controller.BaseController; |
45 | 45 | import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; |
46 | 46 | import org.thingsboard.server.dao.yunteng.service.TkDeviceScriptService; |
... | ... | @@ -62,7 +62,7 @@ public class TkDeviceScriptController extends BaseController { |
62 | 62 | private static final ObjectMapper objectMapper = new ObjectMapper(); |
63 | 63 | private final TkDeviceScriptService scriptService; |
64 | 64 | private final TkDeviceProfileService ytDeviceProfileService; |
65 | - private final YtScriptInvokeService jsEngine; | |
65 | + private final TkScriptInvokeService jsEngine; | |
66 | 66 | |
67 | 67 | @PostMapping() |
68 | 68 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN'},{'api:yt:js:post','api:yt:js:update'})") |
... | ... | @@ -94,7 +94,7 @@ public class TkDeviceScriptController extends BaseController { |
94 | 94 | if(scriptDTO ==null || scriptDTO.getStatus().equals(status)){ |
95 | 95 | return ResponseEntity.ok(false); |
96 | 96 | } |
97 | - String convertJs = YtScriptFactory.INCLUD_ORIGINAL_DATA; | |
97 | + String convertJs = TkScriptFactory.INCLUD_ORIGINAL_DATA; | |
98 | 98 | |
99 | 99 | if(1 == status){ |
100 | 100 | if(scriptDTO.isSaveOriginalData()){ |
... | ... | @@ -135,7 +135,7 @@ public class TkDeviceScriptController extends BaseController { |
135 | 135 | } |
136 | 136 | if (FastIotConstants.ASSERT_DEFAULT_NAME.equals(oldDeviceProfile.getName()) |
137 | 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 | 141 | DeviceProfile savedDeviceProfile = |
... | ... | @@ -166,7 +166,7 @@ public class TkDeviceScriptController extends BaseController { |
166 | 166 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
167 | 167 | @ApiOperation("分页查询") |
168 | 168 | @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})") |
169 | - public YtPageData<TkDeviceScriptDTO> pageDeviceScript( | |
169 | + public TkPageData<TkDeviceScriptDTO> pageDeviceScript( | |
170 | 170 | @RequestParam(PAGE_SIZE) int pageSize, |
171 | 171 | @RequestParam(PAGE) int page, |
172 | 172 | @RequestParam(value = ORDER_FILED, required = false) String orderFiled, |
... | ... | @@ -188,7 +188,7 @@ public class TkDeviceScriptController extends BaseController { |
188 | 188 | } |
189 | 189 | if(null != startTime && null!=endTime){ |
190 | 190 | if (startTime > endTime) { |
191 | - throw new YtDataValidationException( | |
191 | + throw new TkDataValidationException( | |
192 | 192 | ErrorMessage.START_TIME_NOT_MORE_THAN_END_TIME.getMessage()); |
193 | 193 | } |
194 | 194 | queryMap.put("startTime", new Timestamp(startTime).toLocalDateTime()); |
... | ... | @@ -228,7 +228,7 @@ public class TkDeviceScriptController extends BaseController { |
228 | 228 | String errorText = ""; |
229 | 229 | ScriptEngine engine = null; |
230 | 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 | 232 | ListenableFuture<String> result = |
233 | 233 | Futures.transformAsync( |
234 | 234 | jsEngine.invokeFunction(scriptId, jsParam), | ... | ... |
... | ... | @@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
15 | 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 | 17 | import org.thingsboard.server.controller.BaseController; |
18 | 18 | import org.thingsboard.server.dao.yunteng.service.SysDictService; |
19 | 19 | |
... | ... | @@ -29,7 +29,7 @@ public class TkDictController extends BaseController { |
29 | 29 | private final SysDictService sysDictService; |
30 | 30 | |
31 | 31 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
32 | - public YtPageData<SysDictDTO> pageSysDict( | |
32 | + public TkPageData<SysDictDTO> pageSysDict( | |
33 | 33 | @RequestParam(PAGE_SIZE) int pageSize, |
34 | 34 | @RequestParam(PAGE) int page, |
35 | 35 | @RequestParam(value = "dictName", required = false) String dictName, | ... | ... |
... | ... | @@ -14,7 +14,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.dto.SysDictItemDTO; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
16 | 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 | 18 | import org.thingsboard.server.controller.BaseController; |
19 | 19 | import org.thingsboard.server.dao.yunteng.service.SysDictItemService; |
20 | 20 | |
... | ... | @@ -32,7 +32,7 @@ public class TkDictItemController extends BaseController { |
32 | 32 | |
33 | 33 | @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{})") |
34 | 34 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
35 | - public YtPageData<SysDictItemDTO> pageSysDictItem( | |
35 | + public TkPageData<SysDictItemDTO> pageSysDictItem( | |
36 | 36 | @RequestParam(PAGE_SIZE) int pageSize, |
37 | 37 | @RequestParam(PAGE) int page, |
38 | 38 | @RequestParam(value = "dictId", required = false) String dictId, | ... | ... |
... | ... | @@ -7,7 +7,7 @@ import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
7 | 7 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
8 | 8 | import org.thingsboard.server.common.data.yunteng.dto.MailLogDTO; |
9 | 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 | 11 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
12 | 12 | import org.thingsboard.server.controller.BaseController; |
13 | 13 | import org.thingsboard.server.dao.yunteng.service.TkMailLogService; |
... | ... | @@ -24,7 +24,7 @@ public class TkMailLogController extends BaseController { |
24 | 24 | private final TkMailLogService mailLogService; |
25 | 25 | |
26 | 26 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
27 | - public YtPageData<MailLogDTO> pageMessageConfig( | |
27 | + public TkPageData<MailLogDTO> pageMessageConfig( | |
28 | 28 | @RequestParam(PAGE_SIZE) int pageSize, |
29 | 29 | @RequestParam(PAGE) int page, |
30 | 30 | @RequestParam(value = "emailSubject", required = false) String emailSubject, | ... | ... |
... | ... | @@ -8,7 +8,7 @@ import org.springframework.util.Assert; |
8 | 8 | import org.springframework.web.bind.annotation.*; |
9 | 9 | import org.springframework.web.servlet.support.ServletUriComponentsBuilder; |
10 | 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 | 12 | import org.thingsboard.server.common.data.yunteng.dto.MenuDTO; |
13 | 13 | import org.thingsboard.server.controller.BaseController; |
14 | 14 | import org.thingsboard.server.dao.yunteng.service.MenuService; |
... | ... | @@ -84,7 +84,7 @@ public class TkMenuController extends BaseController { |
84 | 84 | @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{})") |
85 | 85 | public void deleteMenus(@RequestBody String[] ids) throws ThingsboardException { |
86 | 86 | if (ids.length == 0) { |
87 | - throw new YtDataValidationException("需要删除的菜单不能为空"); | |
87 | + throw new TkDataValidationException("需要删除的菜单不能为空"); | |
88 | 88 | } |
89 | 89 | menuService.deleteMenus(getCurrentUser().getCurrentTenantId(), ids); |
90 | 90 | } | ... | ... |
... | ... | @@ -14,7 +14,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.dto.MessageConfigDTO; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
16 | 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 | 18 | import org.thingsboard.server.controller.BaseController; |
19 | 19 | import org.thingsboard.server.dao.yunteng.service.TkMessageConfigService; |
20 | 20 | |
... | ... | @@ -31,7 +31,7 @@ public class TkMessageConfigController extends BaseController { |
31 | 31 | private final TkMessageConfigService messageConfigService; |
32 | 32 | |
33 | 33 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
34 | - public YtPageData<MessageConfigDTO> pageMessageConfig( | |
34 | + public TkPageData<MessageConfigDTO> pageMessageConfig( | |
35 | 35 | @RequestParam(PAGE_SIZE) int pageSize, |
36 | 36 | @RequestParam(PAGE) int page, |
37 | 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 | 10 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
12 | 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 | 14 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.dto.MessageTemplateDTO; |
... | ... | @@ -20,7 +20,7 @@ import org.thingsboard.server.common.data.yunteng.enums.AssetStatusEnum; |
20 | 20 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
21 | 21 | import org.thingsboard.server.common.data.yunteng.enums.ResponseCodeEnum; |
22 | 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 | 24 | import org.thingsboard.server.controller.BaseController; |
25 | 25 | import org.thingsboard.server.dao.yunteng.service.TkMailService; |
26 | 26 | import org.thingsboard.server.dao.yunteng.service.TkMessageTemplateService; |
... | ... | @@ -42,7 +42,7 @@ public class TkMessageTemplateController extends BaseController { |
42 | 42 | private final TkMailService mailService; |
43 | 43 | |
44 | 44 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
45 | - public YtPageData<MessageTemplateDTO> pageMessageTemplate( | |
45 | + public TkPageData<MessageTemplateDTO> pageMessageTemplate( | |
46 | 46 | @RequestParam(PAGE_SIZE) int pageSize, |
47 | 47 | @RequestParam(PAGE) int page, |
48 | 48 | @RequestParam(value = "templateCode", required = false) String templateCode, |
... | ... | @@ -95,7 +95,7 @@ public class TkMessageTemplateController extends BaseController { |
95 | 95 | @Validated({AddGroup.class}) @RequestBody SmsReqDTO smsReqDTO) { |
96 | 96 | boolean result = smsService.sendSms(smsReqDTO); |
97 | 97 | if(!result){ |
98 | - throw new YtDataValidationException(ErrorMessage.MESSAGE_SEND_FAILED.getMessage()); | |
98 | + throw new TkDataValidationException(ErrorMessage.MESSAGE_SEND_FAILED.getMessage()); | |
99 | 99 | } |
100 | 100 | return ResponseResult.success(ResponseCodeEnum.SUCCESS.name() ); |
101 | 101 | } |
... | ... | @@ -105,7 +105,7 @@ public class TkMessageTemplateController extends BaseController { |
105 | 105 | @Validated({AddGroup.class}) @RequestBody EmailReqDTO emailReqDTO) { |
106 | 106 | boolean result = mailService.sendEmail(emailReqDTO); |
107 | 107 | if(!result){ |
108 | - throw new YtDataValidationException(ErrorMessage.MESSAGE_SEND_FAILED.getMessage()); | |
108 | + throw new TkDataValidationException(ErrorMessage.MESSAGE_SEND_FAILED.getMessage()); | |
109 | 109 | } |
110 | 110 | return ResponseResult.success(ResponseCodeEnum.SUCCESS.name() ); |
111 | 111 | } | ... | ... |
... | ... | @@ -7,7 +7,7 @@ import lombok.RequiredArgsConstructor; |
7 | 7 | import org.springframework.util.Assert; |
8 | 8 | import org.springframework.web.bind.annotation.*; |
9 | 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 | 11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.dto.DataBoardDTO; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.DataComponentDTO; |
... | ... | @@ -68,13 +68,13 @@ public class TkNoAuthController { |
68 | 68 | Optional.ofNullable(params) |
69 | 69 | .map(param -> params.get("op").asText()) |
70 | 70 | .orElseThrow( |
71 | - () -> new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | |
71 | + () -> new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | |
72 | 72 | ObjectNode objectNode = JacksonUtil.newObjectNode(); |
73 | 73 | ObjectNode content = |
74 | 74 | Optional.ofNullable(params.get("content")) |
75 | 75 | .map(data -> JacksonUtil.convertValue(params.get("content"), ObjectNode.class)) |
76 | 76 | .orElseThrow( |
77 | - () -> new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | |
77 | + () -> new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | |
78 | 78 | String sn = null; |
79 | 79 | FrpInfoDTO queryFrpInfoDTO = null; |
80 | 80 | if (!value.equals(FrpPluginsEnum.Login.name()) && !value.equals(FrpPluginsEnum.Ping.name())) { |
... | ... | @@ -82,7 +82,7 @@ public class TkNoAuthController { |
82 | 82 | Optional.ofNullable(content.get("proxy_name")) |
83 | 83 | .map(proxyName -> content.get("proxy_name").asText()) |
84 | 84 | .orElseThrow( |
85 | - () -> new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | |
85 | + () -> new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | |
86 | 86 | queryFrpInfoDTO = frpInfoService.findFrpInfoByProxyName(sn); |
87 | 87 | } |
88 | 88 | |
... | ... | @@ -119,10 +119,10 @@ public class TkNoAuthController { |
119 | 119 | DataBoardDTO dto = |
120 | 120 | ytDataBoardService.findDataBoardInfoById(boardId, tenantId); |
121 | 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 | 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 | 127 | MoreDataComponentInfoDTO moreDataComponentInfoDTO = new MoreDataComponentInfoDTO(); |
128 | 128 | List<DataComponentDTO> data = | ... | ... |
... | ... | @@ -15,7 +15,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.dto.SysNoticeDTO; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
17 | 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 | 19 | import org.thingsboard.server.controller.BaseController; |
20 | 20 | import org.thingsboard.server.dao.yunteng.service.SysNoticeService; |
21 | 21 | |
... | ... | @@ -41,7 +41,7 @@ public class TkNoticeController extends BaseController { |
41 | 41 | path = "page", |
42 | 42 | params = {PAGE_SIZE, PAGE}) |
43 | 43 | @ApiOperation("分页") |
44 | - public YtPageData<SysNoticeDTO> page( | |
44 | + public TkPageData<SysNoticeDTO> page( | |
45 | 45 | @RequestParam(value = "type", required = false) SysNoticeTypeEnum type, |
46 | 46 | @RequestParam(PAGE_SIZE) int pageSize, |
47 | 47 | @RequestParam(PAGE) int page, | ... | ... |
... | ... | @@ -4,13 +4,12 @@ import io.swagger.annotations.ApiOperation; |
4 | 4 | import lombok.RequiredArgsConstructor; |
5 | 5 | import org.jetbrains.annotations.NotNull; |
6 | 6 | import org.springframework.http.ResponseEntity; |
7 | -import org.springframework.security.access.prepost.PreAuthorize; | |
8 | 7 | import org.springframework.web.bind.annotation.*; |
9 | 8 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
10 | 9 | import org.thingsboard.server.common.data.yunteng.dto.SysNoticeUserDTO; |
11 | 10 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
12 | 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 | 13 | import org.thingsboard.server.controller.BaseController; |
15 | 14 | import org.thingsboard.server.dao.yunteng.service.SysNoticeUserService; |
16 | 15 | |
... | ... | @@ -35,7 +34,7 @@ public class TkNoticeUserController extends BaseController { |
35 | 34 | path = "read", |
36 | 35 | params = {PAGE_SIZE, PAGE}) |
37 | 36 | @ApiOperation("查看人员阅读情况分页") |
38 | - public YtPageData<SysNoticeUserDTO> read( | |
37 | + public TkPageData<SysNoticeUserDTO> read( | |
39 | 38 | @RequestParam(PAGE_SIZE) int pageSize, |
40 | 39 | @RequestParam(PAGE) int page, |
41 | 40 | @RequestParam(value = ORDER_FILED, required = false) String orderBy, |
... | ... | @@ -48,7 +47,7 @@ public class TkNoticeUserController extends BaseController { |
48 | 47 | path = "page", |
49 | 48 | params = {PAGE_SIZE, PAGE}) |
50 | 49 | @ApiOperation("我的通知分页") |
51 | - public YtPageData<SysNoticeUserDTO> page( | |
50 | + public TkPageData<SysNoticeUserDTO> page( | |
52 | 51 | @RequestParam(value = "type", required = false) SysNoticeTypeEnum type, |
53 | 52 | @RequestParam(PAGE_SIZE) int pageSize, |
54 | 53 | @RequestParam(PAGE) int page, |
... | ... | @@ -68,7 +67,7 @@ public class TkNoticeUserController extends BaseController { |
68 | 67 | path = "page/{noticeId}", |
69 | 68 | params = {PAGE_SIZE, PAGE}) |
70 | 69 | @ApiOperation("通知用户分页") |
71 | - public YtPageData<SysNoticeUserDTO> pageByNoticeId ( | |
70 | + public TkPageData<SysNoticeUserDTO> pageByNoticeId ( | |
72 | 71 | @PathVariable("noticeId") String noticeId, |
73 | 72 | @RequestParam(PAGE_SIZE) int pageSize, |
74 | 73 | @RequestParam(PAGE) int page, | ... | ... |
... | ... | @@ -12,7 +12,7 @@ import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.TkOpinionDTO; |
14 | 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 | 16 | import org.thingsboard.server.controller.BaseController; |
17 | 17 | import org.thingsboard.server.dao.yunteng.entities.TkOpinionEntity; |
18 | 18 | import org.thingsboard.server.dao.yunteng.service.TkOpinionService; |
... | ... | @@ -30,7 +30,7 @@ public class TkOpinionController extends BaseController { |
30 | 30 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
31 | 31 | @ApiOperation("分页") |
32 | 32 | @PreAuthorize("hasAnyAuthority('PLATFORM_ADMIN','SYS_ADMIN')") |
33 | - public YtPageData<TkOpinionDTO> pageAlarmProfile( | |
33 | + public TkPageData<TkOpinionDTO> pageAlarmProfile( | |
34 | 34 | @RequestParam(PAGE_SIZE) int pageSize, |
35 | 35 | @RequestParam(PAGE) int page, |
36 | 36 | @RequestParam(value = "status", required = false) Boolean status, | ... | ... |
... | ... | @@ -13,13 +13,13 @@ import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
15 | 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 | 17 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
18 | 18 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
19 | 19 | import org.thingsboard.server.common.data.yunteng.dto.ReportFormConfigDTO; |
20 | 20 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
21 | 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 | 23 | import org.thingsboard.server.controller.BaseController; |
24 | 24 | import org.thingsboard.server.dao.yunteng.service.TkReportFormConfigService; |
25 | 25 | |
... | ... | @@ -40,7 +40,7 @@ public class TkReportFormConfigController extends BaseController { |
40 | 40 | |
41 | 41 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
42 | 42 | @ApiOperation("分页") |
43 | - public YtPageData<ReportFormConfigDTO> page( | |
43 | + public TkPageData<ReportFormConfigDTO> page( | |
44 | 44 | @RequestParam(PAGE_SIZE) int pageSize, |
45 | 45 | @RequestParam(PAGE) int page, |
46 | 46 | @RequestParam(value = "name", required = false) String name, |
... | ... | @@ -66,7 +66,7 @@ public class TkReportFormConfigController extends BaseController { |
66 | 66 | queryMap.put("userId",getCurrentUser().getCurrentUserId()); |
67 | 67 | if (null != startTime && null != endTime) { |
68 | 68 | if (startTime > endTime) { |
69 | - throw new YtDataValidationException( | |
69 | + throw new TkDataValidationException( | |
70 | 70 | ErrorMessage.START_TIME_NOT_MORE_THAN_END_TIME.getMessage()); |
71 | 71 | } |
72 | 72 | queryMap.put("startTime", new Timestamp(startTime).toLocalDateTime()); |
... | ... | @@ -82,7 +82,7 @@ public class TkReportFormConfigController extends BaseController { |
82 | 82 | @Validated({AddGroup.class}) @RequestBody ReportFormConfigDTO configDTO) |
83 | 83 | throws ThingsboardException, SchedulerException { |
84 | 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 | 87 | return saveOrUpdate(configDTO); |
88 | 88 | } |
... | ... | @@ -131,14 +131,14 @@ public class TkReportFormConfigController extends BaseController { |
131 | 131 | Long startTs = configDTO.getQueryCondition().getStartTs(); |
132 | 132 | Long endTs = configDTO.getQueryCondition().getEndTs(); |
133 | 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 | 136 | if (startTs < 946656000000L || endTs < 946656000000L) { |
137 | - throw new YtDataValidationException( | |
137 | + throw new TkDataValidationException( | |
138 | 138 | ErrorMessage.START_TIME_OR_END_TIME_EXCEPTION.getMessage()); |
139 | 139 | } |
140 | 140 | if (startTs > endTs) { |
141 | - throw new YtDataValidationException( | |
141 | + throw new TkDataValidationException( | |
142 | 142 | ErrorMessage.START_TIME_NOT_MORE_THAN_END_TIME.getMessage()); |
143 | 143 | } |
144 | 144 | ReportFormConfigDTO newDTO = reportFormConfigService.saveOrUpdateReportFormConfig(configDTO); | ... | ... |
... | ... | @@ -12,7 +12,7 @@ import org.thingsboard.common.util.JacksonUtil; |
12 | 12 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
14 | 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 | 16 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
18 | 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 | 20 | import org.thingsboard.server.common.data.yunteng.dto.request.QueryConditionDTO; |
21 | 21 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
22 | 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 | 24 | import org.thingsboard.server.controller.BaseController; |
25 | 25 | import org.thingsboard.server.dao.yunteng.service.TkReportFormConfigService; |
26 | 26 | import org.thingsboard.server.dao.yunteng.service.TkReportGenerateRecordService; |
... | ... | @@ -45,7 +45,7 @@ public class TkReportGenerateRecordController extends BaseController { |
45 | 45 | |
46 | 46 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
47 | 47 | @ApiOperation("分页") |
48 | - public YtPageData<ReportGenerateRecordDTO> page( | |
48 | + public TkPageData<ReportGenerateRecordDTO> page( | |
49 | 49 | @RequestParam(PAGE_SIZE) int pageSize, |
50 | 50 | @RequestParam(PAGE) int page, |
51 | 51 | @RequestParam(value = "reportConfigName", required = false) String reportConfigName, |
... | ... | @@ -59,7 +59,7 @@ public class TkReportGenerateRecordController extends BaseController { |
59 | 59 | HashMap<String, Object> queryMap = new HashMap<>(); |
60 | 60 | if (null != startTime && null != endTime) { |
61 | 61 | if (startTime > endTime) { |
62 | - throw new YtDataValidationException( | |
62 | + throw new TkDataValidationException( | |
63 | 63 | ErrorMessage.START_TIME_NOT_MORE_THAN_END_TIME.getMessage()); |
64 | 64 | } |
65 | 65 | ... | ... |
... | ... | @@ -11,7 +11,7 @@ import org.thingsboard.server.common.data.yunteng.dto.RoleDTO; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.dto.request.RoleReqDTO; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.enums.RoleEnum; |
14 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
14 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
15 | 15 | import org.thingsboard.server.controller.BaseController; |
16 | 16 | import org.thingsboard.server.dao.yunteng.service.RoleService; |
17 | 17 | |
... | ... | @@ -30,7 +30,7 @@ public class TkRoleController extends BaseController { |
30 | 30 | |
31 | 31 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
32 | 32 | @PreAuthorize("hasAnyAuthority('SYS_ADMIN','TENANT_ADMIN')") |
33 | - public YtPageData<RoleDTO> pageRole( | |
33 | + public TkPageData<RoleDTO> pageRole( | |
34 | 34 | @RequestParam(PAGE_SIZE) int pageSize, |
35 | 35 | @RequestParam(PAGE) int page, |
36 | 36 | @RequestParam(value = "roleName", required = false) String roleName, |
... | ... | @@ -47,7 +47,7 @@ public class TkRoleController extends BaseController { |
47 | 47 | path = "/tenant", |
48 | 48 | params = {PAGE_SIZE, PAGE}) |
49 | 49 | @PreAuthorize("hasAnyAuthority('SYS_ADMIN','PLATFORM_ADMIN')") |
50 | - public YtPageData<RoleDTO> pageTenantRole( | |
50 | + public TkPageData<RoleDTO> pageTenantRole( | |
51 | 51 | @RequestParam(PAGE_SIZE) int pageSize, |
52 | 52 | @RequestParam(PAGE) int page, |
53 | 53 | @RequestParam(value = "roleName", required = false) String roleName, | ... | ... |
... | ... | @@ -12,7 +12,7 @@ import org.thingsboard.server.common.data.exception.ThingsboardException; |
12 | 12 | import org.thingsboard.server.common.data.rpc.RpcStatus; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.TkRpcRecordDTO; |
14 | 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 | 16 | import org.thingsboard.server.controller.BaseController; |
17 | 17 | import org.thingsboard.server.dao.yunteng.entities.TkRpcRecordEntity; |
18 | 18 | import org.thingsboard.server.dao.yunteng.service.TkRpcRecordService; |
... | ... | @@ -31,7 +31,7 @@ public class TkRpcRecordController extends BaseController { |
31 | 31 | |
32 | 32 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
33 | 33 | @ApiOperation("分页") |
34 | - public YtPageData<TkRpcRecordDTO> pageAlarmProfile( | |
34 | + public TkPageData<TkRpcRecordDTO> pageAlarmProfile( | |
35 | 35 | @RequestParam(PAGE_SIZE) int pageSize, |
36 | 36 | @RequestParam(PAGE) int page, |
37 | 37 | @RequestParam(value = "status", required = false) RpcStatus status, | ... | ... |
... | ... | @@ -21,7 +21,7 @@ import org.thingsboard.server.common.data.yunteng.dto.SceneLinkageDTO; |
21 | 21 | import org.thingsboard.server.common.data.yunteng.dto.TriggerDTO; |
22 | 22 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
23 | 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 | 25 | import org.thingsboard.server.controller.BaseController; |
26 | 26 | import org.thingsboard.server.controller.yunteng.aspect.annotation.AutoLog; |
27 | 27 | import org.thingsboard.server.dao.model.ModelConstants; |
... | ... | @@ -90,7 +90,7 @@ public class TkSceneLinkageController extends BaseController { |
90 | 90 | |
91 | 91 | @ApiOperation("查询(分页列表)") |
92 | 92 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
93 | - public YtPageData<SceneLinkageDTO> page( | |
93 | + public TkPageData<SceneLinkageDTO> page( | |
94 | 94 | @RequestParam(PAGE_SIZE) int pageSize, |
95 | 95 | @RequestParam(PAGE) int page, |
96 | 96 | @RequestParam(value = "name", required = false) String name, | ... | ... |
... | ... | @@ -9,7 +9,7 @@ import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
9 | 9 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
10 | 10 | import org.thingsboard.server.common.data.yunteng.dto.SmsLogDTO; |
11 | 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 | 13 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
14 | 14 | import org.thingsboard.server.controller.BaseController; |
15 | 15 | import org.thingsboard.server.dao.yunteng.service.SmsLogService; |
... | ... | @@ -26,7 +26,7 @@ public class TkSmsLogController extends BaseController { |
26 | 26 | private final SmsLogService smsLogService; |
27 | 27 | |
28 | 28 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
29 | - public YtPageData<SmsLogDTO> pageMessageConfig( | |
29 | + public TkPageData<SmsLogDTO> pageMessageConfig( | |
30 | 30 | @RequestParam(PAGE_SIZE) int pageSize, |
31 | 31 | @RequestParam(PAGE) int page, |
32 | 32 | @RequestParam(value = "toPhone", required = false) String toPhone, | ... | ... |
... | ... | @@ -12,7 +12,7 @@ import org.thingsboard.server.common.data.audit.ActionType; |
12 | 12 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.SysLogDTO; |
14 | 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 | 16 | import org.thingsboard.server.controller.BaseController; |
17 | 17 | import org.thingsboard.server.dao.model.ModelConstants; |
18 | 18 | import org.thingsboard.server.dao.yunteng.entities.SysLogEntity; |
... | ... | @@ -39,7 +39,7 @@ public class TkSyslogController extends BaseController { |
39 | 39 | @GetMapping(value = "exception", params = {PAGE_SIZE, PAGE}) |
40 | 40 | @ApiOperation("异常日志列表") |
41 | 41 | @PreAuthorize("@check.checkPermissions({},{})") |
42 | - public YtPageData<SysLogDTO> pageExceptions( | |
42 | + public TkPageData<SysLogDTO> pageExceptions( | |
43 | 43 | @RequestParam(PAGE_SIZE) int pageSize, |
44 | 44 | @RequestParam(PAGE) int page, |
45 | 45 | @RequestParam(value = "startTime", required = false) Long startTime, |
... | ... | @@ -63,7 +63,7 @@ public class TkSyslogController extends BaseController { |
63 | 63 | @GetMapping(value = "operate", params = {PAGE_SIZE, PAGE}) |
64 | 64 | @ApiOperation("操作日志列表") |
65 | 65 | @PreAuthorize("@check.checkPermissions({},{})") |
66 | - public YtPageData<SysLogDTO> pageOperate( | |
66 | + public TkPageData<SysLogDTO> pageOperate( | |
67 | 67 | @RequestParam(PAGE_SIZE) int pageSize, |
68 | 68 | @RequestParam(PAGE) int page, |
69 | 69 | @RequestParam(value = "startTime", required = false) Long startTime, |
... | ... | @@ -86,7 +86,7 @@ public class TkSyslogController extends BaseController { |
86 | 86 | @GetMapping(value = "user", params = {PAGE_SIZE, PAGE}) |
87 | 87 | @ApiOperation("登录登出列表") |
88 | 88 | @PreAuthorize("@check.checkPermissions({},{})") |
89 | - public YtPageData<SysLogDTO> pageLogin( | |
89 | + public TkPageData<SysLogDTO> pageLogin( | |
90 | 90 | @RequestParam(PAGE_SIZE) int pageSize, |
91 | 91 | @RequestParam(PAGE) int page, |
92 | 92 | @RequestParam(value = "startTime", required = false) Long startTime, | ... | ... |
... | ... | @@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.*; |
7 | 7 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
8 | 8 | import org.thingsboard.server.common.data.id.TenantId; |
9 | 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 | 11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.core.utils.AccountProperties; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.UserDTO; |
... | ... | @@ -42,7 +42,7 @@ public class TkTenantController extends AbstractUserAccount { |
42 | 42 | //check is tenant account |
43 | 43 | UserDTO userDTO = userService.checkAccount(userId,2); |
44 | 44 | if(null == userDTO){ |
45 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
45 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
46 | 46 | } |
47 | 47 | //update |
48 | 48 | String resetPassword = accountProperties.getDefaultPassword(); | ... | ... |
... | ... | @@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.page.PageData; |
13 | 13 | import org.thingsboard.server.common.data.page.PageLink; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
15 | 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 | 17 | import org.thingsboard.server.controller.BaseController; |
18 | 18 | |
19 | 19 | import java.util.List; |
... | ... | @@ -30,7 +30,7 @@ public class TkTenantProfilesController extends BaseController { |
30 | 30 | @GetMapping( |
31 | 31 | name = "page", |
32 | 32 | params = {PAGE_SIZE, PAGE}) |
33 | - public YtPageData<TenantProfile> pageDevice( | |
33 | + public TkPageData<TenantProfile> pageDevice( | |
34 | 34 | @RequestParam(PAGE_SIZE) int pageSize, |
35 | 35 | @RequestParam(PAGE) int page, |
36 | 36 | @RequestParam(value = "textSearch", required = false) String textSearch, |
... | ... | @@ -54,7 +54,7 @@ public class TkTenantProfilesController extends BaseController { |
54 | 54 | tenantProfileService.findTenantProfiles(tenantId, pageLink); |
55 | 55 | List<TenantProfile> targetList = |
56 | 56 | ReflectUtils.sourceToTarget(tenantProfilePageData.getData(), TenantProfile.class); |
57 | - return new YtPageData<>(targetList, tenantProfilePageData.getTotalElements()); | |
57 | + return new TkPageData<>(targetList, tenantProfilePageData.getTotalElements()); | |
58 | 58 | } catch (Exception e) { |
59 | 59 | throw handleException(e); |
60 | 60 | } | ... | ... |
... | ... | @@ -20,14 +20,14 @@ import org.thingsboard.server.common.data.yunteng.dto.UserDetailsDTO; |
20 | 20 | import org.thingsboard.server.common.data.yunteng.dto.TkThirdUserDTO; |
21 | 21 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
22 | 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 | 24 | import org.thingsboard.server.controller.BaseController; |
25 | 25 | import org.thingsboard.server.dao.exception.DataValidationException; |
26 | 26 | import org.thingsboard.server.dao.yunteng.entities.TkThirdUserEntity; |
27 | 27 | import org.thingsboard.server.dao.yunteng.service.TkThirdPlatformService; |
28 | 28 | import org.thingsboard.server.dao.yunteng.service.TkUserService; |
29 | 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 | 31 | import org.thingsboard.server.service.security.model.SecurityUser; |
32 | 32 | import org.thingsboard.server.service.security.model.UserPrincipal; |
33 | 33 | import org.thingsboard.server.service.security.model.token.JwtTokenFactory; |
... | ... | @@ -53,7 +53,7 @@ public class TkThirdPlatformController extends BaseController { |
53 | 53 | |
54 | 54 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
55 | 55 | @ApiOperation("分页") |
56 | - public YtPageData<TkThirdUserDTO> pageAlarmProfile( | |
56 | + public TkPageData<TkThirdUserDTO> pageAlarmProfile( | |
57 | 57 | @RequestParam(PAGE_SIZE) int pageSize, |
58 | 58 | @RequestParam(PAGE) int page, |
59 | 59 | @RequestParam(value = "platformName", required = false) ThirdPlatformEnum platformName, |
... | ... | @@ -69,7 +69,7 @@ public class TkThirdPlatformController extends BaseController { |
69 | 69 | |
70 | 70 | @PostMapping("bind") |
71 | 71 | @ApiOperation("绑定") |
72 | - public YtLoginResponse saveOrUpdateAlarmProfile( | |
72 | + public TkLoginResponse saveOrUpdateAlarmProfile( | |
73 | 73 | @Validated @RequestBody TkThirdUserDTO dto) throws ThingsboardException { |
74 | 74 | UserDTO userDto = thirdService.bindUser(dto); |
75 | 75 | return buildJwtToken(userDto, dto.getThirdUserId()); |
... | ... | @@ -91,23 +91,23 @@ public class TkThirdPlatformController extends BaseController { |
91 | 91 | |
92 | 92 | @GetMapping("login/{loginCode}") |
93 | 93 | @ApiOperation("第三方登录") |
94 | - public YtLoginResponse codeLogin(@PathVariable("loginCode") String loginCode) | |
94 | + public TkLoginResponse codeLogin(@PathVariable("loginCode") String loginCode) | |
95 | 95 | throws ThingsboardException { |
96 | 96 | String thirdUserId = thirdService.thirdLogin(loginCode); |
97 | 97 | UserDTO userDto = thirdService.login(thirdUserId); |
98 | 98 | if (userDto == null) { |
99 | - return new YtLoginResponse().setThirdUserId(thirdUserId); | |
99 | + return new TkLoginResponse().setThirdUserId(thirdUserId); | |
100 | 100 | } |
101 | 101 | return buildJwtToken(userDto, thirdUserId); |
102 | 102 | } |
103 | 103 | |
104 | 104 | @GetMapping("login/id/{userId}") |
105 | 105 | @ApiOperation("组态用户认证") |
106 | - public YtLoginResponse unionidLogin(@PathVariable("userId") String userId) | |
106 | + public TkLoginResponse unionidLogin(@PathVariable("userId") String userId) | |
107 | 107 | throws ThingsboardException { |
108 | 108 | UserDTO userDto = tkUserService.findUserInfoById(userId); |
109 | 109 | if (userDto == null) { |
110 | - return new YtLoginResponse().setThirdUserId(userId); | |
110 | + return new TkLoginResponse().setThirdUserId(userId); | |
111 | 111 | } |
112 | 112 | return buildJwtToken(userDto, userId); |
113 | 113 | } |
... | ... | @@ -116,20 +116,20 @@ public class TkThirdPlatformController extends BaseController { |
116 | 116 | private String authrizeSecret="zhiyun"; |
117 | 117 | @PostMapping("authorize") |
118 | 118 | @ApiOperation("授权客户获取用户访问令牌") |
119 | - public YtLoginResponse authorizeLogin(@Validated @RequestBody AuthorizeDTO dto) | |
119 | + public TkLoginResponse authorizeLogin(@Validated @RequestBody AuthorizeDTO dto) | |
120 | 120 | throws ThingsboardException { |
121 | 121 | if(!authrizeKey.equals(dto.getAuthrizeKey()) || !authrizeSecret.equals(dto.getAuthrizeSecret())){ |
122 | 122 | throw new DataValidationException( ErrorMessage.NO_PERMISSION.getMessage()); |
123 | 123 | } |
124 | 124 | UserDTO userDto = tkUserService.accountExist(dto.getUserName()); |
125 | 125 | if (userDto == null) { |
126 | - return new YtLoginResponse().setThirdUserId(dto.getAuthrizeKey()); | |
126 | + return new TkLoginResponse().setThirdUserId(dto.getAuthrizeKey()); | |
127 | 127 | } |
128 | 128 | return buildJwtToken(userDto, dto.getAuthrizeKey()); |
129 | 129 | } |
130 | 130 | |
131 | 131 | @NotNull |
132 | - private YtLoginResponse buildJwtToken(UserDTO userDto, String thirdUserId) { | |
132 | + private TkLoginResponse buildJwtToken(UserDTO userDto, String thirdUserId) { | |
133 | 133 | String accessToken = ""; |
134 | 134 | String refreshToken = ""; |
135 | 135 | if (userDto != null && StringUtils.isNotEmpty(userDto.getTbUser())) { |
... | ... | @@ -148,7 +148,7 @@ public class TkThirdPlatformController extends BaseController { |
148 | 148 | refreshToken = refreshTokenRepository.requestRefreshToken(securityUser).getToken(); |
149 | 149 | |
150 | 150 | } |
151 | - YtLoginResponse result = new YtLoginResponse(); | |
151 | + TkLoginResponse result = new TkLoginResponse(); | |
152 | 152 | result.setToken(accessToken); |
153 | 153 | result.setRefreshToken(refreshToken); |
154 | 154 | return result.setThirdUserId(thirdUserId); | ... | ... |
... | ... | @@ -24,7 +24,7 @@ import org.thingsboard.server.common.data.security.UserCredentials; |
24 | 24 | import org.thingsboard.server.common.data.yunteng.common.AddGroup; |
25 | 25 | import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
26 | 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 | 28 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
29 | 29 | import org.thingsboard.server.common.data.yunteng.core.utils.AccountProperties; |
30 | 30 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
... | ... | @@ -37,7 +37,7 @@ import org.thingsboard.server.common.data.yunteng.enums.RoleEnum; |
37 | 37 | import org.thingsboard.server.common.data.yunteng.utils.Demo; |
38 | 38 | import org.thingsboard.server.common.data.yunteng.utils.ExcelUtil; |
39 | 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 | 41 | import org.thingsboard.server.dao.user.UserService; |
42 | 42 | import org.thingsboard.server.dao.yunteng.entities.SysUserEntity; |
43 | 43 | import org.thingsboard.server.dao.yunteng.service.TkUserService; |
... | ... | @@ -98,7 +98,7 @@ public class TkUserController extends AbstractUserAccount { |
98 | 98 | path = "page", |
99 | 99 | params = {PAGE_SIZE, PAGE}) |
100 | 100 | @ApiOperation(value = "获取用户分页数据") |
101 | - public YtPageData<UserDTO> pageUser( | |
101 | + public TkPageData<UserDTO> pageUser( | |
102 | 102 | @RequestParam(PAGE_SIZE) int pageSize, |
103 | 103 | @RequestParam(PAGE) int page, |
104 | 104 | @RequestParam(value = "tenantId", required = false) String tenantId, |
... | ... | @@ -133,7 +133,7 @@ public class TkUserController extends AbstractUserAccount { |
133 | 133 | path = "/tenant/page", |
134 | 134 | params = {PAGE_SIZE, PAGE}) |
135 | 135 | @ApiOperation(value = "获取租户管理员分页数据") |
136 | - public YtPageData<UserDTO> tenantPage( | |
136 | + public TkPageData<UserDTO> tenantPage( | |
137 | 137 | @RequestParam(PAGE_SIZE) int pageSize, |
138 | 138 | @RequestParam(PAGE) int page, |
139 | 139 | @RequestParam(value = ORDER_FILED, required = false) String orderBy, |
... | ... | @@ -148,7 +148,7 @@ public class TkUserController extends AbstractUserAccount { |
148 | 148 | } |
149 | 149 | queryMap.put(ORDER_FILED, orderBy); |
150 | 150 | if (StringUtils.isEmpty(tenantId)) { |
151 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
151 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
152 | 152 | } |
153 | 153 | return userService.tenantPage(queryMap, tenantId); |
154 | 154 | } |
... | ... | @@ -212,7 +212,7 @@ public class TkUserController extends AbstractUserAccount { |
212 | 212 | public UserDTO saveTenantAdmin(@Validated(AddGroup.class) @RequestBody UserDTO userDTO) |
213 | 213 | throws ThingsboardException { |
214 | 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 | 217 | userService.validateUserNameAndPhoneNumberAndEmail(userDTO); |
218 | 218 | userService.validateTenantRole(userDTO.getTenantId()); | ... | ... |
... | ... | @@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.TkVideoDTO; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
15 | 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 | 17 | import org.thingsboard.server.controller.BaseController; |
18 | 18 | import org.thingsboard.server.dao.yunteng.entities.TkVideoEntity; |
19 | 19 | import org.thingsboard.server.dao.yunteng.service.TkVideoService; |
... | ... | @@ -34,7 +34,7 @@ public class TkVideoController extends BaseController { |
34 | 34 | |
35 | 35 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
36 | 36 | @ApiOperation("分页") |
37 | - public YtPageData<TkVideoDTO> pageAlarmProfile( | |
37 | + public TkPageData<TkVideoDTO> pageAlarmProfile( | |
38 | 38 | @RequestParam(PAGE_SIZE) int pageSize, |
39 | 39 | @RequestParam(PAGE) int page, |
40 | 40 | @RequestParam(value = "status", required = false) Boolean status, | ... | ... |
... | ... | @@ -12,7 +12,7 @@ import org.thingsboard.server.common.data.yunteng.common.DeleteGroup; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.TkVideoPlatformDTO; |
14 | 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 | 16 | import org.thingsboard.server.controller.BaseController; |
17 | 17 | import org.thingsboard.server.dao.yunteng.entities.TkVideoPlatformEntity; |
18 | 18 | import org.thingsboard.server.dao.yunteng.service.TkVideoPlatformService; |
... | ... | @@ -32,7 +32,7 @@ public class TkVideoPlatformController extends BaseController { |
32 | 32 | |
33 | 33 | @GetMapping(params = {PAGE_SIZE, PAGE}) |
34 | 34 | @ApiOperation("分页") |
35 | - public YtPageData<TkVideoPlatformDTO> pageVideoPlatform( | |
35 | + public TkPageData<TkVideoPlatformDTO> pageVideoPlatform( | |
36 | 36 | @RequestParam(PAGE_SIZE) int pageSize, |
37 | 37 | @RequestParam(PAGE) int page, |
38 | 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 | 1 | package org.thingsboard.server.service.security.auth.yunteng; |
2 | - | |
3 | -import lombok.AllArgsConstructor; | |
4 | 2 | import lombok.Data; |
5 | -import lombok.EqualsAndHashCode; | |
6 | 3 | import lombok.experimental.Accessors; |
7 | 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 | 16 | |
20 | 17 | @Data |
21 | 18 | @Accessors(chain = true) |
22 | -public class YtLoginResponse extends LoginResponse { | |
19 | +public class TkLoginResponse extends LoginResponse { | |
23 | 20 | private String thirdUserId; |
24 | 21 | } | ... | ... |
... | ... | @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; |
21 | 21 | import com.fasterxml.jackson.annotation.JsonTypeInfo; |
22 | 22 | import io.swagger.annotations.ApiModel; |
23 | 23 | import org.thingsboard.server.common.data.DeviceTransportType; |
24 | -import org.thingsboard.server.common.data.device.profile.YtTcpDeviceProfileTransportConfiguration; | |
25 | 24 | |
26 | 25 | import java.io.Serializable; |
27 | 26 | |
... | ... | @@ -34,7 +33,7 @@ import java.io.Serializable; |
34 | 33 | @JsonSubTypes({ |
35 | 34 | @JsonSubTypes.Type(value = DefaultDeviceTransportConfiguration.class, name = "DEFAULT"), |
36 | 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 | 37 | @JsonSubTypes.Type(value = CoapDeviceTransportConfiguration.class, name = "COAP"), |
39 | 38 | @JsonSubTypes.Type(value = Lwm2mDeviceTransportConfiguration.class, name = "LWM2M"), |
40 | 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 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 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 | 17 | import lombok.Data; |
22 | 18 | import org.thingsboard.server.common.data.DeviceTransportType; |
23 | 19 | |
24 | -import java.util.HashMap; | |
25 | -import java.util.Map; | |
26 | - | |
27 | 20 | @Data |
28 | -public class YtTcpDeviceTransportConfiguration implements DeviceTransportConfiguration { | |
21 | +public class TkTcpDeviceTransportConfiguration implements DeviceTransportConfiguration { | |
29 | 22 | |
30 | 23 | |
31 | 24 | @Override | ... | ... |
... | ... | @@ -31,7 +31,7 @@ import java.io.Serializable; |
31 | 31 | @JsonSubTypes({ |
32 | 32 | @JsonSubTypes.Type(value = DefaultDeviceProfileTransportConfiguration.class, name = "DEFAULT"), |
33 | 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 | 35 | @JsonSubTypes.Type(value = Lwm2mDeviceProfileTransportConfiguration.class, name = "LWM2M"), |
36 | 36 | @JsonSubTypes.Type(value = CoapDeviceProfileTransportConfiguration.class, name = "COAP"), |
37 | 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 | 21 | import org.thingsboard.server.common.data.yunteng.enums.TcpDataTypeEnum; |
22 | 22 | |
23 | 23 | @Data |
24 | -public class YtTcpDeviceProfileTransportConfiguration implements DeviceProfileTransportConfiguration { | |
24 | +public class TkTcpDeviceProfileTransportConfiguration implements DeviceProfileTransportConfiguration { | |
25 | 25 | |
26 | 26 | @NoXss |
27 | 27 | private TcpDataTypeEnum dataFormat = TcpDataTypeEnum.HEX; | ... | ... |
... | ... | @@ -18,7 +18,7 @@ import org.thingsboard.server.common.data.yunteng.dto.SysDictItemDTO; |
18 | 18 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; |
19 | 19 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; |
20 | 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 | 23 | import java.lang.reflect.Field; |
24 | 24 | import java.util.ArrayList; |
... | ... | @@ -69,17 +69,17 @@ public class SysDictAspect { |
69 | 69 | returnObject = ResponseResult.success(objectNode); |
70 | 70 | } |
71 | 71 | } |
72 | - if (returnObject instanceof YtPageData) { | |
72 | + if (returnObject instanceof TkPageData) { | |
73 | 73 | Object object = returnObject; |
74 | 74 | List<ObjectNode> list = new ArrayList<>(); |
75 | - for (Object obj : ((YtPageData<?>) object).getItems()) { | |
75 | + for (Object obj : ((TkPageData<?>) object).getItems()) { | |
76 | 76 | ObjectNode objectNode = getObjectNode(obj, obj); |
77 | 77 | if(null == objectNode){ |
78 | 78 | return returnObject; |
79 | 79 | } |
80 | 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 | 84 | return returnObject; |
85 | 85 | } | ... | ... |
... | ... | @@ -2,7 +2,7 @@ package org.thingsboard.server.common.data.yunteng.config.sms; |
2 | 2 | |
3 | 3 | import lombok.extern.slf4j.Slf4j; |
4 | 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 | 6 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
7 | 7 | |
8 | 8 | @Slf4j |
... | ... | @@ -11,7 +11,7 @@ public abstract class AbstractSmsSender implements SmsSender { |
11 | 11 | protected void validatePhoneNumber(String phoneNumber) { |
12 | 12 | phoneNumber = phoneNumber.trim(); |
13 | 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 | } |
\ No newline at end of file | ... | ... |
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 | import org.thingsboard.server.common.data.yunteng.config.sms.tencent.TencentSmsSender; |
8 | 8 | |
9 | 9 | @Component |
10 | -public class YtDefaultSmsSenderFactory implements SmsSenderFactory { | |
10 | +public class TkDefaultSmsSenderFactory implements SmsSenderFactory { | |
11 | 11 | @Override |
12 | 12 | public SmsSender createSmsSender( |
13 | 13 | SmsProviderConfiguration config) { | ... | ... |
... | ... | @@ -11,7 +11,7 @@ import com.aliyuncs.profile.IClientProfile; |
11 | 11 | import lombok.extern.slf4j.Slf4j; |
12 | 12 | import org.apache.commons.lang3.StringUtils; |
13 | 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 | 15 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.enums.ResponseCodeEnum; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; |
... | ... | @@ -29,7 +29,7 @@ public class AliSmsSender extends AbstractSmsSender { |
29 | 29 | public AliSmsSender(AliSmsProviderConfiguration config) { |
30 | 30 | if (StringUtils.isEmpty(config.getAccessKeyId()) |
31 | 31 | || StringUtils.isEmpty(config.getAccessKeyId())) { |
32 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
32 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
33 | 33 | } |
34 | 34 | this.config = config; |
35 | 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 | 4 | import org.springframework.http.HttpStatus; |
5 | 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 | 8 | private static final long serialVersionUID = 3556952261254572635L; |
9 | 9 | |
10 | 10 | @Getter public boolean log = false; |
11 | 11 | |
12 | - public YtDataValidationException(String message) { | |
12 | + public TkDataValidationException(String message) { | |
13 | 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 | 17 | super(ErrorMessage.BAD_PARAMETER.setMessage(message)); |
18 | 18 | this.log = log; |
19 | 19 | } | ... | ... |
... | ... | @@ -3,7 +3,7 @@ package org.thingsboard.server.common.data.yunteng.dto; |
3 | 3 | import io.swagger.annotations.ApiModel; |
4 | 4 | import io.swagger.annotations.ApiModelProperty; |
5 | 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 | 8 | import java.util.List; |
9 | 9 | |
... | ... | @@ -15,5 +15,5 @@ public class HomePageRightDTO { |
15 | 15 | private List<TenantTransportMessageDTO> top10; |
16 | 16 | |
17 | 17 | @ApiModelProperty("本月即将过期租户") |
18 | - private YtPageData<TenantDTO> expireTenant; | |
18 | + private TkPageData<TenantDTO> expireTenant; | |
19 | 19 | } | ... | ... |
... | ... | @@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode; |
6 | 6 | import com.hikvision.artemis.sdk.ArtemisHttpUtil; |
7 | 7 | import com.hikvision.artemis.sdk.config.ArtemisConfig; |
8 | 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 | 10 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; |
12 | 12 | |
... | ... | @@ -36,7 +36,7 @@ public class HikVisionArtemisPostUtils { |
36 | 36 | public static String getCameraPreviewURL(String host, String appKey, String appSecret, int ssl, String cameraIndexCode, |
37 | 37 | ProtocolType protocolType, int streamType) { |
38 | 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 | 41 | ArtemisConfig.host = host; |
42 | 42 | ArtemisConfig.appKey = appKey; |
... | ... | @@ -77,11 +77,11 @@ public class HikVisionArtemisPostUtils { |
77 | 77 | ProtocolType.HLSS.getValue())){ |
78 | 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 | 82 | return json.get("url").textValue(); |
83 | 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 | 8 | |
9 | 9 | @Data |
10 | 10 | @NoArgsConstructor |
11 | -public class YtPageData<T> implements Serializable { | |
11 | +public class TkPageData<T> implements Serializable { | |
12 | 12 | private static final long serialVersionUID = -5385636733740491124L; |
13 | 13 | private int total; |
14 | 14 | private Collection<T> items; |
15 | 15 | |
16 | - public YtPageData(Collection<T> list, long total) { | |
16 | + public TkPageData(Collection<T> list, long total) { | |
17 | 17 | this.items = list; |
18 | 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 | 31 | import org.thingsboard.server.common.data.ota.OtaPackageType; |
32 | 32 | import org.thingsboard.server.common.transport.adaptor.AdaptorException; |
33 | 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 | 36 | import org.thingsboard.server.gen.transport.TransportProtos; |
37 | 37 | import org.thingsboard.server.transport.tcp.session.TCPMessage; |
38 | 38 | import org.thingsboard.server.transport.tcp.session.TcpDeviceWareSessionContext; |
... | ... | @@ -53,7 +53,7 @@ public class JsonTcpAdaptor implements TcpTransportAdaptor { |
53 | 53 | |
54 | 54 | protected static final Charset UTF8 = StandardCharsets.UTF_8; |
55 | 55 | @Autowired |
56 | - private YtScriptInvokeService jsEngine; | |
56 | + private TkScriptInvokeService jsEngine; | |
57 | 57 | private static final JsonParser parser = new JsonParser(); |
58 | 58 | |
59 | 59 | @Override |
... | ... | @@ -73,7 +73,7 @@ public class JsonTcpAdaptor implements TcpTransportAdaptor { |
73 | 73 | |
74 | 74 | @Override |
75 | 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 | 79 | @Override | ... | ... |
... | ... | @@ -21,12 +21,12 @@ import lombok.Getter; |
21 | 21 | import lombok.extern.slf4j.Slf4j; |
22 | 22 | import org.thingsboard.server.common.data.DeviceProfile; |
23 | 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 | 25 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
26 | 26 | import org.thingsboard.server.common.data.yunteng.enums.TcpDataTypeEnum; |
27 | 27 | import org.thingsboard.server.common.transport.auth.TransportDeviceInfo; |
28 | 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 | 30 | import org.thingsboard.server.gen.transport.TransportProtos; |
31 | 31 | import org.thingsboard.server.transport.tcp.TcpTransportContext; |
32 | 32 | import org.thingsboard.server.transport.tcp.adaptors.TcpTransportAdaptor; |
... | ... | @@ -111,7 +111,7 @@ public abstract class TcpDeviceWareSessionContext extends DeviceAwareSessionCont |
111 | 111 | private void updateDeviceSessionConfiguration(DeviceProfile deviceProfile){ |
112 | 112 | DeviceProfileTransportConfiguration transportConfiguration = deviceProfile.getProfileData().getTransportConfiguration(); |
113 | 113 | |
114 | - YtTcpDeviceProfileTransportConfiguration tcpConfiguration = (YtTcpDeviceProfileTransportConfiguration) transportConfiguration; | |
114 | + TkTcpDeviceProfileTransportConfiguration tcpConfiguration = (TkTcpDeviceProfileTransportConfiguration) transportConfiguration; | |
115 | 115 | payloadType = tcpConfiguration.getDataFormat(); |
116 | 116 | if (TcpDataTypeEnum.ASCII.equals(payloadType)) { |
117 | 117 | payloadType = TcpDataTypeEnum.ASCII; |
... | ... | @@ -123,7 +123,7 @@ public abstract class TcpDeviceWareSessionContext extends DeviceAwareSessionCont |
123 | 123 | this.toDeviceRpcResponseTopicFilter = tcpConfiguration.getRpcTopic(); |
124 | 124 | String scriptBody = tcpConfiguration.getScriptText(); |
125 | 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 | 127 | } catch (ExecutionException e) { |
128 | 128 | log.warn("设备配置【{}】的脚本【{}】解析异常",deviceProfile.getSearchText(),scriptBody); |
129 | 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 | 26 | import org.springframework.beans.factory.annotation.Value; |
27 | 27 | import org.springframework.scheduling.annotation.Scheduled; |
28 | 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 | 29 | import org.thingsboard.server.queue.usagestats.TbApiUsageClient; |
33 | 30 | |
34 | 31 | import javax.annotation.PostConstruct; |
... | ... | @@ -45,7 +42,7 @@ import java.util.concurrent.atomic.AtomicInteger; |
45 | 42 | import java.util.concurrent.locks.ReentrantLock; |
46 | 43 | |
47 | 44 | @Slf4j |
48 | -public abstract class AbstractNashornYtScriptInvokeService extends AbstractYtScriptInvokeService { | |
45 | +public abstract class AbstractNashornTkScriptInvokeService extends AbstractTkScriptInvokeService { | |
49 | 46 | |
50 | 47 | private NashornSandbox sandbox; |
51 | 48 | private ScriptEngine engine; |
... | ... | @@ -56,13 +53,13 @@ public abstract class AbstractNashornYtScriptInvokeService extends AbstractYtScr |
56 | 53 | private final AtomicInteger jsEvalMsgs = new AtomicInteger(0); |
57 | 54 | private final AtomicInteger jsFailedMsgs = new AtomicInteger(0); |
58 | 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 | 59 | private final ReentrantLock evalLock = new ReentrantLock(); |
63 | 60 | |
64 | 61 | @Getter |
65 | - private final YtScriptExecutorService jsExecutor; | |
62 | + private final TkScriptExecutorService jsExecutor; | |
66 | 63 | |
67 | 64 | @Value("${js.local.max_requests_timeout:0}") |
68 | 65 | private long maxRequestsTimeout; |
... | ... | @@ -70,7 +67,7 @@ public abstract class AbstractNashornYtScriptInvokeService extends AbstractYtScr |
70 | 67 | @Value("${js.local.stats.enabled:false}") |
71 | 68 | private boolean statsEnabled; |
72 | 69 | |
73 | - public AbstractNashornYtScriptInvokeService(TbApiUsageClient apiUsageClient, YtScriptExecutorService jsExecutor) { | |
70 | + public AbstractNashornTkScriptInvokeService(TbApiUsageClient apiUsageClient, TkScriptExecutorService jsExecutor) { | |
74 | 71 | super(); |
75 | 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 | 31 | * Created by ashvayka on 26.09.18. |
32 | 32 | */ |
33 | 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 | 54 | } |
55 | 55 | |
56 | 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 | 58 | UUID scriptId = UUID.randomUUID(); |
59 | 59 | String functionName = "invokeInternal_" + scriptId.toString().replace('-', '_'); |
60 | 60 | String jsScript = generateJsScript(scriptType, functionName, scriptBody, argNames); |
... | ... | @@ -109,9 +109,9 @@ public abstract class AbstractYtScriptInvokeService implements YtScriptInvokeSer |
109 | 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 | 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 | 19 | import org.springframework.beans.factory.annotation.Value; |
20 | 20 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
21 | 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 | 22 | import org.thingsboard.server.queue.usagestats.TbApiUsageClient; |
25 | 23 | |
26 | 24 | import java.util.concurrent.TimeUnit; |
... | ... | @@ -29,7 +27,7 @@ import java.util.concurrent.TimeUnit; |
29 | 27 | @ConditionalOnProperty(prefix = "js", value = "evaluator", havingValue = "local", matchIfMissing = true) |
30 | 28 | @Service |
31 | 29 | public class |
32 | -NashornYtScriptInvokeService extends AbstractNashornYtScriptInvokeService { | |
30 | +NashornTkScriptInvokeService extends AbstractNashornTkScriptInvokeService { | |
33 | 31 | |
34 | 32 | @Value("${js.local.use_js_sandbox}") |
35 | 33 | private boolean useJsSandbox; |
... | ... | @@ -46,7 +44,7 @@ NashornYtScriptInvokeService extends AbstractNashornYtScriptInvokeService { |
46 | 44 | @Value("${js.local.max_black_list_duration_sec:60}") |
47 | 45 | private int maxBlackListDurationSec; |
48 | 46 | |
49 | - public NashornYtScriptInvokeService(TbApiUsageClient apiUsageClient, YtScriptExecutorService jsExecutor) { | |
47 | + public NashornTkScriptInvokeService(TbApiUsageClient apiUsageClient, TkScriptExecutorService jsExecutor) { | |
50 | 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 | 44 | @Slf4j |
45 | 45 | @ConditionalOnExpression("'${js.evaluator:null}'=='remote' && ('${service.type:null}'=='monolith' || '${service.type:null}'=='tb-core' || '${service.type:null}'=='tb-transport')") |
46 | 46 | @Service |
47 | -public class YtRemoteJsInvokeService extends AbstractYtScriptInvokeService { | |
47 | +public class TkRemoteJsInvokeService extends AbstractTkScriptInvokeService { | |
48 | 48 | |
49 | 49 | @Value("${queue.js.max_eval_requests_timeout}") |
50 | 50 | private long maxEvalRequestsTimeout; |
... | ... | @@ -70,7 +70,7 @@ public class YtRemoteJsInvokeService extends AbstractYtScriptInvokeService { |
70 | 70 | private final ExecutorService callbackExecutor = Executors.newFixedThreadPool( |
71 | 71 | Runtime.getRuntime().availableProcessors(), ThingsBoardThreadFactory.forName("js-executor-remote-callback")); |
72 | 72 | |
73 | - public YtRemoteJsInvokeService(TbApiUsageClient apiUsageClient) { | |
73 | + public TkRemoteJsInvokeService(TbApiUsageClient apiUsageClient) { | |
74 | 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 | 20 | import org.thingsboard.common.util.AbstractListeningExecutor; |
21 | 21 | |
22 | 22 | @Component |
23 | -public class YtScriptExecutorService extends AbstractListeningExecutor { | |
23 | +public class TkScriptExecutorService extends AbstractListeningExecutor { | |
24 | 24 | |
25 | 25 | @Value("${actors.rule.js_thread_pool_size}") |
26 | 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
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
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
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 | 19 | |
20 | 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 | 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 | 23 | import java.util.concurrent.atomic.AtomicInteger; |
24 | 24 | |
25 | 25 | @AllArgsConstructor |
26 | -public class YtScriptStatCallback<T> implements FutureCallback<T> { | |
26 | +public class TkScriptStatCallback<T> implements FutureCallback<T> { | |
27 | 27 | |
28 | 28 | private final AtomicInteger jsSuccessMsgs; |
29 | 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 | 36 | import org.thingsboard.server.common.data.id.TenantId; |
37 | 37 | import org.thingsboard.server.common.data.page.PageData; |
38 | 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 | 40 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
41 | 41 | import org.thingsboard.server.dao.entity.AbstractEntityService; |
42 | 42 | import org.thingsboard.server.dao.exception.DataValidationException; |
... | ... | @@ -114,7 +114,7 @@ public class DeviceProfileServiceImpl extends AbstractEntityService implements D |
114 | 114 | } catch (Exception t) { |
115 | 115 | ConstraintViolationException e = extractConstraintViolationException(t).orElse(null); |
116 | 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 | 118 | } else if (e != null && e.getConstraintName() != null && e.getConstraintName().equalsIgnoreCase("device_provision_key_unq_key")) { |
119 | 119 | throw new DataValidationException("Device profile with such provision device key already exists!"); |
120 | 120 | } else { | ... | ... |
... | ... | @@ -266,7 +266,7 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe |
266 | 266 | |
267 | 267 | //Thingskit function |
268 | 268 | case TCP: |
269 | - deviceData.setTransportConfiguration(new YtTcpDeviceTransportConfiguration()); | |
269 | + deviceData.setTransportConfiguration(new TkTcpDeviceTransportConfiguration()); | |
270 | 270 | break; |
271 | 271 | |
272 | 272 | } | ... | ... |
... | ... | @@ -4,7 +4,7 @@ package org.thingsboard.server.dao.util.yunteng; |
4 | 4 | import org.apache.commons.lang3.StringUtils; |
5 | 5 | import org.quartz.*; |
6 | 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 | 8 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; |
9 | 9 | import org.thingsboard.server.common.data.yunteng.utils.SpringBeanUtils; |
10 | 10 | import org.thingsboard.server.dao.yunteng.entities.SysJobEntity; |
... | ... | @@ -82,7 +82,7 @@ public class ScheduleUtils { |
82 | 82 | |
83 | 83 | /** 设置定时任务策略 */ |
84 | 84 | public static CronScheduleBuilder handleCronScheduleMisfirePolicy( |
85 | - SysJobEntity job, CronScheduleBuilder cb) throws YtDataValidationException { | |
85 | + SysJobEntity job, CronScheduleBuilder cb) throws TkDataValidationException { | |
86 | 86 | switch (job.getMisfirePolicy()) { |
87 | 87 | case FastIotConstants.ScheduleConstants.MISFIRE_DEFAULT: |
88 | 88 | return cb; |
... | ... | @@ -93,7 +93,7 @@ public class ScheduleUtils { |
93 | 93 | case FastIotConstants.ScheduleConstants.MISFIRE_DO_NOTHING: |
94 | 94 | return cb.withMisfireHandlingInstructionDoNothing(); |
95 | 95 | default: |
96 | - throw new YtDataValidationException( | |
96 | + throw new TkDataValidationException( | |
97 | 97 | "The task misfire policy '" |
98 | 98 | + job.getMisfirePolicy() |
99 | 99 | + "' cannot be used in cron schedule tasks"); |
... | ... | @@ -117,7 +117,7 @@ public class ScheduleUtils { |
117 | 117 | try{ |
118 | 118 | obj = SpringBeanUtils.getBean(StringUtils.split(invokeTarget, ".")[0]); |
119 | 119 | }catch (Exception e){ |
120 | - throw new YtDataValidationException("调用方法【"+invokeTarget+"】不存在"); | |
120 | + throw new TkDataValidationException("调用方法【"+invokeTarget+"】不存在"); | |
121 | 121 | } |
122 | 122 | return containsAnyIgnoreCase( |
123 | 123 | obj.getClass().getPackage().getName(), | ... | ... |
... | ... | @@ -8,7 +8,7 @@ import org.springframework.stereotype.Service; |
8 | 8 | import org.springframework.transaction.annotation.Transactional; |
9 | 9 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
10 | 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 | 12 | import org.thingsboard.server.dao.exception.DataValidationException; |
13 | 13 | import org.thingsboard.server.dao.yunteng.entities.SysDictItemEntity; |
14 | 14 | import org.thingsboard.server.dao.yunteng.mapper.SysDictItemMapper; |
... | ... | @@ -26,7 +26,7 @@ public class SysDictItemServiceImpl extends AbstractBaseService<SysDictItemMappe |
26 | 26 | implements SysDictItemService { |
27 | 27 | |
28 | 28 | @Override |
29 | - public YtPageData<SysDictItemDTO> page(Map<String, Object> queryMap) { | |
29 | + public TkPageData<SysDictItemDTO> page(Map<String, Object> queryMap) { | |
30 | 30 | if (StringUtils.isEmpty((CharSequence) queryMap.get("dictId"))) { |
31 | 31 | throw new DataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
32 | 32 | } | ... | ... |
... | ... | @@ -7,11 +7,11 @@ import lombok.extern.slf4j.Slf4j; |
7 | 7 | import org.springframework.stereotype.Service; |
8 | 8 | import org.springframework.transaction.annotation.Transactional; |
9 | 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 | 11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; |
13 | 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 | 15 | import org.thingsboard.server.dao.yunteng.entities.SysDictEntity; |
16 | 16 | import org.thingsboard.server.dao.yunteng.mapper.SysDictItemMapper; |
17 | 17 | import org.thingsboard.server.dao.yunteng.mapper.SysDictMapper; |
... | ... | @@ -31,7 +31,7 @@ public class SysDictServiceImpl extends AbstractBaseService<SysDictMapper, SysDi |
31 | 31 | private final SysDictItemMapper sysDictItemMapper; |
32 | 32 | |
33 | 33 | @Override |
34 | - public YtPageData<SysDictDTO> page(Map<String, Object> queryMap) { | |
34 | + public TkPageData<SysDictDTO> page(Map<String, Object> queryMap) { | |
35 | 35 | IPage<SysDictEntity> iPage = |
36 | 36 | baseMapper.selectPage( |
37 | 37 | getPage(queryMap, "create_time", false), |
... | ... | @@ -54,7 +54,7 @@ public class SysDictServiceImpl extends AbstractBaseService<SysDictMapper, SysDi |
54 | 54 | // 新增之前先判断该租户是否已添加 |
55 | 55 | SysDictDTO querySysDict = baseMapper.getDictInfoByCode(tenantId, sysDictDTO.getDictCode()); |
56 | 56 | if (querySysDict != null) { |
57 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
57 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
58 | 58 | } |
59 | 59 | SysDictEntity sysDict = new SysDictEntity(); |
60 | 60 | sysDictDTO.copyToEntity(sysDict); |
... | ... | @@ -70,7 +70,7 @@ public class SysDictServiceImpl extends AbstractBaseService<SysDictMapper, SysDi |
70 | 70 | for (String id : sysDictIds) { |
71 | 71 | List<SysDictItemDTO> sysDictItemDTO = sysDictItemMapper.getDictItemInfo(id, null); |
72 | 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 | 76 | return baseMapper.deleteBatchIds(sysDictIds) > 0; | ... | ... |
... | ... | @@ -5,7 +5,7 @@ import lombok.RequiredArgsConstructor; |
5 | 5 | import lombok.extern.slf4j.Slf4j; |
6 | 6 | import org.springframework.stereotype.Service; |
7 | 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 | 9 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
10 | 10 | import org.thingsboard.server.common.data.yunteng.dto.SysAreaDTO; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.dto.SysEnterpriseDTO; |
... | ... | @@ -36,7 +36,7 @@ public class SysEnterpriseServiceImpl |
36 | 36 | baseMapper.selectOne( |
37 | 37 | new LambdaQueryWrapper<SysEnterpriseEntity>().eq(SysEnterpriseEntity::getTenantId, tenantId)); |
38 | 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 | 41 | SysEnterpriseEntity entity = sysAppDesignDTO.getEntity(SysEnterpriseEntity.class); |
42 | 42 | entity.setTenantId(tenantId); | ... | ... |
... | ... | @@ -8,11 +8,11 @@ import org.apache.commons.lang3.StringUtils; |
8 | 8 | import org.springframework.stereotype.Service; |
9 | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | 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 | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
14 | 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 | 16 | import org.thingsboard.server.dao.yunteng.entities.SysJobLogEntity; |
17 | 17 | import org.thingsboard.server.dao.yunteng.mapper.SysJobLogMapper; |
18 | 18 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
... | ... | @@ -28,7 +28,7 @@ public class SysJobLogServiceImpl extends AbstractBaseService<SysJobLogMapper, S |
28 | 28 | implements TkSysJobLogService { |
29 | 29 | |
30 | 30 | @Override |
31 | - public YtPageData<SysJobLogDTO> sysJobLogPageByJobId(Map<String, Object> queryMap) { | |
31 | + public TkPageData<SysJobLogDTO> sysJobLogPageByJobId(Map<String, Object> queryMap) { | |
32 | 32 | String jobName = queryMap.get("jobName") != null ? queryMap.get("jobName").toString() : null; |
33 | 33 | String jobGroup = queryMap.get("jobGroup") != null ? queryMap.get("jobGroup").toString() : null; |
34 | 34 | String jobId = queryMap.get("jobId") != null ? queryMap.get("jobId").toString() : null; |
... | ... | @@ -48,7 +48,7 @@ public class SysJobLogServiceImpl extends AbstractBaseService<SysJobLogMapper, S |
48 | 48 | @Override |
49 | 49 | public SysJobLogDTO findSysJobLogById(String jobId, String id) { |
50 | 50 | if (StringUtils.isEmpty(id)) { |
51 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
51 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
52 | 52 | } |
53 | 53 | SysJobLogEntity sysJobLog = baseMapper.selectById(id); |
54 | 54 | return Optional.ofNullable(sysJobLog) |
... | ... | @@ -57,12 +57,12 @@ public class SysJobLogServiceImpl extends AbstractBaseService<SysJobLogMapper, S |
57 | 57 | if (obj.getJobId().equals(jobId)) { |
58 | 58 | return obj.getDTO(SysJobLogDTO.class); |
59 | 59 | } else { |
60 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
60 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
61 | 61 | } |
62 | 62 | }) |
63 | 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 | 78 | .map(job -> baseMapper.updateById(jobLog)) |
79 | 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 | 84 | return jobLogDTO; | ... | ... |
... | ... | @@ -8,11 +8,11 @@ import org.quartz.*; |
8 | 8 | import org.springframework.stereotype.Service; |
9 | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | 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 | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.*; |
14 | 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 | 16 | import org.thingsboard.server.dao.util.yunteng.CronUtils; |
17 | 17 | import org.thingsboard.server.dao.util.yunteng.ScheduleUtils; |
18 | 18 | import org.thingsboard.server.dao.yunteng.entities.SysJobEntity; |
... | ... | @@ -42,7 +42,7 @@ public class SysJobServiceImpl extends AbstractBaseService<SysJobMapper, SysJobE |
42 | 42 | } |
43 | 43 | |
44 | 44 | @Override |
45 | - public YtPageData<SysJobDTO> sysJobPage(Map<String, Object> queryMap) { | |
45 | + public TkPageData<SysJobDTO> sysJobPage(Map<String, Object> queryMap) { | |
46 | 46 | String jobGroup = queryMap.get("jobGroup") != null ? queryMap.get("jobGroup").toString() : null; |
47 | 47 | String jobName = queryMap.get("jobName") != null ? queryMap.get("jobName").toString() : null; |
48 | 48 | Integer status = |
... | ... | @@ -71,7 +71,7 @@ public class SysJobServiceImpl extends AbstractBaseService<SysJobMapper, SysJobE |
71 | 71 | .map(obj -> obj.getDTO(SysJobDTO.class)) |
72 | 72 | .orElseThrow( |
73 | 73 | () -> { |
74 | - throw new YtDataValidationException( | |
74 | + throw new TkDataValidationException( | |
75 | 75 | ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); |
76 | 76 | }); |
77 | 77 | } |
... | ... | @@ -200,7 +200,7 @@ public class SysJobServiceImpl extends AbstractBaseService<SysJobMapper, SysJobE |
200 | 200 | SysJobEntity job = baseMapper.selectById(jobDTO.getId()); |
201 | 201 | SysJobEntity newJob = jobDTO.getEntity(SysJobEntity.class); |
202 | 202 | if (null == job) { |
203 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
203 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
204 | 204 | } |
205 | 205 | newJob.setSourceId(job.getSourceId()); |
206 | 206 | newJob.setTenantId(job.getTenantId()); | ... | ... |
... | ... | @@ -7,7 +7,7 @@ import org.springframework.stereotype.Service; |
7 | 7 | import org.thingsboard.server.common.data.EntityType; |
8 | 8 | import org.thingsboard.server.common.data.audit.ActionType; |
9 | 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 | 11 | import org.thingsboard.server.dao.yunteng.entities.SysLogEntity; |
12 | 12 | import org.thingsboard.server.dao.yunteng.mapper.SysLogMapper; |
13 | 13 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
... | ... | @@ -29,7 +29,7 @@ public class SysLogServiceImpl extends AbstractBaseService<SysLogMapper, SysLogE |
29 | 29 | } |
30 | 30 | |
31 | 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 | 33 | IPage<SysLogDTO> page = |
34 | 34 | baseMapper.getPageDatasMatched(pageInfrom, tenantId, customerId, startTime, endTime, EntityType.RUNNING_EXCEPTION, actionType); |
35 | 35 | return getPageData(page, SysLogDTO.class); |
... | ... | @@ -37,7 +37,7 @@ public class SysLogServiceImpl extends AbstractBaseService<SysLogMapper, SysLogE |
37 | 37 | |
38 | 38 | |
39 | 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 | 41 | List<EntityType> entityTypes = new ArrayList<>(); |
42 | 42 | entityTypes.add(EntityType.RUNNING_EXCEPTION); |
43 | 43 | entityTypes.add(EntityType.USER); |
... | ... | @@ -61,7 +61,7 @@ public class SysLogServiceImpl extends AbstractBaseService<SysLogMapper, SysLogE |
61 | 61 | } |
62 | 62 | |
63 | 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 | 65 | IPage<SysLogDTO> page = |
66 | 66 | baseMapper.getPageDatasMatched(pageInfrom, tenantId, customerId, startTime, endTime, EntityType.USER, actionType); |
67 | 67 | return getPageData(page, SysLogDTO.class); | ... | ... |
... | ... | @@ -11,7 +11,7 @@ import org.springframework.stereotype.Service; |
11 | 11 | import org.springframework.transaction.annotation.Transactional; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
13 | 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 | 15 | import org.thingsboard.server.common.data.yunteng.dto.MenuDTO; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.enums.MenuTypeEnum; |
17 | 17 | import org.thingsboard.server.dao.yunteng.entities.SysMenuEntity; |
... | ... | @@ -91,13 +91,13 @@ public class SysMenuServiceImpl extends AbstractBaseService<MenuMapper, SysMenuE |
91 | 91 | } |
92 | 92 | if (menuDTO.getType().equals(MenuTypeEnum.CUSTOM) |
93 | 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 | 96 | int count = |
97 | 97 | baseMapper.selectCount( |
98 | 98 | new QueryWrapper<SysMenuEntity>().lambda().eq(SysMenuEntity::getPath, menuDTO.getPath())); |
99 | 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 | 102 | menuDTO.setTenantId(tenantId); |
103 | 103 | SysMenuEntity menu = menuDTO.getEntity(SysMenuEntity.class); |
... | ... | @@ -120,7 +120,7 @@ public class SysMenuServiceImpl extends AbstractBaseService<MenuMapper, SysMenuE |
120 | 120 | public MenuDTO updateMenu(String tenantId, boolean isSysAdmin, MenuDTO menuDTO) { |
121 | 121 | SysMenuEntity oldMenu = baseMapper.selectById(menuDTO.getId()); |
122 | 122 | if (oldMenu == null) { |
123 | - throw new YtDataValidationException("cannot find menu to update"); | |
123 | + throw new TkDataValidationException("cannot find menu to update"); | |
124 | 124 | } else { |
125 | 125 | if (!isSysAdmin) { |
126 | 126 | if (!tenantId.equals(menuDTO.getTenantId())) { |
... | ... | @@ -158,7 +158,7 @@ public class SysMenuServiceImpl extends AbstractBaseService<MenuMapper, SysMenuE |
158 | 158 | int menuCountInDB = |
159 | 159 | baseMapper.selectCount(new QueryWrapper<SysMenuEntity>().lambda().in(SysMenuEntity::getId, ids)); |
160 | 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 | 163 | Set<String> existMenus = baseMapper.selectTenantMenuIds(tenantId); |
164 | 164 | Set<String> toDel = Sets.difference(existMenus, ids); |
... | ... | @@ -185,7 +185,7 @@ public class SysMenuServiceImpl extends AbstractBaseService<MenuMapper, SysMenuE |
185 | 185 | int menuCountInDB = |
186 | 186 | baseMapper.selectCount(new QueryWrapper<SysMenuEntity>().lambda().in(SysMenuEntity::getId, ids)); |
187 | 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 | 191 | Set<String> existMenus = baseMapper.selectRoleMenuIds(roleId); | ... | ... |
... | ... | @@ -11,7 +11,7 @@ import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.core.exception.EntityCreationException; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | 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 | 15 | import org.thingsboard.server.dao.yunteng.entities.SysNoticeEntity; |
16 | 16 | import org.thingsboard.server.dao.yunteng.entities.SysUserEntity; |
17 | 17 | import org.thingsboard.server.dao.yunteng.mapper.SysNoticeMapper; |
... | ... | @@ -42,7 +42,7 @@ public class SysNoticeServiceImpl extends AbstractBaseService<SysNoticeMapper, S |
42 | 42 | private final SysNoticeUserService noticeUserService; |
43 | 43 | |
44 | 44 | @Override |
45 | - public YtPageData<SysNoticeDTO> page(Map<String, Object> queryMap) { | |
45 | + public TkPageData<SysNoticeDTO> page(Map<String, Object> queryMap) { | |
46 | 46 | IPage<SysNoticeEntity> page = getPage(queryMap, FastIotConstants.DefaultOrder.CREATE_TIME, false); |
47 | 47 | IPage<SysNoticeDTO> pageDto = baseMapper.page(page, queryMap); |
48 | 48 | return getPageData(pageDto, SysNoticeDTO.class); | ... | ... |
... | ... | @@ -7,10 +7,10 @@ import lombok.RequiredArgsConstructor; |
7 | 7 | import org.apache.commons.lang3.StringUtils; |
8 | 8 | import org.springframework.stereotype.Service; |
9 | 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 | 11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
12 | 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 | 14 | import org.thingsboard.server.dao.yunteng.entities.SysNoticeUserEntity; |
15 | 15 | import org.thingsboard.server.dao.yunteng.entities.SysUserEntity; |
16 | 16 | import org.thingsboard.server.dao.yunteng.mapper.SysNoticeUserMapper; |
... | ... | @@ -37,17 +37,17 @@ public class SysNoticeUserServiceImpl |
37 | 37 | private final UserMapper userMapper; |
38 | 38 | |
39 | 39 | @Override |
40 | - public YtPageData<SysNoticeUserDTO> page(Map<String, Object> queryMap) { | |
40 | + public TkPageData<SysNoticeUserDTO> page(Map<String, Object> queryMap) { | |
41 | 41 | return getPage(queryMap); |
42 | 42 | } |
43 | 43 | |
44 | 44 | @Override |
45 | - public YtPageData<SysNoticeUserDTO> pageByNoticeId(Map<String, Object> queryMap) { | |
45 | + public TkPageData<SysNoticeUserDTO> pageByNoticeId(Map<String, Object> queryMap) { | |
46 | 46 | return getPage(queryMap); |
47 | 47 | } |
48 | 48 | |
49 | 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 | 51 | queryMap.put("creator", currentUserId); |
52 | 52 | return getPage(queryMap); |
53 | 53 | } |
... | ... | @@ -96,7 +96,7 @@ public class SysNoticeUserServiceImpl |
96 | 96 | @Override |
97 | 97 | public List<String> getSysNoticeUserIdsByNoticeId(String noticeId) { |
98 | 98 | if (StringUtils.isEmpty(noticeId)) { |
99 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.name()); | |
99 | + throw new TkDataValidationException(ErrorMessage.INTERNAL_ERROR.name()); | |
100 | 100 | } |
101 | 101 | return baseMapper |
102 | 102 | .selectList( |
... | ... | @@ -109,7 +109,7 @@ public class SysNoticeUserServiceImpl |
109 | 109 | @Override |
110 | 110 | public boolean updateSysNoticeUsersStatusByNoticeId(String id, Integer status) { |
111 | 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 | 114 | return baseMapper.updateSysNoticeUsersStatusByNoticeId(id, status); |
115 | 115 | } |
... | ... | @@ -122,7 +122,7 @@ public class SysNoticeUserServiceImpl |
122 | 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 | 126 | IPage<SysNoticeUserEntity> page = getPage(queryMap, FastIotConstants.DefaultOrder.CREATE_TIME, false); |
127 | 127 | IPage<SysNoticeUserDTO> pageDto = baseMapper.page(page, queryMap); |
128 | 128 | return getPageData(pageDto, SysNoticeUserDTO.class); | ... | ... |
... | ... | @@ -12,12 +12,12 @@ import org.springframework.stereotype.Service; |
12 | 12 | import org.springframework.transaction.annotation.Transactional; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
14 | 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 | 16 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.dto.RoleDTO; |
18 | 18 | import org.thingsboard.server.common.data.yunteng.dto.request.RoleReqDTO; |
19 | 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 | 21 | import org.thingsboard.server.dao.yunteng.entities.SysRoleEntity; |
22 | 22 | import org.thingsboard.server.dao.yunteng.entities.SysTenantMenuEntity; |
23 | 23 | import org.thingsboard.server.dao.yunteng.entities.SysTenantRoleEntity; |
... | ... | @@ -43,7 +43,7 @@ public class SysRoleServiceImpl extends AbstractBaseService<RoleMapper, SysRoleE |
43 | 43 | private final UserRoleMapper userRoleMapper; |
44 | 44 | |
45 | 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 | 47 | IPage<SysRoleEntity> roleIPage = |
48 | 48 | baseMapper.selectPage( |
49 | 49 | getPage(queryMap, "create_time", false), |
... | ... | @@ -73,7 +73,7 @@ public class SysRoleServiceImpl extends AbstractBaseService<RoleMapper, SysRoleE |
73 | 73 | // 判断该角色下面是否有用户 |
74 | 74 | Set<String> userIds = baseMapper.checkRoleUserMappingByRoleIds(ids); |
75 | 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 | 78 | // delete sys_role_menu mapping |
79 | 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 | 8 | import org.springframework.stereotype.Service; |
9 | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | 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 | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.BaseDTO; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.dto.OrganizationDTO; |
... | ... | @@ -63,7 +63,7 @@ public class SysUserOrganizationMappingServiceImpl implements UserOrganizationMa |
63 | 63 | public void addOrUpdateUserOrganizationMapping( |
64 | 64 | String userId, List<String> organizationIds, boolean isUpdate) { |
65 | 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 | 68 | if (isUpdate) { |
69 | 69 | // 先删除,再新增 |
... | ... | @@ -77,7 +77,7 @@ public class SysUserOrganizationMappingServiceImpl implements UserOrganizationMa |
77 | 77 | @Override |
78 | 78 | public List<String> getOrganizationIdsByUserId(String userId) { |
79 | 79 | if (StringUtils.isEmpty(userId)) { |
80 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | |
80 | + throw new TkDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | |
81 | 81 | } |
82 | 82 | return userOrganizationMappingMapper |
83 | 83 | .selectList( |
... | ... | @@ -108,7 +108,7 @@ public class SysUserOrganizationMappingServiceImpl implements UserOrganizationMa |
108 | 108 | organizationMapper.findOrganizationTreeList( |
109 | 109 | tenantId, new HashSet<>(List.of(organizationId))); |
110 | 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 | 113 | organizationIds = |
114 | 114 | organizationList.stream().map(BaseDTO::getId).distinct().collect(Collectors.toList()); | ... | ... |
... | ... | @@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.security.UserCredentials; |
26 | 26 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
27 | 27 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; |
28 | 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 | 30 | import org.thingsboard.server.common.data.yunteng.core.exception.NoneTenantAssetException; |
31 | 31 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
32 | 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 | 36 | import org.thingsboard.server.common.data.yunteng.enums.MsgTemplatePurposeEnum; |
37 | 37 | import org.thingsboard.server.common.data.yunteng.enums.UserStatusEnum; |
38 | 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 | 40 | import org.thingsboard.server.dao.user.UserService; |
41 | 41 | import org.thingsboard.server.dao.yunteng.entities.*; |
42 | 42 | import org.thingsboard.server.dao.yunteng.mapper.*; |
... | ... | @@ -94,11 +94,11 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
94 | 94 | UserDTO userDTO, boolean sendEmail, boolean sendMsg, boolean isTenantAdmin, String tenantId) { |
95 | 95 | boolean isTenantAdminOperate = isTenantAdmin; |
96 | 96 | if (sendMsg && StringUtils.isEmpty(userDTO.getPhoneNumber())) { |
97 | - throw new YtDataValidationException( | |
97 | + throw new TkDataValidationException( | |
98 | 98 | "you must specify user phone number if you want send activate email to this user"); |
99 | 99 | } |
100 | 100 | if (sendEmail && StringUtils.isEmpty(userDTO.getEmail())) { |
101 | - throw new YtDataValidationException( | |
101 | + throw new TkDataValidationException( | |
102 | 102 | "you must specify user email if you want send activate email to this user"); |
103 | 103 | } |
104 | 104 | SysUserEntity user = new SysUserEntity(); |
... | ... | @@ -117,7 +117,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
117 | 117 | .eq(SysUserEntity::getTenantId, tenantId)) |
118 | 118 | > 0; |
119 | 119 | if (userExist) { |
120 | - throw new YtDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); | |
120 | + throw new TkDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); | |
121 | 121 | } else { |
122 | 122 | user.setTenantId(tenantId); |
123 | 123 | user.setLevel( |
... | ... | @@ -148,21 +148,21 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
148 | 148 | new LambdaQueryWrapper<SysUserEntity>() |
149 | 149 | .eq(SysUserEntity::getUsername, userDTO.getUsername())); |
150 | 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 | 154 | if (StringUtils.isNotBlank(userDTO.getPhoneNumber())) { |
155 | 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 | 159 | if (StringUtils.isNotBlank(userDTO.getEmail())) { |
160 | 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 | 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 | 167 | boolean needCheck = true; |
168 | 168 | if (null != userDTO.getId()) { |
... | ... | @@ -189,7 +189,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
189 | 189 | }); |
190 | 190 | List<SysUserEntity> existPhoneOrEmail = baseMapper.selectList(queryWrapper); |
191 | 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 | 197 | @Override |
198 | 198 | public UserDTO findUserInfoById(String id) { |
199 | 199 | if (StringUtils.isEmpty(id)) { |
200 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
200 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
201 | 201 | } |
202 | 202 | SysUserEntity user = baseMapper.selectById(id); |
203 | 203 | return null != user ? user.getDTO(UserDTO.class) : null; |
... | ... | @@ -211,7 +211,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
211 | 211 | "you don't have permission to get activation link for this user"); |
212 | 212 | } |
213 | 213 | if (StringUtils.isEmpty(user.getActivateToken())) { |
214 | - throw new YtDataValidationException("user already activated"); | |
214 | + throw new TkDataValidationException("user already activated"); | |
215 | 215 | } |
216 | 216 | try { |
217 | 217 | List<SysAdminSettingEntity> generalSetting = |
... | ... | @@ -296,7 +296,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
296 | 296 | throw new NoneTenantAssetException(ErrorMessage.NOT_BELONG_CURRENT_TENANT); |
297 | 297 | } |
298 | 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 | 301 | validateUserNameAndPhoneNumberAndEmail(userDTO); |
302 | 302 | user.setRealName(userDTO.getRealName()); |
... | ... | @@ -320,7 +320,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
320 | 320 | } |
321 | 321 | |
322 | 322 | @Override |
323 | - public YtPageData<UserDTO> page( | |
323 | + public TkPageData<UserDTO> page( | |
324 | 324 | Map<String, Object> queryMap, boolean isPtSysadmin, boolean isTenantAdmin) { |
325 | 325 | String tenantId = (String) queryMap.get("tenantId"); |
326 | 326 | IPage<UserDTO> userPage = null; |
... | ... | @@ -360,7 +360,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
360 | 360 | } |
361 | 361 | |
362 | 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 | 364 | IPage<SysUserEntity> userIPage = getPage(queryMap, "create_time", false); |
365 | 365 | IPage<UserDTO> userPage = baseMapper.getTenantAdminPage(userIPage, tenantId); |
366 | 366 | if (null != userPage) { |
... | ... | @@ -445,7 +445,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
445 | 445 | .lambda() |
446 | 446 | .eq(SysUserEntity::getUsername, userDTO.getUsername())); |
447 | 447 | if (!users.isEmpty()) { |
448 | - throw new YtDataValidationException("用户已存在"); | |
448 | + throw new TkDataValidationException("用户已存在"); | |
449 | 449 | } |
450 | 450 | baseMapper.insert(user); |
451 | 451 | List<SysTenantRoleEntity> tenantRoleList = validateTenantRole(userDTO.getTenantId()); |
... | ... | @@ -465,7 +465,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
465 | 465 | .eq(SysTenantRoleEntity::getTenantId, tenantId)); |
466 | 466 | // 保存用户与角色的映射信息 |
467 | 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 | 470 | return tenantRoleList; |
471 | 471 | } |
... | ... | @@ -475,7 +475,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
475 | 475 | public void resetPassword(String userId, String tenantId, String password) { |
476 | 476 | UserDTO userDTO = findUserInfoById(userId); |
477 | 477 | if (null == userDTO) { |
478 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
478 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
479 | 479 | } |
480 | 480 | userDTO.setPassword(passwordEncoder.encode(password)); |
481 | 481 | userDTO.setActivateToken(null); |
... | ... | @@ -504,11 +504,11 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
504 | 504 | }) |
505 | 505 | .orElse(false); |
506 | 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 | 509 | String pwd = forget.getPassword(); |
510 | 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 | 514 | SysUserEntity user = |
... | ... | @@ -542,7 +542,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
542 | 542 | // 通过用户ID查询用户信息 |
543 | 543 | SysUserEntity user = baseMapper.selectById(msg.getUserId()); |
544 | 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 | 555 | List<MessageTemplateDTO> templateDTOList = |
556 | 556 | messageTemplateService.findMessageTemplate(messageTemplateDTO); |
557 | 557 | if (null == templateDTOList || templateDTOList.size() < 1) { |
558 | - throw new YtDataValidationException( | |
558 | + throw new TkDataValidationException( | |
559 | 559 | ErrorMessage.TARGET_TEMPLATE_NOT_EXISTS_SELF_NOTICE.getMessage()); |
560 | 560 | } |
561 | 561 | if (messageType.equalsIgnoreCase(MessageTypeEnum.PHONE_MESSAGE.name())) { |
... | ... | @@ -586,7 +586,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
586 | 586 | public String[] getUserRoleOrOrganization(RoleOrOrganizationReqDTO roleOrGroupReqDTO) { |
587 | 587 | String userId = roleOrGroupReqDTO.getUserId(); |
588 | 588 | if (StringUtils.isEmpty(userId)) { |
589 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
589 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
590 | 590 | } |
591 | 591 | if (roleOrGroupReqDTO.isQueryRole()) { |
592 | 592 | List<String> roleIds = |
... | ... | @@ -633,11 +633,11 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
633 | 633 | @Override |
634 | 634 | public String findUserCustomerIdById(String id) { |
635 | 635 | if (StringUtils.isEmpty(id)) { |
636 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
636 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
637 | 637 | } |
638 | 638 | String customerId = baseMapper.findUserCustomerIdById(id); |
639 | 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 | 642 | return customerId; |
643 | 643 | } |
... | ... | @@ -658,7 +658,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
658 | 658 | public List<UserDTO> getMyCustomers( |
659 | 659 | String organizationId, String tenantId, boolean isTenantAdmin) { |
660 | 660 | if (StringUtils.isEmpty(organizationId)) { |
661 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
661 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
662 | 662 | } |
663 | 663 | if (isTenantAdmin) { |
664 | 664 | List<String> userList = |
... | ... | @@ -694,7 +694,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
694 | 694 | @Override |
695 | 695 | public UserDTO accountExist(String userName) { |
696 | 696 | if (StringUtils.isEmpty(userName)) { |
697 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
697 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
698 | 698 | } |
699 | 699 | UserDTO userDTO = new UserDTO(); |
700 | 700 | userDTO.setUsername(userName); |
... | ... | @@ -710,7 +710,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
710 | 710 | @Override |
711 | 711 | public UserDTO findUserByPhoneNumber(String phoneNumber) { |
712 | 712 | if (StringUtils.isEmpty(phoneNumber)) { |
713 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
713 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
714 | 714 | } |
715 | 715 | UserDTO userDTO = new UserDTO(); |
716 | 716 | userDTO.setPhoneNumber(phoneNumber); |
... | ... | @@ -729,12 +729,12 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
729 | 729 | if (null == user |
730 | 730 | || StringUtils.isEmpty(accountReqDTO.getPassword()) |
731 | 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 | 735 | boolean isMatch = passwordEncoder.matches(accountReqDTO.getPassword(), user.getPassword()); |
736 | 736 | if (!isMatch) { |
737 | - throw new YtDataValidationException(ErrorMessage.PASSWORD_INCORRECT.getMessage()); | |
737 | + throw new TkDataValidationException(ErrorMessage.PASSWORD_INCORRECT.getMessage()); | |
738 | 738 | } |
739 | 739 | user.setPassword(accountReqDTO.getResetPassword()); |
740 | 740 | } |
... | ... | @@ -747,7 +747,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
747 | 747 | */ |
748 | 748 | private void deleteAndAddUserRole(String userId, List<String> roleIds) { |
749 | 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 | 753 | List<String> userIds = new ArrayList<>(); | ... | ... |
... | ... | @@ -10,7 +10,7 @@ import org.springframework.beans.BeanUtils; |
10 | 10 | import org.springframework.stereotype.Service; |
11 | 11 | import org.springframework.transaction.annotation.Transactional; |
12 | 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 | 14 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.dto.*; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.enums.DataTypeEnum; |
... | ... | @@ -18,7 +18,7 @@ import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
18 | 18 | import org.thingsboard.server.common.data.yunteng.enums.FunctionTypeEnum; |
19 | 19 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; |
20 | 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 | 22 | import org.thingsboard.server.dao.yunteng.entities.TkThingsModelEntity; |
23 | 23 | import org.thingsboard.server.dao.yunteng.mapper.ThingsModelMapper; |
24 | 24 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
... | ... | @@ -36,7 +36,7 @@ public class ThingsModelServiceImpl |
36 | 36 | private final TkDeviceProfileService ytDeviceProfileService; |
37 | 37 | |
38 | 38 | @Override |
39 | - public YtPageData<ThingsModelDTO> page( | |
39 | + public TkPageData<ThingsModelDTO> page( | |
40 | 40 | Map<String, Object> queryMap, String tenantId, String deviceProfileId) { |
41 | 41 | String nameOrIdentifier = |
42 | 42 | null != queryMap.get("nameOrIdentifier") ? (String) queryMap.get("nameOrIdentifier") : null; |
... | ... | @@ -71,7 +71,7 @@ public class ThingsModelServiceImpl |
71 | 71 | thingsModelDTO.getIdentifier(), |
72 | 72 | isAdd, |
73 | 73 | thingsModelId)) { |
74 | - throw new YtDataValidationException(ErrorMessage.DUPLICATE_IDENTIFIERS_EXIST.getMessage()); | |
74 | + throw new TkDataValidationException(ErrorMessage.DUPLICATE_IDENTIFIERS_EXIST.getMessage()); | |
75 | 75 | } |
76 | 76 | TkThingsModelEntity entity = thingsModelDTO.getEntity(TkThingsModelEntity.class); |
77 | 77 | if (isAdd) { |
... | ... | @@ -85,7 +85,7 @@ public class ThingsModelServiceImpl |
85 | 85 | .eq(TkThingsModelEntity::getTenantId, thingsModelDTO.getTenantId()) |
86 | 86 | .eq(TkThingsModelEntity::getId, thingsModelDTO.getId())); |
87 | 87 | if (null == result) { |
88 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
88 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
89 | 89 | } |
90 | 90 | baseMapper.updateById(entity); |
91 | 91 | } |
... | ... | @@ -111,7 +111,7 @@ public class ThingsModelServiceImpl |
111 | 111 | .eq(TkThingsModelEntity::getTenantId, dto.getTenantId()) |
112 | 112 | .in(TkThingsModelEntity::getId, dto.getIds())); |
113 | 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 | 116 | return result > FastIotConstants.MagicNumber.ZERO; |
117 | 117 | } |
... | ... | @@ -125,7 +125,7 @@ public class ThingsModelServiceImpl |
125 | 125 | .eq(TkThingsModelEntity::getTenantId, tenantId) |
126 | 126 | .eq(TkThingsModelEntity::getDeviceProfileId, deviceProfileId)); |
127 | 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 | 130 | return true; |
131 | 131 | } |
... | ... | @@ -155,7 +155,7 @@ public class ThingsModelServiceImpl |
155 | 155 | DeviceProfileDTO deviceProfileDTO = |
156 | 156 | ytDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId); |
157 | 157 | if (null == deviceProfileDTO) { |
158 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
158 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
159 | 159 | } |
160 | 160 | List<ThingsModelDTO> thingsModelDTOS = |
161 | 161 | selectByDeviceProfileId(typeEnum, tenantId, deviceProfileId); | ... | ... |
... | ... | @@ -8,13 +8,13 @@ import org.apache.commons.lang3.StringUtils; |
8 | 8 | import org.springframework.stereotype.Service; |
9 | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | 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 | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.AlarmContactDTO; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.dto.BaseDTO; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.dto.OrganizationDTO; |
16 | 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 | 18 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmContactEntity; |
19 | 19 | import org.thingsboard.server.dao.yunteng.mapper.AlarmContactMapper; |
20 | 20 | import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper; |
... | ... | @@ -73,7 +73,7 @@ public class TkAlarmContactServiceImpl extends AbstractBaseService<AlarmContactM |
73 | 73 | List<OrganizationDTO> organizationDTOS = |
74 | 74 | ytOrganizationMapper.findOrganizationTreeList(tenantId, ids); |
75 | 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 | 78 | List<String> organizationIds = |
79 | 79 | organizationDTOS.stream().map(BaseDTO::getId).collect(Collectors.toList()); |
... | ... | @@ -108,12 +108,12 @@ public class TkAlarmContactServiceImpl extends AbstractBaseService<AlarmContactM |
108 | 108 | tenantWapper(tenantId).eq(TkAlarmContactEntity::getUsername, alarmContactDTO.getUsername()); |
109 | 109 | int Count = baseMapper.selectCount(Wrapper); |
110 | 110 | if (Count > 0) { |
111 | - throw new YtDataValidationException( | |
111 | + throw new TkDataValidationException( | |
112 | 112 | String.format(ErrorMessage.NAME_EXISTED.getMessage(), alarmContactDTO.getUsername())); |
113 | 113 | } |
114 | 114 | if (checkPhoneEmail(tenantId, alarmContactDTO.getPhone(), alarmContactDTO.getEmail()).size() |
115 | 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 | 118 | alarmContactDTO.setTenantId(tenantId); |
119 | 119 | TkAlarmContactEntity alarmContact = alarmContactDTO.getEntity(TkAlarmContactEntity.class); |
... | ... | @@ -152,13 +152,13 @@ public class TkAlarmContactServiceImpl extends AbstractBaseService<AlarmContactM |
152 | 152 | // 得到对象 |
153 | 153 | TkAlarmContactEntity alarmContact = baseMapper.selectById(alarmContactDTO.getId()); |
154 | 154 | if (alarmContact == null) { |
155 | - throw new YtDataValidationException("此数据不存在"); | |
155 | + throw new TkDataValidationException("此数据不存在"); | |
156 | 156 | } |
157 | 157 | if (checkPhoneEmail( |
158 | 158 | alarmContact.getTenantId(), alarmContactDTO.getPhone(), alarmContactDTO.getEmail()) |
159 | 159 | .size() |
160 | 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 | 163 | TkAlarmContactEntity entity = alarmContactDTO.getEntity(TkAlarmContactEntity.class); |
164 | 164 | System.out.println(alarmContact); |
... | ... | @@ -188,7 +188,7 @@ public class TkAlarmContactServiceImpl extends AbstractBaseService<AlarmContactM |
188 | 188 | * @return PageData |
189 | 189 | */ |
190 | 190 | @Override |
191 | - public YtPageData<AlarmContactDTO> page( | |
191 | + public TkPageData<AlarmContactDTO> page( | |
192 | 192 | String tenantId, |
193 | 193 | boolean isPtTenantAdmin, |
194 | 194 | String currentUserId, | ... | ... |
... | ... | @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
18 | 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 | 20 | import org.thingsboard.server.dao.model.ModelConstants; |
21 | 21 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmEntity; |
22 | 22 | import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper; |
... | ... | @@ -42,7 +42,7 @@ public class TkAlarmInfoServiceImpl implements TkAlarmInfoService { |
42 | 42 | private final OrganizationMapper organizationMapper; |
43 | 43 | |
44 | 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 | 46 | StringBuilder defaultOrderFields = new StringBuilder("ack_ts asc,clear_ts asc,"); |
47 | 47 | defaultOrderFields.append(ModelConstants.CREATED_TIME_PROPERTY); |
48 | 48 | IPage<TkAlarmEntity> page = getPage(pageMap, defaultOrderFields.toString(), OrderTypeEnum.DESC); |
... | ... | @@ -58,7 +58,7 @@ public class TkAlarmInfoServiceImpl implements TkAlarmInfoService { |
58 | 58 | } |
59 | 59 | |
60 | 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 | 62 | return result; |
63 | 63 | } |
64 | 64 | ... | ... |
... | ... | @@ -10,11 +10,11 @@ import org.springframework.transaction.annotation.Transactional; |
10 | 10 | import org.thingsboard.server.common.data.StringUtils; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
12 | 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 | 14 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.dto.*; |
16 | 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 | 18 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmProfileEntity; |
19 | 19 | import org.thingsboard.server.dao.yunteng.entities.TkSceneLinkageEntity; |
20 | 20 | import org.thingsboard.server.dao.yunteng.mapper.AlarmProfileMapper; |
... | ... | @@ -41,7 +41,7 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM |
41 | 41 | private final SceneLinkageMapper sceneLinkageMapper; |
42 | 42 | |
43 | 43 | @Override |
44 | - public YtPageData<AlarmProfileDTO> page( | |
44 | + public TkPageData<AlarmProfileDTO> page( | |
45 | 45 | boolean isPtTenantAdmin, |
46 | 46 | String tenantId, |
47 | 47 | String currentUserId, |
... | ... | @@ -73,14 +73,14 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM |
73 | 73 | if (StringUtils.isNotEmpty(alarmProfileDTO.getId())) { |
74 | 74 | TkAlarmProfileEntity alarmProfile = baseMapper.selectById(alarmProfileDTO.getId()); |
75 | 75 | if (null == alarmProfile) { |
76 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | |
76 | + throw new TkDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | |
77 | 77 | } |
78 | 78 | if (!alarmProfile.getOrganizationId().equals(alarmProfileDTO.getOrganizationId())) { |
79 | 79 | Set<String> profiles = new HashSet<>(); |
80 | 80 | profiles.add(alarmProfileDTO.getId()); |
81 | 81 | Set<String>names = alarmProfileUsed(alarmProfileDTO.getTenantId(), profiles); |
82 | 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 | 86 | baseMapper.updateById(alarmProfileDTO.getEntity(TkAlarmProfileEntity.class)); |
... | ... | @@ -96,7 +96,7 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM |
96 | 96 | String alarmProfileId, String tenantId, Integer status) { |
97 | 97 | TkAlarmProfileEntity alarmProfile = baseMapper.selectById(alarmProfileId); |
98 | 98 | if (null == alarmProfile) { |
99 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | |
99 | + throw new TkDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | |
100 | 100 | } |
101 | 101 | if (!alarmProfile.getTenantId().equals(tenantId)) { |
102 | 102 | throw new NoneTenantAssetException(ErrorMessage.NOT_BELONG_CURRENT_TENANT); |
... | ... | @@ -111,7 +111,7 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM |
111 | 111 | public boolean deleteAlarmProFile(DeleteDTO deleteDTO) { |
112 | 112 | Set<String>names = alarmProfileUsed(deleteDTO.getTenantId(), deleteDTO.getIds()); |
113 | 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 | 116 | return baseMapper.deleteBatchIds(deleteDTO.getIds()) > 0; |
117 | 117 | } |
... | ... | @@ -144,7 +144,7 @@ public class TkAlarmProfileServiceImpl extends AbstractBaseService<AlarmProfileM |
144 | 144 | ytOrganizationMapper.findOrganizationTreeList( |
145 | 145 | tenantId, new HashSet<>(List.of(organizationId))); |
146 | 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 | 149 | Set<String> organizationIds = |
150 | 150 | organizationList.stream().map(BaseDTO::getId).collect(Collectors.toSet()); | ... | ... |
... | ... | @@ -8,11 +8,11 @@ import org.apache.commons.lang3.StringUtils; |
8 | 8 | import org.springframework.security.access.AccessDeniedException; |
9 | 9 | import org.springframework.stereotype.Service; |
10 | 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 | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.AlarmContactDTO; |
14 | 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 | 16 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmContactEntity; |
17 | 17 | import org.thingsboard.server.dao.yunteng.mapper.AlarmContactMapper; |
18 | 18 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
... | ... | @@ -71,7 +71,7 @@ public class TkAlarmServiceImpl extends AbstractBaseService<AlarmContactMapper, |
71 | 71 | .eq( TkAlarmContactEntity::getUsername, alarmContactDTO.getUsername()); |
72 | 72 | int Count = baseMapper.selectCount(Wrapper); |
73 | 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 | 76 | alarmContactDTO.setTenantId(tenantId); |
77 | 77 | TkAlarmContactEntity alarmContact = alarmContactDTO.getEntity(TkAlarmContactEntity.class); |
... | ... | @@ -112,7 +112,7 @@ public class TkAlarmServiceImpl extends AbstractBaseService<AlarmContactMapper, |
112 | 112 | TkAlarmContactEntity alarmContact = alarmContactMapper.selectById(alarmContactDTO.getId()); |
113 | 113 | if (alarmContact == null) { |
114 | 114 | //为空则抛出无效参数的异常 |
115 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
115 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
116 | 116 | } else { |
117 | 117 | if (!istenantAdmin) { |
118 | 118 | if (!tenantId.equals(alarmContactDTO.getTenantId())) { |
... | ... | @@ -133,7 +133,7 @@ public class TkAlarmServiceImpl extends AbstractBaseService<AlarmContactMapper, |
133 | 133 | */ |
134 | 134 | @Override |
135 | 135 | @Transactional |
136 | - public YtPageData<AlarmContactDTO> page(Map<String, Object> queryMap) { | |
136 | + public TkPageData<AlarmContactDTO> page(Map<String, Object> queryMap) { | |
137 | 137 | //查询分页,加入条模糊条件查询 |
138 | 138 | IPage<TkAlarmContactEntity> iPage = alarmContactMapper.selectPage(getPage(queryMap, "create_time", false), |
139 | 139 | new QueryWrapper<TkAlarmContactEntity>().lambda(). | ... | ... |
... | ... | @@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils; |
8 | 8 | import org.springframework.stereotype.Service; |
9 | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | 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 | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.ConfigurationActDTO; |
14 | 14 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationActEntity; |
... | ... | @@ -42,7 +42,7 @@ public class TkConfigurationActServiceImpl |
42 | 42 | newData.setEnabled(false); |
43 | 43 | baseMapper.insert(newData); |
44 | 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 | 46 | } else { |
47 | 47 | baseMapper.update(newData, filter); |
48 | 48 | } |
... | ... | @@ -65,7 +65,7 @@ public class TkConfigurationActServiceImpl |
65 | 65 | public List<ConfigurationActDTO> listConfigurationAct(String tenantId,String levelType,String levelId) { |
66 | 66 | if(!FastIotConstants.ConfigureLevel.CONTENT.equals(levelType) |
67 | 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 | 70 | LambdaQueryWrapper<TkConfigurationActEntity> filter = new QueryWrapper<TkConfigurationActEntity>().lambda() |
71 | 71 | .eq(TkConfigurationActEntity::getTenantId,tenantId) | ... | ... |
... | ... | @@ -7,11 +7,11 @@ import lombok.extern.slf4j.Slf4j; |
7 | 7 | import org.springframework.stereotype.Service; |
8 | 8 | import org.springframework.transaction.annotation.Transactional; |
9 | 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 | 11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.dto.*; |
13 | 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 | 15 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationCenterEntity; |
16 | 16 | import org.thingsboard.server.dao.yunteng.mapper.ConfigurationCenterMapper; |
17 | 17 | import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper; |
... | ... | @@ -35,7 +35,7 @@ public class TkConfigurationCenterServiceImpl |
35 | 35 | private final UserOrganizationMappingService userOrganizationMappingService; |
36 | 36 | |
37 | 37 | @Override |
38 | - public YtPageData<ConfigurationCenterDTO> page( | |
38 | + public TkPageData<ConfigurationCenterDTO> page( | |
39 | 39 | Map<String, Object> queryMap, boolean tenantAdmin) { |
40 | 40 | List<String> organizationIds = null; |
41 | 41 | if (null != queryMap.get("organizationId")) { |
... | ... | @@ -44,7 +44,7 @@ public class TkConfigurationCenterServiceImpl |
44 | 44 | organizationMapper.findOrganizationTreeList( |
45 | 45 | (String) queryMap.get("tenantId"), new HashSet<>(List.of(organizationId))); |
46 | 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 | 49 | organizationIds = |
50 | 50 | organizationList.stream().map(BaseDTO::getId).distinct().collect(Collectors.toList()); |
... | ... | @@ -86,7 +86,7 @@ public class TkConfigurationCenterServiceImpl |
86 | 86 | public ConfigurationCenterDTO updateConfiguration(ConfigurationCenterDTO configurationCenterDTO) { |
87 | 87 | TkConfigurationCenterEntity configurationCenter = baseMapper.selectById(configurationCenterDTO.getId()); |
88 | 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 | 91 | baseMapper.updateById(configurationCenterDTO.getEntity(TkConfigurationCenterEntity.class)); |
92 | 92 | return configurationCenterDTO; |
... | ... | @@ -101,7 +101,7 @@ public class TkConfigurationCenterServiceImpl |
101 | 101 | .in(TkConfigurationCenterEntity::getId, deleteDTO.getIds())); |
102 | 102 | for (TkConfigurationCenterEntity center : centerList) { |
103 | 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 | 107 | ytConfigurationContentService.deleteConfigurationContentByCenterId(deleteDTO.getIds()); | ... | ... |
... | ... | @@ -7,7 +7,7 @@ import lombok.extern.slf4j.Slf4j; |
7 | 7 | import org.springframework.stereotype.Service; |
8 | 8 | import org.springframework.transaction.annotation.Transactional; |
9 | 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 | 11 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.dto.*; |
13 | 13 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationActEntity; |
... | ... | @@ -93,7 +93,7 @@ public class TkConfigurationContentServiceImpl |
93 | 93 | TkConfigurationContentEntity configurationContent = |
94 | 94 | baseMapper.selectById(configurationContentDTO.getId()); |
95 | 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 | 98 | freshNodeData(configurationContentDTO.getTenantId(), configurationContentDTO.getContentId(), configurationContentDTO.getNodeIds()); |
99 | 99 | baseMapper.updateById(configurationContentDTO.getEntity(TkConfigurationContentEntity.class)); |
... | ... | @@ -109,7 +109,7 @@ public class TkConfigurationContentServiceImpl |
109 | 109 | .in(TkConfigurationContentEntity::getId, deleteDTO.getIds())); |
110 | 110 | for (TkConfigurationContentEntity center : centerList) { |
111 | 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 | 115 | deleteNodeDatas(null,deleteDTO.getIds()); | ... | ... |
... | ... | @@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils; |
8 | 8 | import org.springframework.stereotype.Service; |
9 | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | 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 | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.ConfigurationDatasourceDTO; |
14 | 14 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationDatasourceEntity; |
... | ... | @@ -40,7 +40,7 @@ public class TkConfigurationDatasourceServiceImpl |
40 | 40 | newData.setEnabled(false); |
41 | 41 | baseMapper.insert(newData); |
42 | 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 | 44 | } else { |
45 | 45 | baseMapper.update(newData, filter); |
46 | 46 | } |
... | ... | @@ -63,7 +63,7 @@ public class TkConfigurationDatasourceServiceImpl |
63 | 63 | public List<ConfigurationDatasourceDTO> listConfigurationDatasource(String tenantId,String levelType,String levelId) { |
64 | 64 | if(!FastIotConstants.ConfigureLevel.CONTENT.equals(levelType) |
65 | 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 | 68 | LambdaQueryWrapper<TkConfigurationDatasourceEntity> filter = new QueryWrapper<TkConfigurationDatasourceEntity>().lambda() |
69 | 69 | .eq(TkConfigurationDatasourceEntity::getTenantId,tenantId) | ... | ... |
... | ... | @@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils; |
8 | 8 | import org.springframework.stereotype.Service; |
9 | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | 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 | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.ConfigurationEventDTO; |
14 | 14 | import org.thingsboard.server.dao.yunteng.entities.TkConfigurationEventEntity; |
... | ... | @@ -42,7 +42,7 @@ public class TkConfigurationEventServiceImpl |
42 | 42 | newData.setEnabled(false); |
43 | 43 | baseMapper.insert(newData); |
44 | 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 | 46 | } else { |
47 | 47 | baseMapper.update(newData, filter); |
48 | 48 | } |
... | ... | @@ -65,7 +65,7 @@ public class TkConfigurationEventServiceImpl |
65 | 65 | public List<ConfigurationEventDTO> listConfigurationEvent(String tenantId,String levelType,String levelId) { |
66 | 66 | if(!FastIotConstants.ConfigureLevel.CONTENT.equals(levelType) |
67 | 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 | 70 | LambdaQueryWrapper<TkConfigurationEventEntity> filter = new QueryWrapper<TkConfigurationEventEntity>().lambda() |
71 | 71 | .eq(TkConfigurationEventEntity::getTenantId,tenantId) | ... | ... |
... | ... | @@ -15,11 +15,11 @@ import org.thingsboard.server.common.data.rule.RuleChainMetaData; |
15 | 15 | import org.thingsboard.server.common.data.rule.RuleNode; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
17 | 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 | 19 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
20 | 20 | import org.thingsboard.server.common.data.yunteng.dto.ConvertConfigDTO; |
21 | 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 | 23 | import org.thingsboard.server.dao.yunteng.ConvertConfig; |
24 | 24 | import org.thingsboard.server.dao.yunteng.mapper.ConvertConfigMapper; |
25 | 25 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
... | ... | @@ -41,7 +41,7 @@ public class TkConvertConfigServiceImpl |
41 | 41 | private final String convertNodeName = "dataConvert@thingskit"; |
42 | 42 | |
43 | 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 | 45 | IPage<ConvertConfig> iPage = |
46 | 46 | baseMapper.selectPage( |
47 | 47 | getPage(queryMap, FastIotConstants.DefaultOrder.CREATE_TIME, false), |
... | ... | @@ -71,7 +71,7 @@ public class TkConvertConfigServiceImpl |
71 | 71 | .eq(ConvertConfig::getId, convertConfig.getId()) |
72 | 72 | .eq(ConvertConfig::getTenantId, convertConfig.getTenantId())); |
73 | 73 | if (null == checkConfig) { |
74 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
74 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
75 | 75 | } |
76 | 76 | if (!checkConfig.getName().equals(config.getName())) { |
77 | 77 | // Check Name |
... | ... | @@ -79,7 +79,7 @@ public class TkConvertConfigServiceImpl |
79 | 79 | checkConvertConfigNameExist( |
80 | 80 | convertConfig.getId(), config.getName(), config.getType(), config.getTenantId()); |
81 | 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 | 91 | checkConvertConfigNameExist( |
92 | 92 | null, config.getName(), config.getType(), config.getTenantId()); |
93 | 93 | if (result) { |
94 | - throw new YtDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); | |
94 | + throw new TkDataValidationException(ErrorMessage.NAME_ALREADY_EXISTS.getMessage()); | |
95 | 95 | } |
96 | 96 | // DEFAULT DISABLE |
97 | 97 | config.setStatus(FastIotConstants.StateValue.DISABLE); |
... | ... | @@ -120,7 +120,7 @@ public class TkConvertConfigServiceImpl |
120 | 120 | public List<RuleNode> getRuleNodesByConvertConfigIds( |
121 | 121 | List<String> ids, Integer status, Integer nodeType) { |
122 | 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 | 125 | List<RuleNode> ruleNodes = new ArrayList<>(); |
126 | 126 | List<ConvertConfig> configList = | ... | ... |
... | ... | @@ -6,7 +6,7 @@ import org.springframework.beans.BeanUtils; |
6 | 6 | import org.springframework.stereotype.Service; |
7 | 7 | import org.thingsboard.server.common.data.StringUtils; |
8 | 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 | 10 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.dto.TkCustomerDeviceDTO; |
12 | 12 | import org.thingsboard.server.dao.yunteng.entities.TkCustomerDeviceEntity; |
... | ... | @@ -24,7 +24,7 @@ public class TkCustomerDeviceImpl implements TkCustomerDevice { |
24 | 24 | @Override |
25 | 25 | public List<TkCustomerDeviceDTO> getMappingByCustomerId(String customerId) { |
26 | 26 | if (StringUtils.isEmpty(customerId)) { |
27 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
27 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
28 | 28 | } |
29 | 29 | List<TkCustomerDeviceEntity> entities = |
30 | 30 | tkCustomerDeviceMapper.selectList( |
... | ... | @@ -48,7 +48,7 @@ public class TkCustomerDeviceImpl implements TkCustomerDevice { |
48 | 48 | public TkCustomerDeviceDTO saveCustomerDeviceMapping(TkCustomerDeviceDTO tkCustomerDeviceDTO) { |
49 | 49 | if (StringUtils.isEmpty(tkCustomerDeviceDTO.getCustomerId()) |
50 | 50 | || StringUtils.isEmpty(tkCustomerDeviceDTO.getDeviceId())) { |
51 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
51 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
52 | 52 | } |
53 | 53 | TkCustomerDeviceEntity entity = new TkCustomerDeviceEntity(); |
54 | 54 | BeanUtils.copyProperties(tkCustomerDeviceDTO, entity); |
... | ... | @@ -59,7 +59,7 @@ public class TkCustomerDeviceImpl implements TkCustomerDevice { |
59 | 59 | @Override |
60 | 60 | public boolean deleteCustomerDeviceMapping(List<String> deviceList) { |
61 | 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 | 64 | return tkCustomerDeviceMapper.delete( |
65 | 65 | new LambdaQueryWrapper<TkCustomerDeviceEntity>() | ... | ... |
... | ... | @@ -8,12 +8,12 @@ import org.apache.commons.lang3.StringUtils; |
8 | 8 | import org.springframework.stereotype.Service; |
9 | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | 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 | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.*; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.dto.board.ComponentLayoutDTO; |
15 | 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 | 17 | import org.thingsboard.server.dao.yunteng.entities.TkDataBoardEntity; |
18 | 18 | import org.thingsboard.server.dao.yunteng.entities.TkDataComponentEntity; |
19 | 19 | import org.thingsboard.server.dao.yunteng.mapper.DataBoardMapper; |
... | ... | @@ -35,7 +35,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, |
35 | 35 | private final DataComponentMapper dataComponentMapper; |
36 | 36 | |
37 | 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 | 39 | int zero = FastIotConstants.MagicNumber.ZERO; |
40 | 40 | String name = null != queryMap.get("name") ? queryMap.get("name").toString() : null; |
41 | 41 | String tenantId = |
... | ... | @@ -43,7 +43,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, |
43 | 43 | .map(Object::toString) |
44 | 44 | .orElseThrow( |
45 | 45 | () -> { |
46 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
46 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
47 | 47 | }); |
48 | 48 | String organizationId = |
49 | 49 | null != queryMap.get("organizationId") ? queryMap.get("organizationId").toString() : null; |
... | ... | @@ -53,7 +53,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, |
53 | 53 | organizationMapper.findOrganizationTreeList( |
54 | 54 | (String) queryMap.get("tenantId"), new HashSet<>(List.of(organizationId))); |
55 | 55 | if (list.size() == zero) { |
56 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
56 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
57 | 57 | } |
58 | 58 | organizationIds = list.stream().map(BaseDTO::getId).distinct().collect(Collectors.toList()); |
59 | 59 | } |
... | ... | @@ -101,7 +101,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, |
101 | 101 | .map(obj -> baseMapper.updateById(dataBoard)) |
102 | 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 | 107 | return dataBoard.getDTO(DataBoardDTO.class); |
... | ... | @@ -139,7 +139,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, |
139 | 139 | }) |
140 | 140 | .orElseThrow( |
141 | 141 | () -> { |
142 | - throw new YtDataValidationException( | |
142 | + throw new TkDataValidationException( | |
143 | 143 | ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); |
144 | 144 | }); |
145 | 145 | } | ... | ... |
... | ... | @@ -5,7 +5,7 @@ import com.fasterxml.jackson.databind.JsonNode; |
5 | 5 | import org.apache.commons.lang3.StringUtils; |
6 | 6 | import org.springframework.stereotype.Service; |
7 | 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 | 9 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
10 | 10 | import org.thingsboard.server.common.data.yunteng.dto.DataComponentDTO; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
... | ... | @@ -60,7 +60,7 @@ public class TkDataComponentServiceImpl |
60 | 60 | .map(obj -> baseMapper.updateById(dataComponent)) |
61 | 61 | .orElseThrow( |
62 | 62 | () -> { |
63 | - throw new YtDataValidationException( | |
63 | + throw new TkDataValidationException( | |
64 | 64 | ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); |
65 | 65 | }); |
66 | 66 | } | ... | ... |
... | ... | @@ -15,13 +15,13 @@ import org.thingsboard.server.common.data.id.TenantId; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; |
17 | 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 | 19 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
20 | 20 | import org.thingsboard.server.common.data.yunteng.dto.*; |
21 | 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 | 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 | 25 | import org.thingsboard.server.dao.yunteng.mapper.DeviceMapper; |
26 | 26 | import org.thingsboard.server.dao.yunteng.mapper.TkDeviceProfileMapper; |
27 | 27 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
... | ... | @@ -39,7 +39,7 @@ public class TkDeviceProfileServiceImpl |
39 | 39 | |
40 | 40 | private final DeviceMapper deviceMapper; |
41 | 41 | |
42 | - private final YtJpaDeviceProfileDao deviceProfileDao; | |
42 | + private final TkJpaDeviceProfileDao deviceProfileDao; | |
43 | 43 | |
44 | 44 | @Override |
45 | 45 | public boolean validateFormData(DeviceProfileDTO ytDeviceProfileDTO) { |
... | ... | @@ -49,13 +49,13 @@ public class TkDeviceProfileServiceImpl |
49 | 49 | |
50 | 50 | DeviceProfile profile = deviceProfileDao.findByName(tenantId, ytDeviceProfileDTO.getName()); |
51 | 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 | 54 | } else { |
55 | 55 | UUID profileId = UUID.fromString(ytDeviceProfileDTO.getId()); |
56 | 56 | DeviceProfile profile = deviceProfileDao.findById(tenantId, profileId); |
57 | 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 | 147 | deviceMapper.selectCount( |
148 | 148 | new QueryWrapper<TkDeviceEntity>().lambda().in(TkDeviceEntity::getProfileId, ids)); |
149 | 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 | 157 | } |
158 | 158 | |
159 | 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 | 161 | String tenantIdStr = |
162 | 162 | Optional.ofNullable(queryMap.get(QueryConstant.TENANT_ID)) |
163 | 163 | .map(Object::toString) |
... | ... | @@ -237,7 +237,7 @@ public class TkDeviceProfileServiceImpl |
237 | 237 | @Override |
238 | 238 | public List<DeviceProfileDTO> findDeviceProfileByIds(String tenantId, List<String> ids) { |
239 | 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 | 242 | List<TkDeviceProfileEntity> entities = |
243 | 243 | baseMapper.selectList( | ... | ... |
... | ... | @@ -11,13 +11,13 @@ import org.springframework.transaction.annotation.Transactional; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; |
13 | 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 | 15 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.dto.DeviceDTO; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; |
18 | 18 | import org.thingsboard.server.common.data.yunteng.dto.TkCustomerDeviceDTO; |
19 | 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 | 21 | import org.thingsboard.server.dao.yunteng.entities.TkDeviceProfileEntity; |
22 | 22 | import org.thingsboard.server.dao.yunteng.entities.TkDeviceScriptEntity; |
23 | 23 | import org.thingsboard.server.dao.yunteng.mapper.TkDeviceProfileMapper; |
... | ... | @@ -52,7 +52,7 @@ public class TkDeviceScriptServiceImpl |
52 | 52 | .eq(TkDeviceScriptEntity::getName, scriptDTO.getName()); |
53 | 53 | int results = baseMapper.selectCount(queryWrapper); |
54 | 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 | 57 | } else { |
58 | 58 | LambdaQueryWrapper<TkDeviceScriptEntity> queryWrapper = |
... | ... | @@ -69,10 +69,10 @@ public class TkDeviceScriptServiceImpl |
69 | 69 | for (TkDeviceScriptEntity item : results) { |
70 | 70 | if (item.getId().equals(scriptDTO.getId()) |
71 | 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 | 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 | 84 | @Transactional |
85 | 85 | public boolean updateScriptStatus(String tenantId, String id, Integer status) { |
86 | 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 | 89 | TkDeviceScriptEntity entity = baseMapper.selectById(id); |
90 | 90 | if (null == entity) { |
91 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
91 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
92 | 92 | } |
93 | 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 | 96 | entity.setStatus(status); |
97 | 97 | return baseMapper.updateById(entity) > FastIotConstants.MagicNumber.ZERO; |
... | ... | @@ -127,7 +127,7 @@ public class TkDeviceScriptServiceImpl |
127 | 127 | .in(TkDeviceProfileEntity::getScriptId, ids)); |
128 | 128 | if (usedList != null && usedList.size() > 0) { |
129 | 129 | List<String> names = usedList.stream().map(TkDeviceProfileEntity::getName).collect(Collectors.toList()); |
130 | - throw new YtDataValidationException( | |
130 | + throw new TkDataValidationException( | |
131 | 131 | String.format(ErrorMessage.PROJECT_USED_SCRIPT.getMessage(), names)); |
132 | 132 | } |
133 | 133 | } |
... | ... | @@ -191,7 +191,7 @@ public class TkDeviceScriptServiceImpl |
191 | 191 | } |
192 | 192 | |
193 | 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 | 196 | String tenantId = |
197 | 197 | Optional.ofNullable(queryMap.get(QueryConstant.TENANT_ID)) |
... | ... | @@ -213,7 +213,7 @@ public class TkDeviceScriptServiceImpl |
213 | 213 | scriptIds = getCustomerScripts(customerId, tenantId); |
214 | 214 | } |
215 | 215 | if (!isTenantAdmin && (null == scriptIds || scriptIds.isEmpty())) { |
216 | - return new YtPageData<>(new ArrayList<>(), 0); | |
216 | + return new TkPageData<>(new ArrayList<>(), 0); | |
217 | 217 | } |
218 | 218 | LambdaQueryWrapper<TkDeviceScriptEntity> queryWrapper = |
219 | 219 | new QueryWrapper<TkDeviceScriptEntity>() |
... | ... | @@ -232,7 +232,7 @@ public class TkDeviceScriptServiceImpl |
232 | 232 | scripts.getRecords().stream() |
233 | 233 | .map(entity -> entity.getDTO(TkDeviceScriptDTO.class)) |
234 | 234 | .collect(Collectors.toList()); |
235 | - return new YtPageData<>(records, scripts.getTotal()); | |
235 | + return new TkPageData<>(records, scripts.getTotal()); | |
236 | 236 | } |
237 | 237 | |
238 | 238 | @Override | ... | ... |
... | ... | @@ -18,7 +18,7 @@ import org.thingsboard.server.common.data.id.EntityId; |
18 | 18 | import org.thingsboard.server.common.data.id.TenantId; |
19 | 19 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
20 | 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 | 22 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
23 | 23 | import org.thingsboard.server.common.data.yunteng.dto.*; |
24 | 24 | import org.thingsboard.server.common.data.yunteng.enums.DataTypeEnum; |
... | ... | @@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
26 | 26 | import org.thingsboard.server.common.data.yunteng.enums.FunctionTypeEnum; |
27 | 27 | import org.thingsboard.server.common.data.yunteng.enums.ScopeEnum; |
28 | 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 | 30 | import org.thingsboard.server.dao.device.DeviceProfileDao; |
31 | 31 | import org.thingsboard.server.dao.yunteng.entities.*; |
32 | 32 | import org.thingsboard.server.dao.yunteng.mapper.*; |
... | ... | @@ -87,7 +87,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev |
87 | 87 | |
88 | 88 | private void validateUpdate(DeviceDTO deviceDTO) { |
89 | 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 | 96 | boolean insert = StringUtils.isBlank(deviceDTO.getId()); |
97 | 97 | String deviceTenantId; |
98 | 98 | if (StringUtils.isBlank(deviceDTO.getName())) { |
99 | - throw new YtDataValidationException("设备名称不能为空"); | |
99 | + throw new TkDataValidationException("设备名称不能为空"); | |
100 | 100 | } |
101 | 101 | // validate IOT DB |
102 | 102 | if (StringUtils.isBlank(deviceDTO.getProfileId())) { |
103 | - throw new YtDataValidationException("设备配置不能为空"); | |
103 | + throw new TkDataValidationException("设备配置不能为空"); | |
104 | 104 | } |
105 | 105 | |
106 | 106 | // 验证设备名称是否已经存在 如果此处直接使用deviceDTO 将有误 |
107 | 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 | 110 | if (insert) { |
111 | 111 | deviceTenantId = currentTenantId; |
... | ... | @@ -114,10 +114,10 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev |
114 | 114 | deviceTenantId = deviceDTO.getTenantId(); |
115 | 115 | TkDeviceEntity device = baseMapper.selectById(deviceDTO.getId()); |
116 | 116 | if (device == null) { |
117 | - throw new YtDataValidationException("设备不存在!"); | |
117 | + throw new TkDataValidationException("设备不存在!"); | |
118 | 118 | } |
119 | 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 | 122 | String oldOrganizationId = device.getOrganizationId(); |
123 | 123 | if (!oldOrganizationId.equals(deviceDTO.getOrganizationId())) { |
... | ... | @@ -132,9 +132,9 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev |
132 | 132 | TkOrganizationEntity organization = |
133 | 133 | tkOrganizationMapper.selectById(deviceDTO.getOrganizationId()); |
134 | 134 | if (null == deviceProfile || null == organization) { |
135 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
135 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
136 | 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 | 204 | } |
205 | 205 | } |
206 | 206 | if (sceneNames.size() > 0) { |
207 | - throw new YtDataValidationException( | |
207 | + throw new TkDataValidationException( | |
208 | 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 | 256 | String deviceProfileId) { |
257 | 257 | List<String> orgIds = organizationAllIds(tenantId, organizationId); |
258 | 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 | 261 | return ReflectUtils.sourceToTarget( |
262 | 262 | baseMapper.selectList( |
... | ... | @@ -276,7 +276,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev |
276 | 276 | String tenantId, String organizationId, DeviceTransportType transportType) { |
277 | 277 | List<String> orgIds = organizationAllIds(tenantId, organizationId); |
278 | 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 | 281 | List<String> deviceProfileIds = null; |
282 | 282 | if (null != transportType) { |
... | ... | @@ -306,7 +306,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev |
306 | 306 | @Override |
307 | 307 | public DeviceDTO checkDeviceByTenantIdAndDeviceId(String tenantId, String deviceId) { |
308 | 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 | 311 | return baseMapper.selectDetail(tenantId, deviceId); |
312 | 312 | } |
... | ... | @@ -321,7 +321,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev |
321 | 321 | public DeviceDTO checkDeviceByTenantIdAndId( |
322 | 322 | String tenantId, String deviceId, boolean isTbDeviceId) { |
323 | 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 | 326 | TkDeviceEntity device = |
327 | 327 | baseMapper.selectOne( |
... | ... | @@ -331,7 +331,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev |
331 | 331 | .eq(!isTbDeviceId, TkDeviceEntity::getId, deviceId)); |
332 | 332 | DeviceDTO deviceDTO = null != device ? device.getDTO(DeviceDTO.class) : null; |
333 | 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 | 336 | return deviceDTO; |
337 | 337 | } |
... | ... | @@ -354,7 +354,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev |
354 | 354 | } |
355 | 355 | |
356 | 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 | 358 | queryMap.put("tenantId", tenantId); |
359 | 359 | String organizationId = (String) queryMap.get("organizationId"); |
360 | 360 | if (!StringUtils.isEmpty(organizationId)) { |
... | ... | @@ -372,7 +372,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev |
372 | 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 | 399 | } |
400 | 400 | |
401 | 401 | @Override |
402 | - public YtPageData<RelationDeviceDTO> pageRelation(Map<String, Object> queryMap) { | |
402 | + public TkPageData<RelationDeviceDTO> pageRelation(Map<String, Object> queryMap) { | |
403 | 403 | IPage<TkDeviceEntity> page = getPage(queryMap, "last_online_time", false); |
404 | 404 | IPage<RelationDeviceDTO> deviceIPage = baseMapper.getRelationDevicePage(page, queryMap); |
405 | 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 | 409 | @Override |
... | ... | @@ -449,7 +449,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev |
449 | 449 | public String otherUsing(String deviceId, String tenantId) { |
450 | 450 | TkDeviceEntity device = baseMapper.selectById(deviceId); |
451 | 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 | 454 | String tbDeviceId = device.getTbDeviceId(); |
455 | 455 | |
... | ... | @@ -565,7 +565,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev |
565 | 565 | @Override |
566 | 566 | public List<DeviceDTO> findDevicesInfoByIds(String tenantId, Set<String> ids) { |
567 | 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 | 570 | List<TkDeviceEntity> entities = |
571 | 571 | baseMapper.selectList( |
... | ... | @@ -590,7 +590,7 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev |
590 | 590 | .map(obj -> obj.getDTO(DeviceDTO.class)) |
591 | 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 | ... | ... |
... | ... | @@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
4 | 4 | import org.apache.commons.lang3.StringUtils; |
5 | 5 | import org.springframework.stereotype.Service; |
6 | 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 | 8 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
9 | 9 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
10 | 10 | import org.thingsboard.server.common.data.yunteng.dto.DeviceTypeDTO; |
... | ... | @@ -24,7 +24,7 @@ public class TkDeviceTypeServiceImpl extends AbstractBaseService<DeviceTypeMappe |
24 | 24 | public List<DeviceTypeDTO> getDeviceTypeTree(String tenantId) { |
25 | 25 | if (StringUtils.isEmpty(tenantId)) { |
26 | 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 | 30 | List<TkDeviceTypeEntity> typeList = baseMapper.selectList( | ... | ... |
... | ... | @@ -6,13 +6,13 @@ import com.fasterxml.jackson.databind.node.ObjectNode; |
6 | 6 | import lombok.RequiredArgsConstructor; |
7 | 7 | import org.apache.commons.lang3.StringUtils; |
8 | 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 | 10 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.core.utils.FrpServerProperties; |
12 | 12 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.FrpInfoDTO; |
14 | 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 | 16 | import org.thingsboard.server.dao.yunteng.entities.TkFrpInfoEntity; |
17 | 17 | import org.thingsboard.server.dao.yunteng.mapper.FrpInfoMapper; |
18 | 18 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
... | ... | @@ -31,7 +31,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF |
31 | 31 | private final FrpServerProperties frpServerProperties; |
32 | 32 | |
33 | 33 | @Override |
34 | - public YtPageData<FrpInfoDTO> page(Map<String, Object> queryMap) { | |
34 | + public TkPageData<FrpInfoDTO> page(Map<String, Object> queryMap) { | |
35 | 35 | String proxyName = |
36 | 36 | queryMap.get("proxyName") != null ? queryMap.get("proxyName").toString() : null; |
37 | 37 | IPage<TkFrpInfoEntity> frpInfoIPage = |
... | ... | @@ -45,7 +45,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF |
45 | 45 | @Override |
46 | 46 | public FrpInfoDTO saveOrUpdateFrpInfo(FrpInfoDTO frpInfoDTO) { |
47 | 47 | if (null == frpInfoDTO) { |
48 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
48 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
49 | 49 | } |
50 | 50 | if (StringUtils.isEmpty(frpInfoDTO.getId())) { |
51 | 51 | frpInfoDTO.setCreateTime(LocalDateTime.now()); |
... | ... | @@ -59,7 +59,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF |
59 | 59 | .map(info -> baseMapper.updateById(frpInfoDTO.getEntity(TkFrpInfoEntity.class))) |
60 | 60 | .orElseThrow( |
61 | 61 | () -> |
62 | - new YtDataValidationException( | |
62 | + new TkDataValidationException( | |
63 | 63 | ErrorMessage.INVALID_PARAMETER_OR_NOT_MATCH_TENANT.getMessage())); |
64 | 64 | } |
65 | 65 | return frpInfoDTO; |
... | ... | @@ -68,7 +68,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF |
68 | 68 | @Override |
69 | 69 | public boolean deleteFrpInfo(DeleteDTO deleteDTO) { |
70 | 70 | if (deleteDTO.getIds().isEmpty()) { |
71 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
71 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
72 | 72 | } |
73 | 73 | return baseMapper.deleteBatchIds(deleteDTO.getIds()) > 0; |
74 | 74 | } |
... | ... | @@ -76,7 +76,7 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF |
76 | 76 | @Override |
77 | 77 | public FrpInfoDTO findFrpInfoById(String id) { |
78 | 78 | if (StringUtils.isEmpty(id)) { |
79 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
79 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
80 | 80 | } |
81 | 81 | TkFrpInfoEntity frpInfo = |
82 | 82 | baseMapper.selectOne(new LambdaQueryWrapper<TkFrpInfoEntity>().eq(TkFrpInfoEntity::getId, id)); |
... | ... | @@ -84,14 +84,14 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF |
84 | 84 | .map(info -> frpInfo.getDTO(FrpInfoDTO.class)) |
85 | 85 | .orElseThrow( |
86 | 86 | () -> |
87 | - new YtDataValidationException( | |
87 | + new TkDataValidationException( | |
88 | 88 | ErrorMessage.INVALID_PARAMETER_OR_NOT_MATCH_TENANT.getMessage())); |
89 | 89 | } |
90 | 90 | |
91 | 91 | @Override |
92 | 92 | public FrpInfoDTO findFrpInfoByProxyName(String proxyName) { |
93 | 93 | if (StringUtils.isEmpty(proxyName)) { |
94 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
94 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
95 | 95 | } |
96 | 96 | TkFrpInfoEntity frpInfo = |
97 | 97 | baseMapper.selectOne( |
... | ... | @@ -107,12 +107,12 @@ public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkF |
107 | 107 | Optional.ofNullable(content.get("user")) |
108 | 108 | .map(user -> content.get("user").get("run_id").asText()) |
109 | 109 | .orElseThrow( |
110 | - () -> new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | |
110 | + () -> new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | |
111 | 111 | Integer remotePort = |
112 | 112 | Optional.ofNullable(content.get("remote_port")) |
113 | 113 | .map(remote -> content.get("remote_port").asInt()) |
114 | 114 | .orElseThrow( |
115 | - () -> new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | |
115 | + () -> new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage())); | |
116 | 116 | |
117 | 117 | FrpInfoDTO saveFrpInfoDTO = new FrpInfoDTO(); |
118 | 118 | if (null == queryFrpInfoDTO) { | ... | ... |
... | ... | @@ -23,7 +23,7 @@ import org.thingsboard.server.common.data.yunteng.dto.*; |
23 | 23 | import org.thingsboard.server.common.data.yunteng.dto.statistics.*; |
24 | 24 | import org.thingsboard.server.common.data.yunteng.enums.RoleEnum; |
25 | 25 | import org.thingsboard.server.common.data.yunteng.enums.TrendType; |
26 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
26 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
27 | 27 | import org.thingsboard.server.dao.entity.EntityService; |
28 | 28 | import org.thingsboard.server.dao.timeseries.TimeseriesService; |
29 | 29 | import org.thingsboard.server.dao.usagerecord.ApiUsageStateService; |
... | ... | @@ -351,7 +351,7 @@ public class TkHomePageServiceImpl implements HomePageService { |
351 | 351 | |
352 | 352 | |
353 | 353 | @Override |
354 | - public YtPageData<TenantDTO> getHomePageRightInfo(Map<String, Object> queryMap) { | |
354 | + public TkPageData<TenantDTO> getHomePageRightInfo(Map<String, Object> queryMap) { | |
355 | 355 | return tenantService.getCurrentMonthExpireTenantPage(queryMap); |
356 | 356 | } |
357 | 357 | ... | ... |
... | ... | @@ -7,7 +7,7 @@ import lombok.extern.slf4j.Slf4j; |
7 | 7 | import org.springframework.stereotype.Service; |
8 | 8 | import org.springframework.transaction.annotation.Transactional; |
9 | 9 | import org.thingsboard.server.common.data.yunteng.dto.MailLogDTO; |
10 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
10 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
11 | 11 | import org.thingsboard.server.dao.yunteng.entities.TkMailLogEntity; |
12 | 12 | import org.thingsboard.server.dao.yunteng.mapper.MaiLogMapper; |
13 | 13 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
... | ... | @@ -24,7 +24,7 @@ import java.util.Set; |
24 | 24 | public class TkMailLogServiceImpl extends AbstractBaseService<MaiLogMapper, TkMailLogEntity> |
25 | 25 | implements TkMailLogService { |
26 | 26 | @Override |
27 | - public YtPageData<MailLogDTO> page(String tenantId, Map<String, Object> queryMap) { | |
27 | + public TkPageData<MailLogDTO> page(String tenantId, Map<String, Object> queryMap) { | |
28 | 28 | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
29 | 29 | IPage<TkMailLogEntity> configIPage = |
30 | 30 | baseMapper.selectPage( | ... | ... |
... | ... | @@ -11,7 +11,7 @@ import lombok.RequiredArgsConstructor; |
11 | 11 | import lombok.extern.slf4j.Slf4j; |
12 | 12 | import org.springframework.stereotype.Service; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.config.email.EmailConfiguration; |
14 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | |
14 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; | |
15 | 15 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.dto.request.EmailReqDTO; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.enums.AssetStatusEnum; |
... | ... | @@ -55,7 +55,7 @@ public class TkMailServiceImpl implements TkMailService { |
55 | 55 | TkMessageTemplateEntity messageTemplate = |
56 | 56 | messageTemplateMapper.selectOne(messageTemplateQueryWrapper); |
57 | 57 | if (null == messageTemplate) { |
58 | - throw new YtDataValidationException(ErrorMessage.MESSAGE_TEMPLATE_NOT_EXISTS.getMessage()); | |
58 | + throw new TkDataValidationException(ErrorMessage.MESSAGE_TEMPLATE_NOT_EXISTS.getMessage()); | |
59 | 59 | } |
60 | 60 | // 消息配置是否可用 |
61 | 61 | QueryWrapper<TkMessageConfigEntity> configQueryWrapper = new QueryWrapper<>(); |
... | ... | @@ -65,7 +65,7 @@ public class TkMailServiceImpl implements TkMailService { |
65 | 65 | .eq(TkMessageConfigEntity::getStatus, AssetStatusEnum.ENABLE.ordinal()); |
66 | 66 | TkMessageConfigEntity messageConfig = messageConfigMapper.selectOne(configQueryWrapper); |
67 | 67 | if (null == messageConfig) { |
68 | - throw new YtDataValidationException(ErrorMessage.MESSAGE_CONFIG_NOT_EXISTS.getMessage()); | |
68 | + throw new TkDataValidationException(ErrorMessage.MESSAGE_CONFIG_NOT_EXISTS.getMessage()); | |
69 | 69 | } |
70 | 70 | |
71 | 71 | JsonNode configNode = messageConfig.getConfig(); | ... | ... |
... | ... | @@ -8,11 +8,11 @@ import org.apache.commons.lang3.StringUtils; |
8 | 8 | import org.springframework.stereotype.Service; |
9 | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | 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 | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.MessageConfigDTO; |
14 | 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 | 16 | import org.thingsboard.server.dao.yunteng.entities.TkMessageConfigEntity; |
17 | 17 | import org.thingsboard.server.dao.yunteng.mapper.MessageConfigMapper; |
18 | 18 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
... | ... | @@ -30,7 +30,7 @@ public class TkMessageConfigServiceImpl |
30 | 30 | implements TkMessageConfigService { |
31 | 31 | |
32 | 32 | @Override |
33 | - public YtPageData<MessageConfigDTO> page(String tenantId, Map<String, Object> queryMap) { | |
33 | + public TkPageData<MessageConfigDTO> page(String tenantId, Map<String, Object> queryMap) { | |
34 | 34 | IPage<TkMessageConfigEntity> configIPage = |
35 | 35 | baseMapper.selectPage( |
36 | 36 | getPage(queryMap, "create_time", false), |
... | ... | @@ -78,7 +78,7 @@ public class TkMessageConfigServiceImpl |
78 | 78 | TkMessageConfigEntity config = baseMapper.selectById(configDTO.getId()); |
79 | 79 | if (configDTO.getStatus() == FastIotConstants.StateValue.ENABLE) { |
80 | 80 | if (StringUtils.isEmpty(config.getId())) { |
81 | - throw new YtDataValidationException("invalid parameters"); | |
81 | + throw new TkDataValidationException("invalid parameters"); | |
82 | 82 | } |
83 | 83 | checkMessageConfig(configDTO, tenantId); |
84 | 84 | } |
... | ... | @@ -146,7 +146,7 @@ public class TkMessageConfigServiceImpl |
146 | 146 | getEnableConfigByMessageAndPlatform( |
147 | 147 | configDTO.getMessageType(), configDTO.getPlatformType(), tenantId); |
148 | 148 | if (null != enableConfig && !enableConfig.getId().equalsIgnoreCase(configDTO.getId())) { |
149 | - throw new YtDataValidationException(ErrorMessage.ENABLED_CONFIG_IS_EXISTED.getMessage()); | |
149 | + throw new TkDataValidationException(ErrorMessage.ENABLED_CONFIG_IS_EXISTED.getMessage()); | |
150 | 150 | } |
151 | 151 | } |
152 | 152 | } | ... | ... |
... | ... | @@ -6,10 +6,10 @@ import org.apache.commons.lang3.StringUtils; |
6 | 6 | import org.springframework.stereotype.Service; |
7 | 7 | import org.springframework.transaction.annotation.Transactional; |
8 | 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 | 10 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.dto.MessageTemplateDTO; |
12 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
12 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
13 | 13 | import org.thingsboard.server.dao.yunteng.entities.TkMessageTemplateEntity; |
14 | 14 | import org.thingsboard.server.dao.yunteng.mapper.MessageTemplateMapper; |
15 | 15 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
... | ... | @@ -26,7 +26,7 @@ public class TkMessageTemplateServiceImpl |
26 | 26 | extends AbstractBaseService<MessageTemplateMapper, TkMessageTemplateEntity> |
27 | 27 | implements TkMessageTemplateService { |
28 | 28 | @Override |
29 | - public YtPageData<MessageTemplateDTO> page(Map<String, Object> queryMap) { | |
29 | + public TkPageData<MessageTemplateDTO> page(Map<String, Object> queryMap) { | |
30 | 30 | IPage<TkMessageTemplateEntity> configIPage = getPage(queryMap, FastIotConstants.DefaultOrder.CREATE_TIME,false); |
31 | 31 | IPage<MessageTemplateDTO> iPage = baseMapper.getTemplatePage(configIPage,queryMap); |
32 | 32 | return getPageData(iPage, MessageTemplateDTO.class); |
... | ... | @@ -61,11 +61,11 @@ public class TkMessageTemplateServiceImpl |
61 | 61 | queryTemplate.setTenantId(templateDTO.getTenantId()); |
62 | 62 | queryTemplate.setStatus(FastIotConstants.MagicNumber.ONE); |
63 | 63 | if(StringUtils.isEmpty(templateDTO.getTemplatePurpose()) || StringUtils.isEmpty(templateDTO.getMessageType())){ |
64 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
64 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
65 | 65 | } |
66 | 66 | List<MessageTemplateDTO> messageTemplateDTOList = baseMapper.findMessageTemplate(queryTemplate); |
67 | 67 | if(null!=messageTemplateDTOList && messageTemplateDTOList.size()>0){ |
68 | - throw new YtDataValidationException(ErrorMessage.EXIST_ENABLE_TEMPLATE.getMessage()); | |
68 | + throw new TkDataValidationException(ErrorMessage.EXIST_ENABLE_TEMPLATE.getMessage()); | |
69 | 69 | } |
70 | 70 | } |
71 | 71 | TkMessageTemplateEntity messageTemplate = baseMapper.selectById(templateDTO.getId()); | ... | ... |
... | ... | @@ -8,11 +8,11 @@ import lombok.extern.slf4j.Slf4j; |
8 | 8 | import org.springframework.stereotype.Service; |
9 | 9 | import org.springframework.transaction.annotation.Transactional; |
10 | 10 | import org.thingsboard.server.common.data.StringUtils; |
11 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | |
11 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; | |
12 | 12 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.dto.TkOpinionDTO; |
15 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
15 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
16 | 16 | import org.thingsboard.server.dao.yunteng.entities.TkOpinionEntity; |
17 | 17 | import org.thingsboard.server.dao.yunteng.mapper.TkOpinionMapper; |
18 | 18 | import org.thingsboard.server.dao.yunteng.service.*; |
... | ... | @@ -28,7 +28,7 @@ public class TkOpinionServiceImpl extends AbstractBaseService<TkOpinionMapper, T |
28 | 28 | private final UserOrganizationMappingService userOrganizationMappingService; |
29 | 29 | |
30 | 30 | @Override |
31 | - public YtPageData<TkOpinionDTO> pageDatas(IPage<TkOpinionEntity> pageInfrom, | |
31 | + public TkPageData<TkOpinionDTO> pageDatas(IPage<TkOpinionEntity> pageInfrom, | |
32 | 32 | boolean isPtTenantAdmin, String tenantId, String currentUserId, String organizationId, String name, Boolean status) { |
33 | 33 | |
34 | 34 | List<String> organizationIds = userOrganizationMappingService.getEnableOrganizationIds(isPtTenantAdmin, tenantId, currentUserId,null); |
... | ... | @@ -61,7 +61,7 @@ public class TkOpinionServiceImpl extends AbstractBaseService<TkOpinionMapper, T |
61 | 61 | .eq(TkOpinionEntity::getId,videoDTO.getId()); |
62 | 62 | TkOpinionEntity oldVideo = baseMapper.selectOne(filter); |
63 | 63 | if (null == oldVideo) { |
64 | - throw new YtDataValidationException(String.format(ErrorMessage.NOT_EXITED_OR_PERMISSION.getMessage(),videoDTO.getId())); | |
64 | + throw new TkDataValidationException(String.format(ErrorMessage.NOT_EXITED_OR_PERMISSION.getMessage(),videoDTO.getId())); | |
65 | 65 | } |
66 | 66 | baseMapper.updateById(videoDTO.getEntity(TkOpinionEntity.class)); |
67 | 67 | } else { | ... | ... |
... | ... | @@ -9,7 +9,7 @@ import org.apache.commons.lang3.StringUtils; |
9 | 9 | import org.springframework.stereotype.Service; |
10 | 10 | import org.springframework.transaction.annotation.Transactional; |
11 | 11 | import org.springframework.util.Assert; |
12 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | |
12 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; | |
13 | 13 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.dto.OrganizationDTO; |
... | ... | @@ -47,10 +47,10 @@ public class TkOrganizationServiceImpl extends AbstractBaseService<OrganizationM |
47 | 47 | TkOrganizationEntity organization = baseMapper.selectById(organizationDTO.getParentId()); |
48 | 48 | if (organization == null) { |
49 | 49 | // 父组织不存在 |
50 | - throw new YtDataValidationException("parent organization not exist!"); | |
50 | + throw new TkDataValidationException("parent organization not exist!"); | |
51 | 51 | } else { |
52 | 52 | if (!organization.getTenantId().equals(tenantId)) { |
53 | - throw new YtDataValidationException("Different current tenants"); | |
53 | + throw new TkDataValidationException("Different current tenants"); | |
54 | 54 | } |
55 | 55 | } |
56 | 56 | } |
... | ... | @@ -95,7 +95,7 @@ public class TkOrganizationServiceImpl extends AbstractBaseService<OrganizationM |
95 | 95 | @Transactional |
96 | 96 | public boolean deleteOrganizations(DeleteDTO deleteDTO, String tenantId) { |
97 | 97 | if (null == deleteDTO || deleteDTO.getIds().isEmpty()) { |
98 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
98 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
99 | 99 | } |
100 | 100 | String[] ids = deleteDTO.getIds().toArray(new String[deleteDTO.getIds().size()]); |
101 | 101 | Set<String> idToDelete = |
... | ... | @@ -103,7 +103,7 @@ public class TkOrganizationServiceImpl extends AbstractBaseService<OrganizationM |
103 | 103 | .map(OrganizationDTO::getId) |
104 | 104 | .collect(Collectors.toSet()); |
105 | 105 | if (idToDelete.size() != ids.length) { |
106 | - throw new YtDataValidationException("待删除数据存在子项,不能删除!"); | |
106 | + throw new TkDataValidationException("待删除数据存在子项,不能删除!"); | |
107 | 107 | } |
108 | 108 | List<TkUserOrganizationMappingEntity> userOrganizationMappingList = |
109 | 109 | userOrganizationMappingMapper.selectList( |
... | ... | @@ -111,18 +111,18 @@ public class TkOrganizationServiceImpl extends AbstractBaseService<OrganizationM |
111 | 111 | .lambda() |
112 | 112 | .in(TkUserOrganizationMappingEntity::getOrganizationId, idToDelete)); |
113 | 113 | if (!userOrganizationMappingList.isEmpty()) { |
114 | - throw new YtDataValidationException("待删除数据存在关联用户,不能删除!"); | |
114 | + throw new TkDataValidationException("待删除数据存在关联用户,不能删除!"); | |
115 | 115 | } |
116 | 116 | if (sceneMapper.selectCount( |
117 | 117 | new QueryWrapper<TkSceneLinkageEntity>().lambda().in(TkSceneLinkageEntity::getOrganizationId, ids)) |
118 | 118 | > 0) { |
119 | - throw new YtDataValidationException( | |
119 | + throw new TkDataValidationException( | |
120 | 120 | ErrorMessage.ORGANIZATION_EXISTED_SCENE_REACT.getMessage()); |
121 | 121 | } |
122 | 122 | if (contactMapper.selectCount( |
123 | 123 | new QueryWrapper<TkAlarmContactEntity>().lambda().in(TkAlarmContactEntity::getOrganizationId, ids)) |
124 | 124 | > 0) { |
125 | - throw new YtDataValidationException( | |
125 | + throw new TkDataValidationException( | |
126 | 126 | ErrorMessage.ORGANIZATION_EXISTED_ALARM_CONTACT.getMessage()); |
127 | 127 | } |
128 | 128 | |
... | ... | @@ -135,7 +135,7 @@ public class TkOrganizationServiceImpl extends AbstractBaseService<OrganizationM |
135 | 135 | .eq(TkDeviceEntity::getTenantId, tenantId) |
136 | 136 | .eq(TkDeviceEntity::getOrganizationId, id)); |
137 | 137 | if (!deviceList.isEmpty()) { |
138 | - throw new YtDataValidationException("待删除数据存在关联设备,不能删除!"); | |
138 | + throw new TkDataValidationException("待删除数据存在关联设备,不能删除!"); | |
139 | 139 | } |
140 | 140 | } |
141 | 141 | doDeleteUserOrganizationMapping(idToDelete); |
... | ... | @@ -160,7 +160,7 @@ public class TkOrganizationServiceImpl extends AbstractBaseService<OrganizationM |
160 | 160 | // 判断自己父id不能为本身的id |
161 | 161 | if (organizationDTO.getParentId() != null |
162 | 162 | && organizationDTO.getParentId().equals(organizationDTO.getId())) { |
163 | - throw new YtDataValidationException(ErrorMessage.IT_CANT_EQUAL_ITSELF.name()); | |
163 | + throw new TkDataValidationException(ErrorMessage.IT_CANT_EQUAL_ITSELF.name()); | |
164 | 164 | } |
165 | 165 | // 选择的组织 |
166 | 166 | TkOrganizationEntity organization = baseMapper.selectById(organizationDTO.getId()); |
... | ... | @@ -266,10 +266,10 @@ public class TkOrganizationServiceImpl extends AbstractBaseService<OrganizationM |
266 | 266 | public void bindUserToOrganization(String tenantId, String userId, String[] organizationIds) { |
267 | 267 | SysUserEntity user = userMapper.selectById(userId); |
268 | 268 | if (user == null) { |
269 | - throw new YtDataValidationException("所选用户不存在"); | |
269 | + throw new TkDataValidationException("所选用户不存在"); | |
270 | 270 | } |
271 | 271 | if (!user.getTenantId().equals(tenantId)) { |
272 | - throw new YtDataValidationException("所选用户不可用"); | |
272 | + throw new TkDataValidationException("所选用户不可用"); | |
273 | 273 | } |
274 | 274 | if (null != organizationIds && organizationIds.length > 0) { |
275 | 275 | Set<String> newBinding = |
... | ... | @@ -308,7 +308,7 @@ public class TkOrganizationServiceImpl extends AbstractBaseService<OrganizationM |
308 | 308 | for (String userId : userIds) { |
309 | 309 | SysUserEntity user = userMapper.selectById(userId); |
310 | 310 | if (user == null) { |
311 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
311 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
312 | 312 | } |
313 | 313 | userOrganizationMappingMapper.delete( |
314 | 314 | new QueryWrapper<TkUserOrganizationMappingEntity>() |
... | ... | @@ -325,7 +325,7 @@ public class TkOrganizationServiceImpl extends AbstractBaseService<OrganizationM |
325 | 325 | .eq(TkOrganizationEntity::getTenantId, tenantId) |
326 | 326 | .eq(TkOrganizationEntity::getId, id)); |
327 | 327 | if (null == organization) { |
328 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
328 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
329 | 329 | } |
330 | 330 | return organization.getDTO(OrganizationDTO.class); |
331 | 331 | } | ... | ... |
... | ... | @@ -10,7 +10,7 @@ import org.quartz.SchedulerException; |
10 | 10 | import org.springframework.stereotype.Service; |
11 | 11 | import org.springframework.transaction.annotation.Transactional; |
12 | 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 | 14 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.dto.*; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.dto.report.CycleParameterDTO; |
... | ... | @@ -19,7 +19,7 @@ import org.thingsboard.server.common.data.yunteng.dto.request.QueryConditionDTO; |
19 | 19 | import org.thingsboard.server.common.data.yunteng.enums.JobGroupEnum; |
20 | 20 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; |
21 | 21 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; |
22 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
22 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
23 | 23 | import org.thingsboard.server.dao.yunteng.entities.TkReportFormConfigEntity; |
24 | 24 | import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper; |
25 | 25 | import org.thingsboard.server.dao.yunteng.mapper.ReportFormConfigMapper; |
... | ... | @@ -40,7 +40,7 @@ public class TkReportFromConfigServiceImpl |
40 | 40 | private final UserOrganizationMappingService userOrganizationMappingService; |
41 | 41 | |
42 | 42 | @Override |
43 | - public YtPageData<ReportFormConfigDTO> page(Map<String, Object> queryMap, boolean tenantAdmin) { | |
43 | + public TkPageData<ReportFormConfigDTO> page(Map<String, Object> queryMap, boolean tenantAdmin) { | |
44 | 44 | String tenantId = |
45 | 45 | Optional.ofNullable(queryMap.get("tenantId")).map(Object::toString).orElse(null); |
46 | 46 | List<String> organizationIds = |
... | ... | @@ -79,7 +79,7 @@ public class TkReportFromConfigServiceImpl |
79 | 79 | if ((report.getExecuteWay() == FastIotConstants.MagicNumber.ONE |
80 | 80 | && StringUtils.isEmpty(report.getExecuteContent())) |
81 | 81 | || null == report.getExecuteAttributes()) { |
82 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
82 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
83 | 83 | } |
84 | 84 | if (null != report.getExecuteAttributes() |
85 | 85 | && report.getExecuteAttributes().size() > FastIotConstants.MagicNumber.ZERO) { |
... | ... | @@ -88,7 +88,7 @@ public class TkReportFromConfigServiceImpl |
88 | 88 | .forEach( |
89 | 89 | item -> { |
90 | 90 | if (StringUtils.isEmpty(item.getDevice()) || item.getAttributes().isEmpty()) { |
91 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
91 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
92 | 92 | } |
93 | 93 | }); |
94 | 94 | } |
... | ... | @@ -106,7 +106,7 @@ public class TkReportFromConfigServiceImpl |
106 | 106 | } else { |
107 | 107 | TkReportFormConfigEntity queryEntity = baseMapper.selectById(report.getId()); |
108 | 108 | if (!report.getTenantId().equals(queryEntity.getTenantId())) { |
109 | - throw new YtDataValidationException(ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); | |
109 | + throw new TkDataValidationException(ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage()); | |
110 | 110 | } |
111 | 111 | updateCheckSysJob(reportFormConfig); |
112 | 112 | // 需要调用修改转台接口修改状态 |
... | ... | @@ -120,7 +120,7 @@ public class TkReportFromConfigServiceImpl |
120 | 120 | @Transactional |
121 | 121 | public boolean deleteReportFormConfig(DeleteDTO deleteDTO) throws SchedulerException { |
122 | 122 | if (deleteDTO.getIds().isEmpty()) { |
123 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
123 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
124 | 124 | } |
125 | 125 | // 如存在定时任务,删除定时任务 |
126 | 126 | for (String id : deleteDTO.getIds()) { |
... | ... | @@ -134,7 +134,7 @@ public class TkReportFromConfigServiceImpl |
134 | 134 | public ReportFormConfigDTO updateStatusById(String tenantId, Integer status, String id) |
135 | 135 | throws SchedulerException { |
136 | 136 | if (StringUtils.isEmpty(tenantId) || status == null || StringUtils.isEmpty(id)) { |
137 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
137 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
138 | 138 | } |
139 | 139 | TkReportFormConfigEntity queryEntity = |
140 | 140 | baseMapper.selectOne( |
... | ... | @@ -162,7 +162,7 @@ public class TkReportFromConfigServiceImpl |
162 | 162 | .eq(TkReportFormConfigEntity::getTenantId, tenantId) |
163 | 163 | .eq(TkReportFormConfigEntity::getId, id)); |
164 | 164 | if (null == formConfig) { |
165 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
165 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
166 | 166 | } |
167 | 167 | return getReportFormConfigDTOByEntity(formConfig); |
168 | 168 | } |
... | ... | @@ -173,7 +173,7 @@ public class TkReportFromConfigServiceImpl |
173 | 173 | .map(this::getReportFormConfigDTOByEntity) |
174 | 174 | .orElseThrow( |
175 | 175 | () -> { |
176 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | |
176 | + throw new TkDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | |
177 | 177 | }); |
178 | 178 | } |
179 | 179 | |
... | ... | @@ -233,11 +233,11 @@ public class TkReportFromConfigServiceImpl |
233 | 233 | |
234 | 234 | private void checkCronExpression(String cronExpression) { |
235 | 235 | if (StringUtils.isEmpty(cronExpression)) { |
236 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
236 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
237 | 237 | } |
238 | 238 | // 检查cron表达式是否标准 |
239 | 239 | if (!tkSysJobService.checkCronExpressionIsValid(cronExpression)) { |
240 | - throw new YtDataValidationException(ErrorMessage.CRON_INVALID.getMessage()); | |
240 | + throw new TkDataValidationException(ErrorMessage.CRON_INVALID.getMessage()); | |
241 | 241 | } |
242 | 242 | } |
243 | 243 | |
... | ... | @@ -295,7 +295,7 @@ public class TkReportFromConfigServiceImpl |
295 | 295 | |
296 | 296 | private void generateExcelUpdateReportRecord(ReportFormConfigDTO reportFormConfigDTO) { |
297 | 297 | if (reportFormConfigDTO == null) { |
298 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
298 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
299 | 299 | } |
300 | 300 | // 立即执行报表生成,并创建一条报表执行记录 |
301 | 301 | ReportGenerateRecordDTO recordDTO = | ... | ... |
... | ... | @@ -20,7 +20,7 @@ import org.thingsboard.server.common.data.id.DeviceId; |
20 | 20 | import org.thingsboard.server.common.data.id.TenantId; |
21 | 21 | import org.thingsboard.server.common.data.kv.*; |
22 | 22 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
23 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | |
23 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; | |
24 | 24 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
25 | 25 | import org.thingsboard.server.common.data.yunteng.core.utils.FileStorageService; |
26 | 26 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
... | ... | @@ -32,7 +32,7 @@ import org.thingsboard.server.common.data.yunteng.dto.request.ExecuteAttributesD |
32 | 32 | import org.thingsboard.server.common.data.yunteng.dto.request.QueryConditionDTO; |
33 | 33 | import org.thingsboard.server.common.data.yunteng.enums.StatusEnum; |
34 | 34 | import org.thingsboard.server.common.data.yunteng.utils.ExcelUtil; |
35 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
35 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
36 | 36 | import org.thingsboard.server.dao.timeseries.TimeseriesService; |
37 | 37 | import org.thingsboard.server.dao.yunteng.entities.TkReportGenerateRecordEntity; |
38 | 38 | import org.thingsboard.server.dao.yunteng.mapper.ReportGenerateRecordMapper; |
... | ... | @@ -66,7 +66,7 @@ public class TkReportGenerateRecordServiceImpl |
66 | 66 | private final UserOrganizationMappingService userOrganizationMappingService; |
67 | 67 | |
68 | 68 | @Override |
69 | - public YtPageData<ReportGenerateRecordDTO> page( | |
69 | + public TkPageData<ReportGenerateRecordDTO> page( | |
70 | 70 | Map<String, Object> queryMap, boolean tenantAdmin) { |
71 | 71 | String reportConfigName = |
72 | 72 | Optional.ofNullable(queryMap.get("reportConfigName")).map(Object::toString).orElse(null); |
... | ... | @@ -118,7 +118,7 @@ public class TkReportGenerateRecordServiceImpl |
118 | 118 | .map(obj -> baseMapper.updateById(recordDTO.getEntity(TkReportGenerateRecordEntity.class))) |
119 | 119 | .orElseThrow( |
120 | 120 | () -> { |
121 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
121 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
122 | 122 | }); |
123 | 123 | } |
124 | 124 | return reportGenerateRecord.getDTO(ReportGenerateRecordDTO.class); |
... | ... | @@ -137,7 +137,7 @@ public class TkReportGenerateRecordServiceImpl |
137 | 137 | .eq(TkReportGenerateRecordEntity::getTenantId, tenantId) |
138 | 138 | .eq(TkReportGenerateRecordEntity::getId, id)); |
139 | 139 | if (null == record) { |
140 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
140 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
141 | 141 | } |
142 | 142 | return record.getDTO(ReportGenerateRecordDTO.class); |
143 | 143 | } |
... | ... | @@ -146,7 +146,7 @@ public class TkReportGenerateRecordServiceImpl |
146 | 146 | public ReportGenerateRecordDTO generateReportRecord( |
147 | 147 | ReportFormConfigDTO reportFormConfigDTO, String jobId) { |
148 | 148 | if (null == reportFormConfigDTO) { |
149 | - throw new YtDataValidationException(ErrorMessage.EXPORT_CONFIG_NON_EXISTENT.getMessage()); | |
149 | + throw new TkDataValidationException(ErrorMessage.EXPORT_CONFIG_NON_EXISTENT.getMessage()); | |
150 | 150 | } |
151 | 151 | OrganizationDTO organizationDTO = |
152 | 152 | tkOrganizationService.findOrganizationById( |
... | ... | @@ -243,7 +243,7 @@ public class TkReportGenerateRecordServiceImpl |
243 | 243 | .eq(TkReportGenerateRecordEntity::getTenantId, tenantId) |
244 | 244 | .eq(TkReportGenerateRecordEntity::getId, id)); |
245 | 245 | if (null == record) { |
246 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
246 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
247 | 247 | } |
248 | 248 | return record.getExecuteCondition(); |
249 | 249 | } | ... | ... |
... | ... | @@ -7,7 +7,7 @@ import org.springframework.stereotype.Service; |
7 | 7 | import org.thingsboard.server.common.data.StringUtils; |
8 | 8 | import org.thingsboard.server.common.data.rpc.RpcStatus; |
9 | 9 | import org.thingsboard.server.common.data.yunteng.dto.TkRpcRecordDTO; |
10 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
10 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
11 | 11 | import org.thingsboard.server.dao.yunteng.entities.TkRpcRecordEntity; |
12 | 12 | import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper; |
13 | 13 | import org.thingsboard.server.dao.yunteng.mapper.TkRpcRecordMapper; |
... | ... | @@ -31,7 +31,7 @@ public class TkRpcRecordServiceImpl extends AbstractBaseService<TkRpcRecordMappe |
31 | 31 | private final OrganizationMapper organizationMapper; |
32 | 32 | |
33 | 33 | @Override |
34 | - public YtPageData<TkRpcRecordDTO> pageDatas(IPage<TkRpcRecordEntity> pageInfrom, String tenantId, String deviceId, Boolean oneway, RpcStatus status, String organizationId, String name) { | |
34 | + public TkPageData<TkRpcRecordDTO> pageDatas(IPage<TkRpcRecordEntity> pageInfrom, String tenantId, String deviceId, Boolean oneway, RpcStatus status, String organizationId, String name) { | |
35 | 35 | List<String> organization = null; |
36 | 36 | if (StringUtils.isNotEmpty(organizationId)) { |
37 | 37 | List<String> organizationFilter = new ArrayList<>(); | ... | ... |
... | ... | @@ -6,7 +6,7 @@ import org.thingsboard.server.common.data.id.TenantId; |
6 | 6 | import org.thingsboard.server.common.data.rule.RuleChain; |
7 | 7 | import org.thingsboard.server.common.data.rule.RuleChainType; |
8 | 8 | import org.thingsboard.server.dao.service.Validator; |
9 | -import org.thingsboard.server.dao.yunteng.jpa.dao.YtJpaRuleChainDao; | |
9 | +import org.thingsboard.server.dao.yunteng.jpa.dao.TkJpaRuleChainDao; | |
10 | 10 | import org.thingsboard.server.dao.yunteng.service.TkRuleChainService; |
11 | 11 | |
12 | 12 | import java.util.List; |
... | ... | @@ -24,7 +24,7 @@ import java.util.List; |
24 | 24 | @Service |
25 | 25 | @RequiredArgsConstructor |
26 | 26 | public class TkRuleChainServiceImpl implements TkRuleChainService { |
27 | - private final YtJpaRuleChainDao ruleChainDao; | |
27 | + private final TkJpaRuleChainDao ruleChainDao; | |
28 | 28 | |
29 | 29 | |
30 | 30 | ... | ... |
... | ... | @@ -11,7 +11,7 @@ import org.springframework.stereotype.Service; |
11 | 11 | import org.springframework.transaction.annotation.Transactional; |
12 | 12 | import org.thingsboard.server.common.data.id.EntityId; |
13 | 13 | import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
14 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | |
14 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; | |
15 | 15 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.dto.*; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.enums.ActionTypeEnum; |
... | ... | @@ -20,7 +20,7 @@ import org.thingsboard.server.common.data.yunteng.enums.ScopeEnum; |
20 | 20 | import org.thingsboard.server.common.data.yunteng.enums.TriggerTypeEnum; |
21 | 21 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; |
22 | 22 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; |
23 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
23 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
24 | 24 | import org.thingsboard.server.dao.yunteng.entities.*; |
25 | 25 | import org.thingsboard.server.dao.yunteng.mapper.*; |
26 | 26 | import org.thingsboard.server.dao.yunteng.service.*; |
... | ... | @@ -97,7 +97,7 @@ public class TkSceneLinkageServiceImpl extends AbstractBaseService<SceneLinkageM |
97 | 97 | .in(TkSceneLinkageEntity::getId, ids); |
98 | 98 | int result = sceneLinkageMapper.delete(Wrapper); |
99 | 99 | if (result != ids.size()) { |
100 | - throw new YtDataValidationException("存在非当前用户创建的场景联动"); | |
100 | + throw new TkDataValidationException("存在非当前用户创建的场景联动"); | |
101 | 101 | } |
102 | 102 | // 删除场景,一并删除数据库触发器,执行条件,执行动作的数据 |
103 | 103 | triggerMapper.delete( |
... | ... | @@ -127,10 +127,10 @@ public class TkSceneLinkageServiceImpl extends AbstractBaseService<SceneLinkageM |
127 | 127 | // 获取场景 |
128 | 128 | TkSceneLinkageEntity sceneLinkage = baseMapper.selectById(sceneLinkageDTO.getId()); |
129 | 129 | if (sceneLinkage == null) { |
130 | - throw new YtDataValidationException("此场景已不存在"); | |
130 | + throw new TkDataValidationException("此场景已不存在"); | |
131 | 131 | } |
132 | 132 | if (!sceneLinkage.getCreator().equals(currentUserId)) { |
133 | - throw new YtDataValidationException("你不是此场景的创建者"); | |
133 | + throw new TkDataValidationException("你不是此场景的创建者"); | |
134 | 134 | } |
135 | 135 | String organizationId = sceneLinkage.getOrganizationId(); |
136 | 136 | List<DeviceDTO> organizationDevices = findDeviceList(organizationId, tenantId, customerId,new ArrayList<>()); |
... | ... | @@ -166,11 +166,11 @@ public class TkSceneLinkageServiceImpl extends AbstractBaseService<SceneLinkageM |
166 | 166 | List<String> deviceIds = triggerDTO.getEntityId(); |
167 | 167 | if (ScopeEnum.PART.equals(triggerDTO.getEntityType())) { |
168 | 168 | if (deviceIds == null || deviceIds.isEmpty()) { |
169 | - throw new YtDataValidationException(ErrorMessage.DEVICE_LOSED.getMessage()); | |
169 | + throw new TkDataValidationException(ErrorMessage.DEVICE_LOSED.getMessage()); | |
170 | 170 | } else { |
171 | 171 | for (String item : deviceIds) { |
172 | 172 | if (!tbDeviceIds.contains(item)) { |
173 | - throw new YtDataValidationException( | |
173 | + throw new TkDataValidationException( | |
174 | 174 | ErrorMessage.ORGANIZATION_DEVICE_NOT_MATCHED_IN_TRIGGER.getMessage()); |
175 | 175 | } |
176 | 176 | } |
... | ... | @@ -219,11 +219,11 @@ public class TkSceneLinkageServiceImpl extends AbstractBaseService<SceneLinkageM |
219 | 219 | List<String> deviceIds = action.getDeviceId(); |
220 | 220 | if (ScopeEnum.PART.equals(action.getEntityType())) { |
221 | 221 | if (deviceIds == null || deviceIds.isEmpty()) { |
222 | - throw new YtDataValidationException(ErrorMessage.DEVICE_LOSED.getMessage()); | |
222 | + throw new TkDataValidationException(ErrorMessage.DEVICE_LOSED.getMessage()); | |
223 | 223 | } else { |
224 | 224 | for (String item : deviceIds) { |
225 | 225 | if (!tbDeviceIds.contains(item)) { |
226 | - throw new YtDataValidationException( | |
226 | + throw new TkDataValidationException( | |
227 | 227 | ErrorMessage.ORGANIZATION_DEVICE_NOT_MATCHED_IN_ACTION.getMessage()); |
228 | 228 | } |
229 | 229 | } |
... | ... | @@ -276,11 +276,11 @@ public class TkSceneLinkageServiceImpl extends AbstractBaseService<SceneLinkageM |
276 | 276 | List<String> deviceIds = condition.getEntityId(); |
277 | 277 | if (ScopeEnum.PART.equals(condition.getEntityType())) { |
278 | 278 | if (deviceIds == null || deviceIds.isEmpty()) { |
279 | - throw new YtDataValidationException(ErrorMessage.DEVICE_LOSED.getMessage()); | |
279 | + throw new TkDataValidationException(ErrorMessage.DEVICE_LOSED.getMessage()); | |
280 | 280 | } else { |
281 | 281 | for (String item : deviceIds) { |
282 | 282 | if (!tbDeviceIds.contains(item)) { |
283 | - throw new YtDataValidationException( | |
283 | + throw new TkDataValidationException( | |
284 | 284 | ErrorMessage.ORGANIZATION_DEVICE_NOT_MATCHED_IN_ACTION.getMessage()); |
285 | 285 | } |
286 | 286 | } |
... | ... | @@ -319,7 +319,7 @@ public class TkSceneLinkageServiceImpl extends AbstractBaseService<SceneLinkageM |
319 | 319 | * @return SceneLinkageDTO 场景对象 |
320 | 320 | */ |
321 | 321 | @Override |
322 | - public YtPageData<SceneLinkageDTO> page( | |
322 | + public TkPageData<SceneLinkageDTO> page( | |
323 | 323 | Map<String, Object> queryMap, String tenantId, boolean isCustomerUser) { |
324 | 324 | queryMap.put("tenantId", tenantId); |
325 | 325 | // 拿到传入的组织id |
... | ... | @@ -390,7 +390,7 @@ public class TkSceneLinkageServiceImpl extends AbstractBaseService<SceneLinkageM |
390 | 390 | .collect(Collectors.toList()); |
391 | 391 | // 拿到当前组织ids所包含的设备集合 |
392 | 392 | if (orgIds.isEmpty()) { |
393 | - throw new YtDataValidationException(ErrorMessage.ORGANIZATION_NOT_EXTIED.getMessage()); | |
393 | + throw new TkDataValidationException(ErrorMessage.ORGANIZATION_NOT_EXTIED.getMessage()); | |
394 | 394 | } |
395 | 395 | |
396 | 396 | |
... | ... | @@ -452,7 +452,7 @@ public class TkSceneLinkageServiceImpl extends AbstractBaseService<SceneLinkageM |
452 | 452 | } |
453 | 453 | TkSceneLinkageEntity self = baseMapper.selectById(currentSceneId); |
454 | 454 | if (self == null) { |
455 | - throw new YtDataValidationException(ErrorMessage.SCENE_REACT_NOT_EXTIED.getMessage()); | |
455 | + throw new TkDataValidationException(ErrorMessage.SCENE_REACT_NOT_EXTIED.getMessage()); | |
456 | 456 | } |
457 | 457 | if (state == FastIotConstants.StateValue.DISABLE) { |
458 | 458 | enableIds.remove(currentSceneId); |
... | ... | @@ -503,7 +503,7 @@ public class TkSceneLinkageServiceImpl extends AbstractBaseService<SceneLinkageM |
503 | 503 | .collect(Collectors.toList()); |
504 | 504 | } |
505 | 505 | if (devices == null || devices.isEmpty()) { |
506 | - throw new YtDataValidationException(ErrorMessage.DEVICE_NOT_EXTIED.getMessage()); | |
506 | + throw new TkDataValidationException(ErrorMessage.DEVICE_NOT_EXTIED.getMessage()); | |
507 | 507 | } |
508 | 508 | } |
509 | 509 | deviceSceneMap(matchedDevices, devices, scenId); | ... | ... |
... | ... | @@ -7,7 +7,7 @@ import lombok.extern.slf4j.Slf4j; |
7 | 7 | import org.springframework.stereotype.Service; |
8 | 8 | import org.springframework.transaction.annotation.Transactional; |
9 | 9 | import org.thingsboard.server.common.data.yunteng.dto.SmsLogDTO; |
10 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
10 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
11 | 11 | import org.thingsboard.server.dao.yunteng.entities.TkSmsLogEntity; |
12 | 12 | import org.thingsboard.server.dao.yunteng.mapper.SmsLogMapper; |
13 | 13 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
... | ... | @@ -25,7 +25,7 @@ public class TkSmsLogServiceImpl extends AbstractBaseService<SmsLogMapper, TkSms |
25 | 25 | implements SmsLogService { |
26 | 26 | |
27 | 27 | @Override |
28 | - public YtPageData<SmsLogDTO> page(Map<String, Object> queryMap, String tenantId) { | |
28 | + public TkPageData<SmsLogDTO> page(Map<String, Object> queryMap, String tenantId) { | |
29 | 29 | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
30 | 30 | IPage<TkSmsLogEntity> configIPage = |
31 | 31 | baseMapper.selectPage( | ... | ... |
... | ... | @@ -10,11 +10,11 @@ import org.apache.commons.lang3.StringUtils; |
10 | 10 | import org.springframework.stereotype.Service; |
11 | 11 | import org.springframework.transaction.annotation.Transactional; |
12 | 12 | import org.thingsboard.common.util.JacksonUtil; |
13 | -import org.thingsboard.server.common.data.yunteng.config.sms.YtDefaultSmsSenderFactory; | |
13 | +import org.thingsboard.server.common.data.yunteng.config.sms.TkDefaultSmsSenderFactory; | |
14 | 14 | import org.thingsboard.server.common.data.yunteng.config.sms.SmsProviderConfiguration; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.config.sms.SmsSender; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.core.cache.CacheUtils; |
17 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | |
17 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; | |
18 | 18 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
19 | 19 | import org.thingsboard.server.common.data.yunteng.dto.request.CodeTTL; |
20 | 20 | import org.thingsboard.server.common.data.yunteng.dto.request.SmsReqDTO; |
... | ... | @@ -45,7 +45,7 @@ public class TkSmsServiceImpl implements TkSmsService { |
45 | 45 | |
46 | 46 | private final MessageConfigMapper messageConfigMapper; |
47 | 47 | |
48 | - private final YtDefaultSmsSenderFactory ytDefaultSmsSenderFactory; | |
48 | + private final TkDefaultSmsSenderFactory tkDefaultSmsSenderFactory; | |
49 | 49 | |
50 | 50 | private final SmsLogMapper smsLogMapper; |
51 | 51 | |
... | ... | @@ -60,7 +60,7 @@ public class TkSmsServiceImpl implements TkSmsService { |
60 | 60 | LinkedHashMap<String, String> templateParam = smsReqDTO.getParams(); |
61 | 61 | String templateId = smsReqDTO.getId(); |
62 | 62 | if (StringUtils.isEmpty(phoneNumbers) || StringUtils.isEmpty(templateId)) { |
63 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
63 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
64 | 64 | } |
65 | 65 | /** 消息模板是否可用 */ |
66 | 66 | QueryWrapper<TkMessageTemplateEntity> messageTemplateQueryWrapper = |
... | ... | @@ -72,7 +72,7 @@ public class TkSmsServiceImpl implements TkSmsService { |
72 | 72 | TkMessageTemplateEntity messageTemplate = |
73 | 73 | messageTemplateMapper.selectOne(messageTemplateQueryWrapper); |
74 | 74 | if (null == messageTemplate) { |
75 | - throw new YtDataValidationException(ErrorMessage.MESSAGE_TEMPLATE_NOT_EXISTS.getMessage()); | |
75 | + throw new TkDataValidationException(ErrorMessage.MESSAGE_TEMPLATE_NOT_EXISTS.getMessage()); | |
76 | 76 | } |
77 | 77 | |
78 | 78 | /** 消息配置是否可用 */ |
... | ... | @@ -83,7 +83,7 @@ public class TkSmsServiceImpl implements TkSmsService { |
83 | 83 | .eq(TkMessageConfigEntity::getStatus, AssetStatusEnum.ENABLE.ordinal()); |
84 | 84 | TkMessageConfigEntity messageConfig = messageConfigMapper.selectOne(configQueryWrapper); |
85 | 85 | if (null == messageConfig) { |
86 | - throw new YtDataValidationException(ErrorMessage.MESSAGE_CONFIG_NOT_EXISTS.getMessage()); | |
86 | + throw new TkDataValidationException(ErrorMessage.MESSAGE_CONFIG_NOT_EXISTS.getMessage()); | |
87 | 87 | } |
88 | 88 | |
89 | 89 | JsonNode configJsonNode = messageConfig.getConfig(); |
... | ... | @@ -100,12 +100,12 @@ public class TkSmsServiceImpl implements TkSmsService { |
100 | 100 | isMatch = false; |
101 | 101 | } |
102 | 102 | if (!isMatch) { |
103 | - throw new YtDataValidationException(ErrorMessage.SMS_CONFIG_ERROR.getMessage()); | |
103 | + throw new TkDataValidationException(ErrorMessage.SMS_CONFIG_ERROR.getMessage()); | |
104 | 104 | } |
105 | 105 | SmsProviderConfiguration smsProviderConfiguration = |
106 | 106 | JacksonUtil.convertValue(configObjectNode, SmsProviderConfiguration.class); |
107 | 107 | if (null != smsProviderConfiguration) { |
108 | - SmsSender smsSender = ytDefaultSmsSenderFactory.createSmsSender(smsProviderConfiguration); | |
108 | + SmsSender smsSender = tkDefaultSmsSenderFactory.createSmsSender(smsProviderConfiguration); | |
109 | 109 | String result = |
110 | 110 | smsSender.sendSms( |
111 | 111 | phoneNumbers, |
... | ... | @@ -145,11 +145,11 @@ public class TkSmsServiceImpl implements TkSmsService { |
145 | 145 | .lambda() |
146 | 146 | .eq(SysUserEntity::getPhoneNumber, phoneNumber)); |
147 | 147 | if (users.isEmpty()) { |
148 | - throw new YtDataValidationException("电话号码未在系统注册,请联系你的管理员"); | |
148 | + throw new TkDataValidationException("电话号码未在系统注册,请联系你的管理员"); | |
149 | 149 | } |
150 | 150 | if (users.get(0).getAccountExpireTime() != null |
151 | 151 | && users.get(0).getAccountExpireTime().isBefore(LocalDateTime.now())) { |
152 | - throw new YtDataValidationException(ErrorMessage.ACCOUNT_HAS_EXPIRED.getMessage()); | |
152 | + throw new TkDataValidationException(ErrorMessage.ACCOUNT_HAS_EXPIRED.getMessage()); | |
153 | 153 | } |
154 | 154 | // 获取是否有验证码存在,防止发送数量过多 |
155 | 155 | String key = |
... | ... | @@ -169,7 +169,7 @@ public class TkSmsServiceImpl implements TkSmsService { |
169 | 169 | }) |
170 | 170 | .orElse(true); |
171 | 171 | if (!canSend) { |
172 | - throw new YtDataValidationException(ErrorMessage.MESSAGE_SEND_TOO_FAST.getMessage()); | |
172 | + throw new TkDataValidationException(ErrorMessage.MESSAGE_SEND_TOO_FAST.getMessage()); | |
173 | 173 | } |
174 | 174 | |
175 | 175 | /** 消息模板是否可用 */ |
... | ... | @@ -182,7 +182,7 @@ public class TkSmsServiceImpl implements TkSmsService { |
182 | 182 | .eq(TkMessageTemplateEntity::getTemplatePurpose, purpose.name()) |
183 | 183 | .eq(TkMessageTemplateEntity::getMessageType, MessageTypeEnum.PHONE_MESSAGE.name())); |
184 | 184 | if (messageTemplates.isEmpty()) { |
185 | - throw new YtDataValidationException(ErrorMessage.MESSAGE_TEMPLATE_NOT_EXISTS.getMessage()); | |
185 | + throw new TkDataValidationException(ErrorMessage.MESSAGE_TEMPLATE_NOT_EXISTS.getMessage()); | |
186 | 186 | } |
187 | 187 | |
188 | 188 | /** 消息配置是否可用 */ |
... | ... | @@ -194,7 +194,7 @@ public class TkSmsServiceImpl implements TkSmsService { |
194 | 194 | .eq(TkMessageConfigEntity::getStatus, AssetStatusEnum.ENABLE.ordinal()); |
195 | 195 | TkMessageConfigEntity messageConfig = messageConfigMapper.selectOne(configQueryWrapper); |
196 | 196 | if (null == messageConfig) { |
197 | - throw new YtDataValidationException(ErrorMessage.MESSAGE_CONFIG_NOT_EXISTS.getMessage()); | |
197 | + throw new TkDataValidationException(ErrorMessage.MESSAGE_CONFIG_NOT_EXISTS.getMessage()); | |
198 | 198 | } |
199 | 199 | |
200 | 200 | String code = RandomStringUtils.randomNumeric(6); | ... | ... |
... | ... | @@ -14,13 +14,13 @@ import org.springframework.stereotype.Service; |
14 | 14 | import org.springframework.transaction.annotation.Transactional; |
15 | 15 | import org.thingsboard.server.common.data.id.EntityId; |
16 | 16 | import org.thingsboard.server.common.data.query.TsValue; |
17 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | |
17 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; | |
18 | 18 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
19 | 19 | import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; |
20 | 20 | import org.thingsboard.server.common.data.yunteng.dto.request.TenantReqDTO; |
21 | 21 | import org.thingsboard.server.common.data.yunteng.enums.TenantStatusEnum; |
22 | 22 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; |
23 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
23 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
24 | 24 | import org.thingsboard.server.dao.yunteng.entities.*; |
25 | 25 | import org.thingsboard.server.dao.yunteng.mapper.*; |
26 | 26 | import org.thingsboard.server.dao.yunteng.service.*; |
... | ... | @@ -75,12 +75,12 @@ public class TkTenantServiceImpl extends AbstractBaseService<TenantMapper, SysTe |
75 | 75 | } |
76 | 76 | |
77 | 77 | @Override |
78 | - public YtPageData<TenantDTO> page(Map<String, Object> queryMap) { | |
78 | + public TkPageData<TenantDTO> page(Map<String, Object> queryMap) { | |
79 | 79 | IPage<SysTenantEntity> tenantIPage = getPage(queryMap, "create_time", false); |
80 | 80 | IPage<TenantDTO> userPage = |
81 | 81 | baseMapper.getTenantPage( |
82 | 82 | tenantIPage, (String) queryMap.get("tenantName"), EntityId.NULL_UUID.toString()); |
83 | - YtPageData<TenantDTO> ytPageData = getPageData(userPage, TenantDTO.class); | |
83 | + TkPageData<TenantDTO> ytPageData = getPageData(userPage, TenantDTO.class); | |
84 | 84 | determineTenantStatus(ytPageData.getItems()); |
85 | 85 | return ytPageData; |
86 | 86 | } |
... | ... | @@ -105,7 +105,7 @@ public class TkTenantServiceImpl extends AbstractBaseService<TenantMapper, SysTe |
105 | 105 | public TenantDTO updateTenant(TenantDTO tenantDTO) { |
106 | 106 | SysTenantEntity tenant = baseMapper.selectById(tenantDTO.getId()); |
107 | 107 | if (tenant == null) { |
108 | - throw new YtDataValidationException("tenant does not exist"); | |
108 | + throw new TkDataValidationException("tenant does not exist"); | |
109 | 109 | } |
110 | 110 | String existTenantId = tenant.getTenantId(); |
111 | 111 | tenantDTO.copyToEntity(tenant); |
... | ... | @@ -294,7 +294,7 @@ public class TkTenantServiceImpl extends AbstractBaseService<TenantMapper, SysTe |
294 | 294 | @Override |
295 | 295 | public List<String> getTenantRolesByTenantId(String tenantId) { |
296 | 296 | if (StringUtils.isEmpty(tenantId)) { |
297 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
297 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
298 | 298 | } |
299 | 299 | List<String> roles = new ArrayList<>(); |
300 | 300 | List<SysTenantRoleEntity> tenantRoleList = |
... | ... | @@ -307,7 +307,7 @@ public class TkTenantServiceImpl extends AbstractBaseService<TenantMapper, SysTe |
307 | 307 | } |
308 | 308 | |
309 | 309 | @Override |
310 | - public YtPageData<TenantDTO> getCurrentMonthExpireTenantPage(Map<String, Object> queryMap) { | |
310 | + public TkPageData<TenantDTO> getCurrentMonthExpireTenantPage(Map<String, Object> queryMap) { | |
311 | 311 | IPage<SysTenantEntity> tenantIPage = getPage(queryMap, "create_time", true); |
312 | 312 | IPage<TenantDTO> tenantDTOIPage = baseMapper.getCurrentMonthExpireTenantPage(tenantIPage); |
313 | 313 | return getPageData(tenantDTOIPage, TenantDTO.class); | ... | ... |
... | ... | @@ -15,7 +15,7 @@ import org.springframework.web.client.RestTemplate; |
15 | 15 | import org.thingsboard.server.common.data.StringUtils; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.config.third.WechatProperties; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.core.cache.CacheUtils; |
18 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | |
18 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; | |
19 | 19 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
20 | 20 | import org.thingsboard.server.common.data.yunteng.dto.UserDTO; |
21 | 21 | import org.thingsboard.server.common.data.yunteng.dto.UserDetailsDTO; |
... | ... | @@ -25,7 +25,7 @@ import org.thingsboard.server.common.data.yunteng.enums.MessageTypeEnum; |
25 | 25 | import org.thingsboard.server.common.data.yunteng.enums.MsgTemplatePurposeEnum; |
26 | 26 | import org.thingsboard.server.common.data.yunteng.enums.ThirdPlatformEnum; |
27 | 27 | import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil; |
28 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
28 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
29 | 29 | import org.thingsboard.server.dao.yunteng.entities.SysUserEntity; |
30 | 30 | import org.thingsboard.server.dao.yunteng.entities.TkThirdUserEntity; |
31 | 31 | import org.thingsboard.server.dao.yunteng.mapper.UserMapper; |
... | ... | @@ -53,7 +53,7 @@ public class TkThirdPlatformServiceImpl extends AbstractBaseService<TkThirdPlatf |
53 | 53 | private final WechatProperties wechatProperties; |
54 | 54 | |
55 | 55 | @Override |
56 | - public YtPageData<TkThirdUserDTO> pageDatas(IPage<TkThirdUserEntity> pageInfrom, ThirdPlatformEnum platformName, String name) { | |
56 | + public TkPageData<TkThirdUserDTO> pageDatas(IPage<TkThirdUserEntity> pageInfrom, ThirdPlatformEnum platformName, String name) { | |
57 | 57 | Wrapper pageFilter = new QueryWrapper<TkThirdUserEntity>() |
58 | 58 | .lambda() |
59 | 59 | .eq(pageInfrom != null, TkThirdUserEntity::getPlatformName, platformName) |
... | ... | @@ -76,14 +76,14 @@ public class TkThirdPlatformServiceImpl extends AbstractBaseService<TkThirdPlatf |
76 | 76 | break; |
77 | 77 | } |
78 | 78 | if (user == null) { |
79 | - throw new YtDataValidationException(ErrorMessage.USER_NOT_EXISTS.getMessage()); | |
79 | + throw new TkDataValidationException(ErrorMessage.USER_NOT_EXISTS.getMessage()); | |
80 | 80 | } |
81 | 81 | |
82 | 82 | Wrapper filter = new QueryWrapper<TkThirdUserEntity>().lambda() |
83 | 83 | .eq(TkThirdUserEntity::getAppUserId, user.getId()); |
84 | 84 | TkThirdUserEntity oldBind = baseMapper.selectOne(filter); |
85 | 85 | if(oldBind != null){ |
86 | - throw new YtDataValidationException(String.format(ErrorMessage.APP_USER_BINDED.getMessage(),user.getUsername())); | |
86 | + throw new TkDataValidationException(String.format(ErrorMessage.APP_USER_BINDED.getMessage(),user.getUsername())); | |
87 | 87 | } |
88 | 88 | |
89 | 89 | if (StringUtils.isEmpty(user.getAvatar()) && StringUtils.isNotEmpty(dto.getAvatarUrl())) { |
... | ... | @@ -168,7 +168,7 @@ public class TkThirdPlatformServiceImpl extends AbstractBaseService<TkThirdPlatf |
168 | 168 | |
169 | 169 | SysUserEntity user = userMapper.selectById(appUserId); |
170 | 170 | if(!tenantId.equals(user.getTenantId())){ |
171 | - throw new YtDataValidationException(ErrorMessage.NO_PERMISSION.getMessage()); | |
171 | + throw new TkDataValidationException(ErrorMessage.NO_PERMISSION.getMessage()); | |
172 | 172 | } |
173 | 173 | Wrapper filter = new QueryWrapper<TkThirdUserEntity>().lambda() |
174 | 174 | .eq(TkThirdUserEntity::getAppUserId,appUserId) |
... | ... | @@ -192,7 +192,7 @@ public class TkThirdPlatformServiceImpl extends AbstractBaseService<TkThirdPlatf |
192 | 192 | JsonNode result = JacksonUtil.toJsonNode(response); |
193 | 193 | |
194 | 194 | if(result.has("errcode")){ |
195 | - throw new YtDataValidationException(String.format(ErrorMessage.THIRD_PLATFORM_EXCEPTION.getMessage(),ThirdPlatformEnum.WECHAT,result.get("errmsg").asText())); | |
195 | + throw new TkDataValidationException(String.format(ErrorMessage.THIRD_PLATFORM_EXCEPTION.getMessage(),ThirdPlatformEnum.WECHAT,result.get("errmsg").asText())); | |
196 | 196 | } |
197 | 197 | String thirdUserId = result.get("unionid").asText(); |
198 | 198 | return thirdUserId; | ... | ... |
... | ... | @@ -9,11 +9,11 @@ import lombok.extern.slf4j.Slf4j; |
9 | 9 | import org.springframework.stereotype.Service; |
10 | 10 | import org.springframework.transaction.annotation.Transactional; |
11 | 11 | import org.thingsboard.server.common.data.StringUtils; |
12 | -import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException; | |
12 | +import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; | |
13 | 13 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.dto.TkVideoPlatformDTO; |
16 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
16 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
17 | 17 | import org.thingsboard.server.dao.yunteng.entities.TkVideoPlatformEntity; |
18 | 18 | import org.thingsboard.server.dao.yunteng.mapper.TkVideoPlatformMapper; |
19 | 19 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
... | ... | @@ -32,7 +32,7 @@ public class TkVideoPlatformServiceImpl extends AbstractBaseService<TkVideoPlatf |
32 | 32 | private final TkVideoService tkVideoService; |
33 | 33 | |
34 | 34 | @Override |
35 | - public YtPageData<TkVideoPlatformDTO> page(IPage<TkVideoPlatformEntity> pageInfo, | |
35 | + public TkPageData<TkVideoPlatformDTO> page(IPage<TkVideoPlatformEntity> pageInfo, | |
36 | 36 | boolean isPtTenantAdmin, String tenantId, String currentUserId, String host) { |
37 | 37 | IPage<TkVideoPlatformDTO> page = |
38 | 38 | baseMapper.getVideoPlatformPage(pageInfo, tenantId, host); |
... | ... | @@ -49,7 +49,7 @@ public class TkVideoPlatformServiceImpl extends AbstractBaseService<TkVideoPlatf |
49 | 49 | .eq(TkVideoPlatformEntity::getId, videoPlatformDTO.getId()); |
50 | 50 | TkVideoPlatformEntity oldVideo = baseMapper.selectOne(filter); |
51 | 51 | if (null == oldVideo) { |
52 | - throw new YtDataValidationException(String.format(ErrorMessage.NOT_EXITED_OR_PERMISSION.getMessage(), | |
52 | + throw new TkDataValidationException(String.format(ErrorMessage.NOT_EXITED_OR_PERMISSION.getMessage(), | |
53 | 53 | videoPlatformDTO.getId())); |
54 | 54 | } |
55 | 55 | baseMapper.updateById(videoPlatformDTO.getEntity(TkVideoPlatformEntity.class)); |
... | ... | @@ -57,7 +57,7 @@ public class TkVideoPlatformServiceImpl extends AbstractBaseService<TkVideoPlatf |
57 | 57 | TkVideoPlatformEntity entity = baseMapper.selectOne(new LambdaQueryWrapper<TkVideoPlatformEntity>(). |
58 | 58 | eq(TkVideoPlatformEntity::getHost, videoPlatformDTO.getHost())); |
59 | 59 | if (null != entity) { |
60 | - throw new YtDataValidationException(ErrorMessage.VIDEO_PLATFORM_HOST_EXISTED.getMessage()); | |
60 | + throw new TkDataValidationException(ErrorMessage.VIDEO_PLATFORM_HOST_EXISTED.getMessage()); | |
61 | 61 | } |
62 | 62 | baseMapper.insert(videoPlatformDTO.getEntity(TkVideoPlatformEntity.class)); |
63 | 63 | } |
... | ... | @@ -70,7 +70,7 @@ public class TkVideoPlatformServiceImpl extends AbstractBaseService<TkVideoPlatf |
70 | 70 | public boolean deleteDataByIds(DeleteDTO deleteDTO) { |
71 | 71 | boolean result = tkVideoService.checkConfigIdsIsUseForVideo(deleteDTO.getIds()); |
72 | 72 | if(result){ |
73 | - throw new YtDataValidationException(ErrorMessage.VIDEO_PLATFORM_USED.getMessage()); | |
73 | + throw new TkDataValidationException(ErrorMessage.VIDEO_PLATFORM_USED.getMessage()); | |
74 | 74 | } |
75 | 75 | Wrapper<TkVideoPlatformEntity> filter = new QueryWrapper<TkVideoPlatformEntity>().lambda() |
76 | 76 | .eq(TkVideoPlatformEntity::getTenantId, deleteDTO.getTenantId()) | ... | ... |
... | ... | @@ -10,13 +10,13 @@ import org.springframework.stereotype.Service; |
10 | 10 | import org.springframework.transaction.annotation.Transactional; |
11 | 11 | import org.thingsboard.server.common.data.StringUtils; |
12 | 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 | 14 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.dto.TkVideoDTO; |
17 | 17 | import org.thingsboard.server.common.data.yunteng.utils.tools.HikVisionArtemisPostUtils; |
18 | 18 | import org.thingsboard.server.common.data.yunteng.utils.tools.ProtocolType; |
19 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
19 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
20 | 20 | import org.thingsboard.server.dao.yunteng.entities.TkVideoEntity; |
21 | 21 | import org.thingsboard.server.dao.yunteng.mapper.TkVideoMapper; |
22 | 22 | import org.thingsboard.server.dao.yunteng.service.AbstractBaseService; |
... | ... | @@ -35,7 +35,7 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid |
35 | 35 | private final UserOrganizationMappingService userOrganizationMappingService; |
36 | 36 | |
37 | 37 | @Override |
38 | - public YtPageData<TkVideoDTO> pageDatas(IPage<TkVideoEntity> pageInfrom, | |
38 | + public TkPageData<TkVideoDTO> pageDatas(IPage<TkVideoEntity> pageInfrom, | |
39 | 39 | boolean isPtTenantAdmin, String tenantId, String currentUserId, |
40 | 40 | String organizationId, String name, Boolean status) { |
41 | 41 | |
... | ... | @@ -67,7 +67,7 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid |
67 | 67 | .eq(TkVideoEntity::getTenantId, videoDTO.getTenantId()) |
68 | 68 | .eq(TkVideoEntity::getId, videoDTO.getId())); |
69 | 69 | if (null == oldVideo) { |
70 | - throw new YtDataValidationException(String.format(ErrorMessage.NOT_EXITED_OR_PERMISSION.getMessage(), videoDTO.getId())); | |
70 | + throw new TkDataValidationException(String.format(ErrorMessage.NOT_EXITED_OR_PERMISSION.getMessage(), videoDTO.getId())); | |
71 | 71 | } |
72 | 72 | baseMapper.updateById(videoDTO.getEntity(TkVideoEntity.class)); |
73 | 73 | } else { |
... | ... | @@ -95,7 +95,7 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid |
95 | 95 | List<TkVideoDTO> videoDTOList = baseMapper.getVideoInfosByTenantIdOrAccessModeOrId(tenantId, entityId, |
96 | 96 | FastIotConstants.MagicNumber.ONE, customerUserId); |
97 | 97 | if (videoDTOList.size() == 0) { |
98 | - throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
98 | + throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); | |
99 | 99 | } |
100 | 100 | TkVideoDTO videoDTO = videoDTOList.get(0); |
101 | 101 | ProtocolType protocolType = videoDTO.getPlayProtocol() == 0 ? ProtocolType.HLS : ProtocolType.HLSS; | ... | ... |
dao/src/main/java/org/thingsboard/server/dao/yunteng/jpa/dao/TkJpaDeviceProfileDao.java
renamed from
dao/src/main/java/org/thingsboard/server/dao/yunteng/jpa/dao/YtJpaDeviceProfileDao.java
... | ... | @@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.page.PageLink; |
26 | 26 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; |
27 | 27 | import org.thingsboard.server.dao.DaoUtil; |
28 | 28 | import org.thingsboard.server.dao.sql.device.JpaDeviceProfileDao; |
29 | -import org.thingsboard.server.dao.yunteng.jpa.repository.YtDeviceProfileRepository; | |
29 | +import org.thingsboard.server.dao.yunteng.jpa.repository.TkDeviceProfileRepository; | |
30 | 30 | |
31 | 31 | import java.util.List; |
32 | 32 | import java.util.Objects; |
... | ... | @@ -34,22 +34,22 @@ import java.util.Objects; |
34 | 34 | @Component |
35 | 35 | @Primary |
36 | 36 | @AllArgsConstructor |
37 | -public class YtJpaDeviceProfileDao extends JpaDeviceProfileDao { | |
37 | +public class TkJpaDeviceProfileDao extends JpaDeviceProfileDao { | |
38 | 38 | |
39 | - private final YtDeviceProfileRepository ytDeviceProfileRepository; | |
39 | + private final TkDeviceProfileRepository tkDeviceProfileRepository; | |
40 | 40 | |
41 | 41 | |
42 | 42 | public PageData<DeviceProfileDTO> findDeviceProfileInfos(PageLink pageLink, TenantId tenantId, String transportType) { |
43 | 43 | if (StringUtils.isNotEmpty(transportType)) { |
44 | 44 | return DaoUtil.pageToPageData( |
45 | - ytDeviceProfileRepository.findDeviceProfileInfos( | |
45 | + tkDeviceProfileRepository.findDeviceProfileInfos( | |
46 | 46 | tenantId.getId(), |
47 | 47 | Objects.toString(pageLink.getTextSearch(), ""), |
48 | 48 | DeviceTransportType.valueOf(transportType), |
49 | 49 | DaoUtil.toPageable(pageLink))); |
50 | 50 | } else { |
51 | 51 | return DaoUtil.pageToPageData( |
52 | - ytDeviceProfileRepository.findDeviceProfileInfos( | |
52 | + tkDeviceProfileRepository.findDeviceProfileInfos( | |
53 | 53 | tenantId.getId(), |
54 | 54 | Objects.toString(pageLink.getTextSearch(), ""), |
55 | 55 | DaoUtil.toPageable(pageLink))); |
... | ... | @@ -57,7 +57,7 @@ public class YtJpaDeviceProfileDao extends JpaDeviceProfileDao { |
57 | 57 | } |
58 | 58 | |
59 | 59 | public List<DeviceProfileDTO> findDeviceProfileByTenantId(TenantId tenantId) { |
60 | - return ytDeviceProfileRepository.findDeviceProfileByTenantId(tenantId.getId()); | |
60 | + return tkDeviceProfileRepository.findDeviceProfileByTenantId(tenantId.getId()); | |
61 | 61 | |
62 | 62 | } |
63 | 63 | ... | ... |
dao/src/main/java/org/thingsboard/server/dao/yunteng/jpa/dao/TkJpaRuleChainDao.java
renamed from
dao/src/main/java/org/thingsboard/server/dao/yunteng/jpa/dao/YtJpaRuleChainDao.java
... | ... | @@ -23,7 +23,7 @@ import org.thingsboard.server.common.data.rule.RuleChain; |
23 | 23 | import org.thingsboard.server.common.data.rule.RuleChainType; |
24 | 24 | import org.thingsboard.server.dao.DaoUtil; |
25 | 25 | import org.thingsboard.server.dao.sql.rule.JpaRuleChainDao; |
26 | -import org.thingsboard.server.dao.yunteng.jpa.repository.YtRuleChainRepository; | |
26 | +import org.thingsboard.server.dao.yunteng.jpa.repository.TkRuleChainRepository; | |
27 | 27 | |
28 | 28 | import java.util.List; |
29 | 29 | import java.util.UUID; |
... | ... | @@ -31,15 +31,15 @@ import java.util.UUID; |
31 | 31 | @Component |
32 | 32 | @Primary |
33 | 33 | @AllArgsConstructor |
34 | - public class YtJpaRuleChainDao extends JpaRuleChainDao { | |
34 | + public class TkJpaRuleChainDao extends JpaRuleChainDao { | |
35 | 35 | |
36 | 36 | @Autowired |
37 | - private YtRuleChainRepository ytRuleChainRepository; | |
37 | + private TkRuleChainRepository tkRuleChainRepository; | |
38 | 38 | |
39 | 39 | |
40 | 40 | |
41 | 41 | public List<RuleChain> findByTenantIdAndType(UUID tenantId, RuleChainType type) { |
42 | - return DaoUtil.convertDataList(ytRuleChainRepository.findByTenantIdAndType(tenantId,type)); | |
42 | + return DaoUtil.convertDataList(tkRuleChainRepository.findByTenantIdAndType(tenantId,type)); | |
43 | 43 | |
44 | 44 | } |
45 | 45 | ... | ... |
dao/src/main/java/org/thingsboard/server/dao/yunteng/jpa/entity/TkJpaDeviceEntity.java
renamed from
dao/src/main/java/org/thingsboard/server/dao/yunteng/jpa/entity/YtJpaDeviceEntity.java
... | ... | @@ -19,7 +19,7 @@ import javax.persistence.*; |
19 | 19 | @TypeDef(name = "json", typeClass = JsonStringType.class), |
20 | 20 | @TypeDef(name = "jsonb", typeClass = JsonBinaryType.class) |
21 | 21 | }) |
22 | -public class YtJpaDeviceEntity { | |
22 | +public class TkJpaDeviceEntity { | |
23 | 23 | |
24 | 24 | @Id |
25 | 25 | @Column(name = org.thingsboard.server.dao.model.ModelConstants.ID_PROPERTY) | ... | ... |
dao/src/main/java/org/thingsboard/server/dao/yunteng/jpa/repository/TkDeviceProfileRepository.java
renamed from
dao/src/main/java/org/thingsboard/server/dao/yunteng/jpa/repository/YtDeviceProfileRepository.java
... | ... | @@ -27,7 +27,7 @@ import org.thingsboard.server.dao.model.sql.DeviceProfileEntity; |
27 | 27 | import java.util.List; |
28 | 28 | import java.util.UUID; |
29 | 29 | |
30 | -public interface YtDeviceProfileRepository extends JpaRepository<DeviceProfileEntity, UUID> { | |
30 | +public interface TkDeviceProfileRepository extends JpaRepository<DeviceProfileEntity, UUID> { | |
31 | 31 | |
32 | 32 | |
33 | 33 | @Query("SELECT new org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO(d.id, d.name, d.createdTime,d.description, d.transportType, d.defaultRuleChainId,d.isDefault,d.image,d.type,d.profileData) " + | ... | ... |
dao/src/main/java/org/thingsboard/server/dao/yunteng/jpa/repository/TkRuleChainRepository.java
renamed from
dao/src/main/java/org/thingsboard/server/dao/yunteng/jpa/repository/YtRuleChainRepository.java
... | ... | @@ -22,7 +22,7 @@ import org.thingsboard.server.dao.model.sql.RuleChainEntity; |
22 | 22 | import java.util.List; |
23 | 23 | import java.util.UUID; |
24 | 24 | |
25 | -public interface YtRuleChainRepository extends JpaRepository<RuleChainEntity, UUID> { | |
25 | +public interface TkRuleChainRepository extends JpaRepository<RuleChainEntity, UUID> { | |
26 | 26 | |
27 | 27 | |
28 | 28 | List<RuleChainEntity> findByTenantIdAndType(UUID tenantId, RuleChainType type); | ... | ... |
... | ... | @@ -18,7 +18,7 @@ import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
18 | 18 | import org.thingsboard.server.common.data.yunteng.constant.ModelConstants; |
19 | 19 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
20 | 20 | import org.thingsboard.server.common.data.yunteng.utils.ReflectUtils; |
21 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
21 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
22 | 22 | import org.thingsboard.server.dao.yunteng.entities.BaseEntity; |
23 | 23 | |
24 | 24 | import java.util.Collection; |
... | ... | @@ -151,9 +151,9 @@ public abstract class AbstractBaseService<M extends BaseMapper<T>, T extends Bas |
151 | 151 | return baseMapper.delete(wrapper)> FastIotConstants.MagicNumber.ZERO; |
152 | 152 | } |
153 | 153 | |
154 | - protected <D> YtPageData<D> getPageData(IPage<?> iPage, Class<D> target) { | |
154 | + protected <D> TkPageData<D> getPageData(IPage<?> iPage, Class<D> target) { | |
155 | 155 | List<D> targetList = ReflectUtils.sourceToTarget(iPage.getRecords(), target); |
156 | - return new YtPageData<>(targetList, iPage.getTotal()); | |
156 | + return new TkPageData<>(targetList, iPage.getTotal()); | |
157 | 157 | } |
158 | 158 | /** |
159 | 159 | * 批量插入 | ... | ... |
... | ... | @@ -2,7 +2,7 @@ package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.AlarmProfileDTO; |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
5 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
5 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
6 | 6 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmProfileEntity; |
7 | 7 | |
8 | 8 | import java.util.List; |
... | ... | @@ -10,7 +10,7 @@ import java.util.Map; |
10 | 10 | |
11 | 11 | public interface AlarmProfileService extends BaseService<TkAlarmProfileEntity> { |
12 | 12 | |
13 | - YtPageData<AlarmProfileDTO> page( | |
13 | + TkPageData<AlarmProfileDTO> page( | |
14 | 14 | boolean isPtTenantAdmin, String tenantId, String currentUserId, Map<String, Object> queryMap); |
15 | 15 | |
16 | 16 | List<AlarmProfileDTO> findAlarmProfilesByContactId(String contactId, String tenantId); | ... | ... |
... | ... | @@ -4,14 +4,14 @@ import org.thingsboard.server.common.data.rule.RuleChainMetaData; |
4 | 4 | import org.thingsboard.server.common.data.rule.RuleNode; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.ConvertConfigDTO; |
6 | 6 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
7 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
7 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
8 | 8 | import org.thingsboard.server.dao.yunteng.ConvertConfig; |
9 | 9 | |
10 | 10 | import java.util.List; |
11 | 11 | import java.util.Map; |
12 | 12 | |
13 | 13 | public interface ConvertConfigService extends BaseService<ConvertConfig> { |
14 | - YtPageData<ConvertConfigDTO> page(String tenantId, Map<String, Object> queryMap); | |
14 | + TkPageData<ConvertConfigDTO> page(String tenantId, Map<String, Object> queryMap); | |
15 | 15 | ConvertConfigDTO createOrUpdate(ConvertConfigDTO convertConfig); |
16 | 16 | |
17 | 17 | boolean updateConvertStatusByIds(List<String> ids,Integer status, String tenantId); | ... | ... |
... | ... | @@ -9,7 +9,7 @@ import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; |
9 | 9 | import org.thingsboard.server.common.data.yunteng.dto.TenantTransportMessageDTO; |
10 | 10 | import org.thingsboard.server.common.data.yunteng.dto.statistics.HomePageAppDTO; |
11 | 11 | import org.thingsboard.server.common.data.yunteng.enums.TrendType; |
12 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
12 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
13 | 13 | |
14 | 14 | import java.util.List; |
15 | 15 | import java.util.Map; |
... | ... | @@ -41,7 +41,7 @@ public interface HomePageService { |
41 | 41 | * @param queryMap 查询条件 |
42 | 42 | * @return 右侧信息 |
43 | 43 | */ |
44 | - YtPageData<TenantDTO> getHomePageRightInfo(Map<String, Object> queryMap); | |
44 | + TkPageData<TenantDTO> getHomePageRightInfo(Map<String, Object> queryMap); | |
45 | 45 | |
46 | 46 | /** |
47 | 47 | * 获取首页左侧底部信息 | ... | ... |
... | ... | @@ -3,14 +3,14 @@ package org.thingsboard.server.dao.yunteng.service; |
3 | 3 | |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.RoleDTO; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.request.RoleReqDTO; |
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 | 8 | import java.util.List; |
9 | 9 | import java.util.Map; |
10 | 10 | import java.util.Set; |
11 | 11 | |
12 | 12 | public interface RoleService { |
13 | - YtPageData<RoleDTO> page(String tenantId, Map<String, Object> queryMap); | |
13 | + TkPageData<RoleDTO> page(String tenantId, Map<String, Object> queryMap); | |
14 | 14 | |
15 | 15 | boolean deleteRole(String[] roleIds,String tenantId); |
16 | 16 | ... | ... |
... | ... | @@ -3,7 +3,7 @@ import com.fasterxml.jackson.databind.JsonNode; |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.DeviceDTO; |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.SceneLinkageDTO; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
6 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
6 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
7 | 7 | import org.thingsboard.server.dao.yunteng.entities.TkSceneLinkageEntity; |
8 | 8 | |
9 | 9 | import java.util.List; |
... | ... | @@ -51,7 +51,7 @@ public interface SceneLinkageService extends BaseService<TkSceneLinkageEntity>{ |
51 | 51 | * @param isCustomerUser true是客户 false不是 |
52 | 52 | * @return |
53 | 53 | */ |
54 | - YtPageData<SceneLinkageDTO> page(Map<String, Object> queryMap, String tenantId,boolean isCustomerUser); | |
54 | + TkPageData<SceneLinkageDTO> page(Map<String, Object> queryMap, String tenantId, boolean isCustomerUser); | |
55 | 55 | |
56 | 56 | /** |
57 | 57 | * 查找场景联动所有数据 | ... | ... |
... | ... | @@ -2,14 +2,14 @@ package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | |
3 | 3 | |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.SmsLogDTO; |
5 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
5 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
6 | 6 | import org.thingsboard.server.dao.yunteng.entities.TkSmsLogEntity; |
7 | 7 | |
8 | 8 | import java.util.Map; |
9 | 9 | import java.util.Set; |
10 | 10 | |
11 | 11 | public interface SmsLogService extends BaseService<TkSmsLogEntity>{ |
12 | - YtPageData<SmsLogDTO> page(Map<String, Object> queryMap, String tenantId); | |
12 | + TkPageData<SmsLogDTO> page(Map<String, Object> queryMap, String tenantId); | |
13 | 13 | |
14 | 14 | boolean deleteSmsLog(Set<String> ids); |
15 | 15 | } | ... | ... |
... | ... | @@ -2,14 +2,14 @@ package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | |
3 | 3 | |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.SysDictItemDTO; |
5 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
5 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
6 | 6 | |
7 | 7 | import java.util.List; |
8 | 8 | import java.util.Map; |
9 | 9 | import java.util.Set; |
10 | 10 | |
11 | 11 | public interface SysDictItemService { |
12 | - YtPageData<SysDictItemDTO> page(Map<String, Object> queryMap); | |
12 | + TkPageData<SysDictItemDTO> page(Map<String, Object> queryMap); | |
13 | 13 | |
14 | 14 | SysDictItemDTO saveSysDictItem(SysDictItemDTO sysDictItemDTO,String tenantId); |
15 | 15 | ... | ... |
1 | 1 | package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; |
4 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
4 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
5 | 5 | |
6 | 6 | import java.util.Map; |
7 | 7 | import java.util.Set; |
8 | 8 | |
9 | 9 | public interface SysDictService { |
10 | - YtPageData<SysDictDTO> page(Map<String, Object> queryMap); | |
10 | + TkPageData<SysDictDTO> page(Map<String, Object> queryMap); | |
11 | 11 | |
12 | 12 | SysDictDTO saveSysDict(SysDictDTO sysDictDTO,String tenantId); |
13 | 13 | ... | ... |
1 | 1 | package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.SysNoticeDTO; |
4 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
4 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
5 | 5 | import org.thingsboard.server.dao.yunteng.entities.SysNoticeEntity; |
6 | 6 | |
7 | 7 | import java.util.Map; |
... | ... | @@ -14,7 +14,7 @@ import java.util.Set; |
14 | 14 | */ |
15 | 15 | public interface SysNoticeService extends BaseService<SysNoticeEntity>{ |
16 | 16 | |
17 | - YtPageData<SysNoticeDTO> page(Map<String, Object> queryMap); | |
17 | + TkPageData<SysNoticeDTO> page(Map<String, Object> queryMap); | |
18 | 18 | |
19 | 19 | SysNoticeDTO get(String id,String tenantId); |
20 | 20 | ... | ... |
1 | 1 | package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.SysNoticeUserDTO; |
4 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
4 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
5 | 5 | import org.thingsboard.server.dao.yunteng.entities.SysNoticeUserEntity; |
6 | 6 | |
7 | 7 | import java.util.List; |
... | ... | @@ -13,11 +13,11 @@ import java.util.Map; |
13 | 13 | * @date: 2021/12/2-20:43 |
14 | 14 | */ |
15 | 15 | public interface SysNoticeUserService extends BaseService<SysNoticeUserEntity>{ |
16 | - YtPageData<SysNoticeUserDTO> page(Map<String, Object> queryMap); | |
16 | + TkPageData<SysNoticeUserDTO> page(Map<String, Object> queryMap); | |
17 | 17 | |
18 | - YtPageData<SysNoticeUserDTO> pageByNoticeId(Map<String, Object> queryMap); | |
18 | + TkPageData<SysNoticeUserDTO> pageByNoticeId(Map<String, Object> queryMap); | |
19 | 19 | |
20 | - YtPageData<SysNoticeUserDTO> read(Map<String, Object> queryMap, String currentUserId); | |
20 | + TkPageData<SysNoticeUserDTO> read(Map<String, Object> queryMap, String currentUserId); | |
21 | 21 | |
22 | 22 | SysNoticeUserDTO get(String id,String tenantId); |
23 | 23 | ... | ... |
... | ... | @@ -4,13 +4,13 @@ import com.fasterxml.jackson.databind.JsonNode; |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.ThingsModelDTO; |
6 | 6 | import org.thingsboard.server.common.data.yunteng.enums.FunctionTypeEnum; |
7 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
7 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
8 | 8 | |
9 | 9 | import java.util.List; |
10 | 10 | import java.util.Map; |
11 | 11 | |
12 | 12 | public interface ThingsModelService { |
13 | - YtPageData<ThingsModelDTO> page( | |
13 | + TkPageData<ThingsModelDTO> page( | |
14 | 14 | Map<String, Object> queryMap, String tenantId, String deviceProfileId); |
15 | 15 | |
16 | 16 | ThingsModelDTO saveOrUpdate(ThingsModelDTO thingsModelDTO); | ... | ... |
1 | 1 | package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.AlarmContactDTO; |
4 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
4 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
5 | 5 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmContactEntity; |
6 | 6 | |
7 | 7 | import java.util.List; |
... | ... | @@ -55,6 +55,6 @@ public interface TkAlarmContactService extends BaseService<TkAlarmContactEntity> |
55 | 55 | * @param queryMap 查询集合 |
56 | 56 | * @return PageData |
57 | 57 | */ |
58 | - YtPageData<AlarmContactDTO> page( | |
58 | + TkPageData<AlarmContactDTO> page( | |
59 | 59 | String tenantId, boolean isPtTenantAdmin, String currentUserId, Map<String, Object> queryMap); |
60 | 60 | } | ... | ... |
... | ... | @@ -6,7 +6,7 @@ import org.thingsboard.server.common.data.alarm.AlarmStatus; |
6 | 6 | import org.thingsboard.server.common.data.id.TenantId; |
7 | 7 | import org.thingsboard.server.common.data.yunteng.dto.SysDictDTO; |
8 | 8 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
9 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
9 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
10 | 10 | import org.thingsboard.server.dao.yunteng.entities.TkAlarmEntity; |
11 | 11 | |
12 | 12 | import java.util.List; |
... | ... | @@ -31,7 +31,7 @@ public interface TkAlarmInfoService { |
31 | 31 | * @param organizationId 告警所属组织 |
32 | 32 | * @return |
33 | 33 | */ |
34 | - 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); | |
34 | + 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); | |
35 | 35 | |
36 | 36 | |
37 | 37 | /** | ... | ... |
1 | 1 | package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.AlarmContactDTO; |
4 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
4 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
5 | 5 | |
6 | 6 | import java.util.List; |
7 | 7 | import java.util.Map; |
... | ... | @@ -53,6 +53,6 @@ public interface TkAlarmService { |
53 | 53 | * @param queryMap 查询集合 |
54 | 54 | * @return PageData |
55 | 55 | */ |
56 | - YtPageData<AlarmContactDTO> page(Map<String, Object> queryMap); | |
56 | + TkPageData<AlarmContactDTO> page(Map<String, Object> queryMap); | |
57 | 57 | |
58 | 58 | } | ... | ... |
... | ... | @@ -3,12 +3,12 @@ package org.thingsboard.server.dao.yunteng.service; |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.ConfigurationCenterDTO; |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.request.ConfigurationContentInfoDTO; |
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 | 8 | import java.util.Map; |
9 | 9 | |
10 | 10 | public interface TkConfigurationCenterService { |
11 | - YtPageData<ConfigurationCenterDTO> page(Map<String, Object> queryMap,boolean tenantAdmin); | |
11 | + TkPageData<ConfigurationCenterDTO> page(Map<String, Object> queryMap, boolean tenantAdmin); | |
12 | 12 | |
13 | 13 | ConfigurationCenterDTO saveConfiguration(ConfigurationCenterDTO configurationCenterDTO); |
14 | 14 | ... | ... |
... | ... | @@ -3,7 +3,7 @@ package org.thingsboard.server.dao.yunteng.service; |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.DataBoardDTO; |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.board.ComponentLayoutDTO; |
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 | 8 | import java.util.List; |
9 | 9 | import java.util.Map; |
... | ... | @@ -15,7 +15,7 @@ public interface TkDataBoardService { |
15 | 15 | * @param queryMap 分页查询条件 |
16 | 16 | * @return 分页数据 |
17 | 17 | */ |
18 | - YtPageData<DataBoardDTO> dataBoardPage(Map<String, Object> queryMap,boolean tenantAdmin); | |
18 | + TkPageData<DataBoardDTO> dataBoardPage(Map<String, Object> queryMap, boolean tenantAdmin); | |
19 | 19 | |
20 | 20 | /** |
21 | 21 | * 修改或保存数据看板 | ... | ... |
... | ... | @@ -3,7 +3,7 @@ package org.thingsboard.server.dao.yunteng.service; |
3 | 3 | import org.thingsboard.server.common.data.id.CustomerId; |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
6 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
6 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
7 | 7 | import org.thingsboard.server.dao.yunteng.entities.TkDeviceProfileEntity; |
8 | 8 | |
9 | 9 | import java.util.List; |
... | ... | @@ -21,7 +21,7 @@ public interface TkDeviceProfileService extends BaseService<TkDeviceProfileEntit |
21 | 21 | |
22 | 22 | Optional<DeviceProfileDTO> getDeviceProfile(String tenantId, String id); |
23 | 23 | |
24 | - YtPageData<DeviceProfileDTO> page(Map<String, Object> queryMap, boolean isTenantAdmin); | |
24 | + TkPageData<DeviceProfileDTO> page(Map<String, Object> queryMap, boolean isTenantAdmin); | |
25 | 25 | |
26 | 26 | List<DeviceProfileDTO> findDeviceProfile( |
27 | 27 | String tenantId, String scriptId, DeviceTypeEnum deviceType); | ... | ... |
1 | 1 | package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.TkDeviceScriptDTO; |
4 | -import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; | |
5 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
4 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
6 | 5 | import org.thingsboard.server.dao.yunteng.entities.TkDeviceScriptEntity; |
7 | 6 | |
8 | 7 | import java.util.List; |
... | ... | @@ -28,7 +27,7 @@ public interface TkDeviceScriptService extends BaseService<TkDeviceScriptEntity> |
28 | 27 | |
29 | 28 | Optional<TkDeviceScriptDTO> getDeviceScript(String tenantId, String id); |
30 | 29 | |
31 | - YtPageData<TkDeviceScriptDTO> page(Map<String, Object> queryMap, boolean isTenantAdmin); | |
30 | + TkPageData<TkDeviceScriptDTO> page(Map<String, Object> queryMap, boolean isTenantAdmin); | |
32 | 31 | |
33 | 32 | List<TkDeviceScriptDTO> findDeviceScript(String tenantId); |
34 | 33 | ... | ... |
... | ... | @@ -8,7 +8,7 @@ import org.thingsboard.server.common.data.yunteng.dto.RelationDeviceDTO; |
8 | 8 | import org.thingsboard.server.common.data.yunteng.dto.SelectItemDTO; |
9 | 9 | import org.thingsboard.server.common.data.yunteng.enums.DataTypeEnum; |
10 | 10 | import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum; |
11 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
11 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
12 | 12 | import org.thingsboard.server.dao.yunteng.entities.TkDeviceEntity; |
13 | 13 | |
14 | 14 | import java.util.List; |
... | ... | @@ -23,9 +23,9 @@ public interface TkDeviceService extends BaseService<TkDeviceEntity> { |
23 | 23 | |
24 | 24 | Optional<DeviceDTO> getDevice(String tenantId, String id); |
25 | 25 | |
26 | - YtPageData<DeviceDTO> page(String tenantId, Map<String, Object> queryMap); | |
26 | + TkPageData<DeviceDTO> page(String tenantId, Map<String, Object> queryMap); | |
27 | 27 | |
28 | - YtPageData<RelationDeviceDTO> pageRelation(Map<String, Object> queryMap); | |
28 | + TkPageData<RelationDeviceDTO> pageRelation(Map<String, Object> queryMap); | |
29 | 29 | |
30 | 30 | /** 验证表单数据有效性 */ |
31 | 31 | void validateFormData(String currentTenantId, DeviceDTO ytDevice); | ... | ... |
... | ... | @@ -3,14 +3,14 @@ package org.thingsboard.server.dao.yunteng.service; |
3 | 3 | import com.fasterxml.jackson.databind.node.ObjectNode; |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.FrpInfoDTO; |
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 | 8 | import java.net.UnknownHostException; |
9 | 9 | import java.util.Map; |
10 | 10 | |
11 | 11 | public interface TkFrpInfoService { |
12 | 12 | |
13 | - YtPageData<FrpInfoDTO> page(Map<String, Object> queryMap); | |
13 | + TkPageData<FrpInfoDTO> page(Map<String, Object> queryMap); | |
14 | 14 | |
15 | 15 | FrpInfoDTO saveOrUpdateFrpInfo(FrpInfoDTO frpInfoDTO); |
16 | 16 | ... | ... |
1 | 1 | package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.MailLogDTO; |
4 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
4 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
5 | 5 | import org.thingsboard.server.dao.yunteng.entities.TkMailLogEntity; |
6 | 6 | |
7 | 7 | import java.util.Map; |
8 | 8 | import java.util.Set; |
9 | 9 | |
10 | 10 | public interface TkMailLogService extends BaseService<TkMailLogEntity>{ |
11 | - YtPageData<MailLogDTO> page(String tenantId, Map<String, Object> queryMap); | |
11 | + TkPageData<MailLogDTO> page(String tenantId, Map<String, Object> queryMap); | |
12 | 12 | |
13 | 13 | boolean deleteMailLog(Set<String> ids); |
14 | 14 | } | ... | ... |
1 | 1 | package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.MessageConfigDTO; |
4 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
4 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
5 | 5 | import org.thingsboard.server.dao.yunteng.entities.TkMessageConfigEntity; |
6 | 6 | |
7 | 7 | import java.util.List; |
... | ... | @@ -10,7 +10,7 @@ import java.util.Set; |
10 | 10 | |
11 | 11 | public interface TkMessageConfigService extends BaseService<TkMessageConfigEntity>{ |
12 | 12 | |
13 | - YtPageData<MessageConfigDTO> page(String tenantId, Map<String, Object> queryMap); | |
13 | + TkPageData<MessageConfigDTO> page(String tenantId, Map<String, Object> queryMap); | |
14 | 14 | |
15 | 15 | MessageConfigDTO saveMessageConfig(String tenantId,MessageConfigDTO configDTO); |
16 | 16 | ... | ... |
... | ... | @@ -3,7 +3,7 @@ package org.thingsboard.server.dao.yunteng.service; |
3 | 3 | |
4 | 4 | |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.MessageTemplateDTO; |
6 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
6 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
7 | 7 | import org.thingsboard.server.dao.yunteng.entities.TkMessageTemplateEntity; |
8 | 8 | |
9 | 9 | import java.util.List; |
... | ... | @@ -12,7 +12,7 @@ import java.util.Set; |
12 | 12 | |
13 | 13 | public interface TkMessageTemplateService extends BaseService<TkMessageTemplateEntity>{ |
14 | 14 | |
15 | - YtPageData<MessageTemplateDTO> page(Map<String, Object> queryMap); | |
15 | + TkPageData<MessageTemplateDTO> page(Map<String, Object> queryMap); | |
16 | 16 | |
17 | 17 | MessageTemplateDTO saveMessageTemplate(MessageTemplateDTO templateDTO); |
18 | 18 | ... | ... |
... | ... | @@ -3,7 +3,7 @@ package org.thingsboard.server.dao.yunteng.service; |
3 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.TkOpinionDTO; |
6 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
6 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
7 | 7 | import org.thingsboard.server.dao.yunteng.entities.TkOpinionEntity; |
8 | 8 | |
9 | 9 | public interface TkOpinionService extends BaseService<TkOpinionEntity> { |
... | ... | @@ -17,7 +17,7 @@ public interface TkOpinionService extends BaseService<TkOpinionEntity> { |
17 | 17 | * @param status 状态 |
18 | 18 | * @return |
19 | 19 | */ |
20 | - YtPageData<TkOpinionDTO> pageDatas(IPage<TkOpinionEntity> pageInfrom, | |
20 | + TkPageData<TkOpinionDTO> pageDatas(IPage<TkOpinionEntity> pageInfrom, | |
21 | 21 | boolean isPtTenantAdmin, String tenantId, String currentUserId, String organizationId, String name, Boolean status); |
22 | 22 | |
23 | 23 | /** | ... | ... |
... | ... | @@ -5,13 +5,13 @@ import org.quartz.SchedulerException; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
6 | 6 | import org.thingsboard.server.common.data.yunteng.dto.ReportFormConfigDTO; |
7 | 7 | import org.thingsboard.server.common.data.yunteng.dto.request.ExecuteAttributesDTO; |
8 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
8 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
9 | 9 | |
10 | 10 | import java.util.List; |
11 | 11 | import java.util.Map; |
12 | 12 | |
13 | 13 | public interface TkReportFormConfigService { |
14 | - YtPageData<ReportFormConfigDTO> page(Map<String, Object> queryMap,boolean tenantAdmin); | |
14 | + TkPageData<ReportFormConfigDTO> page(Map<String, Object> queryMap, boolean tenantAdmin); | |
15 | 15 | |
16 | 16 | ReportFormConfigDTO saveOrUpdateReportFormConfig(ReportFormConfigDTO report) throws SchedulerException; |
17 | 17 | ... | ... |
... | ... | @@ -5,13 +5,13 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.ReportFormConfigDTO; |
6 | 6 | import org.thingsboard.server.common.data.yunteng.dto.ReportGenerateRecordDTO; |
7 | 7 | import org.thingsboard.server.common.data.yunteng.dto.request.ExecuteAttributesDTO; |
8 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
8 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
9 | 9 | |
10 | 10 | import java.util.Map; |
11 | 11 | |
12 | 12 | public interface TkReportGenerateRecordService { |
13 | 13 | |
14 | - YtPageData<ReportGenerateRecordDTO> page(Map<String, Object> queryMap,boolean tenantAdmin); | |
14 | + TkPageData<ReportGenerateRecordDTO> page(Map<String, Object> queryMap, boolean tenantAdmin); | |
15 | 15 | |
16 | 16 | ReportGenerateRecordDTO saveOrUpdateReportGenerateRecord(ReportGenerateRecordDTO recordDTO); |
17 | 17 | ... | ... |
... | ... | @@ -3,7 +3,7 @@ package org.thingsboard.server.dao.yunteng.service; |
3 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; |
4 | 4 | import org.thingsboard.server.common.data.rpc.RpcStatus; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.TkRpcRecordDTO; |
6 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
6 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
7 | 7 | import org.thingsboard.server.dao.yunteng.entities.TkRpcRecordEntity; |
8 | 8 | |
9 | 9 | /** |
... | ... | @@ -24,7 +24,7 @@ public interface TkRpcRecordService extends BaseService<TkRpcRecordEntity> { |
24 | 24 | * @param name 名称,例如:设备、命令、组织、租户 |
25 | 25 | * @return |
26 | 26 | */ |
27 | - YtPageData<TkRpcRecordDTO> pageDatas(IPage<TkRpcRecordEntity> pageInfrom, String tenantId, String deviceId, Boolean oneway, RpcStatus status, String organizationId, String name); | |
27 | + TkPageData<TkRpcRecordDTO> pageDatas(IPage<TkRpcRecordEntity> pageInfrom, String tenantId, String deviceId, Boolean oneway, RpcStatus status, String organizationId, String name); | |
28 | 28 | |
29 | 29 | |
30 | 30 | } | ... | ... |
... | ... | @@ -2,7 +2,7 @@ package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.SysJobLogDTO; |
5 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
5 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
6 | 6 | |
7 | 7 | import java.util.Map; |
8 | 8 | |
... | ... | @@ -17,7 +17,7 @@ public interface TkSysJobLogService |
17 | 17 | * @param queryMap |
18 | 18 | * @return |
19 | 19 | */ |
20 | - YtPageData<SysJobLogDTO> sysJobLogPageByJobId(Map<String, Object> queryMap); | |
20 | + TkPageData<SysJobLogDTO> sysJobLogPageByJobId(Map<String, Object> queryMap); | |
21 | 21 | |
22 | 22 | /** |
23 | 23 | * 通过调度任务日志ID查询调度信息 | ... | ... |
... | ... | @@ -2,7 +2,7 @@ package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | import org.quartz.SchedulerException; |
3 | 3 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.SysJobDTO; |
5 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
5 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
6 | 6 | import java.util.Map; |
7 | 7 | |
8 | 8 | /** |
... | ... | @@ -16,7 +16,7 @@ public interface TkSysJobService |
16 | 16 | * @param queryMap 查询参数 |
17 | 17 | * @return 分页数据 |
18 | 18 | */ |
19 | - YtPageData<SysJobDTO> sysJobPage(Map<String, Object> queryMap); | |
19 | + TkPageData<SysJobDTO> sysJobPage(Map<String, Object> queryMap); | |
20 | 20 | |
21 | 21 | /** |
22 | 22 | * 通过调度任务ID查询调度信息 | ... | ... |
... | ... | @@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
4 | 4 | import org.thingsboard.server.common.data.EntityType; |
5 | 5 | import org.thingsboard.server.common.data.audit.ActionType; |
6 | 6 | import org.thingsboard.server.common.data.yunteng.dto.SysLogDTO; |
7 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
7 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
8 | 8 | import org.thingsboard.server.dao.yunteng.entities.SysLogEntity; |
9 | 9 | |
10 | 10 | public interface TkSysLogService extends BaseService<SysLogEntity> { |
... | ... | @@ -29,7 +29,7 @@ public interface TkSysLogService extends BaseService<SysLogEntity> { |
29 | 29 | * @param actionType 日志类型 |
30 | 30 | * @return |
31 | 31 | */ |
32 | - YtPageData<SysLogDTO> exceptionPage(IPage<SysLogEntity> pageInfrom, Long startTime, Long endTime, String tenantId, String customerId, ActionType actionType); | |
32 | + TkPageData<SysLogDTO> exceptionPage(IPage<SysLogEntity> pageInfrom, Long startTime, Long endTime, String tenantId, String customerId, ActionType actionType); | |
33 | 33 | |
34 | 34 | /** |
35 | 35 | * 操作日志列表 |
... | ... | @@ -42,7 +42,7 @@ public interface TkSysLogService extends BaseService<SysLogEntity> { |
42 | 42 | * @param actionType 日志类型 |
43 | 43 | * @return |
44 | 44 | */ |
45 | - YtPageData<SysLogDTO> operatePage(IPage<SysLogEntity> pageInfrom, Long startTime, Long endTime, String tenantId, String customerId, EntityType entityType, ActionType actionType); | |
45 | + TkPageData<SysLogDTO> operatePage(IPage<SysLogEntity> pageInfrom, Long startTime, Long endTime, String tenantId, String customerId, EntityType entityType, ActionType actionType); | |
46 | 46 | |
47 | 47 | /** |
48 | 48 | * 登录日志列表 |
... | ... | @@ -55,6 +55,6 @@ public interface TkSysLogService extends BaseService<SysLogEntity> { |
55 | 55 | * @param actionType 日志类型 |
56 | 56 | * @return |
57 | 57 | */ |
58 | - YtPageData<SysLogDTO> loginPage(IPage<SysLogEntity> pageInfrom, Long startTime, Long endTime, String tenantId, String customerId, ActionType actionType); | |
58 | + TkPageData<SysLogDTO> loginPage(IPage<SysLogEntity> pageInfrom, Long startTime, Long endTime, String tenantId, String customerId, ActionType actionType); | |
59 | 59 | |
60 | 60 | } | ... | ... |
... | ... | @@ -4,10 +4,9 @@ package org.thingsboard.server.dao.yunteng.service; |
4 | 4 | |
5 | 5 | import com.google.common.util.concurrent.ListenableFuture; |
6 | 6 | import org.thingsboard.server.common.data.query.TsValue; |
7 | -import org.thingsboard.server.common.data.yunteng.dto.HomePageLeftBottomDTO; | |
8 | 7 | import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; |
9 | 8 | import org.thingsboard.server.common.data.yunteng.dto.request.TenantReqDTO; |
10 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
9 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
11 | 10 | |
12 | 11 | import java.time.LocalDateTime; |
13 | 12 | import java.util.List; |
... | ... | @@ -24,13 +23,13 @@ public interface TkTenantService { |
24 | 23 | |
25 | 24 | Optional<TenantDTO> findById(String id); |
26 | 25 | |
27 | - YtPageData<TenantDTO> page(Map<String, Object> queryMap); | |
26 | + TkPageData<TenantDTO> page(Map<String, Object> queryMap); | |
28 | 27 | |
29 | 28 | TenantDTO updateOrCreateTenant(TenantReqDTO tenantReqDTO); |
30 | 29 | |
31 | 30 | List<String> getTenantRolesByTenantId(String tenantId); |
32 | 31 | |
33 | - YtPageData<TenantDTO> getCurrentMonthExpireTenantPage(Map<String, Object> queryMap); | |
32 | + TkPageData<TenantDTO> getCurrentMonthExpireTenantPage(Map<String, Object> queryMap); | |
34 | 33 | |
35 | 34 | List<TenantDTO> getAllTenant(); |
36 | 35 | ... | ... |
... | ... | @@ -5,7 +5,7 @@ import com.fasterxml.jackson.databind.JsonNode; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.UserDTO; |
6 | 6 | import org.thingsboard.server.common.data.yunteng.dto.TkThirdUserDTO; |
7 | 7 | import org.thingsboard.server.common.data.yunteng.enums.ThirdPlatformEnum; |
8 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
8 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
9 | 9 | import org.thingsboard.server.dao.yunteng.entities.TkThirdUserEntity; |
10 | 10 | |
11 | 11 | /** |
... | ... | @@ -21,7 +21,7 @@ public interface TkThirdPlatformService extends BaseService<TkThirdUserEntity> { |
21 | 21 | * @param name 第三方平台用户昵称 |
22 | 22 | * @return |
23 | 23 | */ |
24 | - YtPageData<TkThirdUserDTO> pageDatas(IPage<TkThirdUserEntity> pageInfrom, ThirdPlatformEnum platformName, String name); | |
24 | + TkPageData<TkThirdUserDTO> pageDatas(IPage<TkThirdUserEntity> pageInfrom, ThirdPlatformEnum platformName, String name); | |
25 | 25 | |
26 | 26 | |
27 | 27 | /** | ... | ... |
... | ... | @@ -7,7 +7,7 @@ import org.thingsboard.server.common.data.yunteng.dto.UserInfoDTO; |
7 | 7 | import org.thingsboard.server.common.data.yunteng.dto.request.AccountReqDTO; |
8 | 8 | import org.thingsboard.server.common.data.yunteng.dto.request.RoleOrOrganizationReqDTO; |
9 | 9 | import org.thingsboard.server.common.data.yunteng.dto.request.SendResetPasswordEmailMsg; |
10 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
10 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
11 | 11 | import org.thingsboard.server.dao.yunteng.entities.SysTenantRoleEntity; |
12 | 12 | import org.thingsboard.server.dao.yunteng.entities.SysUserEntity; |
13 | 13 | |
... | ... | @@ -30,11 +30,11 @@ public interface TkUserService { |
30 | 30 | |
31 | 31 | UserInfoDTO me(String userId, String tenantId, Set<String> currentRoles); |
32 | 32 | |
33 | - YtPageData<UserDTO> page( | |
33 | + TkPageData<UserDTO> page( | |
34 | 34 | Map<String, Object> queryMap, |
35 | 35 | boolean isPtSysadmin, |
36 | 36 | boolean isTenantAdmin); |
37 | - YtPageData<UserDTO> tenantPage(Map<String, Object> queryMap,String tenantId); | |
37 | + TkPageData<UserDTO> tenantPage(Map<String, Object> queryMap, String tenantId); | |
38 | 38 | |
39 | 39 | UserDTO updateUser(UserDTO userDTO, boolean isPtSysadmin, String tenantId); |
40 | 40 | ... | ... |
... | ... | @@ -3,7 +3,7 @@ package org.thingsboard.server.dao.yunteng.service; |
3 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.TkVideoPlatformDTO; |
6 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
6 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
7 | 7 | import org.thingsboard.server.dao.yunteng.entities.TkVideoPlatformEntity; |
8 | 8 | |
9 | 9 | import java.util.List; |
... | ... | @@ -17,7 +17,7 @@ public interface TkVideoPlatformService extends BaseService<TkVideoPlatformEntit |
17 | 17 | * @param currentUserId 用户ID |
18 | 18 | * @param host 流媒体地址 |
19 | 19 | */ |
20 | - YtPageData<TkVideoPlatformDTO> page(IPage<TkVideoPlatformEntity> pageInfo, | |
20 | + TkPageData<TkVideoPlatformDTO> page(IPage<TkVideoPlatformEntity> pageInfo, | |
21 | 21 | boolean isPtTenantAdmin, String tenantId, String currentUserId, String host); |
22 | 22 | |
23 | 23 | /** 保存或更新流媒体配置 | ... | ... |
... | ... | @@ -3,7 +3,7 @@ package org.thingsboard.server.dao.yunteng.service; |
3 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; |
4 | 4 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
5 | 5 | import org.thingsboard.server.common.data.yunteng.dto.TkVideoDTO; |
6 | -import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData; | |
6 | +import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | |
7 | 7 | import org.thingsboard.server.dao.yunteng.entities.TkVideoEntity; |
8 | 8 | |
9 | 9 | import java.util.Set; |
... | ... | @@ -19,7 +19,7 @@ public interface TkVideoService extends BaseService<TkVideoEntity> { |
19 | 19 | * @param status 状态 |
20 | 20 | * @return |
21 | 21 | */ |
22 | - YtPageData<TkVideoDTO> pageDatas(IPage<TkVideoEntity> pageInfrom, | |
22 | + TkPageData<TkVideoDTO> pageDatas(IPage<TkVideoEntity> pageInfrom, | |
23 | 23 | boolean isPtTenantAdmin, String tenantId, String currentUserId, String organizationId, String name, Boolean status); |
24 | 24 | |
25 | 25 | /** | ... | ... |
... | ... | @@ -261,7 +261,7 @@ export interface MqttDeviceProfileTransportConfiguration { |
261 | 261 | } |
262 | 262 | |
263 | 263 | //Thingskit function |
264 | -export interface YtTcpDeviceProfileTransportConfiguration { | |
264 | +export interface TkTcpDeviceProfileTransportConfiguration { | |
265 | 265 | [key: string]: any; |
266 | 266 | } |
267 | 267 | |
... | ... | @@ -321,7 +321,7 @@ export interface SnmpMapping { |
321 | 321 | |
322 | 322 | export type DeviceProfileTransportConfigurations = DefaultDeviceProfileTransportConfiguration & |
323 | 323 | MqttDeviceProfileTransportConfiguration & |
324 | - YtTcpDeviceProfileTransportConfiguration & | |
324 | + TkTcpDeviceProfileTransportConfiguration & | |
325 | 325 | CoapDeviceProfileTransportConfiguration & |
326 | 326 | Lwm2mDeviceProfileTransportConfiguration & |
327 | 327 | SnmpDeviceProfileTransportConfiguration; |
... | ... | @@ -383,7 +383,7 @@ export function createDeviceProfileTransportConfiguration(type: DeviceTransportT |
383 | 383 | transportConfiguration = {...mqttTransportConfiguration, type: DeviceTransportType.MQTT}; |
384 | 384 | break; |
385 | 385 | case DeviceTransportType.TCP: |
386 | - const tcpTransportConfiguration: YtTcpDeviceProfileTransportConfiguration = {}; | |
386 | + const tcpTransportConfiguration: TkTcpDeviceProfileTransportConfiguration = {}; | |
387 | 387 | transportConfiguration = {...tcpTransportConfiguration, type: DeviceTransportType.TCP}; |
388 | 388 | break; |
389 | 389 | case DeviceTransportType.COAP: |
... | ... | @@ -432,7 +432,7 @@ export function createDeviceTransportConfiguration(type: DeviceTransportType): D |
432 | 432 | transportConfiguration = {...mqttTransportConfiguration, type: DeviceTransportType.MQTT}; |
433 | 433 | break; |
434 | 434 | case DeviceTransportType.TCP: |
435 | - const tcpTransportConfiguration: YtTcpDeviceTransportConfiguration = {}; | |
435 | + const tcpTransportConfiguration: TkTcpDeviceTransportConfiguration = {}; | |
436 | 436 | transportConfiguration = {...tcpTransportConfiguration, type: DeviceTransportType.TCP}; |
437 | 437 | break; |
438 | 438 | case DeviceTransportType.COAP: |
... | ... | @@ -624,7 +624,7 @@ export interface MqttDeviceTransportConfiguration { |
624 | 624 | [key: string]: any; |
625 | 625 | } |
626 | 626 | |
627 | -export interface YtTcpDeviceTransportConfiguration { | |
627 | +export interface TkTcpDeviceTransportConfiguration { | |
628 | 628 | [key: string]: any; |
629 | 629 | } |
630 | 630 | ... | ... |