You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/internal/servants/web/site.go

40 lines
882 B

// Copyright 2023 ROC. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package web
import (
"github.com/alimy/mir/v4"
api "github.com/rocboss/paopao-ce/auto/api/v1"
"github.com/rocboss/paopao-ce/internal/conf"
"github.com/rocboss/paopao-ce/internal/model/web"
"github.com/rocboss/paopao-ce/internal/servants/base"
"github.com/rocboss/paopao-ce/pkg/version"
)
var (
_ api.Site = (*siteSrv)(nil)
)
type siteSrv struct {
api.UnimplementedSiteServant
*base.BaseServant
}
func (*siteSrv) Profile() (*web.SiteProfileResp, mir.Error) {
return conf.WebProfileSetting, nil
}
func (*siteSrv) Version() (*web.VersionResp, mir.Error) {
return &web.VersionResp{
BuildInfo: version.ReadBuildInfo(),
}, nil
}
func newSiteSrv() api.Site {
return &siteSrv{
BaseServant: base.NewBaseServant(),
}
}