Commit 67c55353c8244e16ba84f510bd2147a593b4a827

Authored by 云中非
2 parents e88eadb1 0d225bd5

Merge branch 'master' into 20220916

Showing 24 changed files with 37 additions and 57 deletions
... ... @@ -74,7 +74,7 @@ public class SysJobController extends BaseController {
74 74 }
75 75
76 76 /** 任务调度状态修改 */
77   - @PutMapping("/changeStatus/{id}/{status}")
  77 + @PutMapping("/change_status/{id}/{status}")
78 78 @ApiOperation(value = "任务调度状态修改")
79 79 public ResponseResult<Boolean> changeStatus(
80 80 @PathVariable("id") String id, @PathVariable("status") Integer status)
... ... @@ -120,7 +120,7 @@ public class SysJobController extends BaseController {
120 120 }
121 121
122 122 /** 校验cron表达式是否有效 */
123   - @GetMapping("/checkCron/{cronExpression}")
  123 + @GetMapping("/check_cron/{cronExpression}")
124 124 @ApiOperation(value = "校验cron表达式是否有效")
125 125 public boolean checkCronExpressionIsValid(@PathVariable("cronExpression") String cronExpression) {
126 126 if (StringUtils.isEmpty(cronExpression)) {
... ... @@ -130,7 +130,7 @@ public class SysJobController extends BaseController {
130 130 }
131 131
132 132 /** 查询cron表达式近5次的执行时间 */
133   - @GetMapping("/queryCronExpression/{cronExpression}")
  133 + @GetMapping("/query_cron_expression/{cronExpression}")
134 134 @ResponseBody
135 135 @ApiOperation(value = "查询cron表达式近5次的执行时间")
136 136 public ResponseResult queryCronExpression(@PathVariable("cronExpression") String cronExpression) {
... ...
... ... @@ -25,7 +25,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
25 25 *
26 26 */
27 27 @RestController
28   -@RequestMapping("api/yt/monitor/jobLog")
  28 +@RequestMapping("api/yt/monitor/job_log")
29 29 @RequiredArgsConstructor
30 30 @Api(tags = {"定时任务执行日志"})
31 31 public class SysJobLogController extends BaseController {
... ...
... ... @@ -36,7 +36,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
36 36 * @Description 告警联系人 @Author cxy @Date 2021/11/2 14:54
37 37 */
38 38 @RestController
39   -@RequestMapping("/api/yt/alarmContact")
  39 +@RequestMapping("/api/yt/alarm_contact")
40 40 @RequiredArgsConstructor
41 41 @Api(tags = "告警联系人")
42 42 public class YtAlarmContactController extends BaseController {
... ...
... ... @@ -18,7 +18,7 @@ import org.thingsboard.server.dao.yunteng.service.SysAppDesignService;
18 18 */
19 19 @Api(tags = "APP定制")
20 20 @RestController
21   -@RequestMapping("api/yt/appDesign")
  21 +@RequestMapping("api/yt/app_design")
22 22 @RequiredArgsConstructor
23 23 public class YtAppDesignController extends BaseController {
24 24
... ...
... ... @@ -24,7 +24,7 @@ import java.util.List;
24 24 public class YtAreaController {
25 25 private final SysAreaService sysAreaService;
26 26
27   - @PostMapping("areaList")
  27 + @PostMapping("list")
28 28 @ApiOperation("查询")
29 29 public ResponseEntity<List<SysAreaDTO>> areaList(@RequestBody SysAreaDTO sysAreaDTO) {
30 30 return ResponseEntity.ok(sysAreaService.list(sysAreaDTO));
... ...
1   -package org.thingsboard.server.controller.yunteng;
2   -
3   -import io.swagger.annotations.ApiOperation;
4   -import lombok.RequiredArgsConstructor;
5   -import org.springframework.http.ResponseEntity;
6   -import org.springframework.web.bind.annotation.GetMapping;
7   -import org.springframework.web.bind.annotation.RequestMapping;
8   -import org.springframework.web.bind.annotation.RestController;
9   -import org.thingsboard.server.common.data.exception.ThingsboardException;
10   -import org.thingsboard.server.common.data.yunteng.common.YtCommonService;
11   -import org.thingsboard.server.controller.BaseController;
12   -
13   -@RequiredArgsConstructor
14   -@RequestMapping("/api/yt/common")
15   -@RestController
16   -public class YtCommonController extends BaseController {
17   - private final YtCommonService commonService;
18   -
19   -
20   -}
... ... @@ -97,7 +97,7 @@ public class YtConfigurationCenterController extends BaseController {
97 97 return ResponseEntity.ok(ytConfigurationCenterService.deleteConfigurationCenter(deleteDTO));
98 98 }
99 99
100   - @GetMapping("/getConfigurationInfo/{id}")
  100 + @GetMapping("/get_configuration_info/{id}")
101 101 @ApiOperation("获取组态信息")
102 102 public ResponseEntity<ConfigurationContentInfoDTO> getConfigurationInfos(
103 103 @PathVariable("id") String id) throws ThingsboardException {
... ...
... ... @@ -72,10 +72,10 @@ public class YtConfigurationNodeController extends BaseController {
72 72 return ResponseEntity.ok(nodeDTO);
73 73 }
74 74
75   - @PostMapping("datascource")
  75 + @PostMapping("datasource")
76 76 @ApiOperation("编辑数据源")
77   - @PreAuthorize("@check.checkPermissions({},{'api:yt:configuration:node:datascource:post'})")
78   - public ResponseEntity<ConfigurationDatasourceDTO> saveDatascource(
  77 + @PreAuthorize("@check.checkPermissions({},{'api:yt:configuration:node:datasource:post'})")
  78 + public ResponseEntity<ConfigurationDatasourceDTO> saveDatasource(
79 79 @Validated({AddGroup.class}) @RequestBody ConfigurationDatasourceDTO datasourceDTO)
80 80 throws ThingsboardException {
81 81 datasourceDTO.setTenantId(getCurrentUser().getCurrentTenantId());
... ... @@ -106,10 +106,10 @@ public class YtConfigurationNodeController extends BaseController {
106 106 }
107 107
108 108
109   - @DeleteMapping("datascource")
  109 + @DeleteMapping("datasource")
110 110 @ApiOperation("删除数据源")
111   - @PreAuthorize("@check.checkPermissions({},{'api:yt:configuration:node:datascource:delete'})")
112   - public ResponseEntity<Boolean> deleteDatascource(@RequestBody ConfigurationDatasourceDTO deleteDTO)
  111 + @PreAuthorize("@check.checkPermissions({},{'api:yt:configuration:node:datasource:delete'})")
  112 + public ResponseEntity<Boolean> deleteDatasource(@RequestBody ConfigurationDatasourceDTO deleteDTO)
113 113 throws ThingsboardException {
114 114 deleteDTO.setTenantId(getCurrentUser().getCurrentTenantId());
115 115 return ResponseEntity.ok(datasourceService.deleteConfigurationDatasource(deleteDTO));
... ...
... ... @@ -47,7 +47,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
47 47
48 48 @RestController
49 49 @RequiredArgsConstructor
50   -@RequestMapping("api/yt/deviceProfile")
  50 +@RequestMapping("api/yt/device_profile")
51 51 @Api(tags = {"设备配置管理"})
52 52 public class YtDeviceProfileController extends BaseController {
53 53 private final YtDeviceProfileService ytDeviceProfileService;
... ...
... ... @@ -25,7 +25,7 @@ import java.util.Map;
25 25 import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*;
26 26
27 27 @RestController
28   -@RequestMapping("api/yt/dictItem")
  28 +@RequestMapping("api/yt/dict_item")
29 29 @RequiredArgsConstructor
30 30 public class YtDictItemController extends BaseController {
31 31 private final SysDictItemService sysDictItemService;
... ...
... ... @@ -17,7 +17,7 @@ import java.util.HashMap;
17 17 import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*;
18 18
19 19 @RestController
20   -@RequestMapping("api/yt/mailLog")
  20 +@RequestMapping("api/yt/mail_log")
21 21 @RequiredArgsConstructor
22 22 public class YtMailLogController extends BaseController {
23 23
... ...
... ... @@ -36,7 +36,7 @@ public class YtMenuController extends BaseController {
36 36 getCurrentUser().isPtTenantAdmin(),needButton);
37 37 }
38 38
39   - @GetMapping("getMenuIdsByRoleId/{roleId}")
  39 + @GetMapping("get_ids/{roleId}")
40 40 public Set<String> getMenuIdsByRoleId(@PathVariable("roleId") String roleId) {
41 41 return menuService.getMenuIdsByRoleId(roleId);
42 42 }
... ...
... ... @@ -88,7 +88,7 @@ public class YtMessageTemplateController extends BaseController {
88 88 return messageTemplateService.updateMessageTemplate(templateDTO);
89 89 }
90 90
91   - @PostMapping("/sendSms")
  91 + @PostMapping("/send_sms")
92 92 public ResponseResult<String> sendSms(
93 93 @Validated({AddGroup.class}) @RequestBody SmsReqDTO smsReqDTO) {
94 94 boolean result = smsService.sendSms(smsReqDTO);
... ... @@ -96,7 +96,7 @@ public class YtMessageTemplateController extends BaseController {
96 96 return ResponseResult.success(message);
97 97 }
98 98
99   - @PostMapping("/sendEmail")
  99 + @PostMapping("/send_email")
100 100 public ResponseResult<String> sendEmail(
101 101 @Validated({AddGroup.class}) @RequestBody EmailReqDTO emailReqDTO) {
102 102 boolean result = mailService.sendEmail(emailReqDTO);
... ...
... ... @@ -39,7 +39,7 @@ public class YtNoAuthController{
39 39 private final YtDataComponentService ytDataComponentService;
40 40 private final YtDataBoardService ytDataBoardService;
41 41
42   - @PostMapping("/sendLoginSmsCode/{phoneNumber}")
  42 + @PostMapping("/send_login_code/{phoneNumber}")
43 43 public boolean sendVerificationCode(@PathVariable("phoneNumber") String phoneNumber) {
44 44 Assert.isTrue(
45 45 CHINA_MOBILE_PATTERN.matcher(phoneNumber).matches(), "please input correct phone number");
... ... @@ -54,7 +54,7 @@ public class YtNoAuthController{
54 54 userService.forgetPassword(phoneNumber, forget);
55 55 }
56 56
57   - @PostMapping("/resetCode/{phoneNumber}")
  57 + @PostMapping("/reset_code/{phoneNumber}")
58 58 @ApiOperation("密码找回短信验证码")
59 59 public void forgetPasswordCode(@PathVariable("phoneNumber") String phoneNumber) {
60 60 smsService.sendSmsCode(phoneNumber, MsgTemplatePurposeEnum.FOR_FORGET_PASSWORD);
... ... @@ -112,7 +112,7 @@ public class YtNoAuthController{
112 112 objectNode.put("unchange", true);
113 113 return objectNode;
114 114 }
115   - @GetMapping("/share/dataBoard/{boardId}/{tenantId}")
  115 + @GetMapping("/share/data_board/{boardId}/{tenantId}")
116 116 @ApiOperation(value = "查询看板下的所有组件信息")
117 117 public ResponseResult<MoreDataComponentInfoDTO> getDataComponentsByBoardId(
118 118 @PathVariable("boardId") String boardId,@PathVariable("tenantId") String tenantId) throws ThingsboardException {
... ...
... ... @@ -25,7 +25,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
25 25 */
26 26 @Api(tags = "我的通知")
27 27 @RestController
28   -@RequestMapping("api/yt/noticeUser")
  28 +@RequestMapping("api/yt/notice_user")
29 29 @RequiredArgsConstructor
30 30 public class YtNoticeUserController extends BaseController {
31 31
... ...
... ... @@ -82,7 +82,7 @@ public class YtOrganizationController extends BaseController {
82 82 getCurrentUser().getCurrentUserId()));
83 83 }
84 84
85   - @PutMapping("saveOrUpdateUserOrganizationMapping/{userId}")
  85 + @PutMapping("save_organization_mapping/{userId}")
86 86 public void bindUserToOrganization(
87 87 @RequestBody String[] organizationIds, @PathVariable("userId") String userId) throws ThingsboardException {
88 88 organizationService.bindUserToOrganization(getCurrentUser().getCurrentTenantId(), userId, organizationIds);
... ...
... ... @@ -24,7 +24,7 @@ public class YtOssFileController {
24 24 return fileStorageService.upload(file);
25 25 }
26 26
27   - @GetMapping("/downloadFile/{fileName:.+}")
  27 + @GetMapping("/download_file/{fileName:.+}")
28 28 public ResponseEntity<?> downloadFile(
29 29 @PathVariable String fileName, HttpServletRequest request, HttpServletResponse response) {
30 30 return fileStorageService.download(fileName, request, response);
... ...
... ... @@ -66,14 +66,14 @@ public class YtRoleController extends BaseController {
66 66 return roleService.getPermissions(getCurrentUser().isPtSysadmin(), getCurrentUser().isPtTenantAdmin(), getCurrentUser().getCurrentTenantId(), getCurrentUser().getCurrentUserId());
67 67 }
68 68
69   - @PutMapping("updateRoleStatus/{roleId}/{status}")
  69 + @PutMapping("update_status/{roleId}/{status}")
70 70 public void updateRoleStatus(
71 71 @PathVariable("roleId") String roleId, @PathVariable("status") int status) throws ThingsboardException {
72 72 Assert.isTrue(status == 0 || status == 1, "role status is not correct");
73 73 roleService.updateRoleStatus(roleId, status, getCurrentUser().isPtSysadmin() ,getCurrentUser().getCurrentTenantId());
74 74 }
75 75
76   - @PostMapping("saveOrUpdateRoleInfoWithMenu")
  76 + @PostMapping("save_with_menu")
77 77 @PreAuthorize("@check.checkPermissions({},{'api:yt:role:saveOrUpdateRoleInfoWithMenu:post','api:yt:role:saveOrUpdateRoleInfoWithMenu:update'})")
78 78 public RoleDTO saveOrUpdateRoleInfoWithMenu(@RequestBody RoleReqDTO roleReqDTO) throws ThingsboardException {
79 79 return roleService.saveOrUpdateRoleInfoWithMenu(
... ...
... ... @@ -15,7 +15,7 @@ import org.thingsboard.server.dao.yunteng.service.YtRuleChainService;
15 15
16 16 @RestController
17 17 @RequiredArgsConstructor
18   -@RequestMapping("api/yt/rulechain")
  18 +@RequestMapping("api/yt/rule_chain")
19 19 @Api(tags = {"规则链管理"})
20 20 public class YtRuleChainController extends BaseController {
21 21 private final YtRuleChainService chainService;
... ...
... ... @@ -35,7 +35,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
35 35
36 36 /** @Description 场景联动 @Author cxy @Date 2021/11/25 11:25 */
37 37 @RestController
38   -@RequestMapping("/api/yt/sceneLinkage")
  38 +@RequestMapping("/api/yt/scene_linkage")
39 39 @RequiredArgsConstructor
40 40 @Api(tags = "场景联动")
41 41 @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})")
... ...
... ... @@ -19,7 +19,7 @@ import java.util.HashMap;
19 19 import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*;
20 20
21 21 @RestController
22   -@RequestMapping("api/yt/smsLog")
  22 +@RequestMapping("api/yt/sms_log")
23 23 @RequiredArgsConstructor
24 24 public class YtSmsLogController extends BaseController {
25 25
... ...
... ... @@ -36,7 +36,7 @@ public class YtTenantController extends AbstractUserAccount {
36 36 this.accountProperties = accountProperties;
37 37 }
38 38
39   - @PostMapping("/resetPassword/{userId}")
  39 + @PostMapping("/reset_password/{userId}")
40 40 @PreAuthorize("hasAnyAuthority('SYS_ADMIN')")
41 41 public void resetPassword(@PathVariable("userId") String userId) throws ThingsboardException {
42 42 //check is tenant account
... ...
... ... @@ -20,7 +20,7 @@ import java.util.List;
20 20 import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*;
21 21
22 22 @RestController
23   -@RequestMapping("/api/yt/tenantProfiles")
  23 +@RequestMapping("/api/yt/tenant_profiles")
24 24 @RequiredArgsConstructor
25 25 public class YtTenantProfilesController extends BaseController {
26 26
... ...
... ... @@ -181,7 +181,7 @@ public class YtUserController extends AbstractUserAccount {
181 181
182 182
183 183 @PreAuthorize("@check.checkPermissions({'SYS_ADMIN'},{'api:yt:user:saveTenantAdmin:post'})")
184   - @PostMapping("saveTenantAdmin")
  184 + @PostMapping("save_tenant_admin")
185 185 public UserDTO saveTenantAdmin(@Validated(AddGroup.class) @RequestBody UserDTO userDTO)
186 186 throws ThingsboardException {
187 187 if (StringUtils.isEmpty(userDTO.getTenantId())) {
... ... @@ -226,7 +226,7 @@ public class YtUserController extends AbstractUserAccount {
226 226 deleteDTO.getIds(), getCurrentUser().isPtSysadmin(), getCurrentUser().getCurrentTenantId());
227 227 }
228 228
229   - @GetMapping("getGroupUserByGroupId/{groupId}")
  229 + @GetMapping("get_group_user/{groupId}")
230 230 public ResponseEntity<List<UserDTO>> getGroupUserByGroupId(
231 231 @PathVariable("groupId") String groupId) throws ThingsboardException {
232 232 return ResponseEntity.of(
... ... @@ -245,7 +245,7 @@ public class YtUserController extends AbstractUserAccount {
245 245 ExcelUtil.exportExcel(response, "用户信息", "user info", List.of(me), UserInfoDTO.class);
246 246 }
247 247
248   - @GetMapping("/accountExist/{username}")
  248 + @GetMapping("/account_exist/{username}")
249 249 public ResponseResult<UserDTO> accountExist(@PathVariable String username)
250 250 throws ThingsboardException {
251 251 return ResponseResult.success(
... ... @@ -253,7 +253,7 @@ public class YtUserController extends AbstractUserAccount {
253 253 }
254 254
255 255 @ApiOperation(value = "判断电话是否重复")
256   - @GetMapping("/findUserByPhoneNumber/{phoneNumber}")
  256 + @GetMapping("/get_user/{phoneNumber}")
257 257 public ResponseResult<UserDTO> findUserByPhoneNumber(@PathVariable String phoneNumber) throws ThingsboardException {
258 258 return ResponseResult.success(
259 259 userService.findUserByPhoneNumber(phoneNumber));
... ...