YumiNail后端业务数据库增删改查初始化,前端页面初版

This commit is contained in:
xiaowang
2026-02-13 17:34:32 +08:00
parent 7a6cab8a51
commit c5018b14a5
119 changed files with 11996 additions and 55 deletions
+3
View File
@@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar"]
}
+5
View File
@@ -0,0 +1,5 @@
# Vue 3 + TypeScript + Vite
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
+13
View File
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>frontend</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
+3182
View File
File diff suppressed because it is too large Load Diff
+31
View File
@@ -0,0 +1,31 @@
{
"name": "frontend",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.2",
"ant-design-vue": "^4.2.6",
"axios": "^1.13.5",
"element-plus": "^2.13.2",
"pinia": "^3.0.4",
"vue": "^3.5.25",
"vue-router": "^4.6.4"
},
"devDependencies": {
"@types/node": "^24.10.13",
"@vitejs/plugin-vue": "^6.0.2",
"@vue/tsconfig": "^0.8.1",
"sass": "^1.97.3",
"typescript": "~5.9.3",
"unplugin-auto-import": "^21.0.0",
"unplugin-vue-components": "^31.0.0",
"vite": "^7.3.1",
"vue-tsc": "^3.1.5"
}
}
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

+87
View File
@@ -0,0 +1,87 @@
<template>
<el-config-provider>
<div class="app-container">
<BottomNav v-if="!isHiddenNav" />
<div class="page-content" :class="{ 'no-nav-padding': isHiddenNav }">
<router-view v-slot="{ Component }">
<transition name="page-fade" mode="out-in">
<component :is="Component" :key="route.path" />
</transition>
</router-view>
</div>
</div>
</el-config-provider>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import BottomNav from './components/BottomNav.vue'
const route = useRoute()
// 计算是否需要隐藏导航栏
const isHiddenNav = computed(() => {
// 需要隐藏导航栏的页面路径
const hiddenNavRoutes = ['/settings']
// 检查是否是商品详情页(/product/数字)
const isProductDetail = /^\/product\/\d+$/.test(route.path)
return hiddenNavRoutes.some(path => route.path.startsWith(path)) || isProductDetail
})
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
.app-container {
min-height: 100vh;
display: flex;
flex-direction: column;
position: relative;
}
.page-content {
flex: 1;
padding-bottom: 60px;
position: relative;
z-index: 1;
}
/* 当导航栏隐藏时,移除底部 padding */
.page-content.no-nav-padding {
padding-bottom: 0;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.2s ease;
}
.fade-enter-from {
opacity: 0;
}
.fade-leave-to {
opacity: 0;
}
.page-fade-enter-active,
.page-fade-leave-active {
transition: opacity 0.2s ease;
}
.page-fade-enter-from {
opacity: 0;
}
.page-fade-leave-to {
opacity: 0;
}
</style>
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>

After

Width:  |  Height:  |  Size: 496 B

