refactor: 删除非必要注释

This commit is contained in:
fit2cloud-chenyw 2021-11-15 16:51:45 +08:00
parent aa69d3ebdc
commit 772de9e6dd
27 changed files with 28 additions and 397 deletions

View File

@ -30,8 +30,7 @@ public interface AuthApi {
CurrentUserDto userInfo();
/*@GetMapping("/isLogin")
Boolean isLogin();*/
@ApiOperation("登出")

View File

@ -2,12 +2,10 @@ package io.dataease.auth.service.impl;
import io.dataease.auth.service.ExtAuthService;
import io.dataease.base.domain.SysAuth;
import io.dataease.base.mapper.SysAuthMapper;
import io.dataease.base.mapper.ext.ExtAuthMapper;
import io.dataease.commons.model.AuthURD;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.HashSet;
import java.util.List;
@ -21,8 +19,7 @@ public class ExtAuthServiceImpl implements ExtAuthService {
@Resource
private ExtAuthMapper extAuthMapper;
@Resource
private SysAuthMapper sysAuthMapper;
@Override
public Set<Long> userIdsByRD(AuthURD request) {
@ -42,9 +39,7 @@ public class ExtAuthServiceImpl implements ExtAuthService {
@Override
public AuthURD resourceTarget(String resourceId) {
AuthURD authURD = new AuthURD();
/*SysAuthExample example = new SysAuthExample();
example.createCriteria().andAuthSourceEqualTo(resourceId);
List<SysAuth> sysAuths = sysAuthMapper.selectByExample(example);*/
List<SysAuth> sysAuths = extAuthMapper.queryByResource(resourceId);
Map<String, List<SysAuth>> authMap = sysAuths.stream().collect(Collectors.groupingBy(SysAuth::getAuthTargetType));

View File

@ -14,15 +14,10 @@ public class LicStatusCondition implements Condition {
@Override
public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
// BeanDefinitionRegistry registry = conditionContext.getRegistry();
// DefaultLicenseService defaultLicenseService = conditionContext.getBeanFactory().getBean(DefaultLicenseService.class);
DefaultLicenseService defaultLicenseService = CommonBeanFactory.getBean(DefaultLicenseService.class);
/*if (null == defaultLicenseService) {
registry.registerBeanDefinition();
}*/
if (ObjectUtils.isNotEmpty(defaultLicenseService)) {
F2CLicenseResponse f2CLicenseResponse = defaultLicenseService.validateLicense();
return F2CLicenseResponse.Status.valid == f2CLicenseResponse.getStatus();

View File

@ -23,7 +23,6 @@ public class DefaultLicenseService {
private static final String LICENSE_ID = "fit2cloud_license";
private static final String validatorUtil = "/usr/bin/validator";
private static final String product = "DataEase";
/*private static final String[] NO_PLU_LIMIT_MODULES = new String[]{"dashboard", "gateway"};*/
public F2CLicenseResponse validateLicense(String product, String licenseKey){
List<String> command = new ArrayList<String>();

View File

@ -153,16 +153,7 @@ public class CodingUtil {
}
}
/*public static String getSignature(String accessKey, String secretKey) throws Exception {
return aesEncrypt(accessKey + "|" + UUID.randomUUID().toString() + "|" + System.currentTimeMillis(), secretKey, accessKey);
}
public static void main(String[] args) throws Exception{
String accessKey = "gnPFmtAsdLhUEWPA";
String secretKey = "TfK5FGUle0KRfJJJ";
String signature = getSignature(accessKey, secretKey);
System.out.println(signature);
}*/
public static String secretKey() {
try {

View File

@ -95,23 +95,6 @@ public class DateUtils {
}
/* public static void main(String[] args) throws Exception {
// System.out.println("start:");
Date paramTime = getTime(getTimeString(new Long("1607672440731")));
Map<String, Date> weekDate = getWeedFirstTimeAndLastTime(paramTime);
for (Map.Entry<String, Date> entry :
weekDate.entrySet()) {
// System.out.println(entry.getKey() + ":" + getTimeString(entry.getValue())+":"+entry.getValue().getTime());
}
long countTimeLong = new Long("1607672440731");
// System.out.println(getTimeString(--countTimeLong));
} */
/**
* 获取当天的起始时间Date

View File

@ -1,51 +0,0 @@
/*
package io.dataease.controller.handler;
import io.dataease.commons.exception.DEException;
import io.dataease.controller.ResultHolder;
import org.apache.shiro.ShiroException;
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.SQLException;
@RestControllerAdvice
public class RestControllerExceptionHandler {
*/
/*=========== Shiro 异常拦截==============*//*
@ExceptionHandler(ShiroException.class)
public ResultHolder exceptionHandler(HttpServletRequest request, HttpServletResponse response, Exception exception) {
response.setStatus(HttpStatus.UNAUTHORIZED.value());
return ResultHolder.error(exception.getMessage());
}
*/
/*=========== Shiro 异常拦截==============*//*
@ExceptionHandler(UnauthorizedException.class)
public ResultHolder unauthorizedExceptionHandler(HttpServletRequest request, HttpServletResponse response, Exception exception) {
response.setStatus(HttpStatus.FORBIDDEN.value());
return ResultHolder.error(exception.getMessage());
}
@ExceptionHandler(SQLException.class)
public ResultHolder sqlExceptionHandler(HttpServletRequest request, HttpServletResponse response, DEException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
return ResultHolder.error("SQL error happened, please check logs.");
}
@ExceptionHandler(DEException.class)
public ResultHolder msExceptionHandler(HttpServletRequest request, HttpServletResponse response, DEException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
return ResultHolder.error(e.getMessage());
}
}
*/

View File

@ -4,7 +4,6 @@ import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.dataease.base.domain.PanelShare;
import io.dataease.controller.request.panel.PanelShareFineDto;
import io.dataease.controller.request.panel.PanelShareRemoveRequest;
import io.dataease.controller.request.panel.PanelShareRequest;
import io.dataease.controller.sys.base.BaseGridRequest;
import io.dataease.dto.panel.PanelShareDto;
import io.dataease.dto.panel.PanelShareOutDTO;
@ -15,7 +14,6 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@ -27,9 +25,7 @@ import java.util.List;
@RequestMapping("/api/share")
public interface ShareApi {
/*@ApiIgnore
@PostMapping("/")
void share(PanelShareRequest request);*/
@ApiOperation("查询分享给我")
@PostMapping("/treeList")

View File

@ -96,11 +96,7 @@ public class LinkServer implements LinkApi {
return chartViewService.getData(viewId, requestList);
}
/*@Override
public ResultHolder shortUrl(Map<String,String> param) {
String url = param.get("url");
return panelLinkService.getShortUrl(url);
}*/
@Override
public String shortUrl(Map<String,String> param) {

View File

@ -22,10 +22,7 @@ public class ShareServer implements ShareApi {
@Resource
private ShareService shareService;
/*@Override
public void share(@RequestBody PanelShareRequest request) {
shareService.save(request);
}*/
@Override
public List<PanelShareDto> treeList(@RequestBody BaseGridRequest request) {

View File

@ -36,7 +36,6 @@ public class ViewServer implements ViewApi {
if(CollectionUtils.isNotEmpty(groups)&&CollectionUtils.isNotEmpty(views)){
groups.addAll(views);
}
// List<PanelViewDto> panelViewDtos = panelViewService.buildTree(groups, views);
return TreeUtils.mergeTree(groups);
}

View File

@ -56,34 +56,7 @@ public class SysDeptController extends ResultHolder {
return nodeResponses;
}
/*@ApiOperation("查询部门")
@PostMapping("/root")
public ResultHolder rootData(){
List<SysDept> root = deptService.nodesByPid(null);
return success(root);
}*/
/*@ApiOperation("新增部门")
@PostMapping("/create")
public void create(@RequestBody DeptCreateRequest dept){
deptService.add(dept);
}
@ApiOperation("删除部门")
@PostMapping("/delete")
public void delete(@RequestBody List<DeptDeleteRequest> requests){
deptService.batchDelete(requests);
}
@ApiOperation("更新部门")
@PostMapping("/update")
public void update(@RequestBody DeptCreateRequest dept){
deptService.update(dept);
}
@ApiOperation("更新状态")
@PostMapping("/updateStatus")
public void updateStatus(@RequestBody DeptStatusRequest request){
deptService.updateStatus(request);
}*/
@PostMapping("/nodesByDeptId/{deptId}")
public List<DeptTreeNode> nodesByDeptId(@PathVariable("deptId") Long deptId){

View File

@ -1,78 +0,0 @@
package io.dataease.controller.sys;
/*import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.dataease.base.domain.SysRole;
import io.dataease.commons.utils.PageUtils;
import io.dataease.commons.utils.Pager;
import io.dataease.controller.sys.base.BaseGridRequest;
import io.dataease.controller.sys.request.RoleMenusRequest;*/
import io.dataease.controller.sys.response.RoleUserItem;
import io.dataease.service.sys.SysRoleService;
import io.swagger.annotations.Api;
/*import io.swagger.annotations.ApiOperation;*/
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import java.util.List;
/*@ApiIgnore
@RestController
@RequiredArgsConstructor
@Api(tags = "系统:角色管理")
@RequestMapping("/api/role")
public class SysRoleController {*/
/*
@Resource
private SysRoleService sysRoleService;
@ApiOperation("新增角色")
@PostMapping("/create")
public void create(@RequestBody SysRole role){
sysRoleService.add(role);
}
@ApiOperation("删除角色")
@PostMapping("/delete/{roleId}")
public void delete(@PathVariable("roleId") Long roleId){
sysRoleService.delete(roleId);
}
@ApiOperation("更新角色")
@PostMapping("/update")
public void update(@RequestBody SysRole role){
sysRoleService.update(role);
}
@ApiOperation("查询角色")
@PostMapping("/roleGrid/{goPage}/{pageSize}")
public Pager<List<SysRole>> roleGrid(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody BaseGridRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
Pager<List<SysRole>> listPager = PageUtils.setPageInfo(page, sysRoleService.query(request));
return listPager;
}
@ApiOperation("查询角色对应的菜单ID")
@PostMapping("/menuIds/{roleId}")
public List<Long> menuIdsByRoleId(@PathVariable("roleId") Long roleId){
return sysRoleService.menuIds(roleId);
}
@PostMapping("/saveRolesMenus")
public void saveRolesMenus(@RequestBody RoleMenusRequest request){
sysRoleService.batchSaveRolesMenus(request);
}
@PostMapping("/all")
public List<RoleUserItem> all(){
return sysRoleService.allRoles();
}
*/
/*}*/

View File

@ -54,10 +54,7 @@ public class SysUserController {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, sysUserService.query(request));
}
/*public Pager<List<SysUserGridResponse>> userGrid(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody UserGridRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, sysUserService.query(request));
}*/
@ApiOperation("创建用户")
@PostMapping("/create")
@ -146,11 +143,7 @@ public class SysUserController {
}
/* @ApiOperation("同步用户")
@PostMapping("/sync")
public void importLdap(@RequestBody LdapAddRequest request) {
sysUserService.saveLdapUsers(request);
} */
@ApiOperation("已同步用户")
@PostMapping("/existLdapUsers")

View File

@ -38,11 +38,7 @@ public class MapUtils {
return code;
}
/*public static List<Map<String, Object>> readCodeList( ) {
ExcelReader reader = ExcelUtil.getReader(path);
List<Map<String, Object>> maps = reader.readAll();
return maps;
}*/
public static List<Map<String, Object>> readCodeList( ) {
AreaMappingExample example = new AreaMappingExample();
List<AreaMapping> areaMappings = areaMappingMapper.selectByExample(example);
@ -234,15 +230,7 @@ public class MapUtils {
/*public static MapResultDto buildGeometry(District district, AreaEntity areaEntity) {
Feature feature = buildFeature(district, areaEntity);
MapResultDto mapResultDto = new MapResultDto();
mapResultDto.setType("FeatureCollection");
List<Feature> features = new ArrayList<>();
features.add(feature);
mapResultDto.setFeatures(features);
return mapResultDto;
}*/
public static MapResultDto buildGeometry(List<Feature> features) {
MapResultDto mapResultDto = new MapResultDto();

View File

@ -47,15 +47,5 @@ public class XUserKeysServer {
ukeyXpackService.switchStatus(id);
}
/*@GetMapping("active/{id}")
public void activeUserKey(@PathVariable Long id) {
UkeyXpackService ukeyXpackService = SpringContextUtil.getBean(UkeyXpackService.class);
ukeyXpackService.activeUserKey(id);
}
@GetMapping("disable/{id}")
public void disabledUserKey(@PathVariable Long id) {
UkeyXpackService ukeyXpackService = SpringContextUtil.getBean(UkeyXpackService.class);
ukeyXpackService.disableUserKey(id);
}*/
}

View File

@ -209,17 +209,7 @@ public class EsProvider extends DatasourceProvider {
return new ArrayList<>();
}
// @Override
// public List<TableFiled> getTableFileds(DatasourceRequest datasourceRequest) throws Exception {
// List<TableFiled> tableFileds = new ArrayList<>();
// try {
// String response = exexQuery(datasourceRequest, "desc " + datasourceRequest.getTable(), "?format=json");
// tableFileds = fetchResultField(response);
// } catch (Exception e) {
// DataEaseException.throwException(e);
// }
// return tableFileds;
// }
@Override
public void checkStatus(DatasourceRequest datasourceRequest) throws Exception {

View File

@ -43,9 +43,7 @@ public class FileService {
example2.createCriteria().andFileIdIn(ids);
fileContentMapper.deleteByExample(example2);
/* LoadTestFileExample example3 = new LoadTestFileExample();
example3.createCriteria().andFileIdIn(ids);
loadTestFileMapper.deleteByExample(example3);*/
}
public void deleteFileRelatedByIds(List<String> ids) {

View File

@ -77,10 +77,7 @@ public class PanelLinkService {
}
public void overTime(OverTimeRequest request) {
/* PanelLink po = new PanelLink();
po.setResourceId(request.getResourceId());
po.setOverTime(request.getOverTime());
mapper.updateByPrimaryKeySelective(po); */
extPanelLinkMapper.updateOverTime(request);
}
@ -132,19 +129,9 @@ public class PanelLinkService {
}
private String buildLinkParam(String resourceId){
/* Map<String,Object> map = new HashMap<>();
map.put("resourceId", resourceId);
map.put("time", System.currentTimeMillis());
map.put("salt", salt);
Gson gson = new Gson();
String encrypt = encrypt(gson.toJson(map)); */
String encrypt = encrypt(resourceId);
/* String s = null;
try {
s = RsaUtil.decryptByPrivateKey(RsaProperties.privateKey, encrypt);
} catch (Exception e) {
e.printStackTrace();
} */
return encrypt;
}
private GenerateDto convertDto(PanelLink linl){
@ -186,11 +173,9 @@ public class PanelLinkService {
public boolean validatePwd(PasswordRequest request) throws Exception {
String password = request.getPassword();
/* String password = decryptParam(request.getPassword()); */
String resourceId = request.getResourceId();
PanelLink one = findOne(resourceId);
String pwd = one.getPwd();
/* String pwd = decryptParam(one.getPwd()); */
boolean pass = StringUtils.equals(pwd, password);
if (pass){
String token = JWTUtils.signLink(resourceId, password);

View File

@ -312,20 +312,7 @@ public class ShareService {
List<PanelSharePo> datas = extPanelShareMapper.query(param);
/*List<Long> targetIds = new ArrayList<>();
targetIds.add(userId);
targetIds.add(deptId);
targetIds.addAll(roleIds);
ConditionEntity condition = new ConditionEntity();
condition.setField("s.target_id");
condition.setOperator("in");
condition.setValue(targetIds);
request.setConditions(new ArrayList<ConditionEntity>(){{add(condition);}});
GridExample example = request.convertExample();
List<PanelSharePo> datas = extPanelShareMapper.query(example);*/
List<PanelShareDto> dtoLists = datas.stream().map(po -> BeanUtils.copyBean(new PanelShareDto(), po)).collect(Collectors.toList());
return convertTree(dtoLists);
}

View File

@ -40,9 +40,7 @@ public class StoreService {
panelStoreMapper.deleteByExample(panelStoreExample);
}
/*public void remove(Long storeId) {
panelStoreMapper.deleteByPrimaryKey(storeId);
}*/
/**
* 按照当前用户ID查询收藏仪表板

View File

@ -105,9 +105,6 @@ public class PluginService {
DeFileUtils.deleteFile(folder);
}
//mybatisLoader.loadMybatis(myPlugin);
//5.写表到my_plugin
// myPlugin.setPluginId(0L);
return null;
}
@ -118,15 +115,7 @@ public class PluginService {
/*private String makeTargetDir(MyPlugin myPlugin) {
String name = myPlugin.getName();
String dir = pluginDir + name + "/" + myPlugin.getVersion() + "/";
File fileDir = new File(dir);
if (!fileDir.exists()) {
fileDir.mkdirs();
}
return dir;
}*/
private String makeTargetDir(MyPlugin myPlugin) {
String store = myPlugin.getStore();
String dir = pluginDir + store + "/";

View File

@ -1,86 +1,32 @@
package io.dataease.service.sys;
/*import io.dataease.base.domain.SysRole;
import io.dataease.base.domain.SysUsersRolesExample;
import io.dataease.base.mapper.SysRoleMapper;
import io.dataease.base.mapper.SysUsersRolesMapper;*/
import io.dataease.base.domain.SysRole;
import io.dataease.base.mapper.ext.ExtSysRoleMapper;
/*import io.dataease.controller.sys.base.BaseGridRequest;
import io.dataease.controller.sys.request.RoleMenusRequest;*/
import io.dataease.controller.sys.base.BaseGridRequest;
import io.dataease.controller.sys.response.RoleUserItem;
import org.springframework.stereotype.Service;
/*import org.springframework.transaction.annotation.Transactional;*/
import javax.annotation.Resource;
/*import java.util.HashMap;*/
import java.util.List;
/*import java.util.Map;
import java.util.stream.Collectors;*/
@Service
public class SysRoleService {
/*@Resource
private SysRoleMapper mapper;*/
@Resource
private ExtSysRoleMapper extSysRoleMapper;
/*@Resource
private SysUsersRolesMapper sysUsersRolesMapper;*/
/*public int add(SysRole role){
Long now = System.currentTimeMillis();
role.setCreateTime(now);
role.setUpdateTime(now);
return mapper.insert(role);
}
public int update(SysRole role){
Long now = System.currentTimeMillis();
role.setUpdateTime(now);
return mapper.updateByPrimaryKey(role);
}
@Transactional
public int delete(Long roleId){
SysUsersRolesExample example = new SysUsersRolesExample();
example.createCriteria().andRoleIdEqualTo(roleId);
sysUsersRolesMapper.deleteByExample(example);//删除用户角色关联关系
extSysRoleMapper.deleteRoleMenu(roleId);//删除菜单角色关联关系
return mapper.deleteByPrimaryKey(roleId);
}
*/
public List<SysRole> query(BaseGridRequest request){
List<SysRole> result = extSysRoleMapper.query(request.convertExample());
return result;
}
/*
public List<Long> menuIds(Long roleId){
return extSysRoleMapper.menuIds(roleId);
}
@Transactional
public int batchSaveRolesMenus(RoleMenusRequest request){
extSysRoleMapper.deleteRoleMenu(request.getRoleId());
List<Map<String, Long>> maps = request.getMenuIds().stream().map(menuId -> {
Map<String, Long> map = new HashMap<>();
map.put("roleId", request.getRoleId());
map.put("menuId", menuId);
return map;
}).collect(Collectors.toList());
return extSysRoleMapper.batchInsertRoleMenu(maps);
}*/
public List<RoleUserItem> allRoles(){
return extSysRoleMapper.queryAll();

View File

@ -41,7 +41,6 @@ import java.util.stream.Collectors;
@Service
public class SysUserService {
//private final static String DEFAULT_PWD = "DataEase123..";
@Value("${dataease.init_password:DataEase123..}")
private String DEFAULT_PWD;
@ -57,25 +56,11 @@ public class SysUserService {
public List<SysUserGridResponse> query(BaseGridRequest request) {
/* List<SysUser> sysUsers = sysUserMapper.selectByExample(new SysUserExample());
List<SysUserGridResponse> lists = sysUsers.stream().map(ele -> {
SysUserGridResponse response = new SysUserGridResponse();
BeanUtils.copyBean(response, ele);
return response;
}).collect(Collectors.toList());*/
GridExample gridExample = request.convertExample();
List<SysUserGridResponse> lists = extSysUserMapper.query(gridExample);
lists.forEach(item -> {
/*for (SysUserGridResponse response : query) {
if (item.getUserId().equals(response.getUserId())) {
item.setId(response.getId());
List<SysUserRole> roles = response.getRoles();
item.setRoles(roles);
List<Long> roleIds = roles.stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
item.setRoleIds(roleIds);
item.setDept(response.getDept());
}
}*/
List<SysUserRole> roles = item.getRoles();
List<Long> roleIds = roles.stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
item.setRoleIds(roleIds);

View File

@ -200,9 +200,5 @@ public class SystemParameterService {
}
/* public static void main(String[] args) {
String info="[{\"paramKey\":\"base.url\",\"paramValue\":null,\"type\":\"text\",\"sort\":1,\"file\":null,\"fileName\":null},{\"paramKey\":\"base.title\",\"paramValue\":\"DataEase Title\",\"type\":\"text\",\"sort\":3,\"file\":null,\"fileName\":null},{\"paramKey\":\"base.logo\",\"paramValue\":\"DataEase\",\"type\":\"text\",\"sort\":4,\"file\":null,\"fileName\":\"favicon.icon.png\"}]";
List<SystemParameterDTO> temp = JSON.parseArray(info,SystemParameterDTO.class);
// System.out.println("===>");
} */
}

View File

@ -8,9 +8,7 @@ import javax.websocket.server.ServerEndpointConfig;
public class ServerEndpointConfigurator extends ServerEndpointConfig.Configurator {
@Override
public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
// 将用户信息存储到socket的配置里
// System.out.println(SessionUtils.getUser());
// sec.getUserProperties().put("user", SessionUtils.getUser());
super.modifyHandshake(sec, request, response);
}
}

View File

@ -11,27 +11,21 @@ import java.io.IOException;
public class WebSocketServer {
@OnOpen
public void onOpen(Session session) throws IOException {
// Get session and WebSocket connection
// System.out.println("open: " + session.isOpen());
// System.out.println("open: " + SessionUtils.getUser());
// System.out.println("open: " + session.getUserProperties().get("user"));
}
@OnMessage
public void onMessage(Session session, String message) throws IOException {
// Handle new messages
// System.out.println(message);
}
@OnClose
public void onClose(Session session) throws IOException {
// WebSocket connection closes
// System.out.println("close: " + session.isOpen());
}
@OnError
public void onError(Session session, Throwable throwable) {
// Do error handling here
throwable.printStackTrace();
}
}