Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
b373d319
Commit
b373d319
authored
Jun 23, 2021
by
李成龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改返回值使用工具类
parent
a0db3676
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
104 deletions
+83
-104
CommonResponseUtil.java
...eejoin/amos/boot/biz/common/utils/CommonResponseUtil.java
+0
-56
AlertSubmittedController.java
...t/module/jcs/biz/controller/AlertSubmittedController.java
+24
-14
UserController.java
...n/amos/boot/module/jcs/biz/controller/UserController.java
+42
-23
RemoteSecurityService.java
...ot/module/jcs/biz/service/impl/RemoteSecurityService.java
+17
-11
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/CommonResponseUtil.java
deleted
100644 → 0
View file @
a0db3676
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
utils
;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
import
org.springframework.http.HttpStatus
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
/**
* @author DELL
*/
public
class
CommonResponseUtil
{
public
static
ResponseModel
<?>
success
()
{
ResponseModel
<?>
res
=
new
ResponseModel
();
res
.
setDevMessage
(
CommonConstant
.
RESULT_SUCCESS
);
res
.
setStatus
(
HttpStatus
.
OK
.
value
());
return
res
;
}
public
static
ResponseModel
<
Object
>
success
(
Object
obj
)
{
ResponseModel
<
Object
>
res
=
new
ResponseModel
<
Object
>();
res
.
setResult
(
obj
);
res
.
setDevMessage
(
CommonConstant
.
RESULT_SUCCESS
);
res
.
setStatus
(
HttpStatus
.
OK
.
value
());
return
res
;
}
public
static
ResponseModel
<
Object
>
success
(
Object
obj
,
String
message
)
{
ResponseModel
<
Object
>
res
=
new
ResponseModel
<
Object
>();
res
.
setResult
(
obj
);
res
.
setDevMessage
(
message
);
res
.
setStatus
(
HttpStatus
.
OK
.
value
());
return
res
;
}
public
static
ResponseModel
<?>
failure
()
{
ResponseModel
<?>
res
=
new
ResponseModel
();
res
.
setDevMessage
(
CommonConstant
.
RESULT_FAILURE
);
res
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
return
res
;
}
public
static
ResponseModel
<?>
failure
(
String
message
)
{
ResponseModel
<?>
res
=
new
ResponseModel
();
res
.
setDevMessage
(
CommonConstant
.
RESULT_FAILURE
);
res
.
setMessage
(
message
);
res
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
return
res
;
}
public
static
ResponseModel
<
Object
>
failure
(
Object
obj
,
String
message
)
{
ResponseModel
<
Object
>
res
=
new
ResponseModel
<
Object
>();
res
.
setResult
(
obj
);
res
.
setDevMessage
(
CommonConstant
.
RESULT_FAILURE
);
res
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
return
res
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AlertSubmittedController.java
View file @
b373d319
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
import
java.lang.reflect.Field
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled
;
...
@@ -17,20 +38,9 @@ import com.yeejoin.amos.boot.module.jcs.api.service.ITemplateService;
...
@@ -17,20 +38,9 @@ import com.yeejoin.amos.boot.module.jcs.api.service.ITemplateService;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.SchedulingReportingVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.SchedulingReportingVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.TemplateVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.TemplateVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
java.lang.reflect.Field
;
import
java.util.*
;
/**
/**
...
@@ -221,7 +231,7 @@ public class AlertSubmittedController extends BaseController {
...
@@ -221,7 +231,7 @@ public class AlertSubmittedController extends BaseController {
}
catch
(
IllegalAccessException
e
)
{
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
CommonResponseUtil
.
success
(
templateVos
);
return
ResponseHelper
.
buildResponse
(
templateVos
);
}
}
/**
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/UserController.java
View file @
b373d319
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
import
java.io.IOException
;
import
java.lang.reflect.Field
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.ByteArrayResource
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -9,7 +47,6 @@ import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
...
@@ -9,7 +47,6 @@ import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.RoleBo
;
import
com.yeejoin.amos.boot.biz.common.bo.RoleBo
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.RemoteSecurityService
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.RemoteSecurityService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
@@ -17,29 +54,10 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
...
@@ -17,29 +54,10 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.ByteArrayResource
;
import
org.springframework.http.*
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.io.IOException
;
import
java.lang.reflect.Field
;
import
java.util.*
;
/**
/**
* 获取用户信息
* 获取用户信息
...
@@ -273,7 +291,7 @@ public class UserController extends BaseController {
...
@@ -273,7 +291,7 @@ public class UserController extends BaseController {
}
}
}
}
return
CommonResponseUtil
.
success
(
map1
);
return
ResponseHelper
.
buildResponse
(
map1
);
}
}
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"文件上传(<font color='blue'>release</font>)"
,
notes
=
"文件上传"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"文件上传(<font color='blue'>release</font>)"
,
notes
=
"文件上传"
)
...
@@ -321,7 +339,7 @@ public class UserController extends BaseController {
...
@@ -321,7 +339,7 @@ public class UserController extends BaseController {
}
}
map1
.
put
(
"url"
,
url
);
map1
.
put
(
"url"
,
url
);
}
}
return
CommonResponseUtil
.
success
(
map1
);
return
ResponseHelper
.
buildResponse
(
map1
);
}
}
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/RemoteSecurityService.java
View file @
b373d319
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
...
@@ -14,15 +29,6 @@ import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
...
@@ -14,15 +29,6 @@ import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import
com.yeejoin.amos.feign.privilege.model.PermissionModel
;
import
com.yeejoin.amos.feign.privilege.model.PermissionModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.*
;
/***
/***
*
*
...
@@ -175,7 +181,7 @@ public class RemoteSecurityService {
...
@@ -175,7 +181,7 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
}
catch
(
InnerInvokException
e
)
{
throw
new
RuntimeException
();
throw
new
RuntimeException
();
}
}
ResponseModel
<
Object
>
commonResponse
=
CommonResponseUtil
.
success
(
dictionarieModel
);
ResponseModel
<
Object
>
commonResponse
=
ResponseHelper
.
buildResponse
(
dictionarieModel
);
return
commonResponse
;
return
commonResponse
;
}
}
...
...
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