| | |
| | | package com.doumee.api; |
| | | |
| | | import com.doumee.config.Jwt.JwtTokenUtil; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.SecurityUtils; |
| | |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Controller基类 |
| | |
| | | return request; |
| | | } |
| | | |
| | | /** |
| | | * 获取用户ID |
| | | * |
| | | * @return |
| | | */ |
| | | protected Integer getMemberId() { |
| | | Object obj = this.getRequest().getAttribute(JwtTokenUtil.UserId_Name); |
| | | return obj != null ? (Integer) obj : null; |
| | | } |
| | | |
| | | public List<Integer> getIdList(String ids){ |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | return idList; |
| | | } |
| | | |
| | | } |