更新逻辑删除功能

This commit is contained in:
aiShuiJiaoDeXioShou 2024-09-12 03:55:05 +08:00
parent ccabf6c09d
commit 9b6a8ed49f
55 changed files with 789 additions and 608 deletions

View File

@ -24,6 +24,7 @@
<module>yskj-module-crm</module> <module>yskj-module-crm</module>
<!-- <module>yskj-module-erp</module>--> <!-- <module>yskj-module-erp</module>-->
<!-- <module>yskj-module-ai</module>--> <!-- <module>yskj-module-ai</module>-->
<module>yskj-module-acdr</module>
</modules> </modules>
<name>${project.artifactId}</name> <name>${project.artifactId}</name>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>cn.yskj.dev</groupId>
<artifactId>yskj</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>yskj-module-acdr-api</module>
<module>yskj-module-acdr-biz</module>
</modules>
<packaging>pom</packaging>
<artifactId>yskj-module-acdr</artifactId>
<name>${project.artifactId}</name>
<description>
ai 模块下,接入 LLM 大模型,支持聊天、绘图、音乐、写作、思维脑图等功能。
目前已接入各种模型,不限于:
国内:通义千问、文心一言、讯飞星火、智谱 GLM、DeepSeek
国外OpenAI、Ollama、Midjourney、StableDiffusion、Suno
</description>
</project>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>cn.yskj.dev</groupId>
<artifactId>yskj-module-acdr</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yskj-module-acdr-api</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>
ai 模块 API暴露给其它模块调用
</description>
<dependencies>
<dependency>
<groupId>cn.yskj.dev</groupId>
<artifactId>yskj-common</artifactId>
</dependency>
<!-- 参数校验 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,60 @@
package cn.yskj.linghe.module.acdr.enums;
import cn.yskj.linghe.framework.common.exception.ErrorCode;
/**
* Product 错误码枚举类
*
* product 系统使用 1-008-000-000
*/
public interface ErrorCodeConstants {
// ========== 商品分类相关 1-008-001-000 ============
ErrorCode CATEGORY_NOT_EXISTS = new ErrorCode(1_008_001_000, "商品分类不存在");
ErrorCode CATEGORY_PARENT_NOT_EXISTS = new ErrorCode(1_008_001_001, "父分类不存在");
ErrorCode CATEGORY_PARENT_NOT_FIRST_LEVEL = new ErrorCode(1_008_001_002, "父分类不能是二级分类");
ErrorCode CATEGORY_EXISTS_CHILDREN = new ErrorCode(1_008_001_003, "存在子分类,无法删除");
ErrorCode CATEGORY_DISABLED = new ErrorCode(1_008_001_004, "商品分类({})已禁用,无法使用");
ErrorCode CATEGORY_HAVE_BIND_SPU = new ErrorCode(1_008_001_005, "类别下存在商品,无法删除");
// ========== 商品品牌相关编号 1-008-002-000 ==========
ErrorCode BRAND_NOT_EXISTS = new ErrorCode(1_008_002_000, "品牌不存在");
ErrorCode BRAND_DISABLED = new ErrorCode(1_008_002_001, "品牌已禁用");
ErrorCode BRAND_NAME_EXISTS = new ErrorCode(1_008_002_002, "品牌名称已存在");
// ========== 商品属性项 1-008-003-000 ==========
ErrorCode PROPERTY_NOT_EXISTS = new ErrorCode(1_008_003_000, "属性项不存在");
ErrorCode PROPERTY_EXISTS = new ErrorCode(1_008_003_001, "属性项的名称已存在");
ErrorCode PROPERTY_DELETE_FAIL_VALUE_EXISTS = new ErrorCode(1_008_003_002, "属性项下存在属性值,无法删除");
// ========== 商品属性值 1-008-004-000 ==========
ErrorCode PROPERTY_VALUE_NOT_EXISTS = new ErrorCode(1_008_004_000, "属性值不存在");
ErrorCode PROPERTY_VALUE_EXISTS = new ErrorCode(1_008_004_001, "属性值的名称已存在");
// ========== 商品 SPU 1-008-005-000 ==========
ErrorCode SPU_NOT_EXISTS = new ErrorCode(1_008_005_000, "商品 SPU 不存在");
ErrorCode SPU_SAVE_FAIL_CATEGORY_LEVEL_ERROR = new ErrorCode(1_008_005_001, "商品分类不正确,原因:必须使用第二级的商品分类及以下");
ErrorCode SPU_SAVE_FAIL_COUPON_TEMPLATE_NOT_EXISTS = new ErrorCode(1_008_005_002, "商品 SPU 保存失败,原因:优惠卷不存在");
ErrorCode SPU_NOT_ENABLE = new ErrorCode(1_008_005_003, "商品 SPU【{}】不处于上架状态");
ErrorCode SPU_NOT_RECYCLE = new ErrorCode(1_008_005_004, "商品 SPU 不处于回收站状态");
// ========== 商品 SKU 1-008-006-000 ==========
ErrorCode SKU_NOT_EXISTS = new ErrorCode(1_008_006_000, "商品 SKU 不存在");
ErrorCode SKU_PROPERTIES_DUPLICATED = new ErrorCode(1_008_006_001, "商品 SKU 的属性组合存在重复");
ErrorCode SPU_ATTR_NUMBERS_MUST_BE_EQUALS = new ErrorCode(1_008_006_002, "一个 SPU 下的每个 SKU其属性项必须一致");
ErrorCode SPU_SKU_NOT_DUPLICATE = new ErrorCode(1_008_006_003, "一个 SPU 下的每个 SKU必须不重复");
ErrorCode SKU_STOCK_NOT_ENOUGH = new ErrorCode(1_008_006_004, "商品 SKU 库存不足");
// ========== 商品 评价 1-008-007-000 ==========
ErrorCode COMMENT_NOT_EXISTS = new ErrorCode(1_008_007_000, "商品评价不存在");
ErrorCode COMMENT_ORDER_EXISTS = new ErrorCode(1_008_007_001, "订单的商品评价已存在");
// ========== 商品 收藏 1-008-008-000 ==========
ErrorCode FAVORITE_EXISTS = new ErrorCode(1_008_008_000, "该商品已经被收藏");
ErrorCode FAVORITE_NOT_EXISTS = new ErrorCode(1_008_008_001, "商品收藏不存在");
ErrorCode CONFIG_NOT_EXISTS = new ErrorCode(1_008_009_000, "宠物配置文件不存在");
ErrorCode PET_EXPERT_CERTIFICATION_NOT_EXISTS = new ErrorCode(1_008_009_001, "宠托师审核不存在");
}

View File

