分页接口改造
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.noear</groupId>
|
||||||
|
<artifactId>solon-parent</artifactId>
|
||||||
|
<version>2.2.1</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<groupId>fun.asgc</groupId>
|
||||||
|
<artifactId>orika-solon-plugin</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.noear</groupId>
|
||||||
|
<artifactId>solon</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--orika-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>ma.glasnost.orika</groupId>
|
||||||
|
<artifactId>orika-core</artifactId>
|
||||||
|
<version>1.5.4</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
package fun.asgc.solon.extend.orika;
|
||||||
|
|
||||||
|
import ma.glasnost.orika.MapperFacade;
|
||||||
|
import ma.glasnost.orika.MapperFactory;
|
||||||
|
import org.noear.solon.annotation.Bean;
|
||||||
|
import org.noear.solon.annotation.Configuration;
|
||||||
|
import org.noear.solon.annotation.Inject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: aoshiguchen
|
||||||
|
* @date: 2023/3/11
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class OrikaConfiguration {
|
||||||
|
@Bean
|
||||||
|
public MapperFacade mapperFacade(@Inject MapperFactory factory) {
|
||||||
|
return factory.getMapperFacade();
|
||||||
|
}
|
||||||
|
}
|
||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
package fun.asgc.solon.extend.orika;
|
||||||
|
|
||||||
|
import ma.glasnost.orika.CustomConverter;
|
||||||
|
import ma.glasnost.orika.Mapper;
|
||||||
|
import ma.glasnost.orika.MapperFactory;
|
||||||
|
import ma.glasnost.orika.impl.DefaultMapperFactory;
|
||||||
|
import ma.glasnost.orika.metadata.ClassMapBuilder;
|
||||||
|
import org.noear.solon.core.AopContext;
|
||||||
|
import org.noear.solon.core.Plugin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: aoshiguchen
|
||||||
|
* @date: 2023/3/11
|
||||||
|
*/
|
||||||
|
public class XPluginImp implements Plugin {
|
||||||
|
@Override
|
||||||
|
public void start(AopContext context) throws Throwable {
|
||||||
|
DefaultMapperFactory factory = new DefaultMapperFactory.Builder().build();
|
||||||
|
|
||||||
|
context.subWrapsOfType(CustomConverter.class, bw -> {
|
||||||
|
factory.getConverterFactory().registerConverter(bw.raw());
|
||||||
|
});
|
||||||
|
context.subWrapsOfType(Mapper.class, bw -> {
|
||||||
|
factory.registerMapper(bw.raw());
|
||||||
|
});
|
||||||
|
context.subWrapsOfType(ClassMapBuilder.class, bw -> {
|
||||||
|
factory.registerClassMap((ClassMapBuilder<? extends Object, ? extends Object>) bw.raw());
|
||||||
|
});
|
||||||
|
context.wrapAndPut(MapperFactory.class, factory);
|
||||||
|
context.beanScan("fun.asgc.solon.extend.orika");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
solon.plugin=fun.asgc.solon.extend.orika.XPluginImp
|
||||||
|
solon.plugin.priority=1
|
||||||
+7
-7
@@ -26,7 +26,7 @@ import fun.asgc.neutrino.core.annotation.NonIntercept;
|
|||||||
import fun.asgc.neutrino.core.annotation.Param;
|
import fun.asgc.neutrino.core.annotation.Param;
|
||||||
import fun.asgc.neutrino.core.aop.Invocation;
|
import fun.asgc.neutrino.core.aop.Invocation;
|
||||||
import fun.asgc.neutrino.core.aop.interceptor.Interceptor;
|
import fun.asgc.neutrino.core.aop.interceptor.Interceptor;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.core.db.page.PageInfo;
|
||||||
import fun.asgc.neutrino.core.db.template.JdbcTemplate;
|
import fun.asgc.neutrino.core.db.template.JdbcTemplate;
|
||||||
import fun.asgc.neutrino.core.util.*;
|
import fun.asgc.neutrino.core.util.*;
|
||||||
|
|
||||||
@@ -66,14 +66,14 @@ public class SqlMapperInterceptor implements Interceptor {
|
|||||||
res = jdbcTemplate.queryForListByMap(resultComponentType, sql, (Map)params);
|
res = jdbcTemplate.queryForListByMap(resultComponentType, sql, (Map)params);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Page.class.isAssignableFrom(inv.getTargetMethod().getParameters()[0].getType())) {
|
if (PageInfo.class.isAssignableFrom(inv.getTargetMethod().getParameters()[0].getType())) {
|
||||||
// 分页查询 TODO 此处暂时临时处理,假设后面的参数是一个DO对象
|
// 分页查询 TODO 此处暂时临时处理,假设后面的参数是一个DO对象
|
||||||
Page page = (Page) inv.getArgs()[0];
|
PageInfo pageInfo = (PageInfo) inv.getArgs()[0];
|
||||||
int offset = (page.getCurrentPage() - 1) * page.getPageSize();
|
int offset = (pageInfo.getCurrent() - 1) * pageInfo.getSize();
|
||||||
long total = jdbcTemplate.queryForLongByModel(String.format("select count(1) from (%s) T", sql), inv.getArgs()[1]);
|
long total = jdbcTemplate.queryForLongByModel(String.format("select count(1) from (%s) T", sql), inv.getArgs()[1]);
|
||||||
List resultList = jdbcTemplate.queryForListByModel(resultComponentType, String.format("%s limit %s,%s", sql, offset, page.getPageSize()), inv.getArgs()[1]);
|
List resultList = jdbcTemplate.queryForListByModel(resultComponentType, String.format("%s limit %s,%s", sql, offset, pageInfo.getSize()), inv.getArgs()[1]);
|
||||||
page.setTotal(total);
|
pageInfo.setTotal(total);
|
||||||
page.setRecords(resultList);
|
pageInfo.setRecords(resultList);
|
||||||
} else {
|
} else {
|
||||||
Object params = getParams(inv);
|
Object params = getParams(inv);
|
||||||
if (null == params || params.getClass().isArray()) {
|
if (null == params || params.getClass().isArray()) {
|
||||||
|
|||||||
@@ -0,0 +1,123 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2022 aoshiguchen
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
package fun.asgc.neutrino.core.db.page;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author: aoshiguchen
|
||||||
|
* @date: 2022/8/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PageInfo<T> implements Serializable {
|
||||||
|
private static final long serialVersionUID = 8545996863226528797L;
|
||||||
|
private List<T> records;
|
||||||
|
private Long total;
|
||||||
|
private Integer size;
|
||||||
|
private Integer current;
|
||||||
|
|
||||||
|
public PageInfo() {
|
||||||
|
this.records = Collections.emptyList();
|
||||||
|
this.total = 0L;
|
||||||
|
this.size = 10;
|
||||||
|
this.current = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageInfo(Integer current, Integer size) {
|
||||||
|
this(current, size, 0L);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageInfo(Integer current, Integer size, Long total) {
|
||||||
|
this.records = Collections.emptyList();
|
||||||
|
this.total = 0L;
|
||||||
|
this.size = 10;
|
||||||
|
this.current = 1;
|
||||||
|
if ((long)current > 1L) {
|
||||||
|
this.current = current;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.size = size;
|
||||||
|
this.total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPages() {
|
||||||
|
if ((long)this.getSize() == 0L) {
|
||||||
|
return 0L;
|
||||||
|
} else {
|
||||||
|
Long pages = this.getTotal() / (long)this.getSize();
|
||||||
|
if (this.getTotal() % (long)this.getSize() != 0L) {
|
||||||
|
pages = pages + 1L;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTotal() {
|
||||||
|
return this.total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSize() {
|
||||||
|
return this.size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasPrevious() {
|
||||||
|
return (long)this.current > 1L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasNext() {
|
||||||
|
return (long)this.current < this.getPages();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<T> getRecords() {
|
||||||
|
return this.records;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageInfo<T> setRecords(List<T> records) {
|
||||||
|
this.records = records;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageInfo<T> setTotal(Long total) {
|
||||||
|
this.total = total;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageInfo<T> setSize(Integer size) {
|
||||||
|
this.size = size;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCurrent() {
|
||||||
|
return this.current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageInfo<T> setCurrent(Integer current) {
|
||||||
|
this.current = current;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,34 +21,23 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.core.db.page;
|
package fun.asgc.neutrino.core.db.page;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
* @date: 2022/8/6
|
* @date: 2022/8/6
|
||||||
*/
|
*/
|
||||||
public class PageQuery {
|
@Data
|
||||||
|
public class PageQuery implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 当前页
|
* 当前页
|
||||||
*/
|
*/
|
||||||
private int currentPage = 1;
|
private int current = 1;
|
||||||
/**
|
/**
|
||||||
* 分页大小
|
* 分页大小
|
||||||
*/
|
*/
|
||||||
private int pageSize = 10;
|
private int size = 10;
|
||||||
|
|
||||||
public int getCurrentPage() {
|
|
||||||
return currentPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCurrentPage(int currentPage) {
|
|
||||||
this.currentPage = currentPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getPageSize() {
|
|
||||||
return pageSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPageSize(int pageSize) {
|
|
||||||
this.pageSize = pageSize;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ You need to install [node](http://nodejs.org/) and [git](https://git-scm.com/) l
|
|||||||
- Dynamic breadcrumb
|
- Dynamic breadcrumb
|
||||||
- I18n
|
- I18n
|
||||||
- Customizable theme
|
- Customizable theme
|
||||||
- Tags-view(Tab page Support right-click operation)
|
- Tags-view(Tab pageInfo Support right-click operation)
|
||||||
- Rich text editor
|
- Rich text editor
|
||||||
- Markdown editor
|
- Markdown editor
|
||||||
- JSON editor
|
- JSON editor
|
||||||
@@ -73,7 +73,7 @@ You need to install [node](http://nodejs.org/) and [git](https://git-scm.com/) l
|
|||||||
- Mock data
|
- Mock data
|
||||||
- Echarts
|
- Echarts
|
||||||
- Clipboard
|
- Clipboard
|
||||||
- 401/404 error page
|
- 401/404 error pageInfo
|
||||||
- Error log
|
- Error log
|
||||||
- Export excel
|
- Export excel
|
||||||
- Export zip
|
- Export zip
|
||||||
|
|||||||
@@ -47,12 +47,12 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
<div class="pagination-end" v-if="isPagination">
|
<div class="pagination-end" v-if="isPagination">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
:hide-on-single-page="false"
|
:hide-on-single-pageInfo="false"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
:current-page="PaginationData.currentPage"
|
:current-pageInfo="PaginationData.currentPage"
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
:pageInfo-sizes="[10, 20, 50, 100]"
|
||||||
:page-size="PaginationData.pageSize"
|
:pageInfo-size="PaginationData.pageSize"
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
:total="PaginationData.total"
|
:total="PaginationData.total"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -48,8 +48,8 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="pagination-container">
|
<div class="pagination-container">
|
||||||
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.currentPage"
|
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-pageInfo.sync="listQuery.currentPage"
|
||||||
:page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
:pageInfo-sizes="[10,20,30, 50]" :pageInfo-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -124,16 +124,16 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.currentPage = 1
|
this.listQuery.current = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.listQuery.pageSize = val
|
this.listQuery.size = val
|
||||||
this.listQuery.currentPage = 1
|
this.listQuery.current = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.listQuery.currentPage = val
|
this.listQuery.current = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleLookOver(row) {
|
handleLookOver(row) {
|
||||||
|
|||||||
@@ -46,8 +46,8 @@
|
|||||||
</el-table-column>-->
|
</el-table-column>-->
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="pagination-container">
|
<div class="pagination-container">
|
||||||
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.currentPage"
|
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-pageInfo.sync="listQuery.currentPage"
|
||||||
:page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
:pageInfo-sizes="[10,20,30, 50]" :pageInfo-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -148,16 +148,16 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.currentPage = 1
|
this.listQuery.current = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.listQuery.pageSize = val
|
this.listQuery.size = val
|
||||||
this.listQuery.currentPage = 1
|
this.listQuery.current = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.listQuery.currentPage = val
|
this.listQuery.current = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleShowClick(row) {
|
handleShowClick(row) {
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="pagination-container">
|
<div class="pagination-container">
|
||||||
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.currentPage"
|
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-pageInfo.sync="listQuery.currentPage"
|
||||||
:page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
:pageInfo-sizes="[10,20,30, 50]" :pageInfo-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -116,16 +116,16 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.currentPage = 1
|
this.listQuery.current = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.listQuery.pageSize = val
|
this.listQuery.size = val
|
||||||
this.listQuery.currentPage = 1
|
this.listQuery.current = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.listQuery.currentPage = val
|
this.listQuery.current = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleShowClick(row) {
|
handleShowClick(row) {
|
||||||
|
|||||||
@@ -60,8 +60,8 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<div class="pagination-container">
|
<div class="pagination-container">
|
||||||
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.currentPage"
|
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-pageInfo.sync="listQuery.currentPage"
|
||||||
:page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
:pageInfo-sizes="[10,20,30, 50]" :pageInfo-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -213,15 +213,15 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.currentPage = 1
|
this.listQuery.current = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.listQuery.pageSize = val
|
this.listQuery.size = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.listQuery.currentPage = val
|
this.listQuery.current = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleModifyStatus(row, enable) {
|
handleModifyStatus(row, enable) {
|
||||||
|
|||||||
@@ -65,8 +65,8 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<div class="pagination-container">
|
<div class="pagination-container">
|
||||||
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.currentPage"
|
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-pageInfo.sync="listQuery.currentPage"
|
||||||
:page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
:pageInfo-sizes="[10,20,30, 50]" :pageInfo-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -264,15 +264,15 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.currentPage = 1
|
this.listQuery.current = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.listQuery.pageSize = val
|
this.listQuery.size = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.listQuery.currentPage = val
|
this.listQuery.current = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleModifyStatus(row, enable) {
|
handleModifyStatus(row, enable) {
|
||||||
|
|||||||
@@ -51,8 +51,8 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="pagination-container">
|
<div class="pagination-container">
|
||||||
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.currentPage"
|
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-pageInfo.sync="listQuery.currentPage"
|
||||||
:page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
:pageInfo-sizes="[10,20,30, 50]" :pageInfo-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -171,15 +171,15 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.currentPage = 1
|
this.listQuery.current = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.listQuery.pageSize = val
|
this.listQuery.size = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.listQuery.currentPage = val
|
this.listQuery.current = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleModifyStatus(row, enable) {
|
handleModifyStatus(row, enable) {
|
||||||
|
|||||||
@@ -43,8 +43,8 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<div class="pagination-container">
|
<div class="pagination-container">
|
||||||
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.currentPage"
|
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-pageInfo.sync="listQuery.currentPage"
|
||||||
:page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
:pageInfo-sizes="[10,20,30, 50]" :pageInfo-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -173,15 +173,15 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.currentPage = 1
|
this.listQuery.current = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.listQuery.pageSize = val
|
this.listQuery.size = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.listQuery.currentPage = val
|
this.listQuery.current = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleModifyStatus(row, enable) {
|
handleModifyStatus(row, enable) {
|
||||||
|
|||||||
@@ -50,8 +50,8 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<div class="pagination-container">
|
<div class="pagination-container">
|
||||||
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.currentPage"
|
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-pageInfo.sync="listQuery.currentPage"
|
||||||
:page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
:pageInfo-sizes="[10,20,30, 50]" :pageInfo-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -197,15 +197,15 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.currentPage = 1
|
this.listQuery.current = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.listQuery.pageSize = val
|
this.listQuery.size = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.listQuery.currentPage = val
|
this.listQuery.current = val
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
handleModifyStatus(row, enable) {
|
handleModifyStatus(row, enable) {
|
||||||
|
|||||||
@@ -24,6 +24,25 @@
|
|||||||
<artifactId>mybatis-plus-solon-plugin</artifactId>
|
<artifactId>mybatis-plus-solon-plugin</artifactId>
|
||||||
<version>2.2.1</version>
|
<version>2.2.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.noear</groupId>
|
||||||
|
<artifactId>mybatis-pagehelper-solon-plugin</artifactId>
|
||||||
|
<version>2.2.1</version>
|
||||||
|
</dependency>
|
||||||
|
<!--orika-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>ma.glasnost.orika</groupId>
|
||||||
|
<artifactId>orika-core</artifactId>
|
||||||
|
<version>1.5.4</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>fun.asgc</groupId>
|
||||||
|
<artifactId>orika-solon-plugin</artifactId>
|
||||||
|
<version>2.2.1</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/../_solon_plugin/orika-solon-plugin/pom.xml</systemPath>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>fun.asgc.neutrino</groupId>
|
<groupId>fun.asgc.neutrino</groupId>
|
||||||
<artifactId>neutrino-proxy-core</artifactId>
|
<artifactId>neutrino-proxy-core</artifactId>
|
||||||
|
|||||||
+25
-2
@@ -1,9 +1,14 @@
|
|||||||
package fun.asgc.neutrino.proxy.server.base.db;
|
package fun.asgc.neutrino.proxy.server.base.db;
|
||||||
|
|
||||||
import com.alibaba.druid.pool.DruidDataSource;
|
import com.alibaba.druid.pool.DruidDataSource;
|
||||||
|
import com.baomidou.mybatisplus.core.MybatisConfiguration;
|
||||||
|
import com.baomidou.mybatisplus.core.MybatisSqlSessionFactoryBuilder;
|
||||||
|
import com.baomidou.mybatisplus.core.config.GlobalConfig;
|
||||||
|
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||||
import fun.asgc.neutrino.core.db.template.JdbcTemplate;
|
import fun.asgc.neutrino.core.db.template.JdbcTemplate;
|
||||||
import fun.asgc.neutrino.proxy.server.base.rest.config.DbConfig;
|
import fun.asgc.neutrino.proxy.server.base.rest.config.DbConfig;
|
||||||
import fun.asgc.neutrino.proxy.server.constant.DbTypeEnum;
|
import fun.asgc.neutrino.proxy.server.constant.DbTypeEnum;
|
||||||
|
import org.apache.ibatis.solon.annotation.Db;
|
||||||
import org.noear.solon.annotation.Bean;
|
import org.noear.solon.annotation.Bean;
|
||||||
import org.noear.solon.annotation.Configuration;
|
import org.noear.solon.annotation.Configuration;
|
||||||
import org.noear.solon.annotation.Inject;
|
import org.noear.solon.annotation.Inject;
|
||||||
@@ -19,7 +24,7 @@ import javax.sql.DataSource;
|
|||||||
@Configuration
|
@Configuration
|
||||||
public class DbConfiguration {
|
public class DbConfiguration {
|
||||||
|
|
||||||
@Bean(value = "dataSource", typed = true)
|
@Bean(value = "db", typed = true)
|
||||||
public DataSource dataSource(@Inject DbConfig dbConfig) {
|
public DataSource dataSource(@Inject DbConfig dbConfig) {
|
||||||
DbTypeEnum dbTypeEnum = DbTypeEnum.of(dbConfig.getType());
|
DbTypeEnum dbTypeEnum = DbTypeEnum.of(dbConfig.getType());
|
||||||
if (DbTypeEnum.SQLITE == dbTypeEnum) {
|
if (DbTypeEnum.SQLITE == dbTypeEnum) {
|
||||||
@@ -45,7 +50,25 @@ public class DbConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public JdbcTemplate jdbcTemplate(@Inject("dataSource") DataSource dataSource) {
|
public JdbcTemplate jdbcTemplate(@Inject("db") DataSource dataSource) {
|
||||||
return new JdbcTemplate(dataSource);
|
return new JdbcTemplate(dataSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public void db1_ext(@Db("db") GlobalConfig globalConfig) {
|
||||||
|
MetaObjectHandler metaObjectHandler = new MetaObjectHandlerImpl();
|
||||||
|
globalConfig.setMetaObjectHandler(metaObjectHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public void db1_ext2(@Db("db") MybatisConfiguration config){
|
||||||
|
config.getTypeHandlerRegistry().register("fun.asgc.neutrino.proxy.server.dal");
|
||||||
|
config.setDefaultEnumTypeHandler(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public MybatisSqlSessionFactoryBuilder factoryBuilderNew(){
|
||||||
|
return new MybatisSqlSessionFactoryBuilderImpl();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+33
-35
@@ -1,7 +1,5 @@
|
|||||||
package fun.asgc.neutrino.proxy.server.base.db;
|
package fun.asgc.neutrino.proxy.server.base.db;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.aop.Aop;
|
|
||||||
import fun.asgc.neutrino.proxy.server.dal.*;
|
|
||||||
import org.noear.solon.core.AopContext;
|
import org.noear.solon.core.AopContext;
|
||||||
import org.noear.solon.core.Plugin;
|
import org.noear.solon.core.Plugin;
|
||||||
|
|
||||||
@@ -12,39 +10,39 @@ import org.noear.solon.core.Plugin;
|
|||||||
public class MapperPlugin implements Plugin {
|
public class MapperPlugin implements Plugin {
|
||||||
@Override
|
@Override
|
||||||
public void start(AopContext context) throws Throwable {
|
public void start(AopContext context) throws Throwable {
|
||||||
Aop.intercept(ClientConnectRecordMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(ClientConnectRecordMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(DataCleanMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(DataCleanMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(FlowReportDayMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(FlowReportDayMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(FlowReportHourMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(FlowReportHourMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(FlowReportMinuteMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(FlowReportMinuteMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(FlowReportMonthMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(FlowReportMonthMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(JobInfoMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(JobInfoMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(JobLogMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(JobLogMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(LicenseMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(LicenseMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(PortMappingMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(PortMappingMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(PortPoolMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(PortPoolMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(UserConnectRecordMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(UserConnectRecordMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(UserLoginRecordMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(UserLoginRecordMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(UserMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(UserMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(UserReportMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(UserReportMapper.class, SqlMapperInterceptor.class);
|
||||||
Aop.intercept(UserTokenMapper.class, SqlMapperInterceptor.class);
|
// Aop.intercept(UserTokenMapper.class, SqlMapperInterceptor.class);
|
||||||
|
//
|
||||||
context.wrapAndPut(ClientConnectRecordMapper.class, Aop.get(ClientConnectRecordMapper.class));
|
// context.wrapAndPut(ClientConnectRecordMapper.class, Aop.get(ClientConnectRecordMapper.class));
|
||||||
context.wrapAndPut(DataCleanMapper.class, Aop.get(DataCleanMapper.class));
|
// context.wrapAndPut(DataCleanMapper.class, Aop.get(DataCleanMapper.class));
|
||||||
context.wrapAndPut(FlowReportDayMapper.class, Aop.get(FlowReportDayMapper.class));
|
// context.wrapAndPut(FlowReportDayMapper.class, Aop.get(FlowReportDayMapper.class));
|
||||||
context.wrapAndPut(FlowReportHourMapper.class, Aop.get(FlowReportHourMapper.class));
|
// context.wrapAndPut(FlowReportHourMapper.class, Aop.get(FlowReportHourMapper.class));
|
||||||
context.wrapAndPut(FlowReportMinuteMapper.class, Aop.get(FlowReportMinuteMapper.class));
|
// context.wrapAndPut(FlowReportMinuteMapper.class, Aop.get(FlowReportMinuteMapper.class));
|
||||||
context.wrapAndPut(FlowReportMonthMapper.class, Aop.get(FlowReportMonthMapper.class));
|
// context.wrapAndPut(FlowReportMonthMapper.class, Aop.get(FlowReportMonthMapper.class));
|
||||||
context.wrapAndPut(JobInfoMapper.class, Aop.get(JobInfoMapper.class));
|
// context.wrapAndPut(JobInfoMapper.class, Aop.get(JobInfoMapper.class));
|
||||||
context.wrapAndPut(JobLogMapper.class, Aop.get(JobLogMapper.class));
|
// context.wrapAndPut(JobLogMapper.class, Aop.get(JobLogMapper.class));
|
||||||
context.wrapAndPut(LicenseMapper.class, Aop.get(LicenseMapper.class));
|
// context.wrapAndPut(LicenseMapper.class, Aop.get(LicenseMapper.class));
|
||||||
context.wrapAndPut(PortMappingMapper.class, Aop.get(PortMappingMapper.class));
|
// context.wrapAndPut(PortMappingMapper.class, Aop.get(PortMappingMapper.class));
|
||||||
context.wrapAndPut(PortPoolMapper.class, Aop.get(PortPoolMapper.class));
|
// context.wrapAndPut(PortPoolMapper.class, Aop.get(PortPoolMapper.class));
|
||||||
context.wrapAndPut(UserConnectRecordMapper.class, Aop.get(UserConnectRecordMapper.class));
|
// context.wrapAndPut(UserConnectRecordMapper.class, Aop.get(UserConnectRecordMapper.class));
|
||||||
context.wrapAndPut(UserLoginRecordMapper.class, Aop.get(UserLoginRecordMapper.class));
|
// context.wrapAndPut(UserLoginRecordMapper.class, Aop.get(UserLoginRecordMapper.class));
|
||||||
context.wrapAndPut(UserMapper.class, Aop.get(UserMapper.class));
|
// context.wrapAndPut(UserMapper.class, Aop.get(UserMapper.class));
|
||||||
context.wrapAndPut(UserReportMapper.class, Aop.get(UserReportMapper.class));
|
// context.wrapAndPut(UserReportMapper.class, Aop.get(UserReportMapper.class));
|
||||||
context.wrapAndPut(UserTokenMapper.class, Aop.get(UserTokenMapper.class));
|
// context.wrapAndPut(UserTokenMapper.class, Aop.get(UserTokenMapper.class));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package fun.asgc.neutrino.proxy.server.base.db;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||||
|
import org.apache.ibatis.reflection.MetaObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: aoshiguchen
|
||||||
|
* @date: 2023/3/10
|
||||||
|
*/
|
||||||
|
public class MetaObjectHandlerImpl implements MetaObjectHandler {
|
||||||
|
@Override
|
||||||
|
public void insertFill(MetaObject metaObject) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateFill(MetaObject metaObject) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package fun.asgc.neutrino.proxy.server.base.db;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.MybatisSqlSessionFactoryBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: aoshiguchen
|
||||||
|
* @date: 2023/3/10
|
||||||
|
*/
|
||||||
|
public class MybatisSqlSessionFactoryBuilderImpl extends MybatisSqlSessionFactoryBuilder {
|
||||||
|
|
||||||
|
}
|
||||||
+7
-7
@@ -27,7 +27,7 @@ import fun.asgc.neutrino.core.annotation.Param;
|
|||||||
import fun.asgc.neutrino.core.aop.Invocation;
|
import fun.asgc.neutrino.core.aop.Invocation;
|
||||||
import fun.asgc.neutrino.core.aop.interceptor.Interceptor;
|
import fun.asgc.neutrino.core.aop.interceptor.Interceptor;
|
||||||
import fun.asgc.neutrino.core.db.mapper.SqlParser;
|
import fun.asgc.neutrino.core.db.mapper.SqlParser;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.core.db.page.PageInfo;
|
||||||
import fun.asgc.neutrino.core.db.template.JdbcTemplate;
|
import fun.asgc.neutrino.core.db.template.JdbcTemplate;
|
||||||
import fun.asgc.neutrino.core.util.ArrayUtil;
|
import fun.asgc.neutrino.core.util.ArrayUtil;
|
||||||
import fun.asgc.neutrino.core.util.Assert;
|
import fun.asgc.neutrino.core.util.Assert;
|
||||||
@@ -71,14 +71,14 @@ public class SqlMapperInterceptor implements Interceptor {
|
|||||||
res = jdbcTemplate.queryForListByMap(resultComponentType, sql, (Map)params);
|
res = jdbcTemplate.queryForListByMap(resultComponentType, sql, (Map)params);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Page.class.isAssignableFrom(inv.getTargetMethod().getParameters()[0].getType())) {
|
if (PageInfo.class.isAssignableFrom(inv.getTargetMethod().getParameters()[0].getType())) {
|
||||||
// 分页查询 TODO 此处暂时临时处理,假设后面的参数是一个DO对象
|
// 分页查询 TODO 此处暂时临时处理,假设后面的参数是一个DO对象
|
||||||
Page page = (Page) inv.getArgs()[0];
|
PageInfo pageInfo = (PageInfo) inv.getArgs()[0];
|
||||||
int offset = (page.getCurrentPage() - 1) * page.getPageSize();
|
int offset = (pageInfo.getCurrent() - 1) * pageInfo.getSize();
|
||||||
long total = jdbcTemplate.queryForLongByModel(String.format("select count(1) from (%s) T", sql), inv.getArgs()[1]);
|
long total = jdbcTemplate.queryForLongByModel(String.format("select count(1) from (%s) T", sql), inv.getArgs()[1]);
|
||||||
List resultList = jdbcTemplate.queryForListByModel(resultComponentType, String.format("%s limit %s,%s", sql, offset, page.getPageSize()), inv.getArgs()[1]);
|
List resultList = jdbcTemplate.queryForListByModel(resultComponentType, String.format("%s limit %s,%s", sql, offset, pageInfo.getSize()), inv.getArgs()[1]);
|
||||||
page.setTotal(total);
|
pageInfo.setTotal(total);
|
||||||
page.setRecords(resultList);
|
pageInfo.setRecords(resultList);
|
||||||
} else {
|
} else {
|
||||||
Object params = getParams(inv);
|
Object params = getParams(inv);
|
||||||
if (null == params || params.getClass().isArray()) {
|
if (null == params || params.getClass().isArray()) {
|
||||||
|
|||||||
+132
@@ -0,0 +1,132 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2022 aoshiguchen
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
package fun.asgc.neutrino.proxy.server.base.page;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author: aoshiguchen
|
||||||
|
* @date: 2022/8/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PageInfo<T> implements Serializable {
|
||||||
|
private static final long serialVersionUID = 8545996863226528797L;
|
||||||
|
private List<T> records;
|
||||||
|
private Long total;
|
||||||
|
private Integer size;
|
||||||
|
private Integer current;
|
||||||
|
|
||||||
|
public PageInfo() {
|
||||||
|
this.records = Collections.emptyList();
|
||||||
|
this.total = 0L;
|
||||||
|
this.size = 10;
|
||||||
|
this.current = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageInfo(Integer current, Integer size) {
|
||||||
|
this(current, size, 0L);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageInfo(Integer current, Integer size, Long total) {
|
||||||
|
this.records = Collections.emptyList();
|
||||||
|
this.total = 0L;
|
||||||
|
this.size = 10;
|
||||||
|
this.current = 1;
|
||||||
|
if ((long)current > 1L) {
|
||||||
|
this.current = current;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.size = size;
|
||||||
|
this.total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPages() {
|
||||||
|
if ((long)this.getSize() == 0L) {
|
||||||
|
return 0L;
|
||||||
|
} else {
|
||||||
|
Long pages = this.getTotal() / (long)this.getSize();
|
||||||
|
if (this.getTotal() % (long)this.getSize() != 0L) {
|
||||||
|
pages = pages + 1L;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTotal() {
|
||||||
|
return this.total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSize() {
|
||||||
|
return this.size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasPrevious() {
|
||||||
|
return (long)this.current > 1L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasNext() {
|
||||||
|
return (long)this.current < this.getPages();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<T> getRecords() {
|
||||||
|
return this.records;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageInfo<T> setRecords(List<T> records) {
|
||||||
|
this.records = records;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageInfo<T> setTotal(Long total) {
|
||||||
|
this.total = total;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageInfo<T> setSize(Integer size) {
|
||||||
|
this.size = size;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCurrent() {
|
||||||
|
return this.current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageInfo<T> setCurrent(Integer current) {
|
||||||
|
this.current = current;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> PageInfo<T> of(List<T> records, Long total, Integer current, Integer size) {
|
||||||
|
PageInfo<T> pageInfo = new PageInfo();
|
||||||
|
pageInfo.setRecords(records);
|
||||||
|
pageInfo.setTotal(total);
|
||||||
|
pageInfo.setCurrent(current);
|
||||||
|
pageInfo.setSize(size);
|
||||||
|
return pageInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
+7
-14
@@ -19,11 +19,11 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.core.db.page;
|
package fun.asgc.neutrino.proxy.server.base.page;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -31,20 +31,13 @@ import java.util.List;
|
|||||||
* @date: 2022/8/6
|
* @date: 2022/8/6
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class Page<T> extends PageQuery {
|
public class PageQuery implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 数据总数
|
* 当前页
|
||||||
*/
|
*/
|
||||||
private Long total;
|
private int current = 1;
|
||||||
/**
|
/**
|
||||||
* 结果数据
|
* 分页大小
|
||||||
*/
|
*/
|
||||||
private List<T> records;
|
private int size = 10;
|
||||||
|
|
||||||
public static <T> Page<T> create(PageQuery pageQuery) {
|
|
||||||
Page page = new Page();
|
|
||||||
page.setPageSize(pageQuery.getPageSize());
|
|
||||||
page.setCurrentPage(pageQuery.getCurrentPage());
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
-75
@@ -1,75 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package fun.asgc.neutrino.proxy.server.base.rest.config;
|
|
||||||
|
|
||||||
import com.alibaba.druid.pool.DruidDataSource;
|
|
||||||
import fun.asgc.neutrino.core.db.template.JdbcTemplate;
|
|
||||||
import fun.asgc.neutrino.proxy.server.constant.DbTypeEnum;
|
|
||||||
import org.noear.solon.annotation.Bean;
|
|
||||||
import org.noear.solon.annotation.Configuration;
|
|
||||||
import org.noear.solon.annotation.Inject;
|
|
||||||
import org.sqlite.SQLiteConfig;
|
|
||||||
import org.sqlite.SQLiteDataSource;
|
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统配置
|
|
||||||
*author: aoshiguchen
|
|
||||||
* @date: 2022/8/1
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
public class RestConfiguration {
|
|
||||||
@Inject
|
|
||||||
private DbConfig dbConfig;
|
|
||||||
|
|
||||||
@Bean("dataSource")
|
|
||||||
public DataSource dataSource() {
|
|
||||||
DbTypeEnum dbTypeEnum = DbTypeEnum.of(dbConfig.getType());
|
|
||||||
if (DbTypeEnum.SQLITE == dbTypeEnum) {
|
|
||||||
SQLiteDataSource dataSource = new SQLiteDataSource();
|
|
||||||
dataSource.setUrl(dbConfig.getUrl());
|
|
||||||
dataSource.setJournalMode(SQLiteConfig.JournalMode.WAL.getValue());
|
|
||||||
return dataSource;
|
|
||||||
} else if (DbTypeEnum.MYSQL == dbTypeEnum) {
|
|
||||||
DruidDataSource dataSource = new DruidDataSource();
|
|
||||||
dataSource.setDriverClassName(dbConfig.getDriverClass());
|
|
||||||
dataSource.setUrl(dbConfig.getUrl());
|
|
||||||
dataSource.setInitialSize(5);
|
|
||||||
dataSource.setMinIdle(5);
|
|
||||||
dataSource.setMaxActive(20);
|
|
||||||
dataSource.setMaxWait(60000);
|
|
||||||
dataSource.setPoolPreparedStatements(true);
|
|
||||||
dataSource.setUsername(dbConfig.getUsername());
|
|
||||||
dataSource.setPassword(dbConfig.getPassword());
|
|
||||||
return dataSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public JdbcTemplate jdbcTemplate(@Inject("dataSource") DataSource dataSource) {
|
|
||||||
return new JdbcTemplate(dataSource);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
+3
-3
@@ -21,8 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.controller;
|
package fun.asgc.neutrino.proxy.server.controller;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.ClientConnectRecordListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.ClientConnectRecordListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.ClientConnectRecordListRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.ClientConnectRecordListRes;
|
||||||
import fun.asgc.neutrino.proxy.server.service.ClientConnectRecordService;
|
import fun.asgc.neutrino.proxy.server.service.ClientConnectRecordService;
|
||||||
@@ -46,7 +46,7 @@ public class ClientConnectRecordController {
|
|||||||
|
|
||||||
@Get
|
@Get
|
||||||
@Mapping("/page")
|
@Mapping("/page")
|
||||||
public Page<ClientConnectRecordListRes> page(PageQuery pageQuery, ClientConnectRecordListReq req) {
|
public PageInfo<ClientConnectRecordListRes> page(PageQuery pageQuery, ClientConnectRecordListReq req) {
|
||||||
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
||||||
return clientConnectRecordService.page(pageQuery, req);
|
return clientConnectRecordService.page(pageQuery, req);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -21,9 +21,9 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.controller;
|
package fun.asgc.neutrino.proxy.server.controller;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
|
||||||
import fun.asgc.neutrino.core.web.annotation.RequestBody;
|
import fun.asgc.neutrino.core.web.annotation.RequestBody;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.base.rest.annotation.OnlyAdmin;
|
import fun.asgc.neutrino.proxy.server.base.rest.annotation.OnlyAdmin;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.JobInfoExecuteReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.JobInfoExecuteReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.JobInfoListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.JobInfoListReq;
|
||||||
@@ -55,7 +55,7 @@ public class JobInfoController {
|
|||||||
|
|
||||||
@Get
|
@Get
|
||||||
@Mapping("/page")
|
@Mapping("/page")
|
||||||
public Page<JobInfoListRes> page(PageQuery pageQuery, JobInfoListReq req) {
|
public PageInfo<JobInfoListRes> page(PageQuery pageQuery, JobInfoListReq req) {
|
||||||
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
||||||
return jobInfoService.page(pageQuery, req);
|
return jobInfoService.page(pageQuery, req);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -21,8 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.controller;
|
package fun.asgc.neutrino.proxy.server.controller;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.JobLogListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.JobLogListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.JobLogListRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.JobLogListRes;
|
||||||
import fun.asgc.neutrino.proxy.server.service.JobLogService;
|
import fun.asgc.neutrino.proxy.server.service.JobLogService;
|
||||||
@@ -47,7 +47,7 @@ public class JobLogController {
|
|||||||
|
|
||||||
@Get
|
@Get
|
||||||
@Mapping("/page")
|
@Mapping("/page")
|
||||||
public Page<JobLogListRes> page(PageQuery pageQuery, JobLogListReq req) {
|
public PageInfo<JobLogListRes> page(PageQuery pageQuery, JobLogListReq req) {
|
||||||
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
||||||
return jobLogService.page(pageQuery, req);
|
return jobLogService.page(pageQuery, req);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -21,10 +21,10 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.controller;
|
package fun.asgc.neutrino.proxy.server.controller;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
|
||||||
import fun.asgc.neutrino.core.web.annotation.RequestBody;
|
import fun.asgc.neutrino.core.web.annotation.RequestBody;
|
||||||
import fun.asgc.neutrino.core.web.annotation.RequestParam;
|
import fun.asgc.neutrino.core.web.annotation.RequestParam;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.base.rest.annotation.OnlyAdmin;
|
import fun.asgc.neutrino.proxy.server.base.rest.annotation.OnlyAdmin;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.LicenseCreateReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.LicenseCreateReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.LicenseListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.LicenseListReq;
|
||||||
@@ -50,7 +50,7 @@ public class LicenseController {
|
|||||||
|
|
||||||
@Get
|
@Get
|
||||||
@Mapping("/page")
|
@Mapping("/page")
|
||||||
public Page<LicenseListRes> page(PageQuery pageQuery, LicenseListReq req) {
|
public PageInfo<LicenseListRes> page(PageQuery pageQuery, LicenseListReq req) {
|
||||||
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
||||||
|
|
||||||
return licenseService.page(pageQuery, req);
|
return licenseService.page(pageQuery, req);
|
||||||
|
|||||||
+3
-3
@@ -22,10 +22,10 @@
|
|||||||
package fun.asgc.neutrino.proxy.server.controller;
|
package fun.asgc.neutrino.proxy.server.controller;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.annotation.NonIntercept;
|
import fun.asgc.neutrino.core.annotation.NonIntercept;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
|
||||||
import fun.asgc.neutrino.core.web.annotation.RequestBody;
|
import fun.asgc.neutrino.core.web.annotation.RequestBody;
|
||||||
import fun.asgc.neutrino.core.web.annotation.RequestParam;
|
import fun.asgc.neutrino.core.web.annotation.RequestParam;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.PortMappingCreateReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.PortMappingCreateReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.PortMappingListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.PortMappingListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.PortMappingUpdateEnableStatusReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.PortMappingUpdateEnableStatusReq;
|
||||||
@@ -49,7 +49,7 @@ public class PortMappingController {
|
|||||||
|
|
||||||
@Get
|
@Get
|
||||||
@Mapping("/page")
|
@Mapping("/page")
|
||||||
public Page<PortMappingListRes> page(PageQuery pageQuery, PortMappingListReq req) {
|
public PageInfo<PortMappingListRes> page(PageQuery pageQuery, PortMappingListReq req) {
|
||||||
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
||||||
|
|
||||||
return portMappingService.page(pageQuery, req);
|
return portMappingService.page(pageQuery, req);
|
||||||
|
|||||||
+3
-3
@@ -21,10 +21,10 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.controller;
|
package fun.asgc.neutrino.proxy.server.controller;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
|
||||||
import fun.asgc.neutrino.core.web.annotation.RequestBody;
|
import fun.asgc.neutrino.core.web.annotation.RequestBody;
|
||||||
import fun.asgc.neutrino.core.web.annotation.RequestParam;
|
import fun.asgc.neutrino.core.web.annotation.RequestParam;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.base.rest.annotation.OnlyAdmin;
|
import fun.asgc.neutrino.proxy.server.base.rest.annotation.OnlyAdmin;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.PortPoolCreateReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.PortPoolCreateReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.PortPoolListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.PortPoolListReq;
|
||||||
@@ -51,7 +51,7 @@ public class PortPoolController {
|
|||||||
|
|
||||||
@Get
|
@Get
|
||||||
@Mapping("/page")
|
@Mapping("/page")
|
||||||
public Page<PortPoolListRes> page(PageQuery pageQuery, PortPoolListReq req) {
|
public PageInfo<PortPoolListRes> page(PageQuery pageQuery, PortPoolListReq req) {
|
||||||
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
||||||
|
|
||||||
return portPoolService.page(pageQuery, req);
|
return portPoolService.page(pageQuery, req);
|
||||||
|
|||||||
+3
-3
@@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.controller;
|
package fun.asgc.neutrino.proxy.server.controller;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.core.db.page.PageInfo;
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
import fun.asgc.neutrino.core.db.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.LicenseFlowReportReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.LicenseFlowReportReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.UserFlowReportReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.UserFlowReportReq;
|
||||||
@@ -79,7 +79,7 @@ public class ReportController {
|
|||||||
*/
|
*/
|
||||||
@Get
|
@Get
|
||||||
@Mapping("/user/flow-report/page")
|
@Mapping("/user/flow-report/page")
|
||||||
public Page<UserFlowReportRes> userFlowReportPage(PageQuery pageQuery, UserFlowReportReq req) {
|
public PageInfo<UserFlowReportRes> userFlowReportPage(PageQuery pageQuery, UserFlowReportReq req) {
|
||||||
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
||||||
|
|
||||||
return reportService.userFlowReportPage(pageQuery, req);
|
return reportService.userFlowReportPage(pageQuery, req);
|
||||||
@@ -93,7 +93,7 @@ public class ReportController {
|
|||||||
*/
|
*/
|
||||||
@Get
|
@Get
|
||||||
@Mapping("/license/flow-report/page")
|
@Mapping("/license/flow-report/page")
|
||||||
public Page<LicenseFlowReportRes> licenseFlowReportPage(PageQuery pageQuery, LicenseFlowReportReq req) {
|
public PageInfo<LicenseFlowReportRes> licenseFlowReportPage(PageQuery pageQuery, LicenseFlowReportReq req) {
|
||||||
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
||||||
|
|
||||||
return reportService.licenseFlowReportPage(pageQuery, req);
|
return reportService.licenseFlowReportPage(pageQuery, req);
|
||||||
|
|||||||
+3
-3
@@ -21,10 +21,10 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.controller;
|
package fun.asgc.neutrino.proxy.server.controller;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
|
||||||
import fun.asgc.neutrino.core.web.annotation.RequestBody;
|
import fun.asgc.neutrino.core.web.annotation.RequestBody;
|
||||||
import fun.asgc.neutrino.core.web.annotation.RequestParam;
|
import fun.asgc.neutrino.core.web.annotation.RequestParam;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
||||||
import fun.asgc.neutrino.proxy.server.base.rest.annotation.OnlyAdmin;
|
import fun.asgc.neutrino.proxy.server.base.rest.annotation.OnlyAdmin;
|
||||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||||
@@ -54,7 +54,7 @@ public class UserController {
|
|||||||
|
|
||||||
@Get
|
@Get
|
||||||
@Mapping("/page")
|
@Mapping("/page")
|
||||||
public Page<UserListRes> page(PageQuery pageQuery, UserListReq req) {
|
public PageInfo<UserListRes> page(PageQuery pageQuery, UserListReq req) {
|
||||||
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
||||||
|
|
||||||
return userService.page(pageQuery, req);
|
return userService.page(pageQuery, req);
|
||||||
|
|||||||
+3
-3
@@ -21,8 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.controller;
|
package fun.asgc.neutrino.proxy.server.controller;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.UserLoginRecordListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.UserLoginRecordListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.UserLoginRecordListRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.UserLoginRecordListRes;
|
||||||
import fun.asgc.neutrino.proxy.server.service.UserLoginRecordService;
|
import fun.asgc.neutrino.proxy.server.service.UserLoginRecordService;
|
||||||
@@ -44,7 +44,7 @@ public class UserLoginRecordController {
|
|||||||
|
|
||||||
@Get
|
@Get
|
||||||
@Mapping("/page")
|
@Mapping("/page")
|
||||||
public Page<UserLoginRecordListRes> page(PageQuery pageQuery, UserLoginRecordListReq req) {
|
public PageInfo<UserLoginRecordListRes> page(PageQuery pageQuery, UserLoginRecordListReq req) {
|
||||||
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
||||||
|
|
||||||
return userLoginRecordService.page(pageQuery, req);
|
return userLoginRecordService.page(pageQuery, req);
|
||||||
|
|||||||
+6
-3
@@ -1,21 +1,24 @@
|
|||||||
package fun.asgc.neutrino.proxy.server.dal;
|
package fun.asgc.neutrino.proxy.server.dal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Select;
|
import fun.asgc.neutrino.core.db.annotation.Select;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.core.db.page.PageInfo;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.ClientConnectRecordListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.ClientConnectRecordListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.ClientConnectRecordListRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.ClientConnectRecordListRes;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.ClientConnectRecordDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.ClientConnectRecordDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
* @date: 2022/11/23
|
* @date: 2022/11/23
|
||||||
*/
|
*/
|
||||||
public interface ClientConnectRecordMapper {
|
@Mapper
|
||||||
|
public interface ClientConnectRecordMapper extends BaseMapper<ClientConnectRecordDO> {
|
||||||
|
|
||||||
void add(ClientConnectRecordDO clientConnectRecordDO);
|
void add(ClientConnectRecordDO clientConnectRecordDO);
|
||||||
|
|
||||||
@ResultType(ClientConnectRecordListRes.class)
|
@ResultType(ClientConnectRecordListRes.class)
|
||||||
@Select("select * from client_connect_record order by id desc")
|
@Select("select * from client_connect_record order by id desc")
|
||||||
void page(Page page, ClientConnectRecordListReq req);
|
void page(PageInfo pageInfo, ClientConnectRecordListReq req);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-3
@@ -21,19 +21,20 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal;
|
package fun.asgc.neutrino.proxy.server.dal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import fun.asgc.neutrino.core.annotation.Param;
|
import fun.asgc.neutrino.core.annotation.Param;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Delete;
|
import fun.asgc.neutrino.core.db.annotation.Delete;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Insert;
|
import fun.asgc.neutrino.core.db.annotation.Insert;
|
||||||
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Select;
|
import fun.asgc.neutrino.core.db.annotation.Select;
|
||||||
import fun.asgc.neutrino.core.db.mapper.SqlMapper;
|
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportDayDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportDayDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
public interface FlowReportDayMapper {
|
public interface FlowReportDayMapper extends BaseMapper<FlowReportDayDO> {
|
||||||
@Select("select * from flow_report_day where license_id = :licenseId and date_str = :dateStr")
|
@Select("select * from flow_report_day where license_id = :licenseId and date_str = :dateStr")
|
||||||
FlowReportDayDO findOne(@Param("licenseId") Integer licenseId, @Param("dateStr") String dateStr);
|
FlowReportDayDO findOne(@Param("licenseId") Integer licenseId, @Param("dateStr") String dateStr);
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -21,18 +21,20 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal;
|
package fun.asgc.neutrino.proxy.server.dal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import fun.asgc.neutrino.core.annotation.Param;
|
import fun.asgc.neutrino.core.annotation.Param;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Delete;
|
import fun.asgc.neutrino.core.db.annotation.Delete;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Insert;
|
import fun.asgc.neutrino.core.db.annotation.Insert;
|
||||||
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Select;
|
import fun.asgc.neutrino.core.db.annotation.Select;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportHourDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportHourDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
public interface FlowReportHourMapper {
|
public interface FlowReportHourMapper extends BaseMapper<FlowReportHourDO> {
|
||||||
@Select("select * from flow_report_hour where license_id = :licenseId and date_str = :dateStr")
|
@Select("select * from flow_report_hour where license_id = :licenseId and date_str = :dateStr")
|
||||||
FlowReportHourDO findOne(@Param("licenseId") Integer licenseId, @Param("dateStr") String dateStr);
|
FlowReportHourDO findOne(@Param("licenseId") Integer licenseId, @Param("dateStr") String dateStr);
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -21,18 +21,20 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal;
|
package fun.asgc.neutrino.proxy.server.dal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import fun.asgc.neutrino.core.annotation.Param;
|
import fun.asgc.neutrino.core.annotation.Param;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Insert;
|
import fun.asgc.neutrino.core.db.annotation.Insert;
|
||||||
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Select;
|
import fun.asgc.neutrino.core.db.annotation.Select;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportMinuteDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportMinuteDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
public interface FlowReportMinuteMapper {
|
public interface FlowReportMinuteMapper extends BaseMapper<FlowReportMinuteDO> {
|
||||||
@Select("select * from flow_report_minute where license_id = :licenseId and date = :date")
|
@Select("select * from flow_report_minute where license_id = :licenseId and date = :date")
|
||||||
FlowReportMinuteDO findOne(@Param("licenseId") Integer licenseId, @Param("date") String date);
|
FlowReportMinuteDO findOne(@Param("licenseId") Integer licenseId, @Param("date") String date);
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -21,14 +21,16 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal;
|
package fun.asgc.neutrino.proxy.server.dal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import fun.asgc.neutrino.core.annotation.Param;
|
import fun.asgc.neutrino.core.annotation.Param;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Delete;
|
import fun.asgc.neutrino.core.db.annotation.Delete;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Insert;
|
import fun.asgc.neutrino.core.db.annotation.Insert;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Select;
|
import fun.asgc.neutrino.core.db.annotation.Select;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportMonthDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportMonthDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
public interface FlowReportMonthMapper {
|
public interface FlowReportMonthMapper extends BaseMapper<FlowReportMonthDO> {
|
||||||
@Select("select * from flow_report_month where license_id = :licenseId and date_str = :dateStr")
|
@Select("select * from flow_report_month where license_id = :licenseId and date_str = :dateStr")
|
||||||
FlowReportMonthDO findOne(@Param("licenseId") Integer licenseId, @Param("dateStr") String dateStr);
|
FlowReportMonthDO findOne(@Param("licenseId") Integer licenseId, @Param("dateStr") String dateStr);
|
||||||
|
|
||||||
|
|||||||
+6
-4
@@ -21,24 +21,26 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal;
|
package fun.asgc.neutrino.proxy.server.dal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import fun.asgc.neutrino.core.annotation.Param;
|
import fun.asgc.neutrino.core.annotation.Param;
|
||||||
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Select;
|
import fun.asgc.neutrino.core.db.annotation.Select;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Update;
|
import fun.asgc.neutrino.core.db.annotation.Update;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.core.db.page.PageInfo;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.JobInfoListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.JobInfoListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.JobInfoListRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.JobInfoListRes;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.JobInfoDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.JobInfoDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
public interface JobInfoMapper {
|
public interface JobInfoMapper extends BaseMapper<JobInfoDO> {
|
||||||
|
|
||||||
@ResultType(JobInfoListRes.class)
|
@ResultType(JobInfoListRes.class)
|
||||||
@Select("select * from job_info")
|
@Select("select * from job_info")
|
||||||
void page(Page page, JobInfoListReq req);
|
void page(PageInfo pageInfo, JobInfoListReq req);
|
||||||
|
|
||||||
@Select("select * from job_info where id = ?")
|
@Select("select * from job_info where id = ?")
|
||||||
JobInfoDO findById(Integer id);
|
JobInfoDO findById(Integer id);
|
||||||
|
|||||||
+7
-4
@@ -21,15 +21,17 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal;
|
package fun.asgc.neutrino.proxy.server.dal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import fun.asgc.neutrino.core.annotation.Component;
|
import fun.asgc.neutrino.core.annotation.Component;
|
||||||
import fun.asgc.neutrino.core.aop.Intercept;
|
import fun.asgc.neutrino.core.aop.Intercept;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Insert;
|
import fun.asgc.neutrino.core.db.annotation.Insert;
|
||||||
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Select;
|
import fun.asgc.neutrino.core.db.annotation.Select;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.core.db.page.PageInfo;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.JobLogListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.JobLogListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.JobLogListRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.JobLogListRes;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.JobLogDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.JobLogDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -38,17 +40,18 @@ import fun.asgc.neutrino.proxy.server.dal.entity.JobLogDO;
|
|||||||
*/
|
*/
|
||||||
@Intercept(ignoreGlobal = true)
|
@Intercept(ignoreGlobal = true)
|
||||||
@Component
|
@Component
|
||||||
public interface JobLogMapper {
|
@Mapper
|
||||||
|
public interface JobLogMapper extends BaseMapper<JobLogDO> {
|
||||||
|
|
||||||
@Insert("insert into job_log(`job_id`,`handler`,`param`,`code`,`msg`,`alarm_status`,`create_time`) values(:jobId,:handler,:param,:code,:msg,:alarmStatus,:createTime)")
|
@Insert("insert into job_log(`job_id`,`handler`,`param`,`code`,`msg`,`alarm_status`,`create_time`) values(:jobId,:handler,:param,:code,:msg,:alarmStatus,:createTime)")
|
||||||
void add(JobLogDO jobLog);
|
void add(JobLogDO jobLog);
|
||||||
|
|
||||||
@ResultType(JobLogListRes.class)
|
@ResultType(JobLogListRes.class)
|
||||||
@Select("select * from job_log order by create_time desc")
|
@Select("select * from job_log order by create_time desc")
|
||||||
void page(Page page, JobLogListReq req);
|
void page(PageInfo pageInfo, JobLogListReq req);
|
||||||
|
|
||||||
@ResultType(JobLogListRes.class)
|
@ResultType(JobLogListRes.class)
|
||||||
@Select("select * from job_log where job_id = :jobId order by create_time desc")
|
@Select("select * from job_log where job_id = :jobId order by create_time desc")
|
||||||
void pageByJobId(Page page, JobLogListReq req);
|
void pageByJobId(PageInfo pageInfo, JobLogListReq req);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-7
@@ -21,6 +21,9 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal;
|
package fun.asgc.neutrino.proxy.server.dal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import fun.asgc.neutrino.core.annotation.Component;
|
import fun.asgc.neutrino.core.annotation.Component;
|
||||||
import fun.asgc.neutrino.core.annotation.Param;
|
import fun.asgc.neutrino.core.annotation.Param;
|
||||||
import fun.asgc.neutrino.core.aop.Intercept;
|
import fun.asgc.neutrino.core.aop.Intercept;
|
||||||
@@ -28,10 +31,11 @@ import fun.asgc.neutrino.core.db.annotation.Delete;
|
|||||||
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Select;
|
import fun.asgc.neutrino.core.db.annotation.Select;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Update;
|
import fun.asgc.neutrino.core.db.annotation.Update;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.core.db.page.PageInfo;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.LicenseListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.LicenseListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.LicenseListRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.LicenseListRes;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -44,14 +48,15 @@ import java.util.Set;
|
|||||||
*/
|
*/
|
||||||
@Intercept(ignoreGlobal = true)
|
@Intercept(ignoreGlobal = true)
|
||||||
@Component
|
@Component
|
||||||
public interface LicenseMapper {
|
@Mapper
|
||||||
|
public interface LicenseMapper extends BaseMapper<LicenseDO> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询license分页
|
* 查询license分页
|
||||||
* @param page
|
* @param pageInfo
|
||||||
* @param req
|
* @param req
|
||||||
*/
|
*/
|
||||||
void page(Page page, LicenseListReq req);
|
void page(PageInfo pageInfo, LicenseListReq req);
|
||||||
|
|
||||||
@ResultType(LicenseListRes.class)
|
@ResultType(LicenseListRes.class)
|
||||||
@Select("select * from license where enable = 1")
|
@Select("select * from license where enable = 1")
|
||||||
@@ -75,7 +80,13 @@ public interface LicenseMapper {
|
|||||||
void updateEnableStatus(@Param("id") Integer id, @Param("enable") Integer enable, @Param("updateTime") Date updateTime);
|
void updateEnableStatus(@Param("id") Integer id, @Param("enable") Integer enable, @Param("updateTime") Date updateTime);
|
||||||
|
|
||||||
@Update("update `license` set is_online = :isOnline, update_time = :updateTime where id = :id")
|
@Update("update `license` set is_online = :isOnline, update_time = :updateTime where id = :id")
|
||||||
void updateOnlineStatus(@Param("id") Integer id, @Param("isOnline") Integer isOnline, @Param("updateTime") Date updateTime);
|
default void updateOnlineStatus(@Param("id") Integer id, @Param("isOnline") Integer isOnline, @Param("updateTime") Date updateTime) {
|
||||||
|
this.update(null, new LambdaUpdateWrapper<LicenseDO>()
|
||||||
|
.eq(LicenseDO::getId, id)
|
||||||
|
.set(LicenseDO::getIsOnline, isOnline)
|
||||||
|
.set(LicenseDO::getUpdateTime, updateTime)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@Update("update `license` set is_online = :isOnline, update_time = :updateTime")
|
@Update("update `license` set is_online = :isOnline, update_time = :updateTime")
|
||||||
void updateOnlineStatus(@Param("isOnline") Integer isOnline, @Param("updateTime") Date updateTime);
|
void updateOnlineStatus(@Param("isOnline") Integer isOnline, @Param("updateTime") Date updateTime);
|
||||||
@@ -94,7 +105,9 @@ public interface LicenseMapper {
|
|||||||
|
|
||||||
@ResultType(LicenseDO.class)
|
@ResultType(LicenseDO.class)
|
||||||
@Select("select * from `license` where id in (:ids)")
|
@Select("select * from `license` where id in (:ids)")
|
||||||
List<LicenseDO> findByIds(@Param("ids")Set<Integer> ids);
|
default List<LicenseDO> findByIds(@Param("ids")Set<Integer> ids) {
|
||||||
|
return selectBatchIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
@ResultType(LicenseDO.class)
|
@ResultType(LicenseDO.class)
|
||||||
@Select("select * from `license` where user_id = :userId and name =:name limit 0,1")
|
@Select("select * from `license` where user_id = :userId and name =:name limit 0,1")
|
||||||
@@ -105,5 +118,9 @@ public interface LicenseMapper {
|
|||||||
LicenseDO checkRepeat(@Param("userId") Integer userId, @Param("name") String name, @Param("excludeIds") Set<Integer> excludeIds);
|
LicenseDO checkRepeat(@Param("userId") Integer userId, @Param("name") String name, @Param("excludeIds") Set<Integer> excludeIds);
|
||||||
|
|
||||||
@Select("select * from `license` where `key` = ?")
|
@Select("select * from `license` where `key` = ?")
|
||||||
LicenseDO findByKey(String licenseKey);
|
default LicenseDO findByKey(String licenseKey) {
|
||||||
|
return selectOne(new LambdaQueryWrapper<LicenseDO>()
|
||||||
|
.eq(LicenseDO::getKey, licenseKey)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-5
@@ -21,6 +21,9 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal;
|
package fun.asgc.neutrino.proxy.server.dal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import fun.asgc.neutrino.core.annotation.Component;
|
import fun.asgc.neutrino.core.annotation.Component;
|
||||||
import fun.asgc.neutrino.core.annotation.Param;
|
import fun.asgc.neutrino.core.annotation.Param;
|
||||||
import fun.asgc.neutrino.core.aop.Intercept;
|
import fun.asgc.neutrino.core.aop.Intercept;
|
||||||
@@ -28,10 +31,12 @@ import fun.asgc.neutrino.core.db.annotation.Delete;
|
|||||||
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Select;
|
import fun.asgc.neutrino.core.db.annotation.Select;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Update;
|
import fun.asgc.neutrino.core.db.annotation.Update;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.core.db.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.PortMappingListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.PortMappingListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.PortMappingListRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.PortMappingListRes;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortMappingDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.PortMappingDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -44,11 +49,12 @@ import java.util.Set;
|
|||||||
*/
|
*/
|
||||||
@Intercept(ignoreGlobal = true)
|
@Intercept(ignoreGlobal = true)
|
||||||
@Component
|
@Component
|
||||||
public interface PortMappingMapper {
|
@Mapper
|
||||||
|
public interface PortMappingMapper extends BaseMapper<PortMappingDO> {
|
||||||
|
|
||||||
@ResultType(PortMappingListRes.class)
|
@ResultType(PortMappingListRes.class)
|
||||||
@Select("select * from port_mapping")
|
@Select("select * from port_mapping")
|
||||||
void page(Page page, PortMappingListReq req);
|
void page(PageInfo pageInfo, PortMappingListReq req);
|
||||||
|
|
||||||
void add(PortMappingDO portMappingDO);
|
void add(PortMappingDO portMappingDO);
|
||||||
|
|
||||||
@@ -71,7 +77,12 @@ public interface PortMappingMapper {
|
|||||||
|
|
||||||
@ResultType(PortMappingDO.class)
|
@ResultType(PortMappingDO.class)
|
||||||
@Select("select * from port_mapping where license_id = ? and enable = 1")
|
@Select("select * from port_mapping where license_id = ? and enable = 1")
|
||||||
List<PortMappingDO> findEnableListByLicenseId(Integer licenseId);
|
default List<PortMappingDO> findEnableListByLicenseId(Integer licenseId) {
|
||||||
|
return this.selectList(new LambdaQueryWrapper<PortMappingDO>()
|
||||||
|
.eq(PortMappingDO::getLicenseId, licenseId)
|
||||||
|
.eq(PortMappingDO::getEnable, EnableStatusEnum.ENABLE.getStatus())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@ResultType(PortMappingDO.class)
|
@ResultType(PortMappingDO.class)
|
||||||
@Select("select * from port_mapping where server_port = :serverPort")
|
@Select("select * from port_mapping where server_port = :serverPort")
|
||||||
@@ -82,7 +93,14 @@ public interface PortMappingMapper {
|
|||||||
List<PortMappingDO> findListByLicenseId(Integer licenseId);
|
List<PortMappingDO> findListByLicenseId(Integer licenseId);
|
||||||
|
|
||||||
@Update("update `port_mapping` set is_online = :isOnline,update_time = :updateTime where license_id = :licenseId and server_port = :serverPort")
|
@Update("update `port_mapping` set is_online = :isOnline,update_time = :updateTime where license_id = :licenseId and server_port = :serverPort")
|
||||||
void updateOnlineStatus(@Param("licenseId") Integer licenseId, @Param("serverPort") Integer serverPort, @Param("isOnline") Integer isOnline, @Param("updateTime") Date updateTime);
|
default void updateOnlineStatus(@Param("licenseId") Integer licenseId, @Param("serverPort") Integer serverPort, @Param("isOnline") Integer isOnline, @Param("updateTime") Date updateTime) {
|
||||||
|
this.update(null, new LambdaUpdateWrapper<PortMappingDO>()
|
||||||
|
.eq(PortMappingDO::getLicenseId, licenseId)
|
||||||
|
.eq(PortMappingDO::getServerPort, serverPort)
|
||||||
|
.set(PortMappingDO::getIsOnline, isOnline)
|
||||||
|
.set(PortMappingDO::getUpdateTime, updateTime)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@Update("update `port_mapping` set is_online = :isOnline,update_time = :updateTime where license_id = :licenseId")
|
@Update("update `port_mapping` set is_online = :isOnline,update_time = :updateTime where license_id = :licenseId")
|
||||||
void updateOnlineStatus(@Param("licenseId") Integer licenseId, @Param("isOnline") Integer isOnline, @Param("updateTime") Date updateTime);
|
void updateOnlineStatus(@Param("licenseId") Integer licenseId, @Param("isOnline") Integer isOnline, @Param("updateTime") Date updateTime);
|
||||||
|
|||||||
+6
-3
@@ -21,14 +21,16 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal;
|
package fun.asgc.neutrino.proxy.server.dal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import fun.asgc.neutrino.core.annotation.Component;
|
import fun.asgc.neutrino.core.annotation.Component;
|
||||||
import fun.asgc.neutrino.core.annotation.Param;
|
import fun.asgc.neutrino.core.annotation.Param;
|
||||||
import fun.asgc.neutrino.core.aop.Intercept;
|
import fun.asgc.neutrino.core.aop.Intercept;
|
||||||
import fun.asgc.neutrino.core.db.annotation.*;
|
import fun.asgc.neutrino.core.db.annotation.*;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.core.db.page.PageInfo;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.PortPoolListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.PortPoolListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.PortPoolListRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.PortPoolListRes;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortPoolDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.PortPoolDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -40,11 +42,12 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Intercept(ignoreGlobal = true)
|
@Intercept(ignoreGlobal = true)
|
||||||
@Component
|
@Component
|
||||||
public interface PortPoolMapper {
|
@Mapper
|
||||||
|
public interface PortPoolMapper extends BaseMapper<PortPoolDO> {
|
||||||
|
|
||||||
@ResultType(PortPoolListRes.class)
|
@ResultType(PortPoolListRes.class)
|
||||||
@Select("select * from port_pool")
|
@Select("select * from port_pool")
|
||||||
void page(Page<PortPoolListRes> page, PortPoolListReq req);
|
void page(PageInfo<PortPoolListRes> pageInfo, PortPoolListReq req);
|
||||||
|
|
||||||
@ResultType(PortPoolListRes.class)
|
@ResultType(PortPoolListRes.class)
|
||||||
@Select("select * from port_pool where enable = 1")
|
@Select("select * from port_pool where enable = 1")
|
||||||
|
|||||||
+6
-3
@@ -21,15 +21,17 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal;
|
package fun.asgc.neutrino.proxy.server.dal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import fun.asgc.neutrino.core.annotation.Component;
|
import fun.asgc.neutrino.core.annotation.Component;
|
||||||
import fun.asgc.neutrino.core.aop.Intercept;
|
import fun.asgc.neutrino.core.aop.Intercept;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Insert;
|
import fun.asgc.neutrino.core.db.annotation.Insert;
|
||||||
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
import fun.asgc.neutrino.core.db.annotation.ResultType;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Select;
|
import fun.asgc.neutrino.core.db.annotation.Select;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.core.db.page.PageInfo;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.UserLoginRecordListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.UserLoginRecordListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.UserLoginRecordListRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.UserLoginRecordListRes;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserLoginRecordDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.UserLoginRecordDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -38,7 +40,8 @@ import fun.asgc.neutrino.proxy.server.dal.entity.UserLoginRecordDO;
|
|||||||
*/
|
*/
|
||||||
@Intercept(ignoreGlobal = true)
|
@Intercept(ignoreGlobal = true)
|
||||||
@Component
|
@Component
|
||||||
public interface UserLoginRecordMapper {
|
@Mapper
|
||||||
|
public interface UserLoginRecordMapper extends BaseMapper<UserLoginRecordDO> {
|
||||||
/**
|
/**
|
||||||
* 新增用户登录日志
|
* 新增用户登录日志
|
||||||
* @param userLoginRecord
|
* @param userLoginRecord
|
||||||
@@ -49,5 +52,5 @@ public interface UserLoginRecordMapper {
|
|||||||
|
|
||||||
@ResultType(UserLoginRecordListRes.class)
|
@ResultType(UserLoginRecordListRes.class)
|
||||||
@Select("select * from user_login_record order by create_time desc")
|
@Select("select * from user_login_record order by create_time desc")
|
||||||
void page(Page page, UserLoginRecordListReq req);
|
void page(PageInfo pageInfo, UserLoginRecordListReq req);
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-6
@@ -21,14 +21,17 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal;
|
package fun.asgc.neutrino.proxy.server.dal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import fun.asgc.neutrino.core.annotation.Component;
|
import fun.asgc.neutrino.core.annotation.Component;
|
||||||
import fun.asgc.neutrino.core.annotation.Param;
|
import fun.asgc.neutrino.core.annotation.Param;
|
||||||
import fun.asgc.neutrino.core.aop.Intercept;
|
import fun.asgc.neutrino.core.aop.Intercept;
|
||||||
import fun.asgc.neutrino.core.db.annotation.*;
|
import fun.asgc.neutrino.core.db.annotation.*;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.core.db.page.PageInfo;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.UserListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.UserListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.UserListRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.UserListRes;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -41,7 +44,8 @@ import java.util.Set;
|
|||||||
*/
|
*/
|
||||||
@Intercept(ignoreGlobal = true)
|
@Intercept(ignoreGlobal = true)
|
||||||
@Component
|
@Component
|
||||||
public interface UserMapper {
|
@Mapper
|
||||||
|
public interface UserMapper extends BaseMapper<UserDO> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据登录名查询用户记录
|
* 根据登录名查询用户记录
|
||||||
@@ -49,7 +53,12 @@ public interface UserMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Select("select * from user where login_name = ?")
|
@Select("select * from user where login_name = ?")
|
||||||
UserDO findByLoginName(String loginName);
|
default UserDO findByLoginName(String loginName) {
|
||||||
|
return selectOne(new LambdaQueryWrapper<UserDO>()
|
||||||
|
.eq(UserDO::getLoginName, loginName)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询单条记录
|
* 根据id查询单条记录
|
||||||
@@ -57,15 +66,19 @@ public interface UserMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Select("select * from user where id = ?")
|
@Select("select * from user where id = ?")
|
||||||
UserDO findById(Integer id);
|
default UserDO findById(Integer id) {
|
||||||
|
return selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
@ResultType(UserDO.class)
|
@ResultType(UserDO.class)
|
||||||
@Select("select * from user where id in (:ids)")
|
@Select("select * from user where id in (:ids)")
|
||||||
List<UserDO> findByIds(@Param("ids") Set<Integer> ids);
|
default List<UserDO> findByIds(@Param("ids") Set<Integer> ids) {
|
||||||
|
return selectBatchIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
@ResultType(UserListRes.class)
|
@ResultType(UserListRes.class)
|
||||||
@Select("select * from user")
|
@Select("select * from user")
|
||||||
void page(Page page, UserListReq req);
|
void page(PageInfo pageInfo, UserListReq req);
|
||||||
|
|
||||||
@ResultType(UserListRes.class)
|
@ResultType(UserListRes.class)
|
||||||
@Select("select * from user where enable = 1")
|
@Select("select * from user where enable = 1")
|
||||||
|
|||||||
+4
-2
@@ -3,8 +3,9 @@ package fun.asgc.neutrino.proxy.server.dal;
|
|||||||
import fun.asgc.neutrino.core.annotation.Component;
|
import fun.asgc.neutrino.core.annotation.Component;
|
||||||
import fun.asgc.neutrino.core.annotation.Param;
|
import fun.asgc.neutrino.core.annotation.Param;
|
||||||
import fun.asgc.neutrino.core.aop.Intercept;
|
import fun.asgc.neutrino.core.aop.Intercept;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.core.db.page.PageInfo;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.UserFlowReportRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.UserFlowReportRes;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -14,8 +15,9 @@ import java.util.Date;
|
|||||||
*/
|
*/
|
||||||
@Intercept(ignoreGlobal = true)
|
@Intercept(ignoreGlobal = true)
|
||||||
@Component
|
@Component
|
||||||
|
@Mapper
|
||||||
public interface UserReportMapper {
|
public interface UserReportMapper {
|
||||||
|
|
||||||
void userFlowReportPage(Page<UserFlowReportRes> page, @Param("todayBegin") Date todayBegin, @Param("todayEnd") Date todayEnd);
|
void userFlowReportPage(PageInfo<UserFlowReportRes> pageInfo, @Param("todayBegin") Date todayBegin, @Param("todayEnd") Date todayEnd);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-3
@@ -21,12 +21,16 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal;
|
package fun.asgc.neutrino.proxy.server.dal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import fun.asgc.neutrino.core.annotation.Component;
|
import fun.asgc.neutrino.core.annotation.Component;
|
||||||
import fun.asgc.neutrino.core.annotation.Param;
|
import fun.asgc.neutrino.core.annotation.Param;
|
||||||
import fun.asgc.neutrino.core.aop.Intercept;
|
import fun.asgc.neutrino.core.aop.Intercept;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Delete;
|
import fun.asgc.neutrino.core.db.annotation.Delete;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Update;
|
import fun.asgc.neutrino.core.db.annotation.Update;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserTokenDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.UserTokenDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -37,7 +41,8 @@ import java.util.Date;
|
|||||||
*/
|
*/
|
||||||
@Intercept(ignoreGlobal = true)
|
@Intercept(ignoreGlobal = true)
|
||||||
@Component
|
@Component
|
||||||
public interface UserTokenMapper {
|
@Mapper
|
||||||
|
public interface UserTokenMapper extends BaseMapper<UserTokenDO> {
|
||||||
/**
|
/**
|
||||||
* 新增用户token
|
* 新增用户token
|
||||||
* 支持注解 + xml配置2种方式
|
* 支持注解 + xml配置2种方式
|
||||||
@@ -55,7 +60,12 @@ public interface UserTokenMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
// @Select("select * from user_token where token = ? and expiration_time > ?")
|
// @Select("select * from user_token where token = ? and expiration_time > ?")
|
||||||
UserTokenDO findByAvailableToken(String token, Date date);
|
default UserTokenDO findByAvailableToken(String token, Date date) {
|
||||||
|
return selectOne(new LambdaQueryWrapper<UserTokenDO>()
|
||||||
|
.eq(UserTokenDO::getToken, token)
|
||||||
|
.gt(UserTokenDO::getExpirationTime, date)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据token删除记录
|
* 根据token删除记录
|
||||||
@@ -65,7 +75,12 @@ public interface UserTokenMapper {
|
|||||||
void deleteByToken(String token);
|
void deleteByToken(String token);
|
||||||
|
|
||||||
@Update("update user_token set expiration_time = :expirationTime where token = :token")
|
@Update("update user_token set expiration_time = :expirationTime where token = :token")
|
||||||
void updateTokenExpirationTime(@Param("token") String token, @Param("expirationTime") Date expirationTime);
|
default void updateTokenExpirationTime(@Param("token") String token, @Param("expirationTime") Date expirationTime) {
|
||||||
|
update(null, new LambdaUpdateWrapper<UserTokenDO>()
|
||||||
|
.eq(UserTokenDO::getToken, token)
|
||||||
|
.set(UserTokenDO::getExpirationTime, expirationTime)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据userId删除token
|
* 根据userId删除token
|
||||||
|
|||||||
+4
@@ -1,5 +1,7 @@
|
|||||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Id;
|
import fun.asgc.neutrino.core.db.annotation.Id;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Table;
|
import fun.asgc.neutrino.core.db.annotation.Table;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -16,8 +18,10 @@ import java.util.Date;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Data
|
@Data
|
||||||
@Table("client_connect_record")
|
@Table("client_connect_record")
|
||||||
|
@TableName("client_connect_record")
|
||||||
public class ClientConnectRecordDO {
|
public class ClientConnectRecordDO {
|
||||||
@Id
|
@Id
|
||||||
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private String ip;
|
private String ip;
|
||||||
private Integer licenseId;
|
private Integer licenseId;
|
||||||
|
|||||||
+4
@@ -21,6 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Id;
|
import fun.asgc.neutrino.core.db.annotation.Id;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Table;
|
import fun.asgc.neutrino.core.db.annotation.Table;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -37,8 +39,10 @@ import java.util.Date;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Data
|
@Data
|
||||||
@Table("flow_report_day")
|
@Table("flow_report_day")
|
||||||
|
@TableName("flow_report_day")
|
||||||
public class FlowReportDayDO {
|
public class FlowReportDayDO {
|
||||||
@Id
|
@Id
|
||||||
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
|
|||||||
+2
@@ -21,6 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Id;
|
import fun.asgc.neutrino.core.db.annotation.Id;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Table;
|
import fun.asgc.neutrino.core.db.annotation.Table;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -39,6 +40,7 @@ import java.util.Date;
|
|||||||
@Table("flow_report_hour")
|
@Table("flow_report_hour")
|
||||||
public class FlowReportHourDO {
|
public class FlowReportHourDO {
|
||||||
@Id
|
@Id
|
||||||
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
|
|||||||
+4
@@ -21,6 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Id;
|
import fun.asgc.neutrino.core.db.annotation.Id;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Table;
|
import fun.asgc.neutrino.core.db.annotation.Table;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -37,8 +39,10 @@ import java.util.Date;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Data
|
@Data
|
||||||
@Table("flow_report_minute")
|
@Table("flow_report_minute")
|
||||||
|
@TableName("flow_report_minute")
|
||||||
public class FlowReportMinuteDO {
|
public class FlowReportMinuteDO {
|
||||||
@Id
|
@Id
|
||||||
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
|
|||||||
+4
@@ -21,6 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Id;
|
import fun.asgc.neutrino.core.db.annotation.Id;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Table;
|
import fun.asgc.neutrino.core.db.annotation.Table;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -37,8 +39,10 @@ import java.util.Date;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Data
|
@Data
|
||||||
@Table("flow_report_month")
|
@Table("flow_report_month")
|
||||||
|
@TableName("flow_report_month")
|
||||||
public class FlowReportMonthDO {
|
public class FlowReportMonthDO {
|
||||||
@Id
|
@Id
|
||||||
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
|
|||||||
+4
@@ -21,6 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Id;
|
import fun.asgc.neutrino.core.db.annotation.Id;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Table;
|
import fun.asgc.neutrino.core.db.annotation.Table;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -38,8 +40,10 @@ import java.util.Date;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Data
|
@Data
|
||||||
@Table("job_info")
|
@Table("job_info")
|
||||||
|
@TableName("job_info")
|
||||||
public class JobInfoDO {
|
public class JobInfoDO {
|
||||||
@Id
|
@Id
|
||||||
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private String cron;
|
private String cron;
|
||||||
private String desc;
|
private String desc;
|
||||||
|
|||||||
+4
-2
@@ -21,7 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.annotation.Autowired;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Table;
|
import fun.asgc.neutrino.core.db.annotation.Table;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
@@ -38,8 +39,9 @@ import java.util.Date;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Data
|
@Data
|
||||||
@Table("job_log")
|
@Table("job_log")
|
||||||
|
@TableName("job_log")
|
||||||
public class JobLogDO {
|
public class JobLogDO {
|
||||||
@Autowired
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private Integer jobId;
|
private Integer jobId;
|
||||||
private String handler;
|
private String handler;
|
||||||
|
|||||||
+4
@@ -21,6 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Id;
|
import fun.asgc.neutrino.core.db.annotation.Id;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Table;
|
import fun.asgc.neutrino.core.db.annotation.Table;
|
||||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||||
@@ -39,8 +41,10 @@ import java.util.Date;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Data
|
@Data
|
||||||
@Table("license")
|
@Table("license")
|
||||||
|
@TableName("license")
|
||||||
public class LicenseDO {
|
public class LicenseDO {
|
||||||
@Id
|
@Id
|
||||||
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* 名称
|
* 名称
|
||||||
|
|||||||
+4
@@ -21,6 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Id;
|
import fun.asgc.neutrino.core.db.annotation.Id;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Table;
|
import fun.asgc.neutrino.core.db.annotation.Table;
|
||||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||||
@@ -39,8 +41,10 @@ import java.util.Date;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Data
|
@Data
|
||||||
@Table("port_mapping")
|
@Table("port_mapping")
|
||||||
|
@TableName("port_mapping")
|
||||||
public class PortMappingDO {
|
public class PortMappingDO {
|
||||||
@Id
|
@Id
|
||||||
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* licenseId
|
* licenseId
|
||||||
|
|||||||
+4
@@ -21,6 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Id;
|
import fun.asgc.neutrino.core.db.annotation.Id;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Table;
|
import fun.asgc.neutrino.core.db.annotation.Table;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -38,8 +40,10 @@ import java.util.Date;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Data
|
@Data
|
||||||
@Table("port_pool")
|
@Table("port_pool")
|
||||||
|
@TableName("port_pool")
|
||||||
public class PortPoolDO {
|
public class PortPoolDO {
|
||||||
@Id
|
@Id
|
||||||
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* 端口
|
* 端口
|
||||||
|
|||||||
+4
@@ -21,6 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Id;
|
import fun.asgc.neutrino.core.db.annotation.Id;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Table;
|
import fun.asgc.neutrino.core.db.annotation.Table;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -36,8 +38,10 @@ import java.util.Date;
|
|||||||
@ToString
|
@ToString
|
||||||
@Data
|
@Data
|
||||||
@Table("user")
|
@Table("user")
|
||||||
|
@TableName("user")
|
||||||
public class UserDO {
|
public class UserDO {
|
||||||
@Id
|
@Id
|
||||||
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* 用户名
|
* 用户名
|
||||||
|
|||||||
+4
@@ -12,6 +12,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Id;
|
import fun.asgc.neutrino.core.db.annotation.Id;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Table;
|
import fun.asgc.neutrino.core.db.annotation.Table;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -29,6 +31,7 @@ import java.util.Date;
|
|||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Table("user_login_record")
|
@Table("user_login_record")
|
||||||
|
@TableName("user_login_record")
|
||||||
public class UserLoginRecordDO {
|
public class UserLoginRecordDO {
|
||||||
/**
|
/**
|
||||||
* 类型 - 登录
|
* 类型 - 登录
|
||||||
@@ -40,6 +43,7 @@ public class UserLoginRecordDO {
|
|||||||
public static final Integer TYPE_LOGOUT = 2;
|
public static final Integer TYPE_LOGOUT = 2;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
|
|||||||
+4
@@ -21,6 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Id;
|
import fun.asgc.neutrino.core.db.annotation.Id;
|
||||||
import fun.asgc.neutrino.core.db.annotation.Table;
|
import fun.asgc.neutrino.core.db.annotation.Table;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -38,9 +40,11 @@ import java.util.Date;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Data
|
@Data
|
||||||
@Table("user_token")
|
@Table("user_token")
|
||||||
|
@TableName("user_token")
|
||||||
public class UserTokenDO {
|
public class UserTokenDO {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* token
|
* token
|
||||||
|
|||||||
+22
-15
@@ -21,9 +21,13 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.service;
|
package fun.asgc.neutrino.proxy.server.service;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import fun.asgc.neutrino.core.util.CollectionUtil;
|
import fun.asgc.neutrino.core.util.CollectionUtil;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.ClientConnectRecordListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.ClientConnectRecordListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.ClientConnectRecordListRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.ClientConnectRecordListRes;
|
||||||
@@ -34,6 +38,7 @@ import fun.asgc.neutrino.proxy.server.dal.entity.ClientConnectRecordDO;
|
|||||||
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import ma.glasnost.orika.MapperFactory;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
import org.noear.solon.annotation.Inject;
|
import org.noear.solon.annotation.Inject;
|
||||||
|
|
||||||
@@ -50,6 +55,8 @@ import java.util.stream.Collectors;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class ClientConnectRecordService {
|
public class ClientConnectRecordService {
|
||||||
|
@Inject
|
||||||
|
private MapperFactory mapperFactory;
|
||||||
@Inject
|
@Inject
|
||||||
private ClientConnectRecordMapper clientConnectRecordMapper;
|
private ClientConnectRecordMapper clientConnectRecordMapper;
|
||||||
@Inject
|
@Inject
|
||||||
@@ -58,29 +65,29 @@ public class ClientConnectRecordService {
|
|||||||
private UserMapper userMapper;
|
private UserMapper userMapper;
|
||||||
|
|
||||||
public void add(ClientConnectRecordDO clientConnectRecordDO) {
|
public void add(ClientConnectRecordDO clientConnectRecordDO) {
|
||||||
clientConnectRecordMapper.add(clientConnectRecordDO);
|
clientConnectRecordMapper.insert(clientConnectRecordDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page<ClientConnectRecordListRes> page(PageQuery pageQuery, ClientConnectRecordListReq req) {
|
public PageInfo<ClientConnectRecordListRes> page(PageQuery pageQuery, ClientConnectRecordListReq req) {
|
||||||
Page<ClientConnectRecordListRes> page = Page.create(pageQuery);
|
Page<ClientConnectRecordListRes> result = PageHelper.startPage(pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
clientConnectRecordMapper.page(page, req);
|
List<ClientConnectRecordDO> list = clientConnectRecordMapper.selectList(new LambdaQueryWrapper<ClientConnectRecordDO>()
|
||||||
if (CollectionUtil.isEmpty(page.getRecords())) {
|
.orderByDesc(ClientConnectRecordDO::getId)
|
||||||
return page;
|
);
|
||||||
}
|
List<ClientConnectRecordListRes> respList = mapperFactory.getMapperFacade().mapAsList(list, ClientConnectRecordListRes.class);
|
||||||
Set<Integer> licenseIds = page.getRecords().stream().map(ClientConnectRecordListRes::getLicenseId).collect(Collectors.toSet());
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
if (CollectionUtil.isEmpty(licenseIds)) {
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
return page;
|
|
||||||
}
|
}
|
||||||
|
Set<Integer> licenseIds = respList.stream().map(ClientConnectRecordListRes::getLicenseId).collect(Collectors.toSet());
|
||||||
List<LicenseDO> licenseList = licenseMapper.findByIds(licenseIds);
|
List<LicenseDO> licenseList = licenseMapper.findByIds(licenseIds);
|
||||||
if (CollectionUtil.isEmpty(licenseList)) {
|
if (CollectionUtil.isEmpty(licenseList)) {
|
||||||
return page;
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
}
|
}
|
||||||
Set<Integer> userIds = licenseList.stream().map(LicenseDO::getUserId).collect(Collectors.toSet());
|
Set<Integer> userIds = licenseList.stream().map(LicenseDO::getUserId).collect(Collectors.toSet());
|
||||||
List<UserDO> userList = userMapper.findByIds(userIds);
|
List<UserDO> userList = userMapper.findByIds(userIds);
|
||||||
Map<Integer, LicenseDO> licenseMap = licenseList.stream().collect(Collectors.toMap(LicenseDO::getId, Function.identity()));
|
Map<Integer, LicenseDO> licenseMap = licenseList.stream().collect(Collectors.toMap(LicenseDO::getId, Function.identity()));
|
||||||
Map<Integer, UserDO> userMap = userList.stream().collect(Collectors.toMap(UserDO::getId, Function.identity()));
|
Map<Integer, UserDO> userMap = userList.stream().collect(Collectors.toMap(UserDO::getId, Function.identity()));
|
||||||
boolean isAdmin = SystemContextHolder.isAdmin();
|
boolean isAdmin = SystemContextHolder.isAdmin();
|
||||||
page.getRecords().forEach(item -> {
|
respList.forEach(item -> {
|
||||||
LicenseDO license = licenseMap.get(item.getLicenseId());
|
LicenseDO license = licenseMap.get(item.getLicenseId());
|
||||||
if (null == license) {
|
if (null == license) {
|
||||||
return;
|
return;
|
||||||
@@ -97,6 +104,6 @@ public class ClientConnectRecordService {
|
|||||||
item.setMsg("******");
|
item.setMsg("******");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return page;
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-6
@@ -21,10 +21,13 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.service;
|
package fun.asgc.neutrino.proxy.server.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
|
||||||
import fun.asgc.neutrino.core.util.CollectionUtil;
|
import fun.asgc.neutrino.core.util.CollectionUtil;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.base.quartz.IJobSource;
|
import fun.asgc.neutrino.proxy.server.base.quartz.IJobSource;
|
||||||
import fun.asgc.neutrino.proxy.server.base.quartz.JobExecutor;
|
import fun.asgc.neutrino.proxy.server.base.quartz.JobExecutor;
|
||||||
import fun.asgc.neutrino.proxy.server.base.quartz.JobInfo;
|
import fun.asgc.neutrino.proxy.server.base.quartz.JobInfo;
|
||||||
@@ -42,6 +45,7 @@ import fun.asgc.neutrino.proxy.server.dal.JobInfoMapper;
|
|||||||
import fun.asgc.neutrino.proxy.server.dal.entity.JobInfoDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.JobInfoDO;
|
||||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import ma.glasnost.orika.MapperFactory;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
import org.noear.solon.annotation.Inject;
|
import org.noear.solon.annotation.Inject;
|
||||||
@@ -57,13 +61,18 @@ import java.util.List;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class JobInfoService implements IJobSource {
|
public class JobInfoService implements IJobSource {
|
||||||
|
@Inject
|
||||||
|
private MapperFactory mapperFactory;
|
||||||
@Inject
|
@Inject
|
||||||
private JobInfoMapper jobInfoMapper;
|
private JobInfoMapper jobInfoMapper;
|
||||||
|
|
||||||
public Page<JobInfoListRes> page(PageQuery pageQuery, JobInfoListReq req) {
|
public PageInfo<JobInfoListRes> page(PageQuery pageQuery, JobInfoListReq req) {
|
||||||
Page<JobInfoListRes> page = Page.create(pageQuery);
|
Page<JobInfoListRes> result = PageHelper.startPage(pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
jobInfoMapper.page(page, req);
|
List<JobInfoDO> list = jobInfoMapper.selectList(new LambdaQueryWrapper<JobInfoDO>()
|
||||||
return page;
|
.orderByAsc(JobInfoDO::getId)
|
||||||
|
);
|
||||||
|
List<JobInfoListRes> respList = mapperFactory.getMapperFacade().mapAsList(list, JobInfoListRes.class);
|
||||||
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<JobInfoDO> findList() {
|
public List<JobInfoDO> findList() {
|
||||||
|
|||||||
+17
-11
@@ -21,8 +21,11 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.service;
|
package fun.asgc.neutrino.proxy.server.service;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.base.quartz.IJobCallback;
|
import fun.asgc.neutrino.proxy.server.base.quartz.IJobCallback;
|
||||||
import fun.asgc.neutrino.proxy.server.base.quartz.JobInfo;
|
import fun.asgc.neutrino.proxy.server.base.quartz.JobInfo;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.JobLogListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.JobLogListReq;
|
||||||
@@ -30,11 +33,13 @@ import fun.asgc.neutrino.proxy.server.controller.res.JobLogListRes;
|
|||||||
import fun.asgc.neutrino.proxy.server.dal.JobLogMapper;
|
import fun.asgc.neutrino.proxy.server.dal.JobLogMapper;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.JobLogDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.JobLogDO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import ma.glasnost.orika.MapperFactory;
|
||||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
import org.noear.solon.annotation.Inject;
|
import org.noear.solon.annotation.Inject;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -44,6 +49,8 @@ import java.util.Date;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class JobLogService implements IJobCallback {
|
public class JobLogService implements IJobCallback {
|
||||||
|
@Inject
|
||||||
|
private MapperFactory mapperFactory;
|
||||||
@Inject
|
@Inject
|
||||||
private JobLogMapper jobLogMapper;
|
private JobLogMapper jobLogMapper;
|
||||||
|
|
||||||
@@ -70,15 +77,14 @@ public class JobLogService implements IJobCallback {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page<JobLogListRes> page(PageQuery pageQuery, JobLogListReq req) {
|
public PageInfo<JobLogListRes> page(PageQuery pageQuery, JobLogListReq req) {
|
||||||
Page<JobLogListRes> page = Page.create(pageQuery);
|
Page<JobLogListRes> result = PageHelper.startPage(pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
|
List<JobLogDO> list = jobLogMapper.selectList(new LambdaQueryWrapper<JobLogDO>()
|
||||||
if(req.getJobId() != null && req.getJobId() > 0){
|
.eq(null != req.getJobId(), JobLogDO::getJobId, req.getJobId())
|
||||||
jobLogMapper.pageByJobId(page, req);
|
.orderByDesc(JobLogDO::getId)
|
||||||
} else {
|
);
|
||||||
jobLogMapper.page(page, req);
|
List<JobLogListRes> respList = mapperFactory.getMapperFacade().mapAsList(list, JobLogListRes.class);
|
||||||
}
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
return page;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-10
@@ -21,10 +21,14 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.service;
|
package fun.asgc.neutrino.proxy.server.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
|
||||||
import fun.asgc.neutrino.core.util.CollectionUtil;
|
import fun.asgc.neutrino.core.util.CollectionUtil;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
||||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||||
@@ -39,6 +43,7 @@ import fun.asgc.neutrino.proxy.server.dal.UserMapper;
|
|||||||
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||||
|
import ma.glasnost.orika.MapperFactory;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
import org.noear.solon.annotation.Inject;
|
import org.noear.solon.annotation.Inject;
|
||||||
import org.noear.solon.core.Lifecycle;
|
import org.noear.solon.core.Lifecycle;
|
||||||
@@ -54,7 +59,8 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class LicenseService implements Lifecycle {
|
public class LicenseService implements Lifecycle {
|
||||||
|
@Inject
|
||||||
|
private MapperFactory mapperFactory;
|
||||||
@Inject
|
@Inject
|
||||||
private LicenseMapper licenseMapper;
|
private LicenseMapper licenseMapper;
|
||||||
@Inject
|
@Inject
|
||||||
@@ -62,14 +68,20 @@ public class LicenseService implements Lifecycle {
|
|||||||
@Inject
|
@Inject
|
||||||
private VisitorChannelService visitorChannelService;
|
private VisitorChannelService visitorChannelService;
|
||||||
|
|
||||||
public Page<LicenseListRes> page(PageQuery pageQuery, LicenseListReq req) {
|
public PageInfo<LicenseListRes> page(PageQuery pageQuery, LicenseListReq req) {
|
||||||
Page<LicenseListRes> page = Page.create(pageQuery);
|
Page<LicenseListRes> result = PageHelper.startPage(pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
licenseMapper.page(page, req);
|
List<LicenseDO> list = licenseMapper.selectList(new LambdaQueryWrapper<LicenseDO>()
|
||||||
if (!CollectionUtil.isEmpty(page.getRecords())) {
|
.orderByAsc(LicenseDO::getId)
|
||||||
Set<Integer> userIds = page.getRecords().stream().map(LicenseListRes::getUserId).collect(Collectors.toSet());
|
);
|
||||||
|
List<LicenseListRes> respList = mapperFactory.getMapperFacade().mapAsList(list, LicenseListRes.class);
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
|
}
|
||||||
|
if (!CollectionUtil.isEmpty(respList)) {
|
||||||
|
Set<Integer> userIds = respList.stream().map(LicenseListRes::getUserId).collect(Collectors.toSet());
|
||||||
List<UserDO> userList = userMapper.findByIds(userIds);
|
List<UserDO> userList = userMapper.findByIds(userIds);
|
||||||
Map<Integer, UserDO> userMap = userList.stream().collect(Collectors.toMap(UserDO::getId, Function.identity()));
|
Map<Integer, UserDO> userMap = userList.stream().collect(Collectors.toMap(UserDO::getId, Function.identity()));
|
||||||
for (LicenseListRes item : page.getRecords()) {
|
for (LicenseListRes item : respList) {
|
||||||
UserDO userDO = userMap.get(item.getUserId());
|
UserDO userDO = userMap.get(item.getUserId());
|
||||||
if (null != userDO) {
|
if (null != userDO) {
|
||||||
item.setUserName(userDO.getName());
|
item.setUserName(userDO.getName());
|
||||||
@@ -77,7 +89,7 @@ public class LicenseService implements Lifecycle {
|
|||||||
item.setKey(desensitization(item.getUserId(), item.getKey()));
|
item.setKey(desensitization(item.getUserId(), item.getKey()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return page;
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<LicenseListRes> list(LicenseListReq req) {
|
public List<LicenseListRes> list(LicenseListReq req) {
|
||||||
|
|||||||
+21
-14
@@ -21,10 +21,14 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.service;
|
package fun.asgc.neutrino.proxy.server.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
|
||||||
import fun.asgc.neutrino.core.util.CollectionUtil;
|
import fun.asgc.neutrino.core.util.CollectionUtil;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
||||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||||
@@ -43,6 +47,7 @@ import fun.asgc.neutrino.proxy.server.dal.entity.PortMappingDO;
|
|||||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortPoolDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.PortPoolDO;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||||
|
import ma.glasnost.orika.MapperFactory;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
import org.noear.solon.annotation.Inject;
|
import org.noear.solon.annotation.Inject;
|
||||||
import org.noear.solon.core.Lifecycle;
|
import org.noear.solon.core.Lifecycle;
|
||||||
@@ -61,6 +66,8 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class PortMappingService implements Lifecycle {
|
public class PortMappingService implements Lifecycle {
|
||||||
|
@Inject
|
||||||
|
private MapperFactory mapperFactory;
|
||||||
@Inject
|
@Inject
|
||||||
private PortMappingMapper portMappingMapper;
|
private PortMappingMapper portMappingMapper;
|
||||||
@Inject
|
@Inject
|
||||||
@@ -72,25 +79,25 @@ public class PortMappingService implements Lifecycle {
|
|||||||
@Inject
|
@Inject
|
||||||
private VisitorChannelService visitorChannelService;
|
private VisitorChannelService visitorChannelService;
|
||||||
|
|
||||||
public Page<PortMappingListRes> page(PageQuery pageQuery, PortMappingListReq req) {
|
public PageInfo<PortMappingListRes> page(PageQuery pageQuery, PortMappingListReq req) {
|
||||||
Page<PortMappingListRes> page = Page.create(pageQuery);
|
Page<PortMappingListRes> result = PageHelper.startPage(pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
portMappingMapper.page(page, req);
|
List<PortMappingDO> list = portMappingMapper.selectList(new LambdaQueryWrapper<PortMappingDO>()
|
||||||
if (CollectionUtil.isEmpty(page.getRecords())) {
|
.orderByAsc(PortMappingDO::getId)
|
||||||
return page;
|
);
|
||||||
}
|
List<PortMappingListRes> respList = mapperFactory.getMapperFacade().mapAsList(list, PortMappingListRes.class);
|
||||||
Set<Integer> licenseIds = page.getRecords().stream().map(PortMappingListRes::getLicenseId).collect(Collectors.toSet());
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
if (CollectionUtil.isEmpty(licenseIds)) {
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
return page;
|
|
||||||
}
|
}
|
||||||
|
Set<Integer> licenseIds = respList.stream().map(PortMappingListRes::getLicenseId).collect(Collectors.toSet());
|
||||||
List<LicenseDO> licenseList = licenseMapper.findByIds(licenseIds);
|
List<LicenseDO> licenseList = licenseMapper.findByIds(licenseIds);
|
||||||
if (CollectionUtil.isEmpty(licenseList)) {
|
if (CollectionUtil.isEmpty(licenseList)) {
|
||||||
return page;
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
}
|
}
|
||||||
Set<Integer> userIds = licenseList.stream().map(LicenseDO::getUserId).collect(Collectors.toSet());
|
Set<Integer> userIds = licenseList.stream().map(LicenseDO::getUserId).collect(Collectors.toSet());
|
||||||
List<UserDO> userList = userMapper.findByIds(userIds);
|
List<UserDO> userList = userMapper.findByIds(userIds);
|
||||||
Map<Integer, LicenseDO> licenseMap = licenseList.stream().collect(Collectors.toMap(LicenseDO::getId, Function.identity()));
|
Map<Integer, LicenseDO> licenseMap = licenseList.stream().collect(Collectors.toMap(LicenseDO::getId, Function.identity()));
|
||||||
Map<Integer, UserDO> userMap = userList.stream().collect(Collectors.toMap(UserDO::getId, Function.identity()));
|
Map<Integer, UserDO> userMap = userList.stream().collect(Collectors.toMap(UserDO::getId, Function.identity()));
|
||||||
page.getRecords().forEach(item -> {
|
respList.forEach(item -> {
|
||||||
LicenseDO license = licenseMap.get(item.getLicenseId());
|
LicenseDO license = licenseMap.get(item.getLicenseId());
|
||||||
if (null == license) {
|
if (null == license) {
|
||||||
return;
|
return;
|
||||||
@@ -103,7 +110,7 @@ public class PortMappingService implements Lifecycle {
|
|||||||
}
|
}
|
||||||
item.setUserName(user.getName());
|
item.setUserName(user.getName());
|
||||||
});
|
});
|
||||||
return page;
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
public PortMappingCreateRes create(PortMappingCreateReq req) {
|
public PortMappingCreateRes create(PortMappingCreateReq req) {
|
||||||
|
|||||||
+15
-7
@@ -21,8 +21,11 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.service;
|
package fun.asgc.neutrino.proxy.server.service;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.PortPoolCreateReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.PortPoolCreateReq;
|
||||||
@@ -34,6 +37,7 @@ import fun.asgc.neutrino.proxy.server.controller.res.PortPoolUpdateEnableStatusR
|
|||||||
import fun.asgc.neutrino.proxy.server.dal.PortPoolMapper;
|
import fun.asgc.neutrino.proxy.server.dal.PortPoolMapper;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortPoolDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.PortPoolDO;
|
||||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||||
|
import ma.glasnost.orika.MapperFactory;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
import org.noear.solon.annotation.Inject;
|
import org.noear.solon.annotation.Inject;
|
||||||
|
|
||||||
@@ -47,16 +51,20 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class PortPoolService {
|
public class PortPoolService {
|
||||||
|
@Inject
|
||||||
|
private MapperFactory mapperFactory;
|
||||||
@Inject
|
@Inject
|
||||||
private PortPoolMapper portPoolMapper;
|
private PortPoolMapper portPoolMapper;
|
||||||
@Inject
|
@Inject
|
||||||
private VisitorChannelService visitorChannelService;
|
private VisitorChannelService visitorChannelService;
|
||||||
|
|
||||||
public Page<PortPoolListRes> page(PageQuery pageQuery, PortPoolListReq req) {
|
public PageInfo<PortPoolListRes> page(PageQuery pageQuery, PortPoolListReq req) {
|
||||||
Page<PortPoolListRes> page = Page.create(pageQuery);
|
Page<PortPoolListRes> result = PageHelper.startPage(pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
portPoolMapper.page(page, req);
|
List<PortPoolDO> list = portPoolMapper.selectList(new LambdaQueryWrapper<PortPoolDO>()
|
||||||
return page;
|
.orderByAsc(PortPoolDO::getId)
|
||||||
|
);
|
||||||
|
List<PortPoolListRes> respList = mapperFactory.getMapperFacade().mapAsList(list, PortPoolListRes.class);
|
||||||
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PortPoolListRes> list(PortPoolListReq req) {
|
public List<PortPoolListRes> list(PortPoolListReq req) {
|
||||||
|
|||||||
+3
-3
@@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.service;
|
package fun.asgc.neutrino.proxy.server.service;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import fun.asgc.neutrino.core.db.page.PageInfo;
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
import fun.asgc.neutrino.core.db.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.LicenseFlowReportReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.LicenseFlowReportReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.UserFlowReportReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.UserFlowReportReq;
|
||||||
@@ -48,7 +48,7 @@ public class ReportService {
|
|||||||
* @param req
|
* @param req
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Page<UserFlowReportRes> userFlowReportPage(PageQuery pageQuery, UserFlowReportReq req) {
|
public PageInfo<UserFlowReportRes> userFlowReportPage(PageQuery pageQuery, UserFlowReportReq req) {
|
||||||
// TODO
|
// TODO
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ public class ReportService {
|
|||||||
* @param req
|
* @param req
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Page<LicenseFlowReportRes> licenseFlowReportPage(PageQuery pageQuery, LicenseFlowReportReq req) {
|
public PageInfo<LicenseFlowReportRes> licenseFlowReportPage(PageQuery pageQuery, LicenseFlowReportReq req) {
|
||||||
// TODO
|
// TODO
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-9
@@ -21,14 +21,20 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.service;
|
package fun.asgc.neutrino.proxy.server.service;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import fun.asgc.neutrino.core.util.CollectionUtil;
|
import fun.asgc.neutrino.core.util.CollectionUtil;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.req.UserLoginRecordListReq;
|
import fun.asgc.neutrino.proxy.server.controller.req.UserLoginRecordListReq;
|
||||||
import fun.asgc.neutrino.proxy.server.controller.res.UserLoginRecordListRes;
|
import fun.asgc.neutrino.proxy.server.controller.res.UserLoginRecordListRes;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.UserLoginRecordMapper;
|
import fun.asgc.neutrino.proxy.server.dal.UserLoginRecordMapper;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.UserMapper;
|
import fun.asgc.neutrino.proxy.server.dal.UserMapper;
|
||||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||||
|
import fun.asgc.neutrino.proxy.server.dal.entity.UserLoginRecordDO;
|
||||||
|
import ma.glasnost.orika.MapperFactory;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
import org.noear.solon.annotation.Inject;
|
import org.noear.solon.annotation.Inject;
|
||||||
|
|
||||||
@@ -45,25 +51,34 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class UserLoginRecordService {
|
public class UserLoginRecordService {
|
||||||
|
@Inject
|
||||||
|
private MapperFactory mapperFactory;
|
||||||
@Inject
|
@Inject
|
||||||
private UserLoginRecordMapper userLoginRecordMapper;
|
private UserLoginRecordMapper userLoginRecordMapper;
|
||||||
@Inject
|
@Inject
|
||||||
private UserMapper userMapper;
|
private UserMapper userMapper;
|
||||||
|
|
||||||
public Page<UserLoginRecordListRes> page(PageQuery pageQuery, UserLoginRecordListReq req) {
|
public PageInfo<UserLoginRecordListRes> page(PageQuery pageQuery, UserLoginRecordListReq req) {
|
||||||
Page<UserLoginRecordListRes> page = Page.create(pageQuery);
|
Page<UserLoginRecordListRes> result = PageHelper.startPage(pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
userLoginRecordMapper.page(page, req);
|
List<UserLoginRecordDO> list = userLoginRecordMapper.selectList(new LambdaQueryWrapper<UserLoginRecordDO>()
|
||||||
if (!CollectionUtil.isEmpty(page.getRecords())) {
|
.orderByDesc(UserLoginRecordDO::getCreateTime)
|
||||||
Set<Integer> userIds = page.getRecords().stream().map(UserLoginRecordListRes::getUserId).collect(Collectors.toSet());
|
);
|
||||||
|
List<UserLoginRecordListRes> respList = mapperFactory.getMapperFacade().mapAsList(list, UserLoginRecordListRes.class);
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CollectionUtil.isEmpty(respList)) {
|
||||||
|
Set<Integer> userIds = respList.stream().map(UserLoginRecordListRes::getUserId).collect(Collectors.toSet());
|
||||||
List<UserDO> userList = userMapper.findByIds(userIds);
|
List<UserDO> userList = userMapper.findByIds(userIds);
|
||||||
Map<Integer, UserDO> userMap = userList.stream().collect(Collectors.toMap(UserDO::getId, Function.identity()));
|
Map<Integer, UserDO> userMap = userList.stream().collect(Collectors.toMap(UserDO::getId, Function.identity()));
|
||||||
for (UserLoginRecordListRes item : page.getRecords()) {
|
for (UserLoginRecordListRes item : respList) {
|
||||||
UserDO userDO = userMap.get(item.getUserId());
|
UserDO userDO = userMap.get(item.getUserId());
|
||||||
if (null != userDO) {
|
if (null != userDO) {
|
||||||
item.setUserName(userDO.getName());
|
item.setUserName(userDO.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return page;
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-11
@@ -21,9 +21,12 @@
|
|||||||
*/
|
*/
|
||||||
package fun.asgc.neutrino.proxy.server.service;
|
package fun.asgc.neutrino.proxy.server.service;
|
||||||
|
|
||||||
import fun.asgc.neutrino.core.db.page.Page;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import fun.asgc.neutrino.core.db.page.PageQuery;
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import fun.asgc.neutrino.core.util.DateUtil;
|
import fun.asgc.neutrino.core.util.DateUtil;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||||
|
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||||
import fun.asgc.neutrino.proxy.server.base.rest.ServiceException;
|
import fun.asgc.neutrino.proxy.server.base.rest.ServiceException;
|
||||||
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
||||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||||
@@ -38,6 +41,8 @@ import fun.asgc.neutrino.proxy.server.dal.entity.UserLoginRecordDO;
|
|||||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserTokenDO;
|
import fun.asgc.neutrino.proxy.server.dal.entity.UserTokenDO;
|
||||||
import fun.asgc.neutrino.proxy.server.util.Md5Util;
|
import fun.asgc.neutrino.proxy.server.util.Md5Util;
|
||||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||||
|
import ma.glasnost.orika.MapperFactory;
|
||||||
|
import org.apache.ibatis.solon.annotation.Db;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
import org.noear.solon.annotation.Inject;
|
import org.noear.solon.annotation.Inject;
|
||||||
|
|
||||||
@@ -55,12 +60,14 @@ import java.util.UUID;
|
|||||||
public class UserService {
|
public class UserService {
|
||||||
private static final String DEFAULT_PASSWORD = "123456";
|
private static final String DEFAULT_PASSWORD = "123456";
|
||||||
@Inject
|
@Inject
|
||||||
|
private MapperFactory mapperFactory;
|
||||||
|
@Db
|
||||||
private UserMapper userMapper;
|
private UserMapper userMapper;
|
||||||
@Inject
|
@Db
|
||||||
private UserTokenMapper userTokenMapper;
|
private UserTokenMapper userTokenMapper;
|
||||||
@Inject
|
@Db
|
||||||
private UserLoginRecordMapper userLoginRecordMapper;
|
private UserLoginRecordMapper userLoginRecordMapper;
|
||||||
@Inject
|
@Db
|
||||||
private VisitorChannelService visitorChannelService;
|
private VisitorChannelService visitorChannelService;
|
||||||
|
|
||||||
public LoginRes login(LoginReq req) {
|
public LoginRes login(LoginReq req) {
|
||||||
@@ -77,7 +84,7 @@ public class UserService {
|
|||||||
Date expirationTime = DateUtil.addDate(now, Calendar.HOUR, 1);
|
Date expirationTime = DateUtil.addDate(now, Calendar.HOUR, 1);
|
||||||
|
|
||||||
// 缓存token
|
// 缓存token
|
||||||
userTokenMapper.add(new UserTokenDO()
|
userTokenMapper.insert(new UserTokenDO()
|
||||||
.setToken(token)
|
.setToken(token)
|
||||||
.setUserId(userDO.getId())
|
.setUserId(userDO.getId())
|
||||||
.setExpirationTime(expirationTime)
|
.setExpirationTime(expirationTime)
|
||||||
@@ -86,7 +93,7 @@ public class UserService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// 新增用户登录日志
|
// 新增用户登录日志
|
||||||
userLoginRecordMapper.add(new UserLoginRecordDO()
|
userLoginRecordMapper.insert(new UserLoginRecordDO()
|
||||||
.setUserId(userDO.getId())
|
.setUserId(userDO.getId())
|
||||||
.setIp(SystemContextHolder.getIp())
|
.setIp(SystemContextHolder.getIp())
|
||||||
.setToken(token)
|
.setToken(token)
|
||||||
@@ -132,10 +139,13 @@ public class UserService {
|
|||||||
userTokenMapper.updateTokenExpirationTime(token, expirationTime);
|
userTokenMapper.updateTokenExpirationTime(token, expirationTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page<UserListRes> page(PageQuery pageQuery, UserListReq req) {
|
public PageInfo<UserListRes> page(PageQuery pageQuery, UserListReq req) {
|
||||||
Page<UserListRes> page = Page.create(pageQuery);
|
Page<UserListRes> result = PageHelper.startPage(pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
userMapper.page(page, req);
|
List<UserDO> list = userMapper.selectList(new LambdaQueryWrapper<UserDO>()
|
||||||
return page;
|
.orderByAsc(UserDO::getId)
|
||||||
|
);
|
||||||
|
List<UserListRes> respList = mapperFactory.getMapperFacade().mapAsList(list, UserListRes.class);
|
||||||
|
return PageInfo.of(respList, result.getTotal(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<UserListRes> list(UserListReq req) {
|
public List<UserListRes> list(UserListReq req) {
|
||||||
|
|||||||
@@ -36,4 +36,16 @@ solon.staticfiles.maxAge: 600
|
|||||||
#添加静态目录映射。(按需选择)#v1.11.0 后支持
|
#添加静态目录映射。(按需选择)#v1.11.0 后支持
|
||||||
solon.staticfiles.mappings:
|
solon.staticfiles.mappings:
|
||||||
- path: "/"
|
- path: "/"
|
||||||
repository: "./neutrino-proxy-admin/dist/" #2.添加资源路径(仓库只能是目录)
|
repository: "./neutrino-proxy-admin/dist/" #2.添加资源路径(仓库只能是目录)
|
||||||
|
|
||||||
|
mybatis.db:
|
||||||
|
typeAliases: #支持包名 或 类名(大写开头 或 *)//支持 ** 或 * 占位符
|
||||||
|
- "fun.asgc.neutrino.proxy.server.dal.entity"
|
||||||
|
mappers: #支持包名 或 类名(大写开头 或 *)或 xml(.xml结尾)//支持 ** 或 * 占位符
|
||||||
|
- "classpath:mapper/*.xml"
|
||||||
|
- "fun.asgc.neutrino.proxy.server.dal"
|
||||||
|
configuration: #扩展配置(要与 MybatisConfiguration 类的属性一一对应)
|
||||||
|
cacheEnabled: false
|
||||||
|
mapUnderscoreToCamelCase: true
|
||||||
|
globalConfig: #全局配置(要与 GlobalConfig 类的属性一一对应)
|
||||||
|
banner: true
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.ClientConnectRecordMapper">
|
<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.ClientConnectRecordMapper">
|
||||||
|
|
||||||
<update id="add">
|
<update id="add">
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.JobInfoMapper">
|
<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.JobInfoMapper">
|
||||||
|
|
||||||
<update id="update">
|
<update id="update">
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.LicenseMapper">
|
<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.LicenseMapper">
|
||||||
|
|
||||||
<select id="page" resultType="fun.asgc.neutrino.proxy.server.controller.res.LicenseListRes">
|
<select id="pageInfo" resultType="fun.asgc.neutrino.proxy.server.controller.res.LicenseListRes">
|
||||||
select * from `license`
|
select * from `license`
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.PortMappingMapper">
|
<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.PortMappingMapper">
|
||||||
|
|
||||||
<insert id="add">
|
<insert id="add">
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.UserReportMapper">
|
<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.UserReportMapper">
|
||||||
|
|
||||||
<select id="userFlowReportPage" resultType="fun.asgc.neutrino.proxy.server.controller.res.UserFlowReportRes">
|
<select id="userFlowReportPage" resultType="fun.asgc.neutrino.proxy.server.controller.res.UserFlowReportRes">
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.UserTokenMapper">
|
<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.UserTokenMapper">
|
||||||
|
|
||||||
<insert id = "add">
|
<insert id = "add">
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<!--<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.ClientConnectRecordMapper">-->
|
||||||
|
|
||||||
|
<!-- <update id="add">-->
|
||||||
|
<!-- insert into client_connect_record(`ip`,`license_id`,`type`, `msg`, `code`, `err`, `create_time`)-->
|
||||||
|
<!-- values(:ip,:licenseId,:type,:msg,:code,:err,:createTime)-->
|
||||||
|
<!-- </update>-->
|
||||||
|
<!--</mapper>-->
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<!--<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.JobInfoMapper">-->
|
||||||
|
|
||||||
|
<!-- <update id="update">-->
|
||||||
|
<!-- update `job_info`-->
|
||||||
|
<!-- set cron = :cron,desc = :desc,alarm_email=:alarmEmail,alarm_ding=:alarmDing,param=:param,update_time=:updateTime-->
|
||||||
|
<!-- where id =:id-->
|
||||||
|
<!-- </update>-->
|
||||||
|
<!--</mapper>-->
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<!--<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.LicenseMapper">-->
|
||||||
|
|
||||||
|
<!-- <select id="pageInfo" resultType="fun.asgc.neutrino.proxy.server.controller.res.LicenseListRes">-->
|
||||||
|
<!-- select * from `license`-->
|
||||||
|
<!-- </select>-->
|
||||||
|
|
||||||
|
<!-- <insert id="add">-->
|
||||||
|
<!-- insert into `license`(`name`,`key`,`user_id`,`is_online`,`enable`,`create_time`,`update_time`)-->
|
||||||
|
<!-- values (:name, :key, :userId, :isOnline, :enable, :createTime, :updateTime)-->
|
||||||
|
<!-- </insert>-->
|
||||||
|
|
||||||
|
<!--</mapper>-->
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<!--<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.PortMappingMapper">-->
|
||||||
|
|
||||||
|
<!-- <insert id="add">-->
|
||||||
|
<!-- insert into `port_mapping`(`license_id`,`server_port`,`client_ip`,`client_port`,`is_online`,`enable`,`create_time`,`update_time`)-->
|
||||||
|
<!-- values (:licenseId, :serverPort, :clientIp, :clientPort, :isOnline, :enable, :createTime, :updateTime)-->
|
||||||
|
<!-- </insert>-->
|
||||||
|
|
||||||
|
<!-- <update id="update">-->
|
||||||
|
<!-- update `port_mapping`-->
|
||||||
|
<!-- set license_id = :licenseId,server_port = :serverPort,client_ip=:clientIp,client_port=:clientPort,update_time=:updateTime-->
|
||||||
|
<!-- where id =:id-->
|
||||||
|
<!-- </update>-->
|
||||||
|
<!--</mapper>-->
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<!--<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.UserReportMapper">-->
|
||||||
|
|
||||||
|
<!-- <select id="userFlowReportPage" resultType="fun.asgc.neutrino.proxy.server.controller.res.UserFlowReportRes">-->
|
||||||
|
<!-- SELECT-->
|
||||||
|
<!-- u.id AS userId,-->
|
||||||
|
<!-- u.NAME AS userName,-->
|
||||||
|
<!-- IFNULL( SUM( frm.write_bytes ), 0 ) AS historyWriteBytes,-->
|
||||||
|
<!-- IFNULL( SUM( frm.read_bytes ), 0 ) AS historyReadBytes-->
|
||||||
|
<!-- FROM `user` u-->
|
||||||
|
<!-- LEFT JOIN flow_report_month frm ON u.id = frm.user_id-->
|
||||||
|
<!-- GROUP BY u.id-->
|
||||||
|
<!-- </select>-->
|
||||||
|
|
||||||
|
<!--</mapper>-->
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<!--<mapper namespace = "fun.asgc.neutrino.proxy.server.dal.UserTokenMapper">-->
|
||||||
|
|
||||||
|
<!-- <insert id = "add">-->
|
||||||
|
<!-- insert into `user_token`(`token`,`user_id`,`expiration_time`,`create_time`,`update_time`)-->
|
||||||
|
<!-- values (:token, :userId, :expirationTime, :createTime, :updateTime)-->
|
||||||
|
<!-- </insert>-->
|
||||||
|
|
||||||
|
<!-- <select id = "findByAvailableToken">-->
|
||||||
|
<!-- select * from user_token where token = ? and expiration_time > ?-->
|
||||||
|
<!-- </select>-->
|
||||||
|
|
||||||
|
<!--</mapper>-->
|
||||||
Reference in New Issue
Block a user