.
This commit is contained in:
parent
68802a4fc2
commit
d8b0879bba
37
pom.xml
37
pom.xml
@ -4,9 +4,9 @@
|
||||
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>
|
||||
|
||||
<groupId>com.lxyer</groupId>
|
||||
<groupId>net.tccn</groupId>
|
||||
<artifactId>redbbs</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<version>0.2</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@ -41,23 +41,9 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.22</version>
|
||||
</dependency>
|
||||
|
||||
<!-- arangodb支持 -->
|
||||
<!-- arangodb支持 -->
|
||||
<!--<dependency>
|
||||
<groupId>com.arangodb</groupId>
|
||||
<artifactId>arangodb-java-driver-async</artifactId>
|
||||
<version>5.0.4</version>
|
||||
</dependency>-->
|
||||
<!--<dependency>
|
||||
<groupId>com.lxyer</groupId>
|
||||
<artifactId>redim</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>-->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<!--<directory>lib</directory>-->
|
||||
<finalName>lib/redbbs</finalName>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<plugins>
|
||||
@ -66,8 +52,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.11.0</version>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@ -120,4 +106,19 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>maven-nexus</id>
|
||||
<name>mvn-releasex</name>
|
||||
<url>http://127.0.0.1:8081/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>mvn-release</id>
|
||||
<name>mvn-release</name>
|
||||
<url>http://127.0.0.1:8081/repository/maven-releases/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</project>
|
@ -15,10 +15,7 @@ public class BaseService implements Service {
|
||||
|
||||
protected final int sessionExpireSeconds = 7 * 24 * 60 * 60;
|
||||
|
||||
protected final static RetResult RET_SUCCESS = RetResult.success();
|
||||
|
||||
/*@Resource(name = "SERVER_ROOT")
|
||||
protected File webroot;*/
|
||||
protected static final RetResult RET_SUCCESS = RetResult.success();
|
||||
|
||||
@Resource(name = "redbbs")
|
||||
protected DataSource dataSource;
|
||||
|
@ -8,10 +8,12 @@ import net.tccn.bbs.content.ContentService;
|
||||
import net.tccn.bbs.user.UserInfo;
|
||||
import net.tccn.bbs.user.UserService;
|
||||
import net.tccn.bbs.vislog.entity.VisLog;
|
||||
import org.redkale.net.http.*;
|
||||
import org.redkale.net.http.HttpRequest;
|
||||
import org.redkale.net.http.HttpResponse;
|
||||
import org.redkale.net.http.HttpScope;
|
||||
import org.redkale.net.http.HttpServlet;
|
||||
import org.redkale.source.FilterExpress;
|
||||
import org.redkale.source.FilterNode;
|
||||
import org.redkale.util.AnyValue;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
@ -42,22 +44,12 @@ public class BaseServlet extends HttpServlet {
|
||||
@Resource
|
||||
protected TaskQueue<VisLog> logQueue;
|
||||
|
||||
@Override
|
||||
public void init(HttpContext context, AnyValue config) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preExecute(HttpRequest request, HttpResponse response) throws IOException {
|
||||
/*if (true){
|
||||
response.finish(HttpScope.refer("404.html"));
|
||||
return;
|
||||
}*/
|
||||
|
||||
String sessionid = request.getSessionid(true);
|
||||
int currentid = 0;
|
||||
if (sessionid != null) {
|
||||
request.setCurrentUser(userService.current(sessionid));
|
||||
currentid = userService.currentUserid(sessionid);
|
||||
request.setCurrentUserid(currentid);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.jfinal.template.Engine;
|
||||
import com.jfinal.template.Template;
|
||||
import net.tccn.bbs.base.util.EJ;
|
||||
import net.tccn.bbs.user.UserInfo;
|
||||
import net.tccn.bbs.user.UserService;
|
||||
import org.redkale.convert.Convert;
|
||||
import org.redkale.net.http.*;
|
||||
import org.redkale.util.AnyValue;
|
||||
@ -21,6 +22,9 @@ public class TplRender implements HttpRender<HttpScope> {
|
||||
@Resource(name = "SERVER_ROOT")
|
||||
protected File webroot;
|
||||
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
private static final Engine engine = new Engine();
|
||||
|
||||
@Override
|
||||
@ -33,12 +37,16 @@ public class TplRender implements HttpRender<HttpScope> {
|
||||
|
||||
@Override
|
||||
public void renderTo(HttpRequest request, HttpResponse response, Convert convert, HttpScope scope) {
|
||||
UserInfo mine = request.currentUser();//当前登录人
|
||||
//UserInfo mine = request.currentUser();//当前登录人
|
||||
|
||||
Template template = engine.getTemplate(scope.getReferid());
|
||||
Map attr = scope.getAttributes();
|
||||
if (attr == null) attr = Kv.create();
|
||||
attr.put("mine", mine);
|
||||
if (attr == null) {
|
||||
attr = Kv.create();
|
||||
}
|
||||
|
||||
UserInfo userInfo = userService.find(request.currentUserid(int.class));
|
||||
attr.put("mine", userInfo);
|
||||
attr.put("token", request.getSessionid(false));
|
||||
|
||||
String str = template.renderToString(attr);
|
||||
|
@ -169,7 +169,6 @@ public final class Utils {
|
||||
Kv row = Kv.of();
|
||||
for (int i = 1; i <= count; i++) {
|
||||
String columnTypeName = metaData.getColumnTypeName(i);
|
||||
//String columnName = metaData.getColumnName(i);
|
||||
String columnLabel = metaData.getColumnLabel(i);
|
||||
row.put(columnLabel, null);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user