add i18n support

This commit is contained in:
landaiqing
2024-11-12 22:59:39 +08:00
parent 97ca3fc7b0
commit ae743ba8a6
62 changed files with 4468 additions and 2797 deletions

View File

@@ -5,6 +5,7 @@ import (
"schisandra-album-cloud-microservices/app/auth/internal/svc"
"schisandra-album-cloud-microservices/app/auth/internal/types"
"schisandra-album-cloud-microservices/common/i18n"
"github.com/zeromicro/go-zero/core/logx"
)
@@ -25,6 +26,10 @@ func NewAccountLoginLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Acco
func (l *AccountLoginLogic) AccountLogin(req *types.AccountLoginRequest) (resp *types.LoginResponse, err error) {
// todo: add your logic here and delete this line
i18n.IsHasI18n(l.ctx)
text := i18n.FormatText(l.ctx, "user.name", "landaiqing")
return
return &types.LoginResponse{
AccessToken: text,
}, nil
}