This commit is contained in:
959814898@qq.com
2024-05-30 09:44:52 +08:00
parent 184b40bdbf
commit c6caa39629
68 changed files with 8819 additions and 940 deletions
@@ -5,12 +5,19 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@EnableScheduling
@EnableAspectJAutoProxy(exposeProxy = true)
@EnableAsync
public class SpringBootCommonApplication {
public static void main(String[] args) {
// SpringApplication springApplication = new SpringApplication(SpringBootCommonApplication.class);
// springApplication.setBannerMode(Banner.Mode.OFF);
// ConfigurableApplicationContext run = springApplication.run(args);
SpringApplication.run(SpringBootCommonApplication.class, args);
}
@@ -3,23 +3,24 @@ package com.wyl.spring.boot.common.service.impl;
import com.wyl.spring.boot.common.service.LogTestService;
import com.wyl.spring.boot.common.spel.annotation.SpelTest;
import com.wyl.spring.boot.common.spel.bean.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class LogTestServiceImpl implements LogTestService {
// @Override
//// @LogTest
// @Transactional
// public void test() {
// System.out.println("testLog");
// }
@Override
// @LogTest
@Transactional
public void test() {
System.out.println("testLog");
}
@SpelTest(spel = "123{#order?'真':'假'}")
public void testSPEL(Boolean order) {
System.out.println(123);
@@ -37,4 +38,14 @@ public class LogTestServiceImpl implements LogTestService {
String abc = "123";
return abc;
}
@Scheduled(cron = "*/5 * * * * ?")
@Override
@Async
public void test() {
System.out.println(1);
while (true) {
int a = 0;
}
}
}
@@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("rule/person")
@@ -17,8 +19,9 @@ public class PersonRuleController {
private RuleExecutor ruleExecutor;
@PostMapping("one")
public void fireAllRules4One(@RequestBody Person person) {
ruleExecutor.execute(person);
public void fireAllRules4One(@RequestBody List<Person> person) {
System.out.println(person);
// ruleExecutor.execute(person);
}
}
@@ -2,8 +2,10 @@ package com.wyl.springbootmybatis;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@EnableScheduling
public class SpringBootMybatisApplication {
public static void main(String[] args) {
@@ -2,19 +2,21 @@ package com.wyl.springbootmybatis.mybatis.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wyl.springbootmybatis.mybatis.domain.KeyTest;
import com.wyl.springbootmybatis.mybatis.service.KeyTestService;
import com.wyl.springbootmybatis.mybatis.mapper.KeyTestMapper;
import com.wyl.springbootmybatis.mybatis.service.KeyTestService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
/**
* @author wyl
* @description 针对表【key_test(联合唯一索引更新测试)】的数据库操作Service实现
* @createDate 2022-05-18 22:54:18
*/
* @author wyl
* @description 针对表【key_test(联合唯一索引更新测试)】的数据库操作Service实现
* @createDate 2022-05-18 22:54:18
*/
@Service
public class KeyTestServiceImpl extends ServiceImpl<KeyTestMapper, KeyTest>
implements KeyTestService{
implements KeyTestService {
}
+17
View File
@@ -11,6 +11,18 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-boot-wxrobot</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>9</source>
<target>9</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.source>8</maven.compiler.source>
@@ -30,6 +42,11 @@
<artifactId>fastjson</artifactId>
<version>1.2.83</version>
</dependency>
<dependency>
<groupId>com.aivfo</groupId>
<artifactId>aivfo-dfs-client-spring-boot-starter</artifactId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,51 @@
package com.wyl.spring.wxrobot.controller;
import com.aivfo.dfs.client.core.DFSClient;
import com.aivfo.el.start.core.util.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@Component
public class Download {
@Autowired
DFSClient dfsClient;
public void test(HttpServletResponse response, List<String> path) throws Exception {
ZipOutputStream zipOutputStream = build(response);
AtomicReference<Boolean> skip = new AtomicReference<>(false);
try (zipOutputStream) {
for (int i = 0; i < path.size(); i++) {
if (skip.get()) {
return;
}
zipOutputStream.putNextEntry(new ZipEntry(path.get(i)));
dfsClient.downloadFile(path.get(i), (data, dataSize) -> {
try {
if (ObjectUtils.isNotNull(zipOutputStream)) {
zipOutputStream.write(data, 0, dataSize);
}
} catch (Exception e) {
skip.set(true);
return 0;
}
return 0;
});
zipOutputStream.flush();
}
} catch (IOException e) {
e.printStackTrace();
}
}
private ZipOutputStream build(HttpServletResponse response) throws IOException {
return new ZipOutputStream(response.getOutputStream());
}
}
@@ -1,33 +0,0 @@
package com.wyl.spring.wxrobot.controller;
import com.alibaba.fastjson.JSONObject;
import com.wyl.spring.wxrobot.entity.param.WxRobotMessageParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author: wangyl
* @date: 2023/2/6
* @description:
*/
@RestController
@RequestMapping("/")
@Slf4j
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class RobotMessage {
@PostMapping("/getMessageData")
public String getMessageData(@RequestBody WxRobotMessageParam skuListPageReq) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", 200);
jsonObject.put("message", "成功");
jsonObject.put("data", "123");
System.out.println(jsonObject.toJSONString());
return jsonObject.toJSONString();
}
}
@@ -0,0 +1,21 @@
package com.wyl.spring.wxrobot.entity.param;
import lombok.Data;
import java.util.List;
/**
* 选中图片导出
*
* @author Lbq
* @date 2023/7/12 15:57
*/
@Data
public class PictureExportDTO {
private String tlSn;
private Integer houseSn;
private List<Long> ids;
private Integer pictureLayer;
}
@@ -1 +1,9 @@
server.port=65006
server.port=65006
aivfo.dfs.fastdfs.enable=true
aivfo.dfs.fastdfs.trackerServers=192.168.31.89:22122,192.168.31.89:22123
aivfo.dfs.fastdfs.storagePath.group1[0]=/mnt/data01/image/group1/storaged01
aivfo.dfs.fastdfs.storagePath.group1[1]=/mnt/data01/image/group1/storaged02
aivfo.dfs.fastdfs.storagePath.group1[2]=/mnt/data01/image/group1/storaged03
aivfo.dfs.fastdfs.storagePath.group2[0]=/mnt/data01/image/group1/storaged01
aivfo.dfs.fastdfs.storagePath.group2[1]=/mnt/data01/image/group1/storaged02
aivfo.dfs.fastdfs.storagePath.group2[2]=/mnt/data01/image/group1/storaged03