Some checks failed
Build docker and publish / build (20.15.1) (push) Has been cancelled
41 lines
986 B
Go
41 lines
986 B
Go
package common
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/perfect-panel/server/internal/svc"
|
|
"github.com/perfect-panel/server/internal/types"
|
|
"github.com/perfect-panel/server/pkg/logger"
|
|
)
|
|
|
|
type GetAppVersionLogic struct {
|
|
logger.Logger
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
}
|
|
|
|
// NewGetAppVersionLogic 获取 App 版本信息
|
|
func NewGetAppVersionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetAppVersionLogic {
|
|
return &GetAppVersionLogic{
|
|
Logger: logger.WithContext(ctx),
|
|
ctx: ctx,
|
|
svcCtx: svcCtx,
|
|
}
|
|
}
|
|
|
|
// GetAppVersion 根据平台返回最新版本信息
|
|
func (l *GetAppVersionLogic) GetAppVersion(req *types.GetAppVersionRequest) (resp *types.ApplicationVersion, err error) {
|
|
// TODO: 后续对接数据库实现
|
|
resp = &types.ApplicationVersion{
|
|
Version: "1.0.0",
|
|
MinVersion: "1.0.0",
|
|
ForceUpdate: false,
|
|
Description: map[string]string{
|
|
"zh-CN": "初始版本",
|
|
"en-US": "Initial version",
|
|
},
|
|
IsDefault: true,
|
|
}
|
|
return
|
|
}
|