Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
smartDevices-platform-service
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 0d3b851d
authored
Mar 05, 2021
by
111-PC\111
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]swagger添加
1 parent
602aa77a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
pom.xml
src/main/java/cn/com/glsx/modules/controller/UserController.java
src/main/java/cn/com/glsx/modules/service/UserService.java
pom.xml
View file @
0d3b851
...
@@ -40,6 +40,16 @@
...
@@ -40,6 +40,16 @@
<artifactId>
rest-admin-redis
</artifactId>
<artifactId>
rest-admin-redis
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.glsx
</groupId>
<artifactId>
rest-admin-mybatis
</artifactId>
<version>
1.1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.glsx
</groupId>
<artifactId>
rest-admin-swagger2
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
src/main/java/cn/com/glsx/modules/controller/UserController.java
View file @
0d3b851
...
@@ -5,6 +5,8 @@ import cn.com.glsx.modules.model.param.UserInfo;
...
@@ -5,6 +5,8 @@ import cn.com.glsx.modules.model.param.UserInfo;
import
cn.com.glsx.modules.service.UserService
;
import
cn.com.glsx.modules.service.UserService
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.glsx.plat.core.web.R
;
import
com.glsx.plat.core.web.R
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
...
@@ -22,6 +24,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
...
@@ -22,6 +24,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
*/
*/
@Controller
@Controller
@RequestMapping
(
"/user"
)
@RequestMapping
(
"/user"
)
@Api
(
value
=
"用户模块"
,
tags
=
{
"用户模块"
})
public
class
UserController
{
public
class
UserController
{
@Autowired
@Autowired
...
@@ -35,6 +38,7 @@ public class UserController {
...
@@ -35,6 +38,7 @@ public class UserController {
*/
*/
@RequestMapping
(
value
=
"/registerUser"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/registerUser"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
@ApiOperation
(
value
=
"注册用户"
)
public
R
registerUser
(
@RequestBody
UserBo
userBo
)
{
public
R
registerUser
(
@RequestBody
UserBo
userBo
)
{
String
uid
=
userService
.
registerUser
(
userBo
);
String
uid
=
userService
.
registerUser
(
userBo
);
if
(
StringUtils
.
isNotBlank
(
uid
)){
if
(
StringUtils
.
isNotBlank
(
uid
)){
...
@@ -52,6 +56,7 @@ public class UserController {
...
@@ -52,6 +56,7 @@ public class UserController {
*/
*/
@RequestMapping
(
value
=
"/info/{id}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/info/{id}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
@ApiOperation
(
value
=
"查询用户"
)
public
R
getUserInfo
(
@PathVariable
String
id
)
{
public
R
getUserInfo
(
@PathVariable
String
id
)
{
UserInfo
userInfo
=
userService
.
getUserInfo
(
id
);
UserInfo
userInfo
=
userService
.
getUserInfo
(
id
);
return
R
.
ok
(
JSONObject
.
toJSONString
(
userInfo
));
return
R
.
ok
(
JSONObject
.
toJSONString
(
userInfo
));
...
...
src/main/java/cn/com/glsx/modules/service/UserService.java
View file @
0d3b851
package
cn
.
com
.
glsx
.
modules
.
service
;
package
cn
.
com
.
glsx
.
modules
.
service
;
import
cn.com.glsx.modules.mapper.TuyaUserMapper
;
import
cn.com.glsx.modules.model.param.ResponseBody
;
import
cn.com.glsx.modules.model.param.ResponseBody
;
import
cn.com.glsx.modules.model.param.UserBo
;
import
cn.com.glsx.modules.model.param.UserBo
;
import
cn.com.glsx.modules.model.param.UserInfo
;
import
cn.com.glsx.modules.model.param.UserInfo
;
...
@@ -30,9 +31,6 @@ public class UserService {
...
@@ -30,9 +31,6 @@ public class UserService {
@Value
(
"${tuya.getUserInfoUrl}"
)
@Value
(
"${tuya.getUserInfoUrl}"
)
private
String
getUserInfoUrl
;
private
String
getUserInfoUrl
;
@Value
(
"${tuya.sign_method}"
)
private
String
sign_method
;
@Value
(
"${tuya.client_id}"
)
@Value
(
"${tuya.client_id}"
)
private
String
client_id
;
private
String
client_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