Code Monkey home page Code Monkey logo

dot's Introduction

烛火录服务端

Codacy Badge

项目关键词

  • Spring BootJava
  • JWTRBAC
  • Rest APIOpenAPIv3
  • PostgreSQLRedisFlyway
  • JunitJacoco
  • LombokMapstructJavapoet
  • PMDPMD-P3C
  • OSS
  • CICD
  • Prometheus

项目结构

src
├─main
│  ├─java
│  │  └─o
│  │      └─w
│  │          └─o
│  │              ├─api
│  │              ├─resource
│  │              │  ├─example
│  │              │  │   └─modulex
│  │              │  │      ├─configuration
│  │              │  │      ├─domain
│  │              │  │      │  └─property
│  │              │  │      ├─repository
│  │              │  │      ├─service
│  │              │  │      │  ├─dto
│  │              │  │      │  ├─dtomapper(DO DTO 转换配置)
│  │              │  │      │  ├─dtovalidator(DTO 验证器)
│  │              │  │      │  └─impl
│  │              │  │      └─util
│  │              │  └─system
│  │              │      ├─authentication(认证)
│  │              │      ├─authorization(授权)
│  │              │      ├─notification(通知)
│  │              │      ├─permission(权限)
│  │              │      ├─role(角色)
│  │              │      └─user(用户)
│  │              ├─server
│  │              │  ├─aop
│  │              │  ├─configuration
│  │              │  │  ├─handler
│  │              │  │  │  └─exceptions(分类全局异常拦截器)
│  │              │  │  └─properties
│  │              │  ├─definition(数据定义)
│  │              │  ├─helper(与 util 区别 需要 @Resource 注入使用)
│  │              │  ├─runner
│  │              │  ├─schedule
│  │              │  ├─util(静态工具类)
│  │              │  └─validator(验证器)
│  │              ├─util(全局静态工具类,尽量使用完善的三方库基于接口封装)
│  │              └─websocket
│  │                  └─endpoint
│  └─resources
│      ├─META-INF
│      ├─config(配置文件)
│      ├─db
│      │  └─migration(flyway 脚本)
│      ├─i18n(国际化)
│      ├─resource
│      ├─static
│      └─templates
└─test

项目约定

定义 Definition

  • 模型

    • 服务泛型:ServiceResult
    • 服务异常:ServiceException
    • 接口泛型:ApiResult
    • 接口异常:ApiException
    • 系统异常:SystemException
  • 全局处理

    • 接口全局异常处理:ApiExceptionsHandler
    • 接口全局包装处理:ApiResponseHandler

安全 Security

  • 权限配置

    • 访问控制形式 RBAC
  • 认证 - 授权 [ JWT ]

    • 认证:
      • 生成、注册、校验、刷新、注销
    • 授权
      • 解析、注入
  • 安全策略

数据 Data

  • PostgreSQL

    • 系统资源:
      • 用户
      • 角色
      • 权限
  • Redis

    • 认证
    • 服务访问限制(基于 IP 和 User ID)
    • 接口访问限制(基于 IP 或 User ID)
    • 缓存 Service 层操作结果
  • Flyway

    • 数据库管理
      • 数据库 Baseline 配置
      • 数据库 核心表 SQL 脚本

测试 Test

  • 单元测试
    • Junit 单元测试
    • Jacoco 代码覆盖率

持续集成 / 部署 CI/CD

  • Jenkins
    • 单元测试
    • 代码检查
  • Aliyun Docker Registry
  • Github App Integration
    • 依赖检测

代码简化 Simplification

  • OpenApi
    • 接口 SDK 自动生成
  • MapStruct
    • 对象 DTO DO 自动转化
  • Lombok
    • 对象代码简化

贡献

感谢 JetBrains 提供的 开源许可证(open source licence)。

Jetbrains logo

dot's People

Contributors

o-w-o avatar dependabot-preview[bot] avatar codacy-badger avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

cckmit

dot's Issues

convention($module=core): 项目约定 核心

数据格式 definition

  • 服务泛型:ServiceResult
  • 接口泛型:ApiResult
  • 异常处理 Exception
    • 全局异常处理:ApiExceptionsControllerAdvice
    • 接口异常:ApiException
    • 服务异常:ServiceException
    • 系统异常:SystemException

安全配置 security

  • 权限配置:访问控制形式
  • 认证 / 授权
    • 认证:JWT 生成、注册、校验、刷新、注销
    • 授权:解析、注入

数据库 database

  • postgrel
    • 资源:
      • 用户
      • 权限
  • redis
    • 认证
    • IP 访问限制
    • 接口访问限制
  • flyway
    • 数据库维护

缓存 cache

  • redis

测试 test

  • 单元测试
  • 测试覆盖率

持续集成 / 部署 ci/cd

  • Aliyun Docker Registry
  • Github App Integration
  • Jenkins

代码自动生成

  • 接口 OpenApi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.