dev-discount
parent
9118cff941
commit
ed38148fe7
@ -0,0 +1,58 @@ |
||||
package com.cweb.controller; |
||||
|
||||
import com.hai.common.security.SessionObject; |
||||
import com.hai.common.security.UserCenter; |
||||
import com.hai.common.utils.ResponseMsgUtil; |
||||
import com.hai.model.HighUserModel; |
||||
import com.hai.model.ResponseData; |
||||
import com.hai.service.HighUserService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RequestMethod; |
||||
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
|
||||
/** |
||||
* @Auther: 袁野 |
||||
* @Description: |
||||
* @Date: 2021/3/30 22:50 |
||||
*/ |
||||
@Controller |
||||
@RequestMapping(value = "/highUser") |
||||
@Api(value = "用户接口") |
||||
public class HighUserController { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(HighMerchantStoreController.class); |
||||
|
||||
@Autowired |
||||
private UserCenter userCenter; |
||||
|
||||
@Resource |
||||
private HighUserService highUserService; |
||||
|
||||
@RequestMapping(value = "/findUser", method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "根据id查询详情") |
||||
public ResponseData findById( HttpServletRequest request) { |
||||
try { |
||||
|
||||
// 用户
|
||||
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); |
||||
|
||||
return ResponseMsgUtil.success(highUserService.findByUserId(userInfoModel.getHighUser().getId())); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighUserController --> findByUserId() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue