任务模块初始化
commit
e25c93afbe
|
@ -0,0 +1,36 @@
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
logs
|
||||||
|
*.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,15 @@
|
||||||
|
#指定构建镜像的起始镜像
|
||||||
|
FROM anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/dragonwell:17.0.4.0.4.8-standard-ga-8.6
|
||||||
|
#定义时区参数
|
||||||
|
ENV TZ=Asia/Shanghai
|
||||||
|
#设置时区
|
||||||
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone
|
||||||
|
|
||||||
|
#挂载目录
|
||||||
|
VOLUME ["/home/logs/muyu-quest"]
|
||||||
|
|
||||||
|
#拷贝执行jar报
|
||||||
|
COPY ./muyu-quest-server/target/muyu-quest.jar /home/app.jar
|
||||||
|
|
||||||
|
ENTRYPOINT ["java","-Dfile.encoding=utf-8","-jar"]
|
||||||
|
CMD ["/home/app.jar"]
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-quest</artifactId>
|
||||||
|
<version>3.6.5</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>muyu-quest-client</artifactId>
|
||||||
|
<version>3.6.5</version>
|
||||||
|
|
||||||
|
<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.muyu</groupId>
|
||||||
|
<artifactId>muyu-quest-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -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.muyu</groupId>
|
||||||
|
<artifactId>muyu-quest</artifactId>
|
||||||
|
<version>3.6.5</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>muyu-quest-common</artifactId>
|
||||||
|
<version>3.6.5</version>
|
||||||
|
<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.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,149 @@
|
||||||
|
package com.muyu.quest.domain;
|
||||||
|
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点对象 node_source
|
||||||
|
*
|
||||||
|
* @author 2112A
|
||||||
|
* @date 2024-08-22
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class Node extends BaseEntity{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 自增主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 节点编码 */
|
||||||
|
@Excel(name = "节点编码")
|
||||||
|
private String nodeCode;
|
||||||
|
|
||||||
|
/** 节点名称 */
|
||||||
|
@Excel(name = "节点名称")
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
/** 节点入参 */
|
||||||
|
@Excel(name = "节点入参")
|
||||||
|
private String nodeReq;
|
||||||
|
|
||||||
|
/** 节点出参 */
|
||||||
|
@Excel(name = "节点出参")
|
||||||
|
private String nodeResp;
|
||||||
|
|
||||||
|
/** 上一级节点 */
|
||||||
|
@Excel(name = "上一级节点")
|
||||||
|
private String nodePreCode;
|
||||||
|
|
||||||
|
/** 下一级节点 */
|
||||||
|
@Excel(name = "下一级节点")
|
||||||
|
private String nodeNextCode;
|
||||||
|
|
||||||
|
/** 启用状态 */
|
||||||
|
@Excel(name = "启用状态")
|
||||||
|
private String state;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setNodeCode(String nodeCode)
|
||||||
|
{
|
||||||
|
this.nodeCode = nodeCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNodeCode()
|
||||||
|
{
|
||||||
|
return nodeCode;
|
||||||
|
}
|
||||||
|
public void setNodeName(String nodeName)
|
||||||
|
{
|
||||||
|
this.nodeName = nodeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNodeName()
|
||||||
|
{
|
||||||
|
return nodeName;
|
||||||
|
}
|
||||||
|
public void setNodeReq(String nodeReq)
|
||||||
|
{
|
||||||
|
this.nodeReq = nodeReq;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNodeReq()
|
||||||
|
{
|
||||||
|
return nodeReq;
|
||||||
|
}
|
||||||
|
public void setNodeResp(String nodeResp)
|
||||||
|
{
|
||||||
|
this.nodeResp = nodeResp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNodeResp()
|
||||||
|
{
|
||||||
|
return nodeResp;
|
||||||
|
}
|
||||||
|
public void setNodePreCode(String nodePreCode)
|
||||||
|
{
|
||||||
|
this.nodePreCode = nodePreCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNodePreCode()
|
||||||
|
{
|
||||||
|
return nodePreCode;
|
||||||
|
}
|
||||||
|
public void setNodeNextCode(String nodeNextCode)
|
||||||
|
{
|
||||||
|
this.nodeNextCode = nodeNextCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNodeNextCode()
|
||||||
|
{
|
||||||
|
return nodeNextCode;
|
||||||
|
}
|
||||||
|
public void setState(String state)
|
||||||
|
{
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getState()
|
||||||
|
{
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("nodeCode", getNodeCode())
|
||||||
|
.append("nodeName", getNodeName())
|
||||||
|
.append("nodeReq", getNodeReq())
|
||||||
|
.append("nodeResp", getNodeResp())
|
||||||
|
.append("nodePreCode", getNodePreCode())
|
||||||
|
.append("nodeNextCode", getNodeNextCode())
|
||||||
|
.append("state", getState())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,141 @@
|
||||||
|
package com.muyu.quest.domain;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务对象 task_source
|
||||||
|
*
|
||||||
|
* @author 2112A
|
||||||
|
* @date 2024-08-22
|
||||||
|
*/
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("task_source")
|
||||||
|
public class Task extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 自增主键 */
|
||||||
|
@TableId( type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 任务编码 */
|
||||||
|
@Excel(name = "任务编码")
|
||||||
|
private String taskCode;
|
||||||
|
|
||||||
|
/** 任务名称 */
|
||||||
|
@Excel(name = "任务名称")
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
/** 任务触发器 */
|
||||||
|
@Excel(name = "任务触发器")
|
||||||
|
private String taskWebhook;
|
||||||
|
|
||||||
|
/** 规则编码 */
|
||||||
|
@Excel(name = "规则编码")
|
||||||
|
private String ruleCode;
|
||||||
|
|
||||||
|
/** 任务类型 */
|
||||||
|
@Excel(name = "任务类型")
|
||||||
|
private String taskType;
|
||||||
|
|
||||||
|
/** 启用状态 */
|
||||||
|
@Excel(name = "启用状态")
|
||||||
|
private String state;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setTaskCode(String taskCode)
|
||||||
|
{
|
||||||
|
this.taskCode = taskCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskCode()
|
||||||
|
{
|
||||||
|
return taskCode;
|
||||||
|
}
|
||||||
|
public void setTaskName(String taskName)
|
||||||
|
{
|
||||||
|
this.taskName = taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskName()
|
||||||
|
{
|
||||||
|
return taskName;
|
||||||
|
}
|
||||||
|
public void setTaskWebhook(String taskWebhook)
|
||||||
|
{
|
||||||
|
this.taskWebhook = taskWebhook;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskWebhook()
|
||||||
|
{
|
||||||
|
return taskWebhook;
|
||||||
|
}
|
||||||
|
public void setRuleCode(String ruleCode)
|
||||||
|
{
|
||||||
|
this.ruleCode = ruleCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRuleCode()
|
||||||
|
{
|
||||||
|
return ruleCode;
|
||||||
|
}
|
||||||
|
public void setTaskType(String taskType)
|
||||||
|
{
|
||||||
|
this.taskType = taskType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskType()
|
||||||
|
{
|
||||||
|
return taskType;
|
||||||
|
}
|
||||||
|
public void setState(String state)
|
||||||
|
{
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getState()
|
||||||
|
{
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("taskCode", getTaskCode())
|
||||||
|
.append("taskName", getTaskName())
|
||||||
|
.append("taskWebhook", getTaskWebhook())
|
||||||
|
.append("ruleCode", getRuleCode())
|
||||||
|
.append("taskType", getTaskType())
|
||||||
|
.append("state", getState())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-quest</artifactId>
|
||||||
|
<version>3.6.5</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>muyu-quest-remote</artifactId>
|
||||||
|
<version>3.6.5</version>
|
||||||
|
|
||||||
|
<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.muyu</groupId>
|
||||||
|
<artifactId>muyu-quest-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,18 @@
|
||||||
|
//package com.muyu.source.remote;
|
||||||
|
//
|
||||||
|
//import com.muyu.source.remote.factory.RemoteDataSourceFactory;
|
||||||
|
//import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
//import com.muyu.common.core.constant.ServiceNameConstants;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * @ Tool:IntelliJ IDEA
|
||||||
|
// * @ Author:CHX
|
||||||
|
// * @ Date:2024-08-21-10:50
|
||||||
|
// * @ Version:1.0
|
||||||
|
// * @ Description:数据源远程调用
|
||||||
|
// * @author Lenovo
|
||||||
|
// */
|
||||||
|
//@FeignClient(contextId = "RemoteDataSourceService",value = ServiceNameConstants.SOURCE_SERVICE,fallbackFactory = RemoteDataSourceFactory.class, path = "/dataSource")
|
||||||
|
//public interface RemoteDataSourceService {
|
||||||
|
//
|
||||||
|
//}
|
|
@ -0,0 +1,19 @@
|
||||||
|
//package com.muyu.source.remote.factory;
|
||||||
|
//
|
||||||
|
//import com.muyu.source.remote.RemoteDataSourceService;
|
||||||
|
//import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * @ Tool:IntelliJ IDEA
|
||||||
|
// * @ Author:CHX
|
||||||
|
// * @ Date:2024-08-21-10:54
|
||||||
|
// * @ Version:1.0
|
||||||
|
// * @ Description:
|
||||||
|
// * @author Lenovo
|
||||||
|
// */
|
||||||
|
//public class RemoteDataSourceFactory implements FallbackFactory<RemoteDataSourceService> {
|
||||||
|
// @Override
|
||||||
|
// public RemoteDataSourceService create(Throwable cause) {
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
//}
|
|
@ -0,0 +1 @@
|
||||||
|
#com.muyu.source.remote.factory.RemoteDataSourceFactory
|
|
@ -0,0 +1,133 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-quest</artifactId>
|
||||||
|
<version>3.6.5</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>muyu-quest-server</artifactId>
|
||||||
|
<version>3.6.5</version>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos Config -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Sentinel -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringBoot Actuator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataSource -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-datasource</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataScope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-datascope</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- <!– MuYu Common Log –>-->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>com.muyu</groupId>-->
|
||||||
|
<!-- <artifactId>cloud-common-log</artifactId>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
<!-- 接口模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-api-doc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- XllJob定时任务 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-xxl</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- <!–rabbitmq 公共依赖–>-->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>com.muyu</groupId>-->
|
||||||
|
<!-- <artifactId>cloud-common-rabbit</artifactId>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-quest-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<finalName>muyu-quest</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>
|
||||||
|
<!-- 加入maven compiler插件,确保使用-parameters标志 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<!-- 确保版本是你项目所需的版本 -->
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>16</source>
|
||||||
|
<target>16</target>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>-parameters</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.muyu.quest;
|
||||||
|
|
||||||
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: 胡杨
|
||||||
|
* @Name: MyTask
|
||||||
|
* @Description: 任务模块启动器
|
||||||
|
* @CreatedDate: 2024/8/22 下午6:23
|
||||||
|
* @FilePath: com.muyu.quest
|
||||||
|
*/
|
||||||
|
|
||||||
|
@EnableCustomConfig
|
||||||
|
//@EnableCustomSwagger2
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
public class MyTaskApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
try {
|
||||||
|
SpringApplication.run(MyTaskApplication.class, args);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
System.out.println("MyTask 模块启动成功!");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,106 @@
|
||||||
|
package com.muyu.quest.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
|
import com.muyu.quest.domain.Task;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
import com.muyu.quest.service.TaskService;
|
||||||
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务Controller
|
||||||
|
*
|
||||||
|
* @author 2112A
|
||||||
|
* @date 2024-08-22
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/quest")
|
||||||
|
public class TaskController extends BaseController
|
||||||
|
{
|
||||||
|
@Resource
|
||||||
|
private TaskService taskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务列表
|
||||||
|
*/
|
||||||
|
// @RequiresPermissions("quest:quest:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<TableDataInfo<Task>> list(Task task)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<Task> list = taskService.selectTaskList(task);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取任务详细信息
|
||||||
|
*/
|
||||||
|
// @RequiresPermissions("quest:quest:query")
|
||||||
|
@GetMapping(value = "selectTaskByTaskCode/{taskCode}")
|
||||||
|
public Result<List<Task>> getInfo(@PathVariable("taskCode") String taskCode) {
|
||||||
|
return success(taskService.selectTaskByTaskCode(taskCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取任务详细信息
|
||||||
|
*/
|
||||||
|
// @RequiresPermissions("quest:quest:query")
|
||||||
|
@GetMapping(value = "selectTaskById/{id}")
|
||||||
|
public Result<List<Task>> getInfo(@PathVariable("id") Long id) {
|
||||||
|
return success(taskService.selectTaskById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增任务
|
||||||
|
*/
|
||||||
|
// @RequiresPermissions("quest:quest:quest")
|
||||||
|
@PostMapping
|
||||||
|
public Result<Integer> add (@Validated @RequestBody Task task) {
|
||||||
|
if (taskService.checkTaskCodeUnique(task)) {
|
||||||
|
return error("新增参数'" + task.getTaskName() + "'失败,任务已存在");
|
||||||
|
}
|
||||||
|
task.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
return toAjax(taskService.save(task));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改参数配置
|
||||||
|
*/
|
||||||
|
// @RequiresPermissions("quest:quest:quest")
|
||||||
|
@PutMapping
|
||||||
|
public Result edit (@Validated @RequestBody Task task) {
|
||||||
|
if (!taskService.checkIdUnique(task)) {
|
||||||
|
return error("修改参数'" + task.getTaskName() + "'失败,任务不存在");
|
||||||
|
}
|
||||||
|
task.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
return toAjax(taskService.updateById(task));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除参数配置
|
||||||
|
*/
|
||||||
|
// @RequiresPermissions("system:task:remove")
|
||||||
|
@DeleteMapping("/{taskIds}")
|
||||||
|
public Result remove (@PathVariable("taskIds") Long[] taskIds) {
|
||||||
|
taskService.removeBatchByIds(Arrays.asList(taskIds));
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.muyu.quest.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.quest.domain.Task;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务Mapper接口
|
||||||
|
*
|
||||||
|
* @author 2112A
|
||||||
|
* @date 2024-08-22
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface TaskMapper extends BaseMapper<Task> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.muyu.quest.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.quest.domain.Task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务Service接口
|
||||||
|
*
|
||||||
|
* @author 2112A
|
||||||
|
* @date 2024-08-22
|
||||||
|
*/
|
||||||
|
public interface TaskService extends IService<Task> {
|
||||||
|
/**
|
||||||
|
* 查询任务
|
||||||
|
*
|
||||||
|
* @param taskCode 任务编码
|
||||||
|
* @return 任务
|
||||||
|
*/
|
||||||
|
public Task selectTaskByTaskCode(String taskCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务列表
|
||||||
|
*
|
||||||
|
* @param task 任务
|
||||||
|
* @return 任务集合
|
||||||
|
*/
|
||||||
|
public List<Task> selectTaskList(Task task);
|
||||||
|
|
||||||
|
|
||||||
|
Task selectTaskById(Long id);
|
||||||
|
|
||||||
|
Boolean checkTaskCodeUnique(Task task);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断id是否唯一
|
||||||
|
* @param task 实体
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean checkIdUnique(Task task);
|
||||||
|
}
|
|
@ -0,0 +1,99 @@
|
||||||
|
package com.muyu.quest.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.muyu.quest.mapper.TaskMapper;
|
||||||
|
import com.muyu.quest.domain.Task;
|
||||||
|
import com.muyu.quest.service.TaskService;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务Service业务层处理
|
||||||
|
*
|
||||||
|
* @author 2112A
|
||||||
|
* @date 2024-08-22
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>
|
||||||
|
implements TaskService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务
|
||||||
|
*
|
||||||
|
* @param taskCode 任务编码
|
||||||
|
* @return 任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Task selectTaskByTaskCode(String taskCode)
|
||||||
|
{
|
||||||
|
LambdaQueryWrapper<Task> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
Assert.notNull(taskCode, "taskCode不可为空");
|
||||||
|
queryWrapper.eq(Task::getTaskCode, taskCode);
|
||||||
|
return this.getOne(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务
|
||||||
|
*
|
||||||
|
* @param id 任务主键
|
||||||
|
* @return 任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Task selectTaskById(Long id)
|
||||||
|
{
|
||||||
|
LambdaQueryWrapper<Task> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
Assert.notNull(id, "id不可为空");
|
||||||
|
queryWrapper.eq(Task::getId, id);
|
||||||
|
return this.getOne(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 唯一编码判断
|
||||||
|
* @param task
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean checkTaskCodeUnique(Task task) {
|
||||||
|
LambdaQueryWrapper<Task> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(Task::getTaskCode, task.getTaskCode());
|
||||||
|
return this.count(queryWrapper) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean checkIdUnique(Task task) {
|
||||||
|
LambdaQueryWrapper<Task> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(Task::getId, task.getId());
|
||||||
|
return this.count(queryWrapper) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务列表
|
||||||
|
*
|
||||||
|
* @param task 任务
|
||||||
|
* @return 任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Task> selectTaskList(Task task)
|
||||||
|
{
|
||||||
|
LambdaQueryWrapper<Task> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
if (StringUtils.isNotEmpty(task.getTaskName())){
|
||||||
|
queryWrapper.like(Task::getTaskName, task.getTaskName());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(task.getRuleCode())){
|
||||||
|
queryWrapper.eq(Task::getRuleCode, task.getRuleCode());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(task.getState())){
|
||||||
|
queryWrapper.eq(Task::getState, task.getState());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(task.getTaskType())){
|
||||||
|
queryWrapper.eq(Task::getTaskType, task.getTaskType());
|
||||||
|
}
|
||||||
|
return this.list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,45 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 8080
|
||||||
|
|
||||||
|
# nacos线上地址
|
||||||
|
nacos:
|
||||||
|
addr: 10.0.1.97:8848
|
||||||
|
user-name: nacos
|
||||||
|
password: nacos
|
||||||
|
namespace: cloud-2112
|
||||||
|
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: muyu-quest
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: ${nacos.addr}
|
||||||
|
namespace: ${nacos.namespace}
|
||||||
|
config:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: ${nacos.addr}
|
||||||
|
namespace: ${nacos.namespace}
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
# 系统共享配置
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
# 系统环境Config共享配置
|
||||||
|
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
# xxl-job 配置文件
|
||||||
|
- application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
# rabbit 配置文件
|
||||||
|
# - application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
|
|
@ -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/muyu-quest"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.muyu" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/muyu-quest"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.sky.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||||
|
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||||
|
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||||
|
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||||
|
<Pattern>${log.sky.pattern}</Pattern>
|
||||||
|
</layout>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.muyu" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="GRPC_LOG"/>
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/muyu-quest"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.sky.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||||
|
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||||
|
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||||
|
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||||
|
<Pattern>${log.sky.pattern}</Pattern>
|
||||||
|
</layout>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.muyu" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="GRPC_LOG"/>
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,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.muyu</groupId>
|
||||||
|
<artifactId>cloud-server-parent</artifactId>
|
||||||
|
<version>3.6.5</version>
|
||||||
|
</parent>
|
||||||
|
<artifactId>muyu-quest</artifactId>
|
||||||
|
<version>3.6.5</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>muyu-quest-remote</module>
|
||||||
|
<module>muyu-quest-server</module>
|
||||||
|
<module>muyu-quest-client</module>
|
||||||
|
<module>muyu-quest-common</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>
|
Loading…
Reference in New Issue