liuyong_awesome 4 anni fa
commit
3a1f001ec9
6 ha cambiato i file con 53 aggiunte e 0 eliminazioni
  1. 8 0
      .idea/.gitignore
  2. 9 0
      .idea/go_chat_api_util.iml
  3. 8 0
      .idea/modules.xml
  4. 6 0
      .idea/vcs.xml
  5. 21 0
      common.go
  6. 1 0
      go.mod

+ 8 - 0
.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/

+ 9 - 0
.idea/go_chat_api_util.iml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="Go" enabled="true" />
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/go_chat_api_util.iml" filepath="$PROJECT_DIR$/.idea/go_chat_api_util.iml" />
+    </modules>
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 21 - 0
common.go

@@ -0,0 +1,21 @@
+package go_chat_api_util
+func GetMusk(phone string) string {
+	if phone == "" {
+		return phone
+	}
+	phoneMask := ""
+	list := []byte(phone)
+	lenS := len(phone)
+	if lenS > 7 {
+		asterisk := ""
+		for i := 0; i < lenS-7; i++ {
+			asterisk += "*"
+		}
+		phoneMask = string(list[:3]) + asterisk + string(list[lenS-4:])
+	} else if lenS >= 5 {
+		phoneMask = string(list[:2]) + "**" + string(list[lenS-2:])
+	} else {
+		phoneMask = phone
+	}
+	return phoneMask
+}

+ 1 - 0
go.mod

@@ -0,0 +1 @@
+module "gitdxz.51daxuetong.cn/go_dev/go_chat_api_util"