Commit c4e468c5 authored by liaozan's avatar liaozan 🏀

Upgrade to schbrain-parent 3.0.8-SNAPSHOT

parent 68d31b29
......@@ -16,4 +16,6 @@ public class Entity extends BaseEntity {
@BizId
private String name;
private Integer age;
}
<?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"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>
......@@ -50,6 +50,10 @@
<groupId>com.schbrain.framework</groupId>
<artifactId>oss-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.schbrain.framework</groupId>
<artifactId>xxl-job-spring-boot-starter</artifactId>
......@@ -60,4 +64,4 @@
</dependency>
</dependencies>
</project>
\ No newline at end of file
</project>
<?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"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>
......@@ -54,4 +54,4 @@
</plugins>
</build>
</project>
\ No newline at end of file
</project>
spring:
application:
name: schbrain-initializer
\ No newline at end of file
name: schbrain-initializer
kafka:
consumer:
enabled: true
listener:
ack-mode: manual
package com.schbrain.initializer.web.controller;
import cn.hutool.core.util.RandomUtil;
import com.schbrain.common.util.BeanCopyUtils;
import com.schbrain.common.util.JacksonUtils;
import com.schbrain.common.util.support.lock.RedisLockUtils;
import com.schbrain.framework.autoconfigure.mybatis.base.BaseEntity;
import com.schbrain.framework.autoconfigure.mybatis.base.BaseService;
import com.schbrain.initializer.dao.entity.Entity;
......@@ -9,14 +11,12 @@ import com.schbrain.initializer.dao.entity.EntityWithLogicDelete;
import com.schbrain.initializer.service.EntityService;
import com.schbrain.initializer.service.EntityWithLogicDeleteService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.tuple.Triple;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.time.LocalDate;
import java.util.*;
/**
* @author liaozan
......@@ -32,21 +32,53 @@ public class EntityController {
@Autowired
private EntityWithLogicDeleteService entityWithLogicDeleteService;
@GetMapping
public void localDateTime(@RequestParam LocalDateTime time) {
System.out.println(time);
@GetMapping("/copy")
public void copy() {
Entity entity = new Entity();
entity.setId(1L);
Entity copied = BeanCopyUtils.copy(entity, Entity.class);
System.out.println(copied);
}
@GetMapping("/time")
public Triple<Date, LocalDate, Entity> dateTime(@RequestParam Date date,
@RequestParam LocalDate dateTime,
@RequestBody Entity entity) {
log.info("date: {}", date);
log.info("dateTime: {}", dateTime);
return Triple.of(date, dateTime, entity);
}
@GetMapping("/lock")
public void lock() {
RedisLockUtils.executeWithLock("lock", () -> System.out.println("lock"));
}
@GetMapping("/bizId")
public void bizId() {
String name = entityService.getById(106L, Entity::getName);
System.out.println(JacksonUtils.toPrettyJsonString(name));
Entity entity = entityService.getByBizId("8352707733");
System.out.println(JacksonUtils.toPrettyJsonString(entity));
List<Entity> entities = entityService.listByBizIds(List.of("8352707733"));
Integer age = entityService.getByBizId("8352707733", Entity::getAge);
System.out.println(age);
Long id = entityService.getByBizId("8352707733", Entity::getId);
System.out.println(id);
List<Entity> entities = entityService.listByBizIds(List.of("8352707733", "1119254675595816960"));
System.out.println(JacksonUtils.toPrettyJsonString(entities));
Map<String, Entity> entityMap = entityService.getMapByBizIds(List.of("8352707733"));
Map<String, Entity> entityMap = entityService.getMapByBizIds(List.of("8352707733", "1119254675595816960"));
System.out.println(JacksonUtils.toPrettyJsonString(entityMap));
List<String> names = entityService.listByBizIds(List.of("8352707733", "1119254675595816960"), Entity::getName);
System.out.println(JacksonUtils.toPrettyJsonString(names));
List<String> nameList = entityService.listByIds(List.of(37L, 106L, 107L), Entity::getName);
System.out.println(JacksonUtils.toPrettyJsonString(nameList));
}
@GetMapping("/entity")
......
......@@ -8,7 +8,7 @@
<parent>
<groupId>com.schbrain.framework</groupId>
<artifactId>schbrain-parent</artifactId>
<version>3.0.5-SNAPSHOT</version>
<version>3.0.8-SNAPSHOT</version>
</parent>
<groupId>com.schbrain</groupId>
......@@ -82,4 +82,4 @@
</dependencies>
</dependencyManagement>
</project>
\ No newline at end of file
</project>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment