diff --git a/yui-base-core/pom.xml b/yui-base-core/pom.xml
new file mode 100644
index 0000000..4cbad9d
--- /dev/null
+++ b/yui-base-core/pom.xml
@@ -0,0 +1,107 @@
+
+
+ 4.0.0
+
+ com.yui
+ yui-springboot
+ 0.0.1-SNAPSHOT
+
+
+ yui-base-core
+
+
+ 15
+ 15
+ UTF-8
+
+
+
+
+
+ com.feiniaojin
+ graceful-response
+
+
+
+
+ cn.hutool
+ hutool-all
+
+
+
+
+ cn.dev33
+ sa-token-spring-boot-starter
+
+
+
+
+ cn.dev33
+ sa-token-redis-jackson
+
+
+
+
+ com.mysql
+ mysql-connector-j
+ runtime
+
+
+
+
+ com.mybatis-flex
+ mybatis-flex-spring-boot3-starter
+
+
+ com.mybatis-flex
+ mybatis-flex-processor
+ provided
+
+
+
+
+ com.github.pagehelper
+ pagehelper
+
+
+
+
+ io.springfox
+ springfox-swagger2
+
+
+ io.springfox
+ springfox-swagger-ui
+
+
+
+
+ org.apache.commons
+ commons-compress
+
+
+
+
+ cn.afterturn
+ easypoi-base
+
+
+ cn.afterturn
+ easypoi-web
+
+
+ cn.afterturn
+ easypoi-annotation
+
+
+
+
+ com.alibaba
+ easyexcel
+
+
+
+
+
\ No newline at end of file
diff --git a/yui-base-core/src/main/java/com/yui/base/controller/BaseController.java b/yui-base-core/src/main/java/com/yui/base/controller/BaseController.java
new file mode 100644
index 0000000..7b49444
--- /dev/null
+++ b/yui-base-core/src/main/java/com/yui/base/controller/BaseController.java
@@ -0,0 +1,33 @@
+package com.yui.base.controller;
+
+import cn.hutool.json.JSONUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Controller;
+
+
+/**
+ * 基础业务接口控制器
+ *
+ * @author yui
+ */
+@Controller
+public class BaseController {
+
+ private static final Logger logger = LoggerFactory.getLogger(BaseController.class);
+
+ @Value("${spring.profiles.active:develop}")
+ private String profileName;
+
+ /**
+ * 把实体类转成JSON字符串
+ *
+ * @param obj 实体类
+ * @return {@link String}
+ */
+ protected String toString(Object obj) {
+ return JSONUtil.toJsonStr(obj);
+ }
+
+}
diff --git a/yui-base-core/src/main/java/com/yui/base/entity/BaseEntity.java b/yui-base-core/src/main/java/com/yui/base/entity/BaseEntity.java
new file mode 100644
index 0000000..b7fe56d
--- /dev/null
+++ b/yui-base-core/src/main/java/com/yui/base/entity/BaseEntity.java
@@ -0,0 +1,68 @@
+package com.yui.base.entity;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.mybatisflex.annotation.Column;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 基础实体类
+ *
+ * @author yui
+ */
+@Data
+@ApiModel(value = "基础实体类")
+public class BaseEntity implements Serializable {
+
+ /**
+ * 当前页面数据量
+ */
+ @ApiModelProperty(value = "当前页面数据量")
+ @ExcelIgnore
+ @Column(ignore = true)
+ private int pageSize;
+
+ /**
+ * 当前页码
+ */
+ @ApiModelProperty(value = "当前页码")
+ @ExcelIgnore
+ @Column(ignore = true)
+ private int pageNum;
+
+ /**
+ * 排序字段
+ */
+ @ApiModelProperty(value = "排序字段")
+ @ExcelIgnore
+ @Column(ignore = true)
+ private String field = "id";
+
+ /**
+ * 排序规则,asc升序,desc降序
+ */
+ @ApiModelProperty(value = "排序规则")
+ @ExcelIgnore
+ @Column(ignore = true)
+ private String order = "desc";
+
+ /**
+ * 自定义排序字符串
+ */
+ @ApiModelProperty(value = "自定义排序字符串")
+ @ExcelIgnore
+ @Column(ignore = true)
+ private String columnsOrderStr;
+
+ /**
+ * 快速搜索条件
+ */
+ @ApiModelProperty(value = "快速搜索条件")
+ @ExcelIgnore
+ @Column(ignore = true)
+ private String searchValue;
+
+}
diff --git a/yui-base-core/src/main/java/com/yui/base/service/impl/BaseServiceImpl.java b/yui-base-core/src/main/java/com/yui/base/service/impl/BaseServiceImpl.java
new file mode 100644
index 0000000..54c1fc0
--- /dev/null
+++ b/yui-base-core/src/main/java/com/yui/base/service/impl/BaseServiceImpl.java
@@ -0,0 +1,13 @@
+package com.yui.base.service.impl;
+
+import com.mybatisflex.core.BaseMapper;
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+
+/**
+ * 基础业务服务实现类
+ *
+ * @author yui
+ */
+public class BaseServiceImpl, T2> extends ServiceImpl {
+
+}
diff --git a/yui-base-core/src/main/java/com/yui/common/session/entity/SessionUser.java b/yui-base-core/src/main/java/com/yui/common/session/entity/SessionUser.java
new file mode 100644
index 0000000..a32fe60
--- /dev/null
+++ b/yui-base-core/src/main/java/com/yui/common/session/entity/SessionUser.java
@@ -0,0 +1,45 @@
+package com.yui.common.session.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 会话用户
+ *
+ * @author yui
+ */
+@Data
+public class SessionUser implements Serializable {
+
+ /**
+ * 人员名称
+ */
+ private String personId;
+ private String userName; //登录名称
+ private String password; //密码
+
+ private Long departmentId; //部门ID
+ private String departmentName; //部门名称
+ private String positionName; //职位名称
+ private String personName; //人员名称
+ private String personSex; //人员性别
+ private String personBirthday; //人员生日
+
+ // private String token; //token字符串
+
+ private List powerList; //权限标识
+
+ private List roleList; //角色标识或编码
+
+ private String lastLoginTime; //本次登录时间
+
+ private String UUID; //本次登录的uuid
+
+ private String Url; //本次登录的url
+
+ private String ip; //本次登录访问ip
+
+
+}
diff --git a/yui-base-core/src/main/java/com/yui/common/session/service/ISessionService.java b/yui-base-core/src/main/java/com/yui/common/session/service/ISessionService.java
new file mode 100644
index 0000000..41a4871
--- /dev/null
+++ b/yui-base-core/src/main/java/com/yui/common/session/service/ISessionService.java
@@ -0,0 +1,97 @@
+package com.yui.common.session.service;
+
+import cn.dev33.satoken.session.SaSession;
+import com.yui.common.session.entity.SessionUser;
+
+/**
+ * Session 服务类
+ *
+ * @author yui
+ */
+public interface ISessionService {
+
+ /**
+ * 获取 userId
+ *
+ * @return {@link String}
+ */
+ String getUserId();
+
+ /**
+ * 获取人员姓名
+ *
+ * @return {@link String}
+ */
+ String getPersonName();
+
+ /**
+ * 获取 session
+ *
+ * @return {@link SaSession}
+ */
+ SaSession getSession();
+
+ /**
+ * 获取 token
+ *
+ * @return {@link String}
+ */
+ String getToken();
+
+ /**
+ * 获取会话用户
+ *
+ * @return {@link SessionUser}
+ */
+ SessionUser getSessionUser();
+
+ /**
+ * 使用sa-token进行会话缓存用户信息
+ *
+ * @param sessionUser 会话用户
+ */
+ void setSessionUser(SessionUser sessionUser);
+
+ /**
+ * 设置 UUID
+ *
+ * @param uuid UUID
+ */
+ void setUuid(String uuid);
+
+ /**
+ * 获取 UUID
+ *
+ * @return {@link String}
+ */
+ String getUuid();
+
+ /**
+ * 设置接口地址
+ *
+ * @param url 网址
+ */
+ void setUrl(String url);
+
+ /**
+ * 获取接口地址
+ *
+ * @return {@link String}
+ */
+ String getUrl();
+
+ /**
+ * 设置登录 IP
+ *
+ * @param ip ip
+ */
+ void setIp(String ip);
+
+ /**
+ * 获取登录 IP
+ *
+ * @return {@link String}
+ */
+ String getIp();
+
+}
diff --git a/yui-base-core/src/main/java/com/yui/common/session/service/impl/SessionServiceImpl.java b/yui-base-core/src/main/java/com/yui/common/session/service/impl/SessionServiceImpl.java
new file mode 100644
index 0000000..2c5586c
--- /dev/null
+++ b/yui-base-core/src/main/java/com/yui/common/session/service/impl/SessionServiceImpl.java
@@ -0,0 +1,159 @@
+package com.yui.common.session.service.impl;
+
+import cn.dev33.satoken.session.SaSession;
+import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.util.IdUtil;
+import com.yui.common.session.entity.SessionUser;
+import com.yui.common.session.service.ISessionService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 修改为 sa-token 会话方式
+ *
+ * @author yui
+ */
+@Service
+public class SessionServiceImpl implements ISessionService {
+
+ public static final String SESSION_KEY = "$$sessionUserKey$$";
+
+ private SessionUser sessionUser;
+
+ private String uuid;
+
+ private String url;
+
+ private String ipAddress;
+
+ /**
+ * 获取sa-token会话中的用户对象信息
+ *
+ * @return {@link SessionUser}
+ */
+ private SessionUser getThisSessionUser() {
+ if (!StpUtil.isLogin()) {
+ return null;
+ }
+ Object obj = StpUtil.getSession().get(SESSION_KEY);
+ return obj != null ? (SessionUser) obj : null;
+ }
+
+ /**
+ * 获取session对象
+ *
+ * @return {@link SaSession}
+ */
+ @Override
+ public SaSession getSession() {
+ return StpUtil.getSession();
+ }
+
+ /**
+ * 使用sa-token进行会话缓存用户信息
+ *
+ * @param sessionUser 会话用户
+ */
+ @Override
+ public void setSessionUser(SessionUser sessionUser) {
+ if (sessionUser != null) {
+ // 不为空设置本次的UUID
+ sessionUser.setUUID(IdUtil.simpleUUID());
+ }
+ // 放入sa-token会话中,线程安全放入
+ StpUtil.getSession().set(SESSION_KEY, sessionUser);
+
+ }
+
+ @Override
+ public String getUserId() {
+ SessionUser thisSessionUser = getThisSessionUser();
+ return thisSessionUser != null ? thisSessionUser.getPersonId() : null;
+ }
+
+ @Override
+ public String getPersonName() {
+ SessionUser thisSessionUser = getThisSessionUser();
+ if (thisSessionUser == null) {
+ return "游客";
+ }
+ return thisSessionUser.getPersonName();
+ }
+
+ @Override
+ public String getToken() {
+ SessionUser thisSessionUser = getThisSessionUser();
+ if (thisSessionUser == null) {
+ return null;
+ }
+ // 得到登录后的token
+ return StpUtil.getTokenInfo().getTokenValue();
+ }
+
+ @Override
+ public SessionUser getSessionUser() {
+ return getThisSessionUser();
+ }
+
+ @Override
+ public void setUuid(String uuid) {
+ SessionUser thisSessionUser = getThisSessionUser();
+ if (thisSessionUser == null) {
+ this.uuid = uuid;
+ } else {
+ thisSessionUser.setUUID(uuid);
+ }
+ }
+
+ /**
+ * 获取 UUID
+ *
+ * @return {@link String}
+ */
+ @Override
+ public String getUuid() {
+ SessionUser thisSessionUser = getThisSessionUser();
+ if (thisSessionUser == null) {
+ return this.uuid;
+ }
+ return thisSessionUser.getUUID();
+ }
+
+ @Override
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ /**
+ * 获取接口地址
+ *
+ * @return {@link String}
+ */
+ @Override
+ public String getUrl() {
+ SessionUser thisSessionUser = getThisSessionUser();
+ if (thisSessionUser == null) {
+ return this.url;
+ }
+ return thisSessionUser.getUrl();
+ }
+
+ @Override
+ public void setIp(String ip) {
+ this.ipAddress = ip;
+ }
+
+ /**
+ * 获取登录 IP
+ *
+ * @return {@link String}
+ */
+ @Override
+ public String getIp() {
+ SessionUser thisSessionUser = getThisSessionUser();
+ if (thisSessionUser == null) {
+ return this.ipAddress;
+ }
+ return thisSessionUser.getIp();
+ }
+
+}
diff --git a/yui-base-core/src/main/java/com/yui/common/util/excel/CsvExportUtil.java b/yui-base-core/src/main/java/com/yui/common/util/excel/CsvExportUtil.java
new file mode 100644
index 0000000..e5c540b
--- /dev/null
+++ b/yui-base-core/src/main/java/com/yui/common/util/excel/CsvExportUtil.java
@@ -0,0 +1,116 @@
+package com.yui.common.util.excel;
+
+import cn.afterturn.easypoi.csv.entity.CsvExportParams;
+import cn.afterturn.easypoi.csv.export.CsvExportService;
+import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
+import cn.afterturn.easypoi.handler.inter.IExcelExportServer;
+import cn.afterturn.easypoi.handler.inter.IWriter;
+import cn.hutool.core.collection.CollectionUtil;
+import com.yui.common.util.tools.StrUtil;
+import jakarta.servlet.http.HttpServletResponse;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * csv 导出工具类
+ *
+ * @author yui
+ */
+public class CsvExportUtil {
+
+ private CsvExportUtil() {
+ }
+
+
+ /**
+ * export csv all list
+ *
+ * @param params
+ * @param pojoClass
+ * @param dataSet
+ * @param outputStream
+ */
+ public static void exportCsv(CsvExportParams params, Class> pojoClass, Collection> dataSet, OutputStream outputStream) throws IllegalAccessException {
+ IWriter writer = new CsvExportService(outputStream, params, pojoClass);
+ writer.write(processValueForCsv(dataSet));
+ writer.close();
+ }
+
+ /**
+ * 导出csv文件
+ *
+ * @param params
+ * @param pojoClass
+ * @param dataSet
+ * @param response
+ */
+ public static void exportCsvUtf8(CsvExportParams params, Class> pojoClass, Collection> dataSet, HttpServletResponse response) throws IOException, IllegalAccessException {
+ // 中文乱码:以CSV方式导出的文件中默认不含BOM信息,通过给将要输出的内容设置BOM标识(以 EF BB BF 开头的字节流)即可解决该问题
+ OutputStream outputStream = response.getOutputStream();
+ outputStream.write(new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF});
+ exportCsv(params, pojoClass, dataSet, outputStream);
+ }
+
+ /**
+ * export csv use server
+ *
+ * @param params
+ * @param pojoClass
+ * @param server
+ * @param queryParams
+ * @param outputStream
+ */
+ public static void exportCsv(CsvExportParams params, Class> pojoClass, IExcelExportServer server,
+ Object queryParams, OutputStream outputStream) {
+ IWriter writer = new CsvExportService(outputStream, params, pojoClass);
+ int page = 1;
+ List