1.公众号订阅新增type类型

This commit is contained in:
2024-08-02 10:59:53 +08:00
committed by 牛叉闪闪
parent 0f4d9f0127
commit 9b868838f4
7 changed files with 33 additions and 18 deletions

View File

@@ -19,6 +19,8 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.*;
@@ -38,6 +40,7 @@ import java.util.List;
@RequiredArgsConstructor
public class CommonController {
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
private final ValidateCodeUtil validateCodeUtil;
@Autowired
@@ -213,10 +216,11 @@ public class CommonController {
*/
@PostMapping("/subMsg")
public Result subscribeWxAccount(@RequestBody WxMsgSubDTO wxMsgSubDTO) {
log.info("接收到订阅消息接口调用,携带数据: {}", wxMsgSubDTO);
if (wxMsgSubDTO.getOpenId() == null || wxMsgSubDTO.getShopId() == null) {
return Result.fail("shopId或openId缺失");
}
loginService.addShopId(wxMsgSubDTO.getOpenId(), wxMsgSubDTO.getShopId());
loginService.addShopId(wxMsgSubDTO.getOpenId(), wxMsgSubDTO.getShopId(), wxMsgSubDTO.getType());
return Result.success(CodeEnum.SUCCESS);
}
}