@ -0,0 +1 @@
package cn.yskj.linghe.module.acdr;

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>cn.yskj.dev</groupId>
<artifactId>yskj-module-acdr</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yskj-module-acdr-biz</artifactId>
<name>${project.artifactId}</name>
<description>
ai 模块下,接入 LLM 大模型,支持聊天、绘图、音乐、写作、思维脑图等功能。
目前已接入各种模型,不限于:
国内:通义千问、文心一言、讯飞星火、智谱 GLM、DeepSeek
国外OpenAI、Ollama、Midjourney、StableDiffusion、Suno
</description>
<dependencies>
<dependency>
<groupId>cn.yskj.dev</groupId>
<artifactId>yskj-module-acdr-api</artifactId>
<version>${revision}</version>
</dependency>
<!-- Web 相关 -->
<dependency>
<groupId>cn.yskj.dev</groupId>
<artifactId>yskj-spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>cn.yskj.dev</groupId>
<artifactId>yskj-spring-boot-starter-biz-tenant</artifactId>
</dependency>
<!-- Web 相关 -->
<dependency>
<groupId>cn.yskj.dev</groupId>
<artifactId>yskj-spring-boot-starter-security</artifactId>
</dependency>
<!-- DB 相关 -->
<dependency>
<groupId>cn.yskj.dev</groupId>
<artifactId>yskj-spring-boot-starter-mybatis</artifactId>
</dependency>
<!-- Job 相关 -->
<dependency>
<groupId>cn.yskj.dev</groupId>
<artifactId>yskj-spring-boot-starter-job</artifactId>
</dependency>
<!-- Test 测试相关 -->
<dependency>
<groupId>cn.yskj.dev</groupId>
<artifactId>yskj-spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>cn.yskj.dev</groupId>
<artifactId>yskj-spring-boot-starter-excel</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -75,4 +75,6 @@ public interface ErrorCodeConstants {
// ========== BPM 流程表达式 1-009-014-000 ========== // ========== BPM 流程表达式 1-009-014-000 ==========
ErrorCode PROCESS_EXPRESSION_NOT_EXISTS = new ErrorCode(1_009_014_000, "流程表达式不存在"); ErrorCode PROCESS_EXPRESSION_NOT_EXISTS = new ErrorCode(1_009_014_000, "流程表达式不存在");
ErrorCode CONFIG_NOT_EXISTS = new ErrorCode(1_009_015_000, "宠物配置文件不存在");
} }

View File

