Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
普蓝开源社区
盘古开发框架
提交
b01a0041
盘古开发框架
项目概览
普蓝开源社区
/
盘古开发框架
通知
25
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
盘古开发框架
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b01a0041
编写于
7月 02, 2019
作者:
X
xiongchun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.完善了全局日志处理逻辑,增加了统一日志ID,针对系统级的异常,返回信息中增加了异常摘要信息。2.集成了spring-cache来统一管理缓存,并完成对基础数据等相关模块的缓存逻辑处理。
上级
4a1f97fd
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
123 addition
and
154 deletion
+123
-154
myclouds-base/src/main/java/com/gitee/myclouds/base/MyContext.java
...base/src/main/java/com/gitee/myclouds/base/MyContext.java
+1
-2
myclouds-base/src/main/java/com/gitee/myclouds/base/WebContext.java
...ase/src/main/java/com/gitee/myclouds/base/WebContext.java
+3
-3
myclouds-base/src/main/java/com/gitee/myclouds/base/exception/ExceptionControllerAdvice.java
...ee/myclouds/base/exception/ExceptionControllerAdvice.java
+4
-7
myclouds-base/src/main/java/com/gitee/myclouds/base/util/BaseCons.java
.../src/main/java/com/gitee/myclouds/base/util/BaseCons.java
+2
-102
myclouds-base/src/main/java/com/gitee/myclouds/base/vo/OutVO.java
...-base/src/main/java/com/gitee/myclouds/base/vo/OutVO.java
+4
-1
myclouds-common/src/main/java/com/gitee/myclouds/common/util/CommonCons.java
.../main/java/com/gitee/myclouds/common/util/CommonCons.java
+31
-0
myclouds-gateway/pom.xml
myclouds-gateway/pom.xml
+26
-20
myclouds-gateway/src/main/java/com/gitee/myclouds/gateway/filter/TokenAuthGatewayFilterFactory.java
...yclouds/gateway/filter/TokenAuthGatewayFilterFactory.java
+3
-16
myclouds-system-service/pom.xml
myclouds-system-service/pom.xml
+4
-0
myclouds-system-service/src/main/java/com/gitee/myclouds/system/MySystemApplication.java
...n/java/com/gitee/myclouds/system/MySystemApplication.java
+2
-1
myclouds-system-service/src/main/java/com/gitee/myclouds/system/module/auth/AuthService.java
...va/com/gitee/myclouds/system/module/auth/AuthService.java
+3
-2
myclouds-system-service/src/main/java/com/gitee/myclouds/system/module/dict/DictController.java
...com/gitee/myclouds/system/module/dict/DictController.java
+11
-0
myclouds-system-service/src/main/java/com/gitee/myclouds/system/module/dict/DictMapper.xml
...java/com/gitee/myclouds/system/module/dict/DictMapper.xml
+8
-0
myclouds-system-service/src/main/java/com/gitee/myclouds/system/module/dict/DictService.java
...va/com/gitee/myclouds/system/module/dict/DictService.java
+21
-0
未找到文件。
myclouds-base/src/main/java/com/gitee/myclouds/base/MyContext.java
浏览文件 @
b01a0041
...
...
@@ -7,7 +7,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
com.alibaba.fastjson.JSON
;
import
com.gitee.myclouds.base.util.BaseCons
;
import
com.gitee.myclouds.base.vo.DictVO
;
import
com.gitee.myclouds.common.util.MyListUtil
;
import
com.gitee.myclouds.common.util.MyUtil
;
...
...
@@ -37,7 +36,7 @@ public class MyContext {
* @return
*/
public
List
<
DictVO
>
getDict
(
String
dictType
){
String
key
=
BaseCons
.
CacheKeyOrPrefix
.
MyDict
.
getValue
()
+
":
"
+
dictType
;
String
key
=
"....
"
+
dictType
;
List
<
DictVO
>
dictVOs
=
Lists
.
newArrayList
();
try
{
List
<
Object
>
enumObjs
=
stringRedisTemplate
.
opsForHash
().
values
(
key
);
...
...
myclouds-base/src/main/java/com/gitee/myclouds/base/WebContext.java
浏览文件 @
b01a0041
...
...
@@ -7,8 +7,8 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson.JSON
;
import
com.gitee.myclouds.base.util.BaseCons
;
import
com.gitee.myclouds.base.vo.UserVO
;
import
com.gitee.myclouds.common.util.CommonCons
;
import
com.gitee.myclouds.common.util.MyUtil
;
/**
...
...
@@ -29,7 +29,7 @@ public class WebContext {
* @param request
*/
public
UserVO
getUserVO
(
HttpServletRequest
request
)
{
String
token
=
request
.
getHeader
(
Base
Cons
.
Common
.
Token
.
getValue
());
String
token
=
request
.
getHeader
(
Common
Cons
.
Common
.
Token
.
getValue
());
UserVO
userVO
=
getUserVO
(
token
);
return
userVO
;
}
...
...
@@ -42,7 +42,7 @@ public class WebContext {
*/
public
UserVO
getUserVO
(
String
token
)
{
UserVO
userVO
=
null
;
String
key
=
Base
Cons
.
RedisKey
.
Token
.
getValue
()
+
token
;
String
key
=
Common
Cons
.
RedisKey
.
Token
.
getValue
()
+
token
;
String
userVOJson
=
(
String
)
stringRedisTemplate
.
opsForHash
().
get
(
key
,
"userVO"
);
if
(
MyUtil
.
isNotEmpty
(
userVOJson
))
{
userVO
=
JSON
.
parseObject
(
userVOJson
,
UserVO
.
class
);
...
...
myclouds-base/src/main/java/com/gitee/myclouds/base/exception/ExceptionControllerAdvice.java
浏览文件 @
b01a0041
...
...
@@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
import
com.alibaba.fastjson.JSON
;
import
com.gitee.myclouds.base.vo.OutVO
;
import
cn.hutool.core.
lang.UUID
;
import
cn.hutool.core.
util.IdUtil
;
import
cn.hutool.core.util.StrUtil
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -33,9 +33,7 @@ public class ExceptionControllerAdvice {
@ExceptionHandler
(
value
=
BizException
.
class
)
public
OutVO
bizExceptionHandler
(
BizException
bizException
)
{
OutVO
outVO
=
new
OutVO
(
bizException
.
getCode
()).
setMsg
(
bizException
.
getMsg
());
//生成一个异常溯源ID,进行跟踪
String
traceId
=
UUID
.
fastUUID
().
toString
();
outVO
.
setTrace
(
traceId
);
outVO
.
setLogId
(
IdUtil
.
fastSimpleUUID
());
String
msg
=
StrUtil
.
format
(
"BizException Occurred. "
,
JSON
.
toJSONString
(
outVO
));
log
.
error
(
msg
,
bizException
);
return
outVO
;
...
...
@@ -52,9 +50,8 @@ public class ExceptionControllerAdvice {
public
OutVO
exceptionHandler
(
Exception
exception
,
HttpServletResponse
response
)
{
OutVO
outVO
=
new
OutVO
(-
900
).
setMsg
(
"服务器内部错误。"
);
response
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
//生成一个异常溯源ID,进行跟踪
String
traceId
=
UUID
.
fastUUID
().
toString
();
outVO
.
setTrace
(
traceId
);
//exception.getMessage();
outVO
.
setLogId
(
IdUtil
.
fastSimpleUUID
());
outVO
.
setTrace
(
exception
.
getMessage
());
String
msg
=
StrUtil
.
format
(
"Exception Occurred. {}"
,
JSON
.
toJSONString
(
outVO
));
log
.
error
(
msg
,
exception
);
return
outVO
;
...
...
myclouds-base/src/main/java/com/gitee/myclouds/base/util/BaseCons.java
浏览文件 @
b01a0041
...
...
@@ -5,112 +5,20 @@ import lombok.Getter;
/**
* 常量表 <br>
* 提示:业务常量请别混在这里
*
* @author xiongchun
*
*/
public
class
BaseCons
{
/**
* Redis键前缀常量
*/
@AllArgsConstructor
public
static
enum
RedisKey
{
Token
(
"My:Token:"
,
"Token缓存前缀"
);
@Getter
private
final
String
value
;
@Getter
private
final
String
name
;
}
/**
* 通用
*/
@AllArgsConstructor
public
static
enum
Common
{
Token
(
"X-Auth-Token"
,
"Token参数名"
);
@Getter
private
final
String
value
;
@Getter
private
final
String
name
;
}
//=============== to delete follows================
/**
* 通用的是否布尔值
*/
public
static
enum
YesOrNo
{
NO
(
0
,
"否"
),
YES
(
1
,
"是"
);
private
YesOrNo
(
Integer
value
,
String
name
)
{
this
.
value
=
value
;
this
.
name
=
name
;
}
private
final
Integer
value
;
private
final
String
name
;
public
Integer
getValue
()
{
return
value
;
}
public
String
getName
()
{
return
name
;
}
}
/**
* 平台缓存Key/前缀
*/
public
static
enum
CacheKeyOrPrefix
{
MyDict
(
"mydict"
,
"数据字典缓存Key的前缀"
);
private
CacheKeyOrPrefix
(
String
value
,
String
name
)
{
this
.
value
=
value
;
this
.
name
=
name
;
}
private
final
String
value
;
private
final
String
name
;
public
String
getValue
()
{
return
value
;
}
public
String
getName
()
{
return
name
;
}
}
/**
* 角色菜单授权类型
*/
public
static
enum
GrantType
{
BIZ
(
"1"
,
"经办权限"
),
ADMIN
(
"2"
,
"管理权限"
);
private
GrantType
(
String
value
,
String
name
)
{
this
.
value
=
value
;
this
.
name
=
name
;
}
@Getter
private
final
String
value
;
@Getter
private
final
String
name
;
public
String
getValue
()
{
return
value
;
}
public
String
getName
()
{
return
name
;
}
}
/**
...
...
@@ -118,13 +26,5 @@ public class BaseCons {
*/
public
static
final
String
PWD_KEY
=
"HY&XC&MW"
;
/**
* 缺省当前用户数据对象会话KEY
*/
public
static
final
String
My_USER
=
"userVO"
;
public
static
void
main
(
String
[]
args
)
{
}
}
myclouds-base/src/main/java/com/gitee/myclouds/base/vo/OutVO.java
浏览文件 @
b01a0041
...
...
@@ -31,7 +31,10 @@ public class OutVO implements Serializable{
//业务数据主体
private
Object
data
;
//堆栈溯源信息(异常摘要信息)
//堆栈溯源日志ID
private
String
logId
;
//异常摘要信息
private
String
trace
;
//发生异常时的处理建议(不常用,针对一些外部API的辅助调试)
...
...
myclouds-common/src/main/java/com/gitee/myclouds/common/util/CommonCons.java
0 → 100644
浏览文件 @
b01a0041
package
com.gitee.myclouds.common.util
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
* 常量表 <br>
*
* @author xiongchun
*
*/
public
class
CommonCons
{
@AllArgsConstructor
public
static
enum
RedisKey
{
Token
(
"my:token:"
,
"token缓存前缀"
);
@Getter
private
final
String
value
;
@Getter
private
final
String
name
;
}
@AllArgsConstructor
public
static
enum
Common
{
Token
(
"X-Auth-Token"
,
"Token参数名"
);
@Getter
private
final
String
value
;
@Getter
private
final
String
name
;
}
}
myclouds-gateway/pom.xml
浏览文件 @
b01a0041
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
myclouds-gateway
</artifactId>
...
...
@@ -18,30 +19,35 @@
</properties>
<dependencies>
<dependency>
<groupId>
com.gitee.myclouds
</groupId>
<artifactId>
myclouds-common
</artifactId>
<version>
2.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-consul-discovery
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-gateway
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-hystrix
</artifactId>
</dependency>
<!-- 网关中的限流算法用到redis -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis-reactive
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-config-client
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-gateway
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-hystrix
</artifactId>
</dependency>
<!-- 网关中的限流算法用到redis -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis-reactive
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-config-client
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
...
...
myclouds-gateway/src/main/java/com/gitee/myclouds/gateway/filter/TokenAuthGatewayFilterFactory.java
浏览文件 @
b01a0041
...
...
@@ -18,10 +18,9 @@ import org.springframework.http.server.reactive.ServerHttpResponse;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson.JSON
;
import
com.gitee.myclouds.common.util.CommonCons
;
import
com.google.common.collect.Maps
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
reactor.core.publisher.Flux
;
/**
...
...
@@ -51,7 +50,7 @@ public class TokenAuthGatewayFilterFactory extends AbstractGatewayFilterFactory<
if
(
ArrayUtils
.
contains
(
ignorePaths
,
path
))
{
return
chain
.
filter
(
exchange
);
}
String
tokenName
=
"X-Auth-Token"
;
String
tokenName
=
CommonCons
.
Common
.
Token
.
getValue
()
;
ServerHttpResponse
response
=
exchange
.
getResponse
();
String
token
=
exchange
.
getRequest
().
getHeaders
().
getFirst
(
tokenName
);
Map
<
String
,
Object
>
outMap
=
Maps
.
newHashMap
();
...
...
@@ -68,7 +67,7 @@ public class TokenAuthGatewayFilterFactory extends AbstractGatewayFilterFactory<
.
wrap
(
JSON
.
toJSONString
(
outMap
).
getBytes
(
StandardCharsets
.
UTF_8
));
return
response
.
writeWith
(
Flux
.
just
(
buffer
));
}
String
key
=
RedisKey
.
Token
.
getValue
()
+
token
;
String
key
=
CommonCons
.
RedisKey
.
Token
.
getValue
()
+
token
;
if
(!
stringRedisTemplate
.
opsForHash
().
hasKey
(
key
,
"id"
))
{
response
.
getHeaders
().
add
(
"Content-Type"
,
contentType
);
response
.
setStatusCode
(
HttpStatus
.
UNAUTHORIZED
);
...
...
@@ -84,16 +83,4 @@ public class TokenAuthGatewayFilterFactory extends AbstractGatewayFilterFactory<
}
/**
* Redis键前缀常量
*/
@AllArgsConstructor
public
static
enum
RedisKey
{
Token
(
"My:Token:"
,
"Token缓存前缀"
);
@Getter
private
final
String
value
;
@Getter
private
final
String
name
;
}
}
myclouds-system-service/pom.xml
浏览文件 @
b01a0041
...
...
@@ -41,6 +41,10 @@
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
1.3.2
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-cache
</artifactId>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
...
...
myclouds-system-service/src/main/java/com/gitee/myclouds/system/MySystemApplication.java
浏览文件 @
b01a0041
...
...
@@ -3,6 +3,7 @@ package com.gitee.myclouds.system;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
...
...
@@ -12,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
@SpringBootApplication
@EnableDiscoveryClient
@EnableTransactionManagement
@EnableCaching
@MapperScan
(
basePackages
=
{
"com.gitee.myclouds"
},
sqlSessionFactoryRef
=
"sqlSessionFactory"
)
@ComponentScan
(
basePackages
={
"com.gitee.myclouds"
})
@Slf4j
...
...
@@ -21,7 +23,6 @@ public class MySystemApplication {
log
.
info
(
"Starting MySystemApplication..."
);
SpringApplication
.
run
(
MySystemApplication
.
class
,
args
);
log
.
info
(
"MySystemApplication started successed - - - -"
);
//ConfigurableApplicationContext context = SpringApplication.run(MySystemApplication.class, args);
}
}
myclouds-system-service/src/main/java/com/gitee/myclouds/system/module/auth/AuthService.java
浏览文件 @
b01a0041
...
...
@@ -13,6 +13,7 @@ import com.gitee.myclouds.base.util.BaseCons;
import
com.gitee.myclouds.base.vo.OrgVO
;
import
com.gitee.myclouds.base.vo.OutVO
;
import
com.gitee.myclouds.base.vo.UserVO
;
import
com.gitee.myclouds.common.util.CommonCons
;
import
com.gitee.myclouds.common.util.MyUtil
;
import
com.gitee.myclouds.common.wrapper.Dto
;
import
com.gitee.myclouds.system.domain.myorg.MyOrgEntity
;
...
...
@@ -88,7 +89,7 @@ public class AuthService {
private
UserVO
createToken
(
UserVO
userVO
)
{
String
token
=
IdUtil
.
simpleUUID
().
toUpperCase
();
userVO
.
setToken
(
token
);
String
key
=
Base
Cons
.
RedisKey
.
Token
.
getValue
()
+
token
;
String
key
=
Common
Cons
.
RedisKey
.
Token
.
getValue
()
+
token
;
stringRedisTemplate
.
opsForHash
().
put
(
key
,
"id"
,
token
);
stringRedisTemplate
.
opsForHash
().
put
(
key
,
"createTime"
,
DateUtil
.
now
());
stringRedisTemplate
.
opsForHash
().
put
(
key
,
"userVO"
,
JSON
.
toJSONString
(
userVO
));
...
...
@@ -106,7 +107,7 @@ public class AuthService {
OutVO
outVO
=
new
OutVO
(
0
);
String
token
=
inDto
.
getString
(
"token"
);
if
(
MyUtil
.
isNotEmpty
(
token
))
{
String
key
=
Base
Cons
.
RedisKey
.
Token
.
getValue
()
+
token
;
String
key
=
Common
Cons
.
RedisKey
.
Token
.
getValue
()
+
token
;
stringRedisTemplate
.
delete
(
key
);
}
outVO
.
setMsg
(
"用户注销成功"
);
...
...
myclouds-system-service/src/main/java/com/gitee/myclouds/system/module/dict/DictController.java
浏览文件 @
b01a0041
...
...
@@ -37,6 +37,17 @@ public class DictController {
return
dictService
.
list
(
Dtos
.
newPageDto
(
inMap
));
}
/**
* 根据类型查询字典分组
*
* @param inMap
* @return
*/
@PostMapping
(
value
=
"listByType"
,
produces
=
"application/json"
)
public
OutVO
listByType
(
@RequestBody
Map
<
String
,
Object
>
inMap
){
return
dictService
.
listByType
(
MapUtil
.
getStr
(
inMap
,
"type"
));
}
/**
* 查询实体
*
...
...
myclouds-system-service/src/main/java/com/gitee/myclouds/system/module/dict/DictMapper.xml
浏览文件 @
b01a0041
...
...
@@ -33,5 +33,13 @@
</if>
</where>
</sql>
<!-- 根据类型查询字典分组 -->
<select
id=
"listByType"
parameterType=
"String"
resultType=
"MyDictEntity"
>
SELECT
<include
refid=
"com.gitee.myclouds.system.domain.mydict.MyDictMapper.column"
/>
FROM my_dict WHERE dict_type = #{dict_type} AND is_enable = '1'
ORDER BY sort_no
</select>
</mapper>
\ No newline at end of file
myclouds-system-service/src/main/java/com/gitee/myclouds/system/module/dict/DictService.java
浏览文件 @
b01a0041
...
...
@@ -5,6 +5,8 @@ import java.util.List;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.session.SqlSession
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -51,12 +53,27 @@ public class DictService {
* @param id
* @return
*/
@Cacheable
(
value
=
"mycache:dict"
,
key
=
"#root.methodName +':' + #id"
)
public
OutVO
get
(
Integer
id
)
{
OutVO
outVO
=
new
OutVO
(
0
);
MyDictEntity
myDictEntity
=
myDictMapper
.
selectByKey
(
id
);
outVO
.
setData
(
myDictEntity
);
return
outVO
;
}
/**
* 根据类型查询字典分组
*
* @param id
* @return
*/
@Cacheable
(
value
=
"mycache:dict"
,
key
=
"#root.methodName +':' + #type"
)
public
OutVO
listByType
(
String
type
)
{
OutVO
outVO
=
new
OutVO
(
0
);
List
<
MyDictEntity
>
dictEntities
=
sqlSession
.
selectList
(
"sql.dict.listByType"
,
type
);
outVO
.
setData
(
dictEntities
);
return
outVO
;
}
/**
* 新增
...
...
@@ -64,6 +81,7 @@ public class DictService {
* @param inDto
* @return
*/
@CacheEvict
(
value
=
"mycache:dict"
,
allEntries
=
true
,
beforeInvocation
=
true
)
public
OutVO
add
(
Dto
inDto
)
{
OutVO
outVO
=
new
OutVO
(
0
);
MyDictEntity
myDictEntity
=
new
MyDictEntity
();
...
...
@@ -82,6 +100,7 @@ public class DictService {
* @param inDto
* @return
*/
@CacheEvict
(
value
=
"mycache:dict"
,
allEntries
=
true
,
beforeInvocation
=
true
)
public
OutVO
update
(
Dto
inDto
)
{
OutVO
outVO
=
new
OutVO
(
0
);
MyDictEntity
myDictEntity
=
new
MyDictEntity
();
...
...
@@ -104,6 +123,7 @@ public class DictService {
* @param inDto
* @return
*/
@CacheEvict
(
value
=
"mycache:dict"
,
allEntries
=
true
,
beforeInvocation
=
true
)
public
OutVO
delete
(
Integer
id
)
{
OutVO
outVO
=
new
OutVO
(
0
);
myDictMapper
.
deleteByKey
(
id
);
...
...
@@ -118,6 +138,7 @@ public class DictService {
* @return
*/
@Transactional
@CacheEvict
(
value
=
"mycache:dict"
,
allEntries
=
true
,
beforeInvocation
=
true
)
public
OutVO
batchDelete
(
Dto
inDto
)
{
OutVO
outVO
=
new
OutVO
(
0
);
String
[]
ids
=
StrUtil
.
split
(
inDto
.
getString
(
"ids"
),
","
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录