cn.workde:workde-core-base

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

License

License

GroupId

GroupId

cn.workde
ArtifactId

ArtifactId

workde-core-base
Last Version

Last Version

1.2.6-RELEASE
Release Date

Release Date

Type

Type

jar
Description

Description

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

Download workde-core-base

How to add to project

<!-- https://jarcasting.com/artifacts/cn.workde/workde-core-base/ -->
<dependency>
    <groupId>cn.workde</groupId>
    <artifactId>workde-core-base</artifactId>
    <version>1.2.6-RELEASE</version>
</dependency>
// https://jarcasting.com/artifacts/cn.workde/workde-core-base/
implementation 'cn.workde:workde-core-base:1.2.6-RELEASE'
// https://jarcasting.com/artifacts/cn.workde/workde-core-base/
implementation ("cn.workde:workde-core-base:1.2.6-RELEASE")
'cn.workde:workde-core-base:jar:1.2.6-RELEASE'
<dependency org="cn.workde" name="workde-core-base" rev="1.2.6-RELEASE">
  <artifact name="workde-core-base" type="jar" />
</dependency>
@Grapes(
@Grab(group='cn.workde', module='workde-core-base', version='1.2.6-RELEASE')
)
libraryDependencies += "cn.workde" % "workde-core-base" % "1.2.6-RELEASE"
[cn.workde/workde-core-base "1.2.6-RELEASE"]

Dependencies

compile (7)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-web jar 2.1.7.RELEASE
org.springframework.boot : spring-boot-starter-aop jar 2.1.7.RELEASE
org.projectlombok : lombok jar 1.18.8
cn.hutool : hutool-core jar 4.6.2
com.alibaba : fastjson jar 1.2.59
com.fasterxml.jackson.datatype : jackson-datatype-jsr310 jar 2.9.9
io.swagger : swagger-annotations jar 1.5.23

Project Modules

There are no modules declared in this project.

Workde 框架

介绍

  Workde Core是一个基于SpringBoot封装的基础库,内置丰富的JDK工具,并且自动装配了一系列的基础Bean

工程结构

.workde-core
│   ├── workde-core-dependencies  父pom
│   ├── workde-core-base          基础库提供了丰富的Java工具包
│   ├── workde-starter-boot       基于SpringBoot进行二次封装,同时也自动装配了一系列基础Bean等
│   ├── workde-starter-redis      基于SpringRedis进行二次封装,更简单灵活
│   ├── workde-starter-token      提供token创建与解析
│   ├── workde-starter-secure     提供权限相关的注解,拦截器等
│   ├── workde-starter-mybatis-tk 基于Mybatis,Tkmybatis进行二次封装,提供了默认的Service,Mapper
│   ├── workde-starter-admin      通过配置实体类,提供普通的CRUD接口
│   ├── workde-starter-cache      基于SpringBootCache进行二次封装,提供简单CacheUtils
│   ├── workde-starter-oss-qiniu  七牛云存储的封装
│   └── workde-starter-swagger    基于Swagger,knife4j进行二次封装,提供接口Api文档
├── workde-core-samples  基础库示例   
└── └── workde-core-boot

快速使用

maven项目,在pom.xml文件中添加如下一段代码,并将${version}替换为对应版本号:maven-central

<parent>
	<groupId>cn.workde</groupId>
	<artifactId>workde-core-dependencies</artifactId>
	<version>${version}</version>
</parent>

随后引入所需要的模块

<dependencies>
	<dependency>
		<groupId>cn.workde</groupId>
		<artifactId>workde-starter-boot</artifactId>
	</dependency>
	...
</dependencies>

模块说明

workde-core-base

workde-core-base提供了丰富的Java工具包,它能够帮助我们简化每一行代码(集成Hutool工具包)

  • ResultHttp最外层响应对象,更适应Restful风格API
  • 基于validator扩展IPO增强校验注解,更适合国内校验场景。(如:手机号、身份证号码)

workde-starter-boot

workde-starter-boot基于SpringBoot进行二次封装,同时也自动装配了一系列基础Bean

  • 通过WorkdeApplication.run启动项目
  • 全局统一异常处理,结合Result对象,定位异常更轻松,前端显示更贴切
  • 控制Json返回字段的 JsonReturnHandler

workde-starter-redis

基于SpringRedis进行二次封装,更简单灵活,提供全局token与登录等特性

  • 简化使用并拥有Redis原生常用命令所对应的方法

workde-starter-token

提供token创建与解析

  • 通过JwtUtil获取和解析token串
  • 集成WorkdeController获取Token的用户信息

workde-starter-secure

提供权限相关的注解,拦截器等

  • 默认只对swagger相关的接口放行,可通过配置 workde.secure.skip 来设置放行地址
  • 通过 @PreAuth 来实现功能判断(待实现)

workde-starter-mybatis-tk

基于Mybatis,Tkmybatis进行二次封装,提供了默认的Service,Mapper

  • 默认Service提供 list, page, byId, one, save, udpate, delete 等方法

workde-starter-admin

通过配置实体类,提供普通的CRUD接口

  • 启动类增加注解 @EnableWorkdeAdmin, workde.admin.contextPath 配置后台地址,默认为 admin
  • Controller 继承 ModuleController,提供 list(列表),newDefault(默认值),create(保存),edit(修改),update(更新),delete(删除) 接口
  • 增加注解@AdminController, 设置ModuleDefinepath (必须)
  • ModuleDefine 定义Module的实体类,Service,Logic等
  • Logic 默认提供 beforeInsert(插入前),afterInsert(插入后),beforeUpdate(保存前),afterUpdate(保存后),beforeDelete(删除前),afterDelete(删除后),getNewDefultValue(默认值)

workde-starter-cache

基于SpringBoot Cache进行二次封装,使用ehcache分布式缓存

  • CacheUtils 提供了 获取缓存对象, 设置缓存, 清除缓存, 清空 等方法

workde-starter-oss-qiniu

七牛云存储的封装

  • 通过IQiniuService getUploadToken 获取上传Token

workde-starter-swagger

  • 在application.yml文件中添加basePackages来重新定义路径

Versions

Version
1.2.6-RELEASE
1.2.5-RELEASE
1.2.4-RELEASE
1.2.3-RELEASE
1.2.2-RELEASE
1.2.1-RELEASE
1.2.0-RELEASE