mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
enhance: use require dbname for some db req (#38267)
Signed-off-by: lixinguo <xinguo.li@zilliz.com> Co-authored-by: lixinguo <xinguo.li@zilliz.com>
This commit is contained in:
parent
36946cc9ce
commit
0d4073bdd8
@ -81,9 +81,9 @@ func (h *HandlersV2) RegisterRoutesToV2(router gin.IRouter) {
|
||||
router.POST(CollectionCategory+ReleaseAction, timeoutMiddleware(wrapperPost(func() any { return &CollectionNameReq{} }, wrapperTraceLog(h.releaseCollection))))
|
||||
|
||||
router.POST(DataBaseCategory+CreateAction, timeoutMiddleware(wrapperPost(func() any { return &DatabaseReqWithProperties{} }, wrapperTraceLog(h.createDatabase))))
|
||||
router.POST(DataBaseCategory+DropAction, timeoutMiddleware(wrapperPost(func() any { return &DatabaseReq{} }, wrapperTraceLog(h.dropDatabase))))
|
||||
router.POST(DataBaseCategory+DropAction, timeoutMiddleware(wrapperPost(func() any { return &DatabaseReqRequiredName{} }, wrapperTraceLog(h.dropDatabase))))
|
||||
router.POST(DataBaseCategory+ListAction, timeoutMiddleware(wrapperPost(func() any { return &EmptyReq{} }, wrapperTraceLog(h.listDatabases))))
|
||||
router.POST(DataBaseCategory+DescribeAction, timeoutMiddleware(wrapperPost(func() any { return &DatabaseReq{} }, wrapperTraceLog(h.describeDatabase))))
|
||||
router.POST(DataBaseCategory+DescribeAction, timeoutMiddleware(wrapperPost(func() any { return &DatabaseReqRequiredName{} }, wrapperTraceLog(h.describeDatabase))))
|
||||
router.POST(DataBaseCategory+AlterAction, timeoutMiddleware(wrapperPost(func() any { return &DatabaseReqWithProperties{} }, wrapperTraceLog(h.alterDatabase))))
|
||||
// Query
|
||||
router.POST(EntityCategory+QueryAction, restfulSizeMiddleware(timeoutMiddleware(wrapperPost(func() any {
|
||||
|
||||
@ -35,6 +35,12 @@ type DatabaseReq struct {
|
||||
|
||||
func (req *DatabaseReq) GetDbName() string { return req.DbName }
|
||||
|
||||
type DatabaseReqRequiredName struct {
|
||||
DbName string `json:"dbName" binding:"required"`
|
||||
}
|
||||
|
||||
func (req *DatabaseReqRequiredName) GetDbName() string { return req.DbName }
|
||||
|
||||
type DatabaseReqWithProperties struct {
|
||||
DbName string `json:"dbName" binding:"required"`
|
||||
Properties map[string]interface{} `json:"properties"`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user