Compare commits

..

3 Commits

Author SHA1 Message Date
53701d61f8 Merge branch 'master' into kd-live 2023-06-23 16:27:35 +09:00
6d02eb092c 로그 추가 2023-06-23 16:27:31 +09:00
21d4080baa 서비스가 없을 때 빈 서비스 만들어 줌 2023-06-23 15:07:17 +09:00
2 changed files with 11 additions and 0 deletions

View File

@ -483,6 +483,15 @@ func (mg *Maingate) RegisterHandlers(ctx context.Context, serveMux *http.ServeMu
}
empty.prepare(mg)
atomic.StorePointer(&mg.serviceptr, unsafe.Pointer(&empty))
filter := bson.M{"_id": empty.Id}
_, _, err := mg.mongoClient.Update(CollectionService, filter, bson.M{
"$set": &empty,
}, options.Update().SetUpsert(true))
if err != nil {
return err
}
}
logger.Println("Service is registered :", mg.service().ServiceCode)

View File

@ -606,6 +606,8 @@ func (sh *serviceDescription) ServeHTTP(w http.ResponseWriter, r *http.Request)
r.Body.Close()
}()
logger.Println("serviceDesc :", sh.ServiceCode, r.URL.Path)
if strings.HasSuffix(r.URL.Path, "/auth") {
sh.authorize(w, r)
} else if strings.HasSuffix(r.URL.Path, "/link") {