♻️ Refactoring code.Refactor method name according to Alibaba Java Coding Guidelines
This commit is contained in:
1 parent
1ea00b5b72
commit
d232d4feb3
71 files changed
+222
-211
No files matched your search
+1
-1
@@ -213,7 +213,7 @@ INSERT INTO `sys_menu` VALUES (2200, '字典管理', NULL, 'dict', 2000, 'icon-n
|
||||
INSERT INTO `sys_menu` VALUES (2201, '字典删除', 'sys_dict_del', NULL, 2200, NULL, NULL, NULL, '0', '1', '2017-11-29 11:30:11', '2018-09-28 09:09:10', '0', 1);
|
||||
INSERT INTO `sys_menu` VALUES (2202, '字典新增', 'sys_dict_add', NULL, 2200, NULL, NULL, NULL, '0', '1', '2018-05-11 22:34:55', '2018-09-28 09:09:12', '0', 1);
|
||||
INSERT INTO `sys_menu` VALUES (2203, '字典修改', 'sys_dict_edit', NULL, 2200, NULL, NULL, NULL, '0', '1', '2018-05-11 22:36:03', '2018-09-28 09:09:16', '0', 1);
|
||||
INSERT INTO `sys_menu` VALUES (2300, '代码生成', '', 'gen', 2000, 'icon-weibiaoti46', 'views/admin/gen/index', 8, '0', '0', '2018-01-20 13:17:19', '2018-09-28 09:02:54', '0', 1);
|
||||
INSERT INTO `sys_menu` VALUES (2300, '代码生成', '', 'gen', 2000, 'icon-weibiaoti46', 'views/gen/index', 8, '0', '0', '2018-01-20 13:17:19', '2018-09-28 09:02:54', '0', 1);
|
||||
INSERT INTO `sys_menu` VALUES (2400, '终端管理', '', 'client', 2000, 'icon-shouji', 'views/admin/client/index', 9, '0', '0', '2018-01-20 13:17:19', '2018-09-28 09:01:43', '0', 1);
|
||||
INSERT INTO `sys_menu` VALUES (2401, '客户端新增', 'sys_client_add', NULL, 2400, '1', NULL, NULL, '0', '1', '2018-05-15 21:35:18', '2018-09-28 09:10:25', '0', 1);
|
||||
INSERT INTO `sys_menu` VALUES (2402, '客户端修改', 'sys_client_edit', NULL, 2400, NULL, NULL, NULL, '0', '1', '2018-05-15 21:37:06', '2018-09-28 09:10:27', '0', 1);
|
||||
|
||||
+9
@@ -81,4 +81,13 @@ public interface CommonConstant {
|
||||
* 验证码前缀
|
||||
*/
|
||||
String DEFAULT_CODE_KEY = "DEFAULT_CODE_KEY_";
|
||||
|
||||
/**
|
||||
* 成功标记
|
||||
*/
|
||||
Integer SUCCESS=0;
|
||||
/**
|
||||
* 失败标记
|
||||
*/
|
||||
Integer FAIL=1;
|
||||
}
|
||||
+1
-1
@@ -27,7 +27,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum EnumLoginType {
|
||||
public enum LoginTypeEnum {
|
||||
/**
|
||||
* 账号密码登录
|
||||
*/
|
||||
+1
-1
@@ -27,7 +27,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum EnumProcessStatus {
|
||||
public enum ProcessStatusEnum {
|
||||
/**
|
||||
* 图片资源
|
||||
*/
|
||||
+1
-1
@@ -27,7 +27,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum EnumResourceType {
|
||||
public enum ResourceTypeEnum {
|
||||
/**
|
||||
* 图片资源
|
||||
*/
|
||||
+1
-1
@@ -27,7 +27,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum EnumTaskStatus {
|
||||
public enum TaskStatusEnum {
|
||||
/**
|
||||
* 未提交
|
||||
*/
|
||||
+10
-9
@@ -19,9 +19,8 @@
|
||||
|
||||
package com.pig4cloud.pigx.common.core.util;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstant;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -34,17 +33,19 @@ import java.io.Serializable;
|
||||
*/
|
||||
@ToString
|
||||
@Accessors(chain=true)
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public class R<T> implements Serializable {
|
||||
private static final int SUCCESS = 0;
|
||||
private static final int FAIL = 1;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private int code = CommonConstant.SUCCESS;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private String msg = "success";
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private int code = SUCCESS;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -68,6 +69,6 @@ public class R<T> implements Serializable {
|
||||
public R(Throwable e) {
|
||||
super();
|
||||
this.msg = e.getMessage();
|
||||
this.code = FAIL;
|
||||
this.code = CommonConstant.FAIL;
|
||||
}
|
||||
}
|
||||
+15
-11
@@ -17,6 +17,7 @@
|
||||
|
||||
package com.pig4cloud.pigx.common.security.component;
|
||||
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstant;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -34,11 +35,10 @@ import java.util.List;
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/8/30
|
||||
* 全局的的异常处理器
|
||||
* 全局异常处理器
|
||||
*/
|
||||
@Slf4j
|
||||
@RestControllerAdvice
|
||||
@AllArgsConstructor
|
||||
public class GlobalExceptionHandlerResolver {
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,7 @@ public class GlobalExceptionHandlerResolver {
|
||||
*/
|
||||
@ExceptionHandler(Exception.class)
|
||||
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||
public R exception(Exception e) {
|
||||
public R handleGlobalException(Exception e) {
|
||||
log.error("全局异常信息 ex={}", e.getMessage(), e);
|
||||
return new R<>(e);
|
||||
}
|
||||
@@ -62,8 +62,12 @@ public class GlobalExceptionHandlerResolver {
|
||||
*/
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
@ResponseStatus(HttpStatus.FORBIDDEN)
|
||||
public R exception(AccessDeniedException e) {
|
||||
return new R<>(e.getLocalizedMessage());
|
||||
public R handleAccessDeniedException(AccessDeniedException e) {
|
||||
log.error("拒绝授权异常信息 ex={}",e.getLocalizedMessage(),e);
|
||||
return R.builder()
|
||||
.msg(e.getLocalizedMessage())
|
||||
.code(CommonConstant.FAIL)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,12 +78,12 @@ public class GlobalExceptionHandlerResolver {
|
||||
*/
|
||||
@ExceptionHandler({MethodArgumentNotValidException.class, BindException.class})
|
||||
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
||||
public R bodyValidExceptionHandler(MethodArgumentNotValidException exception) {
|
||||
public R handleBodyValidException(MethodArgumentNotValidException exception) {
|
||||
List<FieldError> fieldErrors = exception.getBindingResult().getFieldErrors();
|
||||
R result = new R();
|
||||
result.setMsg(fieldErrors.get(0).getDefaultMessage());
|
||||
log.warn(fieldErrors.get(0).getDefaultMessage());
|
||||
return result;
|
||||
log.error("参数绑定异常,ex = {}",fieldErrors.get(0).getDefaultMessage());
|
||||
return R.builder()
|
||||
.msg(fieldErrors.get(0).getDefaultMessage())
|
||||
.code(CommonConstant.FAIL)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -71,7 +71,7 @@ public class PigxWebResponseExceptionTranslator implements WebResponseExceptionT
|
||||
ase = (HttpRequestMethodNotSupportedException) throwableAnalyzer
|
||||
.getFirstThrowableOfType(HttpRequestMethodNotSupportedException.class, causeChain);
|
||||
if (ase != null) {
|
||||
return handleOAuth2Exception(new MethodNotAllowed(ase.getMessage(), ase));
|
||||
return handleOAuth2Exception(new MethodNotAllowedException(ase.getMessage(), ase));
|
||||
}
|
||||
|
||||
ase = (OAuth2Exception) throwableAnalyzer.getFirstThrowableOfType(
|
||||
|
||||
+2
-2
@@ -26,9 +26,9 @@ import org.springframework.http.HttpStatus;
|
||||
* @date 2018/7/8
|
||||
*/
|
||||
@JsonSerialize(using = PigxAuth2ExceptionSerializer.class)
|
||||
public class MethodNotAllowed extends PigxAuth2Exception {
|
||||
public class MethodNotAllowedException extends PigxAuth2Exception {
|
||||
|
||||
public MethodNotAllowed(String msg, Throwable t) {
|
||||
public MethodNotAllowedException(String msg, Throwable t) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ public interface RemoteTokenService {
|
||||
* @return page
|
||||
*/
|
||||
@PostMapping("/token/page")
|
||||
R<Page> selectPage(@RequestBody Map<String, Object> params, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
R<Page> getTokenPage(@RequestBody Map<String, Object> params, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
/**
|
||||
* 删除token
|
||||
@@ -51,5 +51,5 @@ public interface RemoteTokenService {
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/token/{token}")
|
||||
R<Boolean> deleteTokenById(@PathVariable("token") String token, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
R<Boolean> removeTokenById(@PathVariable("token") String token, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
}
|
||||
+2
-2
@@ -45,7 +45,7 @@ public class RemoteTokenServiceFallbackImpl implements RemoteTokenService {
|
||||
* @return page
|
||||
*/
|
||||
@Override
|
||||
public R<Page> selectPage(Map<String, Object> params, String from) {
|
||||
public R<Page> getTokenPage(Map<String, Object> params, String from) {
|
||||
log.error("调用认证中心查询token 失败", cause);
|
||||
return null;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public class RemoteTokenServiceFallbackImpl implements RemoteTokenService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R<Boolean> deleteTokenById(String token, String from) {
|
||||
public R<Boolean> removeTokenById(String token, String from) {
|
||||
log.error("删除token 失败 {}", token, cause);
|
||||
return null;
|
||||
}
|
||||
|
||||
+8
-8
@@ -53,7 +53,7 @@ public class DeptController {
|
||||
* @return SysDept
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R get(@PathVariable Integer id) {
|
||||
public R getById(@PathVariable Integer id) {
|
||||
return new R<>(sysDeptService.getById(id));
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ public class DeptController {
|
||||
* @return 树形菜单
|
||||
*/
|
||||
@GetMapping(value = "/user-tree")
|
||||
public R userTree() {
|
||||
return new R<>(sysDeptService.selectUserTree());
|
||||
public R getUserTree() {
|
||||
return new R<>(sysDeptService.getUserTree());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,8 +87,8 @@ public class DeptController {
|
||||
@SysLog("添加部门")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_dept_add')")
|
||||
public R add(@Valid @RequestBody SysDept sysDept) {
|
||||
return new R<>(sysDeptService.insertDept(sysDept));
|
||||
public R save(@Valid @RequestBody SysDept sysDept) {
|
||||
return new R<>(sysDeptService.saveDept(sysDept));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,8 +100,8 @@ public class DeptController {
|
||||
@SysLog("删除部门")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_dept_del')")
|
||||
public R delete(@PathVariable Integer id) {
|
||||
return new R<>(sysDeptService.deleteDeptById(id));
|
||||
public R removeById(@PathVariable Integer id) {
|
||||
return new R<>(sysDeptService.removeDeptById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,7 +113,7 @@ public class DeptController {
|
||||
@SysLog("编辑部门")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_dept_edit')")
|
||||
public R edit(@Valid @RequestBody SysDept sysDept) {
|
||||
public R update(@Valid @RequestBody SysDept sysDept) {
|
||||
sysDept.setUpdateTime(LocalDateTime.now());
|
||||
return new R<>(sysDeptService.updateDeptById(sysDept));
|
||||
}
|
||||
|
||||
+6
-6
@@ -58,7 +58,7 @@ public class DictController {
|
||||
* @return 字典信息
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R dict(@PathVariable Integer id) {
|
||||
public R getById(@PathVariable Integer id) {
|
||||
return new R<>(sysDictService.getById(id));
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class DictController {
|
||||
* @return 分页对象
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R<IPage> getSysDictPage(Page page, SysDict sysDict) {
|
||||
public R<IPage> getDictPage(Page page, SysDict sysDict) {
|
||||
return new R<>(sysDictService.page(page, Wrappers.query(sysDict)));
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class DictController {
|
||||
*/
|
||||
@GetMapping("/type/{type}")
|
||||
@Cacheable(value = "dict_details", key = "#type")
|
||||
public R findDictByType(@PathVariable String type) {
|
||||
public R getDictByType(@PathVariable String type) {
|
||||
return new R<>(sysDictService.list(Wrappers
|
||||
.<SysDict>query().lambda()
|
||||
.eq(SysDict::getType, type)));
|
||||
@@ -97,7 +97,7 @@ public class DictController {
|
||||
@PostMapping
|
||||
@CacheEvict(value = "dict_details", key = "#sysDict.type")
|
||||
@PreAuthorize("@pms.hasPermission('sys_dict_add')")
|
||||
public R dict(@Valid @RequestBody SysDict sysDict) {
|
||||
public R save(@Valid @RequestBody SysDict sysDict) {
|
||||
return new R<>(sysDictService.save(sysDict));
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class DictController {
|
||||
@DeleteMapping("/{id}/{type}")
|
||||
@CacheEvict(value = "dict_details", key = "#type")
|
||||
@PreAuthorize("@pms.hasPermission('sys_dict_del')")
|
||||
public R deleteDict(@PathVariable Integer id, @PathVariable String type) {
|
||||
public R removeById(@PathVariable Integer id, @PathVariable String type) {
|
||||
return new R<>(sysDictService.removeById(id));
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ public class DictController {
|
||||
@SysLog("修改字典")
|
||||
@CacheEvict(value = "dict_details", key = "#sysDict.type")
|
||||
@PreAuthorize("@pms.hasPermission('sys_dict_edit')")
|
||||
public R editDict(@Valid @RequestBody SysDict sysDict) {
|
||||
public R updateById(@Valid @RequestBody SysDict sysDict) {
|
||||
return new R<>(sysDictService.updateById(sysDict));
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -57,7 +57,7 @@ public class LogController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R getSysLogPage(Page page, SysLog sysLog) {
|
||||
public R getLogPage(Page page, SysLog sysLog) {
|
||||
return new R<>(sysLogService.page(page, Wrappers.query(sysLog)));
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class LogController {
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_log_del')")
|
||||
public R delete(@PathVariable Long id) {
|
||||
public R removeById(@PathVariable Long id) {
|
||||
return new R<>(sysLogService.removeById(id));
|
||||
}
|
||||
|
||||
@@ -85,13 +85,13 @@ public class LogController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入前端异常日志
|
||||
* 批量插入前端异常日志
|
||||
*
|
||||
* @param preLogVoList 日志实体
|
||||
* @return success/false
|
||||
*/
|
||||
@PostMapping("/logs")
|
||||
public R saveLogs(@RequestBody List<PreLogVo> preLogVoList) {
|
||||
return new R<>(sysLogService.insertLogs(preLogVoList));
|
||||
public R saveBatchLogs(@RequestBody List<PreLogVo> preLogVoList) {
|
||||
return new R<>(sysLogService.saveBatchLogs(preLogVoList));
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -58,7 +58,7 @@ public class MenuController {
|
||||
* @return 当前用户的树形菜单
|
||||
*/
|
||||
@GetMapping
|
||||
public R userMenu() {
|
||||
public R getUserMenu() {
|
||||
// 获取符合条件的菜单
|
||||
Set<MenuVO> all = new HashSet<>();
|
||||
SecurityUtils.getRoles()
|
||||
@@ -88,7 +88,7 @@ public class MenuController {
|
||||
* @return 属性集合
|
||||
*/
|
||||
@GetMapping("/tree/{roleId}")
|
||||
public List roleTree(@PathVariable Integer roleId) {
|
||||
public List getRoleTree(@PathVariable Integer roleId) {
|
||||
return sysMenuService.findMenuByRoleId(roleId)
|
||||
.stream()
|
||||
.map(MenuVO::getMenuId)
|
||||
@@ -102,7 +102,7 @@ public class MenuController {
|
||||
* @return 菜单详细信息
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R menu(@PathVariable Integer id) {
|
||||
public R getById(@PathVariable Integer id) {
|
||||
return new R<>(sysMenuService.getById(id));
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class MenuController {
|
||||
@SysLog("新增菜单")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_menu_add')")
|
||||
public R menu(@Valid @RequestBody SysMenu sysMenu) {
|
||||
public R save(@Valid @RequestBody SysMenu sysMenu) {
|
||||
return new R<>(sysMenuService.save(sysMenu));
|
||||
}
|
||||
|
||||
@@ -128,8 +128,8 @@ public class MenuController {
|
||||
@SysLog("删除菜单")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_menu_del')")
|
||||
public R menuDel(@PathVariable Integer id) {
|
||||
return new R<>(sysMenuService.deleteMenu(id));
|
||||
public R removeById(@PathVariable Integer id) {
|
||||
return new R<>(sysMenuService.removeMenuById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,7 +141,7 @@ public class MenuController {
|
||||
@SysLog("更新菜单")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_menu_edit')")
|
||||
public R menuUpdate(@Valid @RequestBody SysMenu sysMenu) {
|
||||
public R update(@Valid @RequestBody SysMenu sysMenu) {
|
||||
return new R<>(sysMenuService.updateMenuById(sysMenu));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class MobileController {
|
||||
|
||||
@SysLog("发送验证码")
|
||||
@GetMapping("/{mobile}")
|
||||
public R code(@PathVariable String mobile) {
|
||||
public R sendSmsCode(@PathVariable String mobile) {
|
||||
return mobileService.sendSmsCode(mobile);
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -54,7 +54,7 @@ public class OauthClientDetailsController {
|
||||
* @return SysOauthClientDetails
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R get(@PathVariable Integer id) {
|
||||
public R getById(@PathVariable Integer id) {
|
||||
return new R<>(sysOauthClientDetailsService.getById(id));
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class OauthClientDetailsController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R getSysOauthClientDetailsPage(Page page, SysOauthClientDetails sysOauthClientDetails) {
|
||||
public R getOauthClientDetailsPage(Page page, SysOauthClientDetails sysOauthClientDetails) {
|
||||
return new R<>(sysOauthClientDetailsService.page(page, Wrappers.query(sysOauthClientDetails)));
|
||||
}
|
||||
|
||||
@@ -93,8 +93,8 @@ public class OauthClientDetailsController {
|
||||
@SysLog("删除终端")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_client_del')")
|
||||
public R delete(@PathVariable String id) {
|
||||
return new R<>(sysOauthClientDetailsService.deleteClientDetailsById(id));
|
||||
public R removeById(@PathVariable String id) {
|
||||
return new R<>(sysOauthClientDetailsService.removeClientDetailsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,7 +106,7 @@ public class OauthClientDetailsController {
|
||||
@SysLog("编辑终端")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_client_edit')")
|
||||
public R edit(@Valid @RequestBody SysOauthClientDetails sysOauthClientDetails) {
|
||||
public R update(@Valid @RequestBody SysOauthClientDetails sysOauthClientDetails) {
|
||||
return new R<>(sysOauthClientDetailsService.updateClientDetailsById(sysOauthClientDetails));
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -50,7 +50,7 @@ public class RoleController {
|
||||
* @return 角色信息
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R role(@PathVariable Integer id) {
|
||||
public R getById(@PathVariable Integer id) {
|
||||
return new R<>(sysRoleService.getById(id));
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class RoleController {
|
||||
@SysLog("添加角色")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_role_add')")
|
||||
public R role(@RequestBody SysRole sysRole) {
|
||||
public R save(@RequestBody SysRole sysRole) {
|
||||
return new R<>(sysRoleService.save(sysRole));
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class RoleController {
|
||||
@SysLog("修改角色")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_role_edit')")
|
||||
public R roleUpdate(@RequestBody SysRole sysRole) {
|
||||
public R update(@RequestBody SysRole sysRole) {
|
||||
return new R<>(sysRoleService.updateById(sysRole));
|
||||
}
|
||||
|
||||
@@ -89,8 +89,8 @@ public class RoleController {
|
||||
@SysLog("删除角色")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_role_del')")
|
||||
public R roleDel(@PathVariable Integer id) {
|
||||
return new R<>(sysRoleService.deleteRoleById(id));
|
||||
public R removeById(@PathVariable Integer id) {
|
||||
return new R<>(sysRoleService.removeRoleById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,7 +99,7 @@ public class RoleController {
|
||||
* @return 角色列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R roleList() {
|
||||
public R listRoles() {
|
||||
return new R<>(sysRoleService.list(Wrappers.emptyWrapper()));
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public class RoleController {
|
||||
* @return 分页对象
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R rolePage(Page page) {
|
||||
public R getRolePage(Page page) {
|
||||
return new R<>(sysRoleService.page(page, Wrappers.emptyWrapper()));
|
||||
}
|
||||
|
||||
@@ -124,8 +124,8 @@ public class RoleController {
|
||||
@SysLog("更新角色菜单")
|
||||
@PutMapping("/upd-menu")
|
||||
@PreAuthorize("@pms.hasPermission('sys_role_perm')")
|
||||
public R roleMenuUpd(Integer roleId, @RequestParam(value = "menuIds", required = false) String menuIds) {
|
||||
public R saveRoleMenus(Integer roleId, @RequestParam(value = "menuIds", required = false) String menuIds) {
|
||||
SysRole sysRole = sysRoleService.getById(roleId);
|
||||
return new R<>(sysRoleMenuService.insertRoleMenus(sysRole.getRoleCode(), roleId, menuIds));
|
||||
return new R<>(sysRoleMenuService.saveRoleMenus(sysRole.getRoleCode(), roleId, menuIds));
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -46,7 +46,7 @@ public class SysRouteConfController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping
|
||||
public R routes() {
|
||||
public R listRoutes() {
|
||||
return new R<>(sysRouteConfService.list());
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ public class SysRouteConfController {
|
||||
*/
|
||||
@SysLog("修改路由")
|
||||
@PutMapping
|
||||
public R edit(@RequestBody JSONArray routes) {
|
||||
return new R(sysRouteConfService.editRoutes(routes));
|
||||
public R updateRoutes(@RequestBody JSONArray routes) {
|
||||
return new R(sysRouteConfService.updateRoutes(routes));
|
||||
}
|
||||
|
||||
}
|
||||
+8
-9
@@ -52,7 +52,7 @@ public class SysSocialDetailsController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R getSysSocialDetailsPage(Page page, SysSocialDetails sysSocialDetails) {
|
||||
public R getSocialDetailsPage(Page page, SysSocialDetails sysSocialDetails) {
|
||||
return new R<>(sysSocialDetailsService.page(page, Wrappers.query(sysSocialDetails)));
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class SysSocialDetailsController {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R info(@PathVariable("id") Integer id) {
|
||||
public R getById(@PathVariable("id") Integer id) {
|
||||
return new R<>(sysSocialDetailsService.getById(id));
|
||||
}
|
||||
|
||||
@@ -77,8 +77,7 @@ public class SysSocialDetailsController {
|
||||
@SysLog("保存三方信息")
|
||||
@PostMapping
|
||||
public R save(@Valid @RequestBody SysSocialDetails sysSocialDetails) {
|
||||
sysSocialDetailsService.save(sysSocialDetails);
|
||||
return new R<>(Boolean.TRUE);
|
||||
return new R<>(sysSocialDetailsService.save(sysSocialDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,7 +88,7 @@ public class SysSocialDetailsController {
|
||||
*/
|
||||
@SysLog("修改三方信息")
|
||||
@PutMapping
|
||||
public R update(@Valid @RequestBody SysSocialDetails sysSocialDetails) {
|
||||
public R updateById(@Valid @RequestBody SysSocialDetails sysSocialDetails) {
|
||||
sysSocialDetailsService.updateById(sysSocialDetails);
|
||||
return new R<>(Boolean.TRUE);
|
||||
}
|
||||
@@ -102,7 +101,7 @@ public class SysSocialDetailsController {
|
||||
*/
|
||||
@SysLog("删除三方信息")
|
||||
@DeleteMapping("/{id}")
|
||||
public R delete(@PathVariable Integer id) {
|
||||
public R removeById(@PathVariable Integer id) {
|
||||
return new R<>(sysSocialDetailsService.removeById(id));
|
||||
}
|
||||
|
||||
@@ -113,8 +112,8 @@ public class SysSocialDetailsController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/info/{inStr}")
|
||||
public R social(@PathVariable String inStr) {
|
||||
return new R<>(sysSocialDetailsService.findUserInfo(inStr));
|
||||
public R getUserInfo(@PathVariable String inStr) {
|
||||
return new R<>(sysSocialDetailsService.getUserInfo(inStr));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,7 +124,7 @@ public class SysSocialDetailsController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/bind")
|
||||
public R bind(String state, String code) {
|
||||
public R bindSocial(String state, String code) {
|
||||
return new R<>(sysSocialDetailsService.bindSocial(state, code));
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -31,7 +31,7 @@ import java.util.Map;
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/9/4
|
||||
* token 管理
|
||||
* getTokenPage 管理
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@@ -47,20 +47,20 @@ public class TokenController {
|
||||
* @return token集合
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R token(@RequestParam Map<String, Object> params) {
|
||||
return remoteTokenService.selectPage(params, SecurityConstants.FROM_IN);
|
||||
public R getTokenPage(@RequestParam Map<String, Object> params) {
|
||||
return remoteTokenService.getTokenPage(params, SecurityConstants.FROM_IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param token token
|
||||
* @param token getTokenPage
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("删除用户token")
|
||||
@DeleteMapping("/{token}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_token_del')")
|
||||
public R delete(@PathVariable String token) {
|
||||
return remoteTokenService.deleteTokenById(token, SecurityConstants.FROM_IN);
|
||||
public R removeById(@PathVariable String token) {
|
||||
return remoteTokenService.removeTokenById(token, SecurityConstants.FROM_IN);
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -139,7 +139,7 @@ public class UserController {
|
||||
@SysLog("更新用户信息")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_user_edit')")
|
||||
public R userUpdate(@Valid @RequestBody UserDTO userDto) {
|
||||
public R updateUser(@Valid @RequestBody UserDTO userDto) {
|
||||
return new R<>(userService.updateUser(userDto));
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public class UserController {
|
||||
* @return 用户集合
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R userPage(Page page, UserDTO userDTO) {
|
||||
public R getUserPage(Page page, UserDTO userDTO) {
|
||||
return new R<>(userService.getUsersWithRolePage(page, userDTO));
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ public class UserController {
|
||||
*/
|
||||
@SysLog("修改个人信息")
|
||||
@PutMapping("/edit")
|
||||
public R editInfo(@Valid @RequestBody UserDTO userDto) {
|
||||
public R updateUserInfo(@Valid @RequestBody UserDTO userDto) {
|
||||
return userService.updateUserInfo(userDto);
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ public class UserController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/ancestor/{username}")
|
||||
public R ancestorUsers(@PathVariable String username) {
|
||||
return new R<>(userService.ancestorUsers(username));
|
||||
public R listAncestorUsers(@PathVariable String username) {
|
||||
return new R<>(userService.listAncestorUsers(username));
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -26,7 +26,7 @@ import com.pig4cloud.pigx.admin.api.entity.SysUser;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysSocialDetailsMapper;
|
||||
import com.pig4cloud.pigx.admin.service.SysUserService;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.EnumLoginType;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.LoginTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -55,7 +55,7 @@ public class WeChatLoginHandler extends AbstractLoginHandler {
|
||||
@Override
|
||||
public String identify(String code) {
|
||||
SysSocialDetails condition = new SysSocialDetails();
|
||||
condition.setType(EnumLoginType.WECHAT.getType());
|
||||
condition.setType(LoginTypeEnum.WECHAT.getType());
|
||||
SysSocialDetails socialDetails = sysSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
|
||||
|
||||
String url = String.format(SecurityConstants.WX_AUTHORIZATION_CODE_URL
|
||||
|
||||
+1
-2
@@ -37,8 +37,7 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||
/**
|
||||
* 关联dept——relation
|
||||
*
|
||||
* @param delFlag 删除标记
|
||||
* @return 数据列表
|
||||
*/
|
||||
List<SysDept> selectDeptDtoList(String delFlag);
|
||||
List<SysDept> listDepts();
|
||||
}
|
||||
+3
-2
@@ -36,12 +36,13 @@ public interface SysDeptRelationMapper extends BaseMapper<SysDeptRelation> {
|
||||
*
|
||||
* @param id 部门ID
|
||||
*/
|
||||
void deleteAllDeptRealtion(Integer id);
|
||||
void deleteDeptRelationsById(Integer id);
|
||||
|
||||
/**
|
||||
* 更改部分关系表数据
|
||||
*
|
||||
* @param deptRelation
|
||||
*/
|
||||
void updateDeptRealtion(SysDeptRelation deptRelation);
|
||||
void updateDeptRelations(SysDeptRelation deptRelation);
|
||||
|
||||
}
|
||||
+2
-2
@@ -41,7 +41,7 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
||||
* @param roleId 角色ID
|
||||
* @return
|
||||
*/
|
||||
List<MenuVO> findMenuByRoleId(Integer roleId);
|
||||
List<MenuVO> listMenusByRoleId(Integer roleId);
|
||||
|
||||
/**
|
||||
* 通过角色ID查询权限
|
||||
@@ -49,5 +49,5 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
||||
* @param roleIds Ids
|
||||
* @return
|
||||
*/
|
||||
List<String> findPermissionsByRoleIds(String roleIds);
|
||||
List<String> listPermissionsByRoleIds(String roleIds);
|
||||
}
|
||||
+1
-1
@@ -39,5 +39,5 @@ public interface SysRoleMapper extends BaseMapper<SysRole> {
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<SysRole> findRolesByUserId(Integer userId);
|
||||
List<SysRole> listRolesByUserId(Integer userId);
|
||||
}
|
||||
-2
@@ -19,7 +19,6 @@ package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysRouteConf;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 路由
|
||||
@@ -27,7 +26,6 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* @author lengleng
|
||||
* @date 2018-11-06 10:17:18
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysRouteConfMapper extends BaseMapper<SysRouteConf> {
|
||||
|
||||
}
|
||||
+2
-2
@@ -45,7 +45,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
* @param username 用户名
|
||||
* @return userVo
|
||||
*/
|
||||
UserVO selectUserVoByUsername(String username);
|
||||
UserVO getUserVoByUsername(String username);
|
||||
|
||||
/**
|
||||
* 分页查询用户信息(含角色)
|
||||
@@ -63,5 +63,5 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
* @param id 用户ID
|
||||
* @return userVo
|
||||
*/
|
||||
UserVO selectUserVoById(Integer id);
|
||||
UserVO getUserVoById(Integer id);
|
||||
}
|
||||
+3
-3
@@ -47,7 +47,7 @@ public interface SysDeptService extends IService<SysDept> {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<DeptTree> selectUserTree();
|
||||
List<DeptTree> getUserTree();
|
||||
|
||||
/**
|
||||
* 添加信息部门
|
||||
@@ -55,7 +55,7 @@ public interface SysDeptService extends IService<SysDept> {
|
||||
* @param sysDept
|
||||
* @return
|
||||
*/
|
||||
Boolean insertDept(SysDept sysDept);
|
||||
Boolean saveDept(SysDept sysDept);
|
||||
|
||||
/**
|
||||
* 删除部门
|
||||
@@ -63,7 +63,7 @@ public interface SysDeptService extends IService<SysDept> {
|
||||
* @param id 部门 ID
|
||||
* @return 成功、失败
|
||||
*/
|
||||
Boolean deleteDeptById(Integer id);
|
||||
Boolean removeDeptById(Integer id);
|
||||
|
||||
/**
|
||||
* 更新部门
|
||||
|
||||
+1
-1
@@ -42,5 +42,5 @@ public interface SysLogService extends IService<SysLog> {
|
||||
* @param preLogVoList 日志信息
|
||||
* @return true/false
|
||||
*/
|
||||
Boolean insertLogs(List<PreLogVo> preLogVoList);
|
||||
Boolean saveBatchLogs(List<PreLogVo> preLogVoList);
|
||||
}
|
||||
+1
-1
@@ -49,7 +49,7 @@ public interface SysMenuService extends IService<SysMenu> {
|
||||
* @param id 菜单ID
|
||||
* @return 成功、失败
|
||||
*/
|
||||
Boolean deleteMenu(Integer id);
|
||||
Boolean removeMenuById(Integer id);
|
||||
|
||||
/**
|
||||
* 更新菜单信息
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public interface SysOauthClientDetailsService extends IService<SysOauthClientDet
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteClientDetailsById(String id);
|
||||
Boolean removeClientDetailsById(String id);
|
||||
|
||||
/**
|
||||
* 根据客户端信息
|
||||
|
||||
+1
-1
@@ -41,5 +41,5 @@ public interface SysRoleMenuService extends IService<SysRoleMenu> {
|
||||
* @param menuIds 菜单ID拼成的字符串,每个id之间根据逗号分隔
|
||||
* @return
|
||||
*/
|
||||
Boolean insertRoleMenus(String role, Integer roleId, String menuIds);
|
||||
Boolean saveRoleMenus(String role, Integer roleId, String menuIds);
|
||||
}
|
||||
+1
-1
@@ -48,5 +48,5 @@ public interface SysRoleService extends IService<SysRole> {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteRoleById(Integer id);
|
||||
Boolean removeRoleById(Integer id);
|
||||
}
|
||||
+1
-1
@@ -48,6 +48,6 @@ public interface SysRouteConfService extends IService<SysRouteConf> {
|
||||
* @param routes 路由信息
|
||||
* @return
|
||||
*/
|
||||
Mono<Void> editRoutes(JSONArray routes);
|
||||
Mono<Void> updateRoutes(JSONArray routes);
|
||||
}
|
||||
|
||||
+1
-1
@@ -44,6 +44,6 @@ public interface SysSocialDetailsService extends IService<SysSocialDetails> {
|
||||
* @param inStr
|
||||
* @return
|
||||
*/
|
||||
UserInfo findUserInfo(String inStr);
|
||||
UserInfo getUserInfo(String inStr);
|
||||
}
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ public interface SysUserService extends IService<SysUser> {
|
||||
* @param username 用户名
|
||||
* @return R
|
||||
*/
|
||||
List<SysUser> ancestorUsers(String username);
|
||||
List<SysUser> listAncestorUsers(String username);
|
||||
|
||||
/**
|
||||
* 保存用户信息
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@ import com.pig4cloud.pigx.admin.mapper.SysUserMapper;
|
||||
import com.pig4cloud.pigx.admin.service.MobileService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CommonConstant;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.EnumLoginType;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.LoginTypeEnum;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -77,7 +77,7 @@ public class MobileServiceImpl implements MobileService {
|
||||
String code = RandomUtil.randomNumbers(Integer.parseInt(SecurityConstants.CODE_SIZE));
|
||||
log.debug("手机号生成验证码成功:{},{}", mobile, code);
|
||||
redisTemplate.opsForValue().set(
|
||||
CommonConstant.DEFAULT_CODE_KEY + EnumLoginType.SMS.getType() + "@" + mobile
|
||||
CommonConstant.DEFAULT_CODE_KEY + LoginTypeEnum.SMS.getType() + "@" + mobile
|
||||
, code, SecurityConstants.CODE_TIME, TimeUnit.SECONDS);
|
||||
return new R<>(Boolean.TRUE, code);
|
||||
}
|
||||
|
||||
+2
-2
@@ -82,7 +82,7 @@ public class SysDeptRelationServiceImpl extends ServiceImpl<SysDeptRelationMappe
|
||||
*/
|
||||
@Override
|
||||
public void deleteAllDeptRealtion(Integer id) {
|
||||
baseMapper.deleteAllDeptRealtion(id);
|
||||
baseMapper.deleteDeptRelationsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,7 +92,7 @@ public class SysDeptRelationServiceImpl extends ServiceImpl<SysDeptRelationMappe
|
||||
*/
|
||||
@Override
|
||||
public void updateDeptRealtion(SysDeptRelation relation) {
|
||||
baseMapper.updateDeptRealtion(relation);
|
||||
baseMapper.updateDeptRelations(relation);
|
||||
}
|
||||
|
||||
}
|
||||
+3
-3
@@ -59,7 +59,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertDept(SysDept dept) {
|
||||
public Boolean saveDept(SysDept dept) {
|
||||
SysDept sysDept = new SysDept();
|
||||
BeanUtils.copyProperties(dept, sysDept);
|
||||
this.save(sysDept);
|
||||
@@ -76,7 +76,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteDeptById(Integer id) {
|
||||
public Boolean removeDeptById(Integer id) {
|
||||
//级联删除部门
|
||||
List<Integer> idList = sysDeptRelationService
|
||||
.list(Wrappers.<SysDeptRelation>query().lambda()
|
||||
@@ -129,7 +129,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DeptTree> selectUserTree() {
|
||||
public List<DeptTree> getUserTree() {
|
||||
Integer deptId = SecurityUtils.getUser().getDeptId();
|
||||
List<Integer> descendantIdList = sysDeptRelationService
|
||||
.list(Wrappers.<SysDeptRelation>query().lambda()
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
|
||||
* @return true/false
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertLogs(List<PreLogVo> preLogVoList) {
|
||||
public Boolean saveBatchLogs(List<PreLogVo> preLogVoList) {
|
||||
List<SysLog> sysLogs = preLogVoList.stream()
|
||||
.map(pre -> {
|
||||
SysLog log = new SysLog();
|
||||
|
||||
+2
-2
@@ -52,13 +52,13 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
@Override
|
||||
@Cacheable(value = "menu_details", key = "#roleId + '_menu'")
|
||||
public List<MenuVO> findMenuByRoleId(Integer roleId) {
|
||||
return baseMapper.findMenuByRoleId(roleId);
|
||||
return baseMapper.listMenusByRoleId(roleId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@CacheEvict(value = "menu_details", allEntries = true)
|
||||
public Boolean deleteMenu(Integer id) {
|
||||
public Boolean removeMenuById(Integer id) {
|
||||
// 查询父节点为当前节点的节点
|
||||
List<Integer> menuIdList = this.list(Wrappers.<SysMenu>query()
|
||||
.lambda().eq(SysMenu::getParentId, id))
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ public class SysOauthClientDetailsServiceImpl extends ServiceImpl<SysOauthClient
|
||||
*/
|
||||
@Override
|
||||
@CacheEvict(value = SecurityConstants.CLIENT_DETAILS_KEY, key = "#id")
|
||||
public Boolean deleteClientDetailsById(String id) {
|
||||
public Boolean removeClientDetailsById(String id) {
|
||||
return this.removeById(id);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ public class SysRoleMenuServiceImpl extends ServiceImpl<SysRoleMenuMapper, SysRo
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@CacheEvict(value = "menu_details", key = "#roleId + '_menu'")
|
||||
public Boolean insertRoleMenus(String role, Integer roleId, String menuIds) {
|
||||
public Boolean saveRoleMenus(String role, Integer roleId, String menuIds) {
|
||||
this.remove(Wrappers.<SysRoleMenu>query().lambda()
|
||||
.eq(SysRoleMenu::getRoleId, role));
|
||||
|
||||
|
||||
+2
-2
@@ -54,7 +54,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
*/
|
||||
@Override
|
||||
public List findRolesByUserId(Integer userId) {
|
||||
return baseMapper.findRolesByUserId(userId);
|
||||
return baseMapper.listRolesByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,7 +66,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
@Override
|
||||
@CacheEvict(value = "menu_details", allEntries = true)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteRoleById(Integer id) {
|
||||
public Boolean removeRoleById(Integer id) {
|
||||
sysRoleMenuMapper.delete(Wrappers
|
||||
.<SysRoleMenu>update().lambda()
|
||||
.eq(SysRoleMenu::getRoleId, id));
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ public class SysRouteConfServiceImpl extends ServiceImpl<SysRouteConfMapper, Sys
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Mono<Void> editRoutes(JSONArray routes) {
|
||||
public Mono<Void> updateRoutes(JSONArray routes) {
|
||||
// 清空Redis 缓存
|
||||
Boolean result = redisTemplate.delete(CommonConstant.ROUTE_KEY);
|
||||
log.info("清空网关路由 {} ", result);
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ public class SysSocialDetailsServiceImpl extends ServiceImpl<SysSocialDetailsMap
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserInfo findUserInfo(String inStr) {
|
||||
public UserInfo getUserInfo(String inStr) {
|
||||
String[] inStrs = inStr.split("@");
|
||||
String type = inStrs[0];
|
||||
String loginStr = inStrs[1];
|
||||
|
||||
+3
-3
@@ -152,7 +152,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
*/
|
||||
@Override
|
||||
public UserVO selectUserVoById(Integer id) {
|
||||
return baseMapper.selectUserVoById(id);
|
||||
return baseMapper.getUserVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -172,7 +172,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
@Override
|
||||
@CacheEvict(value = "user_details", key = "#userDto.username")
|
||||
public R<Boolean> updateUserInfo(UserDTO userDto) {
|
||||
UserVO userVO = baseMapper.selectUserVoByUsername(userDto.getUsername());
|
||||
UserVO userVO = baseMapper.getUserVoByUsername(userDto.getUsername());
|
||||
SysUser sysUser = new SysUser();
|
||||
if (StrUtil.isNotBlank(userDto.getPassword())
|
||||
&& StrUtil.isNotBlank(userDto.getNewpassword1())) {
|
||||
@@ -219,7 +219,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
* @return R
|
||||
*/
|
||||
@Override
|
||||
public List<SysUser> ancestorUsers(String username) {
|
||||
public List<SysUser> listAncestorUsers(String username) {
|
||||
SysUser sysUser = this.getOne(Wrappers.<SysUser>query().lambda()
|
||||
.eq(SysUser::getUsername, username));
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</sql>
|
||||
|
||||
<!--关联查询部门列表-->
|
||||
<select id="selectDeptDtoList" resultType="com.pig4cloud.pigx.admin.api.entity.SysDept">
|
||||
<select id="listDepts" resultType="com.pig4cloud.pigx.admin.api.entity.SysDept">
|
||||
SELECT
|
||||
t.*
|
||||
FROM
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</sql>
|
||||
|
||||
<!-- 更新部门关系 -->
|
||||
<update id="updateDeptRealtion">
|
||||
<update id="updateDeptRelations">
|
||||
DELETE FROM sys_dept_relation
|
||||
WHERE
|
||||
descendant IN ( SELECT temp.descendant FROM
|
||||
@@ -50,7 +50,7 @@
|
||||
</update>
|
||||
|
||||
<!--删除部门-->
|
||||
<delete id="deleteAllDeptRealtion">
|
||||
<delete id="deleteDeptRelationsById">
|
||||
DELETE
|
||||
FROM
|
||||
sys_dept_relation
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
</resultMap>
|
||||
|
||||
<!--通过角色查询菜单信息-->
|
||||
<select id="findMenuByRoleId" resultMap="MenuVoResultMap">
|
||||
<select id="listMenusByRoleId" resultMap="MenuVoResultMap">
|
||||
SELECT
|
||||
sys_menu.*
|
||||
FROM
|
||||
@@ -69,7 +69,7 @@
|
||||
</select>
|
||||
|
||||
<!--通过角色ID 查询权限-->
|
||||
<select id="findPermissionsByRoleIds" resultType="java.lang.String">
|
||||
<select id="listPermissionsByRoleIds" resultType="java.lang.String">
|
||||
SELECT
|
||||
m.permission
|
||||
FROM
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</resultMap>
|
||||
|
||||
<!-- 通过用户ID,查询角色信息-->
|
||||
<select id="findRolesByUserId" resultMap="BaseResultMap">
|
||||
<select id="listRolesByUserId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
r.*
|
||||
FROM
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
d.dept_id AS deptId
|
||||
</sql>
|
||||
|
||||
<select id="selectUserVoByUsername" resultMap="userVoResultMap">
|
||||
<select id="getUserVoByUsername" resultMap="userVoResultMap">
|
||||
SELECT
|
||||
<include refid="userRoleSql"/>
|
||||
FROM
|
||||
@@ -123,7 +123,7 @@
|
||||
WHERE `user`.username = #{username}
|
||||
</select>
|
||||
|
||||
<select id="selectUserVoById" resultMap="userVoResultMap">
|
||||
<select id="getUserVoById" resultMap="userVoResultMap">
|
||||
SELECT
|
||||
<include refid="userRoleDeptSql"/>
|
||||
FROM
|
||||
|
||||
+5
-5
@@ -22,7 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pig4cloud.pigx.act.entity.LeaveBill;
|
||||
import com.pig4cloud.pigx.act.service.LeaveBillService;
|
||||
import com.pig4cloud.pigx.act.service.ProcessService;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.EnumTaskStatus;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.TaskStatusEnum;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -62,7 +62,7 @@ public class LeaveBillController {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/{leaveId}")
|
||||
public R info(@PathVariable("leaveId") Integer leaveId) {
|
||||
public R getById(@PathVariable("leaveId") Integer leaveId) {
|
||||
return new R<>(leaveBillService.getById(leaveId));
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class LeaveBillController {
|
||||
@PostMapping
|
||||
public R save(@RequestBody LeaveBill leaveBill) {
|
||||
leaveBill.setUsername(SecurityUtils.getUsername());
|
||||
leaveBill.setState(EnumTaskStatus.UNSUBMIT.getStatus());
|
||||
leaveBill.setState(TaskStatusEnum.UNSUBMIT.getStatus());
|
||||
return new R<>(leaveBillService.save(leaveBill));
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class LeaveBillController {
|
||||
* @return R
|
||||
*/
|
||||
@PutMapping
|
||||
public R update(@RequestBody LeaveBill leaveBill) {
|
||||
public R updateById(@RequestBody LeaveBill leaveBill) {
|
||||
return new R<>(leaveBillService.updateById(leaveBill));
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class LeaveBillController {
|
||||
* @return R
|
||||
*/
|
||||
@DeleteMapping("/{leaveId}")
|
||||
public R delete(@PathVariable Integer leaveId) {
|
||||
public R removeById(@PathVariable Integer leaveId) {
|
||||
return new R<>(leaveBillService.removeById(leaveId));
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -49,13 +49,13 @@ public class ModelController {
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public R list(@RequestParam Map<String, Object> params) {
|
||||
return new R<>(modelService.selectPage(params));
|
||||
public R getModelPage(@RequestParam Map<String, Object> params) {
|
||||
return new R<>(modelService.getModelPage(params));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public R delete(@PathVariable("id") String id) {
|
||||
return new R<>(modelService.delete(id));
|
||||
public R removeModelById(@PathVariable("id") String id) {
|
||||
return new R<>(modelService.removeModelById(id));
|
||||
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -19,7 +19,7 @@ package com.pig4cloud.pigx.act.controller;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import com.pig4cloud.pigx.act.service.ProcessService;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.EnumResourceType;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.ResourceTypeEnum;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
@@ -51,13 +51,13 @@ public class ProcessController {
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
|
||||
if (EnumResourceType.XML.getType().equals(resType)) {
|
||||
if (ResourceTypeEnum.XML.getType().equals(resType)) {
|
||||
headers.setContentType(MediaType.APPLICATION_XML);
|
||||
} else {
|
||||
headers.setContentType(MediaType.IMAGE_PNG);
|
||||
}
|
||||
|
||||
InputStream resourceAsStream = processService.resourceRead(procDefId, proInsId, resType);
|
||||
InputStream resourceAsStream = processService.readResource(procDefId, proInsId, resType);
|
||||
return new ResponseEntity(IoUtil.readBytes(resourceAsStream), headers, HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@@ -68,6 +68,6 @@ public class ProcessController {
|
||||
|
||||
@DeleteMapping("/{deploymentId}")
|
||||
public R deleteProcIns(@PathVariable String deploymentId) {
|
||||
return new R<>(processService.deleteProcIns(deploymentId));
|
||||
return new R<>(processService.removeProcIns(deploymentId));
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -44,16 +44,16 @@ public class TaskController {
|
||||
|
||||
@GetMapping("/todo")
|
||||
public R todo(@RequestParam Map<String, Object> params) {
|
||||
return new R<>(actTaskService.findTaskByName(params, SecurityUtils.getUsername()));
|
||||
return new R<>(actTaskService.getTaskByName(params, SecurityUtils.getUsername()));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public R task(@PathVariable String id) {
|
||||
return new R(actTaskService.findTaskByTaskId(id));
|
||||
public R getTaskById(@PathVariable String id) {
|
||||
return new R(actTaskService.getTaskById(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R task(@RequestBody LeaveBillDto leaveBillDto) {
|
||||
public R submitTask(@RequestBody LeaveBillDto leaveBillDto) {
|
||||
return new R(actTaskService.submitTask(leaveBillDto));
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class TaskController {
|
||||
|
||||
@GetMapping("/comment/{id}")
|
||||
public R commitList(@PathVariable String id) {
|
||||
return new R(actTaskService.findCommentByTaskId(id));
|
||||
return new R(actTaskService.getCommentByTaskId(id));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -39,7 +39,7 @@ public interface ActTaskService {
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
IPage findTaskByName(Map<String, Object> params, String name);
|
||||
IPage getTaskByName(Map<String, Object> params, String name);
|
||||
|
||||
/**
|
||||
* 通过任务ID查询任务信息关联申请单信息
|
||||
@@ -47,7 +47,7 @@ public interface ActTaskService {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LeaveBillDto findTaskByTaskId(String id);
|
||||
LeaveBillDto getTaskById(String id);
|
||||
|
||||
/**
|
||||
* 提交任务
|
||||
@@ -63,7 +63,7 @@ public interface ActTaskService {
|
||||
* @param taskId 任务ID
|
||||
* @return
|
||||
*/
|
||||
List<CommentDto> findCommentByTaskId(String taskId);
|
||||
List<CommentDto> getCommentByTaskId(String taskId);
|
||||
|
||||
/**
|
||||
* 追踪图片节点
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ public interface ModelService {
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
IPage<Model> selectPage(Map<String, Object> params);
|
||||
IPage<Model> getModelPage(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 删除流程
|
||||
@@ -53,7 +53,7 @@ public interface ModelService {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Boolean delete(String id);
|
||||
Boolean removeModelById(String id);
|
||||
|
||||
/**
|
||||
* 部署流程
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ public interface ProcessService {
|
||||
* @param resType
|
||||
* @return
|
||||
*/
|
||||
InputStream resourceRead(String procDefId, String proInsId, String resType);
|
||||
InputStream readResource(String procDefId, String proInsId, String resType);
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
@@ -62,7 +62,7 @@ public interface ProcessService {
|
||||
* @param deploymentId
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteProcIns(String deploymentId);
|
||||
Boolean removeProcIns(String deploymentId);
|
||||
|
||||
/**
|
||||
* 启动流程、更新请假单状态
|
||||
|
||||
+7
-7
@@ -28,7 +28,7 @@ import com.pig4cloud.pigx.act.entity.LeaveBill;
|
||||
import com.pig4cloud.pigx.act.mapper.LeaveBillMapper;
|
||||
import com.pig4cloud.pigx.act.service.ActTaskService;
|
||||
import com.pig4cloud.pigx.common.core.constant.PaginationConstant;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.EnumTaskStatus;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.TaskStatusEnum;
|
||||
import com.pig4cloud.pigx.common.security.util.SecurityUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -70,7 +70,7 @@ public class ActTaskServiceImpl implements ActTaskService {
|
||||
private final ProcessEngineFactoryBean processEngine;
|
||||
|
||||
@Override
|
||||
public IPage findTaskByName(Map<String, Object> params, String name) {
|
||||
public IPage getTaskByName(Map<String, Object> params, String name) {
|
||||
TaskQuery taskQuery = taskService.createTaskQuery()
|
||||
.taskCandidateOrAssigned(name)
|
||||
.orderByTaskCreateTime().asc();
|
||||
@@ -102,7 +102,7 @@ public class ActTaskServiceImpl implements ActTaskService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LeaveBillDto findTaskByTaskId(String taskId) {
|
||||
public LeaveBillDto getTaskById(String taskId) {
|
||||
Task task = taskService.createTaskQuery()
|
||||
.taskId(taskId)
|
||||
.singleResult();
|
||||
@@ -158,16 +158,16 @@ public class ActTaskServiceImpl implements ActTaskService {
|
||||
if (pi == null) {
|
||||
LeaveBill bill = new LeaveBill();
|
||||
bill.setLeaveId(id);
|
||||
bill.setState(StrUtil.equals(EnumTaskStatus.OVERRULE.getDescription()
|
||||
, leaveBillDto.getTaskFlag()) ? EnumTaskStatus.OVERRULE.getStatus()
|
||||
: EnumTaskStatus.COMPLETED.getStatus());
|
||||
bill.setState(StrUtil.equals(TaskStatusEnum.OVERRULE.getDescription()
|
||||
, leaveBillDto.getTaskFlag()) ? TaskStatusEnum.OVERRULE.getStatus()
|
||||
: TaskStatusEnum.COMPLETED.getStatus());
|
||||
leaveBillMapper.updateById(bill);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommentDto> findCommentByTaskId(String taskId) {
|
||||
public List<CommentDto> getCommentByTaskId(String taskId) {
|
||||
//使用当前的任务ID,查询当前流程对应的历史任务ID
|
||||
//使用当前任务ID,获取当前任务对象
|
||||
Task task = taskService.createTaskQuery()
|
||||
|
||||
+2
-2
@@ -108,7 +108,7 @@ public class ModelServiceImpl implements ModelService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<Model> selectPage(Map<String, Object> params) {
|
||||
public IPage<Model> getModelPage(Map<String, Object> params) {
|
||||
ModelQuery modelQuery = repositoryService.createModelQuery()
|
||||
.latestVersion().orderByLastUpdateTime().desc();
|
||||
String category = (String) params.get("category");
|
||||
@@ -132,7 +132,7 @@ public class ModelServiceImpl implements ModelService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(String id) {
|
||||
public Boolean removeModelById(String id) {
|
||||
repositoryService.deleteModel(id);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
+10
-10
@@ -26,9 +26,9 @@ import com.pig4cloud.pigx.act.entity.LeaveBill;
|
||||
import com.pig4cloud.pigx.act.mapper.LeaveBillMapper;
|
||||
import com.pig4cloud.pigx.act.service.ProcessService;
|
||||
import com.pig4cloud.pigx.common.core.constant.PaginationConstant;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.EnumProcessStatus;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.EnumResourceType;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.EnumTaskStatus;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.ProcessStatusEnum;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.ResourceTypeEnum;
|
||||
import com.pig4cloud.pigx.common.core.constant.enums.TaskStatusEnum;
|
||||
import com.pig4cloud.pigx.common.core.util.TenantUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.activiti.engine.RepositoryService;
|
||||
@@ -96,7 +96,7 @@ public class ProcessServiceImpl implements ProcessService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public InputStream resourceRead(String procDefId, String proInsId, String resType) {
|
||||
public InputStream readResource(String procDefId, String proInsId, String resType) {
|
||||
|
||||
if (StrUtil.isBlank(procDefId)) {
|
||||
ProcessInstance processInstance = runtimeService
|
||||
@@ -111,9 +111,9 @@ public class ProcessServiceImpl implements ProcessService {
|
||||
.singleResult();
|
||||
|
||||
String resourceName = "";
|
||||
if (EnumResourceType.IMAGE.getType().equals(resType)) {
|
||||
if (ResourceTypeEnum.IMAGE.getType().equals(resType)) {
|
||||
resourceName = processDefinition.getDiagramResourceName();
|
||||
} else if (EnumResourceType.XML.getType().equals(resType)) {
|
||||
} else if (ResourceTypeEnum.XML.getType().equals(resType)) {
|
||||
resourceName = processDefinition.getResourceName();
|
||||
}
|
||||
|
||||
@@ -131,9 +131,9 @@ public class ProcessServiceImpl implements ProcessService {
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateStatus(String status, String procDefId) {
|
||||
if (EnumProcessStatus.ACTIVE.getStatus().equals(status)) {
|
||||
if (ProcessStatusEnum.ACTIVE.getStatus().equals(status)) {
|
||||
repositoryService.activateProcessDefinitionById(procDefId, true, null);
|
||||
} else if (EnumProcessStatus.SUSPEND.getStatus().equals(status)) {
|
||||
} else if (ProcessStatusEnum.SUSPEND.getStatus().equals(status)) {
|
||||
repositoryService.suspendProcessDefinitionById(procDefId, true, null);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
@@ -146,7 +146,7 @@ public class ProcessServiceImpl implements ProcessService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteProcIns(String deploymentId) {
|
||||
public Boolean removeProcIns(String deploymentId) {
|
||||
repositoryService.deleteDeployment(deploymentId, true);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ public class ProcessServiceImpl implements ProcessService {
|
||||
@Override
|
||||
public Boolean saveStartProcess(Integer leaveId) {
|
||||
LeaveBill leaveBill = leaveBillMapper.selectById(leaveId);
|
||||
leaveBill.setState(EnumTaskStatus.CHECK.getStatus());
|
||||
leaveBill.setState(TaskStatusEnum.CHECK.getStatus());
|
||||
|
||||
String key = leaveBill.getClass().getSimpleName();
|
||||
String businessKey = key + "_" + leaveBill.getLeaveId();
|
||||
|
||||
+3
-3
@@ -48,15 +48,15 @@ public class SysGeneratorController {
|
||||
* @return 数据库表
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R list(Page page, String tableName) {
|
||||
return new R<>(sysGeneratorService.queryPage(page, tableName));
|
||||
public R getPage(Page page, String tableName) {
|
||||
return new R<>(sysGeneratorService.getPage(page, tableName));
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成代码
|
||||
*/
|
||||
@PostMapping("/code")
|
||||
public void code(@RequestBody GenConfig genConfig, HttpServletResponse response) throws IOException {
|
||||
public void generatorCode(@RequestBody GenConfig genConfig, HttpServletResponse response) throws IOException {
|
||||
byte[] data = sysGeneratorService.generatorCode(genConfig);
|
||||
|
||||
response.reset();
|
||||
|
||||
+1
-1
@@ -42,5 +42,5 @@ public interface SysGeneratorService {
|
||||
* @param tableName 表名
|
||||
* @return
|
||||
*/
|
||||
IPage<List<Map<String, Object>>> queryPage(Page page, String tableName);
|
||||
IPage<List<Map<String, Object>>> getPage(Page page, String tableName);
|
||||
}
|
||||
+1
-1
@@ -51,7 +51,7 @@ public class SysGeneratorServiceImpl implements SysGeneratorService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<List<Map<String, Object>>> queryPage(Page page, String tableName) {
|
||||
public IPage<List<Map<String, Object>>> getPage(Page page, String tableName) {
|
||||
return sysGeneratorMapper.queryList(page,tableName);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ${className}Controller {
|
||||
private final ${className}Service ${classname}Service;
|
||||
|
||||
/**
|
||||
* 简单分页查询
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param ${classname} ${comments}
|
||||
* @return
|
||||
@@ -55,8 +55,8 @@ public class ${className}Controller {
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询单条记录
|
||||
* @param ${pk.lowerAttrName}
|
||||
* 通过id查询${comments}
|
||||
* @param ${pk.lowerAttrName} id
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/{${pk.lowerAttrName}}")
|
||||
@@ -65,8 +65,8 @@ public class ${className}Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增记录
|
||||
* @param ${classname}
|
||||
* 新增${comments}
|
||||
* @param ${classname} ${comments}
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("新增${comments}")
|
||||
@@ -76,19 +76,19 @@ public class ${className}Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改记录
|
||||
* @param ${classname}
|
||||
* 修改${comments}
|
||||
* @param ${classname} ${comments}
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("修改${comments}")
|
||||
@PutMapping
|
||||
public R update(@RequestBody ${className} ${classname}){
|
||||
public R updateById(@RequestBody ${className} ${classname}){
|
||||
return new R<>(${classname}Service.updateById(${classname}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除一条记录
|
||||
* @param ${pk.lowerAttrName}
|
||||
* 通过id删除${comments}
|
||||
* @param ${pk.lowerAttrName} id
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("删除${comments}")
|
||||
|
||||
+3
-3
@@ -52,13 +52,13 @@ public class ExecutionLogController {
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
* 通过id查询一条记录
|
||||
*
|
||||
* @param id
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R info(@PathVariable("id") String id) {
|
||||
public R getById(@PathVariable("id") String id) {
|
||||
return new R<>(executionLogService.getById(id));
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class ExecutionLogController {
|
||||
* @return R
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public R delete(@PathVariable String id) {
|
||||
public R removeById(@PathVariable String id) {
|
||||
return new R<>(executionLogService.removeById(id));
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -56,7 +56,7 @@ public class StatusTraceLogController {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R info(@PathVariable("id") String id) {
|
||||
public R getById(@PathVariable("id") String id) {
|
||||
return new R<>(statusTraceLogService.getById(id));
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class StatusTraceLogController {
|
||||
* @return R
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public R delete(@PathVariable("id") String id) {
|
||||
public R removeById(@PathVariable("id") String id) {
|
||||
return new R<>(statusTraceLogService.removeById(id));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user