Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
custom-server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhonghong
custom-server
Commits
56faa65b
Commit
56faa65b
authored
Jun 12, 2026
by
Lizh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化服务的引入方式
parent
be6c42f3
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
311 additions
and
159 deletions
+311
-159
custom-server-app/src/main/java/com/jomalls/custom/app/service/impl/CustomProductInfoServiceImpl.java
+3
-10
custom-server-app/src/main/java/com/jomalls/custom/app/service/impl/LogCustomProductServiceImpl.java
+7
-9
custom-server-app/src/main/java/com/jomalls/custom/app/utils/BeanMapper.java
+7
-2
custom-server-core/src/main/java/com/jomalls/custom/enums/CodeEnum.java
+23
-7
custom-server-core/src/main/java/com/jomalls/custom/service/impl/BaseServiceImpl.java
+17
-2
custom-server-domain/src/main/java/com/jomalls/custom/dal/mapper/DbDiyMapper.java
+15
-0
custom-server-domain/src/main/java/com/jomalls/custom/dal/mapper/LogCustomProductMapper.java
+13
-0
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/DbDiyDomainService.java
+6
-0
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/LogCustomProductDomainService.java
+6
-0
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/CraftCenterDomainServiceImpl.java
+1
-3
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/DbDiyDomainServiceImpl.java
+11
-1
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/DbDiyXiaoguotuDomainServiceImpl.java
+1
-3
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/LogCustomProductDomainServiceImpl.java
+8
-1
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/LogProductTemplateDomainServiceImpl.java
+1
-3
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/ProductFactoryRelDomainServiceImpl.java
+1
-3
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/ProductTemplateInfoDomainServiceImpl.java
+1
-3
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/ProductTemplateItemDomainServiceImpl.java
+1
-3
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/SysBillRuleDomainServiceImpl.java
+1
-3
custom-server-domain/src/main/resources/mapper/DbDiyMapper.xml
+17
-0
custom-server-domain/src/main/resources/mapper/LogCustomProductMapper.xml
+9
-0
custom-server-domain/src/main/resources/mapper/SysUserMapper.xml
+59
-31
custom-server-starter/src/main/java/com/jomalls/custom/CustomServerApplication.java
+0
-1
custom-server-starter/src/main/java/com/jomalls/custom/config/CommonExceptionHandlerAdvice.java
+38
-3
custom-server-starter/src/main/java/com/jomalls/custom/config/SecurityInterceptor.java
+0
-1
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductBlacklistController.java
+4
-4
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductCraftRelController.java
+4
-4
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductDiyUserRelController.java
+4
-4
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductFactoryPriceIntervalRelController.java
+4
-4
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductFactoryPriceRelController.java
+4
-4
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductImageController.java
+4
-4
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductInfoController.java
+4
-4
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductInfoPropertyController.java
+4
-4
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductItemController.java
+5
-5
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductWarehouseRelController.java
+4
-4
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomWarehouseInfoController.java
+4
-4
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/DbDiyController.java
+4
-4
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/HealthController.java
+2
-0
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/LogCustomProductController.java
+3
-5
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/ProductFactoryRelController.java
+4
-4
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/SysBillRuleController.java
+4
-4
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/SysUserController.java
+3
-8
No files found.
custom-server-app/src/main/java/com/jomalls/custom/app/service/impl/CustomProductInfoServiceImpl.java
View file @
56faa65b
...
...
@@ -798,7 +798,7 @@ public class CustomProductInfoServiceImpl implements CustomProductInfoService {
}
List
<
Integer
>
diyIds
=
templates
.
stream
().
map
(
ProductTemplateInfoEntity:
:
getDiyId
)
.
filter
(
Objects:
:
nonNull
).
distinct
().
collect
(
Collectors
.
toList
());
// 3. 查询 db_diy,
SQL 层
完成状态过滤 + FIND_IN_SET 权限过滤(对齐 TS:766-783)
// 3. 查询 db_diy,
通过 Domain XML
完成状态过滤 + FIND_IN_SET 权限过滤(对齐 TS:766-783)
final
Integer
userId
=
user
.
getId
();
List
<
Integer
>
statusList
;
String
userName
=
user
.
getName
();
...
...
@@ -807,15 +807,8 @@ public class CustomProductInfoServiceImpl implements CustomProductInfoService {
}
else
{
statusList
=
Collections
.
singletonList
(
TemplateStatus
.
SHELF_CODE
);
}
List
<
DbDiyEntity
>
diys
=
dbDiyDomainService
.
list
(
new
LambdaQueryWrapper
<
DbDiyEntity
>()
.
in
(
DbDiyEntity:
:
getId
,
diyIds
)
.
in
(
DbDiyEntity:
:
getStatus
,
statusList
)
// user_ids 权限:NULL(对所有人开放)OR FIND_IN_SET(userId, user_ids) > 0
.
and
(
w
->
w
.
isNull
(
DbDiyEntity:
:
getUserIds
)
.
or
().
apply
(
"FIND_IN_SET({0}, user_ids) > 0"
,
userId
))
// ban_user_ids 排除:NULL(无人被禁止)OR FIND_IN_SET(userId, ban_user_ids) = 0
.
and
(
w
->
w
.
isNull
(
DbDiyEntity:
:
getBanUserIds
)
.
or
().
apply
(
"FIND_IN_SET({0}, ban_user_ids) = 0"
,
userId
)));
// FIND_IN_SET 逻辑已下沉至 DbDiyMapper.xml 的 selectByIdsWithUserPermission
List
<
DbDiyEntity
>
diys
=
dbDiyDomainService
.
selectByIdsWithUserPermission
(
diyIds
,
statusList
,
userId
);
if
(
CollectionUtils
.
isEmpty
(
diys
))
{
return
Collections
.
emptyList
();
}
...
...
custom-server-app/src/main/java/com/jomalls/custom/app/service/impl/LogCustomProductServiceImpl.java
View file @
56faa65b
...
...
@@ -7,6 +7,7 @@ import com.jomalls.custom.app.utils.BeanMapper;
import
com.jomalls.custom.app.utils.CustomAsserts
;
import
com.jomalls.custom.dal.entity.LogCustomProductEntity
;
import
com.jomalls.custom.domain.service.LogCustomProductDomainService
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
...
...
@@ -21,23 +22,20 @@ import java.util.stream.Collectors;
*/
@Slf4j
@Service
@RequiredArgsConstructor
public
class
LogCustomProductServiceImpl
implements
LogCustomProductService
{
// 默认查询条数
private
static
final
int
DEFAULT_LIMIT
=
100
;
private
final
LogCustomProductDomainService
logCustomProductDomainService
;
public
LogCustomProductServiceImpl
(
LogCustomProductDomainService
logCustomProductDomainService
)
{
this
.
logCustomProductDomainService
=
logCustomProductDomainService
;
}
@Override
public
List
<
LogCustomProductSnakeVO
>
getListByProductId
(
Integer
productId
)
{
CustomAsserts
.
nonNull
(
productId
,
"商品 ID 不能为空"
);
// 按 product_id 查询日志,按 id 降序,限制 100 条防止数据膨胀
List
<
LogCustomProductEntity
>
logs
=
logCustomProductDomainService
.
list
(
new
LambdaQueryWrapper
<
LogCustomProductEntity
>()
.
eq
(
LogCustomProductEntity:
:
getProductId
,
productId
)
.
orderByDesc
(
LogCustomProductEntity:
:
getId
)
.
last
(
"LIMIT 100"
));
List
<
LogCustomProductEntity
>
logs
=
logCustomProductDomainService
.
selectByProductIdWithLimit
(
productId
,
DEFAULT_LIMIT
);
return
logs
.
stream
()
.
map
(
e
->
BeanMapper
.
snakeCase
().
convert
(
e
,
LogCustomProductSnakeVO
.
class
))
.
collect
(
Collectors
.
toList
());
...
...
custom-server-app/src/main/java/com/jomalls/custom/app/utils/BeanMapper.java
View file @
56faa65b
...
...
@@ -70,8 +70,13 @@ public class BeanMapper {
private
final
ObjectMapper
objectMapper
;
/** 默认(驼峰命名)单例 */
private
static
final
BeanMapper
INSTANCE
=
new
BeanMapper
();
/** 蛇形命名单例 */
private
static
final
BeanMapper
SNAKE_CASE_INSTANCE
=
new
BeanMapper
(
SNAKE_CASE_MAPPER
);
public
static
BeanMapper
mapper
()
{
return
new
BeanMapper
()
;
return
INSTANCE
;
}
/**
...
...
@@ -83,7 +88,7 @@ public class BeanMapper {
* @return 配置了 SNAKE_CASE 命名策略的 BeanMapper
*/
public
static
BeanMapper
snakeCase
()
{
return
new
BeanMapper
(
SNAKE_CASE_MAPPER
)
;
return
SNAKE_CASE_INSTANCE
;
}
/**
...
...
custom-server-core/src/main/java/com/jomalls/custom/enums/CodeEnum.java
View file @
56faa65b
...
...
@@ -2,6 +2,11 @@ package com.jomalls.custom.enums;
import
lombok.Getter
;
import
org.springframework.http.HttpStatus
;
import
java.util.Arrays
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* @Author: Lizh
...
...
@@ -14,32 +19,32 @@ public enum CodeEnum {
/**
* 请求成功
*/
SUCCESS
(
200
,
"OK"
),
SUCCESS
(
200
,
"OK"
,
HttpStatus
.
OK
),
/**
* 服务器内部错误
*/
FAIL
(
500
,
"Internal Server Error"
),
FAIL
(
500
,
"Internal Server Error"
,
HttpStatus
.
INTERNAL_SERVER_ERROR
),
/**
* 资源未找到
*/
NOT_FOUND
(
404
,
"Not Found"
),
NOT_FOUND
(
404
,
"Not Found"
,
HttpStatus
.
NOT_FOUND
),
/**
* 未授权访问
*/
UNAUTHORIZED
(
401
,
"Unauthorized"
),
UNAUTHORIZED
(
401
,
"Unauthorized"
,
HttpStatus
.
UNAUTHORIZED
),
/**
* 禁止访问
*/
FORBIDDEN
(
403
,
"Forbidden"
),
FORBIDDEN
(
403
,
"Forbidden"
,
HttpStatus
.
FORBIDDEN
),
/**
* 错误的请求
*/
BAD_REQUEST
(
400
,
"Bad Request"
);
BAD_REQUEST
(
400
,
"Bad Request"
,
HttpStatus
.
BAD_REQUEST
);
/**
* -- GETTER --
...
...
@@ -55,6 +60,13 @@ public enum CodeEnum {
* @return 状态消息描述
*/
private
final
String
msg
;
/**
* -- GETTER --
* 获取状态消息描述
*
* @return 状态消息描述
*/
private
final
HttpStatus
httpStatus
;
/**
* 构造方法
...
...
@@ -62,9 +74,13 @@ public enum CodeEnum {
* @param code 状态码
* @param msg 状态消息描述
*/
CodeEnum
(
int
code
,
String
msg
)
{
CodeEnum
(
int
code
,
String
msg
,
HttpStatus
httpStatus
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
this
.
httpStatus
=
httpStatus
;
}
public
static
final
Map
<
Integer
,
HttpStatus
>
MAP
=
Arrays
.
stream
(
values
()).
collect
(
Collectors
.
toMap
(
CodeEnum:
:
getCode
,
CodeEnum:
:
getHttpStatus
));
}
custom-server-core/src/main/java/com/jomalls/custom/service/impl/BaseServiceImpl.java
View file @
56faa65b
package
com
.
jomalls
.
custom
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
...
@@ -10,8 +11,10 @@ import com.jomalls.custom.page.Pageable;
import
com.jomalls.custom.page.QueryCondition
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
java.util.Collection
;
import
java.util.Map
;
/**
* @Author: Lizh
...
...
@@ -36,7 +39,13 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> extends Servic
*/
@Override
public
Collection
<
T
>
select
(
QueryCondition
queryCondition
)
{
return
this
.
list
();
Map
<
String
,
Object
>
condition
=
queryCondition
.
getCondition
();
if
(
CollectionUtils
.
isEmpty
(
condition
))
{
return
this
.
list
();
}
QueryWrapper
<
T
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
allEq
(
condition
,
false
);
return
this
.
list
(
wrapper
);
}
/**
...
...
@@ -49,7 +58,13 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> extends Servic
public
IPage
<
T
>
selectPage
(
QueryCondition
queryCondition
)
{
Page
<
T
>
page
=
new
Page
<>(
queryCondition
.
getCurrent
(),
queryCondition
.
getSize
());
page
.
setSearchCount
(
queryCondition
.
isSearchCount
());
return
this
.
page
(
page
);
Map
<
String
,
Object
>
condition
=
queryCondition
.
getCondition
();
if
(
CollectionUtils
.
isEmpty
(
condition
))
{
return
this
.
page
(
page
);
}
QueryWrapper
<
T
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
allEq
(
condition
,
false
);
return
this
.
page
(
page
,
wrapper
);
}
/**
...
...
custom-server-domain/src/main/java/com/jomalls/custom/dal/mapper/DbDiyMapper.java
View file @
56faa65b
...
...
@@ -3,6 +3,9 @@ package com.jomalls.custom.dal.mapper;
import
com.jomalls.custom.dal.entity.DbDiyEntity
;
import
com.jomalls.custom.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @author Lizh
...
...
@@ -12,4 +15,16 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public
interface
DbDiyMapper
extends
BaseMapper
<
DbDiyEntity
>
{
/**
* 根据 ID 列表和状态查询模板,并按用户 ID 做权限过滤(FIND_IN_SET)
*
* @param ids diy ID 列表
* @param statusList 状态列表
* @param userId 当前用户 ID
* @return 过滤后的模板列表
*/
List
<
DbDiyEntity
>
selectByIdsWithUserPermission
(
@Param
(
"ids"
)
List
<
Integer
>
ids
,
@Param
(
"statusList"
)
List
<
Integer
>
statusList
,
@Param
(
"userId"
)
Integer
userId
);
}
custom-server-domain/src/main/java/com/jomalls/custom/dal/mapper/LogCustomProductMapper.java
View file @
56faa65b
...
...
@@ -3,6 +3,9 @@ package com.jomalls.custom.dal.mapper;
import
com.jomalls.custom.dal.entity.LogCustomProductEntity
;
import
com.jomalls.custom.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @author Lizh
...
...
@@ -12,4 +15,14 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public
interface
LogCustomProductMapper
extends
BaseMapper
<
LogCustomProductEntity
>
{
/**
* 根据商品 ID 查询日志(按 id 降序,限制条数)
*
* @param productId 商品 ID
* @param limit 最大返回条数
* @return 日志列表
*/
List
<
LogCustomProductEntity
>
selectByProductIdWithLimit
(
@Param
(
"productId"
)
Integer
productId
,
@Param
(
"limit"
)
Integer
limit
);
}
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/DbDiyDomainService.java
View file @
56faa65b
...
...
@@ -3,6 +3,8 @@ package com.jomalls.custom.domain.service;
import
com.jomalls.custom.dal.entity.DbDiyEntity
;
import
com.jomalls.custom.service.IBaseService
;
import
java.util.List
;
/**
* @author Lizh
* @version 0.01
...
...
@@ -11,5 +13,9 @@ import com.jomalls.custom.service.IBaseService;
*/
public
interface
DbDiyDomainService
extends
IBaseService
<
DbDiyEntity
>
{
/**
* 根据 ID 列表和状态查询模板,并按用户 ID 做权限过滤(FIND_IN_SET)
*/
List
<
DbDiyEntity
>
selectByIdsWithUserPermission
(
List
<
Integer
>
ids
,
List
<
Integer
>
statusList
,
Integer
userId
);
}
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/LogCustomProductDomainService.java
View file @
56faa65b
...
...
@@ -3,6 +3,8 @@ package com.jomalls.custom.domain.service;
import
com.jomalls.custom.dal.entity.LogCustomProductEntity
;
import
com.jomalls.custom.service.IBaseService
;
import
java.util.List
;
/**
* @author Lizh
* @version 0.01
...
...
@@ -11,5 +13,9 @@ import com.jomalls.custom.service.IBaseService;
*/
public
interface
LogCustomProductDomainService
extends
IBaseService
<
LogCustomProductEntity
>
{
/**
* 根据商品 ID 查询日志(按 id 降序,限制条数)
*/
List
<
LogCustomProductEntity
>
selectByProductIdWithLimit
(
Integer
productId
,
Integer
limit
);
}
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/CraftCenterDomainServiceImpl.java
View file @
56faa65b
...
...
@@ -15,9 +15,7 @@ import org.springframework.stereotype.Service;
* @date 2026-06-11
*/
@Service
public
class
CraftCenterDomainServiceImpl
extends
BaseServiceImpl
<
CraftCenterMapper
,
CraftCenterEntity
>
implements
CraftCenterDomainService
{
public
class
CraftCenterDomainServiceImpl
extends
BaseServiceImpl
<
CraftCenterMapper
,
CraftCenterEntity
>
implements
CraftCenterDomainService
{
@Autowired
public
CraftCenterDomainServiceImpl
(
SqlSessionFactory
sqlSessionFactory
)
{
...
...
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/DbDiyDomainServiceImpl.java
View file @
56faa65b
...
...
@@ -8,6 +8,8 @@ import org.apache.ibatis.session.SqlSessionFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author Lizh
...
...
@@ -22,6 +24,13 @@ public class DbDiyDomainServiceImpl extends BaseServiceImpl<DbDiyMapper,DbDiyEnt
public
DbDiyDomainServiceImpl
(
SqlSessionFactory
sqlSessionFactory
)
{
super
(
sqlSessionFactory
);
}
// 自定义方法或者基础方法重写
@Override
public
List
<
DbDiyEntity
>
selectByIdsWithUserPermission
(
List
<
Integer
>
ids
,
List
<
Integer
>
statusList
,
Integer
userId
)
{
if
(
ids
==
null
||
ids
.
isEmpty
())
{
return
List
.
of
();
}
return
baseMapper
.
selectByIdsWithUserPermission
(
ids
,
statusList
,
userId
);
}
}
\ No newline at end of file
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/DbDiyXiaoguotuDomainServiceImpl.java
View file @
56faa65b
...
...
@@ -20,9 +20,7 @@ import java.util.List;
*/
@Slf4j
@Service
public
class
DbDiyXiaoguotuDomainServiceImpl
extends
BaseServiceImpl
<
DbDiyXiaoguotuMapper
,
DbDiyXiaoguotuEntity
>
implements
DbDiyXiaoguotuDomainService
{
public
class
DbDiyXiaoguotuDomainServiceImpl
extends
BaseServiceImpl
<
DbDiyXiaoguotuMapper
,
DbDiyXiaoguotuEntity
>
implements
DbDiyXiaoguotuDomainService
{
@Autowired
public
DbDiyXiaoguotuDomainServiceImpl
(
SqlSessionFactory
sqlSessionFactory
)
{
...
...
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/LogCustomProductDomainServiceImpl.java
View file @
56faa65b
...
...
@@ -8,6 +8,8 @@ import org.apache.ibatis.session.SqlSessionFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author Lizh
...
...
@@ -22,6 +24,10 @@ public class LogCustomProductDomainServiceImpl extends BaseServiceImpl<LogCustom
public
LogCustomProductDomainServiceImpl
(
SqlSessionFactory
sqlSessionFactory
)
{
super
(
sqlSessionFactory
);
}
// 自定义方法或者基础方法重写
@Override
public
List
<
LogCustomProductEntity
>
selectByProductIdWithLimit
(
Integer
productId
,
Integer
limit
)
{
return
baseMapper
.
selectByProductIdWithLimit
(
productId
,
limit
);
}
}
\ No newline at end of file
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/LogProductTemplateDomainServiceImpl.java
View file @
56faa65b
...
...
@@ -15,9 +15,7 @@ import org.springframework.stereotype.Service;
* @date 2026-06-12
*/
@Service
public
class
LogProductTemplateDomainServiceImpl
extends
BaseServiceImpl
<
LogProductTemplateMapper
,
LogProductTemplateEntity
>
implements
LogProductTemplateDomainService
{
public
class
LogProductTemplateDomainServiceImpl
extends
BaseServiceImpl
<
LogProductTemplateMapper
,
LogProductTemplateEntity
>
implements
LogProductTemplateDomainService
{
@Autowired
public
LogProductTemplateDomainServiceImpl
(
SqlSessionFactory
sqlSessionFactory
)
{
...
...
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/ProductFactoryRelDomainServiceImpl.java
View file @
56faa65b
...
...
@@ -15,9 +15,7 @@ import org.springframework.stereotype.Service;
* @date 2026-06-06
*/
@Service
public
class
ProductFactoryRelDomainServiceImpl
extends
BaseServiceImpl
<
ProductFactoryRelMapper
,
ProductFactoryRelEntity
>
implements
ProductFactoryRelDomainService
{
public
class
ProductFactoryRelDomainServiceImpl
extends
BaseServiceImpl
<
ProductFactoryRelMapper
,
ProductFactoryRelEntity
>
implements
ProductFactoryRelDomainService
{
@Autowired
public
ProductFactoryRelDomainServiceImpl
(
SqlSessionFactory
sqlSessionFactory
)
{
...
...
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/ProductTemplateInfoDomainServiceImpl.java
View file @
56faa65b
...
...
@@ -19,9 +19,7 @@ import java.util.List;
*/
@Slf4j
@Service
public
class
ProductTemplateInfoDomainServiceImpl
extends
BaseServiceImpl
<
ProductTemplateInfoMapper
,
ProductTemplateInfoEntity
>
implements
ProductTemplateInfoDomainService
{
public
class
ProductTemplateInfoDomainServiceImpl
extends
BaseServiceImpl
<
ProductTemplateInfoMapper
,
ProductTemplateInfoEntity
>
implements
ProductTemplateInfoDomainService
{
@Autowired
public
ProductTemplateInfoDomainServiceImpl
(
SqlSessionFactory
sqlSessionFactory
)
{
...
...
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/ProductTemplateItemDomainServiceImpl.java
View file @
56faa65b
...
...
@@ -19,9 +19,7 @@ import java.util.List;
*/
@Slf4j
@Service
public
class
ProductTemplateItemDomainServiceImpl
extends
BaseServiceImpl
<
ProductTemplateItemMapper
,
ProductTemplateItemEntity
>
implements
ProductTemplateItemDomainService
{
public
class
ProductTemplateItemDomainServiceImpl
extends
BaseServiceImpl
<
ProductTemplateItemMapper
,
ProductTemplateItemEntity
>
implements
ProductTemplateItemDomainService
{
@Autowired
public
ProductTemplateItemDomainServiceImpl
(
SqlSessionFactory
sqlSessionFactory
)
{
...
...
custom-server-domain/src/main/java/com/jomalls/custom/domain/service/impl/SysBillRuleDomainServiceImpl.java
View file @
56faa65b
...
...
@@ -15,9 +15,7 @@ import org.springframework.stereotype.Service;
* @date 2026-06-05
*/
@Service
public
class
SysBillRuleDomainServiceImpl
extends
BaseServiceImpl
<
SysBillRuleMapper
,
SysBillRuleEntity
>
implements
SysBillRuleDomainService
{
public
class
SysBillRuleDomainServiceImpl
extends
BaseServiceImpl
<
SysBillRuleMapper
,
SysBillRuleEntity
>
implements
SysBillRuleDomainService
{
@Autowired
public
SysBillRuleDomainServiceImpl
(
SqlSessionFactory
sqlSessionFactory
)
{
...
...
custom-server-domain/src/main/resources/mapper/DbDiyMapper.xml
View file @
56faa65b
...
...
@@ -108,6 +108,23 @@
diy_remark
</sql>
<!-- 按 ID + 状态 + 用户权限过滤查询 -->
<!-- FIND_IN_SET -->
<select
id=
"selectByIdsWithUserPermission"
resultMap=
"dbDiyMap"
>
SELECT
<include
refid=
"tableColumns"
/>
FROM db_diy
WHERE id IN
<foreach
collection=
"ids"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
AND status IN
<foreach
collection=
"statusList"
item=
"st"
open=
"("
separator=
","
close=
")"
>
#{st}
</foreach>
AND (user_ids IS NULL OR FIND_IN_SET(#{userId}, user_ids)
>
0)
AND (ban_user_ids IS NULL OR FIND_IN_SET(#{userId}, ban_user_ids) = 0)
</select>
<!-- 批量插入 -->
<insert
id=
"insertBatchSomeColumn"
>
INSERT INTO db_diy (sku, title, en_name, idx, img_url, img_arr, bianma, content, leixing, sc_img_type, chima_now_render, render, parent_id, user_ids, ban_user_ids, type_id, status, create_date, default_diy_id, factory_id, print_type, material, craft_id, min_price, max_price, picture_status, remark, namespace, audit_id, audit_name, audit_date, shelf_date, template_id, category_id, allocation_id, allocation_name, expedited, bind_diy_ids, is_bind, usa_made, manufacturer, style_num, type, production_client, erp_sku_properties, push_user, new_standard, diy_remark) VALUES
...
...
custom-server-domain/src/main/resources/mapper/LogCustomProductMapper.xml
View file @
56faa65b
...
...
@@ -22,6 +22,15 @@
create_time
</sql>
<!-- 根据商品 ID 查询日志(按 id 降序,限制条数) -->
<select
id=
"selectByProductIdWithLimit"
resultMap=
"logCustomProductMap"
>
SELECT
<include
refid=
"tableColumns"
/>
FROM log_custom_product
WHERE product_id = #{productId}
ORDER BY id DESC
LIMIT #{limit}
</select>
<!-- 批量插入 -->
<insert
id=
"insertBatchSomeColumn"
>
INSERT INTO log_custom_product (product_id, employee_id, employee_account, description, create_time) VALUES
...
...
custom-server-domain/src/main/resources/mapper/SysUserMapper.xml
View file @
56faa65b
...
...
@@ -3,58 +3,87 @@
<mapper
namespace=
"com.jomalls.custom.dal.mapper.SysUserMapper"
>
<!-- 通用查询列 -->
<sql
id=
"Base_Column_List"
>
id, username, password, email, phone, status, created_at, updated_at
<resultMap
type=
"com.jomalls.custom.dal.entity.SysUserEntity"
id=
"sysUserMap"
>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"deptId"
column=
"dept_id"
/>
<result
property=
"userName"
column=
"user_name"
/>
<result
property=
"nickName"
column=
"nick_name"
/>
<result
property=
"userType"
column=
"user_type"
/>
<result
property=
"email"
column=
"email"
/>
<result
property=
"phonenumber"
column=
"phonenumber"
/>
<result
property=
"sex"
column=
"sex"
/>
<result
property=
"avatar"
column=
"avatar"
/>
<result
property=
"password"
column=
"password"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"loginIp"
column=
"login_ip"
/>
<result
property=
"loginDate"
column=
"login_date"
/>
<result
property=
"pwdUpdateDate"
column=
"pwd_update_date"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"remark"
column=
"remark"
/>
</resultMap>
<sql
id=
"tableColumns"
>
user_id, dept_id, user_name, nick_name, user_type,
email, phonenumber, sex, avatar, password,
status, del_flag, login_ip, login_date, pwd_update_date,
create_by, create_time, update_by, update_time, remark
</sql>
<!-- 根据用户名查询用户 -->
<select
id=
"selectByUsername"
parameterType=
"java.lang.String"
resultType=
"com.jomalls.custom.dal.entity.SysUserEntity"
>
SELECT
<include
refid=
"Base_Column_List"
/>
<select
id=
"selectByUsername"
resultMap=
"sysUserMap"
>
SELECT
<include
refid=
"tableColumns"
/>
FROM sys_user
WHERE username = #{username}
AND status = 1
WHERE user_name = #{userName}
AND status = '0'
AND del_flag = '0'
</select>
<!-- 根据邮箱查询用户 -->
<select
id=
"selectByEmail"
parameterType=
"java.lang.String"
resultType=
"com.jomalls.custom.dal.entity.SysUserEntity"
>
SELECT
<include
refid=
"Base_Column_List"
/>
<select
id=
"selectByEmail"
resultMap=
"sysUserMap"
>
SELECT
<include
refid=
"tableColumns"
/>
FROM sys_user
WHERE email = #{email}
AND status = 1
AND status = '0'
AND del_flag = '0'
</select>
<!-- 分页查询用户列表 -->
<select
id=
"selectUserPage"
parameterType=
"com.jomalls.custom.dal.entity.SysUserEntity"
resultType=
"com.jomalls.custom.dal.entity.SysUserEntity"
>
SELECT
<include
refid=
"Base_Column_List"
/>
<select
id=
"selectUserPage"
resultMap=
"sysUserMap"
>
SELECT
<include
refid=
"tableColumns"
/>
FROM sys_user
<where>
<if
test=
"status != null"
>
AND status = #{status}
</if>
</where>
ORDER BY created_at DESC
WHERE del_flag = '0'
<if
test=
"status != null"
>
AND status = #{status}
</if>
ORDER BY create_time DESC
</select>
<!-- 查询所有启用状态的用户 -->
<select
id=
"selectAllActiveUsers"
resultType=
"com.jomalls.custom.dal.entity.SysUserEntity"
>
SELECT
<include
refid=
"Base_Column_List"
/>
<select
id=
"selectAllActiveUsers"
resultMap=
"sysUserMap"
>
SELECT
<include
refid=
"tableColumns"
/>
FROM sys_user
WHERE status = 1
ORDER BY created_at DESC
WHERE status = '0'
AND del_flag = '0'
ORDER BY create_time DESC
</select>
<!-- 批量插入 -->
<insert
id=
"insertBatchSomeColumn"
>
INSERT INTO sys_user (username, password, email, phone, status, created_at, updated_at) VALUES
INSERT INTO sys_user (user_name, nick_name, user_type,
email, phonenumber, sex, avatar, password,
status, del_flag, login_ip, login_date,
pwd_update_date, create_by, create_time, update_by, update_time, remark)
VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.username}, #{item.password}, #{item.email}, #{item.phone}, #{item.status}, #{item.createdAt}, #{item.updatedAt})
(#{item.userName}, #{item.nickName}, #{item.userType},
#{item.email}, #{item.phonenumber}, #{item.sex}, #{item.avatar}, #{item.password},
#{item.status}, #{item.delFlag}, #{item.loginIp}, #{item.loginDate},
#{item.pwdUpdateDate}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
</foreach>
</insert>
</mapper>
\ No newline at end of file
</mapper>
custom-server-starter/src/main/java/com/jomalls/custom/CustomServerApplication.java
View file @
56faa65b
...
...
@@ -13,7 +13,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
*/
@SpringBootApplication
@EnableScheduling
@EnableAspectJAutoProxy
public
class
CustomServerApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
custom-server-starter/src/main/java/com/jomalls/custom/config/CommonExceptionHandlerAdvice.java
View file @
56faa65b
...
...
@@ -6,13 +6,18 @@ import com.jomalls.custom.app.exception.PermissionDeniedException;
import
com.jomalls.custom.integrate.exception.RemoteServiceException
;
import
com.jomalls.custom.app.exception.ServiceException
;
import
com.jomalls.custom.utils.R
;
import
jakarta.validation.ConstraintViolation
;
import
jakarta.validation.ConstraintViolationException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.converter.HttpMessageNotReadableException
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.RestControllerAdvice
;
import
java.util.stream.Collectors
;
/**
* 全局异常处理切面
*/
...
...
@@ -31,6 +36,32 @@ public class CommonExceptionHandlerAdvice {
}
/**
* @Valid 校验失败(请求体参数校验不通过)
*/
@ExceptionHandler
(
MethodArgumentNotValidException
.
class
)
public
ResponseEntity
<
R
<
Object
>>
handleMethodArgumentNotValid
(
MethodArgumentNotValidException
e
)
{
String
detail
=
e
.
getBindingResult
().
getFieldErrors
().
stream
()
.
map
(
fe
->
fe
.
getField
()
+
": "
+
fe
.
getDefaultMessage
())
.
collect
(
Collectors
.
joining
(
"; "
));
log
.
debug
(
"[ 参数校验失败 ] {}"
,
detail
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
)
.
body
(
R
.
fail
(
CodeEnum
.
BAD_REQUEST
.
getCode
(),
"参数校验失败: "
+
detail
));
}
/**
* @Validated 校验失败(方法参数校验不通过)
*/
@ExceptionHandler
(
ConstraintViolationException
.
class
)
public
ResponseEntity
<
R
<
Object
>>
handleConstraintViolation
(
ConstraintViolationException
e
)
{
String
detail
=
e
.
getConstraintViolations
().
stream
()
.
map
(
ConstraintViolation:
:
getMessage
)
.
collect
(
Collectors
.
joining
(
"; "
));
log
.
debug
(
"[ 约束校验失败 ] {}"
,
detail
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
)
.
body
(
R
.
fail
(
CodeEnum
.
BAD_REQUEST
.
getCode
(),
"参数校验失败: "
+
detail
));
}
/**
* token验证失败(返回401 未登录或登录已过期)
*/
@ExceptionHandler
(
InvalidTokenException
.
class
)
...
...
@@ -52,12 +83,16 @@ public class CommonExceptionHandlerAdvice {
/**
* 业务异常处理
* <p>
* 根据异常携带的 code 映射 HTTP 状态码:403→FORBIDDEN, 401→UNAUTHORIZED,
* 404→NOT_FOUND, 400→BAD_REQUEST, 其余→INTERNAL_SERVER_ERROR。
* </p>
*/
@ExceptionHandler
(
ServiceException
.
class
)
public
ResponseEntity
<
R
<
Object
>>
handleServiceException
(
ServiceException
e
)
{
log
.
debug
(
"[ 业务异常 ]
{}"
,
e
.
getMessage
(),
e
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
)
.
body
(
R
.
fail
(
e
.
getMessage
()));
log
.
debug
(
"[ 业务异常 ]
code={}, {}"
,
e
.
getCode
()
,
e
.
getMessage
(),
e
);
HttpStatus
httpStatus
=
CodeEnum
.
MAP
.
getOrDefault
(
e
.
getCode
(),
HttpStatus
.
INTERNAL_SERVER_ERROR
);
return
ResponseEntity
.
status
(
httpStatus
).
body
(
R
.
fail
(
e
.
getCode
(),
e
.
getMessage
()));
}
/**
...
...
custom-server-starter/src/main/java/com/jomalls/custom/config/SecurityInterceptor.java
View file @
56faa65b
...
...
@@ -23,7 +23,6 @@ import jakarta.servlet.http.HttpServletResponse;
* 负责用户登录权限检查,保存登录信息到线程本地变量
*/
@Slf4j
@Component
public
class
SecurityInterceptor
implements
HandlerInterceptor
{
@Autowired
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductBlacklistController.java
View file @
56faa65b
...
...
@@ -8,8 +8,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -23,12 +23,12 @@ import java.util.List;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/customProductBlacklist"
,
description
=
"Controller
"
)
@Tag
(
name
=
"
商品黑名单管理"
,
description
=
"商品黑名单管理接口
"
)
@RequestMapping
(
"/customProductBlacklist"
)
@RequiredArgsConstructor
public
class
CustomProductBlacklistController
{
@Autowired
private
CustomProductBlacklistService
customProductBlacklistService
;
private
final
CustomProductBlacklistService
customProductBlacklistService
;
/**
* 列表查询接口
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductCraftRelController.java
View file @
56faa65b
...
...
@@ -9,8 +9,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -24,12 +24,12 @@ import java.util.List;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/customProductCraftRel"
,
description
=
"Controller
"
)
@Tag
(
name
=
"
商品工艺关联管理"
,
description
=
"商品工艺关联接口
"
)
@RequestMapping
(
"/customProductCraftRel"
)
@RequiredArgsConstructor
public
class
CustomProductCraftRelController
{
@Autowired
private
CustomProductCraftRelService
customProductCraftRelService
;
private
final
CustomProductCraftRelService
customProductCraftRelService
;
/**
* 列表查询接口
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductDiyUserRelController.java
View file @
56faa65b
...
...
@@ -8,8 +8,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -23,12 +23,12 @@ import java.util.List;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/customProductDiyUserRel"
,
description
=
"Controller
"
)
@Tag
(
name
=
"
商品DIY用户关联管理"
,
description
=
"商品DIY用户关联接口
"
)
@RequestMapping
(
"/customProductDiyUserRel"
)
@RequiredArgsConstructor
public
class
CustomProductDiyUserRelController
{
@Autowired
private
CustomProductDiyUserRelService
customProductDiyUserRelService
;
private
final
CustomProductDiyUserRelService
customProductDiyUserRelService
;
/**
* 列表查询接口
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductFactoryPriceIntervalRelController.java
View file @
56faa65b
...
...
@@ -8,8 +8,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -23,12 +23,12 @@ import java.util.List;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/customProductFactoryPriceIntervalRel"
,
description
=
"Controller
"
)
@Tag
(
name
=
"
工厂价格区间管理"
,
description
=
"工厂价格区间接口
"
)
@RequestMapping
(
"/customProductFactoryPriceIntervalRel"
)
@RequiredArgsConstructor
public
class
CustomProductFactoryPriceIntervalRelController
{
@Autowired
private
CustomProductFactoryPriceIntervalRelService
customProductFactoryPriceIntervalRelService
;
private
final
CustomProductFactoryPriceIntervalRelService
customProductFactoryPriceIntervalRelService
;
/**
* 列表查询接口
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductFactoryPriceRelController.java
View file @
56faa65b
...
...
@@ -8,8 +8,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -23,12 +23,12 @@ import java.util.List;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/customProductFactoryPriceRel"
,
description
=
"Controller
"
)
@Tag
(
name
=
"
工厂价格关联管理"
,
description
=
"工厂价格关联接口
"
)
@RequestMapping
(
"/customProductFactoryPriceRel"
)
@RequiredArgsConstructor
public
class
CustomProductFactoryPriceRelController
{
@Autowired
private
CustomProductFactoryPriceRelService
customProductFactoryPriceRelService
;
private
final
CustomProductFactoryPriceRelService
customProductFactoryPriceRelService
;
/**
* 列表查询接口
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductImageController.java
View file @
56faa65b
...
...
@@ -8,8 +8,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -23,12 +23,12 @@ import java.util.List;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/customProductImage"
,
description
=
"Controller
"
)
@Tag
(
name
=
"
商品图片管理"
,
description
=
"商品图片管理接口
"
)
@RequestMapping
(
"/customProductImage"
)
@RequiredArgsConstructor
public
class
CustomProductImageController
{
@Autowired
private
CustomProductImageService
customProductImageService
;
private
final
CustomProductImageService
customProductImageService
;
/**
* 列表查询接口
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductInfoController.java
View file @
56faa65b
...
...
@@ -15,8 +15,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -31,12 +31,12 @@ import java.util.Map;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/api/v2/product/info"
,
description
=
"定制商品
接口"
)
@Tag
(
name
=
"
定制商品管理"
,
description
=
"定制商品管理
接口"
)
@RequestMapping
(
"/api/v2/product/info"
)
@RequiredArgsConstructor
public
class
CustomProductInfoController
{
@Autowired
private
CustomProductInfoService
customProductInfoService
;
private
final
CustomProductInfoService
customProductInfoService
;
@Operation
(
summary
=
"创建商品"
,
description
=
"创建商品"
)
@PostMapping
(
"/create"
)
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductInfoPropertyController.java
View file @
56faa65b
...
...
@@ -8,8 +8,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -23,12 +23,12 @@ import java.util.List;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/customProductInfoProperty"
,
description
=
"Controller
"
)
@Tag
(
name
=
"
商品属性管理"
,
description
=
"商品属性管理接口
"
)
@RequestMapping
(
"/customProductInfoProperty"
)
@RequiredArgsConstructor
public
class
CustomProductInfoPropertyController
{
@Autowired
private
CustomProductInfoPropertyService
customProductInfoPropertyService
;
private
final
CustomProductInfoPropertyService
customProductInfoPropertyService
;
/**
* 列表查询接口
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductItemController.java
View file @
56faa65b
...
...
@@ -7,8 +7,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Arrays
;
...
...
@@ -17,19 +17,19 @@ import java.util.List;
/**
* 定制商品明细 Controller
* <p>
* 对齐 TS 项目 {@code ApiCustomProductItemController}
。
* 对齐 TS 项目 {@code ApiCustomProductItemController}
.
*
* @author Lizh
* @date 2026-06-12
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/api/v2/product/item"
,
description
=
"定制商品明细
"
)
@Tag
(
name
=
"
定制商品明细"
,
description
=
"定制商品明细接口
"
)
@RequestMapping
(
"/api/v2/product/item"
)
@RequiredArgsConstructor
public
class
CustomProductItemController
{
@Autowired
private
CustomProductItemService
customProductItemService
;
private
final
CustomProductItemService
customProductItemService
;
/**
* 根据商品 ID 获取明细集合
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomProductWarehouseRelController.java
View file @
56faa65b
...
...
@@ -8,8 +8,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -23,12 +23,12 @@ import java.util.List;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/customProductWarehouseRel"
,
description
=
"Controller
"
)
@Tag
(
name
=
"
商品仓库关联管理"
,
description
=
"商品仓库关联接口
"
)
@RequestMapping
(
"/customProductWarehouseRel"
)
@RequiredArgsConstructor
public
class
CustomProductWarehouseRelController
{
@Autowired
private
CustomProductWarehouseRelService
customProductWarehouseRelService
;
private
final
CustomProductWarehouseRelService
customProductWarehouseRelService
;
/**
* 列表查询接口
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/CustomWarehouseInfoController.java
View file @
56faa65b
...
...
@@ -8,8 +8,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -23,12 +23,12 @@ import java.util.List;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/customWarehouseInfo"
,
description
=
"Controller
"
)
@Tag
(
name
=
"
仓库信息管理"
,
description
=
"仓库信息接口
"
)
@RequestMapping
(
"/customWarehouseInfo"
)
@RequiredArgsConstructor
public
class
CustomWarehouseInfoController
{
@Autowired
private
CustomWarehouseInfoService
customWarehouseInfoService
;
private
final
CustomWarehouseInfoService
customWarehouseInfoService
;
/**
* 列表查询接口
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/DbDiyController.java
View file @
56faa65b
...
...
@@ -8,8 +8,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -23,12 +23,12 @@ import java.util.List;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/dbDiy"
,
description
=
"Controller
"
)
@Tag
(
name
=
"
DIY模板管理"
,
description
=
"DIY模板信息接口
"
)
@RequestMapping
(
"/dbDiy"
)
@RequiredArgsConstructor
public
class
DbDiyController
{
@Autowired
private
DbDiyService
dbDiyService
;
private
final
DbDiyService
dbDiyService
;
/**
* 列表查询接口
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/HealthController.java
View file @
56faa65b
...
...
@@ -3,6 +3,7 @@ package com.jomalls.custom.webapp.controller;
import
com.jomalls.custom.app.constant.Constants
;
import
io.swagger.v3.oas.annotations.Operation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -13,6 +14,7 @@ import java.util.Map;
* @Description: 心跳检测接口
* @Version: 1.0
*/
@RestController
public
class
HealthController
{
/**
* 健康状态字段
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/LogCustomProductController.java
View file @
56faa65b
...
...
@@ -5,6 +5,7 @@ import com.jomalls.custom.app.vo.LogCustomProductSnakeVO;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -22,16 +23,13 @@ import java.util.List;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/api/v2/product/log"
,
description
=
"商品日志
接口"
)
@Tag
(
name
=
"
商品日志管理"
,
description
=
"商品日志管理
接口"
)
@RequestMapping
(
"/api/v2/product/log"
)
@RequiredArgsConstructor
public
class
LogCustomProductController
{
private
final
LogCustomProductService
logCustomProductService
;
public
LogCustomProductController
(
LogCustomProductService
logCustomProductService
)
{
this
.
logCustomProductService
=
logCustomProductService
;
}
/**
* 根据商品 ID 获取日志列表(对齐 TS getListByProductId)
*
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/ProductFactoryRelController.java
View file @
56faa65b
...
...
@@ -8,8 +8,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -22,12 +22,12 @@ import java.util.List;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/productFactoryRel"
,
description
=
"产品-
工厂关联接口"
)
@Tag
(
name
=
"
产品工厂关联管理"
,
description
=
"产品
工厂关联接口"
)
@RequestMapping
(
"/productFactoryRel"
)
@RequiredArgsConstructor
public
class
ProductFactoryRelController
{
@Autowired
private
ProductFactoryRelService
productFactoryRelService
;
private
final
ProductFactoryRelService
productFactoryRelService
;
@Operation
(
summary
=
"列表查询接口"
,
description
=
"根据条件查询列表接口(不分页)"
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
POST
)
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/SysBillRuleController.java
View file @
56faa65b
...
...
@@ -4,8 +4,8 @@ import com.jomalls.custom.app.service.SysBillRuleService;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
...
@@ -21,12 +21,12 @@ import org.springframework.web.bind.annotation.RestController;
*/
@Slf4j
@RestController
@Tag
(
name
=
"
/api/v2/product/homesku
"
,
description
=
"生成产品SKU编号"
)
@Tag
(
name
=
"
SKU编号生成
"
,
description
=
"生成产品SKU编号"
)
@RequestMapping
(
"/api/v2/product/homesku"
)
@RequiredArgsConstructor
public
class
SysBillRuleController
{
@Autowired
private
SysBillRuleService
sysBillRuleService
;
private
final
SysBillRuleService
sysBillRuleService
;
/**
* 生成产品SKU编号
...
...
custom-server-webapp/src/main/java/com/jomalls/custom/webapp/controller/SysUserController.java
View file @
56faa65b
...
...
@@ -9,7 +9,7 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -20,15 +20,11 @@ import java.util.List;
@RestController
@RequestMapping
(
"/api/users"
)
@Tag
(
name
=
"用户管理"
,
description
=
"用户管理相关API"
)
@RequiredArgsConstructor
public
class
SysUserController
{
private
final
SysUserService
sysUserService
;
@Autowired
public
SysUserController
(
SysUserService
sysUserService
)
{
this
.
sysUserService
=
sysUserService
;
}
/**
* 列表查询接口
*
...
...
@@ -101,4 +97,4 @@ public class SysUserController {
public
void
deleteById
(
@Parameter
(
description
=
"用户ID"
,
required
=
true
)
@PathVariable
Long
id
)
{
sysUserService
.
deleteById
(
id
);
}
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment