"eladmin-common/vscode:/vscode.git/clone" did not exist on "a42e1ca7322a8c674ed48e2e4698173a1c71982f"
Commit d1777411 authored by ZhengJie's avatar ZhengJie
Browse files

[代码完善](v2.5): v2.5 beta 更新部分依赖,优化druid配置,其他杂项优化

Closes #339

2.5 Beta 详情:https://www.ydyno.com/archives/1225.html
parent 3f7c8332
......@@ -39,13 +39,13 @@ public class GenConfigController {
@ApiOperation("查询")
@GetMapping(value = "/{tableName}")
public ResponseEntity<Object> get(@PathVariable String tableName){
public ResponseEntity<Object> query(@PathVariable String tableName){
return new ResponseEntity<>(genConfigService.find(tableName), HttpStatus.OK);
}
@ApiOperation("修改")
@PutMapping
public ResponseEntity<Object> emailConfig(@Validated @RequestBody GenConfig genConfig){
public ResponseEntity<Object> update(@Validated @RequestBody GenConfig genConfig){
return new ResponseEntity<>(genConfigService.update(genConfig.getTableName(), genConfig),HttpStatus.OK);
}
}
......@@ -49,13 +49,13 @@ public class GeneratorController {
@ApiOperation("查询数据库数据")
@GetMapping(value = "/tables/all")
public ResponseEntity<Object> getTables(){
public ResponseEntity<Object> queryTables(){
return new ResponseEntity<>(generatorService.getTables(), HttpStatus.OK);
}
@ApiOperation("查询数据库数据")
@GetMapping(value = "/tables")
public ResponseEntity<Object> getTables(@RequestParam(defaultValue = "") String name,
public ResponseEntity<Object> queryTables(@RequestParam(defaultValue = "") String name,
@RequestParam(defaultValue = "0")Integer page,
@RequestParam(defaultValue = "10")Integer size){
int[] startEnd = PageUtil.transToStartEnd(page+1, size);
......@@ -64,7 +64,7 @@ public class GeneratorController {
@ApiOperation("查询字段数据")
@GetMapping(value = "/columns")
public ResponseEntity<Object> getTables(@RequestParam String tableName){
public ResponseEntity<Object> queryColumns(@RequestParam String tableName){
List<ColumnInfo> columnInfos = generatorService.getColumns(tableName);
return new ResponseEntity<>(PageUtil.toPage(columnInfos,columnInfos.size()), HttpStatus.OK);
}
......
......@@ -34,7 +34,6 @@ import java.util.*;
* @date 2019-01-02
*/
@Slf4j
@SuppressWarnings("all")
public class GenUtil {
private static final String TIMESTAMP = "Timestamp";
......@@ -242,9 +241,9 @@ public class GenUtil {
// 主键类型
String colType = ColUtil.cloToJava(column.getColumnType());
// 小写开头的字段名
String changeColumnName = StringUtils.toCamelCase(column.getColumnName().toString());
String changeColumnName = StringUtils.toCamelCase(column.getColumnName());
// 大写开头的字段名
String capitalColumnName = StringUtils.toCapitalizeCamelCase(column.getColumnName().toString());
String capitalColumnName = StringUtils.toCapitalizeCamelCase(column.getColumnName());
if(PK.equals(column.getKeyType())){
// 存储主键类型
genMap.put("pkColumnType",colType);
......
......@@ -55,21 +55,21 @@ public class LogController {
@ApiOperation("导出错误数据")
@GetMapping(value = "/error/download")
@PreAuthorize("@el.check()")
public void errorDownload(HttpServletResponse response, LogQueryCriteria criteria) throws IOException {
public void downloadErrorLog(HttpServletResponse response, LogQueryCriteria criteria) throws IOException {
criteria.setLogType("ERROR");
logService.download(logService.queryAll(criteria), response);
}
@GetMapping
@ApiOperation("日志查询")
@PreAuthorize("@el.check()")
public ResponseEntity<Object> getLogs(LogQueryCriteria criteria, Pageable pageable){
public ResponseEntity<Object> query(LogQueryCriteria criteria, Pageable pageable){
criteria.setLogType("INFO");
return new ResponseEntity<>(logService.queryAll(criteria,pageable), HttpStatus.OK);
}
@GetMapping(value = "/user")
@ApiOperation("用户日志查询")
public ResponseEntity<Object> getUserLogs(LogQueryCriteria criteria, Pageable pageable){
public ResponseEntity<Object> queryUserLog(LogQueryCriteria criteria, Pageable pageable){
criteria.setLogType("INFO");
criteria.setBlurry(SecurityUtils.getCurrentUsername());
return new ResponseEntity<>(logService.queryAllByUser(criteria,pageable), HttpStatus.OK);
......@@ -78,7 +78,7 @@ public class LogController {
@GetMapping(value = "/error")
@ApiOperation("错误日志查询")
@PreAuthorize("@el.check()")
public ResponseEntity<Object> getErrorLogs(LogQueryCriteria criteria, Pageable pageable){
public ResponseEntity<Object> queryErrorLog(LogQueryCriteria criteria, Pageable pageable){
criteria.setLogType("ERROR");
return new ResponseEntity<>(logService.queryAll(criteria,pageable), HttpStatus.OK);
}
......@@ -86,14 +86,14 @@ public class LogController {
@GetMapping(value = "/error/{id}")
@ApiOperation("日志异常详情查询")
@PreAuthorize("@el.check()")
public ResponseEntity<Object> getErrorLogs(@PathVariable Long id){
public ResponseEntity<Object> queryErrorLogs(@PathVariable Long id){
return new ResponseEntity<>(logService.findByErrDetail(id), HttpStatus.OK);
}
@DeleteMapping(value = "/del/error")
@Log("删除所有ERROR日志")
@ApiOperation("删除所有ERROR日志")
@PreAuthorize("@el.check()")
public ResponseEntity<Object> delAllByError(){
public ResponseEntity<Object> delAllErrorLog(){
logService.delAllByError();
return new ResponseEntity<>(HttpStatus.OK);
}
......@@ -102,7 +102,7 @@ public class LogController {
@Log("删除所有INFO日志")
@ApiOperation("删除所有INFO日志")
@PreAuthorize("@el.check()")
public ResponseEntity<Object> delAllByInfo(){
public ResponseEntity<Object> delAllInfoLog(){
logService.delAllByInfo();
return new ResponseEntity<>(HttpStatus.OK);
}
......
......@@ -19,7 +19,7 @@
</properties>
<dependencies>
<!-- 代码生成模块 -->
<!-- 代码生成模块 -->
<dependency>
<groupId>me.zhengjie</groupId>
<artifactId>eladmin-generator</artifactId>
......@@ -32,19 +32,20 @@
</exclusions>
</dependency>
<!-- tools 模块包含了 common 和 logging 模块 -->
<!-- tools 模块包含了 common 和 logging 模块 -->
<dependency>
<groupId>me.zhengjie</groupId>
<artifactId>eladmin-tools</artifactId>
<version>2.4</version>
</dependency>
<!-- Spring boot websocket -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!--jwt-->
<!-- jwt -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
......@@ -67,18 +68,19 @@
<artifactId>quartz</artifactId>
</dependency>
<!-- linux的管理 -->
<dependency>
<groupId>ch.ethz.ganymed</groupId>
<artifactId>ganymed-ssh2</artifactId>
<version>build210</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.55</version>
</dependency>
<!-- 获取系统信息 -->
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
......
......@@ -56,7 +56,7 @@ public class AppController {
@ApiOperation(value = "查询应用")
@GetMapping
@PreAuthorize("@el.check('app:list')")
public ResponseEntity<Object> getApps(AppQueryCriteria criteria, Pageable pageable){
public ResponseEntity<Object> query(AppQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(appService.queryAll(criteria,pageable),HttpStatus.OK);
}
......
......@@ -64,7 +64,7 @@ public class DatabaseController {
@ApiOperation(value = "查询数据库")
@GetMapping
@PreAuthorize("@el.check('database:list')")
public ResponseEntity<Object> getDatabases(DatabaseQueryCriteria criteria, Pageable pageable){
public ResponseEntity<Object> query(DatabaseQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(databaseService.queryAll(criteria,pageable),HttpStatus.OK);
}
......
......@@ -66,7 +66,7 @@ public class DeployController {
@ApiOperation(value = "查询部署")
@GetMapping
@PreAuthorize("@el.check('deploy:list')")
public ResponseEntity<Object> getDeploys(DeployQueryCriteria criteria, Pageable pageable){
public ResponseEntity<Object> query(DeployQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(deployService.queryAll(criteria,pageable),HttpStatus.OK);
}
......
......@@ -54,7 +54,7 @@ public class DeployHistoryController {
@ApiOperation(value = "查询部署历史")
@GetMapping
@PreAuthorize("@el.check('deployHistory:list')")
public ResponseEntity<Object> getDeployHistorys(DeployHistoryQueryCriteria criteria, Pageable pageable){
public ResponseEntity<Object> query(DeployHistoryQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(deployhistoryService.queryAll(criteria,pageable),HttpStatus.OK);
}
......
......@@ -56,7 +56,7 @@ public class ServerDeployController {
@ApiOperation(value = "查询服务器")
@GetMapping
@PreAuthorize("@el.check('serverDeploy:list')")
public ResponseEntity<Object> getServers(ServerDeployQueryCriteria criteria, Pageable pageable){
public ResponseEntity<Object> query(ServerDeployQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(serverDeployService.queryAll(criteria,pageable),HttpStatus.OK);
}
......
......@@ -52,7 +52,7 @@ public class QuartzJobController {
@ApiOperation("查询定时任务")
@GetMapping
@PreAuthorize("@el.check('timing:list')")
public ResponseEntity<Object> getJobs(JobQueryCriteria criteria, Pageable pageable){
public ResponseEntity<Object> query(JobQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(quartzJobService.queryAll(criteria,pageable), HttpStatus.OK);
}
......@@ -75,7 +75,7 @@ public class QuartzJobController {
@ApiOperation("查询任务执行日志")
@GetMapping(value = "/logs")
@PreAuthorize("@el.check('timing:list')")
public ResponseEntity<Object> getJobLogs(JobQueryCriteria criteria, Pageable pageable){
public ResponseEntity<Object> queryJobLog(JobQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(quartzJobService.queryAllLog(criteria,pageable), HttpStatus.OK);
}
......@@ -103,7 +103,7 @@ public class QuartzJobController {
@ApiOperation("更改定时任务状态")
@PutMapping(value = "/{id}")
@PreAuthorize("@el.check('timing:edit')")
public ResponseEntity<Object> updateIsPause(@PathVariable Long id){
public ResponseEntity<Object> update(@PathVariable Long id){
quartzJobService.updateIsPause(quartzJobService.findById(id));
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
......
......@@ -45,7 +45,7 @@ public class OnlineController {
@ApiOperation("查询在线用户")
@GetMapping
@PreAuthorize("@el.check()")
public ResponseEntity<Object> getAll(String filter, Pageable pageable){
public ResponseEntity<Object> query(String filter, Pageable pageable){
return new ResponseEntity<>(onlineUserService.getAll(filter, pageable),HttpStatus.OK);
}
......
......@@ -60,7 +60,7 @@ public class DeptController {
@ApiOperation("查询部门")
@GetMapping
@PreAuthorize("@el.check('user:list','dept:list')")
public ResponseEntity<Object> getDepts(DeptQueryCriteria criteria) throws Exception {
public ResponseEntity<Object> query(DeptQueryCriteria criteria) throws Exception {
List<DeptDto> deptDtos = deptService.queryAll(criteria, true);
return new ResponseEntity<>(PageUtil.toPage(deptDtos, deptDtos.size()),HttpStatus.OK);
}
......
......@@ -58,7 +58,7 @@ public class DictController {
@ApiOperation("查询字典")
@GetMapping(value = "/all")
@PreAuthorize("@el.check('dict:list')")
public ResponseEntity<Object> all(){
public ResponseEntity<Object> queryAll(){
return new ResponseEntity<>(dictService.queryAll(new DictQueryCriteria()),HttpStatus.OK);
}
......@@ -66,7 +66,7 @@ public class DictController {
@ApiOperation("查询字典")
@GetMapping
@PreAuthorize("@el.check('dict:list')")
public ResponseEntity<Object> getByQuery(DictQueryCriteria resources, Pageable pageable){
public ResponseEntity<Object> query(DictQueryCriteria resources, Pageable pageable){
return new ResponseEntity<>(dictService.queryAll(resources,pageable),HttpStatus.OK);
}
......
......@@ -50,7 +50,7 @@ public class DictDetailController {
@Log("查询字典详情")
@ApiOperation("查询字典详情")
@GetMapping
public ResponseEntity<Object> getDictDetails(DictDetailQueryCriteria criteria,
public ResponseEntity<Object> query(DictDetailQueryCriteria criteria,
@PageableDefault(sort = {"dictSort"}, direction = Sort.Direction.ASC) Pageable pageable){
return new ResponseEntity<>(dictDetailService.queryAll(criteria,pageable),HttpStatus.OK);
}
......
......@@ -59,7 +59,7 @@ public class JobController {
@ApiOperation("查询岗位")
@GetMapping
@PreAuthorize("@el.check('job:list','user:list')")
public ResponseEntity<Object> getJobs(JobQueryCriteria criteria, Pageable pageable){
public ResponseEntity<Object> query(JobQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(jobService.queryAll(criteria, pageable),HttpStatus.OK);
}
......
......@@ -42,7 +42,7 @@ public class LimitController {
@AnonymousAccess
@ApiOperation("测试")
@Limit(key = "test", period = 60, count = 10, name = "testLimit", prefix = "limit")
public int testLimit() {
public int test() {
return ATOMIC_INTEGER.incrementAndGet();
}
}
......@@ -69,7 +69,7 @@ public class MenuController {
@ApiOperation("返回全部的菜单")
@GetMapping(value = "/lazy")
@PreAuthorize("@el.check('menu:list','roles:list')")
public ResponseEntity<Object> getMenus(@RequestParam Long pid){
public ResponseEntity<Object> query(@RequestParam Long pid){
return new ResponseEntity<>(menuService.getMenus(pid),HttpStatus.OK);
}
......@@ -77,7 +77,7 @@ public class MenuController {
@ApiOperation("查询菜单")
@GetMapping
@PreAuthorize("@el.check('menu:list')")
public ResponseEntity<Object> getMenus(MenuQueryCriteria criteria) throws Exception {
public ResponseEntity<Object> query(MenuQueryCriteria criteria) throws Exception {
List<MenuDto> menuDtoList = menuService.queryAll(criteria, true);
return new ResponseEntity<>(PageUtil.toPage(menuDtoList, menuDtoList.size()),HttpStatus.OK);
}
......
......@@ -39,7 +39,7 @@ public class MonitorController {
@GetMapping
@ApiOperation("查询服务监控")
@PreAuthorize("@el.check('monitor:list')")
public ResponseEntity<Object> getServers(){
public ResponseEntity<Object> query(){
return new ResponseEntity<>(serverService.getServers(),HttpStatus.OK);
}
}
......@@ -60,7 +60,7 @@ public class RoleController {
@ApiOperation("获取单个role")
@GetMapping(value = "/{id}")
@PreAuthorize("@el.check('roles:list')")
public ResponseEntity<Object> getRoles(@PathVariable Long id){
public ResponseEntity<Object> query(@PathVariable Long id){
return new ResponseEntity<>(roleService.findById(id), HttpStatus.OK);
}
......@@ -75,7 +75,7 @@ public class RoleController {
@ApiOperation("返回全部的角色")
@GetMapping(value = "/all")
@PreAuthorize("@el.check('roles:list','user:add','user:edit')")
public ResponseEntity<Object> getAll(@PageableDefault(value = 2000, sort = {"level"}, direction = Sort.Direction.ASC) Pageable pageable){
public ResponseEntity<Object> query(@PageableDefault(value = 2000, sort = {"level"}, direction = Sort.Direction.ASC) Pageable pageable){
return new ResponseEntity<>(roleService.queryAll(pageable),HttpStatus.OK);
}
......@@ -83,7 +83,7 @@ public class RoleController {
@ApiOperation("查询角色")
@GetMapping
@PreAuthorize("@el.check('roles:list')")
public ResponseEntity<Object> getRoles(RoleQueryCriteria criteria, Pageable pageable){
public ResponseEntity<Object> query(RoleQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(roleService.queryAll(criteria,pageable),HttpStatus.OK);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment