Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
0386a736
提交
0386a736
authored
2月 28, 2019
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加简单的部署打包脚本
增加 Dubbo 参数校验
上级
5616a3cd
显示空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
262 行增加
和
54 行删除
+262
-54
Server.md
Server.md
+18
-0
pom.xml
admin/admin-application/pom.xml
+10
-0
AdminApplication.java
...a/cn/iocoder/mall/admin/application/AdminApplication.java
+4
-1
MVCConfiguration.java
...coder/mall/admin/application/config/MVCConfiguration.java
+11
-4
SwaggerConfiguration.java
...r/mall/admin/application/config/SwaggerConfiguration.java
+2
-2
ResourceController.java
...mall/admin/application/controller/ResourceController.java
+39
-9
AdminMenuTreeNodeVO.java
...ocoder/mall/admin/application/vo/AdminMenuTreeNodeVO.java
+9
-15
application.yaml
admin/admin-application/src/main/resources/application.yaml
+2
-2
pom.xml
admin/admin-sdk/pom.xml
+1
-0
pom.xml
admin/admin-service-api/pom.xml
+3
-3
ResourceService.java
.../main/java/cn/iocoder/mall/admin/api/ResourceService.java
+5
-0
ResourceAddDTO.java
...in/java/cn/iocoder/mall/admin/api/dto/ResourceAddDTO.java
+95
-0
ResourceServiceImpl.java
...va/cn/iocoder/mall/admin/service/ResourceServiceImpl.java
+9
-1
application.yaml
...n-service-impl/src/main/resources/config/application.yaml
+3
-10
build_admin.sh
build_admin.sh
+2
-0
pom.xml
common/common-framework/pom.xml
+5
-0
GlobalExceptionHandler.java
...coder/common/framework/config/GlobalExceptionHandler.java
+25
-7
SysErrorCodeEnum.java
...n/iocoder/common/framework/constant/SysErrorCodeEnum.java
+1
-0
ExceptionUtil.java
.../java/cn/iocoder/common/framework/util/ExceptionUtil.java
+14
-0
publish_admin.sh
publish_admin.sh
+4
-0
没有找到文件。
Server.md
0 → 100644
浏览文件 @
0386a736
# 前端 Server
*
admin 18083
*
# 后端 Server
# 基础服务
## MySQL
## Zookeeper
# 运维
*
ssh 端口
*
工作目录 /work2/
admin/admin-application/pom.xml
浏览文件 @
0386a736
...
...
@@ -113,6 +113,16 @@
</annotationProcessorPaths>
</configuration>
</plugin>
<!-- 打包 -->
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<fork>
true
</fork>
</configuration>
</plugin>
</plugins>
</build>
...
...
admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/AdminApplication.java
浏览文件 @
0386a736
...
...
@@ -2,12 +2,14 @@ package cn.iocoder.mall.admin.application;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.ConfigurableApplicationContext
;
@SpringBootApplication
(
scanBasePackages
=
{
"cn.iocoder.mall.admin"
})
public
class
AdminApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
AdminApplication
.
class
,
args
);
ConfigurableApplicationContext
ctx
=
SpringApplication
.
run
(
AdminApplication
.
class
,
args
);
System
.
out
.
println
();
// TODO 后面去掉,这里是临时的
}
}
\ No newline at end of file
admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/config/MVCConfiguration.java
浏览文件 @
0386a736
...
...
@@ -5,10 +5,7 @@ import cn.iocoder.mall.admin.sdk.interceptor.AdminSecurityInterceptor;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistry
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.servlet.config.annotation.*
;
@EnableWebMvc
@Configuration
...
...
@@ -36,4 +33,13 @@ public class MVCConfiguration implements WebMvcConfigurer {
registry
.
addResourceHandler
(
"webjars/**"
).
addResourceLocations
(
"classpath:/META-INF/resources/webjars/"
);
}
// TODO 芋艿,允许跨域
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
)
.
allowedHeaders
(
"*"
)
.
allowedMethods
(
"*"
)
.
allowedOrigins
(
"*"
);
}
}
\ No newline at end of file
admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/config/SwaggerConfiguration.java
浏览文件 @
0386a736
...
...
@@ -11,7 +11,7 @@ import springfox.documentation.spring.web.plugins.Docket;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
@Configuration
@EnableSwagger2
@EnableSwagger2
// TODO 生产环境时,禁用掉。
public
class
SwaggerConfiguration
{
@Bean
...
...
@@ -19,7 +19,7 @@ public class SwaggerConfiguration {
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
apiInfo
(
apiInfo
())
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.iocoder.mall.admin.controller"
))
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.iocoder.mall.admin.
application.
controller"
))
.
paths
(
PathSelectors
.
any
())
.
build
();
}
...
...
admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/controller/ResourceController.java
浏览文件 @
0386a736
...
...
@@ -4,19 +4,19 @@ import cn.iocoder.common.framework.vo.CommonResult;
import
cn.iocoder.mall.admin.api.ResourceService
;
import
cn.iocoder.mall.admin.api.bo.ResourceBO
;
import
cn.iocoder.mall.admin.api.constant.ResourceType
;
import
cn.iocoder.mall.admin.api.dto.ResourceAddDTO
;
import
cn.iocoder.mall.admin.application.convert.ResourceConvert
;
import
cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder
;
import
cn.iocoder.mall.admin.application.vo.AdminMenuTreeNodeVO
;
import
cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
@RestController
...
...
@@ -24,11 +24,13 @@ import java.util.stream.Collectors;
@Api
(
"资源模块"
)
public
class
ResourceController
{
@Reference
@Reference
(
validation
=
"true"
)
private
ResourceService
resourceService
;
// =========== 当前管理员相关的资源 API ===========
@GetMapping
(
"/admin_menu_tree"
)
@ApiOperation
(
value
=
"获得管理员拥有的菜单权限"
,
notes
=
"以树结构返回"
)
@ApiOperation
(
value
=
"获得
当前登陆的
管理员拥有的菜单权限"
,
notes
=
"以树结构返回"
)
public
CommonResult
<
List
<
AdminMenuTreeNodeVO
>>
adminMenuTree
()
{
List
<
ResourceBO
>
resources
=
resourceService
.
getResourceByTypeAndRoleIds
(
ResourceType
.
MENU
,
AdminSecurityContextHolder
.
getContext
().
getRoleIds
());
// 创建 AdminMenuTreeNodeVO Map
...
...
@@ -53,9 +55,36 @@ public class ResourceController {
}
@GetMapping
(
"/admin_url_list"
)
@ApiOperation
(
value
=
"获得管理员拥有的 URL 权限列表"
)
public
CommonResult
adminUrlList
()
{
return
null
;
@ApiOperation
(
value
=
"获得当前登陆的管理员拥有的 URL 权限列表"
)
// @ApiModelProperty(value = "data", example = "['/admin/role/add', '/admin/role/update']") 没效果
public
CommonResult
<
Set
<
String
>>
adminUrlList
()
{
List
<
ResourceBO
>
resources
=
resourceService
.
getResourceByTypeAndRoleIds
(
ResourceType
.
URL
,
AdminSecurityContextHolder
.
getContext
().
getRoleIds
());
return
CommonResult
.
success
(
resources
.
stream
().
map
(
ResourceBO:
:
getHandler
).
collect
(
Collectors
.
toSet
()));
}
// =========== 资源管理 API ===========
// TODO 芋艿,注释
@PostMapping
(
"/add"
)
@ApiOperation
(
value
=
"创建资源"
,
notes
=
"例如说,菜单资源,Url 资源"
)
public
void
add
(
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
"type"
)
Integer
type
,
@RequestParam
(
"sort"
)
Integer
sort
,
@RequestParam
(
"displayName"
)
String
displayName
,
@RequestParam
(
"pid"
)
Integer
pid
,
@RequestParam
(
"handler"
)
String
handler
)
{
ResourceAddDTO
resourceAddDTO
=
new
ResourceAddDTO
().
setName
(
name
).
setType
(
type
).
setSort
(
sort
)
.
setDisplayName
(
displayName
).
setPid
(
pid
).
setHandler
(
handler
);
CommonResult
<
ResourceBO
>
result
=
resourceService
.
addResource
(
resourceAddDTO
);
}
public
void
update
()
{
}
public
void
delete
()
{
}
}
\ No newline at end of file
admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/vo/AdminMenuTreeNodeVO.java
浏览文件 @
0386a736
package
cn
.
iocoder
.
mall
.
admin
.
application
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.List
;
@ApiModel
(
"管理员拥有的菜单 VO"
)
public
class
AdminMenuTreeNodeVO
{
/**
* 菜单编号
*/
@ApiModelProperty
(
value
=
"菜单编号"
,
required
=
true
,
example
=
"1"
)
private
Integer
id
;
/**
* 彩蛋名
*/
@ApiModelProperty
(
value
=
"菜单名"
,
required
=
true
,
example
=
"商品管理"
)
private
String
name
;
/**
* 操作
*/
@ApiModelProperty
(
value
=
"菜单操作"
,
required
=
true
,
example
=
"/order/list"
)
private
String
handler
;
/**
* 父菜单编号
*/
@ApiModelProperty
(
value
=
"父菜单编号"
,
required
=
true
,
example
=
"1"
,
notes
=
"如果无父菜单,则值为 0"
)
private
Integer
pid
;
/**
* 子节点数组
*/
@ApiModelProperty
(
value
=
"子节点数组"
,
example
=
"[1, 2, 3]"
)
private
List
<
AdminMenuTreeNodeVO
>
children
;
public
Integer
getId
()
{
...
...
admin/admin-application/src/main/resources/application.yaml
浏览文件 @
0386a736
...
...
@@ -4,4 +4,4 @@ spring:
# server
server
:
port
:
8083
\ No newline at end of file
port
:
18083
\ No newline at end of file
admin/admin-sdk/pom.xml
浏览文件 @
0386a736
...
...
@@ -8,6 +8,7 @@
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
jar
</packaging>
<artifactId>
admin-sdk
</artifactId>
...
...
admin/admin-service-api/pom.xml
浏览文件 @
0386a736
...
...
@@ -8,6 +8,7 @@
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
jar
</packaging>
<artifactId>
admin-service-api
</artifactId>
<dependencies>
...
...
@@ -17,9 +18,8 @@
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
admin-service-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<groupId>
org.hibernate.validator
</groupId>
<artifactId>
hibernate-validator
</artifactId>
</dependency>
</dependencies>
...
...
admin/admin-service-api/src/main/java/cn/iocoder/mall/admin/api/ResourceService.java
浏览文件 @
0386a736
package
cn
.
iocoder
.
mall
.
admin
.
api
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.admin.api.bo.ResourceBO
;
import
cn.iocoder.mall.admin.api.dto.ResourceAddDTO
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -9,4 +11,6 @@ public interface ResourceService {
List
<
ResourceBO
>
getResourceByTypeAndRoleIds
(
Integer
type
,
Set
<
Integer
>
roleIds
);
CommonResult
<
ResourceBO
>
addResource
(
ResourceAddDTO
resourceAddDTO
);
}
\ No newline at end of file
admin/admin-service-api/src/main/java/cn/iocoder/mall/admin/api/dto/ResourceAddDTO.java
0 → 100644
浏览文件 @
0386a736
package
cn
.
iocoder
.
mall
.
admin
.
api
.
dto
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
/**
* 资源添加 DTO
*/
public
class
ResourceAddDTO
{
/**
* 资源名字(标识)
*/
@NotEmpty
(
message
=
"资源名字不能为空"
)
private
String
name
;
/**
* 类型
*/
@NotNull
(
message
=
"类型不能为空"
)
private
Integer
type
;
/**
* 排序值
*/
@NotNull
(
message
=
"类型不能为空"
)
private
Integer
sort
;
/**
* 展示名
*/
@NotEmpty
(
message
=
"资源名字不能为空"
)
private
String
displayName
;
/**
* 父资源比那好
*/
private
Integer
pid
;
/**
* 操作
*/
private
String
handler
;
public
String
getName
()
{
return
name
;
}
public
ResourceAddDTO
setName
(
String
name
)
{
this
.
name
=
name
;
return
this
;
}
public
Integer
getType
()
{
return
type
;
}
public
ResourceAddDTO
setType
(
Integer
type
)
{
this
.
type
=
type
;
return
this
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
ResourceAddDTO
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
return
this
;
}
public
String
getDisplayName
()
{
return
displayName
;
}
public
ResourceAddDTO
setDisplayName
(
String
displayName
)
{
this
.
displayName
=
displayName
;
return
this
;
}
public
Integer
getPid
()
{
return
pid
;
}
public
ResourceAddDTO
setPid
(
Integer
pid
)
{
this
.
pid
=
pid
;
return
this
;
}
public
String
getHandler
()
{
return
handler
;
}
public
ResourceAddDTO
setHandler
(
String
handler
)
{
this
.
handler
=
handler
;
return
this
;
}
}
\ No newline at end of file
admin/admin-service-impl/src/main/java/cn/iocoder/mall/admin/service/ResourceServiceImpl.java
浏览文件 @
0386a736
package
cn
.
iocoder
.
mall
.
admin
.
service
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.admin.api.ResourceService
;
import
cn.iocoder.mall.admin.api.bo.ResourceBO
;
import
cn.iocoder.mall.admin.api.dto.ResourceAddDTO
;
import
cn.iocoder.mall.admin.convert.ResourceConvert
;
import
cn.iocoder.mall.admin.dao.ResourceMapper
;
import
cn.iocoder.mall.admin.dataobject.ResourceDO
;
...
...
@@ -13,7 +15,7 @@ import java.util.List;
import
java.util.Set
;
@Service
@com
.
alibaba
.
dubbo
.
config
.
annotation
.
Service
@com
.
alibaba
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
)
public
class
ResourceServiceImpl
implements
ResourceService
{
@Autowired
...
...
@@ -31,4 +33,9 @@ public class ResourceServiceImpl implements ResourceService {
return
ResourceConvert
.
INSTANCE
.
convert
(
resourceMapper
.
selectListByTypeAndRoleIds
(
type
,
roleIds
));
}
@Override
public
CommonResult
<
ResourceBO
>
addResource
(
ResourceAddDTO
resourceAddDTO
)
{
return
null
;
}
}
\ No newline at end of file
admin/admin-service-impl/src/main/resources/config/application.yaml
浏览文件 @
0386a736
spring
:
# datasource
datasource
:
url
:
jdbc:mysql://1
27.0.0.1:33061
/mall_admin?useSSL=false
url
:
jdbc:mysql://1
80.167.213.26:13306
/mall_admin?useSSL=false
driver-class-name
:
com.mysql.jdbc.Driver
username
:
root
password
:
123456
# server
server
:
port
:
8083
password
:
${MALL_MYSQL_PASSWORD}
# mybatis
mybatis
:
...
...
@@ -27,6 +23,3 @@ dubbo:
name
:
dubbo
scan
:
base-packages
:
cn.iocoder.mall.admin.service
\ No newline at end of file
demo
:
service
:
version
:
1.0.0
\ No newline at end of file
build_admin.sh
0 → 100644
浏览文件 @
0386a736
mvn clean package
-am
-DskipTests
\ No newline at end of file
common/common-framework/pom.xml
浏览文件 @
0386a736
...
...
@@ -44,6 +44,11 @@
<artifactId>
jackson-annotations
</artifactId>
<version>
2.9.7
</version>
</dependency>
<dependency>
<groupId>
org.hibernate.validator
</groupId>
<artifactId>
hibernate-validator
</artifactId>
<version>
6.0.15.Final
</version>
</dependency>
<!--<dependency>-->
<!--<groupId>com.baomidou</groupId>-->
<!--<artifactId>mybatis-plus-support</artifactId>-->
...
...
common/common-framework/src/main/java/cn/iocoder/common/framework/config/GlobalExceptionHandler.java
浏览文件 @
0386a736
...
...
@@ -3,13 +3,14 @@ package cn.iocoder.common.framework.config;
import
cn.iocoder.common.framework.constant.SysErrorCodeEnum
;
import
cn.iocoder.common.framework.exception.ServiceException
;
import
cn.iocoder.common.framework.util.ExceptionUtil
;
import
cn.iocoder.common.framework.vo.
Rest
Result
;
import
cn.iocoder.common.framework.vo.
Common
Result
;
import
org.springframework.web.bind.MissingServletRequestParameterException
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.validation.ConstraintViolationException
;
import
java.lang.reflect.UndeclaredThrowableException
;
@ControllerAdvice
...
...
@@ -17,33 +18,49 @@ public class GlobalExceptionHandler {
@ResponseBody
@ExceptionHandler
(
value
=
ServiceException
.
class
)
public
RestResult
serviceExceptionHandler
(
HttpServletRequest
req
,
ServiceException
ex
)
{
return
RestResult
.
error
(
ex
.
getCode
(),
ex
.
getMessage
());
public
CommonResult
serviceExceptionHandler
(
HttpServletRequest
req
,
ServiceException
ex
)
{
return
CommonResult
.
error
(
ex
.
getCode
(),
ex
.
getMessage
());
}
@ResponseBody
@ExceptionHandler
(
value
=
ConstraintViolationException
.
class
)
public
CommonResult
constraintViolationExceptionHandler
(
HttpServletRequest
req
,
ConstraintViolationException
ex
)
{
// TODO 芋艿,后续要想一个更好的方式。
// 拼接详细报错
StringBuilder
detailMessage
=
new
StringBuilder
(
"\n\n详细错误如下:"
);
ex
.
getConstraintViolations
().
forEach
(
constraintViolation
->
detailMessage
.
append
(
"\n"
).
append
(
constraintViolation
.
getMessage
()));
return
CommonResult
.
error
(
SysErrorCodeEnum
.
VALIDATION_REQUEST_PARAM_ERROR
.
getCode
(),
SysErrorCodeEnum
.
VALIDATION_REQUEST_PARAM_ERROR
.
getMessage
()
+
detailMessage
.
toString
());
}
@ResponseBody
@ExceptionHandler
(
value
=
UndeclaredThrowableException
.
class
)
public
Rest
Result
undeclaredThrowableExceptionHandler
(
HttpServletRequest
req
,
UndeclaredThrowableException
e
)
{
public
Common
Result
undeclaredThrowableExceptionHandler
(
HttpServletRequest
req
,
UndeclaredThrowableException
e
)
{
// 尝试获得 ServiceException 异常。如果是,则使用 serviceExceptionHandler 方法处理。
ServiceException
serviceException
=
ExceptionUtil
.
getServiceException
(
e
);
if
(
serviceException
!=
null
)
{
return
serviceExceptionHandler
(
req
,
serviceException
);
}
// 尝试获得 ConstraintViolationException 异常。如果是,
ConstraintViolationException
constraintViolationException
=
ExceptionUtil
.
getConstraintViolationException
(
e
);
if
(
constraintViolationException
!=
null
)
{
return
constraintViolationExceptionHandler
(
req
,
constraintViolationException
);
}
// 获得不到,使用 异常日志 方法处理。
return
resultExceptionHandler
(
req
,
e
);
}
@ResponseBody
@ExceptionHandler
(
value
=
Exception
.
class
)
public
Rest
Result
resultExceptionHandler
(
HttpServletRequest
req
,
Exception
e
)
{
public
Common
Result
resultExceptionHandler
(
HttpServletRequest
req
,
Exception
e
)
{
// TODO 异常日志
e
.
printStackTrace
();
// TODO 翻译不同的异常
if
(
e
instanceof
MissingServletRequestParameterException
)
{
return
Rest
Result
.
error
(
SysErrorCodeEnum
.
MISSING_REQUEST_PARAM_ERROR
.
getCode
(),
SysErrorCodeEnum
.
MISSING_REQUEST_PARAM_ERROR
.
getMessage
());
return
Common
Result
.
error
(
SysErrorCodeEnum
.
MISSING_REQUEST_PARAM_ERROR
.
getCode
(),
SysErrorCodeEnum
.
MISSING_REQUEST_PARAM_ERROR
.
getMessage
());
}
// 返回
return
Rest
Result
.
error
(
SysErrorCodeEnum
.
SYS_ERROR
.
getCode
(),
SysErrorCodeEnum
.
SYS_ERROR
.
getMessage
());
return
Common
Result
.
error
(
SysErrorCodeEnum
.
SYS_ERROR
.
getCode
(),
SysErrorCodeEnum
.
SYS_ERROR
.
getMessage
());
}
}
\ No newline at end of file
common/common-framework/src/main/java/cn/iocoder/common/framework/constant/SysErrorCodeEnum.java
浏览文件 @
0386a736
...
...
@@ -9,6 +9,7 @@ public enum SysErrorCodeEnum {
SYS_ERROR
(
2001001000
,
"服务端发生异常"
),
MISSING_REQUEST_PARAM_ERROR
(
2001001001
,
"参数缺失"
),
VALIDATION_REQUEST_PARAM_ERROR
(
2001001002
,
"参数校验不正确"
)
;
private
final
int
code
;
...
...
common/common-framework/src/main/java/cn/iocoder/common/framework/util/ExceptionUtil.java
浏览文件 @
0386a736
...
...
@@ -2,6 +2,7 @@ package cn.iocoder.common.framework.util;
import
cn.iocoder.common.framework.exception.ServiceException
;
import
javax.validation.ConstraintViolationException
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.UndeclaredThrowableException
;
...
...
@@ -31,4 +32,16 @@ public class ExceptionUtil {
return
null
;
}
public
static
ConstraintViolationException
getConstraintViolationException
(
UndeclaredThrowableException
e
)
{
Throwable
undeclaredThrowable
=
e
.
getUndeclaredThrowable
();
if
(
undeclaredThrowable
instanceof
InvocationTargetException
)
{
InvocationTargetException
invocationTargetException
=
(
InvocationTargetException
)
undeclaredThrowable
;
Throwable
targetException
=
invocationTargetException
.
getTargetException
();
if
(
targetException
!=
null
&&
targetException
instanceof
ConstraintViolationException
)
{
return
(
ConstraintViolationException
)
targetException
;
}
}
return
null
;
}
}
\ No newline at end of file
publish_admin.sh
0 → 100644
浏览文件 @
0386a736
#!/usr/bin/env bash
sh build_admin.sh
scp admin/admin-application/target/admin-application-1.0-SNAPSHOT.jar runner@192.168.88.10:/work2/project/admin
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论