{"id":25332219,"url":"https://github.com/xincao9/infra-framework","last_synced_at":"2026-04-30T10:03:43.706Z","repository":{"id":274482709,"uuid":"923054574","full_name":"xincao9/infra-framework","owner":"xincao9","description":"一个开箱即用的Java基础框架，旨在提供常用功能，简化项目开发","archived":false,"fork":false,"pushed_at":"2025-07-05T09:23:30.000Z","size":415,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-18T16:40:46.482Z","etag":null,"topics":["grpc","java","microservice"],"latest_commit_sha":null,"homepage":"https://golinks.fun/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xincao9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-27T15:11:05.000Z","updated_at":"2025-07-05T09:23:33.000Z","dependencies_parsed_at":"2025-02-10T18:21:17.823Z","dependency_job_id":"bda6d57f-cd9f-41a9-a319-8bd70ac797fe","html_url":"https://github.com/xincao9/infra-framework","commit_stats":null,"previous_names":["xincao9/infra-framework"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xincao9/infra-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xincao9%2Finfra-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xincao9%2Finfra-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xincao9%2Finfra-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xincao9%2Finfra-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xincao9","download_url":"https://codeload.github.com/xincao9/infra-framework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xincao9%2Finfra-framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32460781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grpc","java","microservice"],"created_at":"2025-02-14T04:31:30.854Z","updated_at":"2026-04-30T10:03:43.677Z","avatar_url":"https://github.com/xincao9.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# infra-framework\n\n## 项目简介\n\ninfra-framework 是一个开箱即用的Java基础框架，旨在提供常用功能，简化项目开发。框架包括以下子模块：\n\n- [infra-core](#infra-core)\n- [infra-trace](#infra-trace)\n- [infra-config](#infra-config)\n\n## 子模块\n\n### infra-core\n\n提供一些Java项目实践中常用的功能：\n\n- 异常、CORS、Trace 统一处理\n- 状态码枚举 (`fun.golinks.core.consts.StatusEnums`)\n- 限流功能\n- 接口声明方式调用外部接口\n\n#### 示例代码\n\n限流功能示例：\n\n```java\n\n@RestController\n@RequestMapping(\"greeter\")\npublic class GreeterController {\n\n    @Resource\n    private SysUserService sysUserService;\n    @Resource\n    private GreeterInvoker greeterInvoker;\n\n    @RateLimited(permitsPerSecond = 10)\n    @PostMapping(\"say\")\n    public GreeterSayResponseVO say(@RequestBody GreeterSayRequestVO greeterSayRequestVO) throws Throwable {\n        // 读取数据库\n        SysUser sysUser = sysUserService.findByName(greeterSayRequestVO.getName());\n        if (sysUser == null) {\n            return null;\n        }\n        // 调用grpc服务\n        GreeterSayRequest request = GreeterSayRequest.newBuilder().setName(sysUser.getEmail()).build();\n        GreeterSayResponse response = greeterInvoker.sayInvoker.apply(request);\n        return new GreeterSayResponseVO(response.getMessage());\n    }\n}\n```\n\n### infra-trace\n\n**简单专注**：拒绝臃肿的依赖，保持功能专一。\n\n#### 功能点\n\ninfra-trace 提供以下功能：\n\n* 使用 Zipkin 追踪调用\n* 追踪范围：\n    * Spring MVC 接口追踪\n    * MyBatis 数据库调用追踪\n    * gRPC 远程调用追踪\n    * Redis 访问追踪\n    *\n\n#### 配置文件\n\n在你的 `application.yml` 文件中添加以下配置：\n\n```yaml\ninfra:\n  trace:\n    enabled: true\n    zipkin:\n      url: \"http://localhost:9411/api/v2/spans\"\n      sampler: \"1.0F\"\n```\n\n### infra-config\n\n#### 设计思想\n\n**简单专注**；无需为了集中配置管理，而增加新的中间件；依赖git对配置进行权限和版本管理；极少的代码量方便进行二次开发\n\n#### 功能点\n\n* 项目启动和运行中，实时同步git中的项目配置文件到本地，位于 ${home}/.config/{infra.config.app-name}/ 目录下\n* @Value标记的Bean字段，实时更新最新的配置\n* @ConfigurationProperties 标记的配置属性Bean，实时更新最新的配置\n\n#### 配置文件\n\n位置：classpath:/resources/config.yaml\n\n```yaml\ninfra:\n  config:\n    app-name: sample # 应用名，一般设置为spring.application.name一样\n    enabled: true # 功能是否开启\n    type: git # 使用git做为配置中心\n    git:\n      uri: https://github.com/xincao9/sample-config-repo.git # git配置文件仓库\n      remote: origin # 远程库名，一般不需要改动\n      remote-branch-name: main # 配置使用的代码分支\n      delay-seconds: 30 # 配置同步到本地的延迟，单位：秒\n```\n\n## 贡献\n\n欢迎提交Issues和Pull Requests进行贡献。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxincao9%2Finfra-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxincao9%2Finfra-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxincao9%2Finfra-framework/lists"}