Merge remote-tracking branch 'origin/main'
commit
1179de7cfd
@ -0,0 +1,19 @@
|
|||||||
|
## AdoptOpenJDK 停止发布 OpenJDK 二进制,而 Eclipse Temurin 是它的延伸,提供更好的稳定性
|
||||||
|
## 感谢复旦核博士的建议!灰子哥,牛皮!
|
||||||
|
FROM eclipse-temurin:8-jre
|
||||||
|
|
||||||
|
## 创建目录,并使用它作为工作目录
|
||||||
|
RUN mkdir -p /hake-module-agent-server
|
||||||
|
WORKDIR /hake-module-agent-server
|
||||||
|
## 将后端项目的 Jar 文件,复制到镜像中
|
||||||
|
COPY ./target/hake-module-agent-server.jar app.jar
|
||||||
|
|
||||||
|
## 设置 TZ 时区
|
||||||
|
## 设置 JAVA_OPTS 环境变量,可通过 docker run -e "JAVA_OPTS=" 进行覆盖
|
||||||
|
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms512m -Xmx512m"
|
||||||
|
|
||||||
|
## 暴露后端项目的 48088 端口
|
||||||
|
EXPOSE 48090
|
||||||
|
|
||||||
|
## 启动后端项目
|
||||||
|
CMD java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar app.jar
|
||||||
@ -0,0 +1,135 @@
|
|||||||
|
<?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>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-module-agent</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>hake-module-agent-server</artifactId>
|
||||||
|
|
||||||
|
<name>${project.artifactId}</name>
|
||||||
|
<description>
|
||||||
|
agent 包下,代理商管理
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- Spring Cloud 基础 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-env</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 依赖服务 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-module-system-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-module-agent-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 业务组件 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-biz-tenant</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Web 相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- DB 相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-mybatis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- RPC 远程调用相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-rpc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Registry 注册中心相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Config 配置中心相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 工具类相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-excel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 监控相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-monitor</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Test 测试相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-test</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>central</id>
|
||||||
|
<name>Central Repository</name>
|
||||||
|
<url>http://192.168.1.200:19081/repository/maven-hake/</url>
|
||||||
|
</repository>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>snapshots</id>
|
||||||
|
<name>Nexus Snapshot Repository</name>
|
||||||
|
<url>http://192.168.1.200:19081/repository/maven-snapshots/</url>
|
||||||
|
</snapshotRepository>
|
||||||
|
</distributionManagement>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<!-- 设置构建的 jar 包名 -->
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<!-- 打包 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>${spring.boot.version}</version>
|
||||||
|
<configuration>
|
||||||
|
<finalName>agent</finalName> <!-- 指定新的文件名 -->
|
||||||
|
<outputDirectory>../../packge</outputDirectory>
|
||||||
|
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package cn.iocoder.hake.module.agent;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目的启动类
|
||||||
|
*
|
||||||
|
* @author hake
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
public class AgentServerApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
SpringApplication.run(AgentServerApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,110 @@
|
|||||||
|
package cn.iocoder.hake.module.agent.controller.admin.agent;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.hake.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.hake.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.hake.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.hake.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.hake.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.hake.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.hake.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static cn.iocoder.hake.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.hake.module.agent.controller.admin.agent.vo.*;
|
||||||
|
import cn.iocoder.hake.module.agent.dal.dataobject.agent.AgentDO;
|
||||||
|
import cn.iocoder.hake.module.agent.service.agent.AgentService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 代理商管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/agent/agent")
|
||||||
|
@Validated
|
||||||
|
public class AgentController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AgentService agentService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建代理商管理")
|
||||||
|
@PreAuthorize("@ss.hasPermission('agent:info:create')")
|
||||||
|
public CommonResult<Long> createAgent(@Valid @RequestBody AgentSaveReqVO createReqVO) {
|
||||||
|
return success(agentService.createAgent(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/updateStatus")
|
||||||
|
@Operation(summary = "代理商审核")
|
||||||
|
@PreAuthorize("@ss.hasPermission('agent:info:audit')")
|
||||||
|
public CommonResult<Long> updateAgentStatus(@Valid @RequestBody AuditRespVO auditRespVO) {
|
||||||
|
return success(agentService.updateAgentStatus(auditRespVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新代理商管理")
|
||||||
|
@PreAuthorize("@ss.hasPermission('agent:info:update')")
|
||||||
|
public CommonResult<Boolean> updateAgent(@Valid @RequestBody AgentSaveReqVO updateReqVO) {
|
||||||
|
agentService.updateAgent(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除代理商管理")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('agent:info:delete')")
|
||||||
|
public CommonResult<Boolean> deleteAgent(@RequestParam("id") Long id) {
|
||||||
|
agentService.deleteAgent(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除代理商管理")
|
||||||
|
@PreAuthorize("@ss.hasPermission('agent:info:delete')")
|
||||||
|
public CommonResult<Boolean> deleteAgentList(@RequestParam("ids") List<Long> ids) {
|
||||||
|
agentService.deleteAgentListByIds(ids);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得代理商管理")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('agent:info:query')")
|
||||||
|
public CommonResult<AgentRespVO> getAgent(@RequestParam("id") Long id) {
|
||||||
|
AgentDO agent = agentService.getAgent(id);
|
||||||
|
return success(BeanUtils.toBean(agent, AgentRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得代理商管理分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('agent:info:query')")
|
||||||
|
public CommonResult<PageResult<AgentRespVO>> getAgentPage(@Valid AgentPageReqVO pageReqVO) {
|
||||||
|
PageResult<AgentDO> pageResult = agentService.getAgentPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, AgentRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出代理商管理 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('agent:info:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportAgentExcel(@Valid AgentPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<AgentDO> list = agentService.getAgentPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "代理商管理.xls", "数据", AgentRespVO.class,
|
||||||
|
BeanUtils.toBean(list, AgentRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
package cn.iocoder.hake.module.agent.dal.mysql.agent;
|
||||||
|
|
||||||
|
import cn.iocoder.hake.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.hake.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.hake.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.hake.module.agent.dal.dataobject.agent.AgentDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.hake.module.agent.controller.admin.agent.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商管理 Mapper
|
||||||
|
*
|
||||||
|
* @author hake
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AgentMapper extends BaseMapperX<AgentDO> {
|
||||||
|
|
||||||
|
default PageResult<AgentDO> selectPage(AgentPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<AgentDO>()
|
||||||
|
.likeIfPresent(AgentDO::getAgentName, reqVO.getAgentName())
|
||||||
|
.eqIfPresent(AgentDO::getAgentCode, reqVO.getAgentCode())
|
||||||
|
.likeIfPresent(AgentDO::getAgentNickname, reqVO.getAgentNickname())
|
||||||
|
.likeIfPresent(AgentDO::getAgentShortNickname, reqVO.getAgentShortNickname())
|
||||||
|
.eqIfPresent(AgentDO::getStatus, reqVO.getStatus())
|
||||||
|
.eqIfPresent(AgentDO::getChildAgentFlag, reqVO.getChildAgentFlag())
|
||||||
|
.eqIfPresent(AgentDO::getChildMchFlag, reqVO.getChildMchFlag())
|
||||||
|
.eqIfPresent(AgentDO::getInformFlag, reqVO.getInformFlag())
|
||||||
|
.eqIfPresent(AgentDO::getAgentType, reqVO.getAgentType())
|
||||||
|
.eqIfPresent(AgentDO::getAgentLevel, reqVO.getAgentLevel())
|
||||||
|
.eqIfPresent(AgentDO::getParentAgentId, reqVO.getParentAgentId())
|
||||||
|
.eqIfPresent(AgentDO::getContactPerson, reqVO.getContactPerson())
|
||||||
|
.eqIfPresent(AgentDO::getContactPhone, reqVO.getContactPhone())
|
||||||
|
.eqIfPresent(AgentDO::getContactEmail, reqVO.getContactEmail())
|
||||||
|
.eqIfPresent(AgentDO::getCardFrontPhoto, reqVO.getCardFrontPhoto())
|
||||||
|
.eqIfPresent(AgentDO::getCardReversePhoto, reqVO.getCardReversePhoto())
|
||||||
|
.eqIfPresent(AgentDO::getCommitmentPhoto, reqVO.getCommitmentPhoto())
|
||||||
|
.eqIfPresent(AgentDO::getBusinessLicensePhoto, reqVO.getBusinessLicensePhoto())
|
||||||
|
.eqIfPresent(AgentDO::getBankAccountPermit, reqVO.getBankAccountPermit())
|
||||||
|
.eqIfPresent(AgentDO::getCooperationStatus, reqVO.getCooperationStatus())
|
||||||
|
.eqIfPresent(AgentDO::getReceiveAccountType, reqVO.getReceiveAccountType())
|
||||||
|
.likeIfPresent(AgentDO::getAccountName, reqVO.getAccountName())
|
||||||
|
.eqIfPresent(AgentDO::getAlipayAccount, reqVO.getAlipayAccount())
|
||||||
|
.likeIfPresent(AgentDO::getBankName, reqVO.getBankName())
|
||||||
|
.eqIfPresent(AgentDO::getBankAccount, reqVO.getBankAccount())
|
||||||
|
.eqIfPresent(AgentDO::getBankBranch, reqVO.getBankBranch())
|
||||||
|
.betweenIfPresent(AgentDO::getSignDate, reqVO.getSignDate())
|
||||||
|
.betweenIfPresent(AgentDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(AgentDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
/**
|
||||||
|
* 属于 erp 模块的 framework 封装
|
||||||
|
*
|
||||||
|
* @author hake
|
||||||
|
*/
|
||||||
|
package cn.iocoder.hake.module.agent.framework;
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package cn.iocoder.hake.module.agent.framework.rpc.config;
|
||||||
|
|
||||||
|
import cn.iocoder.hake.module.system.api.user.AdminUserApi;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration(value = "agentRpcConfiguration", proxyBeanMethods = false)
|
||||||
|
@EnableFeignClients(clients = AdminUserApi.class)
|
||||||
|
public class RpcConfiguration {
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* 占位
|
||||||
|
*/
|
||||||
|
package cn.iocoder.hake.module.agent.framework.rpc;
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package cn.iocoder.hake.module.agent.framework.security.config;
|
||||||
|
|
||||||
|
import cn.iocoder.hake.framework.security.config.AuthorizeRequestsCustomizer;
|
||||||
|
import cn.iocoder.hake.module.agent.enums.ApiConstants;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
|
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Erp 模块的 Security 配置
|
||||||
|
*/
|
||||||
|
@Configuration("agentSecurityConfiguration")
|
||||||
|
public class SecurityConfiguration {
|
||||||
|
|
||||||
|
@Bean("agentAuthorizeRequestsCustomizer")
|
||||||
|
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
||||||
|
return new AuthorizeRequestsCustomizer() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void customize(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) {
|
||||||
|
// Swagger 接口文档
|
||||||
|
registry.requestMatchers("/v3/api-docs/**").permitAll()
|
||||||
|
.requestMatchers("/webjars/**").permitAll()
|
||||||
|
.requestMatchers("/swagger-ui").permitAll()
|
||||||
|
.requestMatchers("/swagger-ui/**").permitAll();
|
||||||
|
// Spring Boot Actuator 的安全配置
|
||||||
|
registry.requestMatchers("/actuator").permitAll()
|
||||||
|
.requestMatchers("/actuator/**").permitAll();
|
||||||
|
// Druid 监控
|
||||||
|
registry.requestMatchers("/druid/**").permitAll();
|
||||||
|
// RPC 服务的安全配置
|
||||||
|
registry.requestMatchers(ApiConstants.PREFIX + "/**").permitAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* 占位
|
||||||
|
*/
|
||||||
|
package cn.iocoder.hake.module.agent.framework.security.core;
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
package cn.iocoder.hake.module.agent.service.agent;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import cn.iocoder.hake.module.agent.controller.admin.agent.vo.*;
|
||||||
|
import cn.iocoder.hake.module.agent.dal.dataobject.agent.AgentDO;
|
||||||
|
import cn.iocoder.hake.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商管理 Service 接口
|
||||||
|
*
|
||||||
|
* @author hake
|
||||||
|
*/
|
||||||
|
public interface AgentService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建代理商管理
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createAgent(@Valid AgentSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商审核
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Long updateAgentStatus(@Valid AuditRespVO auditRespVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新代理商管理
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateAgent(@Valid AgentSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除代理商管理
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteAgent(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除代理商管理
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteAgentListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得代理商管理
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 代理商管理
|
||||||
|
*/
|
||||||
|
AgentDO getAgent(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得代理商管理分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 代理商管理分页
|
||||||
|
*/
|
||||||
|
PageResult<AgentDO> getAgentPage(AgentPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,110 @@
|
|||||||
|
--- #################### 注册中心 + 配置中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: 192.168.1.16:8848 # Nacos 服务器地址
|
||||||
|
username: nacos# Nacos 账号
|
||||||
|
password: nacos# Nacos 密码
|
||||||
|
discovery: # 【配置中心】配置项
|
||||||
|
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||||
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
|
metadata:
|
||||||
|
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||||
|
config: # 【注册中心】配置项
|
||||||
|
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||||
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
|
|
||||||
|
--- #################### 数据库相关配置 ####################
|
||||||
|
spring:
|
||||||
|
# 数据源配置项
|
||||||
|
autoconfigure:
|
||||||
|
exclude:
|
||||||
|
datasource:
|
||||||
|
druid: # Druid 【监控】相关的全局配置
|
||||||
|
web-stat-filter:
|
||||||
|
enabled: true
|
||||||
|
stat-view-servlet:
|
||||||
|
enabled: true
|
||||||
|
allow: # 设置白名单,不填则允许所有访问
|
||||||
|
url-pattern: /druid/*
|
||||||
|
login-username: # 控制台管理用户名和密码
|
||||||
|
login-password:
|
||||||
|
filter:
|
||||||
|
stat:
|
||||||
|
enabled: true
|
||||||
|
log-slow-sql: true # 慢 SQL 记录
|
||||||
|
slow-sql-millis: 100
|
||||||
|
merge-sql: true
|
||||||
|
wall:
|
||||||
|
config:
|
||||||
|
multi-statement-allow: true
|
||||||
|
dynamic: # 多数据源配置
|
||||||
|
druid: # Druid 【连接池】相关的全局配置
|
||||||
|
initial-size: 5 # 初始连接数
|
||||||
|
min-idle: 10 # 最小连接池数量
|
||||||
|
max-active: 20 # 最大连接池数量
|
||||||
|
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
|
||||||
|
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
|
||||||
|
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
|
||||||
|
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
|
||||||
|
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
||||||
|
test-while-idle: true
|
||||||
|
test-on-borrow: false
|
||||||
|
test-on-return: false
|
||||||
|
primary: master
|
||||||
|
datasource:
|
||||||
|
master:
|
||||||
|
url: jdbc:mysql://192.168.1.16:3306/hake?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||||
|
username: haketest
|
||||||
|
password: test1234
|
||||||
|
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||||
|
lazy: true # 开启懒加载,保证启动速度
|
||||||
|
url: jdbc:mysql://192.168.1.16:3306/hake?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||||
|
username: haketest
|
||||||
|
password: test1234
|
||||||
|
|
||||||
|
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||||
|
redis:
|
||||||
|
host: 192.168.1.16 # 地址
|
||||||
|
port: 6379 # 端口
|
||||||
|
database: 0 # 数据库索引
|
||||||
|
# password: 123456 # 密码,建议生产环境开启
|
||||||
|
|
||||||
|
--- #################### MQ 消息队列相关配置 ####################
|
||||||
|
|
||||||
|
--- #################### 定时任务相关配置 ####################
|
||||||
|
|
||||||
|
--- #################### 服务保障相关配置 ####################
|
||||||
|
|
||||||
|
# Lock4j 配置项
|
||||||
|
lock4j:
|
||||||
|
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
||||||
|
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
||||||
|
|
||||||
|
--- #################### 监控相关配置 ####################
|
||||||
|
|
||||||
|
# Actuator 监控端点的配置项
|
||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||||
|
exposure:
|
||||||
|
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||||
|
|
||||||
|
# Spring Boot Admin 配置项
|
||||||
|
spring:
|
||||||
|
boot:
|
||||||
|
admin:
|
||||||
|
# Spring Boot Admin Client 客户端的相关配置
|
||||||
|
client:
|
||||||
|
instance:
|
||||||
|
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
|
||||||
|
|
||||||
|
--- #################### 哈客相关配置 ####################
|
||||||
|
|
||||||
|
# 哈客配置项,设置当前项目所有自定义的配置
|
||||||
|
hake:
|
||||||
|
access-log: # 访问日志的配置项
|
||||||
|
enable: false
|
||||||
|
demo: false # 关闭演示模式
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
<?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>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modules>
|
||||||
|
<module>hake-module-agent-api</module>
|
||||||
|
<module>hake-module-agent-server</module>
|
||||||
|
</modules>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>hake-module-agent</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
<name>${project.artifactId}</name>
|
||||||
|
<description>
|
||||||
|
erp 包下,代理商管理
|
||||||
|
</description>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
## AdoptOpenJDK 停止发布 OpenJDK 二进制,而 Eclipse Temurin 是它的延伸,提供更好的稳定性
|
||||||
|
## 感谢复旦核博士的建议!灰子哥,牛皮!
|
||||||
|
FROM eclipse-temurin:8-jre
|
||||||
|
|
||||||
|
## 创建目录,并使用它作为工作目录
|
||||||
|
RUN mkdir -p /hake-module-op-server
|
||||||
|
WORKDIR /hake-module-op-server
|
||||||
|
## 将后端项目的 Jar 文件,复制到镜像中
|
||||||
|
COPY ./target/hake-module-op-server.jar app.jar
|
||||||
|
|
||||||
|
## 设置 TZ 时区
|
||||||
|
## 设置 JAVA_OPTS 环境变量,可通过 docker run -e "JAVA_OPTS=" 进行覆盖
|
||||||
|
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms512m -Xmx512m"
|
||||||
|
|
||||||
|
## 暴露后端项目的 48080 端口
|
||||||
|
EXPOSE 48086
|
||||||
|
|
||||||
|
## 启动后端项目
|
||||||
|
CMD java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar app.jar
|
||||||
@ -0,0 +1,149 @@
|
|||||||
|
<?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>
|
||||||
|
<artifactId>hake-module-op</artifactId>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<name>${project.artifactId}</name>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>hake-module-op-server</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<description>
|
||||||
|
op-server,运营中心服务实现接口、业务逻辑、工具类等其他相应开发实现
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- Spring Cloud 基础 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-env</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- 依赖服务 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-module-op-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-module-system-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-module-infra-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- 业务组件 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-biz-tenant</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Web 相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- DB 相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-mybatis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- RPC 远程调用相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-rpc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Registry 注册中心相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Config 配置中心相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Test 测试相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 监控相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-monitor</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 工具类相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<artifactId>hake-spring-boot-starter-excel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 三方云服务相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.binarywang</groupId>
|
||||||
|
<artifactId>wx-java-mp-spring-boot-starter</artifactId> <!-- 微信登录(公众号) -->
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>central</id>
|
||||||
|
<name>Central Repository</name>
|
||||||
|
<url>http://192.168.1.200:19081/repository/maven-hake/</url>
|
||||||
|
</repository>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>snapshots</id>
|
||||||
|
<name>Nexus Snapshot Repository</name>
|
||||||
|
<url>http://192.168.1.200:19081/repository/maven-snapshots/</url>
|
||||||
|
</snapshotRepository>
|
||||||
|
</distributionManagement>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<!-- 设置构建的 jar 包名 -->
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<!-- 打包 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>${spring.boot.version}</version>
|
||||||
|
<configuration>
|
||||||
|
<finalName>op</finalName> <!-- 指定新的文件名 -->
|
||||||
|
<outputDirectory>../../packge</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.hake.module.op;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OP项目启动类
|
||||||
|
*
|
||||||
|
* @author chenjr
|
||||||
|
* @since 2025-07-30
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
public class OpServerApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(OpServerApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package cn.iocoder.hake.module.op.framework.rpc.config;
|
||||||
|
|
||||||
|
import cn.iocoder.hake.module.infra.api.file.FileApi;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration(value = "mpRpcConfiguration", proxyBeanMethods = false)
|
||||||
|
@EnableFeignClients(clients = FileApi.class)
|
||||||
|
public class RpcConfiguration {
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.hake.module.op.framework.security.config;
|
||||||
|
|
||||||
|
import cn.iocoder.hake.framework.security.config.AuthorizeRequestsCustomizer;
|
||||||
|
import cn.iocoder.hake.module.system.enums.ApiConstants;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
|
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MP 模块的 Security 配置
|
||||||
|
*/
|
||||||
|
@Configuration(proxyBeanMethods = false, value = "mpSecurityConfiguration")
|
||||||
|
public class SecurityConfiguration {
|
||||||
|
|
||||||
|
@Bean("mpAuthorizeRequestsCustomizer")
|
||||||
|
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
||||||
|
return new AuthorizeRequestsCustomizer() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void customize(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) {
|
||||||
|
// TODO 哈客:这个每个项目都需要重复配置,得捉摸有没通用的方案
|
||||||
|
// Swagger 接口文档
|
||||||
|
registry.requestMatchers("/v3/api-docs/**").permitAll()
|
||||||
|
.requestMatchers("/webjars/**").permitAll()
|
||||||
|
.requestMatchers("/swagger-ui").permitAll()
|
||||||
|
.requestMatchers("/swagger-ui/**").permitAll();
|
||||||
|
// Druid 监控
|
||||||
|
registry.requestMatchers("/druid/**").permitAll();
|
||||||
|
// Spring Boot Actuator 的安全配置
|
||||||
|
registry.requestMatchers("/actuator").permitAll()
|
||||||
|
.requestMatchers("/actuator/**").permitAll();
|
||||||
|
// RPC 服务的安全配置
|
||||||
|
registry.requestMatchers(ApiConstants.PREFIX + "/**").permitAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,109 @@
|
|||||||
|
--- #################### 注册中心 + 配置中心相关配置 ####################
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
server-addr: 192.168.1.16:8848 # Nacos 服务器地址
|
||||||
|
username: nacos# Nacos 账号
|
||||||
|
password: nacos# Nacos 密码
|
||||||
|
discovery: # 【配置中心】配置项
|
||||||
|
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||||
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
|
metadata:
|
||||||
|
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||||
|
config: # 【注册中心】配置项
|
||||||
|
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||||
|
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||||
|
|
||||||
|
--- #################### 数据库相关配置 ####################
|
||||||
|
spring:
|
||||||
|
# 数据源配置项
|
||||||
|
autoconfigure:
|
||||||
|
exclude:
|
||||||
|
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
|
||||||
|
datasource:
|
||||||
|
druid: # Druid 【监控】相关的全局配置
|
||||||
|
web-stat-filter:
|
||||||
|
enabled: true
|
||||||
|
stat-view-servlet:
|
||||||
|
enabled: true
|
||||||
|
allow: # 设置白名单,不填则允许所有访问
|
||||||
|
url-pattern: /druid/*
|
||||||
|
login-username: # 控制台管理用户名和密码
|
||||||
|
login-password:
|
||||||
|
filter:
|
||||||
|
stat:
|
||||||
|
enabled: true
|
||||||
|
log-slow-sql: true # 慢 SQL 记录
|
||||||
|
slow-sql-millis: 100
|
||||||
|
merge-sql: true
|
||||||
|
wall:
|
||||||
|
config:
|
||||||
|
multi-statement-allow: true
|
||||||
|
dynamic: # 多数据源配置
|
||||||
|
druid: # Druid 【连接池】相关的全局配置
|
||||||
|
initial-size: 5 # 初始连接数
|
||||||
|
min-idle: 10 # 最小连接池数量
|
||||||
|
max-active: 20 # 最大连接池数量
|
||||||
|
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
|
||||||
|
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
|
||||||
|
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
|
||||||
|
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
|
||||||
|
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
||||||
|
test-while-idle: true
|
||||||
|
test-on-borrow: false
|
||||||
|
test-on-return: false
|
||||||
|
primary: master
|
||||||
|
datasource:
|
||||||
|
master:
|
||||||
|
url: jdbc:mysql://192.168.1.16:3306/hake?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||||
|
username: haketest
|
||||||
|
password: test1234
|
||||||
|
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||||
|
lazy: true # 开启懒加载,保证启动速度
|
||||||
|
url: jdbc:mysql://192.168.1.16:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||||
|
username: haketest
|
||||||
|
password: test1234
|
||||||
|
|
||||||
|
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||||
|
redis:
|
||||||
|
host: 192.168.1.16 # 地址
|
||||||
|
port: 6379 # 端口
|
||||||
|
database: 1 # 数据库索引
|
||||||
|
# password: 123456 # 密码,建议生产环境开启
|
||||||
|
|
||||||
|
--- #################### MQ 消息队列相关配置 ####################
|
||||||
|
|
||||||
|
--- #################### 定时任务相关配置 ####################
|
||||||
|
|
||||||
|
--- #################### 服务保障相关配置 ####################
|
||||||
|
|
||||||
|
# Lock4j 配置项
|
||||||
|
lock4j:
|
||||||
|
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
||||||
|
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
||||||
|
|
||||||
|
--- #################### 监控相关配置 ####################
|
||||||
|
|
||||||
|
# Actuator 监控端点的配置项
|
||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||||
|
exposure:
|
||||||
|
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||||
|
|
||||||
|
# Spring Boot Admin 配置项
|
||||||
|
spring:
|
||||||
|
boot:
|
||||||
|
admin:
|
||||||
|
# Spring Boot Admin Client 客户端的相关配置
|
||||||
|
client:
|
||||||
|
instance:
|
||||||
|
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
|
||||||
|
|
||||||
|
--- #################### 哈客相关配置 ####################
|
||||||
|
|
||||||
|
# 哈客配置项,设置当前项目所有自定义的配置
|
||||||
|
hake:
|
||||||
|
demo: false # 关闭演示模式
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
<?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>
|
||||||
|
<artifactId>hake</artifactId>
|
||||||
|
<groupId>cn.iocoder.cloud</groupId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>hake-module-op</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
op 模块,主要实现运营平台数据展示功能;例如:进件管理、商户列表、
|
||||||
|
门店管理、代理商服务管理等数据整合
|
||||||
|
</description>
|
||||||
|
<modules>
|
||||||
|
<module>hake-module-op-api</module>
|
||||||
|
<module>hake-module-op-server</module>
|
||||||
|
</modules>
|
||||||
|
</project>
|
||||||
Loading…
Reference in New Issue