Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv-springboot
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bsoft
sv-springboot
Commits
226631ad
Commit
226631ad
authored
Oct 28, 2019
by
Suvalue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口修改
parent
c858d449
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
9 deletions
+17
-9
bsoft-api/src/main/java/com/bsoft/api/common/Result.java
+3
-1
bsoft-api/src/main/java/com/bsoft/api/controller/BlockValuesController.java
+8
-3
bsoft-api/src/main/java/com/bsoft/api/controller/LoginController.java
+3
-3
bsoft-api/src/main/java/com/bsoft/api/controller/UserController.java
+1
-0
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/CodeAndPwd.java
+2
-2
No files found.
bsoft-api/src/main/java/com/bsoft/api/common/Result.java
View file @
226631ad
...
@@ -68,10 +68,12 @@ public class Result<T> {
...
@@ -68,10 +68,12 @@ public class Result<T> {
return
new
Result
(
errorCode
.
getCode
(),
errorCode
.
getEnMessage
(),
null
);
return
new
Result
(
errorCode
.
getCode
(),
errorCode
.
getEnMessage
(),
null
);
}
}
public
static
enum
ErrorCode
{
public
static
enum
ErrorCode
{
SUCCESS
(
1
,
"成功"
,
"success"
),
SUCCESS
(
1
,
"成功"
,
"success"
),
INVALID_TOKEN
(
401
,
"无效的TOKEN"
,
"invalid token"
),
INVALID_TOKEN
(
401
,
"无效的TOKEN"
,
"invalid token"
),
ERROR
(
400
,
"错误"
,
"error"
);
ERROR
(
400
,
"错误"
,
"error"
),
USERERROR
(
2
,
"账号或密码错误"
,
"wrong account or password"
);
private
int
code
;
private
int
code
;
private
String
cnMessage
;
private
String
cnMessage
;
private
String
enMessage
;
private
String
enMessage
;
...
...
bsoft-api/src/main/java/com/bsoft/api/controller/BlockValuesController.java
View file @
226631ad
...
@@ -16,6 +16,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -16,6 +16,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
springfox.documentation.annotations.ApiIgnore
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
import
java.util.Map
;
@Api
(
tags
=
"板块数值Api"
)
@Api
(
tags
=
"板块数值Api"
)
@RestController
@RestController
public
class
BlockValuesController
{
public
class
BlockValuesController
{
...
@@ -30,11 +33,12 @@ public class BlockValuesController {
...
@@ -30,11 +33,12 @@ public class BlockValuesController {
* @throws Exception
* @throws Exception
*/
*/
@GetMapping
(
"blockValues"
)
@GetMapping
(
"blockValues"
)
//
@Token
@Token
@ApiOperation
(
"根据Page查询板块数值"
)
@ApiOperation
(
"根据Page查询板块数值"
)
public
Object
getBlockValuesByPageID
(
@RequestBody
BlockValues
blockValues
){
public
Object
getBlockValuesByPageID
(
@RequestBody
BlockValues
blockValues
){
return
Result
.
success
(
blockValuesService
.
getBlockValuesByPageID
(
blockValues
.
getPageId
(),
blockValues
.
getDisease
(),
List
<
Map
<
String
,
Object
>>
list
=
blockValuesService
.
getBlockValuesByPageID
(
blockValues
.
getPageId
(),
blockValues
.
getDisease
(),
blockValues
.
getDoctor
(),
blockValues
.
getDepartment
(),
blockValues
.
getTime
()));
blockValues
.
getDoctor
(),
blockValues
.
getDepartment
(),
blockValues
.
getTime
());
return
Result
.
success
(
list
);
}
}
}
}
\ No newline at end of file
bsoft-api/src/main/java/com/bsoft/api/controller/LoginController.java
View file @
226631ad
...
@@ -21,13 +21,13 @@ public class LoginController {
...
@@ -21,13 +21,13 @@ public class LoginController {
@PostMapping
(
"login"
)
@PostMapping
(
"login"
)
@ApiOperation
(
"登录"
)
@ApiOperation
(
"登录"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
value
=
"登录名"
,
name
=
"loginName"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
value
=
"密码"
,
name
=
"password"
,
required
=
true
,
paramType
=
"query"
)})
public
Result
<
LoginService
.
LoginInfo
>
login
(
@RequestBody
CodeAndPwd
codeAndPwd
,
HttpServletRequest
request
){
public
Result
<
LoginService
.
LoginInfo
>
login
(
@RequestBody
CodeAndPwd
codeAndPwd
,
HttpServletRequest
request
){
String
ip
=
HttpUtil
.
getIP
(
request
);
String
ip
=
HttpUtil
.
getIP
(
request
);
LoginService
.
LoginInfo
loginInfo
=
loginServiceImpl
.
login
(
LoginService
.
LoginInfo
loginInfo
=
loginServiceImpl
.
login
(
codeAndPwd
.
getLoginName
(),
codeAndPwd
.
getPassword
(),
ip
);
codeAndPwd
.
getLoginName
(),
codeAndPwd
.
getPassword
(),
ip
);
if
(
loginInfo
==
null
){
return
Result
.
error
(
Result
.
ErrorCode
.
USERERROR
);
}
return
Result
.
success
(
loginInfo
);
return
Result
.
success
(
loginInfo
);
}
}
...
...
bsoft-api/src/main/java/com/bsoft/api/controller/UserController.java
View file @
226631ad
...
@@ -27,6 +27,7 @@ public class UserController {
...
@@ -27,6 +27,7 @@ public class UserController {
@GetMapping
()
@GetMapping
()
@ApiIgnore
public
Object
user
(
@CurrentUser@ApiIgnore
SysUser
user
){
public
Object
user
(
@CurrentUser@ApiIgnore
SysUser
user
){
return
Result
.
success
(
user
);
return
Result
.
success
(
user
);
}
}
...
...
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/CodeAndPwd.java
View file @
226631ad
...
@@ -5,9 +5,9 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -5,9 +5,9 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel
(
"账号密码"
)
@ApiModel
(
"账号密码"
)
public
class
CodeAndPwd
{
public
class
CodeAndPwd
{
@ApiModelProperty
(
nam
e
=
"账号"
,
required
=
true
)
@ApiModelProperty
(
valu
e
=
"账号"
,
required
=
true
)
String
loginName
;
String
loginName
;
@ApiModelProperty
(
nam
e
=
"密码"
,
required
=
true
)
@ApiModelProperty
(
valu
e
=
"密码"
,
required
=
true
)
String
password
;
String
password
;
public
String
getLoginName
()
{
public
String
getLoginName
()
{
...
...
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