Code Monkey home page Code Monkey logo

memory-core's Introduction

Memory-Core

这里是Memory Blog的后端仓库

项目结构

Memory-Core
├── src
│   ├── main
│   │   ├── java
│   │   │   └── com
│   │   │       └── memory
│   │   │           └── blog
│   │   │               ├── aspect 切面
│   │   │               ├── config 配置
│   │   │               ├── controller 控制器 
│   │   │               ├── dao 数据访问层 ,和 mapper 冲突
│   │   │               ├── entity 实体类 
│   │   │               ├── enums 枚举
│   │   │               ├── exception 异常,TODO
│   │   │               ├── interceptor 拦截器
│   │   │               ├── mapper mapper接口
│   │   │               ├── service 
│   │   │               ├── utils
│   │   │               └── ServerApplication.java 启动类
│   │   └── resources
│   │       ├── com.linmoblog.server.mapper mapper文件
│   │       ├── db-init 数据库初始化文件
│   │       ├── MATE-INF 
│   │       ├── application.yml 通用配置
│   │       ├── application-dev.yml 开发环境配置
│   │       ├── application-prod.yml 生产环境配置
│   │       └── logback-spring.xml

JDK版本 21.0.2

在 application.yml 中修改配置

image

使用

在yml文件中absolutePath配置应为:classpath:/upload/

cd Memory-Core
mvn spring-boot:run

初始账号:
admin
123456

增加 sys_config 表保存配置信息

在 application.yml 中的配置可以写到 sys_config 表中(除了数据库配置,一般用于存储业务配置),这样可以在数据库或者后台管理界面修改项目配置(TODO)。 config_key 对应配置的 key,config_value 对应配置的 value。

文件存储

文件存储目前继承了本地文件存储、阿里云 OSS 文件存储,后续会扩展更多的文件存储方式(Github、Gitee) 同时只支持一种文件存储方式,如果配置了多种文件存储方式,则会有报错提示。

说人话就是 ali.enable 和 local.enable 只能有一个为 true。

阿里云 OSS 文件存储

在 application.yml 中修改配置

ali:
  enable: true # 是否启用阿里云 OSS 文件存储
  endpoint: xxx # OSS endpoint 
  accessKeyId: xxx # OSS accessKeyId
  accessKey: xxx # OSS accessKey
  bucketName: xxx # OSS bucketName
  uploadPath: xxx # OSS uploadPath

本地文件存储

在 application.yml 中修改配置

local:
  enable: true # 是否启用本地文件存储
  uploadDir: xxx # 本地文件存储路径, 例如:/usr/local/upload 或 upload-dir 。

环境搭建

minio搭建

推荐使用 docker 进行安装。 命令如下:

# 创建文件夹
mkdir /home/minio
cd /home/minio
mkdir data 
mkdir config

# 运行容器
docker run --name minio \
-p 9000:9000 \
-p 9999:9999 \
-d --restart=always \
-e "MINIO_ROOT_USER=memory" \
-e "MINIO_ROOT_PASSWORD=memory" \
-v /home/minio/data:/data \
-v /home/minio/config:/root/.minio \
minio/minio server /data \
--console-address '0.0.0.0:9999'

memory-core's People

Contributors

linmoqc avatar poison02 avatar defings avatar wkqzbb avatar

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.