Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
architecture
/
glsx-archetype
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 77d6d894
authored
Aug 10, 2023
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
swagger2升级openapi3
1 parent
76aacb69
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
glsx-archetype-parent/rest-admin-archetype/rest-admin/src/main/java/cn/com/glsx/admin/modules/LoginController.java
glsx-archetype-parent/rest-admin-archetype/rest-admin/src/main/java/cn/com/glsx/admin/modules/api/UserApiController.java
glsx-archetype-parent/rest-admin-archetype/rest-admin/src/main/java/cn/com/glsx/admin/modules/controller/UserController.java
glsx-archetype-parent/rest-admin-archetype/rest-admin/src/main/java/cn/com/glsx/admin/modules/LoginController.java
View file @
77d6d89
...
@@ -4,8 +4,8 @@ import cn.com.glsx.admin.modules.entity.User;
...
@@ -4,8 +4,8 @@ import cn.com.glsx.admin.modules.entity.User;
import
cn.com.glsx.admin.modules.service.UserDemoService
;
import
cn.com.glsx.admin.modules.service.UserDemoService
;
import
com.glsx.plat.common.annotation.SysLog
;
import
com.glsx.plat.common.annotation.SysLog
;
import
com.glsx.plat.core.web.R
;
import
com.glsx.plat.core.web.R
;
import
io.swagger.
annotations.Api
;
import
io.swagger.
v3.oas.annotations.Operation
;
import
io.swagger.
annotations.ApiOperation
;
import
io.swagger.
v3.oas.annotations.tags.Tag
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -19,7 +19,7 @@ import java.util.Map;
...
@@ -19,7 +19,7 @@ import java.util.Map;
* @author payu
* @author payu
*/
*/
@Slf4j
@Slf4j
@
Api
(
value
=
"登录登出"
,
tags
=
"登录登出
"
)
@
Tag
(
name
=
"登录登出(Demo)
"
)
@RestController
@RestController
public
class
LoginController
{
public
class
LoginController
{
...
@@ -30,7 +30,7 @@ public class LoginController {
...
@@ -30,7 +30,7 @@ public class LoginController {
* 登录
* 登录
*/
*/
@SysLog
@SysLog
@
ApiOperation
(
"登录接口"
)
@
Operation
(
summary
=
"登录接口"
,
description
=
"登录接口"
)
@PostMapping
(
value
=
"/login"
)
@PostMapping
(
value
=
"/login"
)
public
R
login
(
@RequestParam
String
account
,
@RequestParam
String
code
)
{
public
R
login
(
@RequestParam
String
account
,
@RequestParam
String
code
)
{
// User user = userService.findByPhone(account);
// User user = userService.findByPhone(account);
...
...
glsx-archetype-parent/rest-admin-archetype/rest-admin/src/main/java/cn/com/glsx/admin/modules/api/UserApiController.java
View file @
77d6d89
...
@@ -9,8 +9,8 @@ import cn.com.glsx.admin.modules.service.UserDemoService;
...
@@ -9,8 +9,8 @@ import cn.com.glsx.admin.modules.service.UserDemoService;
import
cn.com.glsx.echocenter.api.EchoCenterFeignClient
;
import
cn.com.glsx.echocenter.api.EchoCenterFeignClient
;
import
com.glsx.plat.core.annotation.ResponseResultBody
;
import
com.glsx.plat.core.annotation.ResponseResultBody
;
import
com.glsx.plat.core.web.Result
;
import
com.glsx.plat.core.web.Result
;
import
io.swagger.
annotations.Api
;
import
io.swagger.
v3.oas.annotations.Operation
;
import
io.swagger.
annotations.ApiOperation
;
import
io.swagger.
v3.oas.annotations.tags.Tag
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -23,7 +23,7 @@ import javax.annotation.Resource;
...
@@ -23,7 +23,7 @@ import javax.annotation.Resource;
* @author payu
* @author payu
*/
*/
@Slf4j
@Slf4j
@
Api
(
value
=
"用户开放接口"
,
tags
=
"用户开放接口
"
)
@
Tag
(
name
=
"用户开放接口(Demo)
"
)
@RestController
@RestController
@RequestMapping
(
value
=
"/api/user"
)
@RequestMapping
(
value
=
"/api/user"
)
@ResponseResultBody
@ResponseResultBody
...
@@ -39,7 +39,7 @@ public class UserApiController implements UserCenterFeignClient {
...
@@ -39,7 +39,7 @@ public class UserApiController implements UserCenterFeignClient {
private
DubboDemoService
dubboDemoService
;
private
DubboDemoService
dubboDemoService
;
@
ApiOperation
(
"FeignClient调用"
)
@
Operation
(
summary
=
"FeignClient调用"
)
@Override
@Override
@GetMapping
(
"/echo"
)
@GetMapping
(
"/echo"
)
public
String
echo
(
@RequestParam
String
message
)
{
public
String
echo
(
@RequestParam
String
message
)
{
...
@@ -47,7 +47,7 @@ public class UserApiController implements UserCenterFeignClient {
...
@@ -47,7 +47,7 @@ public class UserApiController implements UserCenterFeignClient {
return
echo
;
return
echo
;
}
}
@
ApiOperation
(
"Dubbo调用"
)
@
Operation
(
summary
=
"Dubbo调用"
)
@Override
@Override
@GetMapping
(
"/screenshot"
)
@GetMapping
(
"/screenshot"
)
public
String
screenshot
(
@RequestParam
String
url
)
{
public
String
screenshot
(
@RequestParam
String
url
)
{
...
@@ -55,7 +55,7 @@ public class UserApiController implements UserCenterFeignClient {
...
@@ -55,7 +55,7 @@ public class UserApiController implements UserCenterFeignClient {
return
imgUrl
;
return
imgUrl
;
}
}
@
ApiOperation
(
"本地调用"
)
@
Operation
(
summary
=
"本地调用"
)
@GetMapping
(
value
=
"/info/{id}"
)
@GetMapping
(
value
=
"/info/{id}"
)
public
UserDTO
info
(
@PathVariable
(
"id"
)
Long
id
)
{
public
UserDTO
info
(
@PathVariable
(
"id"
)
Long
id
)
{
User
user
=
userDemoService
.
getById
(
id
);
User
user
=
userDemoService
.
getById
(
id
);
...
@@ -63,7 +63,7 @@ public class UserApiController implements UserCenterFeignClient {
...
@@ -63,7 +63,7 @@ public class UserApiController implements UserCenterFeignClient {
return
result
;
return
result
;
}
}
@
ApiOperation
(
"本地调用"
)
@
Operation
(
summary
=
"本地调用"
)
@Override
@Override
@GetMapping
(
value
=
"/info2/{id}"
)
@GetMapping
(
value
=
"/info2/{id}"
)
public
Result
<
UserDTO
>
info2
(
@PathVariable
(
"id"
)
Long
id
)
{
public
Result
<
UserDTO
>
info2
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
glsx-archetype-parent/rest-admin-archetype/rest-admin/src/main/java/cn/com/glsx/admin/modules/controller/UserController.java
View file @
77d6d89
...
@@ -11,8 +11,8 @@ import com.github.pagehelper.PageHelper;
...
@@ -11,8 +11,8 @@ import com.github.pagehelper.PageHelper;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.context.utils.validator.AssertUtils
;
import
com.glsx.plat.context.utils.validator.AssertUtils
;
import
com.glsx.plat.core.annotation.ResponseResultBody
;
import
com.glsx.plat.core.annotation.ResponseResultBody
;
import
io.swagger.
annotations.Api
;
import
io.swagger.
v3.oas.annotations.Operation
;
import
io.swagger.
annotations.ApiOperation
;
import
io.swagger.
v3.oas.annotations.tags.Tag
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
* @author payu
* @author payu
*/
*/
@Slf4j
@Slf4j
@
Api
(
value
=
"用户接口"
,
tags
=
"用户接口
"
)
@
Tag
(
name
=
"用户接口(Demo)
"
)
@RestController
@RestController
@RequestMapping
(
value
=
"/user"
)
@RequestMapping
(
value
=
"/user"
)
@ResponseResultBody
@ResponseResultBody
...
@@ -33,7 +33,7 @@ public class UserController extends BaseController {
...
@@ -33,7 +33,7 @@ public class UserController extends BaseController {
@Autowired
@Autowired
private
UserDemoService
userDemoService
;
private
UserDemoService
userDemoService
;
@
ApiOperation
(
"分页查询用户"
)
@
Operation
(
summary
=
"分页查询用户"
,
description
=
"分页查询用户"
)
@GetMapping
(
"/search"
)
@GetMapping
(
"/search"
)
public
PageInfo
<
UserDTO
>
search
(
UserSearch
search
)
{
public
PageInfo
<
UserDTO
>
search
(
UserSearch
search
)
{
PageHelper
.
startPage
(
search
.
getPageNumber
(),
search
.
getPageSize
());
PageHelper
.
startPage
(
search
.
getPageNumber
(),
search
.
getPageSize
());
...
@@ -41,7 +41,7 @@ public class UserController extends BaseController {
...
@@ -41,7 +41,7 @@ public class UserController extends BaseController {
return
list
;
return
list
;
}
}
@
ApiOperation
(
"新增
用户"
)
@
Operation
(
summary
=
"新增用户"
,
description
=
"分页查询
用户"
)
@PostMapping
(
value
=
"/add"
)
@PostMapping
(
value
=
"/add"
)
public
UserDTO
add
(
@RequestBody
@Validated
UserBO
userBO
)
{
public
UserDTO
add
(
@RequestBody
@Validated
UserBO
userBO
)
{
User
user
=
UserConverter
.
INSTANCE
.
bo2do
(
userBO
);
User
user
=
UserConverter
.
INSTANCE
.
bo2do
(
userBO
);
...
@@ -50,7 +50,7 @@ public class UserController extends BaseController {
...
@@ -50,7 +50,7 @@ public class UserController extends BaseController {
return
result
;
return
result
;
}
}
@
ApiOperation
(
"编辑
用户"
)
@
Operation
(
summary
=
"编辑用户"
,
description
=
"分页查询
用户"
)
@PostMapping
(
value
=
"/edit"
)
@PostMapping
(
value
=
"/edit"
)
public
Integer
edit
(
@RequestBody
@Validated
UserBO
userBO
)
{
public
Integer
edit
(
@RequestBody
@Validated
UserBO
userBO
)
{
AssertUtils
.
isNull
(
userBO
.
getId
(),
"ID不能为空"
);
AssertUtils
.
isNull
(
userBO
.
getId
(),
"ID不能为空"
);
...
@@ -59,7 +59,7 @@ public class UserController extends BaseController {
...
@@ -59,7 +59,7 @@ public class UserController extends BaseController {
return
editCnt
;
return
editCnt
;
}
}
@
ApiOperation
(
"查询用户详情"
)
@
Operation
(
summary
=
"用户详情"
,
description
=
"查询用户详情"
)
@GetMapping
(
value
=
"/info/{id}"
)
@GetMapping
(
value
=
"/info/{id}"
)
public
UserDTO
info
(
@PathVariable
(
"id"
)
Long
id
)
{
public
UserDTO
info
(
@PathVariable
(
"id"
)
Long
id
)
{
User
user
=
userDemoService
.
getById
(
id
);
User
user
=
userDemoService
.
getById
(
id
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment