From 1a2b07f01ba4616fd9e894dddf474b56d020158c Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期一, 07 四月 2025 15:18:51 +0800
Subject: [PATCH] 整理版本

---
 pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/client/ClientSv.java |   86 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/client/ClientSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/client/ClientSv.java
new file mode 100644
index 0000000..08640b5
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/client/ClientSv.java
@@ -0,0 +1,86 @@
+package com.dy.pipIrrWechat.client;
+
+import com.dy.pipIrrGlobal.daoSe.SeClientMapper;
+import com.dy.pipIrrGlobal.daoSe.SeCodeVerifyMapper;
+import com.dy.pipIrrGlobal.daoSe.SeOpenIdMapper;
+import com.dy.pipIrrGlobal.pojoSe.SeCodeVerify;
+import com.dy.pipIrrGlobal.pojoSe.SeOpenId;
+import com.dy.pipIrrGlobal.voSe.VoClientWechat;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author ZhuBaoMin
+ * @date 2024-06-19 14:25
+ * @LastEditTime 2024-06-19 14:25
+ * @Description
+ */
+
+@Slf4j
+@Service
+public class ClientSv {
+    @Autowired
+    private SeClientMapper seClientMapper;
+    @Autowired
+    private SeCodeVerifyMapper seCodeVerifyMapper;
+    @Autowired
+    private SeOpenIdMapper seOpenIdMapper;
+
+    /**
+     * 鏍规嵁鐢佃瘽鍙风爜鑾峰彇鍐滄埛ID
+     * @param phoneNumber
+     * @return
+     */
+    public Long getClientIdByPhone(String phoneNumber) {
+        return seClientMapper.getClientIdByPhone(phoneNumber);
+    }
+
+    /**
+     * 娣诲姞寰俊鐢ㄦ埛璐︽埛璁板綍
+     * @param po
+     * @return
+     */
+    public Long addOpenId(SeOpenId po) {
+        seOpenIdMapper.insert(po);
+        //return po.getClientId();
+        return po.getId();
+    }
+
+    /**
+     * 娣诲姞楠岃瘉鐮佽褰�
+     * @param po
+     * @return
+     */
+    public Integer addCodeVerify(SeCodeVerify po) {
+        return seCodeVerifyMapper.insert(po);
+    }
+
+    /**
+     * 鏍规嵁鎵嬫満鍙疯幏鍙栭獙璇佺爜楠岃瘉瀵硅薄
+     * @param phoneNumber
+     * @return
+     */
+    public SeCodeVerify getCodeVerify(String phoneNumber) {
+        return seCodeVerifyMapper.getCodeVerify(phoneNumber);
+    }
+
+    /**
+     * 鑾峰彇鍐滄埛鍩烘湰淇℃伅锛屽皬绋嬪簭棣栭〉浣跨敤
+     * @param sessionId
+     * @return
+     */
+    public VoClientWechat getSimpleClientInfo(Long sessionId, String openId) {
+        return seClientMapper.getSimpleClientInfo(sessionId, openId);
+    }
+
+    /**
+     * 瑙g粦鍐滄埛涓庡井淇$殑缁戝畾锛屾牴鎹畇essionId鍒犻櫎缁戝畾璁板綍
+     * @param sessionId
+     * @return
+     */
+    public Integer unbindWechat(Long sessionId) {
+        return seOpenIdMapper.deleteByPrimaryKey(sessionId);
+    }
+
+}

--
Gitblit v1.8.0