tianyun 1 anno fa
parent
commit
c49823e5d3
1 ha cambiato i file con 22 aggiunte e 0 eliminazioni
  1. 22 0
      sh_config.sh

+ 22 - 0
sh_config.sh

@@ -300,4 +300,26 @@ function mvn_push_test() {
 }
 function mvn_clean_deploy() {
     mvn clean deploy -Dmaven.test.skip=true
+}
+
+
+memo() {
+    # 获取传入的参数
+    updatedContent="#速记 "$1
+
+    # 构建请求体数据
+    data="{\"content\": \"$updatedContent\"}"
+
+    # 发送请求
+    response=$(curl -X POST -H "Content-Type: application/json" \
+    -H "Authorization: bearer eyJhbGciOiJIUzI1NiIsImtpZCI6InYxIiwidHlwIjoiSldUIn0.eyJuYW1lIjoidGlhbnl1bnBlcmZlY3QiLCJpc3MiOiJtZW1vcyIsInN1YiI6IjEiLCJhdWQiOlsidXNlci5hY2Nlc3MtdG9rZW4iXSwiaWF0IjoxNzA5MTc5NTUyfQ.LFxWB4efya1sL7VoJ42xpXxbAip-udT_Kx2OwZ8Y3-E" \
+    -d "$data" \
+    "https://memos.tianyunperfect.cn/api/v1/memo")
+
+    # 判断是否存在name字段
+    if [[ $response == *"name"* ]]; then
+        echo "记录成功 https://memos.tianyunperfect.cn"
+    else
+        echo "失败" $response
+    fi
 }