diff --git a/agt-gateway/src/main/resources/application.yaml b/agt-gateway/src/main/resources/application.yaml
index 2d1a683..d6ffdfe 100644
--- a/agt-gateway/src/main/resources/application.yaml
+++ b/agt-gateway/src/main/resources/application.yaml
@@ -188,6 +188,19 @@ spring:
- Path=/admin-api/iot/**
filters:
- RewritePath=/admin-api/iot/v3/api-docs, /v3/api-docs # 配置,保证转发到 /v3/api-docs
+ ## license-server 服务
+ - id: license-admin-api # 路由的编号
+ uri: grayLb://license-server
+ predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组
+ - Path=/admin-api/license/**
+ filters:
+ - RewritePath=/admin-api/license/v3/api-docs, /v3/api-docs # 配置,保证转发到 /v3/api-docs
+ - id: license-app-api # 路由的编号
+ uri: grayLb://license-server
+ predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组
+ - Path=/app-api/license/**
+ filters:
+ - RewritePath=/app-api/license/v3/api-docs, /v3/api-docs
x-forwarded:
prefix-enabled: false # 避免 Swagger 重复带上额外的 /admin-api/system 前缀
diff --git a/agt-module-license/agt-module-license-api/pom.xml b/agt-module-license/agt-module-license-api/pom.xml
new file mode 100644
index 0000000..e67135d
--- /dev/null
+++ b/agt-module-license/agt-module-license-api/pom.xml
@@ -0,0 +1,23 @@
+
+ 4.0.0
+
+ org.agt
+ agt-module-license
+ ${revision}
+
+ agt-module-license-api
+ jar
+
+ ${project.artifactId}
+
+ License 模块 API,暴露给其它模块调用
+
+
+
+
+ org.agt
+ agt-common
+
+
+
diff --git a/agt-module-license/agt-module-license-api/src/main/java/org/agt/module/license/enums/ErrorCodeConstants.java b/agt-module-license/agt-module-license-api/src/main/java/org/agt/module/license/enums/ErrorCodeConstants.java
new file mode 100644
index 0000000..616eb38
--- /dev/null
+++ b/agt-module-license/agt-module-license-api/src/main/java/org/agt/module/license/enums/ErrorCodeConstants.java
@@ -0,0 +1,12 @@
+package org.agt.module.license.enums;
+
+import org.agt.framework.common.exception.ErrorCode;
+
+/**
+ * @description: license 错误码枚举类
+ * @author: cyc
+ * @since: 2025-05-22
+ */
+public interface ErrorCodeConstants {
+ ErrorCode CUSTOMER_NOT_EXISTS = new ErrorCode(2000, "客户不存在");
+}
diff --git a/agt-module-license/agt-module-license-server/pom.xml b/agt-module-license/agt-module-license-server/pom.xml
new file mode 100644
index 0000000..ddee1bc
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/pom.xml
@@ -0,0 +1,145 @@
+
+ 4.0.0
+
+ org.agt
+ agt-module-license
+ ${revision}
+
+
+ agt-module-license-server
+ jar
+
+ ${project.artifactId}
+
+ License 服务模块,主要包含客户管理、项目管理和license管理。
+ 其中license管理主要用于生成license。
+
+
+
+
+
+ org.agt
+ agt-spring-boot-starter-env
+
+
+
+
+ org.agt
+ agt-module-system-api
+ ${revision}
+
+
+ org.agt
+ agt-module-infra-api
+ ${revision}
+
+
+
+ org.agt
+ agt-module-license-api
+ ${revision}
+
+
+
+
+ org.agt
+ agt-spring-boot-starter-biz-data-permission
+
+
+ org.agt
+ agt-spring-boot-starter-biz-tenant
+
+
+ org.agt
+ agt-spring-boot-starter-biz-ip
+
+
+
+
+ org.agt
+ agt-spring-boot-starter-security
+
+
+
+
+ org.agt
+ agt-spring-boot-starter-mybatis
+
+
+
+ org.agt
+ agt-spring-boot-starter-redis
+
+
+
+
+ org.agt
+ agt-spring-boot-starter-rpc
+
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-config
+
+
+
+
+ org.agt
+ agt-spring-boot-starter-job
+
+
+
+
+ org.agt
+ agt-spring-boot-starter-mq
+
+
+
+
+ org.agt
+ agt-spring-boot-starter-test
+ test
+
+
+
+
+ org.agt
+ agt-spring-boot-starter-excel
+
+
+
+
+ org.agt
+ agt-spring-boot-starter-monitor
+
+
+
+
+
+
+ ${project.artifactId}
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ ${spring.boot.version}
+
+
+
+ repackage
+
+
+
+
+
+
+
diff --git a/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/AgtLicenseApplication.java b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/AgtLicenseApplication.java
new file mode 100644
index 0000000..f6786ba
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/AgtLicenseApplication.java
@@ -0,0 +1,18 @@
+package org.agt.module.license;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * @description: 项目的启动类
+ * @author: cyc
+ * @since: 2025-05-21
+ */
+@SpringBootApplication
+public class AgtLicenseApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(AgtLicenseApplication.class, args);
+ }
+
+}
diff --git a/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/controller/admin/customer/CustomerController.java b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/controller/admin/customer/CustomerController.java
new file mode 100644
index 0000000..f98960a
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/controller/admin/customer/CustomerController.java
@@ -0,0 +1,95 @@
+package org.agt.module.license.controller.admin.customer;
+
+import org.springframework.web.bind.annotation.*;
+import jakarta.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 jakarta.validation.constraints.*;
+import jakarta.validation.*;
+import jakarta.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import org.agt.framework.common.pojo.PageParam;
+import org.agt.framework.common.pojo.PageResult;
+import org.agt.framework.common.pojo.CommonResult;
+import org.agt.framework.common.util.object.BeanUtils;
+import static org.agt.framework.common.pojo.CommonResult.success;
+
+import org.agt.framework.excel.core.util.ExcelUtils;
+
+import org.agt.framework.apilog.core.annotation.ApiAccessLog;
+import static org.agt.framework.apilog.core.enums.OperateTypeEnum.*;
+
+import org.agt.module.license.controller.admin.customer.vo.*;
+import org.agt.module.license.dal.dataobject.customer.CustomerDO;
+import org.agt.module.license.service.customer.CustomerService;
+
+@Tag(name = "管理后台 - 客户")
+@RestController
+@RequestMapping("/license/customer")
+@Validated
+public class CustomerController {
+
+ @Resource
+ private CustomerService customerService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建客户")
+ @PreAuthorize("@ss.hasPermission('license:customer:create')")
+ public CommonResult createCustomer(@Valid @RequestBody CustomerSaveReqVO createReqVO) {
+ return success(customerService.createCustomer(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新客户")
+ @PreAuthorize("@ss.hasPermission('license:customer:update')")
+ public CommonResult updateCustomer(@Valid @RequestBody CustomerSaveReqVO updateReqVO) {
+ customerService.updateCustomer(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除客户")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('license:customer:delete')")
+ public CommonResult deleteCustomer(@RequestParam("id") Long id) {
+ customerService.deleteCustomer(id);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得客户")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('license:customer:query')")
+ public CommonResult getCustomer(@RequestParam("id") Long id) {
+ CustomerDO customer = customerService.getCustomer(id);
+ return success(BeanUtils.toBean(customer, CustomerRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得客户分页")
+ @PreAuthorize("@ss.hasPermission('license:customer:query')")
+ public CommonResult> getCustomerPage(@Valid CustomerPageReqVO pageReqVO) {
+ PageResult pageResult = customerService.getCustomerPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, CustomerRespVO.class));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "导出客户 Excel")
+ @PreAuthorize("@ss.hasPermission('license:customer:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportCustomerExcel(@Valid CustomerPageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List list = customerService.getCustomerPage(pageReqVO).getList();
+ // 导出 Excel
+ ExcelUtils.write(response, "客户.xls", "数据", CustomerRespVO.class,
+ BeanUtils.toBean(list, CustomerRespVO.class));
+ }
+
+}
\ No newline at end of file
diff --git a/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/controller/admin/customer/vo/CustomerPageReqVO.java b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/controller/admin/customer/vo/CustomerPageReqVO.java
new file mode 100644
index 0000000..4fb4732
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/controller/admin/customer/vo/CustomerPageReqVO.java
@@ -0,0 +1,39 @@
+package org.agt.module.license.controller.admin.customer.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.agt.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static org.agt.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 客户分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class CustomerPageReqVO extends PageParam {
+
+ @Schema(description = "客户名称", example = "赵六")
+ private String name;
+
+ @Schema(description = "客户编号", example = "2000")
+ private String code;
+
+ @Schema(description = "客户类型", example = "1")
+ private Integer type;
+
+ @Schema(description = "地区", example = "5186")
+ private Long areaId;
+
+ @Schema(description = "联系人")
+ private String contacts;
+
+ @Schema(description = "创建时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] createTime;
+
+}
\ No newline at end of file
diff --git a/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/controller/admin/customer/vo/CustomerRespVO.java b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/controller/admin/customer/vo/CustomerRespVO.java
new file mode 100644
index 0000000..d89ab88
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/controller/admin/customer/vo/CustomerRespVO.java
@@ -0,0 +1,62 @@
+package org.agt.module.license.controller.admin.customer.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import org.agt.framework.excel.core.annotations.DictFormat;
+import org.agt.framework.excel.core.convert.DictConvert;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 客户 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class CustomerRespVO {
+
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25585")
+ @ExcelProperty("主键")
+ private Long id;
+
+ @Schema(description = "客户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
+ @ExcelProperty("客户名称")
+ private String name;
+
+ @Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000")
+ @ExcelProperty("客户编号")
+ private String code;
+
+ @Schema(description = "客户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @ExcelProperty(value = "客户类型", converter = DictConvert.class)
+ @DictFormat("lic_customer_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
+ private Integer type;
+
+ @Schema(description = "地区", requiredMode = Schema.RequiredMode.REQUIRED, example = "5186")
+ @ExcelProperty("地区")
+ private Long areaId;
+
+ @Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("联系人")
+ private String contacts;
+
+ @Schema(description = "角色")
+ @ExcelProperty("角色")
+ private String role;
+
+ @Schema(description = "联系电话")
+ @ExcelProperty("联系电话")
+ private String phone;
+
+ @Schema(description = "邮箱")
+ @ExcelProperty("邮箱")
+ private String email;
+
+ @Schema(description = "备注", example = "随便")
+ @ExcelProperty("备注")
+ private String remark;
+
+ @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("创建时间")
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/controller/admin/customer/vo/CustomerSaveReqVO.java b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/controller/admin/customer/vo/CustomerSaveReqVO.java
new file mode 100644
index 0000000..def64f4
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/controller/admin/customer/vo/CustomerSaveReqVO.java
@@ -0,0 +1,47 @@
+package org.agt.module.license.controller.admin.customer.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import jakarta.validation.constraints.*;
+
+@Schema(description = "管理后台 - 客户新增/修改 Request VO")
+@Data
+public class CustomerSaveReqVO {
+
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11324")
+ private Long id;
+
+ @Schema(description = "客户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
+ @NotEmpty(message = "客户名称不能为空")
+ private String name;
+
+ @Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000")
+ @NotEmpty(message = "客户编号不能为空")
+ private String code;
+
+ @Schema(description = "客户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @NotNull(message = "客户类型不能为空")
+ private Integer type;
+
+ @Schema(description = "地区", requiredMode = Schema.RequiredMode.REQUIRED, example = "5186")
+ @NotNull(message = "地区不能为空")
+ private Long areaId;
+
+ @Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "联系人不能为空")
+ private String contacts;
+
+ @Schema(description = "角色")
+ private String role;
+
+ @Schema(description = "联系电话")
+ private String phone;
+
+ @Schema(description = "邮箱")
+ private String email;
+
+ @Schema(description = "备注", example = "随便")
+ private String remark;
+
+}
\ No newline at end of file
diff --git a/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/dal/dataobject/customer/CustomerDO.java b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/dal/dataobject/customer/CustomerDO.java
new file mode 100644
index 0000000..0bdb706
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/dal/dataobject/customer/CustomerDO.java
@@ -0,0 +1,69 @@
+package org.agt.module.license.dal.dataobject.customer;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import org.agt.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 客户 DO
+ *
+ * @author 管理员
+ */
+@TableName("lic_customer")
+@KeySequence("lic_customer_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class CustomerDO extends BaseDO {
+
+ /**
+ * 主键
+ */
+ @TableId
+ private Long id;
+ /**
+ * 客户名称
+ */
+ private String name;
+ /**
+ * 客户编号
+ */
+ private String code;
+ /**
+ * 客户类型
+ *
+ * 枚举 {@link TODO lic_customer_type 对应的类}
+ */
+ private Integer type;
+ /**
+ * 地区
+ */
+ private Long areaId;
+ /**
+ * 联系人
+ */
+ private String contacts;
+ /**
+ * 角色
+ */
+ private String role;
+ /**
+ * 联系电话
+ */
+ private String phone;
+ /**
+ * 邮箱
+ */
+ private String email;
+ /**
+ * 备注
+ */
+ private String remark;
+
+}
\ No newline at end of file
diff --git a/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/dal/mysql/customer/CustomerMapper.java b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/dal/mysql/customer/CustomerMapper.java
new file mode 100644
index 0000000..4da51c7
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/dal/mysql/customer/CustomerMapper.java
@@ -0,0 +1,31 @@
+package org.agt.module.license.dal.mysql.customer;
+
+import java.util.*;
+
+import org.agt.framework.common.pojo.PageResult;
+import org.agt.framework.mybatis.core.query.LambdaQueryWrapperX;
+import org.agt.framework.mybatis.core.mapper.BaseMapperX;
+import org.agt.module.license.dal.dataobject.customer.CustomerDO;
+import org.apache.ibatis.annotations.Mapper;
+import org.agt.module.license.controller.admin.customer.vo.*;
+
+/**
+ * 客户 Mapper
+ *
+ * @author 管理员
+ */
+@Mapper
+public interface CustomerMapper extends BaseMapperX {
+
+ default PageResult selectPage(CustomerPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .likeIfPresent(CustomerDO::getName, reqVO.getName())
+ .likeIfPresent(CustomerDO::getCode, reqVO.getCode())
+ .eqIfPresent(CustomerDO::getType, reqVO.getType())
+ .eqIfPresent(CustomerDO::getAreaId, reqVO.getAreaId())
+ .eqIfPresent(CustomerDO::getContacts, reqVO.getContacts())
+ .betweenIfPresent(CustomerDO::getCreateTime, reqVO.getCreateTime())
+ .orderByDesc(CustomerDO::getId));
+ }
+
+}
\ No newline at end of file
diff --git a/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/framework/security/config/SecurityConfiguration.java b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/framework/security/config/SecurityConfiguration.java
new file mode 100644
index 0000000..ee65d20
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/framework/security/config/SecurityConfiguration.java
@@ -0,0 +1,39 @@
+package org.agt.module.license.framework.security.config;
+
+import org.agt.framework.security.config.AuthorizeRequestsCustomizer;
+import org.agt.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;
+
+/**
+ * License 模块的 Security 配置
+ */
+@Configuration(proxyBeanMethods = false)
+public class SecurityConfiguration {
+
+ @Bean
+ public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
+ return new AuthorizeRequestsCustomizer() {
+
+ @Override
+ public void customize(AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry registry) {
+ // 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();
+ }
+
+ };
+ }
+
+}
diff --git a/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/service/customer/CustomerService.java b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/service/customer/CustomerService.java
new file mode 100644
index 0000000..60698e0
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/service/customer/CustomerService.java
@@ -0,0 +1,55 @@
+package org.agt.module.license.service.customer;
+
+import java.util.*;
+import jakarta.validation.*;
+import org.agt.module.license.controller.admin.customer.vo.*;
+import org.agt.module.license.dal.dataobject.customer.CustomerDO;
+import org.agt.framework.common.pojo.PageResult;
+import org.agt.framework.common.pojo.PageParam;
+
+/**
+ * 客户 Service 接口
+ *
+ * @author 管理员
+ */
+public interface CustomerService {
+
+ /**
+ * 创建客户
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ Long createCustomer(@Valid CustomerSaveReqVO createReqVO);
+
+ /**
+ * 更新客户
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updateCustomer(@Valid CustomerSaveReqVO updateReqVO);
+
+ /**
+ * 删除客户
+ *
+ * @param id 编号
+ */
+ void deleteCustomer(Long id);
+
+ /**
+ * 获得客户
+ *
+ * @param id 编号
+ * @return 客户
+ */
+ CustomerDO getCustomer(Long id);
+
+ /**
+ * 获得客户分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 客户分页
+ */
+ PageResult getCustomerPage(CustomerPageReqVO pageReqVO);
+
+}
\ No newline at end of file
diff --git a/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/service/customer/CustomerServiceImpl.java b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/service/customer/CustomerServiceImpl.java
new file mode 100644
index 0000000..b3498af
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/java/org/agt/module/license/service/customer/CustomerServiceImpl.java
@@ -0,0 +1,70 @@
+package org.agt.module.license.service.customer;
+
+import jakarta.annotation.Resource;
+import org.agt.framework.common.pojo.PageResult;
+import org.agt.framework.common.util.object.BeanUtils;
+import org.agt.module.license.controller.admin.customer.vo.CustomerPageReqVO;
+import org.agt.module.license.controller.admin.customer.vo.CustomerSaveReqVO;
+import org.agt.module.license.dal.dataobject.customer.CustomerDO;
+import org.agt.module.license.dal.mysql.customer.CustomerMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import static org.agt.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static org.agt.module.license.enums.ErrorCodeConstants.CUSTOMER_NOT_EXISTS;
+
+/**
+ * 客户 Service 实现类
+ *
+ * @author 管理员
+ */
+@Service
+@Validated
+public class CustomerServiceImpl implements CustomerService {
+
+ @Resource
+ private CustomerMapper customerMapper;
+
+ @Override
+ public Long createCustomer(CustomerSaveReqVO createReqVO) {
+ // 插入
+ CustomerDO customer = BeanUtils.toBean(createReqVO, CustomerDO.class);
+ customerMapper.insert(customer);
+ // 返回
+ return customer.getId();
+ }
+
+ @Override
+ public void updateCustomer(CustomerSaveReqVO updateReqVO) {
+ // 校验存在
+ validateCustomerExists(updateReqVO.getId());
+ // 更新
+ CustomerDO updateObj = BeanUtils.toBean(updateReqVO, CustomerDO.class);
+ customerMapper.updateById(updateObj);
+ }
+
+ @Override
+ public void deleteCustomer(Long id) {
+ // 校验存在
+ validateCustomerExists(id);
+ // 删除
+ customerMapper.deleteById(id);
+ }
+
+ private void validateCustomerExists(Long id) {
+ if (customerMapper.selectById(id) == null) {
+ throw exception(CUSTOMER_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public CustomerDO getCustomer(Long id) {
+ return customerMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult getCustomerPage(CustomerPageReqVO pageReqVO) {
+ return customerMapper.selectPage(pageReqVO);
+ }
+
+}
\ No newline at end of file
diff --git a/agt-module-license/agt-module-license-server/src/main/resources/application-local.yaml b/agt-module-license/agt-module-license-server/src/main/resources/application-local.yaml
new file mode 100644
index 0000000..07a7efd
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/resources/application-local.yaml
@@ -0,0 +1,138 @@
+--- #################### 注册中心 + 配置中心相关配置 ####################
+
+spring:
+ cloud:
+ nacos:
+ server-addr: 127.0.0.1:8848 # Nacos 服务器地址
+ username: # Nacos 账号
+ password: # 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:
+ # noinspection SpringBootApplicationYaml
+ 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: 1 # 初始连接数
+ min-idle: 1 # 最小连接池数量
+ 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://127.0.0.1:3306/agt-cloud?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
+ # url: jdbc:mysql://127.0.0.1:3306/agt-cloud?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X 连接的示例
+ # url: jdbc:postgresql://127.0.0.1:5432/agt-cloud # PostgreSQL 连接的示例
+ # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
+ # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=agt-cloud # SQLServer 连接的示例
+ # url: jdbc:dm://10.211.55.4:5236?schema=RUOYI_VUE_PRO # DM 连接的示例
+ username: root
+ password: 123456
+ # username: sa # SQL Server 连接的示例
+ # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # SQL Server 连接的示例
+ # username: SYSDBA # DM 连接的示例
+ # password: SYSDBA # DM 连接的示例
+ slave: # 模拟从库,可根据自己需要修改
+ lazy: true # 开启懒加载,保证启动速度
+ url: jdbc:mysql://127.0.0.1:3306/agt-cloud?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
+ username: root
+ password: 123456
+
+ # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
+ data:
+ redis:
+ host: 127.0.0.1
+ port: 6379
+ database: 0
+# password: 123456 # 密码,建议生产环境开启
+
+--- #################### MQ 消息队列相关配置 ####################
+
+--- #################### 定时任务相关配置 ####################
+
+xxl:
+ job:
+ enabled: false # 是否开启调度中心,默认为 true 开启
+ admin:
+ addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址
+
+--- #################### 服务保障相关配置 ####################
+
+# 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]
+
+# 日志文件配置
+logging:
+ level:
+ # 配置自己写的 MyBatis Mapper 打印日志
+ org.agt.module.license.dal.mysql: debug
+ org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示
+
+--- #################### 芋道相关配置 ####################
+
+# 芋道配置项,设置当前项目所有自定义的配置
+agt:
+ env: # 多环境的配置项
+ tag: ${HOSTNAME}
+ security:
+ mock-enable: true
+ access-log: # 访问日志的配置项
+ enable: false
\ No newline at end of file
diff --git a/agt-module-license/agt-module-license-server/src/main/resources/application.yaml b/agt-module-license/agt-module-license-server/src/main/resources/application.yaml
new file mode 100644
index 0000000..a506914
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/resources/application.yaml
@@ -0,0 +1,119 @@
+spring:
+ application:
+ name: license-server
+
+ profiles:
+ active: local
+
+ main:
+ allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
+ allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
+
+ config:
+ import:
+ - optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置
+ - optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置
+
+ # Servlet 配置
+ servlet:
+ # 文件上传相关配置项
+ multipart:
+ max-file-size: 16MB # 单个文件大小
+ max-request-size: 32MB # 设置总上传的文件大小
+
+ # Jackson 配置项
+ jackson:
+ serialization:
+ write-dates-as-timestamps: true # 设置 LocalDateTime 的格式,使用时间戳
+ write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401
+ write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
+ fail-on-empty-beans: false # 允许序列化无属性的 Bean
+
+ # Cache 配置项
+ cache:
+ type: REDIS
+ redis:
+ time-to-live: 1h # 设置过期时间为 1 小时
+
+server:
+ port: 49001
+
+logging:
+ file:
+ name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
+
+--- #################### 接口文档配置 ####################
+
+springdoc:
+ api-docs:
+ enabled: true # 1. 是否开启 Swagger 接文档的元数据
+ path: /v3/api-docs
+ swagger-ui:
+ enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面
+ path: /swagger-ui.html
+ default-flat-param-object: true # 参见 https://doc.xiaominfo.com/docs/faq/v4/knife4j-parameterobject-flat-param 文档
+
+knife4j:
+ enable: false # 2.2 是否开启 Swagger 文档的 Knife4j UI 界面
+ setting:
+ language: zh_cn
+
+# MyBatis Plus 的配置项
+mybatis-plus:
+ configuration:
+ map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
+ global-config:
+ db-config:
+ id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
+ # id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
+ # id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
+ # id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
+ logic-delete-value: 1 # 逻辑已删除值(默认为 1)
+ logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
+ banner: false # 关闭控制台的 Banner 打印
+ type-aliases-package: ${agt.info.base-package}.module.*.dal.dataobject
+ encryptor:
+ password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成
+
+mybatis-plus-join:
+ banner: false # 关闭控制台的 Banner 打印
+
+# VO 转换(数据翻译)相关
+easy-trans:
+ is-enable-global: true # 启用全局翻译(拦截所有 SpringMVC ResponseBody 进行自动翻译 )。如果对于性能要求很高可关闭此配置,或通过 @IgnoreTrans 忽略某个接口
+
+--- #################### RPC 远程调用相关配置 ####################
+
+--- #################### MQ 消息队列相关配置 ####################
+
+--- #################### 定时任务相关配置 ####################
+
+xxl:
+ job:
+ executor:
+ appname: ${spring.application.name} # 执行器 AppName
+ logpath: ${user.home}/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径
+ accessToken: default_token # 执行器通讯TOKEN
+
+--- #################### 千通相关配置 ####################
+
+agt:
+ info:
+ version: 1.0.0
+ base-package: org.agt.module.license
+ web:
+ admin-ui:
+ url: http://dashboard.agt.iocoder.cn # Admin 管理后台 UI 的地址
+ xss:
+ enable: false
+ exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系
+ - ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
+ - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
+ swagger:
+ title: 管理后台
+ description: 提供管理员管理的所有功能
+ version: ${agt.info.version}
+ tenant: # 多租户相关配置项
+ enable: true
+
+debug: false
\ No newline at end of file
diff --git a/agt-module-license/agt-module-license-server/src/main/resources/logback-spring.xml b/agt-module-license/agt-module-license-server/src/main/resources/logback-spring.xml
new file mode 100644
index 0000000..a0b7f8e
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/resources/logback-spring.xml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ ${PATTERN_DEFAULT}
+
+
+
+
+
+
+
+
+
+ ${PATTERN_DEFAULT}
+
+
+
+ ${LOG_FILE}
+
+
+ ${LOGBACK_ROLLINGPOLICY_FILE_NAME_PATTERN:-${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz}
+
+ ${LOGBACK_ROLLINGPOLICY_CLEAN_HISTORY_ON_START:-false}
+
+ ${LOGBACK_ROLLINGPOLICY_MAX_FILE_SIZE:-10MB}
+
+ ${LOGBACK_ROLLINGPOLICY_TOTAL_SIZE_CAP:-0}
+
+ ${LOGBACK_ROLLINGPOLICY_MAX_HISTORY:-30}
+
+
+
+
+
+ 0
+
+ 256
+
+
+
+
+
+
+
+ ${PATTERN_DEFAULT}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/agt-module-license/agt-module-license-server/src/main/resources/mapper/customer/CustomerMapper.xml b/agt-module-license/agt-module-license-server/src/main/resources/mapper/customer/CustomerMapper.xml
new file mode 100644
index 0000000..d98fbb6
--- /dev/null
+++ b/agt-module-license/agt-module-license-server/src/main/resources/mapper/customer/CustomerMapper.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/agt-module-license/pom.xml b/agt-module-license/pom.xml
new file mode 100644
index 0000000..3f8de25
--- /dev/null
+++ b/agt-module-license/pom.xml
@@ -0,0 +1,25 @@
+
+
+
+ org.agt
+ agt
+ ${revision}
+
+
+ agt-module-license-api
+ agt-module-license-server
+
+ 4.0.0
+
+ agt-module-license
+ pom
+
+ ${project.artifactId}
+
+ License 模块,主要包含客户管理、项目管理和license管理。
+ 其中license管理主要用于生成license。
+
+
+
diff --git a/agt-server/pom.xml b/agt-server/pom.xml
index 3c44f7f..8a4eb04 100644
--- a/agt-server/pom.xml
+++ b/agt-server/pom.xml
@@ -31,6 +31,11 @@
agt-module-infra-server
${revision}
+
+ org.agt
+ agt-module-license-server
+ ${revision}
+
diff --git a/pom.xml b/pom.xml
index 1464164..cf2e017 100644
--- a/pom.xml
+++ b/pom.xml
@@ -16,6 +16,7 @@
agt-module-system
agt-module-infra
+ agt-module-license