+90
View File
@@ -0,0 +1,90 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
// biome-ignore lint: disable
export {}
declare global {
const EffectScope: typeof import('vue').EffectScope
const acceptHMRUpdate: typeof import('pinia').acceptHMRUpdate
const computed: typeof import('vue').computed
const createApp: typeof import('vue').createApp
const createPinia: typeof import('pinia').createPinia
const customRef: typeof import('vue').customRef
const defineAsyncComponent: typeof import('vue').defineAsyncComponent
const defineComponent: typeof import('vue').defineComponent
const defineStore: typeof import('pinia').defineStore
const effectScope: typeof import('vue').effectScope
const getActivePinia: typeof import('pinia').getActivePinia
const getCurrentInstance: typeof import('vue').getCurrentInstance
const getCurrentScope: typeof import('vue').getCurrentScope
const getCurrentWatcher: typeof import('vue').getCurrentWatcher
const h: typeof import('vue').h
const inject: typeof import('vue').inject
const isProxy: typeof import('vue').isProxy
const isReactive: typeof import('vue').isReactive
const isReadonly: typeof import('vue').isReadonly
const isRef: typeof import('vue').isRef
const isShallow: typeof import('vue').isShallow
const mapActions: typeof import('pinia').mapActions
const mapGetters: typeof import('pinia').mapGetters
const mapState: typeof import('pinia').mapState
const mapStores: typeof import('pinia').mapStores
const mapWritableState: typeof import('pinia').mapWritableState
const markRaw: typeof import('vue').markRaw
const nextTick: typeof import('vue').nextTick
const onActivated: typeof import('vue').onActivated
const onBeforeMount: typeof import('vue').onBeforeMount
const onBeforeRouteLeave: typeof import('vue-router').onBeforeRouteLeave
const onBeforeRouteUpdate: typeof import('vue-router').onBeforeRouteUpdate
const onBeforeUnmount: typeof import('vue').onBeforeUnmount
const onBeforeUpdate: typeof import('vue').onBeforeUpdate
const onDeactivated: typeof import('vue').onDeactivated
const onErrorCaptured: typeof import('vue').onErrorCaptured
const onMounted: typeof import('vue').onMounted
const onRenderTracked: typeof import('vue').onRenderTracked
const onRenderTriggered: typeof import('vue').onRenderTriggered
const onScopeDispose: typeof import('vue').onScopeDispose
const onServerPrefetch: typeof import('vue').onServerPrefetch
const onUnmounted: typeof import('vue').onUnmounted
const onUpdated: typeof import('vue').onUpdated
const onWatcherCleanup: typeof import('vue').onWatcherCleanup
const provide: typeof import('vue').provide
const reactive: typeof import('vue').reactive
const readonly: typeof import('vue').readonly
const ref: typeof import('vue').ref
const resolveComponent: typeof import('vue').resolveComponent
const setActivePinia: typeof import('pinia').setActivePinia
const setMapStoreSuffix: typeof import('pinia').setMapStoreSuffix
const shallowReactive: typeof import('vue').shallowReactive
const shallowReadonly: typeof import('vue').shallowReadonly
const shallowRef: typeof import('vue').shallowRef
const storeToRefs: typeof import('pinia').storeToRefs
const toRaw: typeof import('vue').toRaw
const toRef: typeof import('vue').toRef
const toRefs: typeof import('vue').toRefs
const toValue: typeof import('vue').toValue
const triggerRef: typeof import('vue').triggerRef
const unref: typeof import('vue').unref
const useAttrs: typeof import('vue').useAttrs
const useCssModule: typeof import('vue').useCssModule
const useCssVars: typeof import('vue').useCssVars
const useId: typeof import('vue').useId
const useLink: typeof import('vue-router').useLink
const useModel: typeof import('vue').useModel
const useRoute: typeof import('vue-router').useRoute
const useRouter: typeof import('vue-router').useRouter
const useSlots: typeof import('vue').useSlots
const useTemplateRef: typeof import('vue').useTemplateRef
const watch: typeof import('vue').watch
const watchEffect: typeof import('vue').watchEffect
const watchPostEffect: typeof import('vue').watchPostEffect
const watchSyncEffect: typeof import('vue').watchSyncEffect
}
// for type re-export
declare global {
// @ts-ignore
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
}
+26
View File
@@ -0,0 +1,26 @@
/* eslint-disable */
// @ts-nocheck
// biome-ignore lint: disable
// oxlint-disable
// ------
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}
/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
BottomNav: typeof import('./components/BottomNav.vue')['default']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElButton: typeof import('element-plus/es')['ElButton']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElRate: typeof import('element-plus/es')['ElRate']
HelloWorld: typeof import('./components/HelloWorld.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
}
+160
View File
@@ -0,0 +1,160 @@
<template>
<a-layout class="bottom-nav">
<a-layout-content class="nav-content">
<!-- 首页导航项 -->
<div class="nav-item" :class="{ active: currentRoute === 'home' }" @click="handleNavClick('home')">
<a-badge :count="0" :offset="[0, 0]">
<div class="nav-icon">
<HomeOutlined :style="{ fontSize: '24px' }" />
</div>
</a-badge>
<span class="nav-label">首页</span>
</div>
<!-- 商品导航项 -->
<div class="nav-item" :class="{ active: currentRoute === 'products' }" @click="handleNavClick('products')">
<a-badge :count="0" :offset="[0, 0]">
<div class="nav-icon">
<ShoppingOutlined :style="{ fontSize: '24px' }" />
</div>
</a-badge>
<span class="nav-label">商品</span>
</div>
<!-- 购物车导航项 -->
<div class="nav-item" :class="{ active: currentRoute === 'cart' }" @click="handleNavClick('cart')">
<a-badge :count="cartCount" :offset="[0, 0]">
<div class="nav-icon">
<ShoppingCartOutlined :style="{ fontSize: '24px' }" />
</div>
</a-badge>
<span class="nav-label">购物车</span>
</div>
<!-- 个人中心导航项 -->
<div class="nav-item" :class="{ active: currentRoute === 'profile' }" @click="handleNavClick('profile')">
<a-badge :dot="hasNotification" :offset="[0, 0]">
<div class="nav-icon">
<UserOutlined :style="{ fontSize: '24px' }" />
</div>
</a-badge>
<span class="nav-label">我的</span>
</div>
</a-layout-content>
</a-layout>
</template>
<script setup lang="ts">
import { computed, ref } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { HomeOutlined, ShoppingOutlined, ShoppingCartOutlined, UserOutlined } from '@ant-design/icons-vue'
const router = useRouter()
const route = useRoute()
// 购物车商品数量(示例数据)
const cartCount = ref(3)
// 是否有未读通知
const hasNotification = ref(true)
// 根据当前路由判断激活的导航项
const currentRoute = computed(() => {
const path = route.path
if (path === '/') return 'home'
if (path === '/products') return 'products'
if (path === '/product') return 'products'
if (path === '/cart') return 'cart'
if (path === '/profile') return 'profile'
if (path === '/wishlist') return 'profile'
return 'home'
})
// 处理导航点击事件
const handleNavClick = (tab: string) => {
if (tab === 'home') {
router.push('/')
} else if (tab === 'products') {
router.push('/products')
} else if (tab === 'cart') {
router.push('/cart')
} else if (tab === 'profile') {
router.push('/profile')
}
}
</script>
<style scoped>
.bottom-nav {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 60px;
background: white;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
backface-visibility: hidden;
will-change: transform;
transform: translateZ(0);
transition: none !important;
}
.nav-content {
display: flex;
justify-content: space-around;
align-items: center;
height: 100%;
width: 100%;
max-width: 600px;
padding: 0 10px;
transition: none !important;
}
.nav-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 8px 12px;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
border-radius: 12px;
min-width: 60px;
}
.nav-item:hover {
background: rgba(24, 144, 255, 0.05);
transform: translateY(-2px);
}
.nav-item.active {
color: #1890ff;
}
.nav-item.active .nav-icon {
transform: scale(1.1);
}
.nav-icon {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 4px;
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-label {
font-size: 11px;
font-weight: 500;
transition: all 0.3s ease;
}
.nav-item.active .nav-label {
font-weight: 600;
}
</style>
+41
View File
@@ -0,0 +1,41 @@
<script setup lang="ts">
import { ref } from 'vue'
defineProps<{ msg: string }>()
const count = ref(0)
</script>
<template>
<h1>{{ msg }}</h1>
<div class="card">
<button type="button" @click="count++">count is {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test HMR
</p>
</div>
<p>
Check out
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
>create-vue</a
>, the official Vue + Vite starter
</p>
<p>
Learn more about IDE Support for Vue in the
<a
href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
target="_blank"
>Vue Docs Scaling up Guide</a
>.
</p>
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
</template>
<style scoped>
.read-the-docs {
color: #888;
}
</style>
+18
View File
@@ -0,0 +1,18 @@
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'
import App from './App.vue'
import router from './router'
const app = createApp(App)
const pinia = createPinia()
app.use(pinia)
app.use(router)
app.use(ElementPlus)
app.use(Antd)
app.mount('#app')
+44
View File
@@ -0,0 +1,44 @@
import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
component: () => import('../views/HomeView.vue')
},
{
path: '/products',
name: 'products',
component: () => import('../views/ProductListView.vue')
},
{
path: '/product/:id',
name: 'product-detail',
component: () => import('../views/ProductDetailView.vue')
},
{
path: '/cart',
name: 'cart',
component: () => import('../views/CartView.vue')
},
{
path: '/profile',
name: 'profile',
component: () => import('../views/ProfileView.vue')
},
{
path: '/wishlist',
name: 'wishlist',
component: () => import('../views/WishlistView.vue')
},
{
path: '/settings',
name: 'settings',
component: () => import('../views/SettingsView.vue')
}
]
})
export default router
+30
View File
@@ -0,0 +1,30 @@
:root {
--primary-color: #ff6600; /* 根据设计稿中的橙色色值调整 */
--bg-color: #ffffff;
--secondary-bg-color: #f5f5f5;
--text-primary: #333333;
--text-secondary: #999999;
--border-radius-base: 10px;
--border-radius-large: 30px;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: var(--secondary-bg-color);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
color: var(--text-primary);
}
.mobile-container {
max-width: 375px;
margin: 0 auto;
min-height: 100vh;
background-color: var(--bg-color);
position: relative;
overflow-x: hidden;
}
+12
View File
@@ -0,0 +1,12 @@
.bottom-nav {
position: fixed;
bottom: 0;
width: 100%;
height: 60px;
background: white;
display: flex;
justify-content: space-around;
align-items: center;
box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
z-index: 1000;
}
+342
View File
@@ -0,0 +1,342 @@
<template>
<div class="mobile-container">
<!-- 头部区域 -->
<header class="header">
<a-button class="back-btn" type="text" @click="handleBackClick">
<LeftOutlined :style="{ fontSize: '20px' }" />
</a-button>
<h1>购物车</h1>
<a-button class="edit-btn" type="text" @click="handleEditClick">
编辑
</a-button>
</header>
<!-- 购物车商品列表 -->
<div class="cart-items">
<a-empty v-if="cartItems.length === 0" description="购物车是空的">
<a-button type="primary" @click="handleBrowseProducts">去逛逛</a-button>
</a-empty>
<a-card
v-for="item in cartItems"
:key="item.id"
class="cart-item"
:body-style="{ padding: '16px' }"
>
<div class="item-content">
<!-- 复选框 -->
<a-checkbox v-model:checked="item.selected" @change="handleSelectChange" />
<!-- 商品图片 -->
<div class="item-image" :style="{ backgroundColor: item.bgColor }">
<span>{{ item.name[0] }}</span>
</div>
<!-- 商品详情 -->
<div class="item-details">
<h3 class="item-name">{{ item.name }}</h3>
<p class="item-price">${{ item.price }}</p>
<!-- 数量控制和删除按钮 -->
<div class="item-actions">
<a-input-number
v-model:value="item.quantity"
:min="1"
:max="99"
size="small"
@change="(val) => handleQuantityChange(item, val)"
/>
<a-popconfirm
title="确定要删除这个商品吗?"
ok-text="确定"
cancel-text="取消"
@confirm="handleDeleteItem(item)"
>
<a-button type="text" danger size="small">
<DeleteOutlined />
</a-button>
</a-popconfirm>
</div>
</div>
</div>
</a-card>
</div>
<!-- 订单摘要 -->
<div class="summary" v-if="cartItems.length > 0">
<div class="summary-row">
<span>商品数量</span>
<span>{{ totalQuantity }} 件</span>
</div>
<div class="summary-row">
<span>小计</span>
<span>${{ subtotal }}</span>
</div>
<div class="summary-row">
<span>运费</span>
<span>${{ shipping }}</span>
</div>
<div class="summary-row total">
<span>总计</span>
<span class="total-price">${{ total }}</span>
</div>
</div>
<!-- 结算按钮 -->
<div class="checkout-section" v-if="cartItems.length > 0">
<a-button
type="primary"
size="large"
block
@click="handleCheckout"
>
结算 ({{ selectedCount }})
</a-button>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { useRouter } from 'vue-router'
import {
LeftOutlined,
DeleteOutlined
} from '@ant-design/icons-vue'
import { message } from 'ant-design-vue'
const router = useRouter()
// 购物车商品数据
const cartItems = ref([
{ id: 1, name: 'Watch', price: 40, bgColor: '#ffe4d6', quantity: 1, selected: true },
{ id: 2, name: 'Nike Shoes', price: 430, bgColor: '#d6eaff', quantity: 2, selected: true },
{ id: 3, name: 'Airpods', price: 333, bgColor: '#e2ffd6', quantity: 1, selected: false }
])
// 运费
const shipping = 10
// 计算选中的商品数量
const selectedCount = computed(() => {
return cartItems.value.filter(item => item.selected).length
})
// 计算商品总数量
const totalQuantity = computed(() => {
return cartItems.value.reduce((sum, item) => sum + item.quantity, 0)
})
// 计算小计
const subtotal = computed(() => {
return cartItems.value
.filter(item => item.selected)
.reduce((sum, item) => sum + (item.price * item.quantity), 0)
})
// 计算总价
const total = computed(() => {
return subtotal.value + shipping
})
// 处理返回按钮点击
const handleBackClick = () => {
console.log('返回按钮被点击')
router.back()
}
// 处理编辑按钮点击
const handleEditClick = () => {
console.log('编辑按钮被点击')
}
// 处理选择状态变化
const handleSelectChange = () => {
console.log('选择状态改变')
}
// 处理数量变化
const handleQuantityChange = (item: any, val: number | null) => {
console.log('商品数量改变:', item.name, val)
}
// 处理删除商品
const handleDeleteItem = (item: any) => {
console.log('删除商品:', item.name)
const index = cartItems.value.findIndex(i => i.id === item.id)
if (index > -1) {
cartItems.value.splice(index, 1)
message.success('商品已删除')
}
}
// 处理浏览商品
const handleBrowseProducts = () => {
router.push('/products')
}
// 处理结算
const handleCheckout = () => {
const selectedItems = cartItems.value.filter(item => item.selected)
if (selectedItems.length === 0) {
message.warning('请先选择要结算的商品')
return
}
console.log('结算购物车:', {
items: selectedItems,
subtotal: subtotal.value,
shipping: shipping,
total: total.value
})
message.success('正在跳转到结算页面...')
}
</script>
<style scoped>
.mobile-container {
padding-top: 60px;
min-height: 100vh;
background: #f5f5f5;
}
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 15px;
border-bottom: 1px solid #f0f0f0;
background: white;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.header h1 {
font-size: 18px;
font-weight: bold;
margin: 0;
}
.back-btn,
.edit-btn {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
}
.cart-items {
padding: 15px;
padding-bottom: 20px;
}
.cart-item {
margin-bottom: 12px;
border-radius: 12px;
overflow: hidden;
}
.cart-item :deep(.ant-card-body) {
padding: 16px;
}
.item-content {
display: flex;
gap: 12px;
align-items: flex-start;
}
.item-image {
width: 80px;
height: 80px;
border-radius: 8px;
display: flex;
justify-content: center;
align-items: center;
font-size: 30px;
font-weight: bold;
color: rgba(0,0,0,0.1);
flex-shrink: 0;
}
.item-details {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: 80px;
}
.item-name {
font-size: 15px;
font-weight: 600;
margin: 0 0 4px 0;
line-height: 1.4;
}
.item-price {
color: #ff4d4f;
font-weight: bold;
margin: 0;
font-size: 16px;
}
.item-actions {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 8px;
}
.summary {
margin: 0 15px 15px;
padding: 16px;
background: #fafafa;
border-radius: 12px;
}
.summary-row {
display: flex;
justify-content: space-between;
padding: 8px 0;
font-size: 14px;
color: #666;
}
.summary-row.total {
font-size: 16px;
font-weight: bold;
color: #333;
border-top: 1px solid #e8e8e8;
padding-top: 12px;
margin-top: 4px;
}
.total-price {
color: #ff4d4f;
font-size: 20px;
}
.checkout-section {
position: fixed;
bottom: 60px;
left: 0;
right: 0;
padding: 15px;
background: white;
border-top: 1px solid #f0f0f0;
box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}
.checkout-section :deep(.ant-btn-lg) {
height: 48px;
border-radius: 24px;
font-weight: 600;
font-size: 16px;
}
</style>
+422
View File
@@ -0,0 +1,422 @@
<template>
<div class="mobile-container">
<!-- 头部区域 -->
<header class="header">
<!-- 用户信息区域 -->
<div class="user-info" @click="handleUserClick">
<div class="avatar">
<a-avatar :size="40" src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png" />
</div>
<div class="welcome">
<p class="greeting">Hello!</p>
<p class="username">昵称</p>
</div>
</div>
<!-- 通知按钮 -->
<div class="actions">
<a-badge :count="3" :offset="[-5, 5]">
<BellOutlined class="notification-icon" @click="handleNotificationClick" />
</a-badge>
</div>
</header>
<!-- 搜索区域 -->
<div class="search-section">
<a-input
v-model:value="searchQuery"
placeholder="搜索商品..."
size="large"
@input="handleSearch"
>
<template #prefix>
<SearchOutlined style="color: #999" />
</template>
</a-input>
<a-button class="filter-btn" type="primary" shape="circle" @click="handleFilterClick">
<FilterOutlined />
</a-button>
</div>
<!-- Banner 区域 -->
<div class="banner" @click="handleBannerClick">
<div class="banner-content">
<a-tag color="red" class="banner-tag">限时优惠</a-tag>
<h3>Get Winter Discount</h3>
<h2>20% Off</h2>
<p>For Children</p>
<a-button type="primary" size="small" class="banner-btn">立即购买</a-button>
</div>
<div class="banner-image">
<div class="img-placeholder">Banner</div>
</div>
</div>
<!-- 精选商品区域 -->
<section class="section">
<div class="section-header">
<h3>精选商品</h3>
<a class="see-all" @click="handleSeeAll('featured')">查看全部 <RightOutlined /></a>
</div>
<div class="horizontal-scroll">
<a-card
v-for="item in featuredItems"
:key="item.id"
class="product-card"
:body-style="{ padding: '12px' }"
hoverable
@click="handleProductClick(item)"
>
<div class="product-img" :style="{ backgroundColor: item.bgColor }">
<span>{{ item.name[0] }}</span>
</div>
<div class="product-info">
<p class="name">{{ item.name }}</p>
<p class="price">${{ item.price }}</p>
</div>
</a-card>
</div>
</section>
<!-- 热门商品区域 -->
<section class="section popular-section">
<div class="section-header">
<h3>热门商品</h3>
<a class="see-all" @click="handleSeeAll('popular')">查看全部 <RightOutlined /></a>
</div>
<div class="product-grid">
<a-card
v-for="item in popularItems"
:key="item.id"
class="product-card grid-item"
:body-style="{ padding: '12px' }"
hoverable
@click="handleProductClick(item)"
>
<div class="product-img" :style="{ backgroundColor: item.bgColor }">
<span>{{ item.name[0] }}</span>
</div>
<div class="product-info">
<p class="name">{{ item.name }}</p>
<p class="price">${{ item.price }}</p>
</div>
</a-card>
</div>
</section>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import {
BellOutlined,
SearchOutlined,
FilterOutlined,
RightOutlined
} from '@ant-design/icons-vue'
const router = useRouter()
// 搜索关键词
const searchQuery = ref('')
// 精选商品数据
const featuredItems = ref([
{ id: 1, name: 'Watch', price: 40, bgColor: '#ffe4d6' },
{ id: 2, name: 'Nike Shoes', price: 430, bgColor: '#d6eaff' },
{ id: 3, name: 'Airpods', price: 333, bgColor: '#e2ffd6' }
])
// 热门商品数据
const popularItems = ref([
{ id: 4, name: 'LG TV', price: 330, bgColor: '#f0d6ff' },
{ id: 5, name: 'Hoodie', price: 50, bgColor: '#ffd6e2' },
{ id: 6, name: 'Jacket', price: 400, bgColor: '#d6fff0' }
])
// 处理用户头像点击
const handleUserClick = () => {
console.log('用户头像被点击')
router.push('/profile')
}
// 处理通知图标点击
const handleNotificationClick = () => {
console.log('通知图标被点击')
}
// 处理搜索输入
const handleSearch = (val: string) => {
console.log('搜索内容改变:', val)
}
// 处理筛选按钮点击
const handleFilterClick = () => {
console.log('筛选按钮被点击')
}
// 处理 Banner 点击
const handleBannerClick = () => {
console.log('Banner被点击')
}
// 处理查看全部点击
const handleSeeAll = (type: string) => {
console.log(`查看全部: ${type}`)
router.push('/products')
}
// 处理商品卡片点击
const handleProductClick = (item: any) => {
console.log('商品被点击:', item.name)
router.push(`/product/${item.id}`)
}
</script>
<style scoped>
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 20px;
}
.user-info {
display: flex;
align-items: center;
gap: 12px;
cursor: pointer;
transition: transform 0.2s;
}
.user-info:hover {
transform: scale(1.02);
}
.greeting {
font-size: 12px;
color: #999;
margin: 0;
}
.username {
font-weight: bold;
font-size: 16px;
margin: 0;
}
.actions {
display: flex;
align-items: center;
}
.notification-icon {
font-size: 24px;
cursor: pointer;
color: #333;
transition: color 0.3s;
}
.notification-icon:hover {
color: #1890ff;
}
.search-section {
display: flex;
padding: 10px 20px;
gap: 10px;
align-items: center;
}
.search-section :deep(.ant-input) {
border-radius: 20px;
height: 44px;
}
.filter-btn {
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.banner {
margin: 15px 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 20px;
height: 160px;
padding: 20px;
display: flex;
justify-content: space-between;
align-items: center;
color: white;
overflow: hidden;
position: relative;
cursor: pointer;
transition: transform 0.3s, box-shadow 0.3s;
}
.banner:hover {
transform: translateY(-4px);
box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}
.banner-tag {
margin-bottom: 8px;
border: none;
font-weight: 500;
}
.banner-content h3 {
font-size: 14px;
opacity: 0.9;
margin: 0 0 4px 0;
}
.banner-content h2 {
font-size: 28px;
margin: 4px 0;
font-weight: bold;
text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}
.banner-content p {
font-size: 14px;
margin: 4px 0 12px 0;
opacity: 0.9;
}
.banner-btn {
border-radius: 20px;
height: 32px;
font-weight: 500;
}
.banner-image {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
}
.img-placeholder {
width: 100px;
height: 100px;
background: rgba(255,255,255,0.2);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
backdrop-filter: blur(10px);
}
.section {
padding: 15px 0;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px 15px;
}
.section-header h3 {
font-size: 18px;
font-weight: bold;
margin: 0;
}
.see-all {
color: #1890ff;
font-size: 13px;
cursor: pointer;
display: flex;
align-items: center;
gap: 4px;
transition: color 0.3s;
}
.see-all:hover {
color: #40a9ff;
}
.horizontal-scroll {
display: flex;
overflow-x: auto;
padding: 0 20px;
gap: 15px;
scrollbar-width: none;
}
.horizontal-scroll::-webkit-scrollbar {
display: none;
}
.product-card {
width: 140px;
flex-shrink: 0;
cursor: pointer;
transition: transform 0.3s, box-shadow 0.3s;
}
.product-card:hover {
transform: translateY(-4px);
}
.product-card :deep(.ant-card-body) {
padding: 12px;
}
.product-img {
width: 100%;
aspect-ratio: 1;
border-radius: 12px;
display: flex;
justify-content: center;
align-items: center;
font-size: 40px;
font-weight: bold;
color: rgba(0,0,0,0.1);
margin-bottom: 8px;
}
.product-info {
padding: 0;
}
.name {
font-size: 14px;
font-weight: 500;
margin: 0 0 4px 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.price {
color: #ff4d4f;
font-weight: bold;
margin: 0;
font-size: 16px;
}
.product-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
padding: 0 20px;
gap: 15px;
}
.grid-item {
width: 100%;
}
.popular-section {
padding-bottom: 20px;
}
</style>
+309
View File
@@ -0,0 +1,309 @@
<template>
<div class="mobile-container">
<!-- Header -->
<header class="header">
<div class="back-btn" @click="handleBackClick">
<el-icon><ArrowLeft /></el-icon>
</div>
<h1>Product Detail</h1>
<div class="actions">
<el-icon @click="handleFavoriteClick"><Star /></el-icon>
</div>
</header>
<!-- Product Image -->
<div class="product-image" :style="{ backgroundColor: product.bgColor }">
<span class="product-letter">{{ product.name[0] }}</span>
</div>
<!-- Product Info -->
<div class="product-info">
<div class="info-header">
<h2 class="product-name">{{ product.name }}</h2>
<div class="price-tag">${{ product.price }}</div>
</div>
<div class="rating">
<el-rate v-model="product.rating" disabled show-score text-color="#ff9900" />
</div>
<p class="description">{{ product.description }}</p>
</div>
<!-- Size Selection -->
<div class="size-section">
<h3>Size</h3>
<div class="size-options">
<div v-for="size in sizes" :key="size"
class="size-option"
:class="{ active: selectedSize === size }"
@click="handleSizeClick(size)">
{{ size }}
</div>
</div>
</div>
<!-- Color Selection -->
<div class="color-section">
<h3>Color</h3>
<div class="color-options">
<div v-for="color in colors" :key="color.name"
class="color-option"
:class="{ active: selectedColor === color.name }"
:style="{ backgroundColor: color.value }"
@click="handleColorClick(color.name)">
</div>
</div>
</div>
<!-- Quantity -->
<div class="quantity-section">
<h3>Quantity</h3>
<div class="quantity-control">
<el-button @click="decreaseQuantity" :disabled="quantity <= 1">-</el-button>
<span class="quantity">{{ quantity }}</span>
<el-button @click="increaseQuantity">+</el-button>
</div>
</div>
<!-- Action Buttons -->
<div class="action-buttons">
<el-button class="add-cart-btn" @click="handleAddToCart">
Add to Cart
</el-button>
<el-button class="buy-now-btn" type="primary" @click="handleBuyNow">
Buy Now
</el-button>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { ArrowLeft, Star } from '@element-plus/icons-vue'
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
const product = ref({
id: 1,
name: 'Watch',
price: 40,
bgColor: '#ffe4d6',
rating: 4.5,
description: 'This is a premium quality watch with excellent design and durability. Perfect for any occasion.'
})
const sizes = ['S', 'M', 'L', 'XL']
const colors = [
{ name: 'red', value: '#ff6b6b' },
{ name: 'blue', value: '#4ecdc4' },
{ name: 'black', value: '#2c3e50' },
{ name: 'white', value: '#ecf0f1' }
]
const selectedSize = ref('M')
const selectedColor = ref('black')
const quantity = ref(1)
onMounted(() => {
const productId = route.params.id
console.log('产品ID:', productId)
})
const handleBackClick = () => {
console.log('返回按钮被点击')
router.back()
}
const handleFavoriteClick = () => console.log('收藏按钮被点击')
const handleSizeClick = (size: string) => {
console.log('选择尺码:', size)
selectedSize.value = size
}
const handleColorClick = (color: string) => {
console.log('选择颜色:', color)
selectedColor.value = color
}
const decreaseQuantity = () => {
if (quantity.value > 1) {
quantity.value--
console.log('数量减少:', quantity.value)
}
}
const increaseQuantity = () => {
quantity.value++
console.log('数量增加:', quantity.value)
}
const handleAddToCart = () => {
console.log('添加到购物车:', {
product: product.value,
size: selectedSize.value,
color: selectedColor.value,
quantity: quantity.value
})
}
const handleBuyNow = () => {
console.log('立即购买:', {
product: product.value,
size: selectedSize.value,
color: selectedColor.value,
quantity: quantity.value
})
}
</script>
<style scoped>
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 20px;
border-bottom: 1px solid #f0f0f0;
}
.back-btn {
width: 40px;
height: 40px;
display: flex;
align-items: center;
cursor: pointer;
}
.header h1 {
font-size: 18px;
font-weight: bold;
}
.actions {
width: 40px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
.product-image {
width: 100%;
height: 300px;
display: flex;
justify-content: center;
align-items: center;
font-size: 80px;
font-weight: bold;
color: rgba(0,0,0,0.1);
}
.product-info {
padding: 20px;
}
.info-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.product-name {
font-size: 24px;
font-weight: bold;
margin: 0;
}
.price-tag {
font-size: 24px;
color: var(--primary-color);
font-weight: bold;
}
.rating {
margin-bottom: 15px;
}
.description {
color: #666;
line-height: 1.6;
}
.size-section, .color-section, .quantity-section {
padding: 20px;
border-top: 1px solid #f0f0f0;
}
.size-section h3, .color-section h3, .quantity-section h3 {
margin: 0 0 15px 0;
font-size: 16px;
font-weight: bold;
}
.size-options {
display: flex;
gap: 10px;
}
.size-option {
width: 45px;
height: 45px;
border: 2px solid #ddd;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
transition: all 0.3s;
}
.size-option.active {
border-color: var(--primary-color);
background-color: var(--primary-color);
color: white;
}
.color-options {
display: flex;
gap: 15px;
}
.color-option {
width: 40px;
height: 40px;
border-radius: 50%;
cursor: pointer;
border: 3px solid transparent;
transition: all 0.3s;
}
.color-option.active {
border-color: var(--primary-color);
transform: scale(1.1);
}
.quantity-control {
display: flex;
align-items: center;
gap: 15px;
}
.quantity {
font-size: 18px;
font-weight: bold;
min-width: 30px;
text-align: center;
}
.action-buttons {
padding: 20px;
display: flex;
gap: 15px;
padding-bottom: 20px;
}
.add-cart-btn, .buy-now-btn {
flex: 1;
height: 50px;
border-radius: 25px;
font-size: 16px;
font-weight: bold;
}
.add-cart-btn {
background-color: #f5f5f5;
border: none;
color: #333;
}
.buy-now-btn {
background-color: var(--primary-color);
border: none;
}
</style>
+305
View File
@@ -0,0 +1,305 @@
<template>
<div class="mobile-container">
<!-- 头部区域 -->
<header class="header">
<a-button class="back-btn" type="text" @click="handleBackClick">
<LeftOutlined :style="{ fontSize: '20px' }" />
</a-button>
<h1>商品列表</h1>
<a-button class="search-btn" type="text">
<SearchOutlined :style="{ fontSize: '20px' }" />
</a-button>
</header>
<!-- 主内容区域 -->
<div class="main-content">
<!-- 左侧分类边栏 -->
<div class="category-sidebar">
<div
v-for="category in categories"
:key="category"
class="category-item"
:class="{ active: selectedCategory === category }"
@click="handleCategoryClick(category)"
>
{{ category }}
</div>
</div>
<!-- 右侧商品区域 -->
<div class="product-section">
<!-- 商品网格 -->
<div class="product-grid">
<a-card
v-for="item in products"
:key="item.id"
class="product-card"
:body-style="{ padding: '12px' }"
hoverable
@click="handleProductClick(item)"
>
<!-- 商品图片 -->
<div class="product-img" :style="{ backgroundColor: item.bgColor }">
<span>{{ item.name[0] }}</span>
<a-badge
v-if="item.tag"
:text="item.tag"
color="#ff4d4f"
class="product-tag"
/>
</div>
<!-- 商品信息 -->
<div class="product-info">
<p class="name">{{ item.name }}</p>
<div class="price-row">
<p class="price">${{ item.price }}</p>
<a-button
type="primary"
size="small"
shape="circle"
@click.stop="handleAddToCart(item)"
>
<ShoppingCartOutlined />
</a-button>
</div>
</div>
</a-card>
</div>
<!-- 加载更多 -->
<div class="load-more">
<a-button v-if="hasMore" type="link" @click="handleLoadMore">
加载更多 <DownOutlined />
</a-button>
<a-typography-text v-else type="secondary">没有更多商品了</a-typography-text>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import {
LeftOutlined,
SearchOutlined,
ShoppingCartOutlined,
DownOutlined
} from '@ant-design/icons-vue'
import { message } from 'ant-design-vue'
const router = useRouter()
// 当前选中的分类
const selectedCategory = ref('全部')
// 分类列表
const categories = ['全部', '电子产品', '服装', '配饰', '家居']
// 商品数据
const products = ref([
{ id: 1, name: 'Watch', price: 40, bgColor: '#ffe4d6', tag: '热销' },
{ id: 2, name: 'LG TV', price: 330, bgColor: '#f0d6ff', tag: '新品' },
{ id: 3, name: 'Jacket', price: 50, bgColor: '#ffd6e2' },
{ id: 4, name: 'Nike Shoes', price: 430, bgColor: '#d6eaff', tag: '限时' },
{ id: 5, name: 'Airpods', price: 333, bgColor: '#e2ffd6' },
{ id: 6, name: 'Hoodie', price: 50, bgColor: '#d6fff0' }
])
// 是否还有更多数据
const hasMore = ref(true)
// 处理返回按钮点击
const handleBackClick = () => {
console.log('返回按钮被点击')
router.push('/')
}
// 处理分类点击
const handleCategoryClick = (category: string) => {
console.log('选择分类:', category)
selectedCategory.value = category
// 这里可以添加筛选逻辑
}
// 处理商品卡片点击
const handleProductClick = (item: any) => {
console.log('商品被点击:', item.name)
router.push(`/product/${item.id}`)
}
// 处理添加到购物车
const handleAddToCart = (item: any) => {
console.log('添加到购物车:', item.name)
message.success(`已将 ${item.name} 添加到购物车`)
}
// 处理加载更多
const handleLoadMore = () => {
console.log('加载更多商品')
// 这里可以添加加载更多逻辑
hasMore.value = false
}
</script>
<style scoped>
.mobile-container {
padding-top: 60px;
min-height: 100vh;
background: #f5f5f5;
}
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 15px;
border-bottom: 1px solid #f0f0f0;
background: white;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.header h1 {
font-size: 18px;
font-weight: bold;
margin: 0;
}
.back-btn,
.search-btn {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
}
/* 主内容区域 */
.main-content {
display: flex;
height: calc(100vh - 60px);
overflow: hidden;
}
/* 左侧分类边栏 */
.category-sidebar {
width: 90px;
background: #f8f8f8;
overflow-y: auto;
border-right: 1px solid #e8e8e8;
}
.category-item {
padding: 16px 12px;
font-size: 13px;
color: #666;
text-align: center;
cursor: pointer;
transition: all 0.3s;
border-left: 3px solid transparent;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.category-item:hover {
background: #e8e8e8;
color: #1890ff;
}
.category-item.active {
background: white;
color: #1890ff;
border-left-color: #1890ff;
font-weight: 600;
}
/* 右侧商品区域 */
.product-section {
flex: 1;
overflow-y: auto;
background: #f5f5f5;
}
.product-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
padding: 0 20px;
gap: 15px;
}
.product-card {
cursor: pointer;
transition: transform 0.3s, box-shadow 0.3s;
}
.product-card:hover {
transform: translateY(-4px);
}
.product-card :deep(.ant-card-body) {
padding: 12px;
}
.product-img {
width: 100%;
aspect-ratio: 1;
border-radius: 12px;
display: flex;
justify-content: center;
align-items: center;
font-size: 40px;
font-weight: bold;
color: rgba(0,0,0,0.1);
margin-bottom: 10px;
position: relative;
overflow: hidden;
}
.product-tag {
position: absolute;
top: 8px;
left: 8px;
font-size: 11px;
padding: 2px 8px;
border-radius: 8px;
}
.product-info {
padding: 0;
}
.name {
font-size: 14px;
font-weight: 500;
margin: 0 0 4px 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.price-row {
display: flex;
justify-content: space-between;
align-items: center;
}
.price {
color: #ff4d4f;
font-weight: bold;
margin: 0;
font-size: 16px;
}
.load-more {
padding: 20px;
text-align: center;
}
</style>
+341
View File
@@ -0,0 +1,341 @@
<template>
<div class="mobile-container">
<!-- 头部区域 -->
<header class="header">
<h1>个人中心</h1>
<a-button class="settings-btn" type="text" @click="handleSettingsClick">
<SettingOutlined :style="{ fontSize: '20px' }" />
</a-button>
</header>
<!-- 用户信息卡片 -->
<div class="profile-info">
<a-card :bordered="false" class="profile-card">
<div class="avatar-section">
<a-badge :dot="hasNotification" :offset="[-5, 5]">
<a-avatar :size="80" src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png" />
</a-badge>
<div class="user-details">
<h2 class="username">昵称</h2>
<p class="email">user@example.com</p>
</div>
</div>
<a-button type="primary" block @click="handleEditProfile">
编辑资料
</a-button>
</a-card>
</div>
<!-- 统计数据 -->
<div class="stats-section">
<a-row :gutter="16">
<a-col :span="8">
<a-statistic title="订单" :value="12" />
</a-col>
<a-col :span="8">
<a-statistic title="收藏" :value="5" />
</a-col>
<a-col :span="8">
<a-statistic title="优惠券" :value="3" />
</a-col>
</a-row>
</div>
<!-- 菜单列表 -->
<div class="menu-section">
<a-card :bordered="false" class="menu-card">
<a-list :data-source="menuItems" :split="false">
<template #renderItem="{ item }">
<a-list-item
class="menu-item"
@click="handleMenuClick(item.key)"
>
<template #actions>
<RightOutlined />
</template>
<a-list-item-meta>
<template #avatar>
<div class="menu-icon" :style="{ backgroundColor: item.bgColor }">
<component :is="item.icon" />
</div>
</template>
<template #title>
<span>{{ item.title }}</span>
</template>
<template #description v-if="item.desc">
<span>{{ item.desc }}</span>
</template>
</a-list-item-meta>
</a-list-item>
</template>
</a-list>
</a-card>
</div>
<!-- 退出登录按钮 -->
<div class="logout-section">
<a-button danger block @click="handleLogout">
退出登录
</a-button>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, h } from 'vue'
import { useRouter } from 'vue-router'
import {
SettingOutlined,
RightOutlined,
ShoppingOutlined,
HeartOutlined,
EnvironmentOutlined,
CreditCardOutlined,
BellOutlined,
QuestionCircleOutlined
} from '@ant-design/icons-vue'
import { message } from 'ant-design-vue'
const router = useRouter()
// 是否有未读通知
const hasNotification = ref(true)
// 菜单项数据
const menuItems = ref([
{
key: 'orders',
title: '我的订单',
icon: ShoppingOutlined,
bgColor: '#e6f7ff'
},
{
key: 'wishlist',
title: '我的收藏',
icon: HeartOutlined,
bgColor: '#fff1f0'
},
{
key: 'address',
title: '收货地址',
icon: EnvironmentOutlined,
bgColor: '#f6ffed'
},
{
key: 'payment',
title: '支付方式',
icon: CreditCardOutlined,
bgColor: '#fff7e6'
},
{
key: 'notifications',
title: '消息通知',
desc: '3条未读',
icon: BellOutlined,
bgColor: '#f9f0ff'
},
{
key: 'help',
title: '帮助与支持',
icon: QuestionCircleOutlined,
bgColor: '#e6f7ff'
}
])
// 处理编辑资料点击
const handleEditProfile = () => {
console.log('编辑个人资料被点击')
message.info('编辑功能开发中...')
}
// 处理菜单项点击
const handleMenuClick = (key: string) => {
console.log('菜单项被点击:', key)
if (key === 'wishlist') {
router.push('/wishlist')
} else if (key === 'orders') {
message.info('订单功能开发中...')
} else if (key === 'address') {
message.info('地址管理功能开发中...')
} else if (key === 'payment') {
message.info('支付方式功能开发中...')
} else if (key === 'notifications') {
message.info('消息通知功能开发中...')
} else if (key === 'help') {
message.info('帮助中心功能开发中...')
}
}
// 处理退出登录
const handleLogout = () => {
console.log('退出登录被点击')
message.success('已退出登录')
}
// 处理设置图标点击
const handleSettingsClick = () => {
console.log('设置图标被点击')
router.push('/settings')
}
</script>
<style scoped>
.mobile-container {
padding-top: 60px;
min-height: 100vh;
background: #f5f5f5;
}
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 15px;
border-bottom: 1px solid #f0f0f0;
background: white;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.header h1 {
font-size: 18px;
font-weight: bold;
margin: 0;
}
.settings-btn {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
}
.profile-info {
padding: 15px;
}
.profile-card {
border-radius: 16px;
overflow: hidden;
}
.profile-card :deep(.ant-card-body) {
padding: 24px;
}
.avatar-section {
display: flex;
align-items: center;
gap: 16px;
margin-bottom: 20px;
}
.user-details {
flex: 1;
}
.username {
font-size: 20px;
font-weight: bold;
margin: 0 0 4px 0;
}
.email {
color: #999;
font-size: 14px;
margin: 0;
}
.stats-section {
padding: 0 15px 15px;
display: flex;
justify-content: center;
}
.stats-section :deep(.ant-row) {
width: 100%;
max-width: 400px;
}
.stats-section :deep(.ant-statistic-title) {
font-size: 12px;
color: #999;
}
.stats-section :deep(.ant-statistic-content) {
font-size: 20px;
font-weight: bold;
color: #1890ff;
}
.menu-section {
padding: 0 15px 15px;
}
.menu-card {
border-radius: 16px;
overflow: hidden;
}
.menu-card :deep(.ant-card-body) {
padding: 0;
}
.menu-item {
padding: 16px;
cursor: pointer;
transition: background 0.3s;
border-bottom: 1px solid #f0f0f0;
}
.menu-item:hover {
background: #fafafa;
}
.menu-item:last-child {
border-bottom: none;
}
.menu-item :deep(.ant-list-item-action) {
margin-left: 8px;
color: #ccc;
}
.menu-icon {
width: 40px;
height: 40px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
}
.menu-item :deep(.ant-list-item-meta-title) {
font-size: 15px;
font-weight: 500;
color: #333;
}
.menu-item :deep(.ant-list-item-meta-description) {
font-size: 12px;
color: #999;
}
.logout-section {
padding: 0 15px 20px;
}
.logout-section :deep(.ant-btn-dangerous) {
height: 48px;
border-radius: 24px;
font-weight: 600;
font-size: 16px;
}
</style>
+275
View File
@@ -0,0 +1,275 @@
<template>
<div class="mobile-container">
<!-- 头部区域 -->
<header class="header">
<a-button class="back-btn" type="text" @click="handleBackClick">
<LeftOutlined :style="{ fontSize: '20px' }" />
</a-button>
<h1>设置</h1>
<div class="empty"></div>
</header>
<!-- 设置菜单 -->
<div class="settings-menu">
<a-card :bordered="false" class="settings-card">
<a-list :data-source="settingsSections" :split="false">
<template #renderItem="{ item }">
<!-- 分组标题 -->
<a-list-item class="section-title" v-if="item.type === 'title'">
<span>{{ item.title }}</span>
</a-list-item>
<!-- 设置项 -->
<a-list-item
v-else
class="setting-item"
@click="handleSettingClick(item.key)"
>
<template #actions>
<component :is="item.actionComponent" v-if="item.actionComponent" :props="item.actionProps" />
<RightOutlined v-else />
</template>
<a-list-item-meta>
<template #avatar>
<div class="setting-icon" :style="{ backgroundColor: item.bgColor }">
<component :is="item.icon" />
</div>
</template>
<template #title>
<span>{{ item.title }}</span>
</template>
<template #description v-if="item.desc">
<span>{{ item.desc }}</span>
</template>
</a-list-item-meta>
</a-list-item>
</template>
</a-list>
</a-card>
</div>
<!-- 版本信息 -->
<div class="version-info">
<a-typography-text type="secondary">版本 1.0.0</a-typography-text>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import {
LeftOutlined,
RightOutlined,
LockOutlined,
BellOutlined,
SoundOutlined,
MessageOutlined,
ClearOutlined,
SafetyOutlined,
InfoCircleOutlined
} from '@ant-design/icons-vue'
import { message } from 'ant-design-vue'
const router = useRouter()
// 设置项数据
const settingsSections = ref([
// 账户与安全
{
type: 'title',
title: '账户与安全'
},
{
key: 'account',
title: '账号设置',
desc: '修改密码、绑定手机',
icon: LockOutlined,
bgColor: '#e6f7ff'
},
// 通知设置
{
type: 'title',
title: '通知设置'
},
{
key: 'notifications',
title: '消息通知',
icon: BellOutlined,
bgColor: '#f6ffed'
},
{
key: 'message-push',
title: '消息推送',
icon: MessageOutlined,
bgColor: '#fffbe6'
},
// 外观设置
{
type: 'title',
title: '外观设置'
},
{
key: 'theme',
title: '主题设置',
desc: '跟随系统',
icon: SoundOutlined,
bgColor: '#f9f0ff'
},
// 其他设置
{
type: 'title',
title: '其他设置'
},
{
key: 'clear-cache',
title: '清除缓存',
desc: '12.5 MB',
icon: ClearOutlined,
bgColor: '#fff2e8'
},
{
key: 'privacy',
title: '隐私政策',
icon: SafetyOutlined,
bgColor: '#e6f7ff'
},
{
key: 'about',
title: '关于我们',
icon: InfoCircleOutlined,
bgColor: '#f6ffed'
}
])
// 处理返回按钮点击
const handleBackClick = () => {
router.back()
}
// 处理设置项点击
const handleSettingClick = (key: string) => {
console.log('设置项被点击:', key)
switch (key) {
case 'account':
message.info('账号设置功能开发中...')
break
case 'notifications':
message.info('消息通知功能开发中...')
break
case 'message-push':
message.info('消息推送功能开发中...')
break
case 'theme':
message.info('主题设置功能开发中...')
break
case 'clear-cache':
message.success('缓存已清除')
break
case 'privacy':
message.info('隐私政策功能开发中...')
break
case 'about':
message.info('关于我们功能开发中...')
break
default:
break
}
}
</script>
<style scoped>
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 15px;
border-bottom: 1px solid #f0f0f0;
}
.header h1 {
font-size: 18px;
font-weight: bold;
margin: 0;
}
.back-btn,
.empty {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
}
.settings-menu {
padding: 15px;
}
.settings-card {
border-radius: 16px;
overflow: hidden;
}
.settings-card :deep(.ant-card-body) {
padding: 0;
}
.section-title {
padding: 12px 16px;
font-size: 13px;
color: #999;
background: #fafafa;
}
.setting-item {
padding: 16px;
cursor: pointer;
transition: background 0.3s;
border-bottom: 1px solid #f0f0f0;
}
.setting-item:hover {
background: #fafafa;
}
.setting-item:last-child {
border-bottom: none;
}
.setting-item :deep(.ant-list-item-action) {
margin-left: 8px;
color: #ccc;
}
.setting-icon {
width: 40px;
height: 40px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
}
.setting-item :deep(.ant-list-item-meta-title) {
font-size: 15px;
font-weight: 500;
color: #333;
}
.setting-item :deep(.ant-list-item-meta-description) {
font-size: 12px;
color: #999;
}
.version-info {
padding: 20px;
text-align: center;
}
</style>
+172
View File
@@ -0,0 +1,172 @@
<template>
<div class="mobile-container">
<!-- Header -->
<header class="header">
<div class="back-btn" @click="handleBackClick">
<el-icon><ArrowLeft /></el-icon>
</div>
<h1>Wishlist</h1>
<div class="empty"></div>
</header>
<!-- Wishlist Items -->
<div class="wishlist-items">
<div v-for="item in wishlistItems" :key="item.id" class="wishlist-item">
<div class="item-image" :style="{ backgroundColor: item.bgColor }">
<span>{{ item.name[0] }}</span>
</div>
<div class="item-details">
<h3 class="item-name">{{ item.name }}</h3>
<p class="item-price">${{ item.price }}</p>
<div class="item-actions">
<el-button size="small" type="primary" @click="handleAddToCart(item)">
Add to Cart
</el-button>
<el-icon class="delete-icon" @click="handleRemoveItem(item)"><Delete /></el-icon>
</div>
</div>
</div>
</div>
<!-- Empty Wishlist Message -->
<div v-if="wishlistItems.length === 0" class="empty-wishlist">
<el-icon :size="60"><Star /></el-icon>
<p>Your wishlist is empty</p>
<el-button type="primary" @click="handleBrowseProducts">
Browse Products
</el-button>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { ArrowLeft, Delete, Star } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const wishlistItems = ref([
{ id: 1, name: 'Watch', price: 40, bgColor: '#ffe4d6' },
{ id: 2, name: 'LG TV', price: 330, bgColor: '#f0d6ff' },
{ id: 3, name: 'Jacket', price: 50, bgColor: '#ffd6e2' },
{ id: 4, name: 'Nike Shoes', price: 430, bgColor: '#d6eaff' }
])
const handleBackClick = () => {
console.log('返回按钮被点击')
router.back()
}
const handleAddToCart = (item: any) => {
console.log('添加到购物车:', item.name)
}
const handleRemoveItem = (item: any) => {
console.log('从收藏夹移除:', item.name)
const index = wishlistItems.value.findIndex(i => i.id === item.id)
if (index > -1) {
wishlistItems.value.splice(index, 1)
}
}
const handleBrowseProducts = () => {
console.log('浏览商品')
router.push('/products')
}
</script>
<style scoped>
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 20px;
border-bottom: 1px solid #f0f0f0;
}
.back-btn {
width: 40px;
height: 40px;
display: flex;
align-items: center;
cursor: pointer;
}
.header h1 {
font-size: 18px;
font-weight: bold;
}
.empty {
width: 40px;
}
.wishlist-items {
padding: 20px;
padding-bottom: 20px;
}
.wishlist-item {
display: flex;
gap: 15px;
padding: 15px;
background: #f9f9f9;
border-radius: 15px;
margin-bottom: 15px;
}
.item-image {
width: 80px;
height: 80px;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
font-size: 30px;
font-weight: bold;
color: rgba(0,0,0,0.1);
}
.item-details {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.item-name {
font-size: 16px;
font-weight: bold;
margin: 0 0 5px 0;
}
.item-price {
color: var(--primary-color);
font-weight: bold;
margin: 0 0 10px 0;
}
.item-actions {
display: flex;
justify-content: space-between;
align-items: center;
}
.delete-icon {
color: #ff4757;
cursor: pointer;
font-size: 20px;
}
.empty-wishlist {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 60px 20px;
color: #999;
}
.empty-wishlist p {
margin: 20px 0;
font-size: 16px;
}
</style>
+20
View File
@@ -0,0 +1,20 @@
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"types": ["vite/client"],
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
}
+7
View File
@@ -0,0 +1,7 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}
+26
View File
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "ES2023",
"lib": ["ES2023"],
"module": "ESNext",
"types": ["node"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["vite.config.ts"]
}
+58
View File
@@ -0,0 +1,58 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
// https://vite.dev/config/
export default defineConfig({
// 配置服务器中间件
plugins: [
vue(),
AutoImport({
resolvers: [ElementPlusResolver()],
imports: ['vue', 'vue-router', 'pinia'],
dts: 'src/auto-import.d.ts',
}),
Components({
resolvers: [ElementPlusResolver()],
dts: 'src/components.d.ts',
}),
// 添加 IP 访问控制中间件
{
name: 'ip-access-control',
configureServer(server) {
// 暂时禁用 IP 访问控制,允许所有 IP 访问
// 生产环境应该重新启用并配置正确的 IP 列表
server.middlewares.use((req, res, next) => {
// 直接允许所有 IP 访问
next()
})
},
},
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 3000,
host: true,
proxy: {
'/api': {
target: 'http://localhost:8088', // 代理到 Gateway
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
// 配置允许的主机名
allowedHosts: [
'localhost',
'127.0.0.1',
'2666.online', // 允许通过 2666.online 访问
// 可以添加更多允许的域名
],
},
})
+66
View File
@@ -29,36 +29,78 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Log4j2 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<!-- Redis -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- RabbitMQ -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Nacos Discovery -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Bootstrap for Nacos Config -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- MySQL & Druid & MyBatis-Plus -->
@@ -71,17 +113,35 @@
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Validation -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Lombok -->
@@ -96,6 +156,12 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
@@ -22,7 +22,7 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
public void insertFill(MetaObject metaObject) {
log.info("start insert fill ....");
this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now());
this.strictInsertFill(metaObject, "updateTime", LocalDateTime.now().getClass(), LocalDateTime.now());
this.strictInsertFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now());
}
@Override
@@ -0,0 +1,97 @@
package com.xiaowang.yuminailcore.controller;
import com.xiaowang.yuminailcore.common.Result;
import com.xiaowang.yuminailcore.dto.BalanceChangeDetailDTO;
import com.xiaowang.yuminailcore.vo.BalanceChangeDetailVO;
import com.xiaowang.yuminailcore.service.BalanceChangeDetailService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 用户余额变动明细表 Controller
* 对应数据库表 t_balance_change_detail
*
* @author xiaowang
* @date 2026-02-13
*/
@RestController
@RequestMapping("/api/balance-change-detail")
@RequiredArgsConstructor
public class BalanceChangeDetailController {
private final BalanceChangeDetailService balanceChangeDetailService;
/**
* 创建余额变动明细
*
* @param balanceChangeDetailDTO 余额变动明细DTO
* @return 余额变动明细ID
*/
@PostMapping("/create")
public Result<Long> createBalanceChangeDetail(@RequestBody BalanceChangeDetailDTO balanceChangeDetailDTO) {
Long id = balanceChangeDetailService.createBalanceChangeDetail(balanceChangeDetailDTO);
return Result.success(id);
}
/**
* 更新余额变动明细
*
* @param id 余额变动明细ID
* @param balanceChangeDetailDTO 余额变动明细DTO
* @return 是否更新成功
*/
@PutMapping("/update/{id}")
public Result<Boolean> updateBalanceChangeDetail(@PathVariable Long id, @RequestBody BalanceChangeDetailDTO balanceChangeDetailDTO) {
boolean success = balanceChangeDetailService.updateBalanceChangeDetail(id, balanceChangeDetailDTO);
return Result.success(success);
}
/**
* 删除余额变动明细
*
* @param id 余额变动明细ID
* @return 是否删除成功
*/
@DeleteMapping("/delete/{id}")
public Result<Boolean> deleteBalanceChangeDetail(@PathVariable Long id) {
boolean success = balanceChangeDetailService.deleteBalanceChangeDetail(id);
return Result.success(success);
}
/**
* 根据ID查询余额变动明细
*
* @param id 余额变动明细ID
* @return 余额变动明细VO
*/
@GetMapping("/get/{id}")
public Result<BalanceChangeDetailVO> getBalanceChangeDetailById(@PathVariable Long id) {
BalanceChangeDetailVO balanceChangeDetailVO = balanceChangeDetailService.getBalanceChangeDetailById(id);
return Result.success(balanceChangeDetailVO);
}
/**
* 查询所有余额变动明细
*
* @return 余额变动明细VO列表
*/
@GetMapping("/list/all")
public Result<List<BalanceChangeDetailVO>> listAllBalanceChangeDetails() {
List<BalanceChangeDetailVO> balanceChangeDetailVOs = balanceChangeDetailService.listAllBalanceChangeDetails();
return Result.success(balanceChangeDetailVOs);
}
/**
* 根据用户ID查询余额变动明细
*
* @param userId 用户ID
* @return 余额变动明细VO列表
*/
@GetMapping("/list/user/{userId}")
public Result<List<BalanceChangeDetailVO>> listBalanceChangeDetailsByUserId(@PathVariable Long userId) {
List<BalanceChangeDetailVO> balanceChangeDetailVOs = balanceChangeDetailService.listBalanceChangeDetailsByUserId(userId);
return Result.success(balanceChangeDetailVOs);
}
}
@@ -0,0 +1,97 @@
package com.xiaowang.yuminailcore.controller;
import com.xiaowang.yuminailcore.common.Result;
import com.xiaowang.yuminailcore.dto.BalanceDTO;
import com.xiaowang.yuminailcore.vo.BalanceVO;
import com.xiaowang.yuminailcore.service.BalanceService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 用户余额信息表 Controller
* 对应数据库表 t_balance
*
* @author xiaowang
* @date 2026-02-13
*/
@RestController
@RequestMapping("/api/balance")
@RequiredArgsConstructor
public class BalanceController {
private final BalanceService balanceService;
/**
* 创建余额
*
* @param balanceDTO 余额DTO
* @return 余额ID
*/
@PostMapping("/create")
public Result<Long> createBalance(@RequestBody BalanceDTO balanceDTO) {
Long id = balanceService.createBalance(balanceDTO);
return Result.success(id);
}
/**
* 更新余额
*
* @param id 余额ID
* @param balanceDTO 余额DTO
* @return 是否更新成功
*/
@PutMapping("/update/{id}")
public Result<Boolean> updateBalance(@PathVariable Long id, @RequestBody BalanceDTO balanceDTO) {
boolean success = balanceService.updateBalance(id, balanceDTO);
return Result.success(success);
}
/**
* 删除余额
*
* @param id 余额ID
* @return 是否删除成功
*/
@DeleteMapping("/delete/{id}")
public Result<Boolean> deleteBalance(@PathVariable Long id) {
boolean success = balanceService.deleteBalance(id);
return Result.success(success);
}
/**
* 根据ID查询余额
*
* @param id 余额ID
* @return 余额VO
*/
@GetMapping("/get/{id}")
public Result<BalanceVO> getBalanceById(@PathVariable Long id) {
BalanceVO balanceVO = balanceService.getBalanceById(id);
return Result.success(balanceVO);
}
/**
* 查询所有余额
*
* @return 余额VO列表
*/
@GetMapping("/list/all")
public Result<List<BalanceVO>> listAllBalances() {
List<BalanceVO> balanceVOs = balanceService.listAllBalances();
return Result.success(balanceVOs);
}
/**
* 根据用户ID查询余额
*
* @param userId 用户ID
* @return 余额VO
*/
@GetMapping("/get/user/{userId}")
public Result<BalanceVO> getBalanceByUserId(@PathVariable Long userId) {
BalanceVO balanceVO = balanceService.getBalanceByUserId(userId);
return Result.success(balanceVO);
}
}
@@ -0,0 +1,133 @@
package com.xiaowang.yuminailcore.controller;
import com.xiaowang.yuminailcore.common.Result;
import com.xiaowang.yuminailcore.dto.CommentDTO;
import com.xiaowang.yuminailcore.vo.CommentVO;
import com.xiaowang.yuminailcore.service.CommentService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 用户评论信息表 Controller
* 对应数据库表 t_comment
*
* @author xiaowang
* @date 2026-02-13
*/
@RestController
@RequestMapping("/api/comment")
@RequiredArgsConstructor
public class CommentController {
private final CommentService commentService;
/**
* 创建评论
*
* @param commentDTO 评论DTO
* @return 评论ID
*/
@PostMapping("/create")
public Result<Long> createComment(@RequestBody CommentDTO commentDTO) {
Long id = commentService.createComment(commentDTO);
return Result.success(id);
}
/**
* 更新评论
*
* @param id 评论ID
* @param commentDTO 评论DTO
* @return 是否更新成功
*/
@PutMapping("/update/{id}")
public Result<Boolean> updateComment(@PathVariable Long id, @RequestBody CommentDTO commentDTO) {
boolean success = commentService.updateComment(id, commentDTO);
return Result.success(success);
}
/**
* 删除评论
*
* @param id 评论ID
* @return 是否删除成功
*/
@DeleteMapping("/delete/{id}")
public Result<Boolean> deleteComment(@PathVariable Long id) {
boolean success = commentService.deleteComment(id);
return Result.success(success);
}
/**
* 根据ID查询评论
*
* @param id 评论ID
* @return 评论VO
*/
@GetMapping("/get/{id}")
public Result<CommentVO> getCommentById(@PathVariable Long id) {
CommentVO commentVO = commentService.getCommentById(id);
return Result.success(commentVO);
}
/**
* 查询所有评论
*
* @return 评论VO列表
*/
@GetMapping("/list/all")
public Result<List<CommentVO>> listAllComments() {
List<CommentVO> commentVOs = commentService.listAllComments();
return Result.success(commentVOs);
}
/**
* 根据用户ID查询评论
*
* @param userId 用户ID
* @return 评论VO列表
*/
@GetMapping("/list/user/{userId}")
public Result<List<CommentVO>> listCommentsByUserId(@PathVariable Long userId) {
List<CommentVO> commentVOs = commentService.listCommentsByUserId(userId);
return Result.success(commentVOs);
}
/**
* 根据店铺ID查询评论
*
* @param shopId 店铺ID
* @return 评论VO列表
*/
@GetMapping("/list/shop/{shopId}")
public Result<List<CommentVO>> listCommentsByShopId(@PathVariable Long shopId) {
List<CommentVO> commentVOs = commentService.listCommentsByShopId(shopId);
return Result.success(commentVOs);
}
/**
* 根据商品ID查询评论
*
* @param productId 商品ID
* @return 评论VO列表
*/
@GetMapping("/list/product/{productId}")
public Result<List<CommentVO>> listCommentsByProductId(@PathVariable Long productId) {
List<CommentVO> commentVOs = commentService.listCommentsByProductId(productId);
return Result.success(commentVOs);
}
/**
* 根据父级评论ID查询回复
*
* @param parentCommentId 父级评论ID
* @return 评论VO列表
*/
@GetMapping("/list/parent/{parentCommentId}")
public Result<List<CommentVO>> listCommentsByParentCommentId(@PathVariable Long parentCommentId) {
List<CommentVO> commentVOs = commentService.listCommentsByParentCommentId(parentCommentId);
return Result.success(commentVOs);
}
}
@@ -0,0 +1,109 @@
package com.xiaowang.yuminailcore.controller;
import com.xiaowang.yuminailcore.common.Result;
import com.xiaowang.yuminailcore.dto.EffectDiagramDTO;
import com.xiaowang.yuminailcore.vo.EffectDiagramVO;
import com.xiaowang.yuminailcore.service.EffectDiagramService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 商品效果图信息表 Controller
* 对应数据库表 t_effect_diagram
*
* @author xiaowang
* @date 2026-02-13
*/
@RestController
@RequestMapping("/api/effect-diagram")
@RequiredArgsConstructor
public class EffectDiagramController {
private final EffectDiagramService effectDiagramService;
/**
* 创建效果图
*
* @param effectDiagramDTO 效果图DTO
* @return 效果图ID
*/
@PostMapping("/create")
public Result<Long> createEffectDiagram(@RequestBody EffectDiagramDTO effectDiagramDTO) {
Long id = effectDiagramService.createEffectDiagram(effectDiagramDTO);
return Result.success(id);
}
/**
* 更新效果图
*
* @param id 效果图ID
* @param effectDiagramDTO 效果图DTO
* @return 是否更新成功
*/
@PutMapping("/update/{id}")
public Result<Boolean> updateEffectDiagram(@PathVariable Long id, @RequestBody EffectDiagramDTO effectDiagramDTO) {
boolean success = effectDiagramService.updateEffectDiagram(id, effectDiagramDTO);
return Result.success(success);
}
/**
* 删除效果图
*
* @param id 效果图ID
* @return 是否删除成功
*/
@DeleteMapping("/delete/{id}")
public Result<Boolean> deleteEffectDiagram(@PathVariable Long id) {
boolean success = effectDiagramService.deleteEffectDiagram(id);
return Result.success(success);
}
/**
* 根据ID查询效果图
*
* @param id 效果图ID
* @return 效果图VO
*/
@GetMapping("/get/{id}")
public Result<EffectDiagramVO> getEffectDiagramById(@PathVariable Long id) {
EffectDiagramVO effectDiagramVO = effectDiagramService.getEffectDiagramById(id);
return Result.success(effectDiagramVO);
}
/**
* 查询所有效果图
*
* @return 效果图VO列表
*/
@GetMapping("/list/all")
public Result<List<EffectDiagramVO>> listAllEffectDiagrams() {
List<EffectDiagramVO> effectDiagramVOs = effectDiagramService.listAllEffectDiagrams();
return Result.success(effectDiagramVOs);
}
/**
* 根据商品ID查询效果图
*
* @param productId 商品ID
* @return 效果图VO列表
*/
@GetMapping("/list/product/{productId}")
public Result<List<EffectDiagramVO>> listEffectDiagramsByProductId(@PathVariable Long productId) {
List<EffectDiagramVO> effectDiagramVOs = effectDiagramService.listEffectDiagramsByProductId(productId);
return Result.success(effectDiagramVOs);
}
/**
* 根据类别查询效果图
*
* @param category 类别
* @return 效果图VO列表
*/
@GetMapping("/list/category/{category}")
public Result<List<EffectDiagramVO>> listEffectDiagramsByCategory(@PathVariable String category) {
List<EffectDiagramVO> effectDiagramVOs = effectDiagramService.listEffectDiagramsByCategory(category);
return Result.success(effectDiagramVOs);
}
}
@@ -0,0 +1,109 @@
package com.xiaowang.yuminailcore.controller;
import com.xiaowang.yuminailcore.common.Result;
import com.xiaowang.yuminailcore.dto.LoginIdentityDTO;
import com.xiaowang.yuminailcore.vo.LoginIdentityVO;
import com.xiaowang.yuminailcore.service.LoginIdentityService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 用户登录标识信息表 Controller
* 对应数据库表 t_login_identity
*
* @author xiaowang
* @date 2026-02-13
*/
@RestController
@RequestMapping("/api/login-identity")
@RequiredArgsConstructor
public class LoginIdentityController {
private final LoginIdentityService loginIdentityService;
/**
* 创建登录标识
*
* @param loginIdentityDTO 登录标识DTO
* @return 登录标识ID
*/
@PostMapping("/create")
public Result<Long> createLoginIdentity(@RequestBody LoginIdentityDTO loginIdentityDTO) {
Long id = loginIdentityService.createLoginIdentity(loginIdentityDTO);
return Result.success(id);
}
/**
* 更新登录标识
*
* @param id 登录标识ID
* @param loginIdentityDTO 登录标识DTO
* @return 是否更新成功
*/
@PutMapping("/update/{id}")
public Result<Boolean> updateLoginIdentity(@PathVariable Long id, @RequestBody LoginIdentityDTO loginIdentityDTO) {
boolean success = loginIdentityService.updateLoginIdentity(id, loginIdentityDTO);
return Result.success(success);
}
/**
* 删除登录标识
*
* @param id 登录标识ID
* @return 是否删除成功
*/
@DeleteMapping("/delete/{id}")
public Result<Boolean> deleteLoginIdentity(@PathVariable Long id) {
boolean success = loginIdentityService.deleteLoginIdentity(id);
return Result.success(success);
}
/**
* 根据ID查询登录标识
*
* @param id 登录标识ID
* @return 登录标识VO
*/
@GetMapping("/get/{id}")
public Result<LoginIdentityVO> getLoginIdentityById(@PathVariable Long id) {
LoginIdentityVO loginIdentityVO = loginIdentityService.getLoginIdentityById(id);
return Result.success(loginIdentityVO);
}
/**
* 查询所有登录标识
*
* @return 登录标识VO列表
*/
@GetMapping("/list/all")
public Result<List<LoginIdentityVO>> listAllLoginIdentities() {
List<LoginIdentityVO> loginIdentityVOs = loginIdentityService.listAllLoginIdentities();
return Result.success(loginIdentityVOs);
}
/**
* 根据用户ID查询登录标识
*
* @param userId 用户ID
* @return 登录标识VO列表
*/
@GetMapping("/list/user/{userId}")
public Result<List<LoginIdentityVO>> listLoginIdentitiesByUserId(@PathVariable Long userId) {
List<LoginIdentityVO> loginIdentityVOs = loginIdentityService.listLoginIdentitiesByUserId(userId);
return Result.success(loginIdentityVOs);
}
/**
* 根据登录方式查询登录标识
*
* @param loginMethod 登录方式
* @return 登录标识VO列表
*/
@GetMapping("/list/loginMethod/{loginMethod}")
public Result<List<LoginIdentityVO>> listLoginIdentitiesByLoginMethod(@PathVariable String loginMethod) {
List<LoginIdentityVO> loginIdentityVOs = loginIdentityService.listLoginIdentitiesByLoginMethod(loginMethod);
return Result.success(loginIdentityVOs);
}
}
@@ -0,0 +1,97 @@
package com.xiaowang.yuminailcore.controller;
import com.xiaowang.yuminailcore.common.Result;
import com.xiaowang.yuminailcore.dto.ObjectStorageFileDTO;
import com.xiaowang.yuminailcore.vo.ObjectStorageFileVO;
import com.xiaowang.yuminailcore.service.ObjectStorageFileService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 对象存储文件信息表 Controller
* 对应数据库表 t_object_storage_file
*
* @author xiaowang
* @date 2026-02-13
*/
@RestController
@RequestMapping("/api/object-storage-file")
@RequiredArgsConstructor
public class ObjectStorageFileController {
private final ObjectStorageFileService objectStorageFileService;
/**
* 创建文件
*
* @param objectStorageFileDTO 文件DTO
* @return 文件ID
*/
@PostMapping("/create")
public Result<Long> createObjectStorageFile(@RequestBody ObjectStorageFileDTO objectStorageFileDTO) {
Long id = objectStorageFileService.createObjectStorageFile(objectStorageFileDTO);
return Result.success(id);
}
/**
* 更新文件
*
* @param id 文件ID
* @param objectStorageFileDTO 文件DTO
* @return 是否更新成功
*/
@PutMapping("/update/{id}")
public Result<Boolean> updateObjectStorageFile(@PathVariable Long id, @RequestBody ObjectStorageFileDTO objectStorageFileDTO) {
boolean success = objectStorageFileService.updateObjectStorageFile(id, objectStorageFileDTO);
return Result.success(success);
}
/**
* 删除文件
*
* @param id 文件ID
* @return 是否删除成功
*/
@DeleteMapping("/delete/{id}")
public Result<Boolean> deleteObjectStorageFile(@PathVariable Long id) {
boolean success = objectStorageFileService.deleteObjectStorageFile(id);
return Result.success(success);
}
/**
* 根据ID查询文件
*
* @param id 文件ID
* @return 文件VO
*/
@GetMapping("/get/{id}")
public Result<ObjectStorageFileVO> getObjectStorageFileById(@PathVariable Long id) {
ObjectStorageFileVO objectStorageFileVO = objectStorageFileService.getObjectStorageFileById(id);
return Result.success(objectStorageFileVO);
}
/**
* 查询所有文件
*
* @return 文件VO列表
*/
@GetMapping("/list/all")
public Result<List<ObjectStorageFileVO>> listAllObjectStorageFiles() {
List<ObjectStorageFileVO> objectStorageFileVOs = objectStorageFileService.listAllObjectStorageFiles();
return Result.success(objectStorageFileVOs);
}
/**
* 根据状态查询文件
*
* @param status 文件状态
* @return 文件VO列表
*/
@GetMapping("/list/status/{status}")
public Result<List<ObjectStorageFileVO>> listObjectStorageFilesByStatus(@PathVariable Integer status) {
List<ObjectStorageFileVO> objectStorageFileVOs = objectStorageFileService.listObjectStorageFilesByStatus(status);
return Result.success(objectStorageFileVOs);
}
}
@@ -0,0 +1,109 @@
package com.xiaowang.yuminailcore.controller;
import com.xiaowang.yuminailcore.common.Result;
import com.xiaowang.yuminailcore.dto.ProductDTO;
import com.xiaowang.yuminailcore.vo.ProductVO;
import com.xiaowang.yuminailcore.service.ProductService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 商品信息表 Controller
* 对应数据库表 t_product
*
* @author xiaowang
* @date 2026-02-13
*/
@RestController
@RequestMapping("/api/product")
@RequiredArgsConstructor
public class ProductController {
private final ProductService productService;
/**
* 创建商品
*
* @param productDTO 商品DTO
* @return 商品ID
*/
@PostMapping("/create")
public Result<Long> createProduct(@RequestBody ProductDTO productDTO) {
Long id = productService.createProduct(productDTO);
return Result.success(id);
}
/**
* 更新商品
*
* @param id 商品ID
* @param productDTO 商品DTO
* @return 是否更新成功
*/
@PutMapping("/update/{id}")
public Result<Boolean> updateProduct(@PathVariable Long id, @RequestBody ProductDTO productDTO) {
boolean success = productService.updateProduct(id, productDTO);
return Result.success(success);
}
/**
* 删除商品
*
* @param id 商品ID
* @return 是否删除成功
*/
@DeleteMapping("/delete/{id}")
public Result<Boolean> deleteProduct(@PathVariable Long id) {
boolean success = productService.deleteProduct(id);
return Result.success(success);
}
/**
* 根据ID查询商品
*
* @param id 商品ID
* @return 商品VO
*/
@GetMapping("/get/{id}")
public Result<ProductVO> getProductById(@PathVariable Long id) {
ProductVO productVO = productService.getProductById(id);
return Result.success(productVO);
}
/**
* 查询所有商品
*
* @return 商品VO列表
*/
@GetMapping("/list/all")
public Result<List<ProductVO>> listAllProducts() {
List<ProductVO> productVOs = productService.listAllProducts();
return Result.success(productVOs);
}
/**
* 根据店铺ID查询商品
*
* @param shopId 店铺ID
* @return 商品VO列表
*/
@GetMapping("/list/shop/{shopId}")
public Result<List<ProductVO>> listProductsByShopId(@PathVariable Long shopId) {
List<ProductVO> productVOs = productService.listProductsByShopId(shopId);
return Result.success(productVOs);
}
/**
* 根据标签查询商品
*
* @param tag 标签
* @return 商品VO列表
*/
@GetMapping("/list/tag/{tag}")
public Result<List<ProductVO>> listProductsByTag(@PathVariable String tag) {
List<ProductVO> productVOs = productService.listProductsByTag(tag);
return Result.success(productVOs);
}
}
@@ -0,0 +1,97 @@
package com.xiaowang.yuminailcore.controller;
import com.xiaowang.yuminailcore.common.Result;
import com.xiaowang.yuminailcore.dto.ShopDTO;
import com.xiaowang.yuminailcore.vo.ShopVO;
import com.xiaowang.yuminailcore.service.ShopService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 店铺信息表 Controller
* 对应数据库表 t_shop
*
* @author xiaowang
* @date 2026-02-13
*/
@RestController
@RequestMapping("/api/shop")
@RequiredArgsConstructor
public class ShopController {
private final ShopService shopService;
/**
* 创建店铺
*
* @param shopDTO 店铺DTO
* @return 店铺ID
*/
@PostMapping("/create")
public Result<Long> createShop(@RequestBody ShopDTO shopDTO) {
Long id = shopService.createShop(shopDTO);
return Result.success(id);
}
/**
* 更新店铺
*
* @param id 店铺ID
* @param shopDTO 店铺DTO
* @return 是否更新成功
*/
@PutMapping("/update/{id}")
public Result<Boolean> updateShop(@PathVariable Long id, @RequestBody ShopDTO shopDTO) {
boolean success = shopService.updateShop(id, shopDTO);
return Result.success(success);
}
/**
* 删除店铺
*
* @param id 店铺ID
* @return 是否删除成功
*/
@DeleteMapping("/delete/{id}")
public Result<Boolean> deleteShop(@PathVariable Long id) {
boolean success = shopService.deleteShop(id);
return Result.success(success);
}
/**
* 根据ID查询店铺
*
* @param id 店铺ID
* @return 店铺VO
*/
@GetMapping("/get/{id}")
public Result<ShopVO> getShopById(@PathVariable Long id) {
ShopVO shopVO = shopService.getShopById(id);
return Result.success(shopVO);
}
/**
* 查询所有店铺
*
* @return 店铺VO列表
*/
@GetMapping("/list/all")
public Result<List<ShopVO>> listAllShops() {
List<ShopVO> shopVOs = shopService.listAllShops();
return Result.success(shopVOs);
}
/**
* 根据店铺名称查询店铺
*
* @param shopName 店铺名称
* @return 店铺VO列表
*/
@GetMapping("/list/shopName/{shopName}")
public Result<List<ShopVO>> listShopsByShopName(@PathVariable String shopName) {
List<ShopVO> shopVOs = shopService.listShopsByShopName(shopName);
return Result.success(shopVOs);
}
}
@@ -0,0 +1,97 @@
package com.xiaowang.yuminailcore.controller;
import com.xiaowang.yuminailcore.common.Result;
import com.xiaowang.yuminailcore.dto.TagDTO;
import com.xiaowang.yuminailcore.vo.TagVO;
import com.xiaowang.yuminailcore.service.TagService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 系统标签信息表 Controller
* 对应数据库表 t_tag
*
* @author xiaowang
* @date 2026-02-13
*/
@RestController
@RequestMapping("/api/tag")
@RequiredArgsConstructor
public class TagController {
private final TagService tagService;
/**
* 创建标签
*
* @param tagDTO 标签DTO
* @return 标签ID
*/
@PostMapping("/create")
public Result<Long> createTag(@RequestBody TagDTO tagDTO) {
Long id = tagService.createTag(tagDTO);
return Result.success(id);
}
/**
* 更新标签
*
* @param id 标签ID
* @param tagDTO 标签DTO
* @return 是否更新成功
*/
@PutMapping("/update/{id}")
public Result<Boolean> updateTag(@PathVariable Long id, @RequestBody TagDTO tagDTO) {
boolean success = tagService.updateTag(id, tagDTO);
return Result.success(success);
}
/**
* 删除标签
*
* @param id 标签ID
* @return 是否删除成功
*/
@DeleteMapping("/delete/{id}")
public Result<Boolean> deleteTag(@PathVariable Long id) {
boolean success = tagService.deleteTag(id);
return Result.success(success);
}
/**
* 根据ID查询标签
*
* @param id 标签ID
* @return 标签VO
*/
@GetMapping("/get/{id}")
public Result<TagVO> getTagById(@PathVariable Long id) {
TagVO tagVO = tagService.getTagById(id);
return Result.success(tagVO);
}
/**
* 查询所有标签
*
* @return 标签VO列表
*/
@GetMapping("/list/all")
public Result<List<TagVO>> listAllTags() {
List<TagVO> tagVOs = tagService.listAllTags();
return Result.success(tagVOs);
}
/**
* 根据标签名称查询标签
*
* @param tagName 标签名称
* @return 标签VO
*/
@GetMapping("/get/tagName/{tagName}")
public Result<TagVO> getTagByTagName(@PathVariable String tagName) {
TagVO tagVO = tagService.getTagByTagName(tagName);
return Result.success(tagVO);
}
}
@@ -0,0 +1,121 @@
package com.xiaowang.yuminailcore.controller;
import com.xiaowang.yuminailcore.common.Result;
import com.xiaowang.yuminailcore.dto.UserDTO;
import com.xiaowang.yuminailcore.vo.UserVO;
import com.xiaowang.yuminailcore.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 系统用户信息表 Controller
* 对应数据库表 t_user
*
* @author xiaowang
* @date 2026-02-13
*/
@RestController
@RequestMapping("/api/user")
@RequiredArgsConstructor
public class UserController {
private final UserService userService;
/**
* 创建用户
*
* @param userDTO 用户DTO
* @return 用户ID
*/
@PostMapping("/create")
public Result<Long> createUser(@RequestBody UserDTO userDTO) {
Long id = userService.createUser(userDTO);
return Result.success(id);
}
/**
* 更新用户
*
* @param id 用户ID
* @param userDTO 用户DTO
* @return 是否更新成功
*/
@PutMapping("/update/{id}")
public Result<Boolean> updateUser(@PathVariable Long id, @RequestBody UserDTO userDTO) {
boolean success = userService.updateUser(id, userDTO);
return Result.success(success);
}
/**
* 删除用户
*
* @param id 用户ID
* @return 是否删除成功
*/
@DeleteMapping("/delete/{id}")
public Result<Boolean> deleteUser(@PathVariable Long id) {
boolean success = userService.deleteUser(id);
return Result.success(success);
}
/**
* 根据ID查询用户
*
* @param id 用户ID
* @return 用户VO
*/
@GetMapping("/get/{id}")
public Result<UserVO> getUserById(@PathVariable Long id) {
UserVO userVO = userService.getUserById(id);
return Result.success(userVO);
}
/**
* 查询所有用户
*
* @return 用户VO列表
*/
@GetMapping("/list/all")
public Result<List<UserVO>> listAllUsers() {
List<UserVO> userVOs = userService.listAllUsers();
return Result.success(userVOs);
}
/**
* 根据店铺ID查询用户
*
* @param shopId 店铺ID
* @return 用户VO列表
*/
@GetMapping("/list/shop/{shopId}")
public Result<List<UserVO>> listUsersByShopId(@PathVariable Long shopId) {
List<UserVO> userVOs = userService.listUsersByShopId(shopId);
return Result.success(userVOs);
}
/**
* 根据用户类型查询用户
*
* @param type 用户类型
* @return 用户VO列表
*/
@GetMapping("/list/type/{type}")
public Result<List<UserVO>> listUsersByType(@PathVariable Integer type) {
List<UserVO> userVOs = userService.listUsersByType(type);
return Result.success(userVOs);
}
/**
* 根据账号查询用户
*
* @param account 账号
* @return 用户VO
*/
@GetMapping("/get/account/{account}")
public Result<UserVO> getUserByAccount(@PathVariable String account) {
UserVO userVO = userService.getUserByAccount(account);
return Result.success(userVO);
}
}
@@ -0,0 +1,97 @@
package com.xiaowang.yuminailcore.controller;
import com.xiaowang.yuminailcore.common.Result;
import com.xiaowang.yuminailcore.dto.VipBenefitDTO;
import com.xiaowang.yuminailcore.vo.VipBenefitVO;
import com.xiaowang.yuminailcore.service.VipBenefitService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* VIP权益信息表 Controller
* 对应数据库表 t_vip_benefit
*
* @author xiaowang
* @date 2026-02-13
*/
@RestController
@RequestMapping("/api/vip-benefit")
@RequiredArgsConstructor
public class VipBenefitController {
private final VipBenefitService vipBenefitService;
/**
* 创建VIP权益
*
* @param vipBenefitDTO VIP权益DTO
* @return VIP权益ID
*/
@PostMapping("/create")
public Result<Long> createVipBenefit(@RequestBody VipBenefitDTO vipBenefitDTO) {
Long id = vipBenefitService.createVipBenefit(vipBenefitDTO);
return Result.success(id);
}
/**
* 更新VIP权益
*
* @param id VIP权益ID
* @param vipBenefitDTO VIP权益DTO
* @return 是否更新成功
*/
@PutMapping("/update/{id}")
public Result<Boolean> updateVipBenefit(@PathVariable Long id, @RequestBody VipBenefitDTO vipBenefitDTO) {
boolean success = vipBenefitService.updateVipBenefit(id, vipBenefitDTO);
return Result.success(success);
}
/**
* 删除VIP权益
*
* @param id VIP权益ID
* @return 是否删除成功
*/
@DeleteMapping("/delete/{id}")
public Result<Boolean> deleteVipBenefit(@PathVariable Long id) {
boolean success = vipBenefitService.deleteVipBenefit(id);
return Result.success(success);
}
/**
* 根据ID查询VIP权益
*
* @param id VIP权益ID
* @return VIP权益VO
*/
@GetMapping("/get/{id}")
public Result<VipBenefitVO> getVipBenefitById(@PathVariable Long id) {
VipBenefitVO vipBenefitVO = vipBenefitService.getVipBenefitById(id);
return Result.success(vipBenefitVO);
}
/**
* 查询所有VIP权益
*
* @return VIP权益VO列表
*/
@GetMapping("/list/all")
public Result<List<VipBenefitVO>> listAllVipBenefits() {
List<VipBenefitVO> vipBenefitVOs = vipBenefitService.listAllVipBenefits();
return Result.success(vipBenefitVOs);
}
/**
* 根据所需VIP等级查询VIP权益
*
* @param requiredVipLevel 所需VIP等级
* @return VIP权益VO列表
*/
@GetMapping("/list/requiredVipLevel/{requiredVipLevel}")
public Result<List<VipBenefitVO>> listVipBenefitsByRequiredVipLevel(@PathVariable String requiredVipLevel) {
List<VipBenefitVO> vipBenefitVOs = vipBenefitService.listVipBenefitsByRequiredVipLevel(requiredVipLevel);
return Result.success(vipBenefitVOs);
}
}
@@ -0,0 +1,97 @@
package com.xiaowang.yuminailcore.controller;
import com.xiaowang.yuminailcore.common.Result;
import com.xiaowang.yuminailcore.dto.VipInfoDTO;
import com.xiaowang.yuminailcore.vo.VipInfoVO;
import com.xiaowang.yuminailcore.service.VipInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 用户VIP信息表 Controller
* 对应数据库表 t_vip_info
*
* @author xiaowang
* @date 2026-02-13
*/
@RestController
@RequestMapping("/api/vip-info")
@RequiredArgsConstructor
public class VipInfoController {
private final VipInfoService vipInfoService;
/**
* 创建VIP信息
*
* @param vipInfoDTO VIP信息DTO
* @return VIP信息ID
*/
@PostMapping("/create")
public Result<Long> createVipInfo(@RequestBody VipInfoDTO vipInfoDTO) {
Long id = vipInfoService.createVipInfo(vipInfoDTO);
return Result.success(id);
}
/**
* 更新VIP信息
*
* @param id VIP信息ID
* @param vipInfoDTO VIP信息DTO
* @return 是否更新成功
*/
@PutMapping("/update/{id}")
public Result<Boolean> updateVipInfo(@PathVariable Long id, @RequestBody VipInfoDTO vipInfoDTO) {
boolean success = vipInfoService.updateVipInfo(id, vipInfoDTO);
return Result.success(success);
}
/**
* 删除VIP信息
*
* @param id VIP信息ID
* @return 是否删除成功
*/
@DeleteMapping("/delete/{id}")
public Result<Boolean> deleteVipInfo(@PathVariable Long id) {
boolean success = vipInfoService.deleteVipInfo(id);
return Result.success(success);
}
/**
* 根据ID查询VIP信息
*
* @param id VIP信息ID
* @return VIP信息VO
*/
@GetMapping("/get/{id}")
public Result<VipInfoVO> getVipInfoById(@PathVariable Long id) {
VipInfoVO vipInfoVO = vipInfoService.getVipInfoById(id);
return Result.success(vipInfoVO);
}
/**
* 查询所有VIP信息
*
* @return VIP信息VO列表
*/
@GetMapping("/list/all")
public Result<List<VipInfoVO>> listAllVipInfos() {
List<VipInfoVO> vipInfoVOs = vipInfoService.listAllVipInfos();
return Result.success(vipInfoVOs);
}
/**
* 根据VIP等级查询VIP信息
*
* @param vipLevel VIP等级
* @return VIP信息VO列表
*/
@GetMapping("/list/vipLevel/{vipLevel}")
public Result<List<VipInfoVO>> listVipInfosByVipLevel(@PathVariable String vipLevel) {
List<VipInfoVO> vipInfoVOs = vipInfoService.listVipInfosByVipLevel(vipLevel);
return Result.success(vipInfoVOs);
}
}
@@ -0,0 +1,42 @@
package com.xiaowang.yuminailcore.dto;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 用户余额变动明细表 DTO
* 用于余额变动明细信息的传输
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
public class BalanceChangeDetailDTO {
/**
* 关联用户表主键
*/
private Long userId;
/**
* 本次变动金额(正数为增加,负数为减少)
*/
private BigDecimal amount;
/**
* 变动类型(如充值、消费、退款)
*/
private String type;
/**
* 变动后的当前余额
*/
private BigDecimal currentBalance;
/**
* 变动时间
*/
private LocalDateTime changeTime;
}
@@ -0,0 +1,26 @@
package com.xiaowang.yuminailcore.dto;
import lombok.Data;
import java.math.BigDecimal;
/**
* 用户余额信息表 DTO
* 用于余额信息的传输
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
public class BalanceDTO {
/**
* 关联用户表主键
*/
private Long userId;
/**
* 当前余额
*/
private BigDecimal amount;
}
@@ -0,0 +1,39 @@
package com.xiaowang.yuminailcore.dto;
import lombok.Data;
/**
* 用户评论信息表 DTO
* 用于评论信息的传输
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
public class CommentDTO {
/**
* 评论用户ID,关联用户表主键
*/
private Long userId;
/**
* 关联店铺表主键(0表示非店铺评论)
*/
private Long shopId;
/**
* 关联商品表主键(0表示非商品评论)
*/
private Long productId;
/**
* 评论内容
*/
private String commentContent;
/**
* 父级评论ID(0表示为根评论)
*/
private Long parentCommentId;
}
@@ -0,0 +1,51 @@
package com.xiaowang.yuminailcore.dto;
import lombok.Data;
import java.math.BigDecimal;
/**
* 商品效果图信息表 DTO
* 用于效果图信息的传输
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
public class EffectDiagramDTO {
/**
* 所属商品ID,关联商品表主键
*/
private Long productId;
/**
* 效果图类别
*/
private String category;
/**
* 图片文件ID集合,多ID以逗号分隔
*/
private String imageFileIds;
/**
* 效果图描述
*/
private String description;
/**
* 效果图对应服务价格
*/
private BigDecimal price;
/**
* 效果图对应服务耗时
*/
private String duration;
/**
* 效果图标签
*/
private String tag;
}
@@ -0,0 +1,41 @@
package com.xiaowang.yuminailcore.dto;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 用户登录标识信息表 DTO
* 用于登录标识信息的传输
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
public class LoginIdentityDTO {
/**
* 关联用户表主键
*/
private Long userId;
/**
* 登录方式(0-手机号、1-账号、2-邮箱)
*/
private String loginMethod;
/**
* 前端输入的具体值(如手机号、账号、邮箱)
*/
private String inputValue;
/**
* 输入时间
*/
private LocalDateTime inputTime;
/**
* 状态:1-有效,0-无效
*/
private Integer status;
}
@@ -0,0 +1,41 @@
package com.xiaowang.yuminailcore.dto;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 对象存储文件信息表 DTO
* 用于文件信息的传输
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
public class ObjectStorageFileDTO {
/**
* 文件名称
*/
private String fileName;
/**
* 文件访问链接
*/
private String fileUrl;
/**
* 文件状态:1-可用,0-不可用,2-回收站
*/
private Integer status;
/**
* 文件删除时间(NULL表示未删除)
*/
private LocalDateTime deleteTime;
/**
* 文件移入回收站时间(NULL表示未移入)
*/
private LocalDateTime recycleTime;
}
@@ -0,0 +1,61 @@
package com.xiaowang.yuminailcore.dto;
import lombok.Data;
import java.math.BigDecimal;
/**
* 商品信息表 DTO
* 用于商品信息的传输
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
public class ProductDTO {
/**
* 所属店铺ID,关联店铺表主键
*/
private Long shopId;
/**
* 商品标题
*/
private String title;
/**
* 商品描述
*/
private String description;
/**
* 图片文件ID集合,多个ID以逗号分隔
*/
private String imageFileIds;
/**
* 商品价格,保留2位小数
*/
private BigDecimal price;
/**
* 标签集合,多个标签以逗号分隔,最多5个
*/
private String tags;
/**
* 商品对应的服务大约耗时(如"30分钟")
*/
private String approximateDuration;
/**
* 可预约的美甲师ID集合,多个ID以逗号分隔
*/
private String bookableArtists;
/**
* 可用的优惠券ID集合,多个ID以逗号分隔
*/
private String availableCoupons;
}
@@ -0,0 +1,39 @@
package com.xiaowang.yuminailcore.dto;
import lombok.Data;
/**
* 店铺信息表 DTO
* 用于店铺信息的传输
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
public class ShopDTO {
/**
* 店铺名称
*/
private String shopName;
/**
* 店铺描述
*/
private String description;
/**
* 店铺地址
*/
private String address;
/**
* 店铺营业时间
*/
private String businessHours;
/**
* 店铺封面图文件ID
*/
private String coverImageFileId;
}
@@ -0,0 +1,34 @@
package com.xiaowang.yuminailcore.dto;
import lombok.Data;
/**
* 系统标签信息表 DTO
* 用于标签信息的传输
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
public class TagDTO {
/**
* 标签名称
*/
private String tagName;
/**
* 标签文字颜色(16进制)
*/
private String textColor;
/**
* 标签背景颜色(16进制)
*/
private String bgColor;
/**
* 标签边框颜色(16进制)
*/
private String borderColor;
}
@@ -0,0 +1,54 @@
package com.xiaowang.yuminailcore.dto;
import lombok.Data;
/**
* 系统用户信息表 DTO
* 用于用户信息的传输
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
public class UserDTO {
/**
* 所属店铺ID,关联店铺表主键(0表示无所属店铺)
*/
private Long shopId;
/**
* 用户昵称
*/
private String nickname;
/**
* 用户账号(登录用)
*/
private String account;
/**
* 用户密码(加密存储)
*/
private String password;
/**
* 用户签名
*/
private String signature;
/**
* 用户等级
*/
private String level;
/**
* 用户类型,(0-用户,2-店长,3-美甲师,4-管理员)
*/
private Integer type;
/**
* 关联VIP信息表主键(0表示非VIP)
*/
private Long vipId;
}
@@ -0,0 +1,24 @@
package com.xiaowang.yuminailcore.dto;
import lombok.Data;
/**
* VIP权益信息表 DTO
* 用于VIP权益信息的传输
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
public class VipBenefitDTO {
/**
* 权益详情(如折扣、专属服务)
*/
private String benefitInfo;
/**
* 所需VIP等级
*/
private String requiredVipLevel;
}
@@ -0,0 +1,41 @@
package com.xiaowang.yuminailcore.dto;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 用户VIP信息表 DTO
* 用于VIP信息的传输
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
public class VipInfoDTO {
/**
* VIP等级(如青铜、白银)
*/
private String vipLevel;
/**
* VIP开通时间
*/
private LocalDateTime startTime;
/**
* VIP到期时间
*/
private LocalDateTime expireTime;
/**
* VIP开通方式(如购买、赠送)
*/
private String activationMethod;
/**
* 关联VIP权益信息表主键
*/
private Long benefitId;
}
@@ -0,0 +1,52 @@
package com.xiaowang.yuminailcore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 用户余额变动明细表 DO
* 对应数据库表 t_balance_change_detail
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_balance_change_detail")
public class BalanceChangeDetailDO extends BaseEntity {
/**
* 关联用户表主键
*/
@TableField("user_id")
private Long userId;
/**
* 本次变动金额(正数为增加,负数为减少)
*/
@TableField("amount")
private BigDecimal amount;
/**
* 变动类型(如充值、消费、退款)
*/
@TableField("type")
private String type;
/**
* 变动后的当前余额
*/
@TableField("current_balance")
private BigDecimal currentBalance;
/**
* 变动时间
*/
@TableField("change_time")
private LocalDateTime changeTime;
}
@@ -0,0 +1,40 @@
package com.xiaowang.yuminailcore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 用户余额信息表 DO
* 对应数据库表 t_balance
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_balance")
public class BalanceDO extends BaseEntity {
/**
* 关联用户表主键
*/
@TableField("user_id")
private Long userId;
/**
* 当前余额
*/
@TableField("amount")
private BigDecimal amount;
/**
* 最近一次更新时间
*/
@TableField("last_update_time")
private LocalDateTime lastUpdateTime;
}
@@ -0,0 +1,61 @@
package com.xiaowang.yuminailcore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户评论信息表 DO
* 对应数据库表 t_comment
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_comment")
public class CommentDO extends BaseEntity {
/**
* 评论用户ID,关联用户表主键
*/
@TableField("user_id")
private Long userId;
/**
* 关联店铺表主键(0表示非店铺评论)
*/
@TableField("shop_id")
private Long shopId;
/**
* 关联商品表主键(0表示非商品评论)
*/
@TableField("product_id")
private Long productId;
/**
* 评论内容
*/
@TableField("comment_content")
private String commentContent;
/**
* 父级评论ID(0表示为根评论)
*/
@TableField("parent_comment_id")
private Long parentCommentId;
/**
* 评论点赞数
*/
@TableField("like_count")
private Integer likeCount;
/**
* 逻辑删除标识:0-未删除,1-已删除
*/
@TableField("is_delete")
private Integer isDelete;
}
@@ -0,0 +1,75 @@
package com.xiaowang.yuminailcore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 商品效果图信息表 DO
* 对应数据库表 t_effect_diagram
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_effect_diagram")
public class EffectDiagramDO extends BaseEntity {
/**
* 所属商品ID,关联商品表主键
*/
@TableField("product_id")
private Long productId;
/**
* 效果图类别
*/
@TableField("category")
private String category;
/**
* 图片文件ID集合,多ID以逗号分隔
*/
@TableField("image_file_ids")
private String imageFileIds;
/**
* 效果图描述
*/
@TableField("description")
private String description;
/**
* 效果图对应服务价格
*/
@TableField("price")
private BigDecimal price;
/**
* 效果图对应服务耗时
*/
@TableField("duration")
private String duration;
/**
* 效果图标签
*/
@TableField("tag")
private String tag;
/**
* 效果图点赞数
*/
@TableField("like_count")
private Integer likeCount;
/**
* 逻辑删除:0-未删,1-已删
*/
@TableField("is_delete")
private Integer isDelete;
}
@@ -0,0 +1,51 @@
package com.xiaowang.yuminailcore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 用户登录标识信息表 DO
* 对应数据库表 t_login_identity
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_login_identity")
public class LoginIdentityDO extends BaseEntity {
/**
* 关联用户表主键
*/
@TableField("user_id")
private Long userId;
/**
* 登录方式(0-手机号、1-账号、2-邮箱)
*/
@TableField("login_method")
private String loginMethod;
/**
* 前端输入的具体值(如手机号、账号、邮箱)
*/
@TableField("input_value")
private String inputValue;
/**
* 输入时间
*/
@TableField("input_time")
private LocalDateTime inputTime;
/**
* 状态:1-有效,0-无效
*/
@TableField("status")
private Integer status;
}
@@ -0,0 +1,51 @@
package com.xiaowang.yuminailcore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 对象存储文件信息表 DO
* 对应数据库表 t_object_storage_file
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_object_storage_file")
public class ObjectStorageFileDO extends BaseEntity {
/**
* 文件名称
*/
@TableField("file_name")
private String fileName;
/**
* 文件访问链接
*/
@TableField("file_url")
private String fileUrl;
/**
* 文件状态:1-可用,0-不可用,2-回收站
*/
@TableField("status")
private Integer status;
/**
* 文件删除时间(NULL表示未删除)
*/
@TableField("delete_time")
private LocalDateTime deleteTime;
/**
* 文件移入回收站时间(NULL表示未移入)
*/
@TableField("recycle_time")
private LocalDateTime recycleTime;
}
@@ -0,0 +1,93 @@
package com.xiaowang.yuminailcore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 商品信息表 DO
* 对应数据库表 t_product
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_product")
public class ProductDO extends BaseEntity {
/**
* 所属店铺ID,关联店铺表主键
*/
@TableField("shop_id")
private Long shopId;
/**
* 商品标题
*/
@TableField("title")
private String title;
/**
* 商品描述
*/
@TableField("description")
private String description;
/**
* 图片文件ID集合,多个ID以逗号分隔
*/
@TableField("image_file_ids")
private String imageFileIds;
/**
* 商品价格,保留2位小数
*/
@TableField("price")
private BigDecimal price;
/**
* 标签集合,多个标签以逗号分隔,最多5个
*/
@TableField("tags")
private String tags;
/**
* 商品点赞数
*/
@TableField("like_count")
private Integer likeCount;
/**
* 商品收藏数
*/
@TableField("collect_count")
private Integer collectCount;
/**
* 商品对应的服务大约耗时(如"30分钟")
*/
@TableField("approximate_duration")
private String approximateDuration;
/**
* 可预约的美甲师ID集合,多个ID以逗号分隔
*/
@TableField("bookable_artists")
private String bookableArtists;
/**
* 可用的优惠券ID集合,多个ID以逗号分隔
*/
@TableField("available_coupons")
private String availableCoupons;
/**
* 逻辑删除标识:0-未删除,1-已删除
*/
@TableField("is_delete")
private Integer isDelete;
}
@@ -0,0 +1,55 @@
package com.xiaowang.yuminailcore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 店铺信息表 DO
* 对应数据库表 t_shop
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_shop")
public class ShopDO extends BaseEntity {
/**
* 店铺名称
*/
@TableField("shop_name")
private String shopName;
/**
* 店铺描述
*/
@TableField("description")
private String description;
/**
* 店铺地址
*/
@TableField("address")
private String address;
/**
* 店铺营业时间
*/
@TableField("business_hours")
private String businessHours;
/**
* 店铺封面图文件ID
*/
@TableField("cover_image_file_id")
private String coverImageFileId;
/**
* 逻辑删除:0-未删,1-已删
*/
@TableField("is_delete")
private Integer isDelete;
}
@@ -0,0 +1,49 @@
package com.xiaowang.yuminailcore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 系统标签信息表 DO
* 对应数据库表 t_tag
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_tag")
public class TagDO extends BaseEntity {
/**
* 标签名称
*/
@TableField("tag_name")
private String tagName;
/**
* 标签文字颜色(16进制)
*/
@TableField("text_color")
private String textColor;
/**
* 标签背景颜色(16进制)
*/
@TableField("bg_color")
private String bgColor;
/**
* 标签边框颜色(16进制)
*/
@TableField("border_color")
private String borderColor;
/**
* 逻辑删除:0-未删,1-已删
*/
@TableField("is_delete")
private Integer isDelete;
}
@@ -0,0 +1,73 @@
package com.xiaowang.yuminailcore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 系统用户信息表 DO
* 对应数据库表 t_user
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_user")
public class UserDO extends BaseEntity {
/**
* 所属店铺ID,关联店铺表主键(0表示无所属店铺)
*/
@TableField("shop_id")
private Long shopId;
/**
* 用户昵称
*/
@TableField("nickname")
private String nickname;
/**
* 用户账号(登录用)
*/
@TableField("account")
private String account;
/**
* 用户密码(加密存储)
*/
@TableField("password")
private String password;
/**
* 用户签名
*/
@TableField("signature")
private String signature;
/**
* 用户等级
*/
@TableField("level")
private String level;
/**
* 用户类型,(0-用户,2-店长,3-美甲师,4-管理员)
*/
@TableField("type")
private Integer type;
/**
* 关联VIP信息表主键(0表示非VIP)
*/
@TableField("vip_id")
private Long vipId;
/**
* 逻辑删除:0-未删,1-已删
*/
@TableField("is_delete")
private Integer isDelete;
}
@@ -0,0 +1,31 @@
package com.xiaowang.yuminailcore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* VIP权益信息表 DO
* 对应数据库表 t_vip_benefit
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_vip_benefit")
public class VipBenefitDO extends BaseEntity {
/**
* 权益详情(如折扣、专属服务)
*/
@TableField("benefit_info")
private String benefitInfo;
/**
* 所需VIP等级
*/
@TableField("required_vip_level")
private String requiredVipLevel;
}
@@ -0,0 +1,51 @@
package com.xiaowang.yuminailcore.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 用户VIP信息表 DO
* 对应数据库表 t_vip_info
*
* @author xiaowang
* @date 2026-02-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_vip_info")
public class VipInfoDO extends BaseEntity {
/**
* VIP等级(如青铜、白银)
*/
@TableField("vip_level")
private String vipLevel;
/**
* VIP开通时间
*/
@TableField("start_time")
private LocalDateTime startTime;
/**
* VIP到期时间
*/
@TableField("expire_time")
private LocalDateTime expireTime;
/**
* VIP开通方式(如购买、赠送)
*/
@TableField("activation_method")
private String activationMethod;
/**
* 关联VIP权益信息表主键
*/
@TableField("benefit_id")
private Long benefitId;
}
@@ -0,0 +1,14 @@
package com.xiaowang.yuminailcore.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaowang.yuminailcore.entity.BalanceChangeDetailDO;
/**
* 用户余额变动明细表 Mapper
* 对应数据库表 t_balance_change_detail
*
* @author xiaowang
* @date 2026-02-13
*/
public interface BalanceChangeDetailMapper extends BaseMapper<BalanceChangeDetailDO> {
}
@@ -0,0 +1,14 @@
package com.xiaowang.yuminailcore.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaowang.yuminailcore.entity.BalanceDO;
/**
* 用户余额信息表 Mapper
* 对应数据库表 t_balance
*
* @author xiaowang
* @date 2026-02-13
*/
public interface BalanceMapper extends BaseMapper<BalanceDO> {
}
@@ -0,0 +1,14 @@
package com.xiaowang.yuminailcore.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaowang.yuminailcore.entity.CommentDO;
/**
* 用户评论信息表 Mapper
* 对应数据库表 t_comment
*
* @author xiaowang
* @date 2026-02-13
*/
public interface CommentMapper extends BaseMapper<CommentDO> {
}
@@ -0,0 +1,14 @@
package com.xiaowang.yuminailcore.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaowang.yuminailcore.entity.EffectDiagramDO;
/**
* 商品效果图信息表 Mapper
* 对应数据库表 t_effect_diagram
*
* @author xiaowang
* @date 2026-02-13
*/
public interface EffectDiagramMapper extends BaseMapper<EffectDiagramDO> {
}
@@ -0,0 +1,14 @@
package com.xiaowang.yuminailcore.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaowang.yuminailcore.entity.LoginIdentityDO;
/**
* 用户登录标识信息表 Mapper
* 对应数据库表 t_login_identity
*
* @author xiaowang
* @date 2026-02-13
*/
public interface LoginIdentityMapper extends BaseMapper<LoginIdentityDO> {
}
@@ -0,0 +1,14 @@
package com.xiaowang.yuminailcore.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaowang.yuminailcore.entity.ObjectStorageFileDO;
/**
* 对象存储文件信息表 Mapper
* 对应数据库表 t_object_storage_file
*
* @author xiaowang
* @date 2026-02-13
*/
public interface ObjectStorageFileMapper extends BaseMapper<ObjectStorageFileDO> {
}
@@ -0,0 +1,14 @@
package com.xiaowang.yuminailcore.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaowang.yuminailcore.entity.ProductDO;
/**
* 商品信息表 Mapper
* 对应数据库表 t_product
*
* @author xiaowang
* @date 2026-02-13
*/
public interface ProductMapper extends BaseMapper<ProductDO> {
}
@@ -0,0 +1,14 @@
package com.xiaowang.yuminailcore.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaowang.yuminailcore.entity.ShopDO;
/**
* 店铺信息表 Mapper
* 对应数据库表 t_shop
*
* @author xiaowang
* @date 2026-02-13
*/
public interface ShopMapper extends BaseMapper<ShopDO> {
}
@@ -0,0 +1,14 @@
package com.xiaowang.yuminailcore.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaowang.yuminailcore.entity.TagDO;
/**
* 系统标签信息表 Mapper
* 对应数据库表 t_tag
*
* @author xiaowang
* @date 2026-02-13
*/
public interface TagMapper extends BaseMapper<TagDO> {
}
@@ -0,0 +1,14 @@
package com.xiaowang.yuminailcore.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaowang.yuminailcore.entity.UserDO;
/**
* 系统用户信息表 Mapper
* 对应数据库表 t_user
*
* @author xiaowang
* @date 2026-02-13
*/
public interface UserMapper extends BaseMapper<UserDO> {
}
@@ -0,0 +1,14 @@
package com.xiaowang.yuminailcore.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaowang.yuminailcore.entity.VipBenefitDO;
/**
* VIP权益信息表 Mapper
* 对应数据库表 t_vip_benefit
*
* @author xiaowang
* @date 2026-02-13
*/
public interface VipBenefitMapper extends BaseMapper<VipBenefitDO> {
}
@@ -0,0 +1,14 @@
package com.xiaowang.yuminailcore.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaowang.yuminailcore.entity.VipInfoDO;
/**
* 用户VIP信息表 Mapper
* 对应数据库表 t_vip_info
*
* @author xiaowang
* @date 2026-02-13
*/
public interface VipInfoMapper extends BaseMapper<VipInfoDO> {
}
@@ -0,0 +1,66 @@
package com.xiaowang.yuminailcore.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaowang.yuminailcore.entity.BalanceChangeDetailDO;
import com.xiaowang.yuminailcore.dto.BalanceChangeDetailDTO;
import com.xiaowang.yuminailcore.vo.BalanceChangeDetailVO;
import java.util.List;
/**
* 用户余额变动明细表 Service
* 对应数据库表 t_balance_change_detail
*
* @author xiaowang
* @date 2026-02-13
*/
public interface BalanceChangeDetailService extends IService<BalanceChangeDetailDO> {
/**
* 创建余额变动明细
*
* @param balanceChangeDetailDTO 余额变动明细DTO
* @return 余额变动明细ID
*/
Long createBalanceChangeDetail(BalanceChangeDetailDTO balanceChangeDetailDTO);
/**
* 更新余额变动明细
*
* @param id 余额变动明细ID
* @param balanceChangeDetailDTO 余额变动明细DTO
* @return 是否更新成功
*/
boolean updateBalanceChangeDetail(Long id, BalanceChangeDetailDTO balanceChangeDetailDTO);
/**
* 删除余额变动明细
*
* @param id 余额变动明细ID
* @return 是否删除成功
*/
boolean deleteBalanceChangeDetail(Long id);
/**
* 根据ID查询余额变动明细
*
* @param id 余额变动明细ID
* @return 余额变动明细VO
*/
BalanceChangeDetailVO getBalanceChangeDetailById(Long id);
/**
* 查询所有余额变动明细
*
* @return 余额变动明细VO列表
*/
List<BalanceChangeDetailVO> listAllBalanceChangeDetails();
/**
* 根据用户ID查询余额变动明细
*
* @param userId 用户ID
* @return 余额变动明细VO列表
*/
List<BalanceChangeDetailVO> listBalanceChangeDetailsByUserId(Long userId);
}
@@ -0,0 +1,66 @@
package com.xiaowang.yuminailcore.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaowang.yuminailcore.entity.BalanceDO;
import com.xiaowang.yuminailcore.dto.BalanceDTO;
import com.xiaowang.yuminailcore.vo.BalanceVO;
import java.util.List;
/**
* 用户余额信息表 Service
* 对应数据库表 t_balance
*
* @author xiaowang
* @date 2026-02-13
*/
public interface BalanceService extends IService<BalanceDO> {
/**
* 创建余额
*
* @param balanceDTO 余额DTO
* @return 余额ID
*/
Long createBalance(BalanceDTO balanceDTO);
/**
* 更新余额
*
* @param id 余额ID
* @param balanceDTO 余额DTO
* @return 是否更新成功
*/
boolean updateBalance(Long id, BalanceDTO balanceDTO);
/**
* 删除余额
*
* @param id 余额ID
* @return 是否删除成功
*/
boolean deleteBalance(Long id);
/**
* 根据ID查询余额
*
* @param id 余额ID
* @return 余额VO
*/
BalanceVO getBalanceById(Long id);
/**
* 查询所有余额
*
* @return 余额VO列表
*/
List<BalanceVO> listAllBalances();
/**
* 根据用户ID查询余额
*
* @param userId 用户ID
* @return 余额VO
*/
BalanceVO getBalanceByUserId(Long userId);
}
@@ -0,0 +1,90 @@
package com.xiaowang.yuminailcore.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaowang.yuminailcore.entity.CommentDO;
import com.xiaowang.yuminailcore.dto.CommentDTO;
import com.xiaowang.yuminailcore.vo.CommentVO;
import java.util.List;
/**
* 用户评论信息表 Service
* 对应数据库表 t_comment
*
* @author xiaowang
* @date 2026-02-13
*/
public interface CommentService extends IService<CommentDO> {
/**
* 创建评论
*
* @param commentDTO 评论DTO
* @return 评论ID
*/
Long createComment(CommentDTO commentDTO);
/**
* 更新评论
*
* @param id 评论ID
* @param commentDTO 评论DTO
* @return 是否更新成功
*/
boolean updateComment(Long id, CommentDTO commentDTO);
/**
* 删除评论
*
* @param id 评论ID
* @return 是否删除成功
*/
boolean deleteComment(Long id);
/**
* 根据ID查询评论
*
* @param id 评论ID
* @return 评论VO
*/
CommentVO getCommentById(Long id);
/**
* 查询所有评论
*
* @return 评论VO列表
*/
List<CommentVO> listAllComments();
/**
* 根据用户ID查询评论
*
* @param userId 用户ID
* @return 评论VO列表
*/
List<CommentVO> listCommentsByUserId(Long userId);
/**
* 根据店铺ID查询评论
*
* @param shopId 店铺ID
* @return 评论VO列表
*/
List<CommentVO> listCommentsByShopId(Long shopId);
/**
* 根据商品ID查询评论
*
* @param productId 商品ID
* @return 评论VO列表
*/
List<CommentVO> listCommentsByProductId(Long productId);
/**
* 根据父级评论ID查询回复
*
* @param parentCommentId 父级评论ID
* @return 评论VO列表
*/
List<CommentVO> listCommentsByParentCommentId(Long parentCommentId);
}
@@ -0,0 +1,74 @@
package com.xiaowang.yuminailcore.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaowang.yuminailcore.entity.EffectDiagramDO;
import com.xiaowang.yuminailcore.dto.EffectDiagramDTO;
import com.xiaowang.yuminailcore.vo.EffectDiagramVO;
import java.util.List;
/**
* 商品效果图信息表 Service
* 对应数据库表 t_effect_diagram
*
* @author xiaowang
* @date 2026-02-13
*/
public interface EffectDiagramService extends IService<EffectDiagramDO> {
/**
* 创建效果图
*
* @param effectDiagramDTO 效果图DTO
* @return 效果图ID
*/
Long createEffectDiagram(EffectDiagramDTO effectDiagramDTO);
/**
* 更新效果图
*
* @param id 效果图ID
* @param effectDiagramDTO 效果图DTO
* @return 是否更新成功
*/
boolean updateEffectDiagram(Long id, EffectDiagramDTO effectDiagramDTO);
/**
* 删除效果图
*
* @param id 效果图ID
* @return 是否删除成功
*/
boolean deleteEffectDiagram(Long id);
/**
* 根据ID查询效果图
*
* @param id 效果图ID
* @return 效果图VO
*/
EffectDiagramVO getEffectDiagramById(Long id);
/**
* 查询所有效果图
*
* @return 效果图VO列表
*/
List<EffectDiagramVO> listAllEffectDiagrams();
/**
* 根据商品ID查询效果图
*
* @param productId 商品ID
* @return 效果图VO列表
*/
List<EffectDiagramVO> listEffectDiagramsByProductId(Long productId);
/**
* 根据类别查询效果图
*
* @param category 类别
* @return 效果图VO列表
*/
List<EffectDiagramVO> listEffectDiagramsByCategory(String category);
}
@@ -0,0 +1,74 @@
package com.xiaowang.yuminailcore.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaowang.yuminailcore.entity.LoginIdentityDO;
import com.xiaowang.yuminailcore.dto.LoginIdentityDTO;
import com.xiaowang.yuminailcore.vo.LoginIdentityVO;
import java.util.List;
/**
* 用户登录标识信息表 Service
* 对应数据库表 t_login_identity
*
* @author xiaowang
* @date 2026-02-13
*/
public interface LoginIdentityService extends IService<LoginIdentityDO> {
/**
* 创建登录标识
*
* @param loginIdentityDTO 登录标识DTO
* @return 登录标识ID
*/
Long createLoginIdentity(LoginIdentityDTO loginIdentityDTO);
/**
* 更新登录标识
*
* @param id 登录标识ID
* @param loginIdentityDTO 登录标识DTO
* @return 是否更新成功
*/
boolean updateLoginIdentity(Long id, LoginIdentityDTO loginIdentityDTO);
/**
* 删除登录标识
*
* @param id 登录标识ID
* @return 是否删除成功
*/
boolean deleteLoginIdentity(Long id);
/**
* 根据ID查询登录标识
*
* @param id 登录标识ID
* @return 登录标识VO
*/
LoginIdentityVO getLoginIdentityById(Long id);
/**
* 查询所有登录标识
*
* @return 登录标识VO列表
*/
List<LoginIdentityVO> listAllLoginIdentities();
/**
* 根据用户ID查询登录标识
*
* @param userId 用户ID
* @return 登录标识VO列表
*/
List<LoginIdentityVO> listLoginIdentitiesByUserId(Long userId);
/**
* 根据登录方式查询登录标识
*
* @param loginMethod 登录方式
* @return 登录标识VO列表
*/
List<LoginIdentityVO> listLoginIdentitiesByLoginMethod(String loginMethod);
}
@@ -0,0 +1,66 @@
package com.xiaowang.yuminailcore.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaowang.yuminailcore.entity.ObjectStorageFileDO;
import com.xiaowang.yuminailcore.dto.ObjectStorageFileDTO;
import com.xiaowang.yuminailcore.vo.ObjectStorageFileVO;
import java.util.List;
/**
* 对象存储文件信息表 Service
* 对应数据库表 t_object_storage_file
*
* @author xiaowang
* @date 2026-02-13
*/
public interface ObjectStorageFileService extends IService<ObjectStorageFileDO> {
/**
* 创建文件
*
* @param objectStorageFileDTO 文件DTO
* @return 文件ID
*/
Long createObjectStorageFile(ObjectStorageFileDTO objectStorageFileDTO);
/**
* 更新文件
*
* @param id 文件ID
* @param objectStorageFileDTO 文件DTO
* @return 是否更新成功
*/
boolean updateObjectStorageFile(Long id, ObjectStorageFileDTO objectStorageFileDTO);
/**
* 删除文件
*
* @param id 文件ID
* @return 是否删除成功
*/
boolean deleteObjectStorageFile(Long id);
/**
* 根据ID查询文件
*
* @param id 文件ID
* @return 文件VO
*/
ObjectStorageFileVO getObjectStorageFileById(Long id);
/**
* 查询所有文件
*
* @return 文件VO列表
*/
List<ObjectStorageFileVO> listAllObjectStorageFiles();
/**
* 根据状态查询文件
*
* @param status 文件状态
* @return 文件VO列表
*/
List<ObjectStorageFileVO> listObjectStorageFilesByStatus(Integer status);
}
@@ -0,0 +1,74 @@
package com.xiaowang.yuminailcore.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaowang.yuminailcore.entity.ProductDO;
import com.xiaowang.yuminailcore.dto.ProductDTO;
import com.xiaowang.yuminailcore.vo.ProductVO;
import java.util.List;
/**
* 商品信息表 Service
* 对应数据库表 t_product
*
* @author xiaowang
* @date 2026-02-13
*/
public interface ProductService extends IService<ProductDO> {
/**
* 创建商品
*
* @param productDTO 商品DTO
* @return 商品ID
*/
Long createProduct(ProductDTO productDTO);
/**
* 更新商品
*
* @param id 商品ID
* @param productDTO 商品DTO
* @return 是否更新成功
*/
boolean updateProduct(Long id, ProductDTO productDTO);
/**
* 删除商品
*
* @param id 商品ID
* @return 是否删除成功
*/
boolean deleteProduct(Long id);
/**
* 根据ID查询商品
*
* @param id 商品ID
* @return 商品VO
*/
ProductVO getProductById(Long id);
/**
* 查询所有商品
*
* @return 商品VO列表
*/
List<ProductVO> listAllProducts();
/**
* 根据店铺ID查询商品
*
* @param shopId 店铺ID
* @return 商品VO列表
*/
List<ProductVO> listProductsByShopId(Long shopId);
/**
* 根据标签查询商品
*
* @param tag 标签
* @return 商品VO列表
*/
List<ProductVO> listProductsByTag(String tag);
}
@@ -0,0 +1,66 @@
package com.xiaowang.yuminailcore.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaowang.yuminailcore.entity.ShopDO;
import com.xiaowang.yuminailcore.dto.ShopDTO;
import com.xiaowang.yuminailcore.vo.ShopVO;
import java.util.List;
/**
* 店铺信息表 Service
* 对应数据库表 t_shop
*
* @author xiaowang
* @date 2026-02-13
*/
public interface ShopService extends IService<ShopDO> {
/**
* 创建店铺
*
* @param shopDTO 店铺DTO
* @return 店铺ID
*/
Long createShop(ShopDTO shopDTO);
/**
* 更新店铺
*
* @param id 店铺ID
* @param shopDTO 店铺DTO
* @return 是否更新成功
*/
boolean updateShop(Long id, ShopDTO shopDTO);
/**
* 删除店铺
*
* @param id 店铺ID
* @return 是否删除成功
*/
boolean deleteShop(Long id);
/**
* 根据ID查询店铺
*
* @param id 店铺ID
* @return 店铺VO
*/
ShopVO getShopById(Long id);
/**
* 查询所有店铺
*
* @return 店铺VO列表
*/
List<ShopVO> listAllShops();
/**
* 根据店铺名称查询店铺
*
* @param shopName 店铺名称
* @return 店铺VO列表
*/
List<ShopVO> listShopsByShopName(String shopName);
}
@@ -0,0 +1,66 @@
package com.xiaowang.yuminailcore.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaowang.yuminailcore.entity.TagDO;
import com.xiaowang.yuminailcore.dto.TagDTO;
import com.xiaowang.yuminailcore.vo.TagVO;
import java.util.List;
/**
* 系统标签信息表 Service
* 对应数据库表 t_tag
*
* @author xiaowang
* @date 2026-02-13
*/
public interface TagService extends IService<TagDO> {
/**
* 创建标签
*
* @param tagDTO 标签DTO
* @return 标签ID
*/
Long createTag(TagDTO tagDTO);
/**
* 更新标签
*
* @param id 标签ID
* @param tagDTO 标签DTO
* @return 是否更新成功
*/
boolean updateTag(Long id, TagDTO tagDTO);
/**
* 删除标签
*
* @param id 标签ID
* @return 是否删除成功
*/
boolean deleteTag(Long id);
/**
* 根据ID查询标签
*
* @param id 标签ID
* @return 标签VO
*/
TagVO getTagById(Long id);
/**
* 查询所有标签
*
* @return 标签VO列表
*/
List<TagVO> listAllTags();
/**
* 根据标签名称查询标签
*
* @param tagName 标签名称
* @return 标签VO
*/
TagVO getTagByTagName(String tagName);
}
@@ -0,0 +1,82 @@
package com.xiaowang.yuminailcore.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaowang.yuminailcore.entity.UserDO;
import com.xiaowang.yuminailcore.dto.UserDTO;
import com.xiaowang.yuminailcore.vo.UserVO;
import java.util.List;
/**
* 系统用户信息表 Service
* 对应数据库表 t_user
*
* @author xiaowang
* @date 2026-02-13
*/
public interface UserService extends IService<UserDO> {
/**
* 创建用户
*
* @param userDTO 用户DTO
* @return 用户ID
*/
Long createUser(UserDTO userDTO);
/**
* 更新用户
*
* @param id 用户ID
* @param userDTO 用户DTO
* @return 是否更新成功
*/
boolean updateUser(Long id, UserDTO userDTO);
/**
* 删除用户
*
* @param id 用户ID
* @return 是否删除成功
*/
boolean deleteUser(Long id);
/**
* 根据ID查询用户
*
* @param id 用户ID
* @return 用户VO
*/
UserVO getUserById(Long id);
/**
* 查询所有用户
*
* @return 用户VO列表
*/
List<UserVO> listAllUsers();
/**
* 根据店铺ID查询用户
*
* @param shopId 店铺ID
* @return 用户VO列表
*/
List<UserVO> listUsersByShopId(Long shopId);
/**
* 根据用户类型查询用户
*
* @param type 用户类型
* @return 用户VO列表
*/
List<UserVO> listUsersByType(Integer type);
/**
* 根据账号查询用户
*
* @param account 账号
* @return 用户VO
*/
UserVO getUserByAccount(String account);
}
@@ -0,0 +1,66 @@
package com.xiaowang.yuminailcore.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaowang.yuminailcore.entity.VipBenefitDO;
import com.xiaowang.yuminailcore.dto.VipBenefitDTO;
import com.xiaowang.yuminailcore.vo.VipBenefitVO;
import java.util.List;
/**
* VIP权益信息表 Service
* 对应数据库表 t_vip_benefit
*
* @author xiaowang
* @date 2026-02-13
*/
public interface VipBenefitService extends IService<VipBenefitDO> {
/**
* 创建VIP权益
*
* @param vipBenefitDTO VIP权益DTO
* @return VIP权益ID
*/
Long createVipBenefit(VipBenefitDTO vipBenefitDTO);
/**
* 更新VIP权益
*
* @param id VIP权益ID
* @param vipBenefitDTO VIP权益DTO
* @return 是否更新成功
*/
boolean updateVipBenefit(Long id, VipBenefitDTO vipBenefitDTO);
/**
* 删除VIP权益
*
* @param id VIP权益ID
* @return 是否删除成功
*/
boolean deleteVipBenefit(Long id);
/**
* 根据ID查询VIP权益
*
* @param id VIP权益ID
* @return VIP权益VO
*/
VipBenefitVO getVipBenefitById(Long id);
/**
* 查询所有VIP权益
*
* @return VIP权益VO列表
*/
List<VipBenefitVO> listAllVipBenefits();
/**
* 根据所需VIP等级查询VIP权益
*
* @param requiredVipLevel 所需VIP等级
* @return VIP权益VO列表
*/
List<VipBenefitVO> listVipBenefitsByRequiredVipLevel(String requiredVipLevel);
}
@@ -0,0 +1,66 @@
package com.xiaowang.yuminailcore.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaowang.yuminailcore.entity.VipInfoDO;
import com.xiaowang.yuminailcore.dto.VipInfoDTO;
import com.xiaowang.yuminailcore.vo.VipInfoVO;
import java.util.List;
/**
* 用户VIP信息表 Service
* 对应数据库表 t_vip_info
*
* @author xiaowang
* @date 2026-02-13
*/
public interface VipInfoService extends IService<VipInfoDO> {
/**
* 创建VIP信息
*
* @param vipInfoDTO VIP信息DTO
* @return VIP信息ID
*/
Long createVipInfo(VipInfoDTO vipInfoDTO);
/**
* 更新VIP信息
*
* @param id VIP信息ID
* @param vipInfoDTO VIP信息DTO
* @return 是否更新成功
*/
boolean updateVipInfo(Long id, VipInfoDTO vipInfoDTO);
/**
* 删除VIP信息
*
* @param id VIP信息ID
* @return 是否删除成功
*/
boolean deleteVipInfo(Long id);
/**
* 根据ID查询VIP信息
*
* @param id VIP信息ID
* @return VIP信息VO
*/
VipInfoVO getVipInfoById(Long id);
/**
* 查询所有VIP信息
*
* @return VIP信息VO列表
*/
List<VipInfoVO> listAllVipInfos();
/**
* 根据VIP等级查询VIP信息
*
* @param vipLevel VIP等级
* @return VIP信息VO列表
*/
List<VipInfoVO> listVipInfosByVipLevel(String vipLevel);
}
@@ -0,0 +1,103 @@
package com.xiaowang.yuminailcore.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaowang.yuminailcore.entity.BalanceChangeDetailDO;
import com.xiaowang.yuminailcore.dto.BalanceChangeDetailDTO;
import com.xiaowang.yuminailcore.vo.BalanceChangeDetailVO;
import com.xiaowang.yuminailcore.mapper.BalanceChangeDetailMapper;
import com.xiaowang.yuminailcore.service.BalanceChangeDetailService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 用户余额变动明细表 Service 实现
* 对应数据库表 t_balance_change_detail
*
* @author xiaowang
* @date 2026-02-13
*/
@Service
@RequiredArgsConstructor
public class BalanceChangeDetailServiceImpl extends ServiceImpl<BalanceChangeDetailMapper, BalanceChangeDetailDO> implements BalanceChangeDetailService {
private final BalanceChangeDetailMapper balanceChangeDetailMapper;
@Override
public Long createBalanceChangeDetail(BalanceChangeDetailDTO balanceChangeDetailDTO) {
BalanceChangeDetailDO balanceChangeDetailDO = new BalanceChangeDetailDO();
balanceChangeDetailDO.setUserId(balanceChangeDetailDTO.getUserId());
balanceChangeDetailDO.setAmount(balanceChangeDetailDTO.getAmount());
balanceChangeDetailDO.setType(balanceChangeDetailDTO.getType());
balanceChangeDetailDO.setCurrentBalance(balanceChangeDetailDTO.getCurrentBalance());
balanceChangeDetailDO.setChangeTime(balanceChangeDetailDTO.getChangeTime());
balanceChangeDetailMapper.insert(balanceChangeDetailDO);
return balanceChangeDetailDO.getId();
}
@Override
public boolean updateBalanceChangeDetail(Long id, BalanceChangeDetailDTO balanceChangeDetailDTO) {
BalanceChangeDetailDO balanceChangeDetailDO = balanceChangeDetailMapper.selectById(id);
if (balanceChangeDetailDO == null) {
return false;
}
balanceChangeDetailDO.setUserId(balanceChangeDetailDTO.getUserId());
balanceChangeDetailDO.setAmount(balanceChangeDetailDTO.getAmount());
balanceChangeDetailDO.setType(balanceChangeDetailDTO.getType());
balanceChangeDetailDO.setCurrentBalance(balanceChangeDetailDTO.getCurrentBalance());
balanceChangeDetailDO.setChangeTime(balanceChangeDetailDTO.getChangeTime());
return balanceChangeDetailMapper.updateById(balanceChangeDetailDO) > 0;
}
@Override
public boolean deleteBalanceChangeDetail(Long id) {
return balanceChangeDetailMapper.deleteById(id) > 0;
}
@Override
public BalanceChangeDetailVO getBalanceChangeDetailById(Long id) {
BalanceChangeDetailDO balanceChangeDetailDO = balanceChangeDetailMapper.selectById(id);
if (balanceChangeDetailDO == null) {
return null;
}
return convertToVO(balanceChangeDetailDO);
}
@Override
public List<BalanceChangeDetailVO> listAllBalanceChangeDetails() {
List<BalanceChangeDetailDO> balanceChangeDetailDOs = balanceChangeDetailMapper.selectList(null);
return balanceChangeDetailDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<BalanceChangeDetailVO> listBalanceChangeDetailsByUserId(Long userId) {
List<BalanceChangeDetailDO> balanceChangeDetailDOs = balanceChangeDetailMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<BalanceChangeDetailDO>lambdaQuery()
.eq(BalanceChangeDetailDO::getUserId, userId)
);
return balanceChangeDetailDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
/**
* 将 DO 转换为 VO
*
* @param balanceChangeDetailDO 余额变动明细DO
* @return 余额变动明细VO
*/
private BalanceChangeDetailVO convertToVO(BalanceChangeDetailDO balanceChangeDetailDO) {
BalanceChangeDetailVO balanceChangeDetailVO = new BalanceChangeDetailVO();
balanceChangeDetailVO.setId(balanceChangeDetailDO.getId());
balanceChangeDetailVO.setUserId(balanceChangeDetailDO.getUserId());
balanceChangeDetailVO.setAmount(balanceChangeDetailDO.getAmount());
balanceChangeDetailVO.setType(balanceChangeDetailDO.getType());
balanceChangeDetailVO.setCurrentBalance(balanceChangeDetailDO.getCurrentBalance());
balanceChangeDetailVO.setChangeTime(balanceChangeDetailDO.getChangeTime());
return balanceChangeDetailVO;
}
}
@@ -0,0 +1,100 @@
package com.xiaowang.yuminailcore.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaowang.yuminailcore.entity.BalanceDO;
import com.xiaowang.yuminailcore.dto.BalanceDTO;
import com.xiaowang.yuminailcore.vo.BalanceVO;
import com.xiaowang.yuminailcore.mapper.BalanceMapper;
import com.xiaowang.yuminailcore.service.BalanceService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;
/**
* 用户余额信息表 Service 实现
* 对应数据库表 t_balance
*
* @author xiaowang
* @date 2026-02-13
*/
@Service
@RequiredArgsConstructor
public class BalanceServiceImpl extends ServiceImpl<BalanceMapper, BalanceDO> implements BalanceService {
private final BalanceMapper balanceMapper;
@Override
public Long createBalance(BalanceDTO balanceDTO) {
BalanceDO balanceDO = new BalanceDO();
balanceDO.setUserId(balanceDTO.getUserId());
balanceDO.setAmount(balanceDTO.getAmount());
balanceDO.setLastUpdateTime(LocalDateTime.now());
balanceMapper.insert(balanceDO);
return balanceDO.getId();
}
@Override
public boolean updateBalance(Long id, BalanceDTO balanceDTO) {
BalanceDO balanceDO = balanceMapper.selectById(id);
if (balanceDO == null) {
return false;
}
balanceDO.setUserId(balanceDTO.getUserId());
balanceDO.setAmount(balanceDTO.getAmount());
balanceDO.setLastUpdateTime(LocalDateTime.now());
return balanceMapper.updateById(balanceDO) > 0;
}
@Override
public boolean deleteBalance(Long id) {
return balanceMapper.deleteById(id) > 0;
}
@Override
public BalanceVO getBalanceById(Long id) {
BalanceDO balanceDO = balanceMapper.selectById(id);
if (balanceDO == null) {
return null;
}
return convertToVO(balanceDO);
}
@Override
public List<BalanceVO> listAllBalances() {
List<BalanceDO> balanceDOs = balanceMapper.selectList(null);
return balanceDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public BalanceVO getBalanceByUserId(Long userId) {
BalanceDO balanceDO = balanceMapper.selectOne(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<BalanceDO>lambdaQuery()
.eq(BalanceDO::getUserId, userId)
);
if (balanceDO == null) {
return null;
}
return convertToVO(balanceDO);
}
/**
* 将 DO 转换为 VO
*
* @param balanceDO 余额DO
* @return 余额VO
*/
private BalanceVO convertToVO(BalanceDO balanceDO) {
BalanceVO balanceVO = new BalanceVO();
balanceVO.setId(balanceDO.getId());
balanceVO.setUserId(balanceDO.getUserId());
balanceVO.setAmount(balanceDO.getAmount());
balanceVO.setCreateTime(balanceDO.getCreateTime());
balanceVO.setLastUpdateTime(balanceDO.getLastUpdateTime());
return balanceVO;
}
}
@@ -0,0 +1,145 @@
package com.xiaowang.yuminailcore.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaowang.yuminailcore.entity.CommentDO;
import com.xiaowang.yuminailcore.dto.CommentDTO;
import com.xiaowang.yuminailcore.vo.CommentVO;
import com.xiaowang.yuminailcore.mapper.CommentMapper;
import com.xiaowang.yuminailcore.service.CommentService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 用户评论信息表 Service 实现
* 对应数据库表 t_comment
*
* @author xiaowang
* @date 2026-02-13
*/
@Service
@RequiredArgsConstructor
public class CommentServiceImpl extends ServiceImpl<CommentMapper, CommentDO> implements CommentService {
private final CommentMapper commentMapper;
@Override
public Long createComment(CommentDTO commentDTO) {
CommentDO commentDO = new CommentDO();
commentDO.setUserId(commentDTO.getUserId());
commentDO.setShopId(commentDTO.getShopId());
commentDO.setProductId(commentDTO.getProductId());
commentDO.setCommentContent(commentDTO.getCommentContent());
commentDO.setParentCommentId(commentDTO.getParentCommentId());
commentDO.setIsDelete(0);
commentMapper.insert(commentDO);
return commentDO.getId();
}
@Override
public boolean updateComment(Long id, CommentDTO commentDTO) {
CommentDO commentDO = commentMapper.selectById(id);
if (commentDO == null) {
return false;
}
commentDO.setUserId(commentDTO.getUserId());
commentDO.setShopId(commentDTO.getShopId());
commentDO.setProductId(commentDTO.getProductId());
commentDO.setCommentContent(commentDTO.getCommentContent());
commentDO.setParentCommentId(commentDTO.getParentCommentId());
return commentMapper.updateById(commentDO) > 0;
}
@Override
public boolean deleteComment(Long id) {
CommentDO commentDO = commentMapper.selectById(id);
if (commentDO == null) {
return false;
}
commentDO.setIsDelete(1);
return commentMapper.updateById(commentDO) > 0;
}
@Override
public CommentVO getCommentById(Long id) {
CommentDO commentDO = commentMapper.selectById(id);
if (commentDO == null) {
return null;
}
return convertToVO(commentDO);
}
@Override
public List<CommentVO> listAllComments() {
List<CommentDO> commentDOs = commentMapper.selectList(null);
return commentDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<CommentVO> listCommentsByUserId(Long userId) {
List<CommentDO> commentDOs = commentMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<CommentDO>lambdaQuery()
.eq(CommentDO::getUserId, userId)
);
return commentDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<CommentVO> listCommentsByShopId(Long shopId) {
List<CommentDO> commentDOs = commentMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<CommentDO>lambdaQuery()
.eq(CommentDO::getShopId, shopId)
);
return commentDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<CommentVO> listCommentsByProductId(Long productId) {
List<CommentDO> commentDOs = commentMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<CommentDO>lambdaQuery()
.eq(CommentDO::getProductId, productId)
);
return commentDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<CommentVO> listCommentsByParentCommentId(Long parentCommentId) {
List<CommentDO> commentDOs = commentMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<CommentDO>lambdaQuery()
.eq(CommentDO::getParentCommentId, parentCommentId)
);
return commentDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
/**
* 将 DO 转换为 VO
*
* @param commentDO 评论DO
* @return 评论VO
*/
private CommentVO convertToVO(CommentDO commentDO) {
CommentVO commentVO = new CommentVO();
commentVO.setId(commentDO.getId());
commentVO.setUserId(commentDO.getUserId());
commentVO.setShopId(commentDO.getShopId());
commentVO.setProductId(commentDO.getProductId());
commentVO.setCommentContent(commentDO.getCommentContent());
commentVO.setParentCommentId(commentDO.getParentCommentId());
commentVO.setLikeCount(commentDO.getLikeCount());
commentVO.setCreateTime(commentDO.getCreateTime());
commentVO.setUpdateTime(commentDO.getUpdateTime());
return commentVO;
}
}
@@ -0,0 +1,129 @@
package com.xiaowang.yuminailcore.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaowang.yuminailcore.entity.EffectDiagramDO;
import com.xiaowang.yuminailcore.dto.EffectDiagramDTO;
import com.xiaowang.yuminailcore.vo.EffectDiagramVO;
import com.xiaowang.yuminailcore.mapper.EffectDiagramMapper;
import com.xiaowang.yuminailcore.service.EffectDiagramService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 商品效果图信息表 Service 实现
* 对应数据库表 t_effect_diagram
*
* @author xiaowang
* @date 2026-02-13
*/
@Service
@RequiredArgsConstructor
public class EffectDiagramServiceImpl extends ServiceImpl<EffectDiagramMapper, EffectDiagramDO> implements EffectDiagramService {
private final EffectDiagramMapper effectDiagramMapper;
@Override
public Long createEffectDiagram(EffectDiagramDTO effectDiagramDTO) {
EffectDiagramDO effectDiagramDO = new EffectDiagramDO();
effectDiagramDO.setProductId(effectDiagramDTO.getProductId());
effectDiagramDO.setCategory(effectDiagramDTO.getCategory());
effectDiagramDO.setImageFileIds(effectDiagramDTO.getImageFileIds());
effectDiagramDO.setDescription(effectDiagramDTO.getDescription());
effectDiagramDO.setPrice(effectDiagramDTO.getPrice());
effectDiagramDO.setDuration(effectDiagramDTO.getDuration());
effectDiagramDO.setTag(effectDiagramDTO.getTag());
effectDiagramDO.setIsDelete(0);
effectDiagramMapper.insert(effectDiagramDO);
return effectDiagramDO.getId();
}
@Override
public boolean updateEffectDiagram(Long id, EffectDiagramDTO effectDiagramDTO) {
EffectDiagramDO effectDiagramDO = effectDiagramMapper.selectById(id);
if (effectDiagramDO == null) {
return false;
}
effectDiagramDO.setProductId(effectDiagramDTO.getProductId());
effectDiagramDO.setCategory(effectDiagramDTO.getCategory());
effectDiagramDO.setImageFileIds(effectDiagramDTO.getImageFileIds());
effectDiagramDO.setDescription(effectDiagramDTO.getDescription());
effectDiagramDO.setPrice(effectDiagramDTO.getPrice());
effectDiagramDO.setDuration(effectDiagramDTO.getDuration());
effectDiagramDO.setTag(effectDiagramDTO.getTag());
return effectDiagramMapper.updateById(effectDiagramDO) > 0;
}
@Override
public boolean deleteEffectDiagram(Long id) {
EffectDiagramDO effectDiagramDO = effectDiagramMapper.selectById(id);
if (effectDiagramDO == null) {
return false;
}
effectDiagramDO.setIsDelete(1);
return effectDiagramMapper.updateById(effectDiagramDO) > 0;
}
@Override
public EffectDiagramVO getEffectDiagramById(Long id) {
EffectDiagramDO effectDiagramDO = effectDiagramMapper.selectById(id);
if (effectDiagramDO == null) {
return null;
}
return convertToVO(effectDiagramDO);
}
@Override
public List<EffectDiagramVO> listAllEffectDiagrams() {
List<EffectDiagramDO> effectDiagramDOs = effectDiagramMapper.selectList(null);
return effectDiagramDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<EffectDiagramVO> listEffectDiagramsByProductId(Long productId) {
List<EffectDiagramDO> effectDiagramDOs = effectDiagramMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<EffectDiagramDO>lambdaQuery()
.eq(EffectDiagramDO::getProductId, productId)
);
return effectDiagramDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<EffectDiagramVO> listEffectDiagramsByCategory(String category) {
List<EffectDiagramDO> effectDiagramDOs = effectDiagramMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<EffectDiagramDO>lambdaQuery()
.eq(EffectDiagramDO::getCategory, category)
);
return effectDiagramDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
/**
* 将 DO 转换为 VO
*
* @param effectDiagramDO 效果图DO
* @return 效果图VO
*/
private EffectDiagramVO convertToVO(EffectDiagramDO effectDiagramDO) {
EffectDiagramVO effectDiagramVO = new EffectDiagramVO();
effectDiagramVO.setId(effectDiagramDO.getId());
effectDiagramVO.setProductId(effectDiagramDO.getProductId());
effectDiagramVO.setCategory(effectDiagramDO.getCategory());
effectDiagramVO.setImageFileIds(effectDiagramDO.getImageFileIds());
effectDiagramVO.setDescription(effectDiagramDO.getDescription());
effectDiagramVO.setPrice(effectDiagramDO.getPrice());
effectDiagramVO.setDuration(effectDiagramDO.getDuration());
effectDiagramVO.setTag(effectDiagramDO.getTag());
effectDiagramVO.setLikeCount(effectDiagramDO.getLikeCount());
effectDiagramVO.setCreateTime(effectDiagramDO.getCreateTime());
effectDiagramVO.setUpdateTime(effectDiagramDO.getUpdateTime());
return effectDiagramVO;
}
}
@@ -0,0 +1,115 @@
package com.xiaowang.yuminailcore.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaowang.yuminailcore.entity.LoginIdentityDO;
import com.xiaowang.yuminailcore.dto.LoginIdentityDTO;
import com.xiaowang.yuminailcore.vo.LoginIdentityVO;
import com.xiaowang.yuminailcore.mapper.LoginIdentityMapper;
import com.xiaowang.yuminailcore.service.LoginIdentityService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 用户登录标识信息表 Service 实现
* 对应数据库表 t_login_identity
*
* @author xiaowang
* @date 2026-02-13
*/
@Service
@RequiredArgsConstructor
public class LoginIdentityServiceImpl extends ServiceImpl<LoginIdentityMapper, LoginIdentityDO> implements LoginIdentityService {
private final LoginIdentityMapper loginIdentityMapper;
@Override
public Long createLoginIdentity(LoginIdentityDTO loginIdentityDTO) {
LoginIdentityDO loginIdentityDO = new LoginIdentityDO();
loginIdentityDO.setUserId(loginIdentityDTO.getUserId());
loginIdentityDO.setLoginMethod(loginIdentityDTO.getLoginMethod());
loginIdentityDO.setInputValue(loginIdentityDTO.getInputValue());
loginIdentityDO.setInputTime(loginIdentityDTO.getInputTime());
loginIdentityDO.setStatus(loginIdentityDTO.getStatus());
loginIdentityMapper.insert(loginIdentityDO);
return loginIdentityDO.getId();
}
@Override
public boolean updateLoginIdentity(Long id, LoginIdentityDTO loginIdentityDTO) {
LoginIdentityDO loginIdentityDO = loginIdentityMapper.selectById(id);
if (loginIdentityDO == null) {
return false;
}
loginIdentityDO.setUserId(loginIdentityDTO.getUserId());
loginIdentityDO.setLoginMethod(loginIdentityDTO.getLoginMethod());
loginIdentityDO.setInputValue(loginIdentityDTO.getInputValue());
loginIdentityDO.setInputTime(loginIdentityDTO.getInputTime());
loginIdentityDO.setStatus(loginIdentityDTO.getStatus());
return loginIdentityMapper.updateById(loginIdentityDO) > 0;
}
@Override
public boolean deleteLoginIdentity(Long id) {
return loginIdentityMapper.deleteById(id) > 0;
}
@Override
public LoginIdentityVO getLoginIdentityById(Long id) {
LoginIdentityDO loginIdentityDO = loginIdentityMapper.selectById(id);
if (loginIdentityDO == null) {
return null;
}
return convertToVO(loginIdentityDO);
}
@Override
public List<LoginIdentityVO> listAllLoginIdentities() {
List<LoginIdentityDO> loginIdentityDOs = loginIdentityMapper.selectList(null);
return loginIdentityDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<LoginIdentityVO> listLoginIdentitiesByUserId(Long userId) {
List<LoginIdentityDO> loginIdentityDOs = loginIdentityMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<LoginIdentityDO>lambdaQuery()
.eq(LoginIdentityDO::getUserId, userId)
);
return loginIdentityDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<LoginIdentityVO> listLoginIdentitiesByLoginMethod(String loginMethod) {
List<LoginIdentityDO> loginIdentityDOs = loginIdentityMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<LoginIdentityDO>lambdaQuery()
.eq(LoginIdentityDO::getLoginMethod, loginMethod)
);
return loginIdentityDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
/**
* 将 DO 转换为 VO
*
* @param loginIdentityDO 登录标识DO
* @return 登录标识VO
*/
private LoginIdentityVO convertToVO(LoginIdentityDO loginIdentityDO) {
LoginIdentityVO loginIdentityVO = new LoginIdentityVO();
loginIdentityVO.setId(loginIdentityDO.getId());
loginIdentityVO.setUserId(loginIdentityDO.getUserId());
loginIdentityVO.setLoginMethod(loginIdentityDO.getLoginMethod());
loginIdentityVO.setInputValue(loginIdentityDO.getInputValue());
loginIdentityVO.setInputTime(loginIdentityDO.getInputTime());
loginIdentityVO.setUpdateTime(loginIdentityDO.getUpdateTime());
loginIdentityVO.setStatus(loginIdentityDO.getStatus());
return loginIdentityVO;
}
}
@@ -0,0 +1,104 @@
package com.xiaowang.yuminailcore.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaowang.yuminailcore.entity.ObjectStorageFileDO;
import com.xiaowang.yuminailcore.dto.ObjectStorageFileDTO;
import com.xiaowang.yuminailcore.vo.ObjectStorageFileVO;
import com.xiaowang.yuminailcore.mapper.ObjectStorageFileMapper;
import com.xiaowang.yuminailcore.service.ObjectStorageFileService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 对象存储文件信息表 Service 实现
* 对应数据库表 t_object_storage_file
*
* @author xiaowang
* @date 2026-02-13
*/
@Service
@RequiredArgsConstructor
public class ObjectStorageFileServiceImpl extends ServiceImpl<ObjectStorageFileMapper, ObjectStorageFileDO> implements ObjectStorageFileService {
private final ObjectStorageFileMapper objectStorageFileMapper;
@Override
public Long createObjectStorageFile(ObjectStorageFileDTO objectStorageFileDTO) {
ObjectStorageFileDO objectStorageFileDO = new ObjectStorageFileDO();
objectStorageFileDO.setFileName(objectStorageFileDTO.getFileName());
objectStorageFileDO.setFileUrl(objectStorageFileDTO.getFileUrl());
objectStorageFileDO.setStatus(objectStorageFileDTO.getStatus());
objectStorageFileDO.setDeleteTime(objectStorageFileDTO.getDeleteTime());
objectStorageFileDO.setRecycleTime(objectStorageFileDTO.getRecycleTime());
objectStorageFileMapper.insert(objectStorageFileDO);
return objectStorageFileDO.getId();
}
@Override
public boolean updateObjectStorageFile(Long id, ObjectStorageFileDTO objectStorageFileDTO) {
ObjectStorageFileDO objectStorageFileDO = objectStorageFileMapper.selectById(id);
if (objectStorageFileDO == null) {
return false;
}
objectStorageFileDO.setFileName(objectStorageFileDTO.getFileName());
objectStorageFileDO.setFileUrl(objectStorageFileDTO.getFileUrl());
objectStorageFileDO.setStatus(objectStorageFileDTO.getStatus());
objectStorageFileDO.setDeleteTime(objectStorageFileDTO.getDeleteTime());
objectStorageFileDO.setRecycleTime(objectStorageFileDTO.getRecycleTime());
return objectStorageFileMapper.updateById(objectStorageFileDO) > 0;
}
@Override
public boolean deleteObjectStorageFile(Long id) {
return objectStorageFileMapper.deleteById(id) > 0;
}
@Override
public ObjectStorageFileVO getObjectStorageFileById(Long id) {
ObjectStorageFileDO objectStorageFileDO = objectStorageFileMapper.selectById(id);
if (objectStorageFileDO == null) {
return null;
}
return convertToVO(objectStorageFileDO);
}
@Override
public List<ObjectStorageFileVO> listAllObjectStorageFiles() {
List<ObjectStorageFileDO> objectStorageFileDOs = objectStorageFileMapper.selectList(null);
return objectStorageFileDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<ObjectStorageFileVO> listObjectStorageFilesByStatus(Integer status) {
List<ObjectStorageFileDO> objectStorageFileDOs = objectStorageFileMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<ObjectStorageFileDO>lambdaQuery()
.eq(ObjectStorageFileDO::getStatus, status)
);
return objectStorageFileDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
/**
* 将 DO 转换为 VO
*
* @param objectStorageFileDO 文件DO
* @return 文件VO
*/
private ObjectStorageFileVO convertToVO(ObjectStorageFileDO objectStorageFileDO) {
ObjectStorageFileVO objectStorageFileVO = new ObjectStorageFileVO();
objectStorageFileVO.setId(objectStorageFileDO.getId());
objectStorageFileVO.setFileName(objectStorageFileDO.getFileName());
objectStorageFileVO.setFileUrl(objectStorageFileDO.getFileUrl());
objectStorageFileVO.setCreateTime(objectStorageFileDO.getCreateTime());
objectStorageFileVO.setStatus(objectStorageFileDO.getStatus());
objectStorageFileVO.setDeleteTime(objectStorageFileDO.getDeleteTime());
objectStorageFileVO.setRecycleTime(objectStorageFileDO.getRecycleTime());
return objectStorageFileVO;
}
}
@@ -0,0 +1,136 @@
package com.xiaowang.yuminailcore.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaowang.yuminailcore.entity.ProductDO;
import com.xiaowang.yuminailcore.dto.ProductDTO;
import com.xiaowang.yuminailcore.vo.ProductVO;
import com.xiaowang.yuminailcore.mapper.ProductMapper;
import com.xiaowang.yuminailcore.service.ProductService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 商品信息表 Service 实现
* 对应数据库表 t_product
*
* @author xiaowang
* @date 2026-02-13
*/
@Service
@RequiredArgsConstructor
public class ProductServiceImpl extends ServiceImpl<ProductMapper, ProductDO> implements ProductService {
private final ProductMapper productMapper;
@Override
public Long createProduct(ProductDTO productDTO) {
ProductDO productDO = new ProductDO();
productDO.setShopId(productDTO.getShopId());
productDO.setTitle(productDTO.getTitle());
productDO.setDescription(productDTO.getDescription());
productDO.setImageFileIds(productDTO.getImageFileIds());
productDO.setPrice(productDTO.getPrice());
productDO.setTags(productDTO.getTags());
productDO.setApproximateDuration(productDTO.getApproximateDuration());
productDO.setBookableArtists(productDTO.getBookableArtists());
productDO.setAvailableCoupons(productDTO.getAvailableCoupons());
productDO.setIsDelete(0);
productMapper.insert(productDO);
return productDO.getId();
}
@Override
public boolean updateProduct(Long id, ProductDTO productDTO) {
ProductDO productDO = productMapper.selectById(id);
if (productDO == null) {
return false;
}
productDO.setShopId(productDTO.getShopId());
productDO.setTitle(productDTO.getTitle());
productDO.setDescription(productDTO.getDescription());
productDO.setImageFileIds(productDTO.getImageFileIds());
productDO.setPrice(productDTO.getPrice());
productDO.setTags(productDTO.getTags());
productDO.setApproximateDuration(productDTO.getApproximateDuration());
productDO.setBookableArtists(productDTO.getBookableArtists());
productDO.setAvailableCoupons(productDTO.getAvailableCoupons());
return productMapper.updateById(productDO) > 0;
}
@Override
public boolean deleteProduct(Long id) {
ProductDO productDO = productMapper.selectById(id);
if (productDO == null) {
return false;
}
productDO.setIsDelete(1);
return productMapper.updateById(productDO) > 0;
}
@Override
public ProductVO getProductById(Long id) {
ProductDO productDO = productMapper.selectById(id);
if (productDO == null) {
return null;
}
return convertToVO(productDO);
}
@Override
public List<ProductVO> listAllProducts() {
List<ProductDO> productDOs = productMapper.selectList(null);
return productDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<ProductVO> listProductsByShopId(Long shopId) {
List<ProductDO> productDOs = productMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<ProductDO>lambdaQuery()
.eq(ProductDO::getShopId, shopId)
);
return productDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<ProductVO> listProductsByTag(String tag) {
List<ProductDO> productDOs = productMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<ProductDO>lambdaQuery()
.like(ProductDO::getTags, tag)
);
return productDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
/**
* 将 DO 转换为 VO
*
* @param productDO 商品DO
* @return 商品VO
*/
private ProductVO convertToVO(ProductDO productDO) {
ProductVO productVO = new ProductVO();
productVO.setId(productDO.getId());
productVO.setShopId(productDO.getShopId());
productVO.setTitle(productDO.getTitle());
productVO.setDescription(productDO.getDescription());
productVO.setImageFileIds(productDO.getImageFileIds());
productVO.setPrice(productDO.getPrice());
productVO.setTags(productDO.getTags());
productVO.setLikeCount(productDO.getLikeCount());
productVO.setCollectCount(productDO.getCollectCount());
productVO.setApproximateDuration(productDO.getApproximateDuration());
productVO.setBookableArtists(productDO.getBookableArtists());
productVO.setAvailableCoupons(productDO.getAvailableCoupons());
productVO.setCreateTime(productDO.getCreateTime());
productVO.setUpdateTime(productDO.getUpdateTime());
return productVO;
}
}
@@ -0,0 +1,111 @@
package com.xiaowang.yuminailcore.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaowang.yuminailcore.entity.ShopDO;
import com.xiaowang.yuminailcore.dto.ShopDTO;
import com.xiaowang.yuminailcore.vo.ShopVO;
import com.xiaowang.yuminailcore.mapper.ShopMapper;
import com.xiaowang.yuminailcore.service.ShopService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 店铺信息表 Service 实现
* 对应数据库表 t_shop
*
* @author xiaowang
* @date 2026-02-13
*/
@Service
@RequiredArgsConstructor
public class ShopServiceImpl extends ServiceImpl<ShopMapper, ShopDO> implements ShopService {
private final ShopMapper shopMapper;
@Override
public Long createShop(ShopDTO shopDTO) {
ShopDO shopDO = new ShopDO();
shopDO.setShopName(shopDTO.getShopName());
shopDO.setDescription(shopDTO.getDescription());
shopDO.setAddress(shopDTO.getAddress());
shopDO.setBusinessHours(shopDTO.getBusinessHours());
shopDO.setCoverImageFileId(shopDTO.getCoverImageFileId());
shopDO.setIsDelete(0);
shopMapper.insert(shopDO);
return shopDO.getId();
}
@Override
public boolean updateShop(Long id, ShopDTO shopDTO) {
ShopDO shopDO = shopMapper.selectById(id);
if (shopDO == null) {
return false;
}
shopDO.setShopName(shopDTO.getShopName());
shopDO.setDescription(shopDTO.getDescription());
shopDO.setAddress(shopDTO.getAddress());
shopDO.setBusinessHours(shopDTO.getBusinessHours());
shopDO.setCoverImageFileId(shopDTO.getCoverImageFileId());
return shopMapper.updateById(shopDO) > 0;
}
@Override
public boolean deleteShop(Long id) {
ShopDO shopDO = shopMapper.selectById(id);
if (shopDO == null) {
return false;
}
shopDO.setIsDelete(1);
return shopMapper.updateById(shopDO) > 0;
}
@Override
public ShopVO getShopById(Long id) {
ShopDO shopDO = shopMapper.selectById(id);
if (shopDO == null) {
return null;
}
return convertToVO(shopDO);
}
@Override
public List<ShopVO> listAllShops() {
List<ShopDO> shopDOs = shopMapper.selectList(null);
return shopDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<ShopVO> listShopsByShopName(String shopName) {
List<ShopDO> shopDOs = shopMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<ShopDO>lambdaQuery()
.like(ShopDO::getShopName, shopName)
);
return shopDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
/**
* 将 DO 转换为 VO
*
* @param shopDO 店铺DO
* @return 店铺VO
*/
private ShopVO convertToVO(ShopDO shopDO) {
ShopVO shopVO = new ShopVO();
shopVO.setId(shopDO.getId());
shopVO.setShopName(shopDO.getShopName());
shopVO.setDescription(shopDO.getDescription());
shopVO.setAddress(shopDO.getAddress());
shopVO.setBusinessHours(shopDO.getBusinessHours());
shopVO.setCoverImageFileId(shopDO.getCoverImageFileId());
shopVO.setCreateTime(shopDO.getCreateTime());
shopVO.setUpdateTime(shopDO.getUpdateTime());
return shopVO;
}
}
@@ -0,0 +1,109 @@
package com.xiaowang.yuminailcore.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaowang.yuminailcore.entity.TagDO;
import com.xiaowang.yuminailcore.dto.TagDTO;
import com.xiaowang.yuminailcore.vo.TagVO;
import com.xiaowang.yuminailcore.mapper.TagMapper;
import com.xiaowang.yuminailcore.service.TagService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 系统标签信息表 Service 实现
* 对应数据库表 t_tag
*
* @author xiaowang
* @date 2026-02-13
*/
@Service
@RequiredArgsConstructor
public class TagServiceImpl extends ServiceImpl<TagMapper, TagDO> implements TagService {
private final TagMapper tagMapper;
@Override
public Long createTag(TagDTO tagDTO) {
TagDO tagDO = new TagDO();
tagDO.setTagName(tagDTO.getTagName());
tagDO.setTextColor(tagDTO.getTextColor());
tagDO.setBgColor(tagDTO.getBgColor());
tagDO.setBorderColor(tagDTO.getBorderColor());
tagDO.setIsDelete(0);
tagMapper.insert(tagDO);
return tagDO.getId();
}
@Override
public boolean updateTag(Long id, TagDTO tagDTO) {
TagDO tagDO = tagMapper.selectById(id);
if (tagDO == null) {
return false;
}
tagDO.setTagName(tagDTO.getTagName());
tagDO.setTextColor(tagDTO.getTextColor());
tagDO.setBgColor(tagDTO.getBgColor());
tagDO.setBorderColor(tagDTO.getBorderColor());
return tagMapper.updateById(tagDO) > 0;
}
@Override
public boolean deleteTag(Long id) {
TagDO tagDO = tagMapper.selectById(id);
if (tagDO == null) {
return false;
}
tagDO.setIsDelete(1);
return tagMapper.updateById(tagDO) > 0;
}
@Override
public TagVO getTagById(Long id) {
TagDO tagDO = tagMapper.selectById(id);
if (tagDO == null) {
return null;
}
return convertToVO(tagDO);
}
@Override
public List<TagVO> listAllTags() {
List<TagDO> tagDOs = tagMapper.selectList(null);
return tagDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public TagVO getTagByTagName(String tagName) {
TagDO tagDO = tagMapper.selectOne(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<TagDO>lambdaQuery()
.eq(TagDO::getTagName, tagName)
);
if (tagDO == null) {
return null;
}
return convertToVO(tagDO);
}
/**
* 将 DO 转换为 VO
*
* @param tagDO 标签DO
* @return 标签VO
*/
private TagVO convertToVO(TagDO tagDO) {
TagVO tagVO = new TagVO();
tagVO.setId(tagDO.getId());
tagVO.setTagName(tagDO.getTagName());
tagVO.setTextColor(tagDO.getTextColor());
tagVO.setBgColor(tagDO.getBgColor());
tagVO.setBorderColor(tagDO.getBorderColor());
tagVO.setCreateTime(tagDO.getCreateTime());
tagVO.setUpdateTime(tagDO.getUpdateTime());
return tagVO;
}
}
@@ -0,0 +1,142 @@
package com.xiaowang.yuminailcore.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaowang.yuminailcore.entity.UserDO;
import com.xiaowang.yuminailcore.dto.UserDTO;
import com.xiaowang.yuminailcore.vo.UserVO;
import com.xiaowang.yuminailcore.mapper.UserMapper;
import com.xiaowang.yuminailcore.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 系统用户信息表 Service 实现
* 对应数据库表 t_user
*
* @author xiaowang
* @date 2026-02-13
*/
@Service
@RequiredArgsConstructor
public class UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements UserService {
private final UserMapper userMapper;
@Override
public Long createUser(UserDTO userDTO) {
UserDO userDO = new UserDO();
userDO.setShopId(userDTO.getShopId());
userDO.setNickname(userDTO.getNickname());
userDO.setAccount(userDTO.getAccount());
userDO.setPassword(userDTO.getPassword());
userDO.setSignature(userDTO.getSignature());
userDO.setLevel(userDTO.getLevel());
userDO.setType(userDTO.getType());
userDO.setVipId(userDTO.getVipId());
userDO.setIsDelete(0);
userMapper.insert(userDO);
return userDO.getId();
}
@Override
public boolean updateUser(Long id, UserDTO userDTO) {
UserDO userDO = userMapper.selectById(id);
if (userDO == null) {
return false;
}
userDO.setShopId(userDTO.getShopId());
userDO.setNickname(userDTO.getNickname());
userDO.setAccount(userDTO.getAccount());
userDO.setPassword(userDTO.getPassword());
userDO.setSignature(userDTO.getSignature());
userDO.setLevel(userDTO.getLevel());
userDO.setType(userDTO.getType());
userDO.setVipId(userDTO.getVipId());
return userMapper.updateById(userDO) > 0;
}
@Override
public boolean deleteUser(Long id) {
UserDO userDO = userMapper.selectById(id);
if (userDO == null) {
return false;
}
userDO.setIsDelete(1);
return userMapper.updateById(userDO) > 0;
}
@Override
public UserVO getUserById(Long id) {
UserDO userDO = userMapper.selectById(id);
if (userDO == null) {
return null;
}
return convertToVO(userDO);
}
@Override
public List<UserVO> listAllUsers() {
List<UserDO> userDOs = userMapper.selectList(null);
return userDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<UserVO> listUsersByShopId(Long shopId) {
List<UserDO> userDOs = userMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<UserDO>lambdaQuery()
.eq(UserDO::getShopId, shopId)
);
return userDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<UserVO> listUsersByType(Integer type) {
List<UserDO> userDOs = userMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<UserDO>lambdaQuery()
.eq(UserDO::getType, type)
);
return userDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public UserVO getUserByAccount(String account) {
UserDO userDO = userMapper.selectOne(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<UserDO>lambdaQuery()
.eq(UserDO::getAccount, account)
);
if (userDO == null) {
return null;
}
return convertToVO(userDO);
}
/**
* 将 DO 转换为 VO
*
* @param userDO 用户DO
* @return 用户VO
*/
private UserVO convertToVO(UserDO userDO) {
UserVO userVO = new UserVO();
userVO.setId(userDO.getId());
userVO.setShopId(userDO.getShopId());
userVO.setNickname(userDO.getNickname());
userVO.setAccount(userDO.getAccount());
userVO.setSignature(userDO.getSignature());
userVO.setLevel(userDO.getLevel());
userVO.setType(userDO.getType());
userVO.setVipId(userDO.getVipId());
userVO.setCreateTime(userDO.getCreateTime());
userVO.setUpdateTime(userDO.getUpdateTime());
return userVO;
}
}
@@ -0,0 +1,96 @@
package com.xiaowang.yuminailcore.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaowang.yuminailcore.entity.VipBenefitDO;
import com.xiaowang.yuminailcore.dto.VipBenefitDTO;
import com.xiaowang.yuminailcore.vo.VipBenefitVO;
import com.xiaowang.yuminailcore.mapper.VipBenefitMapper;
import com.xiaowang.yuminailcore.service.VipBenefitService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* VIP权益信息表 Service 实现
* 对应数据库表 t_vip_benefit
*
* @author xiaowang
* @date 2026-02-13
*/
@Service
@RequiredArgsConstructor
public class VipBenefitServiceImpl extends ServiceImpl<VipBenefitMapper, VipBenefitDO> implements VipBenefitService {
private final VipBenefitMapper vipBenefitMapper;
@Override
public Long createVipBenefit(VipBenefitDTO vipBenefitDTO) {
VipBenefitDO vipBenefitDO = new VipBenefitDO();
vipBenefitDO.setBenefitInfo(vipBenefitDTO.getBenefitInfo());
vipBenefitDO.setRequiredVipLevel(vipBenefitDTO.getRequiredVipLevel());
vipBenefitMapper.insert(vipBenefitDO);
return vipBenefitDO.getId();
}
@Override
public boolean updateVipBenefit(Long id, VipBenefitDTO vipBenefitDTO) {
VipBenefitDO vipBenefitDO = vipBenefitMapper.selectById(id);
if (vipBenefitDO == null) {
return false;
}
vipBenefitDO.setBenefitInfo(vipBenefitDTO.getBenefitInfo());
vipBenefitDO.setRequiredVipLevel(vipBenefitDTO.getRequiredVipLevel());
return vipBenefitMapper.updateById(vipBenefitDO) > 0;
}
@Override
public boolean deleteVipBenefit(Long id) {
return vipBenefitMapper.deleteById(id) > 0;
}
@Override
public VipBenefitVO getVipBenefitById(Long id) {
VipBenefitDO vipBenefitDO = vipBenefitMapper.selectById(id);
if (vipBenefitDO == null) {
return null;
}
return convertToVO(vipBenefitDO);
}
@Override
public List<VipBenefitVO> listAllVipBenefits() {
List<VipBenefitDO> vipBenefitDOs = vipBenefitMapper.selectList(null);
return vipBenefitDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
@Override
public List<VipBenefitVO> listVipBenefitsByRequiredVipLevel(String requiredVipLevel) {
List<VipBenefitDO> vipBenefitDOs = vipBenefitMapper.selectList(
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper.<VipBenefitDO>lambdaQuery()
.eq(VipBenefitDO::getRequiredVipLevel, requiredVipLevel)
);
return vipBenefitDOs.stream()
.map(this::convertToVO)
.collect(Collectors.toList());
}
/**
* 将 DO 转换为 VO
*
* @param vipBenefitDO VIP权益DO
* @return VIP权益VO
*/
private VipBenefitVO convertToVO(VipBenefitDO vipBenefitDO) {
VipBenefitVO vipBenefitVO = new VipBenefitVO();
vipBenefitVO.setId(vipBenefitDO.getId());
vipBenefitVO.setBenefitInfo(vipBenefitDO.getBenefitInfo());
vipBenefitVO.setRequiredVipLevel(vipBenefitDO.getRequiredVipLevel());
vipBenefitVO.setCreateTime(vipBenefitDO.getCreateTime());
vipBenefitVO.setUpdateTime(vipBenefitDO.getUpdateTime());
return vipBenefitVO;
}
}

Some files were not shown because too many files have changed in this diff Show More