package tool import ( "data_ai/clean" "encoding/json" log "github.com/donnie4w/go-logger/logger" "io/ioutil" "net/http" "sync" ) var datalock sync.Mutex func InitCleanDeepSeekService() { //提取地域信息 http.HandleFunc("/clean/deepseek", func(w http.ResponseWriter, r *http.Request) { datalock.Lock() data, _ := ioutil.ReadAll(r.Body) tmp := map[string]interface{}{} err := json.Unmarshal([]byte(data), &tmp) if err != nil { log.Debug(err) } info := clean.CleanDeepSeekInfo(tmp, map[string]interface{}{}) res, _ := json.Marshal(info) w.Write(res) datalock.Unlock() }) log.Debug("初始化接口完毕...") }