fix():修复框架bug
parent
70ee6d0628
commit
05e6ecb947
|
@ -20,4 +20,10 @@ public class ServiceNameConstants {
|
|||
* 文件服务的serviceid
|
||||
*/
|
||||
public static final String FILE_SERVICE = "cloud-file";
|
||||
|
||||
/**
|
||||
* 车辆服务的serviceid
|
||||
*/
|
||||
public static final String ENTERPRISE_SERVICE = "cloud-saas";
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
|
|||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.core.utils.PageUtils;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -19,7 +20,7 @@ import java.util.List;
|
|||
*
|
||||
* @author muyu
|
||||
*/
|
||||
public class BaseController {
|
||||
public class BaseController<M extends BaseEntity> {
|
||||
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-server</artifactId>
|
||||
<artifactId>cloud-modules-enterprise</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>enterpise-client</artifactId>
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
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>com.muyu</groupId>
|
||||
<artifactId>cloud-server</artifactId>
|
||||
<artifactId>cloud-modules-enterprise</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>enterpise-common</artifactId>
|
||||
|
@ -19,70 +19,15 @@
|
|||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>enterpise-common</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.paho</groupId>
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
<version>1.2.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-log</artifactId>
|
||||
<artifactId>cloud-common-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 接口模块 -->
|
||||
|
@ -91,10 +36,9 @@
|
|||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- XllJob定时任务 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-xxl</artifactId>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-server</artifactId>
|
||||
<artifactId>cloud-modules-enterprise</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>enterpise-remote</artifactId>
|
||||
|
@ -18,4 +17,10 @@
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>enterpise-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
package com.muyu.remote;
|
||||
|
||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.domain.req.MessageValueReq;
|
||||
import com.muyu.domain.resp.MessageValueListResp;
|
||||
import com.muyu.remote.factory.RemoteMessageValueFallbackFactory;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author xie ya ru
|
||||
* @Date 2024/9/28 21:00
|
||||
* @注释 vin查询报文模版类型
|
||||
*/
|
||||
@FeignClient(contextId = "remoteMessageValueService", value = ServiceNameConstants.ENTERPRISE_SERVICE, fallbackFactory = RemoteMessageValueFallbackFactory.class,path = "messageValue")
|
||||
public interface RemoteMessageValueService {
|
||||
|
||||
@PostMapping("/findByTemplateId/{stringVin}")
|
||||
@Operation(summary = "根据车辆类型查询报文模版ID",description = "根据车辆类型查询报文模版ID")
|
||||
Result<Long> findByTemplateId(@PathVariable("stringVin") String stringVin);
|
||||
|
||||
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
||||
Result<List<MessageValueListResp>> findAll(@RequestBody MessageValueReq messageValueReq);
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.remote.factory;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.domain.req.MessageValueReq;
|
||||
import com.muyu.domain.resp.MessageValueListResp;
|
||||
import com.muyu.remote.RemoteMessageValueService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author xie ya ru
|
||||
* @Date 2024/9/28 21:04
|
||||
* @注释
|
||||
*/
|
||||
@Log4j2
|
||||
public class RemoteMessageValueFallbackFactory implements FallbackFactory<RemoteMessageValueService> {
|
||||
@Override
|
||||
public RemoteMessageValueService create(Throwable cause) {
|
||||
log.error("文件服务调用失败:{}",cause.getMessage());
|
||||
return new RemoteMessageValueService() {
|
||||
@Override
|
||||
public Result<List<MessageValueListResp>> findAll(MessageValueReq messageValueReq) {
|
||||
return Result.error("查询数据失败:"+cause.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Long> findByTemplateId(String stringVin) {
|
||||
return Result.error("查询数据失败:"+cause.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
com.muyu.remote.factory.RemoteMessageValueFallbackFactory
|
|
@ -5,9 +5,8 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-server</artifactId>
|
||||
<artifactId>cloud-modules-enterprise</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>enterpise-service</artifactId>
|
||||
|
@ -23,13 +22,6 @@
|
|||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>enterpise-common</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.paho</groupId>
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
<version>1.2.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
|
@ -91,7 +83,6 @@
|
|||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-xxl</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -11,8 +11,10 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -31,6 +33,9 @@ public class MessageValueController extends BaseController {
|
|||
@Autowired
|
||||
private MessageValueService messageValueService;
|
||||
|
||||
@Resource
|
||||
private RedisTemplate<String,MessageValue> redisTemplate;
|
||||
|
||||
/**
|
||||
* 报文数据列表查询
|
||||
* @param messageValueReq
|
||||
|
@ -51,6 +56,7 @@ public class MessageValueController extends BaseController {
|
|||
@PostMapping("/")
|
||||
@Operation(summary = "添加报文数据", description = "新增报文数据")
|
||||
public Result<String> save(@RequestBody MessageValueAddReq messageValueAddReq){
|
||||
redisTemplate.boundValueOps("messageValue:" +messageValueAddReq.getTemplateId()).increment(1);
|
||||
messageValueService.save(MessageValue.addBuild(messageValueAddReq));
|
||||
return Result.success("添加成功");
|
||||
}
|
||||
|
@ -74,4 +80,14 @@ public class MessageValueController extends BaseController {
|
|||
public void test(String str){
|
||||
messageValueService.test(str);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping({"/findByTemplateId/{stringVin}"})
|
||||
@Operation(
|
||||
summary = "根据车辆类型查询报文模版ID",
|
||||
description = "根据车辆类型查询报文模版ID"
|
||||
)
|
||||
public Result<Long> findByTemplateId(@PathVariable("stringVin") String stringVin) {
|
||||
return Result.success(this.messageValueService.findByTemplateId(stringVin), "查询成功");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.MessageValue;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* 消息值表(MessageValue)表数据库访问层
|
||||
|
@ -13,4 +14,6 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
*/
|
||||
@Mapper
|
||||
public interface MessageValueMapper extends BaseMapper<MessageValue> {
|
||||
@Select({"SELECT sct.message_template_id FROM sys_car sc LEFT JOIN sys_car_type sct on sct.id = sc.car_type WHERE sc.car_vin = ${stringVin}"})
|
||||
Long findByTemplateId(String stringVin);
|
||||
}
|
||||
|
|
|
@ -27,5 +27,6 @@ public interface MessageValueService extends IService<MessageValue> {
|
|||
* @param str
|
||||
*/
|
||||
void test(String str);
|
||||
Long findByTemplateId(String stringVin);
|
||||
|
||||
}
|
||||
|
|
|
@ -9,9 +9,12 @@ import com.muyu.domain.req.MessageValueReq;
|
|||
import com.muyu.domain.resp.MessageValueListResp;
|
||||
import com.muyu.mapper.MessageValueMapper;
|
||||
import com.muyu.service.MessageValueService;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 消息值服务实现类
|
||||
|
@ -25,6 +28,11 @@ public class MessageValueServiceImpl
|
|||
extends ServiceImpl<MessageValueMapper, MessageValue>
|
||||
implements MessageValueService {
|
||||
|
||||
@Resource
|
||||
private MessageValueMapper messageValueMapper;
|
||||
|
||||
|
||||
private RedisTemplate<String, MessageValue> redisTemplate;
|
||||
/**
|
||||
* 查询所有消息值
|
||||
* @param messageValueReq
|
||||
|
@ -46,6 +54,10 @@ public class MessageValueServiceImpl
|
|||
}
|
||||
|
||||
List<MessageValue> list = this.list(queryWrapper);
|
||||
for (MessageValue messageValue : list){
|
||||
redisTemplate.boundValueOps("messageValue:" + messageValue.getTemplateId()).set(messageValue);
|
||||
}
|
||||
|
||||
return list.stream()
|
||||
.map(messageValue -> MessageValueListResp.valueBuild(
|
||||
messageValue
|
||||
|
@ -68,5 +80,10 @@ public class MessageValueServiceImpl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long findByTemplateId(String stringVin) {
|
||||
return messageValueMapper.findByTemplateId(stringVin);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
</parent>
|
||||
|
||||
<artifactId>cloud-modules-enterprise</artifactId>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
<description>
|
||||
cloud-modules-enterprise
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.gen.controller;
|
|||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.text.Convert;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
@ -31,8 +32,7 @@ import java.util.Map;
|
|||
*/
|
||||
@RequestMapping("/gen")
|
||||
@RestController
|
||||
public class GenController extends BaseController
|
||||
{
|
||||
public class GenController extends BaseController<BaseEntity> {
|
||||
@Resource
|
||||
private IGenTableService genTableService;
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@ package ${packageName}.controller;
|
|||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -33,8 +35,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${businessName}")
|
||||
public class ${ClassName}Controller extends BaseController
|
||||
{
|
||||
public class ${ClassName}Controller extends BaseController<BaseEntity> {
|
||||
@Resource
|
||||
private I${ClassName}Service ${className}Service;
|
||||
|
||||
|
|
|
@ -0,0 +1,122 @@
|
|||
<?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>com.muyu</groupId>
|
||||
<artifactId>cloud-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-modules-parse</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 接口模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- <!– XllJob定时任务 –>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.muyu</groupId>-->
|
||||
<!-- <artifactId>cloud-common-xxl</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- mqtt监控者 -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.paho</groupId>
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>enterpise-remote</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>enterpise-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,24 @@
|
|||
package com.muyu.parse;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author xie ya ru
|
||||
* @Date 2024/9/28 12:26
|
||||
* @注释
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableCustomConfig
|
||||
//@EnableCustomSwagger2
|
||||
@EnableMyFeignClients
|
||||
|
||||
public class ParseApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ParseApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
package com.muyu.parse.configure;
|
||||
|
||||
import com.muyu.parse.process.ProcessData;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.paho.client.mqttv3.*;
|
||||
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author xie ya ru
|
||||
* @Date 2024/9/26 15:31
|
||||
* @注释
|
||||
*/
|
||||
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class MqttConsumerConfig {
|
||||
|
||||
String topic = "xxx";
|
||||
String content = "Message from MqttPublishSample";
|
||||
int qos = 2;
|
||||
String broker = "tcp://123.57.152.124:1883";
|
||||
String clientId = "xyr1";
|
||||
|
||||
@PostConstruct
|
||||
public String connect() {
|
||||
final String vin= "";
|
||||
try {
|
||||
MqttClient sampleClient = new MqttClient(broker, clientId, new MemoryPersistence());
|
||||
MqttConnectOptions connOpts = new MqttConnectOptions();
|
||||
//是否清空session
|
||||
connOpts.setCleanSession(true);
|
||||
System.out.println("Connecting to broker: " + broker);
|
||||
//连接
|
||||
sampleClient.connect(connOpts);
|
||||
sampleClient.subscribe(topic, qos);
|
||||
sampleClient.setCallback(new MqttCallback() {
|
||||
//连接丢失(报错)
|
||||
@Override
|
||||
public void connectionLost(Throwable throwable) {
|
||||
log.error("error:{}", throwable.getMessage(), throwable);
|
||||
}
|
||||
|
||||
//消息已经接收到
|
||||
@Override
|
||||
public void messageArrived(String s, MqttMessage mqttMessage) throws Exception {
|
||||
String s1 = new String(mqttMessage.getPayload());
|
||||
System.out.println("接收到的主题是:" + s + "内容是:{}" + s1);
|
||||
ProcessData.DataConversion(s1);
|
||||
|
||||
}
|
||||
|
||||
//交付完成
|
||||
@Override
|
||||
public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) {
|
||||
|
||||
}
|
||||
});
|
||||
} catch (MqttException me) {
|
||||
System.out.println("reason " + me.getReasonCode());
|
||||
System.out.println("msg " + me.getMessage());
|
||||
System.out.println("loc " + me.getLocalizedMessage());
|
||||
System.out.println("cause " + me.getCause());
|
||||
System.out.println("excep " + me);
|
||||
me.printStackTrace();
|
||||
}
|
||||
|
||||
return vin;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
package com.muyu.parse.process;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
|
||||
import com.muyu.domain.req.MessageValueReq;
|
||||
import com.muyu.domain.resp.MessageValueListResp;
|
||||
import com.muyu.parse.uitl.DataParseUtil;
|
||||
import com.muyu.remote.RemoteMessageValueService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author xie ya ru
|
||||
* @Date 2024/9/28 21:14
|
||||
* @注释
|
||||
*/
|
||||
@Log4j2
|
||||
public class ProcessData {
|
||||
|
||||
@Resource
|
||||
private static RemoteMessageValueService remoteMessageValueService;
|
||||
|
||||
@Resource
|
||||
private static RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
public static JSONObject DataConversion(String jsonVin ) {
|
||||
String vin = DataParseUtil.dataParsing(jsonVin);
|
||||
|
||||
Result<Long> byTemplateId = remoteMessageValueService.findByTemplateId(vin);
|
||||
|
||||
Long templateId = byTemplateId.getData();
|
||||
List<MessageValueListResp> templateList;
|
||||
try{
|
||||
//从Redis中获取报文模版信息
|
||||
if (redisTemplate.hasKey("messageValue:" + templateId)) {
|
||||
List<Object> list = redisTemplate.opsForList().range("messageValue:" + templateId, 0, -1);
|
||||
templateList = list.stream()
|
||||
.map(obj -> JSON.parseObject(obj.toString(), MessageValueListResp.class))
|
||||
.toList();
|
||||
log.info("Redis缓存查询成功");
|
||||
} else {
|
||||
|
||||
Result<List<MessageValueListResp>> byTemplate = remoteMessageValueService.findAll(MessageValueReq.builder().messageTemplateId(templateId).build());
|
||||
templateList = byTemplate.getData();
|
||||
templateList.forEach(
|
||||
listResp ->
|
||||
redisTemplate.opsForList().rightPush(
|
||||
"messageValue:" + templateId, JSON.toJSONString(listResp)
|
||||
)
|
||||
);
|
||||
}
|
||||
log.info("数据库查询成功");
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("获取报文模板失败");
|
||||
}
|
||||
//判断报文模板列表不为空
|
||||
if (templateList.isEmpty()) {
|
||||
throw new RuntimeException("报文模版为空");
|
||||
}
|
||||
//存储报文模版解析后的数据
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
for (MessageValueListResp messageValue : templateList) {
|
||||
//起始位下标
|
||||
Integer startIndex = messageValue.getMessageStartIndex() - 1;
|
||||
//结束位下标
|
||||
Integer endIndex = messageValue.getMessageEndIndex();
|
||||
//根据报文模版截取数据
|
||||
String value = vin.substring(startIndex, endIndex);
|
||||
//存入数据
|
||||
System.out.println("标签"+messageValue.getMessageLabel()+"值"+value);
|
||||
jsonObject.put(messageValue.getMessageLabel(), value);
|
||||
}
|
||||
return jsonObject;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.muyu.parse.uitl;
|
||||
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author xie ya ru
|
||||
* @Date 2024/9/28 16:48
|
||||
* @注释
|
||||
*/
|
||||
|
||||
public class DataParseUtil {
|
||||
public static final Integer STARTPOSITION = 0;
|
||||
|
||||
public static final Integer ENDPOSITION = 18;
|
||||
|
||||
public static final Integer INDEX = 16;
|
||||
public static String dataParsing(String jsonVin){
|
||||
jsonVin = jsonVin.substring(STARTPOSITION,ENDPOSITION);
|
||||
StringBuilder asciiString = new StringBuilder();
|
||||
String[] split = jsonVin.split(" ");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
//十六进制转换为十进制
|
||||
int decimal = Integer.parseInt(split[i],INDEX);
|
||||
//将十进制整数转换为字符
|
||||
char character =(char)decimal;
|
||||
//添加字符到ASCII 字符串
|
||||
asciiString.append(character);
|
||||
}
|
||||
System.out.println(asciiString.toString());
|
||||
return asciiString.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-parse"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-parse"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.sky.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<Pattern>${log.sky.pattern}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="GRPC_LOG"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-parse"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.sky.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<Pattern>${log.sky.pattern}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="GRPC_LOG"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -3,6 +3,7 @@ package com.muyu.system.controller;
|
|||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
@ -28,7 +29,7 @@ import java.util.List;
|
|||
@RestController
|
||||
@RequestMapping("/config")
|
||||
@Tag(name = "SysConfigController", description = "系统参数配置")
|
||||
public class SysConfigController extends BaseController {
|
||||
public class SysConfigController extends BaseController<BaseEntity> {
|
||||
|
||||
@Autowired
|
||||
private SysConfigService configService;
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.muyu.common.core.constant.UserConstants;
|
|||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
|
@ -24,7 +25,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dept")
|
||||
public class SysDeptController extends BaseController {
|
||||
public class SysDeptController extends BaseController<BaseEntity> {
|
||||
|
||||
@Autowired
|
||||
private SysDeptService deptService;
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.muyu.common.core.utils.StringUtils;
|
|||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
@ -27,7 +28,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dict/data")
|
||||
public class SysDictDataController extends BaseController {
|
||||
public class SysDictDataController extends BaseController<BaseEntity> {
|
||||
@Autowired
|
||||
private SysDictDataService dictDataService;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.system.controller;
|
|||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
@ -24,7 +25,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dict/type")
|
||||
public class SysDictTypeController extends BaseController {
|
||||
public class SysDictTypeController extends BaseController<BaseEntity> {
|
||||
@Autowired
|
||||
private SysDictTypeService dictTypeService;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.muyu.common.core.constant.CacheConstants;
|
|||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
@ -25,7 +26,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/logininfor")
|
||||
public class SysLogininforController extends BaseController {
|
||||
public class SysLogininforController extends BaseController<BaseEntity> {
|
||||
@Autowired
|
||||
private SysLogininforService logininforService;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.muyu.common.core.constant.UserConstants;
|
|||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
|
@ -24,7 +25,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/menu")
|
||||
public class SysMenuController extends BaseController {
|
||||
public class SysMenuController extends BaseController<BaseEntity> {
|
||||
@Autowired
|
||||
private SysMenuService menuService;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.system.controller;
|
|||
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/notice")
|
||||
public class SysNoticeController extends BaseController {
|
||||
public class SysNoticeController extends BaseController<BaseEntity> {
|
||||
@Autowired
|
||||
private SysNoticeService noticeService;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.system.controller;
|
|||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
@ -23,7 +24,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/operlog")
|
||||
public class SysOperlogController extends BaseController {
|
||||
public class SysOperlogController extends BaseController<BaseEntity> {
|
||||
@Autowired
|
||||
private SysOperLogService operLogService;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.system.controller;
|
|||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
@ -24,7 +25,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/post")
|
||||
public class SysPostController extends BaseController {
|
||||
public class SysPostController extends BaseController<BaseEntity> {
|
||||
@Autowired
|
||||
private SysPostService postService;
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.muyu.common.core.utils.StringUtils;
|
|||
import com.muyu.common.core.utils.file.FileTypeUtils;
|
||||
import com.muyu.common.core.utils.file.MimeTypeUtils;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.service.TokenService;
|
||||
|
@ -28,7 +29,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/profile")
|
||||
public class SysProfileController extends BaseController {
|
||||
public class SysProfileController extends BaseController<BaseEntity> {
|
||||
@Autowired
|
||||
private SysUserService userService;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.system.controller;
|
|||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
@ -30,7 +31,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/role")
|
||||
public class SysRoleController extends BaseController {
|
||||
public class SysRoleController extends BaseController<BaseEntity> {
|
||||
@Autowired
|
||||
private SysRoleService roleService;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.muyu.common.core.domain.Result;
|
|||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
@ -37,7 +38,7 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class SysUserController extends BaseController {
|
||||
public class SysUserController extends BaseController<BaseEntity> {
|
||||
@Autowired
|
||||
private SysUserService userService;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.muyu.common.core.constant.CacheConstants;
|
|||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
|
@ -27,7 +28,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/online")
|
||||
public class SysUserOnlineController extends BaseController {
|
||||
public class SysUserOnlineController extends BaseController<BaseEntity> {
|
||||
@Autowired
|
||||
private SysUserOnlineService userOnlineService;
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<module>cloud-modules-gen</module>
|
||||
<module>cloud-modules-file</module>
|
||||
<module>cloud-vx</module>
|
||||
<module>cloud-modules-parse</module>
|
||||
<module>cloud-modules-enterprise</module>
|
||||
</modules>
|
||||
|
||||
|
|
26
pom.xml
26
pom.xml
|
@ -23,6 +23,7 @@
|
|||
<spring-boot-admin.version>3.2.3</spring-boot-admin.version>
|
||||
<swagger.fox.version>3.0.0</swagger.fox.version>
|
||||
<swagger.core.version>1.6.2</swagger.core.version>
|
||||
<swagger.v3.version>2.2.8</swagger.v3.version>
|
||||
<tobato.version>1.27.2</tobato.version>
|
||||
<kaptcha.version>2.3.3</kaptcha.version>
|
||||
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
|
||||
|
@ -42,6 +43,7 @@
|
|||
<hutool.version>5.8.27</hutool.version>
|
||||
<knife4j-openapi3.version>4.1.0</knife4j-openapi3.version>
|
||||
<xxl-job-core.version>2.4.1</xxl-job-core.version>
|
||||
<mqtt.version>1.2.5</mqtt.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
|
@ -127,6 +129,11 @@
|
|||
<version>${swagger.core.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||
<version>${swagger.v3.version}</version>
|
||||
</dependency>
|
||||
<!-- 验证码 -->
|
||||
<dependency>
|
||||
<groupId>pro.fessional</groupId>
|
||||
|
@ -266,6 +273,25 @@
|
|||
<artifactId>cloud-common-rabbit</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>enterpise-common</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>enterpise-client</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- mqtt -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.paho</groupId>
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
<version>${mqtt.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
|
Loading…
Reference in New Issue