1. 统一包名修改
This commit is contained in:
BIN
.image/common/cloud-cloud-architecture.png
Normal file
BIN
.image/common/cloud-cloud-architecture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 201 KiB |
BIN
.image/common/cloud-roadmap.png
Normal file
BIN
.image/common/cloud-roadmap.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
@@ -0,0 +1,20 @@
|
|||||||
|
package com.zt.plat.base;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base 服务器的启动类
|
||||||
|
*
|
||||||
|
* @author ZT
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${cloud.info.base-package}
|
||||||
|
@SpringBootApplication(scanBasePackages = {"${cloud.info.base-package}.base", "${cloud.info.base-package}.module"},
|
||||||
|
excludeName = {})
|
||||||
|
public class BaseServerApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(BaseServerApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.zt.plat.base.controller.base;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* base 控制器
|
||||||
|
*
|
||||||
|
* @author ZT
|
||||||
|
*/
|
||||||
|
@Tag(name = "base")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base")
|
||||||
|
public class BaseDemoController {
|
||||||
|
|
||||||
|
@GetMapping("/hello")
|
||||||
|
@Operation(summary = "Hello base")
|
||||||
|
public CommonResult<String> hello() {
|
||||||
|
return success("Hello, base!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
734
cloud-dependencies/pom.xml
Normal file
734
cloud-dependencies/pom.xml
Normal file
File diff suppressed because it is too large
Load Diff
156
cloud-framework/cloud-common/pom.xml
Normal file
156
cloud-framework/cloud-common/pom.xml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,59 @@
|
|||||||
|
package com.fhs.trans.service;
|
||||||
|
|
||||||
|
import com.fhs.core.trans.vo.VO;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 只有实现了这个接口的才能自动翻译
|
||||||
|
*
|
||||||
|
* 为什么要赋值粘贴到 cloud-common 包下?
|
||||||
|
* 因为 AutoTransable 属于 easy-trans-service 下,无法方便的在 cloud-module-xxx-api 模块下使用
|
||||||
|
*
|
||||||
|
* @author jackwang
|
||||||
|
* @since 2020-05-19 10:26:15
|
||||||
|
*/
|
||||||
|
public interface AutoTransable<V extends VO> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 ids 查询数据列表
|
||||||
|
*
|
||||||
|
* 改方法已过期啦,请使用 selectByIds
|
||||||
|
*
|
||||||
|
* @param ids 编号数组
|
||||||
|
* @return 数据列表
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
default List<V> findByIds(List<? extends Object> ids){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 ids 查询
|
||||||
|
*
|
||||||
|
* @param ids 编号数组
|
||||||
|
* @return 数据列表
|
||||||
|
*/
|
||||||
|
default List<V> selectByIds(List<? extends Object> ids){
|
||||||
|
return this.findByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 db 中所有的数据
|
||||||
|
*
|
||||||
|
* @return db 中所有的数据
|
||||||
|
*/
|
||||||
|
default List<V> select(){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 id 获取 vo
|
||||||
|
*
|
||||||
|
* @param primaryValue id
|
||||||
|
* @return vo
|
||||||
|
*/
|
||||||
|
V selectById(Object primaryValue);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.zt.plat.framework.common.biz.infra.logger;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.biz.infra.logger.dto.ApiAccessLogCreateReqDTO;
|
||||||
|
import com.zt.plat.framework.common.enums.RpcConstants;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
@FeignClient(name = RpcConstants.INFRA_NAME) // TODO 芋艿:fallbackFactory =
|
||||||
|
@Tag(name = "RPC 服务 - API 访问日志")
|
||||||
|
public interface ApiAccessLogCommonApi {
|
||||||
|
|
||||||
|
String PREFIX = RpcConstants.INFRA_PREFIX + "/api-access-log";
|
||||||
|
|
||||||
|
@PostMapping(PREFIX + "/create")
|
||||||
|
@Operation(summary = "创建 API 访问日志")
|
||||||
|
CommonResult<Boolean> createApiAccessLog(@Valid @RequestBody ApiAccessLogCreateReqDTO createDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【异步】创建 API 访问日志
|
||||||
|
*
|
||||||
|
* @param createDTO 访问日志 DTO
|
||||||
|
*/
|
||||||
|
@Async
|
||||||
|
default void createApiAccessLogAsync(ApiAccessLogCreateReqDTO createDTO) {
|
||||||
|
createApiAccessLog(createDTO).checkError();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.zt.plat.framework.common.biz.infra.logger;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO;
|
||||||
|
import com.zt.plat.framework.common.enums.RpcConstants;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
@FeignClient(name = RpcConstants.INFRA_NAME) // TODO 芋艿:fallbackFactory =
|
||||||
|
@Tag(name = "RPC 服务 - API 异常日志")
|
||||||
|
public interface ApiErrorLogCommonApi {
|
||||||
|
|
||||||
|
String PREFIX = RpcConstants.INFRA_PREFIX + "/api-error-log";
|
||||||
|
|
||||||
|
@PostMapping(PREFIX + "/create")
|
||||||
|
@Operation(summary = "创建 API 异常日志")
|
||||||
|
CommonResult<Boolean> createApiErrorLog(@Valid @RequestBody ApiErrorLogCreateReqDTO createDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【异步】创建 API 异常日志
|
||||||
|
*
|
||||||
|
* @param createDTO 异常日志 DTO
|
||||||
|
*/
|
||||||
|
@Async
|
||||||
|
default void createApiErrorLogAsync(ApiErrorLogCreateReqDTO createDTO) {
|
||||||
|
createApiErrorLog(createDTO).checkError();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user