You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

getpublicimagelogic.go 1.0 kB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package core
  2. import (
  3. "context"
  4. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
  5. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types"
  6. "github.com/zeromicro/go-zero/core/logx"
  7. )
  8. type GetPublicImageLogic struct {
  9. logx.Logger
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. }
  13. func NewGetPublicImageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetPublicImageLogic {
  14. return &GetPublicImageLogic{
  15. Logger: logx.WithContext(ctx),
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. }
  19. }
  20. func (l *GetPublicImageLogic) GetPublicImage(req *types.PublicImageReq) (resp *types.PublicImageResp, err error) {
  21. // todo: add your logic here and delete this line
  22. resp = &types.PublicImageResp{}
  23. var iamgeDict []types.ImageDict
  24. sqlStrTask := "SELECT * FROM `vm_image_dict`"
  25. txTask := l.svcCtx.DbEngin.Raw(sqlStrTask).Scan(&iamgeDict)
  26. if txTask.Error != nil {
  27. logx.Error(err)
  28. return nil, txTask.Error
  29. }
  30. resp.Code = 200
  31. resp.Message = "success"
  32. resp.ImageDict = iamgeDict
  33. return resp, nil
  34. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.