dev-discount
parent
2650933acb
commit
24832dbdf1
@ -0,0 +1,103 @@ |
|||||||
|
package com.cweb.controller; |
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper; |
||||||
|
import com.github.pagehelper.PageInfo; |
||||||
|
import com.hai.common.exception.ErrorCode; |
||||||
|
import com.hai.common.exception.ErrorHelp; |
||||||
|
import com.hai.common.exception.SysCode; |
||||||
|
import com.hai.common.security.SessionObject; |
||||||
|
import com.hai.common.security.UserCenter; |
||||||
|
import com.hai.common.utils.ResponseMsgUtil; |
||||||
|
import com.hai.entity.BsMsg; |
||||||
|
import com.hai.model.HighUserModel; |
||||||
|
import com.hai.model.ResponseData; |
||||||
|
import com.hai.model.UserInfoModel; |
||||||
|
import com.hai.service.BsMsgService; |
||||||
|
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.*; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
import javax.servlet.http.HttpServletRequest; |
||||||
|
import java.util.Date; |
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author sum1dream |
||||||
|
*/ |
||||||
|
@Controller |
||||||
|
@RequestMapping(value = "/bsMsg") |
||||||
|
@Api(value = "站内信") |
||||||
|
public class BsMsgController { |
||||||
|
|
||||||
|
Logger log = LoggerFactory.getLogger(BsMsgController.class); |
||||||
|
|
||||||
|
@Resource |
||||||
|
private BsMsgService bsMsgService; |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private UserCenter userCenter; |
||||||
|
|
||||||
|
@RequestMapping(value = "/getMsgByList", method = RequestMethod.GET) |
||||||
|
@ResponseBody |
||||||
|
@ApiOperation(value = "查询站内信列表") |
||||||
|
public ResponseData getMsgByList( |
||||||
|
@RequestParam(value = "type", required = false) Integer type, |
||||||
|
@RequestParam(value = "jumpType", required = false) Integer jumpType, |
||||||
|
@RequestParam(value = "msgType", required = false) Integer msgType, |
||||||
|
@RequestParam(value = "title", required = false) String title, |
||||||
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||||
|
@RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request |
||||||
|
) { |
||||||
|
try { |
||||||
|
|
||||||
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||||
|
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); |
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<>(5); |
||||||
|
|
||||||
|
map.put("type", type); |
||||||
|
map.put("jumpType", jumpType); |
||||||
|
map.put("msgType", msgType); |
||||||
|
map.put("title", title); |
||||||
|
map.put("companyId" , userInfoModel.getBsCompany().getId()); |
||||||
|
|
||||||
|
PageHelper.startPage(pageNum,pageSize); |
||||||
|
|
||||||
|
List<BsMsg> list = bsMsgService.getMsgByList(map); |
||||||
|
return ResponseMsgUtil.success(new PageInfo<>(list)); |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.error("BsMsgController --> getMsgByList() error!", e); |
||||||
|
return ResponseMsgUtil.exception(e); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@RequestMapping(value = "/checkMsg", method = RequestMethod.GET) |
||||||
|
@ResponseBody |
||||||
|
@ApiOperation(value = "查看站内信") |
||||||
|
public ResponseData checkMsg(@RequestParam(value = "msgId", required = false) Long msgId, HttpServletRequest request) { |
||||||
|
try { |
||||||
|
|
||||||
|
// 用户
|
||||||
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||||
|
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return ResponseMsgUtil.success(null); |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.error("HighOrderController -> addOrder() error!", e); |
||||||
|
return ResponseMsgUtil.exception(e); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue