Merge branch 'server_five' into server_five_dongxiaodong
commit
f26476a526
|
@ -15,13 +15,13 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
shared-configs:
|
shared-configs:
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.couplet.common.core.utils.ServletUtils;
|
||||||
import com.couplet.common.core.utils.StringUtils;
|
import com.couplet.common.core.utils.StringUtils;
|
||||||
import com.couplet.common.system.domain.LoginUser;
|
import com.couplet.common.system.domain.LoginUser;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
@ -44,6 +45,15 @@ public class SecurityUtils {
|
||||||
return SecurityContextHolder.get(SecurityConstants.LOGIN_USER, LoginUser.class);
|
return SecurityContextHolder.get(SecurityConstants.LOGIN_USER, LoginUser.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取登录企业ID
|
||||||
|
*/
|
||||||
|
public static Long getEnterpriseId(){
|
||||||
|
Long enterpriseId = getLoginUser().getEnterpriseId();
|
||||||
|
Assert.notNull(enterpriseId, "该用户未绑定负责企业");
|
||||||
|
return enterpriseId;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取请求token
|
* 获取请求token
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.couplet.common.system.domain;
|
package com.couplet.common.system.domain;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -9,6 +11,10 @@ import java.util.Set;
|
||||||
*
|
*
|
||||||
* @author couplet
|
* @author couplet
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class LoginUser implements Serializable {
|
public class LoginUser implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -52,80 +58,14 @@ public class LoginUser implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Set<String> roles;
|
private Set<String> roles;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业ID
|
||||||
|
*/
|
||||||
|
private Long enterpriseId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户信息
|
* 用户信息
|
||||||
*/
|
*/
|
||||||
private SysUser sysUser;
|
private SysUser sysUser;
|
||||||
|
|
||||||
public String getToken () {
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setToken (String token) {
|
|
||||||
this.token = token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getUserid () {
|
|
||||||
return userid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserid (Long userid) {
|
|
||||||
this.userid = userid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUsername () {
|
|
||||||
return username;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUsername (String username) {
|
|
||||||
this.username = username;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getLoginTime () {
|
|
||||||
return loginTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLoginTime (Long loginTime) {
|
|
||||||
this.loginTime = loginTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getExpireTime () {
|
|
||||||
return expireTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExpireTime (Long expireTime) {
|
|
||||||
this.expireTime = expireTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIpaddr () {
|
|
||||||
return ipaddr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIpaddr (String ipaddr) {
|
|
||||||
this.ipaddr = ipaddr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<String> getPermissions () {
|
|
||||||
return permissions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPermissions (Set<String> permissions) {
|
|
||||||
this.permissions = permissions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<String> getRoles () {
|
|
||||||
return roles;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoles (Set<String> roles) {
|
|
||||||
this.roles = roles;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SysUser getSysUser () {
|
|
||||||
return sysUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSysUser (SysUser sysUser) {
|
|
||||||
this.sysUser = sysUser;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.couplet.common.system.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName SysFirm
|
||||||
|
* @Description 企业实体类
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/3/28 22:14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysFirm {
|
||||||
|
/**
|
||||||
|
* 企业id
|
||||||
|
**/
|
||||||
|
private Integer firmId;
|
||||||
|
/**
|
||||||
|
* 企业名称
|
||||||
|
**/
|
||||||
|
private String firmName;
|
||||||
|
/**
|
||||||
|
* 企业认证
|
||||||
|
**/
|
||||||
|
private Integer approveId;
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.couplet.common.system.remote;
|
||||||
|
|
||||||
|
import com.couplet.common.core.constant.ServiceNameConstants;
|
||||||
|
import com.couplet.common.core.domain.Result;
|
||||||
|
import com.couplet.common.core.web.page.TableDataInfo;
|
||||||
|
import com.couplet.common.system.domain.SysDept;
|
||||||
|
import com.couplet.common.system.domain.SysUser;
|
||||||
|
import com.couplet.common.system.remote.factory.RemoteDeptFallbackFactory;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
||||||
|
|
||||||
|
@FeignClient(contextId = "remoteFileService" ,
|
||||||
|
value = ServiceNameConstants.SYSTEM_SERVICE,
|
||||||
|
fallbackFactory = RemoteDeptFallbackFactory.class,
|
||||||
|
path = "/dept"
|
||||||
|
)
|
||||||
|
public interface RemoteDeptService {
|
||||||
|
/**
|
||||||
|
* 查询部门管理数据
|
||||||
|
*
|
||||||
|
* @param dept 部门信息
|
||||||
|
* @return 部门信息集合
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result list (SysDept dept);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据企业ID获取企业下部门
|
||||||
|
* @param enterpriseId 企业ID
|
||||||
|
* @return 企业信息,内含有部门
|
||||||
|
*/
|
||||||
|
@GetMapping("/getSysDeptByEnterpriseId/{enterpriseId}")
|
||||||
|
public Result<SysDept> getSysDeptByEnterpriseId(@PathVariable(value = "enterpriseId") Long enterpriseId);
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.couplet.common.system.remote.factory;
|
||||||
|
|
||||||
|
import com.couplet.common.core.domain.Result;
|
||||||
|
import com.couplet.common.core.web.page.TableDataInfo;
|
||||||
|
import com.couplet.common.system.domain.SysDept;
|
||||||
|
import com.couplet.common.system.domain.SysUser;
|
||||||
|
import com.couplet.common.system.remote.RemoteDeptService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fufanrui
|
||||||
|
* @version 1.0
|
||||||
|
* @description: TODO
|
||||||
|
* @date 2024/3/27 15:29
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
|
||||||
|
public class RemoteDeptFallbackFactory implements FallbackFactory<RemoteDeptService> {
|
||||||
|
@Override
|
||||||
|
public RemoteDeptService create(Throwable cause) {
|
||||||
|
log.error("sys服务调用失败:{}", cause.getMessage());
|
||||||
|
return new RemoteDeptService() {
|
||||||
|
@Override
|
||||||
|
public Result list(SysDept dept) {
|
||||||
|
return Result.error("调用失败..."+cause.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据企业ID获取企业下部门
|
||||||
|
*
|
||||||
|
* @param enterpriseId 企业ID
|
||||||
|
*
|
||||||
|
* @return 企业信息,内含有部门
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<SysDept> getSysDeptByEnterpriseId (Long enterpriseId) {
|
||||||
|
return Result.error("调用失败..."+cause.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
com.couplet.common.system.remote.factory.RemoteUserFallbackFactory
|
com.couplet.common.system.remote.factory.RemoteUserFallbackFactory
|
||||||
com.couplet.common.system.remote.factory.RemoteLogFallbackFactory
|
com.couplet.common.system.remote.factory.RemoteLogFallbackFactory
|
||||||
com.couplet.common.system.remote.factory.RemoteFileFallbackFactory
|
com.couplet.common.system.remote.factory.RemoteFileFallbackFactory
|
||||||
|
com.couplet.common.system.remote.factory.RemoteDeptFallbackFactory
|
||||||
|
|
|
@ -15,9 +15,11 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/jarRepositories.xml
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/libraries/
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
|
@ -0,0 +1,38 @@
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/jarRepositories.xml
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/libraries/
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?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.couplet</groupId>
|
||||||
|
<artifactId>couplet-electronic-fence</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
|
||||||
|
<artifactId>couplet-electronic-fence-common</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
couplet-electronic-fence-common
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.couplet.map.common.domin;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.couplet.common.core.web.domain.BaseEntity;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LiJiaYao
|
||||||
|
* @Date: 2024/3/28
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName("couplet_fence")
|
||||||
|
public class Fence extends BaseEntity {
|
||||||
|
|
||||||
|
@TableId(value = "fence_id", type = IdType.AUTO)
|
||||||
|
/**
|
||||||
|
* 围栏id
|
||||||
|
*/
|
||||||
|
private Long fenceId;
|
||||||
|
/**
|
||||||
|
* 围栏名称
|
||||||
|
*/
|
||||||
|
private String fenceName;
|
||||||
|
/**
|
||||||
|
* 围栏经纬度
|
||||||
|
*/
|
||||||
|
private String fenceLongitudeLatitude;
|
||||||
|
/**
|
||||||
|
* 围栏描述
|
||||||
|
*/
|
||||||
|
private String fenceDescription;
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
private Integer isDelete;
|
||||||
|
/**
|
||||||
|
* 围栏状态
|
||||||
|
*/
|
||||||
|
private Integer fenceState;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date createTime;
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createName;
|
||||||
|
/**
|
||||||
|
* 维护人
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String maintainerName;
|
||||||
|
/**
|
||||||
|
* 告警状态
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Integer alarmStatus;
|
||||||
|
/**
|
||||||
|
* 围栏类型
|
||||||
|
*/
|
||||||
|
private Integer fenceType;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.couplet.map.common.domin.request;
|
||||||
|
|
||||||
|
import com.couplet.common.core.web.domain.BaseEntity;
|
||||||
|
import com.couplet.map.common.domin.Fence;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LiJiaYao
|
||||||
|
* @Date: 2024/3/28
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FenceConfig{
|
||||||
|
|
||||||
|
|
||||||
|
private String fenceName;
|
||||||
|
/**
|
||||||
|
* 围栏经纬度
|
||||||
|
*/
|
||||||
|
private String fenceLongitudeLatitude;
|
||||||
|
private Integer pageNum=1;
|
||||||
|
private Integer pageSize=3;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/jarRepositories.xml
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/libraries/
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?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.couplet</groupId>
|
||||||
|
<artifactId>couplet-electronic-fence</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>couplet-electronic-fence-remote</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>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-electronic-fence-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,38 @@
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/jarRepositories.xml
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/libraries/
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
|
@ -0,0 +1,116 @@
|
||||||
|
<?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.couplet</groupId>
|
||||||
|
<artifactId>couplet-electronic-fence</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>couplet-electronic-fence-server</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>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-electronic-fence-common</artifactId>
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<!-- Swagger UI -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
|
<version>${swagger.fox.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataSource -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-datasource</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataScope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-datascope</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Log -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-log</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Swagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-swagger</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>
|
||||||
|
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.couplet.map.server;
|
||||||
|
|
||||||
|
import com.couplet.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.couplet.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import com.couplet.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统模块
|
||||||
|
*
|
||||||
|
* @author couplet
|
||||||
|
*/
|
||||||
|
@EnableCustomConfig
|
||||||
|
@EnableCustomSwagger2
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
public class CoupletElectronicFenceApplication {
|
||||||
|
public static void main (String[] args) {
|
||||||
|
SpringApplication.run(CoupletElectronicFenceApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.couplet.map.server.controller;
|
||||||
|
|
||||||
|
import com.couplet.common.core.domain.Result;
|
||||||
|
import com.couplet.common.core.web.controller.BaseController;
|
||||||
|
import com.couplet.map.common.domin.Fence;
|
||||||
|
import com.couplet.map.common.domin.request.FenceConfig;
|
||||||
|
import com.couplet.map.server.service.FenceService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import static com.couplet.common.core.utils.PageUtils.startPage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LiJiaYao
|
||||||
|
* @Date: 2024/3/28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/fence")
|
||||||
|
public class FenceController extends BaseController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调用服务
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private FenceService fenceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取围栏列表
|
||||||
|
* @return
|
||||||
|
* @param fenceConfig
|
||||||
|
*/
|
||||||
|
@GetMapping("/fenceList")
|
||||||
|
public Result<?> fenceList(@RequestBody FenceConfig fenceConfig){
|
||||||
|
|
||||||
|
startPage();
|
||||||
|
List<Fence> list = fenceService.pageQuery(fenceConfig);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.couplet.map.server.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.couplet.map.common.domin.Fence;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LiJiaYao
|
||||||
|
* @Date: 2024/3/28
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface FenceMapper extends BaseMapper<Fence> {
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.couplet.map.server.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.couplet.map.common.domin.Fence;
|
||||||
|
import com.couplet.map.common.domin.request.FenceConfig;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LiJiaYao
|
||||||
|
* @Date: 2024/3/28
|
||||||
|
*/
|
||||||
|
public interface FenceService extends IService<Fence> {
|
||||||
|
List<Fence> pageQuery(FenceConfig fenceConfig);
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.couplet.map.server.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.couplet.map.common.domin.Fence;
|
||||||
|
import com.couplet.map.common.domin.request.FenceConfig;
|
||||||
|
import com.couplet.map.server.mapper.FenceMapper;
|
||||||
|
import com.couplet.map.server.service.FenceService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LiJiaYao
|
||||||
|
* @Date: 2024/3/28
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class FenceServiceImpl extends ServiceImpl<FenceMapper, Fence> implements FenceService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调用围栏mapper
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private FenceMapper fenceMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Fence> pageQuery(FenceConfig fenceConfig) {
|
||||||
|
LambdaQueryWrapper<Fence> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
return this.list(queryWrapper);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 9999
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: couplet-electronic-fence
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 121.89.211.230:8848
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 121.89.211.230:8848
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.couplet.trouble.mapper: DEBUG
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.couplet.map.server.mapper.FenceMapper">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?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.couplet</groupId>
|
||||||
|
<artifactId>couplet-modules</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<artifactId>couplet-electronic-fence</artifactId>
|
||||||
|
|
||||||
|
<modules>
|
||||||
|
<module>couplet-electronic-fence-server</module>
|
||||||
|
<module>couplet-electronic-fence-common</module>
|
||||||
|
<module>couplet-electronic-fence-remote</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?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.couplet</groupId>
|
||||||
|
<artifactId>couplet-enterprisemanagement</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>couplet-enterprisemanagement-common</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>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-system</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?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.couplet</groupId>
|
||||||
|
<artifactId>couplet-enterprisemanagement</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>couplet-enterprisemanagement-remote</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>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-enterprisemanagement-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,88 @@
|
||||||
|
<?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.couplet</groupId>
|
||||||
|
<artifactId>couplet-enterprisemanagement</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>couplet-enterprisemanagement-server</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>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-enterprisemanagement-common</artifactId>
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<!-- Swagger UI -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
|
<version>${swagger.fox.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataSource -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-datasource</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataScope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-datascope</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Log -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-log</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Swagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-swagger</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.couplet.server;
|
||||||
|
|
||||||
|
import com.couplet.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.couplet.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import com.couplet.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fufanrui
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 启动类
|
||||||
|
* @date 2024/3/27 14:04
|
||||||
|
*/
|
||||||
|
@EnableCustomConfig
|
||||||
|
@EnableCustomSwagger2
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
public class CoupleManagementApp {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
SpringApplication.run(CoupleManagementApp.class, args);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.couplet.server.controller;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fufanrui
|
||||||
|
* @version 1.0
|
||||||
|
* @description: TODO
|
||||||
|
* @date 2024/3/27 15:33
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/manage")
|
||||||
|
public class ManageController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.couplet.server.service;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
public interface ManageServer {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.couplet.server.service.impl;
|
||||||
|
|
||||||
|
import com.couplet.common.core.domain.Result;
|
||||||
|
import com.couplet.common.security.utils.SecurityUtils;
|
||||||
|
import com.couplet.common.system.domain.SysDept;
|
||||||
|
import com.couplet.common.system.remote.RemoteDeptService;
|
||||||
|
import com.couplet.server.service.ManageServer;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fufanrui
|
||||||
|
* @version 1.0
|
||||||
|
* @description: TODO
|
||||||
|
* @date 2024/3/27 15:34
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ManageServiceImpl implements ManageServer {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RemoteDeptService remoteDeptService;
|
||||||
|
{
|
||||||
|
Long enterpriseId = SecurityUtils.getEnterpriseId();
|
||||||
|
Result<SysDept> sysDeptByEnterpriseId = remoteDeptService.getSysDeptByEnterpriseId(enterpriseId);
|
||||||
|
if (sysDeptByEnterpriseId.getCode() == 200){
|
||||||
|
SysDept sysDept = sysDeptByEnterpriseId.getData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 9222
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: couplet-enterprisemanagement
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.couplet.system.mapper: DEBUG
|
|
@ -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/couplet-system"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<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.couplet" 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,26 @@
|
||||||
|
<?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.couplet</groupId>
|
||||||
|
<artifactId>couplet-modules</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>couplet-enterprisemanagement</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>couplet-enterprisemanagement-common</module>
|
||||||
|
<module>couplet-enterprisemanagement-server</module>
|
||||||
|
<module>couplet-enterprisemanagement-remote</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -15,13 +15,13 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
shared-configs:
|
shared-configs:
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
|
||||||
|
|
|
@ -15,13 +15,13 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
shared-configs:
|
shared-configs:
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
|
||||||
|
|
|
@ -15,13 +15,13 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
shared-configs:
|
shared-configs:
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
|
||||||
|
|
|
@ -0,0 +1,120 @@
|
||||||
|
<?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.couplet</groupId>
|
||||||
|
<artifactId>couplet-modules</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>couplet-modules-mqtt</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>-->
|
||||||
|
|
||||||
|
<description>
|
||||||
|
couplet-modules-mqttx获取报文模块
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<!-- Swagger UI -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
|
<version>${swagger.fox.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataSource -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-datasource</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataScope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-datascope</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Log -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-log</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Swagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-swagger</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mqttx依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.paho</groupId>
|
||||||
|
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||||
|
<version>1.2.5</version>
|
||||||
|
</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>
|
||||||
|
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.couplet.mqtt;
|
||||||
|
|
||||||
|
import com.couplet.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.couplet.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import com.couplet.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
|
import com.couplet.mqtt.service.impl.MqttListen;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: Default (Template) Project
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/28
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@EnableCustomConfig
|
||||||
|
@EnableCustomSwagger2
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
public class LyhMqttxApplatcaion {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(LyhMqttxApplatcaion.class, args);
|
||||||
|
System.out.println("获取报文模块启动成功");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.couplet.mqtt.controller;
|
||||||
|
|
||||||
|
import org.eclipse.paho.client.mqttv3.*;
|
||||||
|
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/28
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Test {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String broker = "tcp://115.159.47.13:1883";
|
||||||
|
String clientId = "JavaMqttSubscriber";
|
||||||
|
String topic = "test"; // 替换成您要订阅的主题
|
||||||
|
|
||||||
|
try {
|
||||||
|
MqttClient client = new MqttClient(broker, clientId, new MemoryPersistence());
|
||||||
|
MqttConnectOptions connOpts = new MqttConnectOptions();
|
||||||
|
connOpts.setCleanSession(true);
|
||||||
|
|
||||||
|
System.out.println("Connecting to broker: " + broker);
|
||||||
|
client.connect(connOpts);
|
||||||
|
System.out.println("Connected");
|
||||||
|
|
||||||
|
client.setCallback(new MqttCallback() {
|
||||||
|
@Override
|
||||||
|
public void connectionLost(Throwable cause) {
|
||||||
|
System.out.println("Connection lost");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void messageArrived(String topic, MqttMessage message) throws Exception {
|
||||||
|
System.out.println("Received message: " + new String(message.getPayload()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deliveryComplete(IMqttDeliveryToken token) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
client.subscribe(topic);
|
||||||
|
System.out.println("Subscribed to topic: " + topic);
|
||||||
|
} catch (MqttException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.couplet.mqtt.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/28
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Mapper
|
||||||
|
public interface MqttMapper {
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.couplet.mqtt.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/28
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface MqttService {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,108 @@
|
||||||
|
package com.couplet.mqtt.service.impl;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.eclipse.paho.client.mqttv3.*;
|
||||||
|
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/28
|
||||||
|
* @Description: mqtt客户端
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class MqttListen {
|
||||||
|
/*
|
||||||
|
* 路径
|
||||||
|
* */
|
||||||
|
@Value("${mqtt.server.broker}")
|
||||||
|
private String BROKER;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 主题
|
||||||
|
* */
|
||||||
|
@Value("${mqtt.server.topic}")
|
||||||
|
private String TOPIC;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 客户端id
|
||||||
|
* */
|
||||||
|
@Value("${mqtt.server.clientid}")
|
||||||
|
private String CLIENTID;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 用户名
|
||||||
|
* */
|
||||||
|
@Value("${mqtt.server.username}")
|
||||||
|
private String USERNAME;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 密码
|
||||||
|
* */
|
||||||
|
@Value("${mqtt.server.password}")
|
||||||
|
private String PASSWORD;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* qos
|
||||||
|
* */
|
||||||
|
@Value("${mqtt.server.qos}")
|
||||||
|
private Integer QOS;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void connect() {
|
||||||
|
System.out.println("监听者启动");
|
||||||
|
try {
|
||||||
|
|
||||||
|
MqttClient client = new MqttClient(BROKER, CLIENTID, new MemoryPersistence());
|
||||||
|
MqttConnectOptions options = new MqttConnectOptions();
|
||||||
|
options.setUserName(USERNAME);
|
||||||
|
options.setPassword(PASSWORD.toCharArray());
|
||||||
|
|
||||||
|
//连接超时
|
||||||
|
options.setConnectionTimeout(60);
|
||||||
|
|
||||||
|
//心跳
|
||||||
|
options.setKeepAliveInterval(60);
|
||||||
|
|
||||||
|
log.info("连接到:"+BROKER);
|
||||||
|
|
||||||
|
client.connect(options);
|
||||||
|
log.info("连接成功");
|
||||||
|
|
||||||
|
//设置回调
|
||||||
|
client.setCallback(new MqttCallback() {
|
||||||
|
@Override
|
||||||
|
public void connectionLost(Throwable throwable) {
|
||||||
|
log.error("连接断开:" + throwable.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void messageArrived(String topic, MqttMessage message) throws Exception {
|
||||||
|
log.info("消息到达");
|
||||||
|
log.info("接收消息主题:" + topic);
|
||||||
|
log.info("接收消息Qos:" + message.getQos());
|
||||||
|
log.info("接收消息内容:" + new String(message.getPayload()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deliveryComplete(IMqttDeliveryToken token) {
|
||||||
|
log.info("消息发送成功----------" + token.isComplete());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
client.subscribe(TOPIC, QOS);
|
||||||
|
|
||||||
|
|
||||||
|
} catch (MqttException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.couplet.mqtt.service.impl;
|
||||||
|
|
||||||
|
import com.couplet.mqtt.service.MqttService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/28
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MqttServiceImpl implements MqttService {
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,40 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 9616
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: couplet-mqtt
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 172469
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 172469
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.couplet.system.mapper: DEBUG
|
||||||
|
|
||||||
|
# 订阅端配置
|
||||||
|
mqtt:
|
||||||
|
server:
|
||||||
|
broker: tcp://115.159.47.13:1883
|
||||||
|
username:
|
||||||
|
password:
|
||||||
|
clientid: mqttx
|
||||||
|
qos: 0
|
||||||
|
topic: test
|
|
@ -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/couplet-system"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<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.couplet" 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,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.couplet.mqtt.mapper.MqttMapper">
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,114 @@
|
||||||
|
<?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">
|
||||||
|
<parent>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-modules</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>couplet-modules-vehicle</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>-->
|
||||||
|
|
||||||
|
<description>
|
||||||
|
couplet-modules-vehicle车辆管理模块
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<!-- Swagger UI -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
|
<version>${swagger.fox.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataSource -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-datasource</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataScope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-datascope</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Log -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-log</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Swagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-swagger</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>
|
||||||
|
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.couplet.vehicle;
|
||||||
|
|
||||||
|
import com.couplet.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.couplet.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import com.couplet.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: Default (Template) Project
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/26
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@EnableCustomConfig
|
||||||
|
@EnableCustomSwagger2
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
public class CoupletVehicleApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(CoupletVehicleApplication.class, args);
|
||||||
|
System.out.println("车辆管理模块启动成功");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,92 @@
|
||||||
|
package com.couplet.vehicle.controller;
|
||||||
|
|
||||||
|
import com.couplet.common.core.domain.Result;
|
||||||
|
import com.couplet.common.core.web.controller.BaseController;
|
||||||
|
import com.couplet.common.log.annotation.Log;
|
||||||
|
import com.couplet.common.log.enums.BusinessType;
|
||||||
|
import com.couplet.vehicle.domain.LyhVehicle;
|
||||||
|
import com.couplet.vehicle.domain.req.VehicleEditParams;
|
||||||
|
import com.couplet.vehicle.domain.req.VehicleInsertParams;
|
||||||
|
import com.couplet.vehicle.domain.req.VehicleListParams;
|
||||||
|
import com.couplet.vehicle.service.VehicleService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/26
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/vehicle")
|
||||||
|
public class VehicleController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private VehicleService lyhVehicleService;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @Date: 2024/3/26 21:39
|
||||||
|
* @Description: 查询车辆列表
|
||||||
|
* @Param: [listParams]
|
||||||
|
* @Return: com.couplet.common.core.domain.Result
|
||||||
|
**/
|
||||||
|
@PostMapping("/list")
|
||||||
|
@Log(title = "车辆列表")
|
||||||
|
public Result list(@RequestBody VehicleListParams listParams) {
|
||||||
|
|
||||||
|
List<LyhVehicle> List = lyhVehicleService.list(listParams);
|
||||||
|
|
||||||
|
return Result.success(List);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @Date: 2024/3/26 22:35
|
||||||
|
* @Description: 通过id删除车辆
|
||||||
|
* @Param: [vehicleId]
|
||||||
|
* @Return: com.couplet.common.core.domain.Result
|
||||||
|
**/
|
||||||
|
@GetMapping("/deleteById/{vehicleId}")
|
||||||
|
@Log(title = "删除车辆", businessType = BusinessType.DELETE)
|
||||||
|
public Result deleteById(@PathVariable Long vehicleId) {
|
||||||
|
String result = lyhVehicleService.deleteById(vehicleId);
|
||||||
|
|
||||||
|
return Result.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @Date: 2024/3/27 16:09
|
||||||
|
* @Description: 编辑车辆
|
||||||
|
* @Param: [editParams]
|
||||||
|
* @Return: com.couplet.common.core.domain.Result
|
||||||
|
**/
|
||||||
|
@PostMapping("/editById")
|
||||||
|
@Log(title = "编辑车辆", businessType = BusinessType.UPDATE)
|
||||||
|
public Result editById(@RequestBody VehicleEditParams editParams) {
|
||||||
|
|
||||||
|
String result = lyhVehicleService.editById(editParams);
|
||||||
|
|
||||||
|
return Result.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @Date: 2024/3/27 16:21
|
||||||
|
* @Description: 新增车辆
|
||||||
|
* @Param: [insertParams]
|
||||||
|
* @Return: com.couplet.common.core.domain.Result
|
||||||
|
**/
|
||||||
|
@PostMapping("/insert")
|
||||||
|
@Log(title = "新增车辆", businessType = BusinessType.INSERT)
|
||||||
|
public Result insert(@RequestBody VehicleInsertParams insertParams) {
|
||||||
|
|
||||||
|
String result = lyhVehicleService.insert(insertParams);
|
||||||
|
|
||||||
|
return Result.success(result);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.couplet.vehicle.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/26
|
||||||
|
* @Description: 车辆信息表
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName("lyh_vehicle")
|
||||||
|
public class LyhVehicle {
|
||||||
|
|
||||||
|
/*
|
||||||
|
*车辆id
|
||||||
|
* */
|
||||||
|
@TableId(type = IdType.AUTO, value = "vehicle_id")
|
||||||
|
private Long vehicleId;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*车辆类型
|
||||||
|
* */
|
||||||
|
@TableField(value = "vehicle_type")
|
||||||
|
private Integer vehicleType;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*电机厂商
|
||||||
|
* */
|
||||||
|
@TableField(value = "motor_manufacturer")
|
||||||
|
private String motorManufacturer;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*电池厂商
|
||||||
|
* */
|
||||||
|
@TableField(value = "battery_manufacturer")
|
||||||
|
private String batteryManufacturer;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*电机编号
|
||||||
|
* */
|
||||||
|
@TableField(value = "motor_number")
|
||||||
|
private String motorNumber;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*电池编号
|
||||||
|
* */
|
||||||
|
@TableField(value = "battery_number")
|
||||||
|
private String batteryNumber;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*vin码
|
||||||
|
* */
|
||||||
|
@TableField(value = "vin")
|
||||||
|
private String vin;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*0离线 1在线
|
||||||
|
* */
|
||||||
|
@TableField(value = "vehicle_state")
|
||||||
|
private Integer vehicleState;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*0未删除 1删除
|
||||||
|
* */
|
||||||
|
@TableField(value = "isdelete")
|
||||||
|
private Integer isdelete;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.couplet.vehicle.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/27
|
||||||
|
* @Description: 车辆编辑入参
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class VehicleEditParams {
|
||||||
|
/*
|
||||||
|
*车辆id
|
||||||
|
* */
|
||||||
|
private Long vehicleId;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*车辆类型
|
||||||
|
* */
|
||||||
|
private Integer vehicleType;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*电机厂商
|
||||||
|
* */
|
||||||
|
private String motorManufacturer;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*电池厂商
|
||||||
|
* */
|
||||||
|
private String batteryManufacturer;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*电机编号
|
||||||
|
* */
|
||||||
|
private String motorNumber;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*电池编号
|
||||||
|
* */
|
||||||
|
private String batteryNumber;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.couplet.vehicle.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/27
|
||||||
|
* @Description: 车辆编辑入参
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class VehicleInsertParams {
|
||||||
|
|
||||||
|
/*
|
||||||
|
*车辆类型
|
||||||
|
* */
|
||||||
|
@NotNull(message = "车辆类型不能为空")
|
||||||
|
private Integer vehicleType;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*电机厂商
|
||||||
|
* */
|
||||||
|
@NotBlank(message = "电机厂商不能为空")
|
||||||
|
private String motorManufacturer;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*电池厂商
|
||||||
|
* */
|
||||||
|
@NotBlank(message = "电池厂商不能为空")
|
||||||
|
private String batteryManufacturer;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*电机编号
|
||||||
|
* */
|
||||||
|
@NotBlank(message = "电机编号不能为空")
|
||||||
|
private String motorNumber;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*电池编号
|
||||||
|
* */
|
||||||
|
@NotBlank(message = "电池编号不能为空")
|
||||||
|
private String batteryNumber;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.couplet.vehicle.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/26
|
||||||
|
* @Description: 查询车辆列表入参
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class VehicleListParams {
|
||||||
|
/*
|
||||||
|
*车辆类型
|
||||||
|
* */
|
||||||
|
private Integer vehicleType;
|
||||||
|
|
||||||
|
/*
|
||||||
|
*0离线 1在线
|
||||||
|
* */
|
||||||
|
private Integer vehicleState;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.couplet.vehicle.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.couplet.vehicle.domain.LyhVehicle;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/26
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
@Component
|
||||||
|
public interface VehicleMapper extends BaseMapper<LyhVehicle> {
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.couplet.vehicle.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.couplet.vehicle.domain.LyhVehicle;
|
||||||
|
import com.couplet.vehicle.domain.req.VehicleEditParams;
|
||||||
|
import com.couplet.vehicle.domain.req.VehicleInsertParams;
|
||||||
|
import com.couplet.vehicle.domain.req.VehicleListParams;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/26
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface VehicleService extends IService<LyhVehicle> {
|
||||||
|
List<LyhVehicle> list(VehicleListParams listParams);
|
||||||
|
|
||||||
|
String deleteById(Long vehicleId);
|
||||||
|
|
||||||
|
String editById(VehicleEditParams editParams);
|
||||||
|
|
||||||
|
String insert(VehicleInsertParams insertParams);
|
||||||
|
}
|
|
@ -0,0 +1,162 @@
|
||||||
|
package com.couplet.vehicle.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.couplet.common.core.utils.StringUtils;
|
||||||
|
import com.couplet.vehicle.domain.LyhVehicle;
|
||||||
|
import com.couplet.vehicle.domain.req.VehicleEditParams;
|
||||||
|
import com.couplet.vehicle.domain.req.VehicleInsertParams;
|
||||||
|
import com.couplet.vehicle.domain.req.VehicleListParams;
|
||||||
|
import com.couplet.vehicle.mapper.VehicleMapper;
|
||||||
|
import com.couplet.vehicle.service.VehicleService;
|
||||||
|
import com.couplet.vehicle.utils.SnowflakeIdGenerator;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/26
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, LyhVehicle> implements VehicleService {
|
||||||
|
@Autowired
|
||||||
|
private VehicleMapper lyhVehicleMapper;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @Date: 2024/3/26 22:11
|
||||||
|
* @Description: 查询列表
|
||||||
|
* @Param: [listParams]
|
||||||
|
* @Return: java.util.List<com.couplet.vehicle.domain.LyhVehicle>
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public List<LyhVehicle> list(VehicleListParams listParams) {
|
||||||
|
// 创建查询条件包装器
|
||||||
|
LambdaQueryWrapper<LyhVehicle> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
// 如果车辆类型不为空,添加车辆类型作为查询条件
|
||||||
|
if (!StringUtils.isNull(listParams.getVehicleType())) {
|
||||||
|
queryWrapper.eq(LyhVehicle::getVehicleType, listParams.getVehicleType());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果车辆状态不为空,添加车辆状态作为查询条件
|
||||||
|
if (!StringUtils.isNull(listParams.getVehicleState())) {
|
||||||
|
queryWrapper.eq(LyhVehicle::getVehicleState, listParams.getVehicleState());
|
||||||
|
}
|
||||||
|
|
||||||
|
//只查询车辆未被删除的
|
||||||
|
queryWrapper.eq(LyhVehicle::getIsdelete, 0);
|
||||||
|
|
||||||
|
// 执行查询并返回结果
|
||||||
|
return this.list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @Date: 2024/3/26 22:31
|
||||||
|
* @Description: 通过id删除
|
||||||
|
* @Param: [vehicleId]
|
||||||
|
* @Return: java.lang.String
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public String deleteById(Long vehicleId) {
|
||||||
|
String result = "";
|
||||||
|
|
||||||
|
UpdateWrapper<LyhVehicle> updateWrapper = new UpdateWrapper<>();
|
||||||
|
|
||||||
|
updateWrapper.set("isdelete", 1)
|
||||||
|
.eq("vehicle_id", vehicleId);
|
||||||
|
|
||||||
|
boolean update = update(updateWrapper);
|
||||||
|
|
||||||
|
if (!update) {
|
||||||
|
result = "删除失败";
|
||||||
|
throw new RuntimeException(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
result = "删除成功!";
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @Date: 2024/3/27 15:21
|
||||||
|
* @Description: 通过id进行编辑
|
||||||
|
* @Param: [editParams]
|
||||||
|
* @Return: java.lang.String
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public String editById(VehicleEditParams editParams) {
|
||||||
|
String result = "";
|
||||||
|
|
||||||
|
UpdateWrapper<LyhVehicle> updateWrapper = new UpdateWrapper<>();
|
||||||
|
|
||||||
|
//编辑车辆类型
|
||||||
|
|
||||||
|
updateWrapper.set("vehicle_type", editParams.getVehicleType())
|
||||||
|
|
||||||
|
//编辑电机厂商
|
||||||
|
.set("motor_manufacturer", editParams.getMotorManufacturer())
|
||||||
|
|
||||||
|
//编辑电池厂商
|
||||||
|
.set("battery_manufacturer", editParams.getBatteryManufacturer())
|
||||||
|
|
||||||
|
//编辑电机编号
|
||||||
|
.set("motor_number", editParams.getMotorNumber())
|
||||||
|
|
||||||
|
//编辑电池编号
|
||||||
|
.set("battery_number", editParams.getBatteryNumber())
|
||||||
|
|
||||||
|
//匹配车辆id
|
||||||
|
.eq("vehicle_id", editParams.getVehicleId());
|
||||||
|
|
||||||
|
|
||||||
|
boolean update = update(updateWrapper);
|
||||||
|
|
||||||
|
if (!update) {
|
||||||
|
result = "编辑失败";
|
||||||
|
throw new RuntimeException(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
result = "编辑成功!";
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @Date: 2024/3/27 16:34
|
||||||
|
* @Description: 新增车辆
|
||||||
|
* @Param: [insertParams]
|
||||||
|
* @Return: java.lang.String
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public String insert(VehicleInsertParams insertParams) {
|
||||||
|
String result = "";
|
||||||
|
|
||||||
|
SnowflakeIdGenerator idGenerator = new SnowflakeIdGenerator(1, 1);
|
||||||
|
long randomId = idGenerator.nextId();
|
||||||
|
String vin = "VIN" + randomId;
|
||||||
|
|
||||||
|
int insert = lyhVehicleMapper.insert(new LyhVehicle(null, insertParams.getVehicleType(), insertParams.getMotorManufacturer(), insertParams.getBatteryManufacturer(), insertParams.getMotorNumber(), insertParams.getBatteryNumber(), vin, 0, 0));
|
||||||
|
|
||||||
|
if (insert == 0) {
|
||||||
|
result = "新增失败";
|
||||||
|
throw new RuntimeException(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
result = "新增成功!";
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,79 @@
|
||||||
|
package com.couplet.vehicle.utils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/27
|
||||||
|
* @Description: 雪花ID生成器
|
||||||
|
* 使用方法
|
||||||
|
* SnowflakeIdGenerator idGenerator = new SnowflakeIdGenerator(1, 1); // 创建一个 ID 生成器,传入机器 ID 和数据中心 ID
|
||||||
|
* long id = idGenerator.nextId(); // 生成 ID
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class SnowflakeIdGenerator {
|
||||||
|
|
||||||
|
private final long epoch = 1420041600000L; // 起始时间戳,用于缩小时间戳范围,可根据实际情况调整
|
||||||
|
private final long workerIdBits = 5L; // 机器 ID 所占位数
|
||||||
|
private final long dataCenterIdBits = 5L; // 数据中心 ID 所占位数
|
||||||
|
private final long sequenceBits = 12L; // 序列号所占位数
|
||||||
|
|
||||||
|
private final long maxWorkerId = -1L ^ (-1L << workerIdBits); // 机器 ID 最大值
|
||||||
|
private final long maxDataCenterId = -1L ^ (-1L << dataCenterIdBits); // 数据中心 ID 最大值
|
||||||
|
private final long maxSequence = -1L ^ (-1L << sequenceBits); // 序列号最大值
|
||||||
|
|
||||||
|
private final long workerIdShift = sequenceBits; // 机器 ID 向左移动位数
|
||||||
|
private final long dataCenterIdShift = sequenceBits + workerIdBits; // 数据中心 ID 向左移动位数
|
||||||
|
private final long timestampShift = sequenceBits + workerIdBits + dataCenterIdBits; // 时间戳向左移动位数
|
||||||
|
|
||||||
|
private long workerId; // 机器 ID
|
||||||
|
private long dataCenterId; // 数据中心 ID
|
||||||
|
private long sequence = 0L; // 序列号
|
||||||
|
private long lastTimestamp = -1L; // 上次生成的时间戳
|
||||||
|
|
||||||
|
public SnowflakeIdGenerator(long workerId, long dataCenterId) {
|
||||||
|
if (workerId > maxWorkerId || workerId < 0) {
|
||||||
|
throw new IllegalArgumentException("Worker ID can't be greater than " + maxWorkerId + " or less than 0");
|
||||||
|
}
|
||||||
|
if (dataCenterId > maxDataCenterId || dataCenterId < 0) {
|
||||||
|
throw new IllegalArgumentException("Data center ID can't be greater than " + maxDataCenterId + " or less than 0");
|
||||||
|
}
|
||||||
|
this.workerId = workerId;
|
||||||
|
this.dataCenterId = dataCenterId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized long nextId() {
|
||||||
|
long timestamp = timeGen();
|
||||||
|
|
||||||
|
if (timestamp < lastTimestamp) {
|
||||||
|
throw new RuntimeException("Clock moved backwards, refusing to generate ID");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (timestamp == lastTimestamp) {
|
||||||
|
sequence = (sequence + 1) & maxSequence;
|
||||||
|
if (sequence == 0) {
|
||||||
|
timestamp = tilNextMillis(lastTimestamp);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sequence = 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
lastTimestamp = timestamp;
|
||||||
|
|
||||||
|
return ((timestamp - epoch) << timestampShift) |
|
||||||
|
(dataCenterId << dataCenterIdShift) |
|
||||||
|
(workerId << workerIdShift) |
|
||||||
|
sequence;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long tilNextMillis(long lastTimestamp) {
|
||||||
|
long timestamp = timeGen();
|
||||||
|
while (timestamp <= lastTimestamp) {
|
||||||
|
timestamp = timeGen();
|
||||||
|
}
|
||||||
|
return timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long timeGen() {
|
||||||
|
return System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 9615
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: couplet-vehicle
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 172469
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 172469
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.couplet.system.mapper: DEBUG
|
|
@ -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/couplet-system"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<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.couplet" 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,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.couplet.vehicle.mapper.VehicleMapper">
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,20 @@
|
||||||
|
import com.couplet.vehicle.utils.SnowflakeIdGenerator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/27
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class IdTest {
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SnowflakeIdGenerator idGenerator = new SnowflakeIdGenerator(1, 1);
|
||||||
|
|
||||||
|
long l = idGenerator.nextId();
|
||||||
|
System.out.println(l);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,12 +14,9 @@ import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门信息
|
* 部门信息
|
||||||
*
|
|
||||||
* @author couplet
|
* @author couplet
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
|
@ -110,4 +107,15 @@ public class SysDeptController extends BaseController {
|
||||||
deptService.checkDeptDataScope(deptId);
|
deptService.checkDeptDataScope(deptId);
|
||||||
return toAjax(deptService.deleteDeptById(deptId));
|
return toAjax(deptService.deleteDeptById(deptId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据企业ID获取企业下部门
|
||||||
|
* @param enterpriseId 企业ID
|
||||||
|
* @return 企业信息,内含有部门
|
||||||
|
*/
|
||||||
|
@GetMapping("/getSysDeptByEnterpriseId/{enterpriseId}")
|
||||||
|
public Result<SysDept> getSysDeptByEnterpriseId(@PathVariable(value = "enterpriseId") Long enterpriseId){
|
||||||
|
SysDept sysDept = deptService.getSysDeptByEnterpriseId(enterpriseId);
|
||||||
|
return Result.success(sysDept);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.couplet.system.controller;
|
||||||
|
|
||||||
|
import com.couplet.common.core.domain.Result;
|
||||||
|
import com.couplet.common.system.domain.SysFirm;
|
||||||
|
import com.couplet.system.service.SysFirmService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName SysFirmController
|
||||||
|
* @Description 企业信息
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/3/28 22:14
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("firm")
|
||||||
|
public class SysFirmController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysFirmService sysFirmService;
|
||||||
|
/**
|
||||||
|
* @Description // 管理企业列表
|
||||||
|
* @Date 2024/3/28
|
||||||
|
* @param sysFirm
|
||||||
|
* @return com.couplet.common.core.domain.Result<java.util.List<com.couplet.common.system.domain.SysFirm>>
|
||||||
|
**/
|
||||||
|
@PostMapping("firmList")
|
||||||
|
public Result<List<SysFirm>> firmList(@RequestBody SysFirm sysFirm){
|
||||||
|
List<SysFirm> list = sysFirmService.firmList(sysFirm);
|
||||||
|
Result<List<SysFirm>> result = Result.success(list);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description // 添加企业 默认未认证
|
||||||
|
* @Date 2024/3/28
|
||||||
|
* @param sysFirm
|
||||||
|
* @return com.couplet.common.core.domain.Result
|
||||||
|
**/
|
||||||
|
@PostMapping("addFirm")
|
||||||
|
public Result addFirm(@RequestBody SysFirm sysFirm){
|
||||||
|
int i = sysFirmService.addFirm(sysFirm);
|
||||||
|
Result<Integer> result = Result.success(i);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description // 修改企业信息
|
||||||
|
* @Date 2024/3/28
|
||||||
|
* @param sysFirm
|
||||||
|
* @return com.couplet.common.core.domain.Result
|
||||||
|
**/
|
||||||
|
@PostMapping("updateFirm")
|
||||||
|
public Result updateFirm(@RequestBody SysFirm sysFirm){
|
||||||
|
int i = sysFirmService.updateFirm(sysFirm);
|
||||||
|
Result<Integer> result = Result.success(i);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
|
@ -107,10 +107,13 @@ public class SysUserController extends BaseController {
|
||||||
Set<String> roles = permissionService.getRolePermission(sysUser);
|
Set<String> roles = permissionService.getRolePermission(sysUser);
|
||||||
// 权限集合
|
// 权限集合
|
||||||
Set<String> permissions = permissionService.getMenuPermission(sysUser);
|
Set<String> permissions = permissionService.getMenuPermission(sysUser);
|
||||||
|
// 查询企业信息
|
||||||
|
Long deptId = deptService.selectDeptIdByLeader(sysUser.getUserName());
|
||||||
LoginUser sysUserVo = new LoginUser();
|
LoginUser sysUserVo = new LoginUser();
|
||||||
sysUserVo.setSysUser(sysUser);
|
sysUserVo.setSysUser(sysUser);
|
||||||
sysUserVo.setRoles(roles);
|
sysUserVo.setRoles(roles);
|
||||||
sysUserVo.setPermissions(permissions);
|
sysUserVo.setPermissions(permissions);
|
||||||
|
sysUserVo.setEnterpriseId(deptId);
|
||||||
return Result.success(sysUserVo);
|
return Result.success(sysUserVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.couplet.system.mapper;
|
||||||
|
|
||||||
|
import com.couplet.common.system.domain.SysFirm;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName SysFirmMapper
|
||||||
|
* @Description TODO
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/3/28 22:18
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SysFirmMapper {
|
||||||
|
List<SysFirm> firmList(SysFirm sysFirm);
|
||||||
|
|
||||||
|
int addFirm(SysFirm sysFirm);
|
||||||
|
|
||||||
|
int updateFirm(SysFirm sysFirm);
|
||||||
|
|
||||||
|
}
|
|
@ -135,4 +135,18 @@ public interface SysDeptService extends IService<SysDept> {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDeptById (Long deptId);
|
public int deleteDeptById (Long deptId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过负责人查询企业ID
|
||||||
|
* @param leader 负责人
|
||||||
|
* @return 企业ID
|
||||||
|
*/
|
||||||
|
Long selectDeptIdByLeader (String leader);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据企业ID获取企业下部门
|
||||||
|
* @param enterpriseId 企业ID
|
||||||
|
* @return 企业信息,内含有部门
|
||||||
|
*/
|
||||||
|
SysDept getSysDeptByEnterpriseId (Long enterpriseId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.couplet.system.service;
|
||||||
|
|
||||||
|
import com.couplet.common.system.domain.SysFirm;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName SysFirmService
|
||||||
|
* @Description TODO
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/3/28 22:17
|
||||||
|
*/
|
||||||
|
public interface SysFirmService {
|
||||||
|
List<SysFirm> firmList(SysFirm sysFirm);
|
||||||
|
|
||||||
|
int addFirm(SysFirm sysFirm);
|
||||||
|
|
||||||
|
int updateFirm(SysFirm sysFirm);
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package com.couplet.system.service.impl;
|
package com.couplet.system.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.couplet.common.core.constant.UserConstants;
|
import com.couplet.common.core.constant.UserConstants;
|
||||||
import com.couplet.common.core.exception.ServiceException;
|
import com.couplet.common.core.exception.ServiceException;
|
||||||
|
@ -17,6 +18,7 @@ import com.couplet.system.mapper.SysRoleMapper;
|
||||||
import com.couplet.system.service.SysDeptService;
|
import com.couplet.system.service.SysDeptService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -280,6 +282,34 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||||
return deptMapper.deleteDeptById(deptId);
|
return deptMapper.deleteDeptById(deptId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过负责人查询企业ID
|
||||||
|
*
|
||||||
|
* @param leader 负责人
|
||||||
|
*
|
||||||
|
* @return 企业ID
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Long selectDeptIdByLeader (String leader) {
|
||||||
|
SysDept sysDept = getOne(new LambdaQueryWrapper<>() {{
|
||||||
|
eq(SysDept::getLeader, leader);
|
||||||
|
}});
|
||||||
|
|
||||||
|
return sysDept == null ? null : sysDept.getDeptId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据企业ID获取企业下部门
|
||||||
|
*
|
||||||
|
* @param enterpriseId 企业ID
|
||||||
|
*
|
||||||
|
* @return 企业信息,内含有部门
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SysDept getSysDeptByEnterpriseId (Long enterpriseId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 递归列表
|
* 递归列表
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.couplet.system.service.impl;
|
||||||
|
|
||||||
|
import com.couplet.common.system.domain.SysFirm;
|
||||||
|
import com.couplet.system.mapper.SysFirmMapper;
|
||||||
|
import com.couplet.system.service.SysFirmService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName SysFirmServiceImpl
|
||||||
|
* @Description TODO
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/3/28 22:17
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysFirmServiceImpl implements SysFirmService {
|
||||||
|
@Autowired
|
||||||
|
private SysFirmMapper sysFirmMapper;
|
||||||
|
@Override
|
||||||
|
public List<SysFirm> firmList(SysFirm sysFirm) {
|
||||||
|
return sysFirmMapper.firmList(sysFirm);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int addFirm(SysFirm sysFirm) {
|
||||||
|
return sysFirmMapper.addFirm(sysFirm);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateFirm(SysFirm sysFirm) {
|
||||||
|
return sysFirmMapper.updateFirm(sysFirm);
|
||||||
|
}
|
||||||
|
}
|
|
@ -61,6 +61,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
@Override
|
@Override
|
||||||
@DataScope(deptAlias = "d", userAlias = "u")
|
@DataScope(deptAlias = "d", userAlias = "u")
|
||||||
public List<SysUser> selectUserList (SysUser user) {
|
public List<SysUser> selectUserList (SysUser user) {
|
||||||
|
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||||
|
user.setDeptId(deptId);
|
||||||
return userMapper.selectUserList(user);
|
return userMapper.selectUserList(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,16 +15,16 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
shared-configs:
|
shared-configs:
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
com.couplet.system.mapper: DEBUG
|
com.couplet.system.mapper: DEBUG
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.couplet.system.mapper.SysFirmMapper">
|
||||||
|
<insert id="addFirm">
|
||||||
|
INSERT INTO `ry-cloud`.`yyh_firm` ( `firm_name`)
|
||||||
|
VALUES ( #{firmName});
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
<update id="updateFirm">
|
||||||
|
|
||||||
|
UPDATE `ry-cloud`.`yyh_firm`
|
||||||
|
SET `firm_name` = #{firmName}, `approve_id` = #{approveId}
|
||||||
|
WHERE `firm_id` = #{firmId};
|
||||||
|
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="firmList" resultType="com.couplet.common.system.domain.SysFirm">
|
||||||
|
select * from yyh_firm;
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -15,7 +15,6 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
|
@ -24,7 +23,6 @@ spring:
|
||||||
# 共享配置
|
# 共享配置
|
||||||
shared-configs:
|
shared-configs:
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
com.couplet.trouble.mapper: DEBUG
|
com.couplet.trouble.mapper: DEBUG
|
||||||
|
|
|
@ -14,6 +14,10 @@
|
||||||
<module>couplet-job</module>
|
<module>couplet-job</module>
|
||||||
<module>couplet-file</module>
|
<module>couplet-file</module>
|
||||||
<module>couplet-trouble</module>
|
<module>couplet-trouble</module>
|
||||||
|
<module>couplet-electronic-fence</module>
|
||||||
|
<module>couplet-modules-vehicle</module>
|
||||||
|
<module>couplet-modules-mqtt</module>
|
||||||
|
<module>couplet-enterprisemanagement</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>couplet-modules</artifactId>
|
<artifactId>couplet-modules</artifactId>
|
||||||
|
|
|
@ -15,13 +15,13 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
shared-configs:
|
shared-configs:
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
|
||||||
|
|
34
pom.xml
34
pom.xml
|
@ -211,6 +211,40 @@
|
||||||
<artifactId>couplet-modules-system</artifactId>
|
<artifactId>couplet-modules-system</artifactId>
|
||||||
<version>${couplet.version}</version>
|
<version>${couplet.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-trouble</artifactId>
|
||||||
|
<version>${couplet.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-electronic-fence-server</artifactId>
|
||||||
|
<version>${couplet.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-electronic-fence-common</artifactId>
|
||||||
|
<version>${couplet.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-electronic-fence-remote</artifactId>
|
||||||
|
<version>${couplet.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 企业服务 模块 公共依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-enterprisemanagement-common</artifactId>
|
||||||
|
<version>${couplet.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 企业服务 模块 远程调用依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-enterprisemanagement-remote</artifactId>
|
||||||
|
<version>${couplet.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
Loading…
Reference in New Issue