|
- package mq
-
- import (
- "gitlink.org.cn/cloudream/common/consts/errorcode"
- "gitlink.org.cn/cloudream/common/pkgs/logger"
-
- "gitlink.org.cn/cloudream/common/pkgs/mq"
- coormq "gitlink.org.cn/cloudream/storage2/common/pkgs/mq/coordinator"
- )
-
- func (svc *Service) GetStorage(msg *coormq.GetStorage) (*coormq.GetStorageResp, *mq.CodeMessage) {
- stg, err := svc.db.Storage().GetByID(svc.db.DefCtx(), msg.StorageID)
- if err != nil {
- logger.Warnf("getting user storage: %s", err.Error())
- return nil, mq.Failed(errorcode.OperationFailed, "get user storage failed")
- }
-
- return mq.ReplyOK(coormq.RespGetStorage(stg))
- }
|