2022-12-22 16:07

这就是一个缓存名称为啥要存在xml中

2022-08-03 10:40

团队协作怎么可能不用maven

2022-03-17 23:33

2020-07-24 08:47

可以参考一下 jboot Db 增强这一块

2020-07-23 15:55

@heycm 看一下jboot的玩法吧。

2020-07-15 17:32

应用于 SQL 管理的 Engine 对象的配置在 configPlugin(Plugins me) 中进行:

public void configPlugin(Plugins me) {
ActiveRecordPlugin arp = new ActiveRecordPlugin(...);
Engine engine = arp.getEngine();

// 上面的代码获取到了用于 sql 管理功能的 Engine 对象,接着就可以开始配置了
engine.setToClassPathSourceFactory();
engine.addSharedMethod(new StrKit());

me.add(arp);
}
https://jfinal.com/doc/6-2

2020-03-26 08:55

如果是:Jackson的话配置一下即可

import java.io.IOException;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.jfinal.plugin.activerecord.Record;

public class RecordJackSonSerializer extends JsonSerializer {

@Override
public void serialize(Record record, JsonGenerator gen, SerializerProvider serializers) throws IOException {
gen.writeObject(record.getColumns());
}
}


======================================================

import java.io.IOException;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import org.zalando.problem.ProblemModule;
import org.zalando.problem.violations.ConstraintViolationProblemModule;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.module.afterburner.AfterburnerModule;
import com.jfinal.plugin.activerecord.Record;

@Configuration
public class JacksonConfiguration {

/**
* Support for Java date and time API.
* @return the corresponding Jackson module.
*/
@Bean
public JavaTimeModule javaTimeModule() {
return new JavaTimeModule();
}

@Bean
public Jdk8Module jdk8TimeModule() {
return new Jdk8Module();
}

@Bean
@Primary
@ConditionalOnMissingBean(ObjectMapper.class)
public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) {
ObjectMapper objectMapper = builder.createXmlMapper(false).build();
SimpleModule simpleModule = new SimpleModule();
simpleModule.addSerializer(Record.class,new RecordJackSonSerializer());
objectMapper.registerModule(simpleModule);

objectMapper.getSerializerProvider().setNullValueSerializer(new JsonSerializer() {
@Override
public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
jsonGenerator.writeString("");
}
});
return objectMapper;
}


/*
* Jackson Afterburner module to speed up serialization/deserialization.
*/
@Bean
public AfterburnerModule afterburnerModule() {
return new AfterburnerModule();
}

/*
* Module for serialization/deserialization of RFC7807 Problem.
*/
@Bean
ProblemModule problemModule() {
return new ProblemModule();
}

/*
* Module for serialization/deserialization of ConstraintViolationProblem.
*/
@Bean
ConstraintViolationProblemModule constraintViolationProblemModule() {
return new ConstraintViolationProblemModule();
}

}

2020-03-17 09:08

quartz 挺好用的。集成也 简单。

2019-11-22 10:44

@JFinal 确实需要排序功能,排序的场景需求很大

2019-11-12 09:35

没有第三方的,需要自己改