Giter Club home page Giter Club logo

citrus's Introduction

citrus-logo

Citrus: 低代码开发脚手架

code style springboot-2.5.2 mybatis-plus-3.4.3 maven

项目简介

🌈 低代码快速开发脚手架

前后端分离架构,基于SpringBoot2.x + SpringSecurity + JWT + Mybatis-plus + Activiti7

灵活、高效,降低开发成本

前端仓库地址https://github.com/Yiuman/citrus-vuetify

😄 我是一个活生生的例子

欢迎issues、PR~~ 如果此项目对你有所帮助,麻烦动动小手给个小星星:star:

项目特性

  1. 开箱即用,引入starter依赖后即可启动
  2. 高效开发,只需要定义实体与库表,入口继承基类的Controller,即可完成基础的增删改查操作
  3. 常用数据结构的封装与基础的CRUD实现(左右值预遍历树、普通树等)
  4. 统一的认证入口,方便的安全认证扩展,可实现多种方式的认证,且支持表单与接口
  5. 灵活的权限钩子,既可全局进行权限验证、亦可定义于类与方法,验证方式易与扩展
  6. 细粒度的RBAC权限控制,可自定义验证方式,支持数据范围注入
  7. 动态数据源+多数据源事务管理
  8. 封装activiti7工作流,多实例加签,任务跳转

项目结构/模块设计及使用指南

  • citrus-boot-starter 项目自动配置相关
  • citrus-main 项目的运行入口(体验开箱即用的快感)
  • citrus-security 项目安全相关的代码,统一认证、验证码类型、鉴权、jwt等 安全模块传送门
  • citrus-support 项目通用支持相关的代码,通用Service层、Controller层,工具类、缓存、异常、注入、数据结构、动态数据源及相关扩展 通用CRUD指南多数据源及事务
  • citrus-system 项目系统设计的主要实现 包含用户、角色、权限、资源、菜单、数据范围等模块的实现与处理,数据范围注入也在这里 权限数据范围设计
  • citrus-workflow 整合activiti7的工作流模块,实现多维度人员解析、加签、跳转功能 acitivi模型设计器
  • citrus-workflow-impl 系统模块与工作流模块结合的工作流相关实现

如何使用

方式一

  1. springboot项目中引入最新的依赖 见readme顶部微章

    <dependency>
      <groupId>com.github.yiuman</groupId>
      <artifactId>citrus-boot-starter</artifactId>
      <version>${latest}</version>
    </dependency>
  2. 下载 https://github.com/Yiuman/citrus/tree/master/sql 中的sql文件,创建你的数据并执行(多数据源请见多数据源及事务使用指南)

  3. application.yml中配置数据库及应用信息

    spring:
      datasource:
        driver-class-name: com.mysql.jdbc.Driver
        url: jdbc:mysql://localhost:3306/citrus?zeroDateTimeBehavior=convertToNull&characterEncoding=UTF-8
        username: root
        password: yiuman
    server:
      port: 8082
  4. 启动项目

方式二

  1. 克隆项目 git clone https://github.com/Yiuman/citrus.git

  2. 自行修改项目配置与代码

  3. 启动项目

citrus's People

Contributors

carldea avatar dependabot[bot] avatar henyi-c avatar suhigh avatar yiuman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

citrus's Issues

简单树报错

简单树形结构报错,如图所示树形顶级的父类id为null
尝试将顶级父类id定义为“0”后,方法的第三行报错,再次将第三行的current.getParentId()定义为“0”后,只能得到顶级那一层的数据

微信截图_20220819182202

    private void listToTree(E current, final List<E> list) {
        Map<K, List<E>> parentIdChildrenMap = list.stream().collect(Collectors.groupingBy(Tree::getParentId));
        for (E entity : list) {
            K id = entity.getId();
            List<E> es = parentIdChildrenMap.get(id);
            if (null != es) {
                List<E> collect = es.stream().distinct().collect(Collectors.toList());
                entity.setChildren(collect);
            }
        }
        current.setChildren(list.stream().filter(entity -> Objects.equals(entity.getParentId(), 0L)).collect(Collectors.toList()));
    }

同时在判断获取普通树形或左右值树的service时,总是进入左右值的方法,所以我将此处的superclass.isAssignableFrom改成了equals

// 超类比较
            if (superclass.equals(BasePreOrderTree.class)) {
                return CrudUtils.getCrudService(
                        getModelClass(),
                        (Class<K>) TypeUtil.getTypeArgument(getClass(), 1),
                        BasePreOrderTreeService.class
                );
            }

登录报错

报错:java.lang.NoSuchMethodError: java.lang.Class.getModule()Ljava/lang/Module,是不是因为jdk必须是16或17的原因?
图片

编译workflow报错

无法将类 com.github.yiuman.citrus.workflow.cmd.AddClaimCmd中的构造器 AddClaimCmd应用到给定类型;

代码更新

代码是不是有些没上传啊

我这clone下来发现很多sql字段和entity类字段不符的。

这个项目真不错,哈哈,拿来学习下

数据库脚本与代码不对应

AccessLog.java 里面有 createTime,表里面是 created_time
sys_role 表 有 create_by,AbstractAuditingEntity 里面是 created_by

单独使用citrus-support模块遇到的问题

仅依赖"citrus-support"模块时,调用CRUD方法提示未知异常.

控制台打印的错误信息如下:
Cannot find current proxy: Set 'exposeProxy' property on Advised to 'true' to make it available, and ensure that AopContext.currentProxy() is invoked in the same thread as the AOP invocation context.

我在Springboot入口类添加EnableAspectJAutoProxy注解,还是报错;

请问一下如何单独使用"citrus-support"模块呢?

sql建表语句错误

1)INSERT INTO sys_user (user_id, login_id, password, username, email, mobile, uuid, status, create_time, create_by,
last_modified_time, last_modified_by, version, admin, avatar)
VALUES (1, 'admin', '$2a$10$gK0BhYud6iSM7um4RLCYvuYEvtWSLYjsKb3VlTEcxgbtPQC3pAK9C', '平台管理员', '[email protected]',
'13119593102', 'YvuYEvtWSLYjsKb3VlTEcxgbtPQC3pAK9C', 1, '2020-09-23 03:27:51', null, '2020-09-23 03:27:51', 1,
1, 1, null); create_time写成了created_time
2)有几个表例如sys_role promary key前少了,

分页查询无法拼接条件

作者你好,使用分页查询无法实现根据传入条件进行查询,烦请解答,具体代码如下

/**
 * citrus自带分页查询
 * /
@GetMapping
public ResponseEntity<Page<T>> getPageList(HttpServletRequest request) throws Exception {
    return ResponseEntity.ok(getProxy().page(request));
}

如上默认的分页查询方法,传入实体类字段无法根据条件查询,实体如下:

@Data
@TableName("student")
public class Student {
    @Equals(mapping = "id")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Like(mapping = "name")
    private String name;

    @Equals(mapping = "student_id")
    private String studentId;
}

请求如下:

http://127.0.0.1:8082/student?current=1&size=100&name=李四

结果:查询出全部记录

LocalFileStorageService的save函数处理不当

问题说明:

\citrus-support\src\main\java\com\github\yiuman\citrus\support\file\LocalFileStorageServiceImpl.java#L44

save函数未对上传文件名做处理,导致任意文件上传

image

image

image

修复建议:

增加对文件名的处理,特殊字符过滤或者重命名

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.