| 1234567891011121314151617181920212223242526272829303132333435 |
- package cn.com.goldenwater.dcproj.controller.util;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.constValue.CommonLabel;
- import cn.com.goldenwater.dcproj.model.WeiXinMsg;
- import cn.com.goldenwater.dcproj.service.impl.RedisDataCenterReceiver;
- import cn.com.goldenwater.dcproj.utils.RedisOperator;
- import com.alibaba.fastjson.JSON;
- import io.swagger.annotations.Api;
- import net.sf.json.JSONObject;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.data.redis.core.RedisTemplate;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.*;
- @Api(value = "webSocket相关接口", tags = "webSocket相关接口")
- @RestController
- @RequestMapping("/wx/call/back")
- public class WeiXinRecvController extends BaseController {
- @Autowired
- private RedisTemplate redisTemplate;
- protected static final Logger LOGGER = LoggerFactory.getLogger(RedisDataCenterReceiver.class);
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<WeiXinMsg> recvMsg(@RequestBody WeiXinMsg weiXinMsg) {
- //JSONObject jsonObject = JSONObject.fromObject(weiXinMsg);
- redisTemplate.convertAndSend(CommonLabel.SEND_TO_WEI_XIN, JSON.toJSONString(weiXinMsg));
- //LOGGER.info(jsonObject.toString());
- return buildSuccessResponse(weiXinMsg);
- }
- }
|