Commit b4a2604d by whl

Merge remote-tracking branch 'origin/dev' into dev

parents c33b2525 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;
......
...@@ -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
...@@ -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);
} }
......
...@@ -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);
} }
......
...@@ -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(name="账号",required = true) @ApiModelProperty(value="账号",required = true)
String loginName; String loginName;
@ApiModelProperty(name="密码",required = true) @ApiModelProperty(value="密码",required = true)
String password; String password;
public String getLoginName() { public String getLoginName() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment