mirror of https://github.com/rocboss/paopao-ce
commit
335d6e0e7d
@ -1,173 +0,0 @@
|
||||
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
|
||||
//
|
||||
// Source: core/v1/auth.proto
|
||||
|
||||
package corev1connect
|
||||
|
||||
import (
|
||||
connect "connectrpc.com/connect"
|
||||
context "context"
|
||||
errors "errors"
|
||||
v1 "github.com/rocboss/paopao-ce/auto/rpc/core/v1"
|
||||
http "net/http"
|
||||
strings "strings"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file and the connect package are
|
||||
// compatible. If you get a compiler error that this constant is not defined, this code was
|
||||
// generated with a version of connect newer than the one compiled into your binary. You can fix the
|
||||
// problem by either regenerating this code with an older version of connect or updating the connect
|
||||
// version compiled into your binary.
|
||||
const _ = connect.IsAtLeastVersion1_13_0
|
||||
|
||||
const (
|
||||
// AuthenticateServiceName is the fully-qualified name of the AuthenticateService service.
|
||||
AuthenticateServiceName = "core.v1.AuthenticateService"
|
||||
)
|
||||
|
||||
// These constants are the fully-qualified names of the RPCs defined in this package. They're
|
||||
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
|
||||
//
|
||||
// Note that these are different from the fully-qualified method names used by
|
||||
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
|
||||
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
|
||||
// period.
|
||||
const (
|
||||
// AuthenticateServicePreLoginProcedure is the fully-qualified name of the AuthenticateService's
|
||||
// preLogin RPC.
|
||||
AuthenticateServicePreLoginProcedure = "/core.v1.AuthenticateService/preLogin"
|
||||
// AuthenticateServiceLoginProcedure is the fully-qualified name of the AuthenticateService's login
|
||||
// RPC.
|
||||
AuthenticateServiceLoginProcedure = "/core.v1.AuthenticateService/login"
|
||||
// AuthenticateServiceLogoutProcedure is the fully-qualified name of the AuthenticateService's
|
||||
// logout RPC.
|
||||
AuthenticateServiceLogoutProcedure = "/core.v1.AuthenticateService/logout"
|
||||
)
|
||||
|
||||
// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package.
|
||||
var (
|
||||
authenticateServiceServiceDescriptor = v1.File_core_v1_auth_proto.Services().ByName("AuthenticateService")
|
||||
authenticateServicePreLoginMethodDescriptor = authenticateServiceServiceDescriptor.Methods().ByName("preLogin")
|
||||
authenticateServiceLoginMethodDescriptor = authenticateServiceServiceDescriptor.Methods().ByName("login")
|
||||
authenticateServiceLogoutMethodDescriptor = authenticateServiceServiceDescriptor.Methods().ByName("logout")
|
||||
)
|
||||
|
||||
// AuthenticateServiceClient is a client for the core.v1.AuthenticateService service.
|
||||
type AuthenticateServiceClient interface {
|
||||
PreLogin(context.Context, *connect.Request[v1.User]) (*connect.Response[v1.ActionReply], error)
|
||||
Login(context.Context, *connect.Request[v1.User]) (*connect.Response[v1.LoginReply], error)
|
||||
Logout(context.Context, *connect.Request[v1.User]) (*connect.Response[v1.ActionReply], error)
|
||||
}
|
||||
|
||||
// NewAuthenticateServiceClient constructs a client for the core.v1.AuthenticateService service. By
|
||||
// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,
|
||||
// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
|
||||
// connect.WithGRPC() or connect.WithGRPCWeb() options.
|
||||
//
|
||||
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
|
||||
// http://api.acme.com or https://acme.com/grpc).
|
||||
func NewAuthenticateServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AuthenticateServiceClient {
|
||||
baseURL = strings.TrimRight(baseURL, "/")
|
||||
return &authenticateServiceClient{
|
||||
preLogin: connect.NewClient[v1.User, v1.ActionReply](
|
||||
httpClient,
|
||||
baseURL+AuthenticateServicePreLoginProcedure,
|
||||
connect.WithSchema(authenticateServicePreLoginMethodDescriptor),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
login: connect.NewClient[v1.User, v1.LoginReply](
|
||||
httpClient,
|
||||
baseURL+AuthenticateServiceLoginProcedure,
|
||||
connect.WithSchema(authenticateServiceLoginMethodDescriptor),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
logout: connect.NewClient[v1.User, v1.ActionReply](
|
||||
httpClient,
|
||||
baseURL+AuthenticateServiceLogoutProcedure,
|
||||
connect.WithSchema(authenticateServiceLogoutMethodDescriptor),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
// authenticateServiceClient implements AuthenticateServiceClient.
|
||||
type authenticateServiceClient struct {
|
||||
preLogin *connect.Client[v1.User, v1.ActionReply]
|
||||
login *connect.Client[v1.User, v1.LoginReply]
|
||||
logout *connect.Client[v1.User, v1.ActionReply]
|
||||
}
|
||||
|
||||
// PreLogin calls core.v1.AuthenticateService.preLogin.
|
||||
func (c *authenticateServiceClient) PreLogin(ctx context.Context, req *connect.Request[v1.User]) (*connect.Response[v1.ActionReply], error) {
|
||||
return c.preLogin.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// Login calls core.v1.AuthenticateService.login.
|
||||
func (c *authenticateServiceClient) Login(ctx context.Context, req *connect.Request[v1.User]) (*connect.Response[v1.LoginReply], error) {
|
||||
return c.login.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// Logout calls core.v1.AuthenticateService.logout.
|
||||
func (c *authenticateServiceClient) Logout(ctx context.Context, req *connect.Request[v1.User]) (*connect.Response[v1.ActionReply], error) {
|
||||
return c.logout.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// AuthenticateServiceHandler is an implementation of the core.v1.AuthenticateService service.
|
||||
type AuthenticateServiceHandler interface {
|
||||
PreLogin(context.Context, *connect.Request[v1.User]) (*connect.Response[v1.ActionReply], error)
|
||||
Login(context.Context, *connect.Request[v1.User]) (*connect.Response[v1.LoginReply], error)
|
||||
Logout(context.Context, *connect.Request[v1.User]) (*connect.Response[v1.ActionReply], error)
|
||||
}
|
||||
|
||||
// NewAuthenticateServiceHandler builds an HTTP handler from the service implementation. It returns
|
||||
// the path on which to mount the handler and the handler itself.
|
||||
//
|
||||
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
|
||||
// and JSON codecs. They also support gzip compression.
|
||||
func NewAuthenticateServiceHandler(svc AuthenticateServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
|
||||
authenticateServicePreLoginHandler := connect.NewUnaryHandler(
|
||||
AuthenticateServicePreLoginProcedure,
|
||||
svc.PreLogin,
|
||||
connect.WithSchema(authenticateServicePreLoginMethodDescriptor),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
authenticateServiceLoginHandler := connect.NewUnaryHandler(
|
||||
AuthenticateServiceLoginProcedure,
|
||||
svc.Login,
|
||||
connect.WithSchema(authenticateServiceLoginMethodDescriptor),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
authenticateServiceLogoutHandler := connect.NewUnaryHandler(
|
||||
AuthenticateServiceLogoutProcedure,
|
||||
svc.Logout,
|
||||
connect.WithSchema(authenticateServiceLogoutMethodDescriptor),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
return "/core.v1.AuthenticateService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.URL.Path {
|
||||
case AuthenticateServicePreLoginProcedure:
|
||||
authenticateServicePreLoginHandler.ServeHTTP(w, r)
|
||||
case AuthenticateServiceLoginProcedure:
|
||||
authenticateServiceLoginHandler.ServeHTTP(w, r)
|
||||
case AuthenticateServiceLogoutProcedure:
|
||||
authenticateServiceLogoutHandler.ServeHTTP(w, r)
|
||||
default:
|
||||
http.NotFound(w, r)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// UnimplementedAuthenticateServiceHandler returns CodeUnimplemented from all methods.
|
||||
type UnimplementedAuthenticateServiceHandler struct{}
|
||||
|
||||
func (UnimplementedAuthenticateServiceHandler) PreLogin(context.Context, *connect.Request[v1.User]) (*connect.Response[v1.ActionReply], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("core.v1.AuthenticateService.preLogin is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedAuthenticateServiceHandler) Login(context.Context, *connect.Request[v1.User]) (*connect.Response[v1.LoginReply], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("core.v1.AuthenticateService.login is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedAuthenticateServiceHandler) Logout(context.Context, *connect.Request[v1.User]) (*connect.Response[v1.ActionReply], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("core.v1.AuthenticateService.logout is not implemented"))
|
||||
}
|
@ -1,112 +0,0 @@
|
||||
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
|
||||
//
|
||||
// Source: greet/v1/greet.proto
|
||||
|
||||
package greetv1connect
|
||||
|
||||
import (
|
||||
connect "connectrpc.com/connect"
|
||||
context "context"
|
||||
errors "errors"
|
||||
v1 "github.com/rocboss/paopao-ce/auto/rpc/greet/v1"
|
||||
http "net/http"
|
||||
strings "strings"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file and the connect package are
|
||||
// compatible. If you get a compiler error that this constant is not defined, this code was
|
||||
// generated with a version of connect newer than the one compiled into your binary. You can fix the
|
||||
// problem by either regenerating this code with an older version of connect or updating the connect
|
||||
// version compiled into your binary.
|
||||
const _ = connect.IsAtLeastVersion1_13_0
|
||||
|
||||
const (
|
||||
// GreetServiceName is the fully-qualified name of the GreetService service.
|
||||
GreetServiceName = "greet.v1.GreetService"
|
||||
)
|
||||
|
||||
// These constants are the fully-qualified names of the RPCs defined in this package. They're
|
||||
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
|
||||
//
|
||||
// Note that these are different from the fully-qualified method names used by
|
||||
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
|
||||
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
|
||||
// period.
|
||||
const (
|
||||
// GreetServiceGreetProcedure is the fully-qualified name of the GreetService's Greet RPC.
|
||||
GreetServiceGreetProcedure = "/greet.v1.GreetService/Greet"
|
||||
)
|
||||
|
||||
// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package.
|
||||
var (
|
||||
greetServiceServiceDescriptor = v1.File_greet_v1_greet_proto.Services().ByName("GreetService")
|
||||
greetServiceGreetMethodDescriptor = greetServiceServiceDescriptor.Methods().ByName("Greet")
|
||||
)
|
||||
|
||||
// GreetServiceClient is a client for the greet.v1.GreetService service.
|
||||
type GreetServiceClient interface {
|
||||
Greet(context.Context, *connect.Request[v1.GreetRequest]) (*connect.Response[v1.GreetResponse], error)
|
||||
}
|
||||
|
||||
// NewGreetServiceClient constructs a client for the greet.v1.GreetService service. By default, it
|
||||
// uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends
|
||||
// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
|
||||
// connect.WithGRPCWeb() options.
|
||||
//
|
||||
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
|
||||
// http://api.acme.com or https://acme.com/grpc).
|
||||
func NewGreetServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) GreetServiceClient {
|
||||
baseURL = strings.TrimRight(baseURL, "/")
|
||||
return &greetServiceClient{
|
||||
greet: connect.NewClient[v1.GreetRequest, v1.GreetResponse](
|
||||
httpClient,
|
||||
baseURL+GreetServiceGreetProcedure,
|
||||
connect.WithSchema(greetServiceGreetMethodDescriptor),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
// greetServiceClient implements GreetServiceClient.
|
||||
type greetServiceClient struct {
|
||||
greet *connect.Client[v1.GreetRequest, v1.GreetResponse]
|
||||
}
|
||||
|
||||
// Greet calls greet.v1.GreetService.Greet.
|
||||
func (c *greetServiceClient) Greet(ctx context.Context, req *connect.Request[v1.GreetRequest]) (*connect.Response[v1.GreetResponse], error) {
|
||||
return c.greet.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// GreetServiceHandler is an implementation of the greet.v1.GreetService service.
|
||||
type GreetServiceHandler interface {
|
||||
Greet(context.Context, *connect.Request[v1.GreetRequest]) (*connect.Response[v1.GreetResponse], error)
|
||||
}
|
||||
|
||||
// NewGreetServiceHandler builds an HTTP handler from the service implementation. It returns the
|
||||
// path on which to mount the handler and the handler itself.
|
||||
//
|
||||
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
|
||||
// and JSON codecs. They also support gzip compression.
|
||||
func NewGreetServiceHandler(svc GreetServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
|
||||
greetServiceGreetHandler := connect.NewUnaryHandler(
|
||||
GreetServiceGreetProcedure,
|
||||
svc.Greet,
|
||||
connect.WithSchema(greetServiceGreetMethodDescriptor),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
return "/greet.v1.GreetService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.URL.Path {
|
||||
case GreetServiceGreetProcedure:
|
||||
greetServiceGreetHandler.ServeHTTP(w, r)
|
||||
default:
|
||||
http.NotFound(w, r)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// UnimplementedGreetServiceHandler returns CodeUnimplemented from all methods.
|
||||
type UnimplementedGreetServiceHandler struct{}
|
||||
|
||||
func (UnimplementedGreetServiceHandler) Greet(context.Context, *connect.Request[v1.GreetRequest]) (*connect.Response[v1.GreetResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("greet.v1.GreetService.Greet is not implemented"))
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
// Copyright 2025 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 conf
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"go.opentelemetry.io/contrib/instrumentation/runtime"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
|
||||
"go.opentelemetry.io/otel/log/global"
|
||||
"go.opentelemetry.io/otel/propagation"
|
||||
sdklog "go.opentelemetry.io/otel/sdk/log"
|
||||
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
|
||||
sdkresource "go.opentelemetry.io/otel/sdk/resource"
|
||||
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.27.0"
|
||||
)
|
||||
|
||||
var (
|
||||
resource *sdkresource.Resource
|
||||
initResourcesOnce sync.Once
|
||||
)
|
||||
|
||||
func InitTelemetry() (shutdownFn func(), err error) {
|
||||
s := loggerOtlpSetting
|
||||
var (
|
||||
tp *sdktrace.TracerProvider
|
||||
mp *sdkmetric.MeterProvider
|
||||
lp *sdklog.LoggerProvider
|
||||
)
|
||||
|
||||
if tp, err = initTracerProvider(s); err != nil {
|
||||
return
|
||||
}
|
||||
if mp, err = initMeterProvider(s); err != nil {
|
||||
return
|
||||
}
|
||||
if lp, err = initLoggerProvider(s); err != nil {
|
||||
return
|
||||
}
|
||||
// Starting runtime instrumentation
|
||||
if err = runtime.Start(); err != nil {
|
||||
shutdownFn = func() {
|
||||
fmt.Printf("skip shutdown by step of init telemetry occurs error:%s", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
shutdownFn = func() {
|
||||
ctx := context.Background()
|
||||
tp.Shutdown(ctx)
|
||||
mp.Shutdown(ctx)
|
||||
lp.Shutdown(ctx)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func initResource() *sdkresource.Resource {
|
||||
initResourcesOnce.Do(func() {
|
||||
extraResources, _ := sdkresource.New(
|
||||
context.Background(),
|
||||
sdkresource.WithContainer(),
|
||||
sdkresource.WithHost(),
|
||||
sdkresource.WithSchemaURL(semconv.SchemaURL),
|
||||
sdkresource.WithAttributes(semconv.ServiceNameKey.String("jswhatx")),
|
||||
)
|
||||
resource, _ = sdkresource.Merge(
|
||||
sdkresource.Default(),
|
||||
extraResources,
|
||||
)
|
||||
})
|
||||
return resource
|
||||
}
|
||||
|
||||
func initTracerProvider(s *loggerOtlponf) (*sdktrace.TracerProvider, error) {
|
||||
opts := []otlptracegrpc.Option{
|
||||
otlptracegrpc.WithEndpoint(s.Endpoint),
|
||||
otlptracegrpc.WithHeaders(newOtlpHeaders(s.Authorization, s.Organization, s.TraceStream)),
|
||||
}
|
||||
if s.Insecure {
|
||||
opts = append(opts, otlptracegrpc.WithInsecure())
|
||||
}
|
||||
exporter, err := otlptracegrpc.New(context.Background(), opts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("otlp trace grpc exporter failed: %w", err)
|
||||
}
|
||||
tp := sdktrace.NewTracerProvider(
|
||||
sdktrace.WithBatcher(exporter),
|
||||
sdktrace.WithResource(initResource()),
|
||||
)
|
||||
otel.SetTracerProvider(tp)
|
||||
otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
|
||||
return tp, nil
|
||||
}
|
||||
|
||||
func initMeterProvider(s *loggerOtlponf) (*sdkmetric.MeterProvider, error) {
|
||||
opts := []otlpmetricgrpc.Option{
|
||||
otlpmetricgrpc.WithEndpoint(s.Endpoint),
|
||||
otlpmetricgrpc.WithHeaders(newOtlpHeaders(s.Authorization, s.Organization, s.MetricStream)),
|
||||
}
|
||||
if s.Insecure {
|
||||
opts = append(opts, otlpmetricgrpc.WithInsecure())
|
||||
}
|
||||
exporter, err := otlpmetricgrpc.New(context.Background(), opts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("otlp metric grpc exporter failed: %w", err)
|
||||
}
|
||||
mp := sdkmetric.NewMeterProvider(
|
||||
sdkmetric.WithReader(sdkmetric.NewPeriodicReader(exporter)),
|
||||
sdkmetric.WithResource(initResource()),
|
||||
)
|
||||
otel.SetMeterProvider(mp)
|
||||
return mp, nil
|
||||
}
|
||||
|
||||
func initLoggerProvider(s *loggerOtlponf) (*sdklog.LoggerProvider, error) {
|
||||
opts := []otlploggrpc.Option{
|
||||
otlploggrpc.WithEndpoint(s.Endpoint),
|
||||
otlploggrpc.WithHeaders(newOtlpHeaders(s.Authorization, s.Organization, s.LogStream)),
|
||||
}
|
||||
if s.Insecure {
|
||||
opts = append(opts, otlploggrpc.WithInsecure())
|
||||
}
|
||||
exporter, err := otlploggrpc.New(context.Background(), opts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("otlp log grpc exporter failed: %w", err)
|
||||
}
|
||||
processor := sdklog.NewBatchProcessor(exporter)
|
||||
provider := sdklog.NewLoggerProvider(
|
||||
sdklog.WithProcessor(processor),
|
||||
sdklog.WithResource(initResource()),
|
||||
)
|
||||
global.SetLoggerProvider(provider)
|
||||
return provider, nil
|
||||
}
|
||||
|
||||
func newOtlpHeaders(auth, org, stream string) map[string]string {
|
||||
return map[string]string{
|
||||
"Authorization": auth,
|
||||
"organization": org,
|
||||
"stream-name": stream,
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
// Copyright 2025 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 infra infrastructure components.
|
||||
|
||||
package infra
|
@ -0,0 +1,14 @@
|
||||
package enum
|
||||
|
||||
//go:generate go-enum --names --values --nocase --marshal --mustparse --sqlnullint
|
||||
|
||||
/*
|
||||
Boolean
|
||||
ENUM(
|
||||
|
||||
False, // false
|
||||
True, // true
|
||||
|
||||
)
|
||||
*/
|
||||
type Boolean int
|
@ -0,0 +1,258 @@
|
||||
// Code generated by go-enum DO NOT EDIT.
|
||||
// Version:
|
||||
// Revision:
|
||||
// Build Date:
|
||||
// Built By:
|
||||
|
||||
package enum
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
// BooleanFalse is a Boolean of type False.
|
||||
// false
|
||||
BooleanFalse Boolean = iota
|
||||
// BooleanTrue is a Boolean of type True.
|
||||
// true
|
||||
BooleanTrue
|
||||
)
|
||||
|
||||
var ErrInvalidBoolean = fmt.Errorf("not a valid Boolean, try [%s]", strings.Join(_BooleanNames, ", "))
|
||||
|
||||
const _BooleanName = "FalseTrue"
|
||||
|
||||
var _BooleanNames = []string{
|
||||
_BooleanName[0:5],
|
||||
_BooleanName[5:9],
|
||||
}
|
||||
|
||||
// BooleanNames returns a list of possible string values of Boolean.
|
||||
func BooleanNames() []string {
|
||||
tmp := make([]string, len(_BooleanNames))
|
||||
copy(tmp, _BooleanNames)
|
||||
return tmp
|
||||
}
|
||||
|
||||
// BooleanValues returns a list of the values for Boolean
|
||||
func BooleanValues() []Boolean {
|
||||
return []Boolean{
|
||||
BooleanFalse,
|
||||
BooleanTrue,
|
||||
}
|
||||
}
|
||||
|
||||
var _BooleanMap = map[Boolean]string{
|
||||
BooleanFalse: _BooleanName[0:5],
|
||||
BooleanTrue: _BooleanName[5:9],
|
||||
}
|
||||
|
||||
// String implements the Stringer interface.
|
||||
func (x Boolean) String() string {
|
||||
if str, ok := _BooleanMap[x]; ok {
|
||||
return str
|
||||
}
|
||||
return fmt.Sprintf("Boolean(%d)", x)
|
||||
}
|
||||
|
||||
// IsValid provides a quick way to determine if the typed value is
|
||||
// part of the allowed enumerated values
|
||||
func (x Boolean) IsValid() bool {
|
||||
_, ok := _BooleanMap[x]
|
||||
return ok
|
||||
}
|
||||
|
||||
var _BooleanValue = map[string]Boolean{
|
||||
_BooleanName[0:5]: BooleanFalse,
|
||||
strings.ToLower(_BooleanName[0:5]): BooleanFalse,
|
||||
_BooleanName[5:9]: BooleanTrue,
|
||||
strings.ToLower(_BooleanName[5:9]): BooleanTrue,
|
||||
}
|
||||
|
||||
// ParseBoolean attempts to convert a string to a Boolean.
|
||||
func ParseBoolean(name string) (Boolean, error) {
|
||||
if x, ok := _BooleanValue[name]; ok {
|
||||
return x, nil
|
||||
}
|
||||
// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.
|
||||
if x, ok := _BooleanValue[strings.ToLower(name)]; ok {
|
||||
return x, nil
|
||||
}
|
||||
return Boolean(0), fmt.Errorf("%s is %w", name, ErrInvalidBoolean)
|
||||
}
|
||||
|
||||
// MustParseBoolean converts a string to a Boolean, and panics if is not valid.
|
||||
func MustParseBoolean(name string) Boolean {
|
||||
val, err := ParseBoolean(name)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return val
|
||||
}
|
||||
|
||||
// MarshalText implements the text marshaller method.
|
||||
func (x Boolean) MarshalText() ([]byte, error) {
|
||||
return []byte(x.String()), nil
|
||||
}
|
||||
|
||||
// UnmarshalText implements the text unmarshaller method.
|
||||
func (x *Boolean) UnmarshalText(text []byte) error {
|
||||
name := string(text)
|
||||
tmp, err := ParseBoolean(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = tmp
|
||||
return nil
|
||||
}
|
||||
|
||||
var errBooleanNilPtr = errors.New("value pointer is nil") // one per type for package clashes
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (x *Boolean) Scan(value interface{}) (err error) {
|
||||
if value == nil {
|
||||
*x = Boolean(0)
|
||||
return
|
||||
}
|
||||
|
||||
// A wider range of scannable types.
|
||||
// driver.Value values at the top of the list for expediency
|
||||
switch v := value.(type) {
|
||||
case int64:
|
||||
*x = Boolean(v)
|
||||
case string:
|
||||
*x, err = ParseBoolean(v)
|
||||
if err != nil {
|
||||
// try parsing the integer value as a string
|
||||
if val, verr := strconv.Atoi(v); verr == nil {
|
||||
*x, err = Boolean(val), nil
|
||||
}
|
||||
}
|
||||
case []byte:
|
||||
*x, err = ParseBoolean(string(v))
|
||||
if err != nil {
|
||||
// try parsing the integer value as a string
|
||||
if val, verr := strconv.Atoi(string(v)); verr == nil {
|
||||
*x, err = Boolean(val), nil
|
||||
}
|
||||
}
|
||||
case Boolean:
|
||||
*x = v
|
||||
case int:
|
||||
*x = Boolean(v)
|
||||
case *Boolean:
|
||||
if v == nil {
|
||||
return errBooleanNilPtr
|
||||
}
|
||||
*x = *v
|
||||
case uint:
|
||||
*x = Boolean(v)
|
||||
case uint64:
|
||||
*x = Boolean(v)
|
||||
case *int:
|
||||
if v == nil {
|
||||
return errBooleanNilPtr
|
||||
}
|
||||
*x = Boolean(*v)
|
||||
case *int64:
|
||||
if v == nil {
|
||||
return errBooleanNilPtr
|
||||
}
|
||||
*x = Boolean(*v)
|
||||
case float64: // json marshals everything as a float64 if it's a number
|
||||
*x = Boolean(v)
|
||||
case *float64: // json marshals everything as a float64 if it's a number
|
||||
if v == nil {
|
||||
return errBooleanNilPtr
|
||||
}
|
||||
*x = Boolean(*v)
|
||||
case *uint:
|
||||
if v == nil {
|
||||
return errBooleanNilPtr
|
||||
}
|
||||
*x = Boolean(*v)
|
||||
case *uint64:
|
||||
if v == nil {
|
||||
return errBooleanNilPtr
|
||||
}
|
||||
*x = Boolean(*v)
|
||||
case *string:
|
||||
if v == nil {
|
||||
return errBooleanNilPtr
|
||||
}
|
||||
*x, err = ParseBoolean(*v)
|
||||
if err != nil {
|
||||
// try parsing the integer value as a string
|
||||
if val, verr := strconv.Atoi(*v); verr == nil {
|
||||
*x, err = Boolean(val), nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (x Boolean) Value() (driver.Value, error) {
|
||||
return int64(x), nil
|
||||
}
|
||||
|
||||
type NullBoolean struct {
|
||||
Boolean Boolean
|
||||
Valid bool
|
||||
Set bool
|
||||
}
|
||||
|
||||
func NewNullBoolean(val interface{}) (x NullBoolean) {
|
||||
x.Scan(val) // yes, we ignore this error, it will just be an invalid value.
|
||||
return
|
||||
}
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (x *NullBoolean) Scan(value interface{}) (err error) {
|
||||
x.Set = true
|
||||
if value == nil {
|
||||
x.Boolean, x.Valid = Boolean(0), false
|
||||
return
|
||||
}
|
||||
|
||||
err = x.Boolean.Scan(value)
|
||||
x.Valid = (err == nil)
|
||||
return
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (x NullBoolean) Value() (driver.Value, error) {
|
||||
if !x.Valid {
|
||||
return nil, nil
|
||||
}
|
||||
// driver.Value accepts int64 for int values.
|
||||
return int64(x.Boolean), nil
|
||||
}
|
||||
|
||||
// MarshalJSON correctly serializes a NullBoolean to JSON.
|
||||
func (n NullBoolean) MarshalJSON() ([]byte, error) {
|
||||
const nullStr = "null"
|
||||
if n.Valid {
|
||||
return json.Marshal(n.Boolean)
|
||||
}
|
||||
return []byte(nullStr), nil
|
||||
}
|
||||
|
||||
// UnmarshalJSON correctly deserializes a NullBoolean from JSON.
|
||||
func (n *NullBoolean) UnmarshalJSON(b []byte) error {
|
||||
n.Set = true
|
||||
var x interface{}
|
||||
err := json.Unmarshal(b, &x)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = n.Scan(x)
|
||||
return err
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
// Copyright 2025 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 enum all const enum variables define.
|
||||
|
||||
package enum
|
@ -1,17 +0,0 @@
|
||||
// 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 triplet
|
||||
|
||||
import (
|
||||
api "github.com/rocboss/paopao-ce/auto/connect/core/v1/corev1connect"
|
||||
)
|
||||
|
||||
var (
|
||||
_ api.AuthenticateServiceHandler = (*authenticateSrv)(nil)
|
||||
)
|
||||
|
||||
type authenticateSrv struct {
|
||||
api.UnimplementedAuthenticateServiceHandler
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
// 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 triplet
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"connectrpc.com/connect"
|
||||
api "github.com/rocboss/paopao-ce/auto/connect/core/v1/corev1connect"
|
||||
)
|
||||
|
||||
func RegisterAuthenticateHandler(h func(string, http.Handler), opts ...connect.HandlerOption) {
|
||||
h(api.NewAuthenticateServiceHandler(&authenticateSrv{}, opts...))
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
// 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 service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"connectrpc.com/connect"
|
||||
hx "github.com/rocboss/paopao-ce/pkg/http"
|
||||
)
|
||||
|
||||
var (
|
||||
_ server = (*connectServer)(nil)
|
||||
)
|
||||
|
||||
// connectServer wraper for connect
|
||||
type connectServer struct {
|
||||
*baseServer
|
||||
|
||||
isTLS bool
|
||||
certFile string
|
||||
keyFile string
|
||||
handlerOpts []connect.HandlerOption
|
||||
server *http.Server
|
||||
mux connectMux
|
||||
}
|
||||
|
||||
type connectMux interface {
|
||||
http.Handler
|
||||
Handle(string, http.Handler)
|
||||
}
|
||||
|
||||
func (s *connectServer) start() error {
|
||||
s.server.Handler = s.mux
|
||||
if s.isTLS {
|
||||
return s.server.ListenAndServeTLS(s.certFile, s.keyFile)
|
||||
} else {
|
||||
return s.server.ListenAndServe()
|
||||
}
|
||||
}
|
||||
|
||||
func (s *connectServer) stop() error {
|
||||
return s.server.Shutdown(context.Background())
|
||||
}
|
||||
|
||||
func (s *connectServer) register(path string, handler http.Handler) {
|
||||
s.mux.Handle(path, handler)
|
||||
}
|
||||
|
||||
func defaultConnectServer(addr string) (s *connectServer) {
|
||||
s = &connectServer{
|
||||
baseServer: newBaseServe(),
|
||||
server: &http.Server{
|
||||
Addr: addr,
|
||||
},
|
||||
mux: &http.ServeMux{},
|
||||
}
|
||||
// TODO: custom value from config
|
||||
var useConnectMux bool
|
||||
if useConnectMux {
|
||||
s.mux = hx.NewConnectMux()
|
||||
}
|
||||
return
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
// 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 service
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"connectrpc.com/connect"
|
||||
)
|
||||
|
||||
type baseConnectService struct {
|
||||
baseService
|
||||
|
||||
server *connectServer
|
||||
}
|
||||
|
||||
func (s *baseConnectService) registerServer(srv Service, h func(func(string, http.Handler), ...connect.HandlerOption), opts ...connect.HandlerOption) {
|
||||
h(s.server.register, append(opts, s.server.handlerOpts...)...)
|
||||
s.server.addService(srv)
|
||||
}
|
||||
|
||||
func (s *baseConnectService) OnStart() error {
|
||||
// do nothing default
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *baseConnectService) OnStop() error {
|
||||
// do nothing default
|
||||
return nil
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
// 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 service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/fatih/color"
|
||||
"github.com/rocboss/paopao-ce/internal/servants"
|
||||
)
|
||||
|
||||
var (
|
||||
_ Service = (*tripletService)(nil)
|
||||
)
|
||||
|
||||
// tripletService just a demo service for Connect
|
||||
type tripletService struct {
|
||||
*baseConnectService
|
||||
}
|
||||
|
||||
func (s *tripletService) Name() string {
|
||||
return "TripletService"
|
||||
}
|
||||
|
||||
func (s *tripletService) Version() *semver.Version {
|
||||
return semver.MustParse("v0.1.0")
|
||||
}
|
||||
|
||||
func (s *tripletService) OnInit() error {
|
||||
s.registerServer(s, servants.RegisterTripletServants)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *tripletService) String() string {
|
||||
return fmt.Sprintf("listen on %s\n", color.GreenString("http://localhost:8080"))
|
||||
}
|
||||
|
||||
func newTripletService() Service {
|
||||
server := connectServers.from(":8080", func() *connectServer {
|
||||
// TODO: do something for conenct server initialize
|
||||
return defaultConnectServer(":8080")
|
||||
})
|
||||
return &tripletService{
|
||||
baseConnectService: &baseConnectService{
|
||||
server: server,
|
||||
},
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
// Copyright 2025 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 version
|
||||
|
||||
import (
|
||||
"debug/buildinfo"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
BuildTime = time.Now()
|
||||
)
|
||||
|
||||
func init() {
|
||||
exe, err := os.Executable()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
info, err := buildinfo.ReadFile(exe)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
for _, s := range info.Settings {
|
||||
if s.Key == "vcs.time" && s.Value != "" {
|
||||
if t, err := time.Parse(time.RFC3339, s.Value); err == nil {
|
||||
BuildTime = t
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM alpine:3.18
|
||||
FROM alpine:3.21
|
||||
ENV TZ=Asia/Shanghai
|
||||
RUN apk update && apk add --no-cache ca-certificates && update-ca-certificates
|
||||
|
@ -0,0 +1,30 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
|
||||
"organizeImports": {
|
||||
"enabled": true
|
||||
},
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
"useIgnoreFile": true
|
||||
},
|
||||
"formatter": {
|
||||
"indentStyle": "space"
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"quoteStyle": "single"
|
||||
}
|
||||
},
|
||||
"css": {
|
||||
"parser": {
|
||||
"cssModules": true
|
||||
}
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
import{_}from"./main-nav.vue_vue_type_style_index_0_lang-D7-FAbTY.js";import{u as a}from"./vue-router-yrkFRUM9.js";import{G as c,a2 as u,B as l}from"./naive-ui-BJojRuLw.js";import{d,f,q as t,w as o,G as x,j as w}from"./@vue-9sINKCPW.js";import{_ as B}from"./index-DxHQoSDp.js";import"./vuex--ttreJMD.js";import"./vooks-CfQnrjIt.js";import"./evtd-CI_DDEu_.js";import"./@vicons-PCg97L0F.js";import"./seemly-D-teBmey.js";import"./vueuc-DrMWnH2h.js";import"./@css-render-DN2R7sM6.js";import"./vdirs-DRH9Xvnd.js";import"./@juggle-C8OzoCMD.js";import"./css-render-BDrvWz3H.js";import"./@emotion-WldOFDRm.js";import"./lodash-es-TJvrUncL.js";import"./treemate-HRdUPn5m.js";import"./async-validator-9PlIezaS.js";import"./date-fns-Db9XENWt.js";import"./axios-t--hEgTQ.js";import"./moment-P60zs0je.js";/* empty css */const g=d({__name:"404",setup(k){const n=a(),p=()=>{n.push({path:"/"})};return(v,r)=>{const e=_,m=l,i=u,s=c;return w(),f("div",null,[t(e,{title:"404"}),t(s,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(i,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(m,{onClick:p},{default:o(()=>r[0]||(r[0]=[x("回主页")])),_:1})]),_:1})]),_:1})])}}}),O=B(g,[["__scopeId","data-v-e62daa85"]]);export{O as default};
|
@ -1 +0,0 @@
|
||||
import{_ as i}from"./main-nav.vue_vue_type_style_index_0_lang-DmAlkpQJ.js";import{u as s}from"./vue-router-zwGLnBy5.js";import{G as a,e as c,a2 as u}from"./naive-ui-DNcWoFGl.js";import{d as l,f as d,k as t,w as o,e as f,A as x}from"./@vue-CQsYufSu.js";import{_ as g}from"./index-v3l9hw1O.js";import"./vuex-DNAxYlmG.js";import"./vooks-BQzJqMzq.js";import"./evtd-CI_DDEu_.js";import"./@vicons-C3A8jsfr.js";import"./seemly-B7f2tHrf.js";import"./vueuc-CbQ6ZCvR.js";import"./@css-render-CQdyXCYJ.js";import"./vdirs-DL8EOfHr.js";import"./@juggle-C8OzoCMD.js";import"./css-render-Ct37b3-v.js";import"./@emotion-WldOFDRm.js";import"./lodash-es-i05dkx59.js";import"./treemate-HRdUPn5m.js";import"./async-validator-DKvM95Vc.js";import"./date-fns-x7VUUoCw.js";import"./axios-Bo0ATomq.js";import"./moment-BqTRGcJI.js";/* empty css */const h=l({__name:"404",setup(k){const n=s(),e=()=>{n.push({path:"/"})};return(w,v)=>{const r=i,p=c,_=u,m=a;return f(),d("div",null,[t(r,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(_,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:e},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}}),O=g(h,[["__scopeId","data-v-e62daa85"]]);export{O as default};
|
@ -1 +0,0 @@
|
||||
var o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}export{o as c,l as g};
|
@ -1,3 +0,0 @@
|
||||
import{i as d}from"./@vue-CQsYufSu.js";function C(i){let r=".",f="__",o="--",s;if(i){let e=i.blockPrefix;e&&(r=e),e=i.elementPrefix,e&&(f=e),e=i.modifierPrefix,e&&(o=e)}const b={install(e){s=e.c;const l=e.context;l.bem={},l.bem.b=null,l.bem.els=null}};function v(e){let l,n;return{before(t){l=t.bem.b,n=t.bem.els,t.bem.els=null},after(t){t.bem.b=l,t.bem.els=n},$({context:t,props:u}){return e=typeof e=="string"?e:e({context:t,props:u}),t.bem.b=e,`${(u==null?void 0:u.bPrefix)||r}${t.bem.b}`}}}function y(e){let l;return{before(n){l=n.bem.els},after(n){n.bem.els=l},$({context:n,props:t}){return e=typeof e=="string"?e:e({context:n,props:t}),n.bem.els=e.split(",").map(u=>u.trim()),n.bem.els.map(u=>`${(t==null?void 0:t.bPrefix)||r}${n.bem.b}${f}${u}`).join(", ")}}}function P(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=e.split(",").map(m=>m.trim());function u(m){return t.map(x=>`&${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${m!==void 0?`${f}${m}`:""}${o}${x}`).join(", ")}const c=l.bem.els;return c!==null?u(c[0]):u()}}}function _(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=l.bem.els;return`&:not(${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${t!==null&&t.length>0?`${f}${t[0]}`:""}${o}${e})`}}}return Object.assign(b,{cB:(...e)=>s(v(e[0]),e[1],e[2]),cE:(...e)=>s(y(e[0]),e[1],e[2]),cM:(...e)=>s(P(e[0]),e[1],e[2]),cNotM:(...e)=>s(_(e[0]),e[1],e[2])}),b}const $=Symbol("@css-render/vue3-ssr");function M(i,r){return`<style cssr-id="${i}">
|
||||
${r}
|
||||
</style>`}function S(i,r){const f=d($,null);if(f===null){console.error("[css-render/vue3-ssr]: no ssr context found.");return}const{styles:o,ids:s}=f;s.has(i)||o!==null&&(s.add(i),o.push(M(i,r)))}const j=typeof document<"u";function N(){if(j)return;const i=d($,null);if(i!==null)return{adapter:S,context:i}}export{C as p,N as u};
|
@ -0,0 +1,3 @@
|
||||
import{i as _}from"./@vue-9sINKCPW.js";function N(l){let u=".",m="__",b="--",r;if(l){let e=l.blockPrefix;e&&(u=e),e=l.elementPrefix,e&&(m=e),e=l.modifierPrefix,e&&(b=e)}const o={install(e){r=e.c;const i=e.context;i.bem={},i.bem.b=null,i.bem.els=null}};function d(e){let i,n;return{before(t){i=t.bem.b,n=t.bem.els,t.bem.els=null},after(t){t.bem.b=i,t.bem.els=n},$({context:t,props:f}){return e=typeof e=="string"?e:e({context:t,props:f}),t.bem.b=e,`${(f==null?void 0:f.bPrefix)||u}${t.bem.b}`}}}function $(e){let i;return{before(n){i=n.bem.els},after(n){n.bem.els=i},$({context:n,props:t}){return e=typeof e=="string"?e:e({context:n,props:t}),n.bem.els=e.split(",").map(f=>f.trim()),n.bem.els.map(f=>`${(t==null?void 0:t.bPrefix)||u}${n.bem.b}${m}${f}`).join(", ")}}}function v(e){return{$({context:i,props:n}){e=typeof e=="string"?e:e({context:i,props:n});const t=e.split(",").map(s=>s.trim());function f(s){return t.map(P=>`&${(n==null?void 0:n.bPrefix)||u}${i.bem.b}${s!==void 0?`${m}${s}`:""}${b}${P}`).join(", ")}const c=i.bem.els;return c!==null?f(c[0]):f()}}}function y(e){return{$({context:i,props:n}){e=typeof e=="string"?e:e({context:i,props:n});const t=i.bem.els;return`&:not(${(n==null?void 0:n.bPrefix)||u}${i.bem.b}${t!==null&&t.length>0?`${m}${t[0]}`:""}${b}${e})`}}}return Object.assign(o,{cB:(...e)=>r(d(e[0]),e[1],e[2]),cE:(...e)=>r($(e[0]),e[1],e[2]),cM:(...e)=>r(v(e[0]),e[1],e[2]),cNotM:(...e)=>r(y(e[0]),e[1],e[2])}),o}const M="@css-render/vue3-ssr";function j(l,u){return`<style cssr-id="${l}">
|
||||
${u}
|
||||
</style>`}function B(l,u,m){const{styles:b,ids:r}=m;r.has(l)||b!==null&&(r.add(l),b.push(j(l,u)))}const E=typeof document<"u";function k(){if(E)return;const l=_(M,null);if(l!==null)return{adapter:(u,m)=>B(u,m,l),context:l}}export{N as p,k as u};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
import{_ as N}from"./post-skeleton-YfJeD-2o.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-DmAlkpQJ.js";import{u as z}from"./vuex-DNAxYlmG.js";import{b as F}from"./vue-router-zwGLnBy5.js";import{K as S,_ as V}from"./index-v3l9hw1O.js";import{G as q,R as A,J as H,H as P}from"./naive-ui-DNcWoFGl.js";import{d as j,H as n,b as D,f as e,k as a,w as p,e as o,bk as u,Z as l,F as E,u as G,q as I,j as s,x as _,l as J}from"./@vue-CQsYufSu.js";import"./vooks-BQzJqMzq.js";import"./evtd-CI_DDEu_.js";import"./@vicons-C3A8jsfr.js";import"./axios-Bo0ATomq.js";import"./moment-BqTRGcJI.js";/* empty css */import"./seemly-B7f2tHrf.js";import"./vueuc-CbQ6ZCvR.js";import"./@css-render-CQdyXCYJ.js";import"./vdirs-DL8EOfHr.js";import"./@juggle-C8OzoCMD.js";import"./css-render-Ct37b3-v.js";import"./@emotion-WldOFDRm.js";import"./lodash-es-i05dkx59.js";import"./treemate-HRdUPn5m.js";import"./async-validator-DKvM95Vc.js";import"./date-fns-x7VUUoCw.js";const K={key:0,class:"pagination-wrap"},L={key:0,class:"skeleton-wrap"},M={key:1},O={key:0,class:"empty-wrap"},T={class:"bill-line"},U=j({__name:"Anouncement",setup(Z){const d=z(),g=F(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),m=n(0),h=c=>{i.value=c};return D(()=>{}),(c,$)=>{const k=R,y=A,w=N,x=H,B=P,C=q;return o(),e("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[m.value>1?(o(),e("div",K,[a(y,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(o(),e("div",L,[a(w,{num:f.value},null,8,["num"])])):(o(),e("div",M,[r.value.length===0?(o(),e("div",O,[a(x,{size:"large",description:"暂无数据"})])):l("",!0),(o(!0),e(E,null,G(r.value,t=>(o(),I(B,{key:t.id},{default:p(()=>[s("div",T,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:J({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(S)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}}),kt=V(U,[["__scopeId","data-v-d4d04859"]]);export{kt as default};
|
@ -0,0 +1 @@
|
||||
import{_ as C}from"./post-skeleton-B6KFVL2X.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-D7-FAbTY.js";import{u as R}from"./vuex--ttreJMD.js";import{b as q}from"./vue-router-yrkFRUM9.js";import{K as F,_ as S}from"./index-DxHQoSDp.js";import{G as V,J as A,R as P,H as j}from"./naive-ui-BJojRuLw.js";import{d as D,r as n,b as E,f as e,q as a,w as p,Y as u,F as G,x as H,bq as l,j as o,t as I,k as s,z as _,s as J}from"./@vue-9sINKCPW.js";import"./vooks-CfQnrjIt.js";import"./evtd-CI_DDEu_.js";import"./@vicons-PCg97L0F.js";import"./axios-t--hEgTQ.js";import"./moment-P60zs0je.js";/* empty css */import"./seemly-D-teBmey.js";import"./vueuc-DrMWnH2h.js";import"./@css-render-DN2R7sM6.js";import"./vdirs-DRH9Xvnd.js";import"./@juggle-C8OzoCMD.js";import"./css-render-BDrvWz3H.js";import"./@emotion-WldOFDRm.js";import"./lodash-es-TJvrUncL.js";import"./treemate-HRdUPn5m.js";import"./async-validator-9PlIezaS.js";import"./date-fns-Db9XENWt.js";const K={key:0,class:"pagination-wrap"},L={key:0,class:"skeleton-wrap"},M={key:1},O={key:0,class:"empty-wrap"},T={class:"bill-line"},U=D({__name:"Anouncement",setup(Y){const d=R(),g=q(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),m=n(0),h=c=>{i.value=c};return E(()=>{}),(c,$)=>{const k=N,y=P,w=C,x=A,z=j,B=V;return o(),e("div",null,[a(k,{title:"公告"}),a(B,{class:"main-content-wrap",bordered:""},{footer:p(()=>[m.value>1?(o(),e("div",K,[a(y,{page:i.value,"onUpdate:page":h,"page-slot":l(d).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):u("",!0)]),default:p(()=>[v.value?(o(),e("div",L,[a(w,{num:f.value},null,8,["num"])])):(o(),e("div",M,[r.value.length===0?(o(),e("div",O,[a(x,{size:"large",description:"暂无数据"})])):u("",!0),(o(!0),e(G,null,H(r.value,t=>(o(),I(z,{key:t.id},{default:p(()=>[s("div",T,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:J({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(l(F)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}}),kt=S(U,[["__scopeId","data-v-d4d04859"]]);export{kt as default};
|
@ -0,0 +1 @@
|
||||
import{_ as D}from"./whisper-CD0RDnNY.js";import{_ as H,a as R}from"./post-item.vue_vue_type_style_index_0_lang-3gNUBBWd.js";import{_ as W}from"./post-skeleton-B6KFVL2X.js";import{_ as Y}from"./main-nav.vue_vue_type_style_index_0_lang-D7-FAbTY.js";import{u as E}from"./vuex--ttreJMD.js";import{b as G}from"./vue-router-yrkFRUM9.js";import{Y as J}from"./v3-infinite-loading-D3303HHP.js";import{U as L,u as K,f as Q,_ as X}from"./index-DxHQoSDp.js";import{d as Z,r as t,b as ee,f as n,q as a,t as d,Y as h,w as u,bq as f,F as b,x as $,k as z,z as oe,j as o}from"./@vue-9sINKCPW.js";import{F as se,G as te,a as ne,J as ae,j as ie,H as le}from"./naive-ui-BJojRuLw.js";import"./content-x8CCof-x.js";import"./@vicons-PCg97L0F.js";import"./paopao-video-player-FrzfkELx.js";import"./copy-to-clipboard-DgsYVcxl.js";import"./toggle-selection-DGa8lynz.js";import"./vooks-CfQnrjIt.js";import"./evtd-CI_DDEu_.js";import"./axios-t--hEgTQ.js";import"./moment-P60zs0je.js";/* empty css */import"./seemly-D-teBmey.js";import"./vueuc-DrMWnH2h.js";import"./@css-render-DN2R7sM6.js";import"./vdirs-DRH9Xvnd.js";import"./@juggle-C8OzoCMD.js";import"./css-render-BDrvWz3H.js";import"./@emotion-WldOFDRm.js";import"./lodash-es-TJvrUncL.js";import"./treemate-HRdUPn5m.js";import"./async-validator-9PlIezaS.js";import"./date-fns-Db9XENWt.js";const re={key:0,class:"skeleton-wrap"},_e={key:1},ue={key:0,class:"empty-wrap"},ce={key:1},me={key:2},pe={class:"load-more-wrap"},de={class:"load-more-spinner"},fe=Z({__name:"Collection",setup(ve){const v=E(),A=G(),B=se(),c=t(!1),_=t(!1),s=t([]),l=t(+A.query.p||1),w=t(20),m=t(0),g=t(!1),k=t({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=e=>{k.value=e,g.value=!0},I=()=>{g.value=!1},x=e=>{B.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?K({user_id:e.user.id}).then(r=>{window.$message.success("操作成功"),C(e.user_id,!1)}).catch(r=>{}):Q({user_id:e.user.id}).then(r=>{window.$message.success("关注成功"),C(e.user_id,!0)}).catch(r=>{})}})};function C(e,r){for(let p in s.value)s.value[p].user_id==e&&(s.value[p].user.is_following=r)}const F=()=>{c.value=!0,L({page:l.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(_.value=!0),l.value>1?s.value=s.value.concat(e.list):(s.value=e.list,window.scrollTo(0,0)),m.value=Math.ceil(e.pager.total_rows/w.value)}).catch(e=>{c.value=!1,l.value>1&&l.value--})},M=()=>{l.value<m.value||m.value==0?(_.value=!1,l.value++,F()):_.value=!0};return ee(()=>{F()}),(e,r)=>{const p=Y,O=W,P=ae,j=H,S=le,q=R,N=D,T=te,U=ie,V=ne;return o(),n("div",null,[a(p,{title:"收藏"}),a(T,{class:"main-content-wrap",bordered:""},{default:u(()=>[c.value&&s.value.length===0?(o(),n("div",re,[a(O,{num:w.value},null,8,["num"])])):(o(),n("div",_e,[s.value.length===0?(o(),n("div",ue,[a(P,{size:"large",description:"暂无数据"})])):h("",!0),f(v).state.desktopModelShow?(o(),n("div",ce,[(o(!0),n(b,null,$(s.value,i=>(o(),d(S,{key:i.id},{default:u(()=>[a(j,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))])):(o(),n("div",me,[(o(!0),n(b,null,$(s.value,i=>(o(),d(S,{key:i.id},{default:u(()=>[a(q,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))]))])),a(N,{show:g.value,user:k.value,onSuccess:I},null,8,["show","user"])]),_:1}),m.value>0?(o(),d(V,{key:0,justify:"center"},{default:u(()=>[a(f(J),{class:"load-more",slots:{complete:"没有更多收藏了",error:"加载出错"},onInfinite:M},{spinner:u(()=>[z("div",pe,[_.value?h("",!0):(o(),d(U,{key:0,size:14})),z("span",de,oe(_.value?"没有更多收藏了":"加载更多"),1)])]),_:1})]),_:1})):h("",!0)])}}}),Je=X(fe,[["__scopeId","data-v-735372fb"]]);export{Je as default};
|
@ -1 +0,0 @@
|
||||
import{_ as j}from"./whisper-DFhobfFF.js";import{_ as q,a as D}from"./post-item.vue_vue_type_style_index_0_lang-Dfn2xguO.js";import{_ as R}from"./post-skeleton-YfJeD-2o.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-DmAlkpQJ.js";import{u as G}from"./vuex-DNAxYlmG.js";import{b as J}from"./vue-router-zwGLnBy5.js";import{W as L}from"./v3-infinite-loading-DK6TzcZc.js";import{U as Z,u as K,f as Q,_ as X}from"./index-v3l9hw1O.js";import{d as Y,H as t,b as ee,f as n,k as a,w as u,q as d,Z as h,e as o,bk as f,F as b,u as $,j as z,x as oe}from"./@vue-CQsYufSu.js";import{F as se,G as te,a as ne,J as ae,k as ie,H as le}from"./naive-ui-DNcWoFGl.js";import"./content-BMjusBPS.js";import"./@vicons-C3A8jsfr.js";import"./paopao-video-player-DAi68TC5.js";import"./copy-to-clipboard-CA7crPat.js";import"./@babel-Cpj98o6Y.js";import"./toggle-selection-BHUZwh74.js";import"./vooks-BQzJqMzq.js";import"./evtd-CI_DDEu_.js";import"./axios-Bo0ATomq.js";import"./moment-BqTRGcJI.js";/* empty css */import"./seemly-B7f2tHrf.js";import"./vueuc-CbQ6ZCvR.js";import"./@css-render-CQdyXCYJ.js";import"./vdirs-DL8EOfHr.js";import"./@juggle-C8OzoCMD.js";import"./css-render-Ct37b3-v.js";import"./@emotion-WldOFDRm.js";import"./lodash-es-i05dkx59.js";import"./treemate-HRdUPn5m.js";import"./async-validator-DKvM95Vc.js";import"./date-fns-x7VUUoCw.js";const re={key:0,class:"skeleton-wrap"},_e={key:1},ue={key:0,class:"empty-wrap"},ce={key:1},me={key:2},pe={class:"load-more-wrap"},de={class:"load-more-spinner"},fe=Y({__name:"Collection",setup(ve){const v=G(),A=J(),B=se(),c=t(!1),_=t(!1),s=t([]),l=t(+A.query.p||1),w=t(20),m=t(0),g=t(!1),k=t({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=e=>{k.value=e,g.value=!0},I=()=>{g.value=!1},x=e=>{B.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?K({user_id:e.user.id}).then(r=>{window.$message.success("操作成功"),C(e.user_id,!1)}).catch(r=>{}):Q({user_id:e.user.id}).then(r=>{window.$message.success("关注成功"),C(e.user_id,!0)}).catch(r=>{})}})};function C(e,r){for(let p in s.value)s.value[p].user_id==e&&(s.value[p].user.is_following=r)}const F=()=>{c.value=!0,Z({page:l.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(_.value=!0),l.value>1?s.value=s.value.concat(e.list):(s.value=e.list,window.scrollTo(0,0)),m.value=Math.ceil(e.pager.total_rows/w.value)}).catch(e=>{c.value=!1,l.value>1&&l.value--})},M=()=>{l.value<m.value||m.value==0?(_.value=!1,l.value++,F()):_.value=!0};return ee(()=>{F()}),(e,r)=>{const p=E,O=R,P=ae,H=q,S=le,N=D,T=j,U=te,V=ie,W=ne;return o(),n("div",null,[a(p,{title:"收藏"}),a(U,{class:"main-content-wrap",bordered:""},{default:u(()=>[c.value&&s.value.length===0?(o(),n("div",re,[a(O,{num:w.value},null,8,["num"])])):(o(),n("div",_e,[s.value.length===0?(o(),n("div",ue,[a(P,{size:"large",description:"暂无数据"})])):h("",!0),f(v).state.desktopModelShow?(o(),n("div",ce,[(o(!0),n(b,null,$(s.value,i=>(o(),d(S,{key:i.id},{default:u(()=>[a(H,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))])):(o(),n("div",me,[(o(!0),n(b,null,$(s.value,i=>(o(),d(S,{key:i.id},{default:u(()=>[a(N,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))]))])),a(T,{show:g.value,user:k.value,onSuccess:I},null,8,["show","user"])]),_:1}),m.value>0?(o(),d(W,{key:0,justify:"center"},{default:u(()=>[a(f(L),{class:"load-more",slots:{complete:"没有更多收藏了",error:"加载出错"},onInfinite:M},{spinner:u(()=>[z("div",pe,[_.value?h("",!0):(o(),d(V,{key:0,size:14})),z("span",de,oe(_.value?"没有更多收藏了":"加载更多"),1)])]),_:1})]),_:1})):h("",!0)])}}}),Ze=X(fe,[["__scopeId","data-v-735372fb"]]);export{Ze as default};
|
@ -0,0 +1 @@
|
||||
import{_ as G}from"./whisper-CD0RDnNY.js";import{d as S,c as H,l as L,f as p,j as s,q as t,w as o,k as a,bq as g,A as O,G as R,z as d,h as B,r,b as W,t as C,Y as b,F as I,x as E}from"./@vue-9sINKCPW.js";import{L as J,_ as N,Y as Q}from"./index-DxHQoSDp.js";import{M as U,Q as K,B as X,i as M,m as Z,G as ee,a as te,J as ne,j as oe,H as se}from"./naive-ui-BJojRuLw.js";import{q as ae,r as ce}from"./@vicons-PCg97L0F.js";import{_ as ie}from"./post-skeleton-B6KFVL2X.js";import{_ as re}from"./main-nav.vue_vue_type_style_index_0_lang-D7-FAbTY.js";import{Y as le}from"./v3-infinite-loading-D3303HHP.js";import{b as _e}from"./vue-router-yrkFRUM9.js";import"./vuex--ttreJMD.js";import"./axios-t--hEgTQ.js";import"./moment-P60zs0je.js";/* empty css */import"./seemly-D-teBmey.js";import"./vueuc-DrMWnH2h.js";import"./evtd-CI_DDEu_.js";import"./@css-render-DN2R7sM6.js";import"./vooks-CfQnrjIt.js";import"./vdirs-DRH9Xvnd.js";import"./@juggle-C8OzoCMD.js";import"./css-render-BDrvWz3H.js";import"./@emotion-WldOFDRm.js";import"./lodash-es-TJvrUncL.js";import"./treemate-HRdUPn5m.js";import"./async-validator-9PlIezaS.js";import"./date-fns-Db9XENWt.js";const ue={class:"contact-item"},pe={class:"nickname-wrap"},me={class:"username-wrap"},de={class:"user-info"},fe={class:"info-item"},ve={class:"info-item"},he={class:"item-header-extra"},ge=S({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(z,{emit:w}){const _=w,l=e=>()=>B(M,null,{default:()=>B(e)}),n=z,c=H(()=>[{label:"私信 @"+n.contact.username,key:"whisper",icon:l(ce)}]),m=e=>{switch(e){case"whisper":const i={id:n.contact.user_id,avatar:n.contact.avatar,username:n.contact.username,nickname:n.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};_("send-whisper",i);break}};return(e,i)=>{const f=Z,k=L("router-link"),y=X,$=K,v=U;return s(),p("div",ue,[t(v,{"content-indented":""},{avatar:o(()=>[t(f,{size:54,src:e.contact.avatar},null,8,["src"])]),header:o(()=>[a("span",pe,[t(k,{onClick:i[0]||(i[0]=O(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:o(()=>[R(d(e.contact.nickname),1)]),_:1},8,["to"])]),a("span",me," @"+d(e.contact.username),1),a("div",de,[a("span",fe," UID. "+d(e.contact.user_id),1),a("span",ve,d(g(J)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":o(()=>[a("div",he,[t($,{placement:"bottom-end",trigger:"click",size:"small",options:c.value,onSelect:m},{default:o(()=>[t(y,{quaternary:"",circle:""},{icon:o(()=>[t(g(M),null,{default:o(()=>[t(g(ae))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}}),we=N(ge,[["__scopeId","data-v-42e975ce"]]),ke={key:0,class:"skeleton-wrap"},ye={key:1},$e={key:0,class:"empty-wrap"},Ce={class:"load-more-wrap"},be={class:"load-more-spinner"},ze=S({__name:"Contacts",setup(z){const w=_e(),_=r(!1),l=r(!1),n=r([]),c=r(+w.query.p||1),m=r(20),e=r(0),i=r(!1),f=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),k=h=>{f.value=h,i.value=!0},y=()=>{i.value=!1},$=()=>{c.value<e.value||e.value==0?(l.value=!1,c.value++,v()):l.value=!0};W(()=>{v()});const v=(h=!1)=>{n.value.length===0&&(_.value=!0),Q({page:c.value,page_size:m.value}).then(u=>{_.value=!1,u.list.length===0&&(l.value=!0),c.value>1?n.value=n.value.concat(u.list):(n.value=u.list,h&&setTimeout(()=>{window.scrollTo(0,99999)},50)),e.value=Math.ceil(u.pager.total_rows/m.value)}).catch(u=>{_.value=!1,c.value>1&&c.value--})};return(h,u)=>{const x=re,P=ie,V=ne,j=we,D=se,F=G,T=ee,Y=oe,A=te;return s(),p(I,null,[a("div",null,[t(x,{title:"好友"}),t(T,{class:"main-content-wrap",bordered:""},{default:o(()=>[_.value&&n.value.length===0?(s(),p("div",ke,[t(P,{num:m.value},null,8,["num"])])):(s(),p("div",ye,[n.value.length===0?(s(),p("div",$e,[t(V,{size:"large",description:"暂无数据"})])):b("",!0),(s(!0),p(I,null,E(n.value,q=>(s(),C(D,{class:"list-item",key:q.user_id},{default:o(()=>[t(j,{contact:q,onSendWhisper:k},null,8,["contact"])]),_:2},1024))),128))])),t(F,{show:i.value,user:f.value,onSuccess:y},null,8,["show","user"])]),_:1})]),e.value>0?(s(),C(A,{key:0,justify:"center"},{default:o(()=>[t(g(le),{class:"load-more",slots:{complete:"没有更多好友了",error:"加载出错"},onInfinite:$},{spinner:o(()=>[a("div",Ce,[l.value?b("",!0):(s(),C(Y,{key:0,size:14})),a("span",be,d(l.value?"没有更多好友了":"加载更多"),1)])]),_:1})]),_:1})):b("",!0)],64)}}}),Xe=N(ze,[["__scopeId","data-v-69277f0c"]]);export{Xe as default};
|
@ -1 +0,0 @@
|
||||
import{_ as W}from"./whisper-DFhobfFF.js";import{d as P,c as A,r as L,e as s,f as p,k as t,w as o,j as a,y as R,A as E,x as d,bk as g,h as S,H as r,b as G,q as C,Z as b,F as M,u as J}from"./@vue-CQsYufSu.js";import{L as U,_ as q,Y}from"./index-v3l9hw1O.js";import{k as Z,r as K}from"./@vicons-C3A8jsfr.js";import{j as N,o as Q,e as X,P as ee,O as te,G as ne,a as oe,J as se,k as ae,H as ce}from"./naive-ui-DNcWoFGl.js";import{_ as ie}from"./post-skeleton-YfJeD-2o.js";import{_ as re}from"./main-nav.vue_vue_type_style_index_0_lang-DmAlkpQJ.js";import{W as le}from"./v3-infinite-loading-DK6TzcZc.js";import{b as _e}from"./vue-router-zwGLnBy5.js";import"./vuex-DNAxYlmG.js";import"./axios-Bo0ATomq.js";import"./moment-BqTRGcJI.js";/* empty css */import"./seemly-B7f2tHrf.js";import"./vueuc-CbQ6ZCvR.js";import"./evtd-CI_DDEu_.js";import"./@css-render-CQdyXCYJ.js";import"./vooks-BQzJqMzq.js";import"./vdirs-DL8EOfHr.js";import"./@juggle-C8OzoCMD.js";import"./css-render-Ct37b3-v.js";import"./@emotion-WldOFDRm.js";import"./lodash-es-i05dkx59.js";import"./treemate-HRdUPn5m.js";import"./async-validator-DKvM95Vc.js";import"./date-fns-x7VUUoCw.js";const ue={class:"contact-item"},pe={class:"nickname-wrap"},me={class:"username-wrap"},de={class:"user-info"},fe={class:"info-item"},ve={class:"info-item"},he={class:"item-header-extra"},ge=P({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(z,{emit:w}){const _=w,l=e=>()=>S(N,null,{default:()=>S(e)}),n=z,c=A(()=>[{label:"私信 @"+n.contact.username,key:"whisper",icon:l(K)}]),m=e=>{switch(e){case"whisper":const i={id:n.contact.user_id,avatar:n.contact.avatar,username:n.contact.username,nickname:n.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};_("send-whisper",i);break}};return(e,i)=>{const f=Q,k=L("router-link"),y=X,$=ee,v=te;return s(),p("div",ue,[t(v,{"content-indented":""},{avatar:o(()=>[t(f,{size:54,src:e.contact.avatar},null,8,["src"])]),header:o(()=>[a("span",pe,[t(k,{onClick:i[0]||(i[0]=R(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:o(()=>[E(d(e.contact.nickname),1)]),_:1},8,["to"])]),a("span",me," @"+d(e.contact.username),1),a("div",de,[a("span",fe," UID. "+d(e.contact.user_id),1),a("span",ve,d(g(U)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":o(()=>[a("div",he,[t($,{placement:"bottom-end",trigger:"click",size:"small",options:c.value,onSelect:m},{default:o(()=>[t(y,{quaternary:"",circle:""},{icon:o(()=>[t(g(N),null,{default:o(()=>[t(g(Z))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}}),we=q(ge,[["__scopeId","data-v-42e975ce"]]),ke={key:0,class:"skeleton-wrap"},ye={key:1},$e={key:0,class:"empty-wrap"},Ce={class:"load-more-wrap"},be={class:"load-more-spinner"},ze=P({__name:"Contacts",setup(z){const w=_e(),_=r(!1),l=r(!1),n=r([]),c=r(+w.query.p||1),m=r(20),e=r(0),i=r(!1),f=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),k=h=>{f.value=h,i.value=!0},y=()=>{i.value=!1},$=()=>{c.value<e.value||e.value==0?(l.value=!1,c.value++,v()):l.value=!0};G(()=>{v()});const v=(h=!1)=>{n.value.length===0&&(_.value=!0),Y({page:c.value,page_size:m.value}).then(u=>{_.value=!1,u.list.length===0&&(l.value=!0),c.value>1?n.value=n.value.concat(u.list):(n.value=u.list,h&&setTimeout(()=>{window.scrollTo(0,99999)},50)),e.value=Math.ceil(u.pager.total_rows/m.value)}).catch(u=>{_.value=!1,c.value>1&&c.value--})};return(h,u)=>{const x=re,B=ie,V=se,j=we,D=ce,F=W,H=ne,O=ae,T=oe;return s(),p(M,null,[a("div",null,[t(x,{title:"好友"}),t(H,{class:"main-content-wrap",bordered:""},{default:o(()=>[_.value&&n.value.length===0?(s(),p("div",ke,[t(B,{num:m.value},null,8,["num"])])):(s(),p("div",ye,[n.value.length===0?(s(),p("div",$e,[t(V,{size:"large",description:"暂无数据"})])):b("",!0),(s(!0),p(M,null,J(n.value,I=>(s(),C(D,{class:"list-item",key:I.user_id},{default:o(()=>[t(j,{contact:I,onSendWhisper:k},null,8,["contact"])]),_:2},1024))),128))])),t(F,{show:i.value,user:f.value,onSuccess:y},null,8,["show","user"])]),_:1})]),e.value>0?(s(),C(T,{key:0,justify:"center"},{default:o(()=>[t(g(le),{class:"load-more",slots:{complete:"没有更多好友了",error:"加载出错"},onInfinite:$},{spinner:o(()=>[a("div",Ce,[l.value?b("",!0):(s(),C(O,{key:0,size:14})),a("span",be,d(l.value?"没有更多好友了":"加载更多"),1)])]),_:1})]),_:1})):b("",!0)],64)}}}),Qe=q(ze,[["__scopeId","data-v-69277f0c"]]);export{Qe as default};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue