Commit 4c159a83 authored by licc's avatar licc

修改退出登录接口

parent e7afc37d
package cn.wisenergy.model.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author 86187
*/
@Data
@ApiModel("LoginOutVo")
public class LoginOutVo implements Serializable {
private static final long serialVersionUID = -307447260120718038L;
/**
* 用户id
*/
@ApiModelProperty(value = "用户id", name = "userId")
private Integer userId;
}
...@@ -678,11 +678,32 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -678,11 +678,32 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
} }
/**
* 超过限定展示方案条数,要帅选
*
* @param list 所以方案数据
* @param total 限定展示方案条数
* @return 筛选结果
*/
private List<Volunteer> getVolunteerList(List<Volunteer> list, Integer total) { private List<Volunteer> getVolunteerList(List<Volunteer> list, Integer total) {
List<Volunteer> result = new ArrayList<>(); List<Volunteer> result = new ArrayList<>();
result.add(list.get(0));
List<Volunteer> otherList = new ArrayList<>(); List<Volunteer> otherList = new ArrayList<>();
List<String> grades = new ArrayList<>();
grades.add(list.get(0).getLowestMark());
for (Volunteer volunteer : list) { for (Volunteer volunteer : list) {
if (!grades.contains(volunteer.getLowestMark()) && result.size() <= total) {
grades.add(volunteer.getLowestMark());
result.add(volunteer);
} else {
otherList.add(volunteer);
}
}
if (result.size() < total) {
int number = total - result.size();
List<Volunteer> volunteers = otherList.subList(0, number);
result.addAll(volunteers);
} }
return result; return result;
......
...@@ -3,10 +3,7 @@ package cn.wisenergy.web.admin.controller.app; ...@@ -3,10 +3,7 @@ package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.utils.R; import cn.wisenergy.common.utils.R;
import cn.wisenergy.model.app.Banner; import cn.wisenergy.model.app.Banner;
import cn.wisenergy.model.vo.UpdatePasswordVo; import cn.wisenergy.model.vo.*;
import cn.wisenergy.model.vo.UserInfoVo;
import cn.wisenergy.model.vo.UserLoginVo;
import cn.wisenergy.model.vo.UserRegisterVo;
import cn.wisenergy.service.app.UserLoginService; import cn.wisenergy.service.app.UserLoginService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -14,10 +11,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -14,10 +11,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
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.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* @author 86187 * @author 86187
...@@ -77,14 +71,15 @@ public class UserLoginController { ...@@ -77,14 +71,15 @@ public class UserLoginController {
@ApiOperation(value = "退出登录", notes = "退出登录", httpMethod = "POST") @ApiOperation(value = "退出登录", notes = "退出登录", httpMethod = "POST")
@ApiImplicitParam(name = "outVo", value = "退出用户信息", dataType = "LoginOutVo")
@PostMapping("/loginOut") @PostMapping("/loginOut")
public R<Boolean> loginOut(Integer userId) { public R<Boolean> loginOut(@RequestBody LoginOutVo outVo) {
log.info("volunteer-service[]UserLongController[]loginOut[]input.param.userId:" + userId); log.info("volunteer-service[]UserLongController[]loginOut[]input.param.outVo:" + outVo);
if (null == userId) { if (null == outVo || null == outVo.getUserId()) {
return R.error("入参不能为空!"); return R.error("入参不能为空!");
} }
return userLoginService.loginOut(userId); return userLoginService.loginOut(outVo.getUserId());
} }
@ApiOperation(value = "修改用户密码", notes = "修改用户密码", httpMethod = "POST") @ApiOperation(value = "修改用户密码", notes = "修改用户密码", httpMethod = "POST")
......
...@@ -44,18 +44,18 @@ spring: ...@@ -44,18 +44,18 @@ spring:
# 总限制 # 总限制
max-request-size: 10MB max-request-size: 10MB
# redis: redis:
# database: 0 database: 0
# host: localhost host: 192.168.110.165
# port: 6379 port: 6379
# password: root # 密码(默认为空) password: # 密码(默认为空)
# timeout: 6000ms # 连接超时时长(毫秒) timeout: 6000ms # 连接超时时长(毫秒)
# jedis: jedis:
# pool: pool:
# max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
# max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
# max-idle: 10 # 连接池中的最大空闲连接 max-idle: 10 # 连接池中的最大空闲连接
# min-idle: 5 # 连接池中的最小空闲连 min-idle: 5 # 连接池中的最小空闲连
###上传文件配置 :该配置可根据部署的系统或开发人员自定义路径,每次部署之前需要修改location ###上传文件配置 :该配置可根据部署的系统或开发人员自定义路径,每次部署之前需要修改location
uploadFile: uploadFile:
resourceHandler: /upload_flowChart/** #请求 url 中的资源映射也是保存到数据库中的父级路径 resourceHandler: /upload_flowChart/** #请求 url 中的资源映射也是保存到数据库中的父级路径
......
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