12345678910111213141516171819202122232425262728293031323334353637383940 |
- package logic
- import (
- "GtDataStore/app/cmd/organization/internal/svc"
- "GtDataStore/app/cmd/organization/pb"
- "context"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type GetAppInfoLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewGetAppInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetAppInfoLogic {
- return &GetAppInfoLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- func (l *GetAppInfoLogic) GetAppInfo(in *pb.GetAppInfoReq) (*pb.GetAppInfoResp, error) {
- appInfo, err := l.svcCtx.AppInfo.FindOneByAppName(l.ctx, in.AppName)
- if err != nil {
- return nil, err
- }
- return &pb.GetAppInfoResp{AppInfo: &pb.AppInfo{
- Id: appInfo.Id,
- AppName: appInfo.AppName,
- ProjectIds: appInfo.ProjectIds,
- Secret: appInfo.Secret,
- Status: appInfo.Status,
- ExpireAt: appInfo.ExpireAt.Format("2006-01-02 15:04:05"),
- CTime: appInfo.MTime.Format("2006-01-02 15:04:05"),
- }}, nil
- }
|