@ -1,5 +1,7 @@
package cn.yskj.linghe.module.product.enums; package cn.yskj.linghe.module.product.enums;
import cn.yskj.linghe.framework.common.exception.ErrorCode; import cn.yskj.linghe.framework.common.exception.ErrorCode;
/** /**

View File

@ -121,6 +121,13 @@
<artifactId>yskj-spring-boot-starter-protection</artifactId> <artifactId>yskj-spring-boot-starter-protection</artifactId>
</dependency> </dependency>
<!-- 宠物模块 -->
<dependency>
<groupId>cn.yskj.dev</groupId>
<artifactId>yskj-module-acdr-biz</artifactId>
<version>${revision}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -239,7 +239,7 @@ yskj:
db-schemas: ${spring.datasource.dynamic.datasource.master.name} db-schemas: ${spring.datasource.dynamic.datasource.master.name}
front-type: 10 # 前端模版的类型,参见 CodegenFrontTypeEnum 枚举类 front-type: 10 # 前端模版的类型,参见 CodegenFrontTypeEnum 枚举类
tenant: # 多租户相关配置项 tenant: # 多租户相关配置项
enable: true enable: false
ignore-urls: ignore-urls:
- /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号 - /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号
- /admin-api/system/tenant/get-by-website # 基于域名获取租户,不许带租户编号 - /admin-api/system/tenant/get-by-website # 基于域名获取租户,不许带租户编号

View File

@ -8,7 +8,7 @@ VITE_PORT=80
VITE_OPEN=true VITE_OPEN=true
# 租户开关 # 租户开关
VITE_APP_TENANT_ENABLE=true VITE_APP_TENANT_ENABLE=false
# 验证码的开关 # 验证码的开关
VITE_APP_CAPTCHA_ENABLE=true VITE_APP_CAPTCHA_ENABLE=true

View File

@ -0,0 +1,45 @@
import request from '@/config/axios'
// 宠托师审核 VO
export interface PetExpertCertificationVO {
id: number // ID
content: string // 审核内容
type: string // 申请职务
imageUrls: string // 审核材料
state: number // 审核状态
verifyAdminId: number // 审核管理员
userId: number // 创建人
}
// 宠托师审核 API
export const PetExpertCertificationApi = {
// 查询宠托师审核分页
getPetExpertCertificationPage: async (params: any) => {
return await request.get({ url: `/acdr/pet-expert-certification/page`, params })
},
// 查询宠托师审核详情
getPetExpertCertification: async (id: number) => {
return await request.get({ url: `/acdr/pet-expert-certification/get?id=` + id })
},
// 新增宠托师审核
createPetExpertCertification: async (data: PetExpertCertificationVO) => {
return await request.post({ url: `/acdr/pet-expert-certification/create`, data })
},
// 修改宠托师审核
updatePetExpertCertification: async (data: PetExpertCertificationVO) => {
return await request.put({ url: `/acdr/pet-expert-certification/update`, data })
},
// 删除宠托师审核
deletePetExpertCertification: async (id: number) => {
return await request.delete({ url: `/acdr/pet-expert-certification/delete?id=` + id })
},
// 导出宠托师审核 Excel
exportPetExpertCertification: async (params) => {
return await request.download({ url: `/acdr/pet-expert-certification/export-excel`, params })
},
}

View File

@ -0,0 +1,116 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="审核内容" prop="content">
<Editor v-model="formData.content" height="150px" />
</el-form-item>
<el-form-item label="申请职务" prop="type">
<el-input v-model="formData.type" placeholder="请输入申请职务" />
</el-form-item>
<el-form-item label="审核材料" prop="imageUrls">
<el-input v-model="formData.imageUrls" placeholder="请输入审核材料" />
</el-form-item>
<el-form-item label="审核状态" prop="state">
<el-input v-model="formData.state" placeholder="请输入审核状态" />
</el-form-item>
<el-form-item label="审核管理员" prop="verifyAdminId">
<el-input v-model="formData.verifyAdminId" placeholder="请输入审核管理员" />
</el-form-item>
<el-form-item label="创建人" prop="userId">
<el-input v-model="formData.userId" placeholder="请输入创建人" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { PetExpertCertificationApi, PetExpertCertificationVO } from '@/api/acdr/petexpertcertification'
/** 宠托师审核 表单 */
defineOptions({ name: 'PetExpertCertificationForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
content: undefined,
type: undefined,
imageUrls: undefined,
state: undefined,
verifyAdminId: undefined,
userId: undefined,
})
const formRules = reactive({
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await PetExpertCertificationApi.getPetExpertCertification(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as PetExpertCertificationVO
if (formType.value === 'create') {
await PetExpertCertificationApi.createPetExpertCertification(data)
message.success(t('common.createSuccess'))
} else {
await PetExpertCertificationApi.updatePetExpertCertification(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
content: undefined,
type: undefined,
imageUrls: undefined,
state: undefined,
verifyAdminId: undefined,
userId: undefined,
}
formRef.value?.resetFields()
}
</script>

View File

@ -0,0 +1,233 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="申请职务" prop="type">
<el-input
v-model="queryParams.type"
placeholder="请输入申请职务"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="审核材料" prop="imageUrls">
<el-input
v-model="queryParams.imageUrls"
placeholder="请输入审核材料"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="审核状态" prop="state">
<el-input
v-model="queryParams.state"
placeholder="请输入审核状态"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="审核管理员" prop="verifyAdminId">
<el-input
v-model="queryParams.verifyAdminId"
placeholder="请输入审核管理员"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建人" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入创建人"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['acdr:pet-expert-certification:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['acdr:pet-expert-certification:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="审核内容" align="center" prop="content" />
<el-table-column label="申请职务" align="center" prop="type" />
<el-table-column label="审核材料" align="center" prop="imageUrls" />
<el-table-column label="审核状态" align="center" prop="state" />
<el-table-column label="审核管理员" align="center" prop="verifyAdminId" />
<el-table-column label="创建人" align="center" prop="userId" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['acdr:pet-expert-certification:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['acdr:pet-expert-certification:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<PetExpertCertificationForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { PetExpertCertificationApi, PetExpertCertificationVO } from '@/api/acdr/petexpertcertification'
import PetExpertCertificationForm from './PetExpertCertificationForm.vue'
/** 宠托师审核 列表 */
defineOptions({ name: 'PetExpertCertification' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<PetExpertCertificationVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
content: undefined,
type: undefined,
imageUrls: undefined,
state: undefined,
verifyAdminId: undefined,
userId: undefined,
createTime: [],
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await PetExpertCertificationApi.getPetExpertCertificationPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PetExpertCertificationApi.deletePetExpertCertification(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PetExpertCertificationApi.exportPetExpertCertification(queryParams)
download.excel(data, '宠托师审核.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>

View File

@ -117,6 +117,14 @@
"navigationBarTitleText": "消息列表" "navigationBarTitleText": "消息列表"
} }
}, },
{
"path": "pages/message/privatechat",
"type": "page",
"layout": "default",
"style": {
"navigationBarTitleText": "聊天"
}
},
{ {
"path": "pages/my/index", "path": "pages/my/index",
"type": "page", "type": "page",

View File

@ -17,6 +17,7 @@ interface NavigateToOptions {
"/pages/message/chat" | "/pages/message/chat" |
"/pages/message/index" | "/pages/message/index" |
"/pages/message/message-list" | "/pages/message/message-list" |
"/pages/message/privatechat" |
"/pages/my/index" | "/pages/my/index" |
"/pages/order/index" | "/pages/order/index" |
"/pages/order/order-detail" | "/pages/order/order-detail" |

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View File

@ -1,150 +0,0 @@
import os
import cv2
import numpy as np
import re
from tkinter import *
from tkinter import filedialog, messagebox, colorchooser
from PIL import Image
import tkinter as tk
# 主应用类
class ImageSplitterApp:
def __init__(self, root):
self.root = root
self.root.title("图像分割工具")
self.root.geometry("500x450")
# 文件或文件夹路径
self.file_path = None
self.folder_path = None
self.selected_color = (0, 0, 0) # 默认黑色
# 创建选择文件按钮
Button(self.root, text="选择单个文件", command=self.select_file).pack(pady=10)
Button(self.root, text="选择文件夹", command=self.select_folder).pack(pady=10)
# 选择颜色按钮
Label(self.root, text="选择分割线颜色:").pack(pady=10)
Button(self.root, text="打开取色器", command=self.pick_color).pack(pady=5)
# 当前选择的颜色显示
self.color_label = Label(self.root, text=f"当前颜色: {self.selected_color}")
self.color_label.pack(pady=5)
# 命名规则
Label(self.root, text="请输入保存图片的命名规则(支持正则):").pack(pady=10)
self.naming_entry = Entry(self.root)
self.naming_entry.insert(0, r"sub_image_{idx}") # 默认命名规则
self.naming_entry.pack(pady=5)
# 分割按钮
Button(self.root, text="开始分割", command=self.split_image).pack(pady=20)
# 选择保存文件夹
self.save_folder_path = None
Button(self.root, text="选择保存文件夹", command=self.select_save_folder).pack(pady=10)
def select_file(self):
self.file_path = filedialog.askopenfilename(filetypes=[("Image Files", "*.png *.jpg *.jpeg")])
if self.file_path:
messagebox.showinfo("文件选择", f"已选择文件: {self.file_path}")
def select_folder(self):
self.folder_path = filedialog.askdirectory()
if self.folder_path:
messagebox.showinfo("文件夹选择", f"已选择文件夹: {self.folder_path}")
def select_save_folder(self):
self.save_folder_path = filedialog.askdirectory()
if self.save_folder_path:
messagebox.showinfo("保存文件夹选择", f"已选择保存文件夹: {self.save_folder_path}")
# 颜色取色器
def pick_color(self):
color = colorchooser.askcolor(title="选择分割线颜色")
if color:
self.selected_color = tuple(map(int, color[0])) # 颜色转换为整数的 (r, g, b)
self.color_label.config(text=f"当前颜色: {self.selected_color}")
# 查找分割线的位置 (通过指定颜色)
def find_dividing_lines(self, image, line_color):
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # 将图像转换为灰度图
_, binary = cv2.threshold(gray, 128, 255, cv2.THRESH_BINARY_INV) # 进行二值化
# 查找水平和垂直线条
horizontal_kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (25, 1))
vertical_kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (1, 25))
# 水平线
horizontal_lines = cv2.morphologyEx(binary, cv2.MORPH_OPEN, horizontal_kernel, iterations=2)
# 垂直线
vertical_lines = cv2.morphologyEx(binary, cv2.MORPH_OPEN, vertical_kernel, iterations=2)
return horizontal_lines, vertical_lines
# 分割图像
def split_image(self):
# 提取颜色
line_color = self.selected_color
# 读取命名规则
naming_rule = self.naming_entry.get()
# 处理单个文件
if self.file_path:
self.process_file(self.file_path, line_color, naming_rule)
# 处理文件夹中的所有文件
if self.folder_path:
for file_name in os.listdir(self.folder_path):
if file_name.endswith(('.png', '.jpg', '.jpeg')):
file_path = os.path.join(self.folder_path, file_name)
self.process_file(file_path, line_color, naming_rule)
# 处理单个文件的分割
def process_file(self, file_path, line_color, naming_rule):
image = cv2.imread(file_path)
if image is None:
messagebox.showerror("错误", f"无法加载图像: {file_path}")
return
horizontal_lines, vertical_lines = self.find_dividing_lines(image, line_color)
sub_images = self.split_image_by_lines(image, horizontal_lines, vertical_lines)
# 保存分割后的图像
self.save_sub_images(sub_images, naming_rule)
# 根据分割线分割图像
def split_image_by_lines(self, image, horizontal_lines, vertical_lines):
horizontal_coords = np.where(np.any(horizontal_lines > 0, axis=1))[0]
vertical_coords = np.where(np.any(vertical_lines > 0, axis=0))[0]
sub_images = []
for i in range(len(horizontal_coords) - 1):
for j in range(len(vertical_coords) - 1):
x1, x2 = vertical_coords[j], vertical_coords[j + 1]
y1, y2 = horizontal_coords[i], horizontal_coords[i + 1]
sub_image = image[y1:y2, x1:x2]
sub_images.append(sub_image)
return sub_images
# 保存分割后的图像,支持正则命名规则
def save_sub_images(self, sub_images, naming_rule):
if not self.save_folder_path:
messagebox.showerror("错误", "请先选择保存文件夹")
return
for idx, img in enumerate(sub_images):
filename = re.sub(r'{idx}', str(idx), naming_rule) # 使用正则表达式进行命名
save_path = os.path.join(self.save_folder_path, f"{filename}.png")
cv2.imwrite(save_path, img)
messagebox.showinfo("完成", f"图像已分割并保存到 {self.save_folder_path}")
# 运行图形界面应用
if __name__ == "__main__":
root = tk.Tk()
app = ImageSplitterApp(root)
root.mainloop()

View File

@ -1,202 +0,0 @@
import os
import tkinter as tk
from tkinter import filedialog, scrolledtext, ttk
from tkinter import Menu
from PIL import Image
# 搜索指定关键字的函数
def search_keyword_in_files(directory, keyword, output_text):
if not keyword:
output_text.insert(tk.END, "请输入要搜索的关键字。\n")
return
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith(('.js', '.json', '.vue', '.ts', '.py', '.java', '.cpp')):
file_path = os.path.join(root, file)
try:
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
count = content.count(keyword)
if count > 0:
output_text.insert(tk.END, f"{file_path} 中找到 '{keyword}',共 {count}\n")
except Exception as e:
output_text.insert(tk.END, f"读取文件 {file_path} 出错: {e}\n")
output_text.insert(tk.END, "搜索完成。\n")
# 找出不包含指定关键字的文件
def find_files_without_keyword(directory, keyword, output_text):
if not keyword:
output_text.insert(tk.END, "请输入要搜索的关键字。\n")
return
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith(('.js', '.json', '.vue', '.ts', '.py', '.java', '.cpp')):
file_path = os.path.join(root, file)
try:
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
if keyword not in content:
output_text.insert(tk.END, f"'{keyword}' 未在文件 {file_path} 中找到。\n")
except Exception as e:
output_text.insert(tk.END, f"读取文件 {file_path} 出错: {e}\n")
output_text.insert(tk.END, "查找未包含关键字的文件完成。\n")
# 替换文件内容中的指定字符串
def replace_in_files(directory, search_text, replace_text, output_text):
if not search_text or not replace_text:
output_text.insert(tk.END, "请输入要替换的文本和新文本。\n")
return
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith(('.js', '.json', '.vue', '.ts', '.py', '.java', '.cpp')):
file_path = os.path.join(root, file)
try:
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
if search_text in content:
new_content = content.replace(search_text, replace_text)
with open(file_path, 'w', encoding='utf-8') as f:
f.write(new_content)
output_text.insert(tk.END, f"{file_path} 中替换 '{search_text}''{replace_text}'\n")
except Exception as e:
output_text.insert(tk.END, f"处理文件 {file_path} 时出错: {e}\n")
output_text.insert(tk.END, "替换完成。\n")
# 转换指定颜色为透明色的功能
def convert_color_to_transparent(image_path, color, output_text):
img = Image.open(image_path)
img = img.convert("RGBA")
datas = img.getdata()
newData = []
for item in datas:
if item[0:3] == color:
newData.append((255, 255, 255, 0)) # 将指定颜色变为透明
else:
newData.append(item)
img.putdata(newData)
new_path = os.path.splitext(image_path)[0] + "_transparent.png"
img.save(new_path)
output_text.insert(tk.END, f"处理后的图片保存为 '{new_path}'\n")
# 清空输出框的函数
def clear_output(output_text):
output_text.delete(1.0, tk.END)
# 添加右键菜单
def add_right_click_menu(output_text):
menu = Menu(output_text, tearoff=0)
menu.add_command(label="清空输出", command=lambda: clear_output(output_text))
def show_menu(event):
menu.post(event.x_root, event.y_root)
output_text.bind("<Button-3>", show_menu)
# 创建GUI界面
def create_gui():
root = tk.Tk()
root.title("文件和图片处理工具")
root.geometry("800x500")
notebook = ttk.Notebook(root)
notebook.pack(fill='both', expand=True)
search_frame = ttk.Frame(notebook)
notebook.add(search_frame, text="搜索和替换")
image_frame = ttk.Frame(notebook)
notebook.add(image_frame, text="图片透明化")
note_frame = ttk.Frame(notebook)
notebook.add(note_frame, text="记事本")
# 搜索和替换界面
left_frame_search = ttk.Frame(search_frame)
left_frame_search.pack(side=tk.LEFT, fill=tk.Y, padx=10, pady=10)
keyword_entry = ttk.Entry(left_frame_search)
keyword_entry.pack(pady=5)
ttk.Label(left_frame_search, text="请输入要搜索的关键字:").pack(pady=5)
search_button = ttk.Button(left_frame_search, text="搜索文件夹",
command=lambda: browse_directory_for_search(keyword_entry.get(), output_text_search))
search_button.pack(pady=5)
search_text_entry = ttk.Entry(left_frame_search)
search_text_entry.pack(pady=5)
ttk.Label(left_frame_search, text="请输入要替换的文本:").pack(pady=5)
replace_text_entry = ttk.Entry(left_frame_search)
replace_text_entry.pack(pady=5)
ttk.Label(left_frame_search, text="请输入新文本:").pack(pady=5)
replace_button = ttk.Button(left_frame_search, text="替换文件夹中的内容",
command=lambda: browse_directory_for_replace(search_text_entry.get(), replace_text_entry.get(), output_text_search))
replace_button.pack(pady=5)
search_missing_button = ttk.Button(left_frame_search, text="查找不包含关键字的文件",
command=lambda: browse_directory_for_missing(keyword_entry.get(), output_text_search))
search_missing_button.pack(pady=5)
output_text_search = scrolledtext.ScrolledText(search_frame, width=70)
output_text_search.pack(side=tk.RIGHT, fill=tk.BOTH, expand=True)
add_right_click_menu(output_text_search) # 为搜索输出框添加右键菜单
# 图像透明化界面
color_entry = ttk.Entry(image_frame)
color_entry.pack(pady=5)
ttk.Label(image_frame, text="请输入要透明化的颜色 (r,g,b):").pack(pady=5)
trans_button = ttk.Button(image_frame, text="使图片透明",
command=lambda: browse_image_for_transparency(tuple(map(int, color_entry.get().split(','))), output_text_image))
trans_button.pack(pady=5)
output_text_image = scrolledtext.ScrolledText(image_frame, width=70)
output_text_image.pack(side=tk.RIGHT, fill=tk.BOTH, expand=True)
add_right_click_menu(output_text_image) # 为图片处理输出框添加右键菜单
# 记事本界面
note_text = scrolledtext.ScrolledText(note_frame, width=70)
note_text.pack(padx=10, pady=10, fill=tk.BOTH, expand=True)
save_button = ttk.Button(note_frame, text="保存记事本", command=lambda: save_notes(note_text))
save_button.pack(pady=10)
root.mainloop()
# 辅助函数
def browse_directory_for_search(keyword, output_text):
directory = filedialog.askdirectory()
if directory:
output_text.insert(tk.END, f"正在 {directory} 中搜索关键字: '{keyword}'\n")
search_keyword_in_files(directory, keyword, output_text)
def browse_directory_for_replace(search_text, replace_text, output_text):
directory = filedialog.askdirectory()
if directory:
output_text.insert(tk.END, f"{directory} 中将 '{search_text}' 替换为 '{replace_text}'\n")
replace_in_files(directory, search_text, replace_text, output_text)
def browse_directory_for_missing(keyword, output_text):
directory = filedialog.askdirectory()
if directory:
output_text.insert(tk.END, f"正在 {directory} 中查找未包含关键字 '{keyword}' 的文件。\n")
find_files_without_keyword(directory, keyword, output_text)
def browse_image_for_transparency(color, output_text):
image_path = filedialog.askopenfilename()
if image_path:
convert_color_to_transparent(image_path, color, output_text)
def save_notes(note_text):
file_path = filedialog.asksaveasfilename(defaultextension=".txt")
if file_path:
with open(file_path, 'w') as file:
file.write(note_text.get(1.0, tk.END))
note_text.insert(tk.END, f"记事本已保存到 {file_path}\n")
if __name__ == "__main__":
create_gui()

View File

@ -11,6 +11,7 @@ import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.yskj.acdr.common.verify.ValidPhone; import com.yskj.acdr.common.verify.ValidPhone;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Pattern; import jakarta.validation.constraints.Pattern;
@ -37,7 +38,7 @@ import jakarta.validation.constraints.Null;
@TableName("acdr_china_address") @TableName("acdr_china_address")
@ApiModel(value = "ChinaAddress对象", description = "中国地址表") @ApiModel(value = "ChinaAddress对象", description = "中国地址表")
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class ChinaAddress implements Serializable { public class ChinaAddress extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -104,14 +105,6 @@ public class ChinaAddress implements Serializable {
@TableField(value = "longitude") @TableField(value = "longitude")
private Long longitude; private Long longitude;
@ApiModelProperty("创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty("更新时间")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
@ApiModelProperty("是否为默认地址") @ApiModelProperty("是否为默认地址")
@TableField("is_default") @TableField("is_default")
private Boolean isDefault; private Boolean isDefault;

View File

@ -2,6 +2,7 @@ package com.yskj.acdr.master.chat.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.yskj.acdr.master.chat.chatenum.ChatState; import com.yskj.acdr.master.chat.chatenum.ChatState;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
@ -26,7 +27,7 @@ import java.time.LocalDateTime;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_chat_message") @TableName("acdr_chat_message")
@ApiModel(value = "ChatMessage对象", description = "") @ApiModel(value = "ChatMessage对象", description = "")
public class ChatMessage implements Serializable { public class ChatMessage extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -46,10 +47,6 @@ public class ChatMessage implements Serializable {
@TableField("be_user_id") @TableField("be_user_id")
private Long beUserId; private Long beUserId;
@ApiModelProperty("创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty("消息状态,0未读1已读") @ApiModelProperty("消息状态,0未读1已读")
@TableField(value = "state") @TableField(value = "state")
private ChatState state; private ChatState state;

View File

@ -0,0 +1,39 @@
package com.yskj.acdr.master.common;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.JdbcType;
import java.time.LocalDateTime;
/**
* 这个类是一些公共字段的抽象类比如创建时间更新时间逻辑删除等
*/
@Data
@Accessors(chain = true)
@JsonIgnoreProperties(value = "transMap")
public class ExtendEntity {
// 更新作者
@TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.VARCHAR)
private Long updater;
// 创建作者
@TableField(fill = FieldFill.INSERT_UPDATE, jdbcType = JdbcType.VARCHAR)
private Long creator;
// 逻辑删除
@TableLogic
private Boolean deleted;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
}

View File

@ -74,7 +74,7 @@ public class CommunityController {
@Transactional @Transactional
public GlobalResponse<Posts> createPost(@Valid @RequestBody Posts post) { public GlobalResponse<Posts> createPost(@Valid @RequestBody Posts post) {
post.setUserId(StpUtil.getLoginIdAsLong()); post.setUserId(StpUtil.getLoginIdAsLong());
post.setCreatedTime(LocalDateTime.now()); post.setCreateTime(LocalDateTime.now());
postsMapper.insert(post); postsMapper.insert(post);
for (String url : post.getImages()) { for (String url : post.getImages()) {
photosMapper.insert( photosMapper.insert(
@ -207,7 +207,7 @@ public class CommunityController {
} }
comment.setPostId(postId); comment.setPostId(postId);
comment.setUserId(StpUtil.getLoginIdAsLong()); comment.setUserId(StpUtil.getLoginIdAsLong());
comment.setCreatedTime(LocalDateTime.now()); comment.setCreateTime(LocalDateTime.now());
commentsMapper.insert(comment); commentsMapper.insert(comment);
return GlobalResponse.success(comment); return GlobalResponse.success(comment);
} }
@ -285,7 +285,7 @@ public class CommunityController {
Follows follow = new Follows(); Follows follow = new Follows();
follow.setFollowerId(followerId); follow.setFollowerId(followerId);
follow.setFollowingId(followingId); follow.setFollowingId(followingId);
follow.setCreatedTime(LocalDateTime.now()); follow.setCreateTime(LocalDateTime.now());
followsMapper.insert(follow); followsMapper.insert(follow);
return GlobalResponse.success("关注成功"); return GlobalResponse.success("关注成功");
@ -334,7 +334,7 @@ public class CommunityController {
like.setUserId(userId); like.setUserId(userId);
like.setPostId(postId); like.setPostId(postId);
like.setCommentId(commentId); like.setCommentId(commentId);
like.setCreatedTime(LocalDateTime.now()); like.setCreateTime(LocalDateTime.now());
likesMapper.insert(like); likesMapper.insert(like);
return GlobalResponse.success("点赞成功"); return GlobalResponse.success("点赞成功");
@ -389,7 +389,7 @@ public class CommunityController {
Favorites favorite = new Favorites(); Favorites favorite = new Favorites();
favorite.setUserId(userId); favorite.setUserId(userId);
favorite.setPostId(postId); favorite.setPostId(postId);
favorite.setCreatedTime(LocalDateTime.now()); favorite.setCreateTime(LocalDateTime.now());
favoritesMapper.insert(favorite); favoritesMapper.insert(favorite);
return GlobalResponse.success("收藏成功"); return GlobalResponse.success("收藏成功");
@ -470,7 +470,7 @@ public class CommunityController {
// 设置图片所属的帖子ID和创建时间 // 设置图片所属的帖子ID和创建时间
photo.setPostId(postId); photo.setPostId(postId);
photo.setCreatedTime(LocalDateTime.now()); photo.setCreateTime(LocalDateTime.now());
// 将图片信息插入数据库 // 将图片信息插入数据库
photosMapper.insert(photo); photosMapper.insert(photo);

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
@ -33,7 +34,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_comments") @TableName("acdr_comments")
@ApiModel(value = "Comments对象", description = "") @ApiModel(value = "Comments对象", description = "")
public class Comments implements Serializable { public class Comments extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -52,12 +53,6 @@ public class Comments implements Serializable {
@Size(min = 5, message = "评论内容不能少于五个字") @Size(min = 5, message = "评论内容不能少于五个字")
private String content; private String content;
@TableField("created_time")
private LocalDateTime createdTime;
@TableField("updated_time")
private LocalDateTime updatedTime;
@TableField("deleted_time") @TableField("deleted_time")
private LocalDateTime deletedTime; private LocalDateTime deletedTime;

View File

@ -1,6 +1,7 @@
package com.yskj.acdr.master.community.entity; package com.yskj.acdr.master.community.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -24,7 +25,7 @@ import java.time.LocalDateTime;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_favorites") @TableName("acdr_favorites")
@ApiModel(value = "Favorites对象", description = "") @ApiModel(value = "Favorites对象", description = "")
public class Favorites implements Serializable { public class Favorites extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -36,7 +37,4 @@ public class Favorites implements Serializable {
@TableField("post_id") @TableField("post_id")
private Long postId; private Long postId;
@TableField("created_time")
private LocalDateTime createdTime;
} }

View File

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
@ -30,7 +31,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_follows") @TableName("acdr_follows")
@ApiModel(value = "Follows对象", description = "") @ApiModel(value = "Follows对象", description = "")
public class Follows implements Serializable { public class Follows extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -44,7 +45,4 @@ public class Follows implements Serializable {
@TableField("following_id") @TableField("following_id")
@NotNull(message = "被关注者ID不能为空") @NotNull(message = "被关注者ID不能为空")
private Long followingId; private Long followingId;
@TableField("created_time")
private LocalDateTime createdTime;
} }

View File

@ -1,49 +1,42 @@
package com.yskj.acdr.master.community.entity; package com.yskj.acdr.master.community.entity;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.IdType; import com.yskj.acdr.master.common.ExtendEntity;
import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.annotations.ApiModel;
import com.baomidou.mybatisplus.annotation.TableId; import lombok.Getter;
import com.baomidou.mybatisplus.annotation.TableName; import lombok.Setter;
import java.io.Serializable; import lombok.ToString;
import java.time.LocalDateTime; import lombok.experimental.Accessors;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import java.io.Serializable;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
/** /**
* <p> * <p>
* *
* </p> * </p>
* *
* @author 林河 * @author 林河
* @since 2024-08-12 * @since 2024-08-12
*/ */
@Getter @Getter
@Setter @Setter
@ToString @ToString
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_likes") @TableName("acdr_likes")
@ApiModel(value = "Likes对象", description = "") @ApiModel(value = "Likes对象", description = "")
public class Likes implements Serializable { public class Likes extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
@TableField(value = "user_id", fill = FieldFill.INSERT) @TableField(value = "user_id", fill = FieldFill.INSERT)
private Long userId; private Long userId;
@TableField("post_id") @TableField("post_id")
private Long postId; private Long postId;
@TableField("comment_id") @TableField("comment_id")
private Long commentId; private Long commentId;
@TableField("created_time")
private LocalDateTime createdTime;
} }

View File

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
@ -32,7 +33,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_photos") @TableName("acdr_photos")
@ApiModel(value = "Photos对象", description = "照片实体") @ApiModel(value = "Photos对象", description = "照片实体")
public class Photos implements Serializable { public class Photos extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -47,8 +48,5 @@ public class Photos implements Serializable {
@Size(max = 255, message = "图片URL不能超过255个字符") @Size(max = 255, message = "图片URL不能超过255个字符")
@TableField("photo_url") @TableField("photo_url")
private String photoUrl; private String photoUrl;
@TableField("created_time")
private LocalDateTime createdTime;
} }

View File

@ -10,6 +10,7 @@ import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
@ -34,7 +35,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_posts") @TableName("acdr_posts")
@ApiModel(value = "Posts对象", description = "帖子实体") @ApiModel(value = "Posts对象", description = "帖子实体")
public class Posts implements Serializable { public class Posts extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -66,12 +67,6 @@ public class Posts implements Serializable {
@TableField("is_public") @TableField("is_public")
private Boolean isPublic; private Boolean isPublic;
@TableField("created_time")
private LocalDateTime createdTime;
@TableField("updated_time")
private LocalDateTime updatedTime;
@TableField("deleted_at") @TableField("deleted_at")
private LocalDateTime deletedAt; private LocalDateTime deletedAt;
} }

View File

@ -1,16 +1,16 @@
package com.yskj.acdr.master.config.entity; package com.yskj.acdr.master.config.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.ToString; import lombok.ToString;
@ -30,10 +30,13 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_config") @TableName("acdr_config")
@ApiModel(value = "Config对象") @ApiModel(value = "Config对象")
public class Config implements Serializable { public class Config extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId
private Long id;
@ApiModelProperty("配置表key") @ApiModelProperty("配置表key")
@NotBlank(message = "key 不能为空") @NotBlank(message = "key 不能为空")
private String key; private String key;

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
@ -27,7 +28,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_file_map") @TableName("acdr_file_map")
@ApiModel(value = "FileMap对象", description = "") @ApiModel(value = "FileMap对象", description = "")
public class FileMap implements Serializable { public class FileMap extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -57,14 +58,6 @@ public class FileMap implements Serializable {
@TableField("is_web") @TableField("is_web")
private Boolean isWeb; private Boolean isWeb;
@ApiModelProperty("创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty("更新时间")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
@ApiModelProperty("上传用户") @ApiModelProperty("上传用户")
@TableField(value = "user_id") @TableField(value = "user_id")
private long userId; private long userId;

View File

@ -41,8 +41,8 @@ public class MallController {
@PostMapping("/stores") @PostMapping("/stores")
public GlobalResponse<Stores> createStores(@RequestBody Stores store) { public GlobalResponse<Stores> createStores(@RequestBody Stores store) {
try { try {
store.setCreatedTime(LocalDateTime.now()); store.setCreateTime(LocalDateTime.now());
store.setUpdatedTime(LocalDateTime.now()); store.setUpdateTime(LocalDateTime.now());
storeMapper.insert(store); storeMapper.insert(store);
return GlobalResponse.success(store); return GlobalResponse.success(store);
} catch (Exception e) { } catch (Exception e) {
@ -74,8 +74,8 @@ public class MallController {
@PostMapping("/products") @PostMapping("/products")
public GlobalResponse<Products> addProducts(@RequestBody Products product) { public GlobalResponse<Products> addProducts(@RequestBody Products product) {
try { try {
product.setCreatedTime(LocalDateTime.now()); product.setCreateTime(LocalDateTime.now());
product.setUpdatedTime(LocalDateTime.now()); product.setUpdateTime(LocalDateTime.now());
productMapper.insert(product); productMapper.insert(product);
return GlobalResponse.success(product); return GlobalResponse.success(product);
} catch (Exception e) { } catch (Exception e) {
@ -109,8 +109,8 @@ public class MallController {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public GlobalResponse<Orders> createOrders(@RequestBody Orders order) { public GlobalResponse<Orders> createOrders(@RequestBody Orders order) {
try { try {
order.setCreatedTime(LocalDateTime.now()); order.setCreateTime(LocalDateTime.now());
order.setUpdatedTime(LocalDateTime.now()); order.setUpdateTime(LocalDateTime.now());
orderMapper.insert(order); orderMapper.insert(order);
return GlobalResponse.success(order); return GlobalResponse.success(order);
} catch (Exception e) { } catch (Exception e) {
@ -147,8 +147,8 @@ public class MallController {
@PostMapping("/cart") @PostMapping("/cart")
public GlobalResponse<CartItems> addToCart(@RequestBody CartItems cartItem) { public GlobalResponse<CartItems> addToCart(@RequestBody CartItems cartItem) {
try { try {
cartItem.setCreatedTime(LocalDateTime.now()); cartItem.setCreateTime(LocalDateTime.now());
cartItem.setUpdatedTime(LocalDateTime.now()); cartItem.setUpdateTime(LocalDateTime.now());
cartItemMapper.insert(cartItem); cartItemMapper.insert(cartItem);
return GlobalResponse.success(cartItem); return GlobalResponse.success(cartItem);
} catch (Exception e) { } catch (Exception e) {

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
@ -30,7 +31,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_cart_items") @TableName("acdr_cart_items")
@ApiModel(value = "CartItems对象", description = "") @ApiModel(value = "CartItems对象", description = "")
public class CartItems implements Serializable { public class CartItems extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -45,10 +46,4 @@ public class CartItems implements Serializable {
@TableField("quantity") @TableField("quantity")
private Integer quantity; private Integer quantity;
@TableField("created_time")
private LocalDateTime createdTime;
@TableField("updated_time")
private LocalDateTime updatedTime;
} }

View File

@ -9,6 +9,7 @@ import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
@ -30,7 +31,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_order_items") @TableName("acdr_order_items")
@ApiModel(value = "OrderItems对象", description = "") @ApiModel(value = "OrderItems对象", description = "")
public class OrderItems implements Serializable { public class OrderItems extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -48,7 +49,4 @@ public class OrderItems implements Serializable {
@TableField("price") @TableField("price")
private BigDecimal price; private BigDecimal price;
@TableField("created_time")
private LocalDateTime createdTime;
} }

View File

@ -10,6 +10,7 @@ import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
@ -31,7 +32,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_orders") @TableName("acdr_orders")
@ApiModel(value = "Orders对象", description = "") @ApiModel(value = "Orders对象", description = "")
public class Orders implements Serializable { public class Orders extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -46,10 +47,4 @@ public class Orders implements Serializable {
@TableField("status") @TableField("status")
private String status; private String status;
@TableField("created_time")
private LocalDateTime createdTime;
@TableField("updated_time")
private LocalDateTime updatedTime;
} }

View File

@ -9,6 +9,7 @@ import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
@ -30,7 +31,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_products") @TableName("acdr_products")
@ApiModel(value = "Products对象", description = "") @ApiModel(value = "Products对象", description = "")
public class Products implements Serializable { public class Products extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -51,10 +52,4 @@ public class Products implements Serializable {
@TableField("stock") @TableField("stock")
private Integer stock; private Integer stock;
@TableField("created_time")
private LocalDateTime createdTime;
@TableField("updated_time")
private LocalDateTime updatedTime;
} }

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
@ -28,7 +29,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_store_types") @TableName("acdr_store_types")
@ApiModel(value = "StoreTypes对象", description = "") @ApiModel(value = "StoreTypes对象", description = "")
public class StoreTypes implements Serializable { public class StoreTypes extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
@ -29,7 +30,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_stores") @TableName("acdr_stores")
@ApiModel(value = "Stores对象", description = "") @ApiModel(value = "Stores对象", description = "")
public class Stores implements Serializable { public class Stores extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -50,10 +51,4 @@ public class Stores implements Serializable {
@TableField("owner_id") @TableField("owner_id")
private Long ownerId; private Long ownerId;
@TableField("created_time")
private LocalDateTime createdTime;
@TableField("updated_time")
private LocalDateTime updatedTime;
} }

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
@ -31,7 +32,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_notifications") @TableName("acdr_notifications")
@ApiModel(value = "Notifications对象", description = "") @ApiModel(value = "Notifications对象", description = "")
public class Notifications implements Serializable { public class Notifications extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -53,10 +54,6 @@ public class Notifications implements Serializable {
@TableField("url") @TableField("url")
private String url; private String url;
@ApiModelProperty("消息创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty("消息创建状态") @ApiModelProperty("消息创建状态")
@TableField("status") @TableField("status")
private Integer status; private Integer status;
@ -72,8 +69,4 @@ public class Notifications implements Serializable {
@ApiModelProperty("消息接受范围") @ApiModelProperty("消息接受范围")
@TableField("receiver_scope") @TableField("receiver_scope")
private String receiverScope; private String receiverScope;
@ApiModelProperty("消息更新时间")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
} }

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
@ -28,7 +29,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_notifications_user") @TableName("acdr_notifications_user")
@ApiModel(value = "NotificationsUser对象", description = "") @ApiModel(value = "NotificationsUser对象", description = "")
public class NotificationsUser implements Serializable { public class NotificationsUser extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -11,6 +11,7 @@ import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.yskj.acdr.master.common.ExtendEntity;
import com.yskj.acdr.master.order.orderenum.OrderState; import com.yskj.acdr.master.order.orderenum.OrderState;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -35,7 +36,7 @@ import org.springframework.format.annotation.DateTimeFormat;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_order") @TableName("acdr_order")
@ApiModel(value = "Order对象", description = "订单实体类") @ApiModel(value = "Order对象", description = "订单实体类")
public class Order implements Serializable { public class Order extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -104,16 +105,6 @@ public class Order implements Serializable {
@TableField("qrcode") @TableField("qrcode")
private String qrcode; private String qrcode;
// 这个是默认为不为空的由数据库插入的时候补全
@ApiModelProperty("预约创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
// 这个是默认为不为空的由数据库插入的时候补全
@ApiModelProperty("预约更新时间")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
@ApiModelProperty("客户下单地址") @ApiModelProperty("客户下单地址")
@TableField("address") @TableField("address")
@NotNull(message = "用户下单地址不能为空") @NotNull(message = "用户下单地址不能为空")

View File

@ -10,6 +10,7 @@ import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import com.yskj.acdr.master.order.orderenum.PayType; import com.yskj.acdr.master.order.orderenum.PayType;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -32,7 +33,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_pay_info") @TableName("acdr_pay_info")
@ApiModel(value = "PayInfo对象", description = "") @ApiModel(value = "PayInfo对象", description = "")
public class PayInfo implements Serializable { public class PayInfo extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -75,8 +76,4 @@ public class PayInfo implements Serializable {
@ApiModelProperty("被支付方") @ApiModelProperty("被支付方")
@TableField("payee") @TableField("payee")
private Long payee; private Long payee;
@ApiModelProperty("支付时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
} }

View File

@ -4,16 +4,18 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_qr_code") @TableName("acdr_qr_code")
public class QrCode { public class QrCode extends ExtendEntity implements Serializable {
@TableId(value = "id", type = IdType.ASSIGN_ID) @TableId(value = "id", type = IdType.ASSIGN_ID)
@ApiModelProperty("二维码id") @ApiModelProperty("二维码id")

View File

@ -10,6 +10,7 @@ import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.*; import jakarta.validation.constraints.*;
@ -30,7 +31,7 @@ import org.springframework.web.bind.annotation.PutMapping;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_personal_service") @TableName("acdr_personal_service")
@ApiModel(value = "PersonalService对象", description = "") @ApiModel(value = "PersonalService对象", description = "")
public class PersonalService implements Serializable { public class PersonalService extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -82,14 +83,6 @@ public class PersonalService implements Serializable {
@TableField(value = "user_id", fill = FieldFill.INSERT) @TableField(value = "user_id", fill = FieldFill.INSERT)
private Long userId; private Long userId;
@ApiModelProperty("创建服务的时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty("更新服务的时间")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
@ApiModelProperty("发布地址") @ApiModelProperty("发布地址")
@NotBlank(message = "发布地址不能为空") @NotBlank(message = "发布地址不能为空")
@TableField(value = "address") @TableField(value = "address")

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
@ -30,7 +31,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_service_name") @TableName("acdr_service_name")
@ApiModel(value = "ServiceName对象", description = "") @ApiModel(value = "ServiceName对象", description = "")
public class ServiceName implements Serializable { public class ServiceName extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -49,12 +50,4 @@ public class ServiceName implements Serializable {
@ApiModelProperty("优先级") @ApiModelProperty("优先级")
@TableField("number") @TableField("number")
private Integer number; private Integer number;
@ApiModelProperty("创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty("更新时间")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
} }

View File

@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yskj.acdr.master.common.ExtendEntity;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@ -21,7 +23,7 @@ import java.util.Date;
@Getter @Getter
@Setter @Setter
@Accessors(chain = true) @Accessors(chain = true)
public class ExpandLocOrderInfo { public class ExpandLocOrderInfo extends ExtendEntity implements Serializable {
/** /**
* 宠物拓展位主键只记录支付成功的 * 宠物拓展位主键只记录支付成功的
*/ */

View File

@ -11,6 +11,7 @@ import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.yskj.acdr.master.common.ExtendEntity;
import com.yskj.acdr.master.pet.status.PetExpertCertificationStatus; import com.yskj.acdr.master.pet.status.PetExpertCertificationStatus;
import com.yskj.acdr.serialization.handler.JsonTypeHandler; import com.yskj.acdr.serialization.handler.JsonTypeHandler;
import com.yskj.acdr.serialization.handler.ListStringTypeHandler; import com.yskj.acdr.serialization.handler.ListStringTypeHandler;
@ -37,7 +38,7 @@ import lombok.experimental.Accessors;
@TableName("acdr_pet_expert_certification") @TableName("acdr_pet_expert_certification")
@ApiModel(value = "PetExpertCertification对象", description = "") @ApiModel(value = "PetExpertCertification对象", description = "")
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class PetExpertCertification implements Serializable { public class PetExpertCertification extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -69,10 +70,4 @@ public class PetExpertCertification implements Serializable {
@ApiModelProperty("创建人") @ApiModelProperty("创建人")
@TableField("user_id") @TableField("user_id")
private Long userId; private Long userId;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
} }

View File

@ -3,6 +3,7 @@ package com.yskj.acdr.master.pet.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.yskj.acdr.common.verify.ValidAgeRange; import com.yskj.acdr.common.verify.ValidAgeRange;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
@ -13,6 +14,7 @@ import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
@ -23,7 +25,7 @@ import java.time.LocalDateTime;
@Getter @Getter
@Setter @Setter
@Accessors(chain = true) @Accessors(chain = true)
public class PetInfo { public class PetInfo extends ExtendEntity implements Serializable {
/** /**
* 宠物主键 * 宠物主键
@ -106,12 +108,4 @@ public class PetInfo {
@TableField(value = "`hair_color`") @TableField(value = "`hair_color`")
@NotNull(message = "毛发不能为空") @NotNull(message = "毛发不能为空")
private String hairColor; private String hairColor;
@ApiModelProperty("创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty("更新时间")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
} }

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
@ -30,21 +31,13 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_pet_specialist_certificate") @TableName("acdr_pet_specialist_certificate")
@ApiModel(value = "PetSpecialistCertificate对象", description = "") @ApiModel(value = "PetSpecialistCertificate对象", description = "")
public class PetSpecialistCertificate implements Serializable { public class PetSpecialistCertificate extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.ASSIGN_ID) @TableId(value = "id", type = IdType.ASSIGN_ID)
private Long id; private Long id;
@ApiModelProperty("创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty("更新时间")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
@ApiModelProperty("过期日期") @ApiModelProperty("过期日期")
@TableField("expired_time") @TableField("expired_time")
private LocalDateTime expiredTime; private LocalDateTime expiredTime;

View File

@ -109,9 +109,9 @@ public class UserController {
public GlobalResponse<Users> userInfo() { public GlobalResponse<Users> userInfo() {
Users userInfo = usersService.getById(StpUtil.getLoginIdAsLong()); Users userInfo = usersService.getById(StpUtil.getLoginIdAsLong());
userInfo.setTypeId("") userInfo.setTypeId("")
.setEmail("")
.setCreateTime(null) .setCreateTime(null)
.setUpdateTime(null) .setUpdateTime(null);
.setEmail("");
return GlobalResponse.success("获取用户信息成功!", userInfo); return GlobalResponse.success("获取用户信息成功!", userInfo);
} }

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.yskj.acdr.master.common.ExtendEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
@ -26,7 +27,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_user_identity_verification") @TableName("acdr_user_identity_verification")
@ApiModel(value = "UserIdentityVerification对象", description = "") @ApiModel(value = "UserIdentityVerification对象", description = "")
public class UserIdentityVerification implements Serializable { public class UserIdentityVerification extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -50,14 +51,6 @@ public class UserIdentityVerification implements Serializable {
@TableField("real_sex") @TableField("real_sex")
private String realSex; private String realSex;
@ApiModelProperty("创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty("实名认证信息更新时间")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
@ApiModelProperty("身份证信息") @ApiModelProperty("身份证信息")
@TableField("identity") @TableField("identity")
private String identity; private String identity;

View File

@ -1,36 +1,34 @@
package com.yskj.acdr.master.user.entity; package com.yskj.acdr.master.user.entity;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.IdType; import com.yskj.acdr.master.common.ExtendEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.ToString; import lombok.ToString;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null; import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
* *
* </p> * </p>
* *
* @author 林河 * @author 林河
* @since 2024-08-08 * @since 2024-08-08
*/ */
@Getter @Getter
@Setter @Setter
@ToString @ToString
@Accessors(chain = true) @Accessors(chain = true)
@TableName("acdr_users") @TableName("acdr_users")
@ApiModel(value = "UserBase对象", description = "") @ApiModel(value = "UserBase对象", description = "")
public class Users implements Serializable { public class Users extends ExtendEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -55,16 +53,6 @@ import jakarta.validation.constraints.Null;
@TableField("type_id") @TableField("type_id")
private String typeId; private String typeId;
@ApiModelProperty("创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
@NotNull(message = "创建时间不能为空")
private LocalDateTime createTime;
@ApiModelProperty("更新时间")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
@NotNull(message = "更新时间不能为空")
private LocalDateTime updateTime;
@ApiModelProperty("用户头像") @ApiModelProperty("用户头像")
@TableField("avatar") @TableField("avatar")
private String avatar; private String avatar;

View File

@ -128,14 +128,14 @@ public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements
// 检查手机号是否已注册 // 检查手机号是否已注册
Users user = this.baseMapper.selectOne(new QueryWrapper<Users>().eq("phone", phone)); Users user = this.baseMapper.selectOne(new QueryWrapper<Users>().eq("phone", phone));
if (user == null) { if (user == null) {
// 未注册创建新用户 user = (Users) new Users()
user = new Users()
.setAvatar("/profile/avatar.jpg") .setAvatar("/profile/avatar.jpg")
.setName(phone) // 设置默认用户名 .setName(phone) // 设置默认用户名
.setPhone(phone) .setPhone(phone)
.setNickname(DEFAULT_NICK_NAME_PREFIX + phone.substring(phone.length() - 4))
.setCreateTime(LocalDateTime.now()) .setCreateTime(LocalDateTime.now())
.setUpdateTime(LocalDateTime.now()) .setUpdateTime(LocalDateTime.now());
.setNickname(DEFAULT_NICK_NAME_PREFIX + phone.substring(phone.length() - 4)); // 未注册创建新用户
this.baseMapper.insert(user); this.baseMapper.insert(user);
} }
@ -154,13 +154,13 @@ public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements
@Override @Override
public Users getSafeUsers(Long userId) { public Users getSafeUsers(Long userId) {
Users users = baseMapper.selectById(userId); Users users = baseMapper.selectById(userId);
return users.setOpenid("") return (Users) users.setOpenid("")
.setCreateTime(null)
.setUpdateTime(null)
.setEmail("") .setEmail("")
.setTypeId("") .setTypeId("")
// 这个是创建用户的手机号信息隐藏中间几位 // 这个是创建用户的手机号信息隐藏中间几位
.setPhone(PhoneValidator.hidePhoneNumber(users.getPhone())); .setPhone(PhoneValidator.hidePhoneNumber(users.getPhone()))
.setCreateTime(null)
.setUpdateTime(null);
} }
/** /**
@ -170,13 +170,13 @@ public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements
@Override @Override
public Users getSafeUsers() { public Users getSafeUsers() {
Users users = baseMapper.selectById(StpUtil.getLoginIdAsLong()); Users users = baseMapper.selectById(StpUtil.getLoginIdAsLong());
return users.setOpenid("") return (Users) users.setOpenid("")
.setCreateTime(null)
.setUpdateTime(null)
.setEmail("") .setEmail("")
.setTypeId("") .setTypeId("")
// 这个是创建用户的手机号信息隐藏中间几位 // 这个是创建用户的手机号信息隐藏中间几位
.setPhone(PhoneValidator.hidePhoneNumber(users.getPhone())); .setPhone(PhoneValidator.hidePhoneNumber(users.getPhone()))
.setCreateTime(null)
.setUpdateTime(null);
} }
@Override @Override

View File

@ -94,6 +94,10 @@ mybatis-plus:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 当使用非实体类接收返回数据时字段值若为空则返回null不设置此项会忽略为null的字段 # 当使用非实体类接收返回数据时字段值若为空则返回null不设置此项会忽略为null的字段
call-setters-on-nulls: true call-setters-on-nulls: true
global-config:
db-config:
logic-delete-value: 1 # 逻辑删除时的值
logic-not-delete-value: 0 # 逻辑未删除时的值
# 系统管理 # 系统管理
management: management:

View File

@ -91,6 +91,10 @@ mybatis-plus:
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 当使用非实体类接收返回数据时字段值若为空则返回null不设置此项会忽略为null的字段 # 当使用非实体类接收返回数据时字段值若为空则返回null不设置此项会忽略为null的字段
call-setters-on-nulls: true call-setters-on-nulls: true
global-config:
db-config:
logic-delete-value: 1 # 逻辑删除时的值
logic-not-delete-value: 0 # 逻辑未删除时的值
# 系统管理 # 系统管理
management: management: