1 Star 0 Fork 0

MissQinMeng / store

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
MIT

Store系统介绍

技术栈

技术 说明 官网
lombok 一个 Java 库,可自动插入您的编辑器并构建工具 https://projectlombok.org/
mysql 一个免费最常用的关系型数据库 https://www.mysql.com/
redis 最强大的内存管理数据库 https://redis.io/
druid 一个JDBC连接池,监控,等组件 https://github.com/alibaba/druid
hutool Hutool是一个小而全的Java工具类库 https://www.hutool.cn/docs/#/
mybatis plus 非常好用的dao层框架 增强mybatis https://mybatis.plus/
autopoi Excel和 Word简易工具类 https://gitee.com/jeecg/autopoi?_from=gitee_search

模块说明

  1. core 基础依赖模块(配置,工具类等)
  2. auth 权限模块
  3. store 店铺模块
  4. system 系统级别处理模块(垃圾表处理)

常用类说明

说明
DeleteInnerInterceptor 删除拦截器
WebLogAop aop日志处理
RequestInterceptor 请求拦截
BasePageRequest 分页统一请求父类
BaseRequest 统一请求父类
BaseResult 统一返回类
RedisKeyConst RedisKey管理类
RequestAttributeKeyConst RequestAttributeKey管理类

entity包

  1. base 基础类
  2. bo 数据库对应实体
  3. dto 参数和传输对应
  4. vo 返回实体

运行环境

  • jdk11
  • mysql 8
  • redis 5.0

规范

com.time.store.*.controller 控制器,负责对service的前置处理, 处理对象转换之类

com.time.store.*.service service无接口类 直接实现类,具体业务逻辑

com.time.store.*.dao 对数据库的操作

com.time.store.*.entity.bo 数据库对应实体

com.time.store.*.entity.dto 接受的请求或者传输需要的类

com.time.store.*.entity.vo 响应类,返回类

控制器返回

错误返回直接抛异常

示例

        import com.time.store.core.util.Assert;
        Assert.state(false,"失败");
        //返回{"code":500,"success":false,"message":"java.lang.IllegalStateException: 失败","data":null}

正常返回

    // 直接传字符串会封装到message里
    @GetMapping
    public String hello() {
        return "hello";
    }
    //返回{"code":200,"message":"hello","success":true}

    // 传除了字符串和Result其他类会封装到data里
    @GetMapping
    public JSONObject hello() {
        JSONObject jsonObject=new JSONObject();
        jsonObject.put("name","jikeytang");
        return jsonObject;
    }
    // 返回{"code":200,"data":{"name":"jikeytang"},"success":true}

自定义返回

    // 自定义result返回
    @GetMapping
    public Result hello() {
        return new Result();
    }
    
    //如果不想返回Result又想自定义可以使用@IgnoreResultAdvice
    @GetMapping
    @IgnoreResultAdvice
    public Result hello() {
        return new Result();
    }

注解

注解统一放在com.yun.yunmanager.annotations下

  1. @IgnoreAuth 忽略权限校验可放在方法或者类上
  2. @IgnoreResultAdvice 忽略对返回值封装可放在方法或者类上
  3. @LoginUser 控制器方法属性使用,可以注入当前用户
  public ActiveUser me(@LoginUser ActiveUser activeUser) {
        return activeUser;
    }

sql规范

  1. 设计表所有字段尽量不能为null
  2. 表名规范 模块名_表名
  3. 创建时间和修改时间必带
    `create_time` datetime NOT NULL COMMENT '创建时间',
    `update_time` datetime NOT NULL COMMENT '修改时间',

对应model

    @TableId(type = IdType.AUTO)
    private Integer id;
  1. id为int类型
    `id` int NOT NULL,

对应model

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
  1. 不需要是否删除状态,被删除的记录会统一存在删除表里
MIT License Copyright (c) 2021 杰克 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

有赞商城的后台管理模仿 expand collapse
PLpgSQL and 4 more languages
MIT
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/MissQinMeng/store.git
git@gitee.com:MissQinMeng/store.git
MissQinMeng
store
store
master

Search

344bd9b3 5694891 D2dac590 5694891