mirror of https://github.com/rocboss/paopao-ce
commit
ae8e99b658
@ -0,0 +1,4 @@
|
||||
.DS_Store
|
||||
*.log
|
||||
__debug_bin
|
||||
settings.json
|
@ -0,0 +1,14 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "paopao-ce [debug]",
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "exec",
|
||||
"program": "${workspaceFolder}/.vscode/__debug_bin",
|
||||
"preLaunchTask": "go: build (debug)",
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
let launch = require('./launch.json');
|
||||
launch.configurations.sort((a, b) => a.name.localeCompare(b.name));
|
||||
let fs = require('fs');
|
||||
fs.writeFileSync('launch.json', JSON.stringify(launch, null, 4));
|
@ -0,0 +1,21 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "go: build (debug)",
|
||||
"type": "shell",
|
||||
"command": "go",
|
||||
"args": [
|
||||
"build",
|
||||
"-gcflags=all=-N -l",
|
||||
"-tags",
|
||||
"'embed go_json'",
|
||||
"-o",
|
||||
"${workspaceFolder}/.vscode/__debug_bin"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,178 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to paopao-ce are documented in this file.
|
||||
## 0.4.0+dev ([`dev`](https://github.com/rocboss/paopao-ce/tree/dev))
|
||||
### Added
|
||||
- add `pprof` feature support [#327](https://github.com/rocboss/paopao-ce/pull/327)
|
||||
- use compiler profile-guided optimization (PGO) to further optimize builds. [#327](https://github.com/rocboss/paopao-ce/pull/327)
|
||||
- frontend: re-add stars page embed to profile page. [#339](https://github.com/rocboss/paopao-ce/pull/339)
|
||||
- simple support for user posts filter by style(post/comment/media/star). [#345](https://github.com/rocboss/paopao-ce/pull/345)
|
||||
- add user highlight tweet support include custom tweet set to highlight and list in user/profile page.
|
||||
|
||||
### Changed
|
||||
- change man content width to 600px and optimize tweet/comment/replay text length. [#333](https://github.com/rocboss/paopao-ce/pull/333)
|
||||
|
||||
## 0.3.1
|
||||
### Fixed
|
||||
- fixed: video player assets cdn error. [&caff8c0](https://github.com/rocboss/paopao-ce/commit/caff8c052be6c8d59576011192f830fd98e17ab3 'commit caff8c0')
|
||||
|
||||
## 0.3.0
|
||||
### Added
|
||||
|
||||
- add custom comment sort strategy support [#243](https://github.com/rocboss/paopao-ce/pull/243)
|
||||
- add `RedisCacheIndex` feature [#250](https://github.com/rocboss/paopao-ce/pull/250)
|
||||
- add `Sentry` feature [#258](https://github.com/rocboss/paopao-ce/pull/258)
|
||||
- add simple tweet share feature(just copy tweet link to clipboard now) support [#264](https://github.com/rocboss/paopao-ce/pull/264)
|
||||
- add default tweet max length configure in web/.env support. [&a1160ca](https://github.com/rocboss/paopao-ce/commit/a1160ca79380445157146d9eae1710543c153cce 'commit a1160ca')
|
||||
Set the value of `VITE_DEFAULT_TWEET_MAX_LENGTH` in file web/.env to change the tweet max default length.
|
||||
- add custom whether provide user register configure in web/.env support. [#267](https://github.com/rocboss/paopao-ce/pull/267)
|
||||
Set the value of `VITE_ALLOW_USER_REGISTER` in file web/.env to custom whether provide user register feature.
|
||||
```
|
||||
# file: web/.env or web/.env.local
|
||||
...
|
||||
# 局部参数
|
||||
VITE_ALLOW_USER_REGISTER=true
|
||||
...
|
||||
```
|
||||
and disallow user register in backend(add `Web:DisallowUserRegister` feature in `config.yaml`):
|
||||
```yaml
|
||||
# file config.yaml
|
||||
...
|
||||
Features:
|
||||
Default: ["Base", "Postgres", "Zinc", "LocalOSS", "LoggerZinc", "BigCacheIndex", "Friendship", "Service", "Web:DisallowUserRegister"]
|
||||
...
|
||||
```
|
||||
- add topic follow feature support [#273](https://github.com/rocboss/paopao-ce/pull/273)
|
||||
mirgration database first(sql ddl file in `scripts/migration/**/*_topic_follow.up.sql`):
|
||||
```sql
|
||||
CREATE TABLE `p_topic_user` (
|
||||
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`topic_id` BIGINT UNSIGNED NOT NULL COMMENT '标签ID',
|
||||
`user_id` BIGINT UNSIGNED NOT NULL COMMENT '创建者ID',
|
||||
`alias_name` VARCHAR ( 255 ) COMMENT '别名',
|
||||
`remark` VARCHAR ( 512 ) COMMENT '备注',
|
||||
`quote_num` BIGINT UNSIGNED COMMENT '引用数',
|
||||
`is_top` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否置顶 0 为未置顶、1 为已置顶',
|
||||
`created_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`modified_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
`deleted_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间',
|
||||
`is_del` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除',
|
||||
`reserve_a` VARCHAR ( 255 ) COMMENT '保留字段a',
|
||||
`reserve_b` VARCHAR ( 255 ) COMMENT '保留字段b',
|
||||
PRIMARY KEY ( `id` ) USING BTREE,
|
||||
UNIQUE KEY `idx_topic_user_uid_tid` ( `topic_id`, `user_id` ) USING BTREE
|
||||
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户话题';
|
||||
```
|
||||
- add tweet comment thumbs up/down feature support [#275](https://github.com/rocboss/paopao-ce/pull/275)
|
||||
mirgration database first(sql ddl file in `scripts/migration/**/*_comment_thumbs.up.sql`):
|
||||
- add load more comments feature support [&60b217b](https://github.com/rocboss/paopao-ce/commit/60b217bcd950c69ba45cebcaa17efdf8048d5a4f 'commit 60b217b')
|
||||
|
||||
### Fixed
|
||||
|
||||
- fixed sql ddl p_contact's column `is_delete` define error (change to `is_del`) in scripts/paopao-mysql.sql [&afd8fe1](https://github.com/rocboss/paopao-ce/commit/afd8fe18d2dce08a4af846c2f822379d99a3d3b3 'commit afd8fe1')
|
||||
- fixed cache index not expire in delete/add tweet error [#266](https://github.com/rocboss/paopao-ce/pull/266)
|
||||
- fixed tweet's owner not allow star/collection action when tweet is private error [#274](https://github.com/rocboss/paopao-ce/pull/274)
|
||||
- fixed user not list owner's collectioned private tweet error [#274](https://github.com/rocboss/paopao-ce/pull/274)
|
||||
- fixed comments thumbs up/down state incorrect error [#283](https://github.com/rocboss/paopao-ce/pull/283)
|
||||
|
||||
### Fixed
|
||||
|
||||
- fixed sql ddl p_contact's column `is_delete` define error (change to `is_del`) in scripts/paopao-mysql.sql [&afd8fe1](https://github.com/rocboss/paopao-ce/commit/afd8fe18d2dce08a4af846c2f822379d99a3d3b3 'commit afd8fe1')
|
||||
|
||||
### Changed
|
||||
|
||||
- use [github.com/rueian/rueidis](https://github.com/rueian/rueidis) as Redis client [#249](https://github.com/rocboss/paopao-ce/pull/249)
|
||||
the **Old** redis client configure field
|
||||
```yaml
|
||||
...
|
||||
Redis:
|
||||
Host: redis:6379
|
||||
Password:
|
||||
DB:
|
||||
```
|
||||
the **New** redis client configure field
|
||||
```yaml
|
||||
...
|
||||
Redis:
|
||||
InitAddress:
|
||||
- redis:6379
|
||||
Username:
|
||||
Password:
|
||||
SelectDB:
|
||||
ConnWriteTimeout: 60 # 连接写超时时间 多少秒 默认 60秒
|
||||
```
|
||||
- optimize web frontend dark theme [&b082a8f](https://github.com/rocboss/paopao-ce/commit/b082a8fa5e43dd6dacf459df93fa7e243dd901ea 'commit b082a8f')
|
||||
- change web frontend main content layout default size to 544px [&b082a8f](https://github.com/rocboss/paopao-ce/commit/b082a8fa5e43dd6dacf459df93fa7e243dd901ea 'commit b082a8f')
|
||||
- optimize web frontend in mobile environment use Drawer to display menu [#265](https://github.com/rocboss/paopao-ce/pull/265)
|
||||
- optimize Dockerfile use pre-build builder/runner image to prevent network latency problem (`bitbus/paopao-ce-backend-builder` `bitbus/paopao-ce-backend-runner`) [#265](https://github.com/rocboss/paopao-ce/pull/265)
|
||||
- optimize web ui in mobile environment [#280](https://github.com/rocboss/paopao-ce/pull/280)
|
||||
- optimize upload zip attachment compatible with different browsers for uploading zip mimetype [#286](https://github.com/rocboss/paopao-ce/pull/286)
|
||||
- adapte meilisearch to version v1.1 [#288](https://github.com/rocboss/paopao-ce/pull/288)
|
||||
|
||||
### Removed
|
||||
|
||||
- remove `Deprecated:OldWeb` feature [#256](https://github.com/rocboss/paopao-ce/pull/256)
|
||||
|
||||
## 0.2.5
|
||||
|
||||
### Changed
|
||||
|
||||
- fixed sql ddl error for contact table [#281](https://github.com/rocboss/paopao-ce/pull/281)
|
||||
|
||||
## 0.2.4
|
||||
|
||||
### Added
|
||||
|
||||
- add PWA support for web frontend [#242](https://github.com/rocboss/paopao-ce/pull/242)
|
||||
|
||||
|
||||
## 0.2.3
|
||||
|
||||
### Added
|
||||
|
||||
- add PostgreSQL DDL file [#229](https://github.com/rocboss/paopao-ce/pull/229)
|
||||
|
||||
### Changed
|
||||
|
||||
- optimize MySQL DDL file [#229](https://github.com/rocboss/paopao-ce/pull/229)
|
||||
- optimize Sqlite3 DDL file [#229](https://github.com/rocboss/paopao-ce/pull/229)
|
||||
|
||||
## 0.2.2
|
||||
|
||||
### Fixed
|
||||
|
||||
- fixed add star to tweet error [#222](https://github.com/rocboss/paopao-ce/pull/222)
|
||||
|
||||
## 0.2.1
|
||||
|
||||
### Changed
|
||||
|
||||
- optimize docker-compose.yaml use bitbus/paopao-ce:latest as release image [#217](https://github.com/rocboss/paopao-ce/pull/217)
|
||||
|
||||
### Fixed
|
||||
|
||||
- fixed sql ddl in scripts/paopao-mysql.sql and scripts/paopao-sqlite3.sql [#217](https://github.com/rocboss/paopao-ce/pull/217)
|
||||
|
||||
## 0.2.0
|
||||
|
||||
### Added
|
||||
|
||||
- add `Friendship` feature [#192](https://github.com/rocboss/paopao-ce/pull/192)
|
||||
- add `Lightship` feature [#198](https://github.com/rocboss/paopao-ce/pull/198)
|
||||
- add `Pyroscope` feature [#199](https://github.com/rocboss/paopao-ce/pull/199)
|
||||
- add new `Web` service [#196](https://github.com/rocboss/paopao-ce/pull/196)
|
||||
- add `Frontend:Web` feature [#196](https://github.com/rocboss/paopao-ce/pull/196)
|
||||
- add `Deprecated:OldWeb` feature [#196](https://github.com/rocboss/paopao-ce/pull/196)
|
||||
|
||||
### Changes
|
||||
|
||||
- support run multiple service in single paopao-ce instance [#196](https://github.com/rocboss/paopao-ce/pull/196)
|
||||
- use [go-mir](https://github.com/alimy/mir) optimize paopao-ce source code architecture [#196](https://github.com/rocboss/paopao-ce/pull/196)
|
||||
|
||||
### Fixed
|
||||
|
||||
- some other features optimize and bug fix
|
||||
|
||||
---
|
||||
|
||||
**Older change logs can be found on [GitHub](https://github.com/rocboss/paopao-ce/releases?after=v0.2.0).**
|
@ -0,0 +1,159 @@
|
||||
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
|
||||
//
|
||||
// Source: core/v1/auth.proto
|
||||
|
||||
package corev1connect
|
||||
|
||||
import (
|
||||
context "context"
|
||||
errors "errors"
|
||||
connect_go "github.com/bufbuild/connect-go"
|
||||
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_go.IsAtLeastVersion0_1_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"
|
||||
)
|
||||
|
||||
// AuthenticateServiceClient is a client for the core.v1.AuthenticateService service.
|
||||
type AuthenticateServiceClient interface {
|
||||
PreLogin(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error)
|
||||
Login(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.LoginReply], error)
|
||||
Logout(context.Context, *connect_go.Request[v1.User]) (*connect_go.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_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) AuthenticateServiceClient {
|
||||
baseURL = strings.TrimRight(baseURL, "/")
|
||||
return &authenticateServiceClient{
|
||||
preLogin: connect_go.NewClient[v1.User, v1.ActionReply](
|
||||
httpClient,
|
||||
baseURL+AuthenticateServicePreLoginProcedure,
|
||||
opts...,
|
||||
),
|
||||
login: connect_go.NewClient[v1.User, v1.LoginReply](
|
||||
httpClient,
|
||||
baseURL+AuthenticateServiceLoginProcedure,
|
||||
opts...,
|
||||
),
|
||||
logout: connect_go.NewClient[v1.User, v1.ActionReply](
|
||||
httpClient,
|
||||
baseURL+AuthenticateServiceLogoutProcedure,
|
||||
opts...,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
// authenticateServiceClient implements AuthenticateServiceClient.
|
||||
type authenticateServiceClient struct {
|
||||
preLogin *connect_go.Client[v1.User, v1.ActionReply]
|
||||
login *connect_go.Client[v1.User, v1.LoginReply]
|
||||
logout *connect_go.Client[v1.User, v1.ActionReply]
|
||||
}
|
||||
|
||||
// PreLogin calls core.v1.AuthenticateService.preLogin.
|
||||
func (c *authenticateServiceClient) PreLogin(ctx context.Context, req *connect_go.Request[v1.User]) (*connect_go.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_go.Request[v1.User]) (*connect_go.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_go.Request[v1.User]) (*connect_go.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_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error)
|
||||
Login(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.LoginReply], error)
|
||||
Logout(context.Context, *connect_go.Request[v1.User]) (*connect_go.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_go.HandlerOption) (string, http.Handler) {
|
||||
authenticateServicePreLoginHandler := connect_go.NewUnaryHandler(
|
||||
AuthenticateServicePreLoginProcedure,
|
||||
svc.PreLogin,
|
||||
opts...,
|
||||
)
|
||||
authenticateServiceLoginHandler := connect_go.NewUnaryHandler(
|
||||
AuthenticateServiceLoginProcedure,
|
||||
svc.Login,
|
||||
opts...,
|
||||
)
|
||||
authenticateServiceLogoutHandler := connect_go.NewUnaryHandler(
|
||||
AuthenticateServiceLogoutProcedure,
|
||||
svc.Logout,
|
||||
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_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) {
|
||||
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("core.v1.AuthenticateService.preLogin is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedAuthenticateServiceHandler) Login(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.LoginReply], error) {
|
||||
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("core.v1.AuthenticateService.login is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedAuthenticateServiceHandler) Logout(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) {
|
||||
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("core.v1.AuthenticateService.logout is not implemented"))
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
|
||||
//
|
||||
// Source: greet/v1/greet.proto
|
||||
|
||||
package greetv1connect
|
||||
|
||||
import (
|
||||
context "context"
|
||||
errors "errors"
|
||||
connect_go "github.com/bufbuild/connect-go"
|
||||
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_go.IsAtLeastVersion0_1_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"
|
||||
)
|
||||
|
||||
// GreetServiceClient is a client for the greet.v1.GreetService service.
|
||||
type GreetServiceClient interface {
|
||||
Greet(context.Context, *connect_go.Request[v1.GreetRequest]) (*connect_go.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_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) GreetServiceClient {
|
||||
baseURL = strings.TrimRight(baseURL, "/")
|
||||
return &greetServiceClient{
|
||||
greet: connect_go.NewClient[v1.GreetRequest, v1.GreetResponse](
|
||||
httpClient,
|
||||
baseURL+GreetServiceGreetProcedure,
|
||||
opts...,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
// greetServiceClient implements GreetServiceClient.
|
||||
type greetServiceClient struct {
|
||||
greet *connect_go.Client[v1.GreetRequest, v1.GreetResponse]
|
||||
}
|
||||
|
||||
// Greet calls greet.v1.GreetService.Greet.
|
||||
func (c *greetServiceClient) Greet(ctx context.Context, req *connect_go.Request[v1.GreetRequest]) (*connect_go.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_go.Request[v1.GreetRequest]) (*connect_go.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_go.HandlerOption) (string, http.Handler) {
|
||||
greetServiceGreetHandler := connect_go.NewUnaryHandler(
|
||||
GreetServiceGreetProcedure,
|
||||
svc.Greet,
|
||||
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_go.Request[v1.GreetRequest]) (*connect_go.Response[v1.GreetResponse], error) {
|
||||
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("greet.v1.GreetService.Greet is not implemented"))
|
||||
}
|
@ -0,0 +1,375 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc (unknown)
|
||||
// source: core/v1/auth.proto
|
||||
|
||||
package corev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type User struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
PhoneNum string `protobuf:"bytes,1,opt,name=phone_num,json=phoneNum,proto3" json:"phone_num,omitempty"`
|
||||
}
|
||||
|
||||
func (x *User) Reset() {
|
||||
*x = User{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_core_v1_auth_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *User) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*User) ProtoMessage() {}
|
||||
|
||||
func (x *User) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_core_v1_auth_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use User.ProtoReflect.Descriptor instead.
|
||||
func (*User) Descriptor() ([]byte, []int) {
|
||||
return file_core_v1_auth_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *User) GetPhoneNum() string {
|
||||
if x != nil {
|
||||
return x.PhoneNum
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type UserVerify struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
PhoneNum string `protobuf:"bytes,1,opt,name=phone_num,json=phoneNum,proto3" json:"phone_num,omitempty"`
|
||||
VerificationCode string `protobuf:"bytes,2,opt,name=verification_code,json=verificationCode,proto3" json:"verification_code,omitempty"`
|
||||
}
|
||||
|
||||
func (x *UserVerify) Reset() {
|
||||
*x = UserVerify{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_core_v1_auth_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *UserVerify) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UserVerify) ProtoMessage() {}
|
||||
|
||||
func (x *UserVerify) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_core_v1_auth_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UserVerify.ProtoReflect.Descriptor instead.
|
||||
func (*UserVerify) Descriptor() ([]byte, []int) {
|
||||
return file_core_v1_auth_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *UserVerify) GetPhoneNum() string {
|
||||
if x != nil {
|
||||
return x.PhoneNum
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UserVerify) GetVerificationCode() string {
|
||||
if x != nil {
|
||||
return x.VerificationCode
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type LoginReply struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
|
||||
Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
|
||||
}
|
||||
|
||||
func (x *LoginReply) Reset() {
|
||||
*x = LoginReply{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_core_v1_auth_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LoginReply) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LoginReply) ProtoMessage() {}
|
||||
|
||||
func (x *LoginReply) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_core_v1_auth_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use LoginReply.ProtoReflect.Descriptor instead.
|
||||
func (*LoginReply) Descriptor() ([]byte, []int) {
|
||||
return file_core_v1_auth_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *LoginReply) GetStatusCode() int32 {
|
||||
if x != nil {
|
||||
return x.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *LoginReply) GetToken() string {
|
||||
if x != nil {
|
||||
return x.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ActionReply struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ActionReply) Reset() {
|
||||
*x = ActionReply{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_core_v1_auth_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ActionReply) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ActionReply) ProtoMessage() {}
|
||||
|
||||
func (x *ActionReply) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_core_v1_auth_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ActionReply.ProtoReflect.Descriptor instead.
|
||||
func (*ActionReply) Descriptor() ([]byte, []int) {
|
||||
return file_core_v1_auth_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ActionReply) GetStatusCode() int32 {
|
||||
if x != nil {
|
||||
return x.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_core_v1_auth_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_core_v1_auth_proto_rawDesc = []byte{
|
||||
0x0a, 0x12, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x23, 0x0a,
|
||||
0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e,
|
||||
0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e,
|
||||
0x75, 0x6d, 0x22, 0x56, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79,
|
||||
0x12, 0x1b, 0x0a, 0x09, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x2b, 0x0a,
|
||||
0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f,
|
||||
0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69,
|
||||
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x43, 0x0a, 0x0a, 0x4c, 0x6f,
|
||||
0x67, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b,
|
||||
0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22,
|
||||
0x2e, 0x0a, 0x0b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1f,
|
||||
0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x32,
|
||||
0xa2, 0x01, 0x0a, 0x13, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x4c, 0x6f,
|
||||
0x67, 0x69, 0x6e, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73,
|
||||
0x65, 0x72, 0x1a, 0x14, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2b, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69,
|
||||
0x6e, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72,
|
||||
0x1a, 0x13, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e,
|
||||
0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2d, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12,
|
||||
0x0d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x14,
|
||||
0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52,
|
||||
0x65, 0x70, 0x6c, 0x79, 0x42, 0x8b, 0x01, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72,
|
||||
0x65, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
|
||||
0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f,
|
||||
0x63, 0x62, 0x6f, 0x73, 0x73, 0x2f, 0x70, 0x61, 0x6f, 0x70, 0x61, 0x6f, 0x2d, 0x63, 0x65, 0x2f,
|
||||
0x61, 0x75, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31,
|
||||
0x3b, 0x63, 0x6f, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x07,
|
||||
0x43, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x07, 0x43, 0x6f, 0x72, 0x65, 0x5c, 0x56,
|
||||
0x31, 0xe2, 0x02, 0x13, 0x43, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d,
|
||||
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x08, 0x43, 0x6f, 0x72, 0x65, 0x3a, 0x3a,
|
||||
0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_core_v1_auth_proto_rawDescOnce sync.Once
|
||||
file_core_v1_auth_proto_rawDescData = file_core_v1_auth_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_core_v1_auth_proto_rawDescGZIP() []byte {
|
||||
file_core_v1_auth_proto_rawDescOnce.Do(func() {
|
||||
file_core_v1_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_core_v1_auth_proto_rawDescData)
|
||||
})
|
||||
return file_core_v1_auth_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_core_v1_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_core_v1_auth_proto_goTypes = []interface{}{
|
||||
(*User)(nil), // 0: core.v1.User
|
||||
(*UserVerify)(nil), // 1: core.v1.UserVerify
|
||||
(*LoginReply)(nil), // 2: core.v1.LoginReply
|
||||
(*ActionReply)(nil), // 3: core.v1.ActionReply
|
||||
}
|
||||
var file_core_v1_auth_proto_depIdxs = []int32{
|
||||
0, // 0: core.v1.AuthenticateService.preLogin:input_type -> core.v1.User
|
||||
0, // 1: core.v1.AuthenticateService.login:input_type -> core.v1.User
|
||||
0, // 2: core.v1.AuthenticateService.logout:input_type -> core.v1.User
|
||||
3, // 3: core.v1.AuthenticateService.preLogin:output_type -> core.v1.ActionReply
|
||||
2, // 4: core.v1.AuthenticateService.login:output_type -> core.v1.LoginReply
|
||||
3, // 5: core.v1.AuthenticateService.logout:output_type -> core.v1.ActionReply
|
||||
3, // [3:6] is the sub-list for method output_type
|
||||
0, // [0:3] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_core_v1_auth_proto_init() }
|
||||
func file_core_v1_auth_proto_init() {
|
||||
if File_core_v1_auth_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_core_v1_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*User); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_core_v1_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*UserVerify); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_core_v1_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*LoginReply); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_core_v1_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ActionReply); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_core_v1_auth_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_core_v1_auth_proto_goTypes,
|
||||
DependencyIndexes: file_core_v1_auth_proto_depIdxs,
|
||||
MessageInfos: file_core_v1_auth_proto_msgTypes,
|
||||
}.Build()
|
||||
File_core_v1_auth_proto = out.File
|
||||
file_core_v1_auth_proto_rawDesc = nil
|
||||
file_core_v1_auth_proto_goTypes = nil
|
||||
file_core_v1_auth_proto_depIdxs = nil
|
||||
}
|
@ -0,0 +1,183 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: core/v1/auth.proto
|
||||
|
||||
package corev1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
AuthenticateService_PreLogin_FullMethodName = "/core.v1.AuthenticateService/preLogin"
|
||||
AuthenticateService_Login_FullMethodName = "/core.v1.AuthenticateService/login"
|
||||
AuthenticateService_Logout_FullMethodName = "/core.v1.AuthenticateService/logout"
|
||||
)
|
||||
|
||||
// AuthenticateServiceClient is the client API for AuthenticateService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type AuthenticateServiceClient interface {
|
||||
PreLogin(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error)
|
||||
Login(ctx context.Context, in *User, opts ...grpc.CallOption) (*LoginReply, error)
|
||||
Logout(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error)
|
||||
}
|
||||
|
||||
type authenticateServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAuthenticateServiceClient(cc grpc.ClientConnInterface) AuthenticateServiceClient {
|
||||
return &authenticateServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *authenticateServiceClient) PreLogin(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) {
|
||||
out := new(ActionReply)
|
||||
err := c.cc.Invoke(ctx, AuthenticateService_PreLogin_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authenticateServiceClient) Login(ctx context.Context, in *User, opts ...grpc.CallOption) (*LoginReply, error) {
|
||||
out := new(LoginReply)
|
||||
err := c.cc.Invoke(ctx, AuthenticateService_Login_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authenticateServiceClient) Logout(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) {
|
||||
out := new(ActionReply)
|
||||
err := c.cc.Invoke(ctx, AuthenticateService_Logout_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AuthenticateServiceServer is the server API for AuthenticateService service.
|
||||
// All implementations must embed UnimplementedAuthenticateServiceServer
|
||||
// for forward compatibility
|
||||
type AuthenticateServiceServer interface {
|
||||
PreLogin(context.Context, *User) (*ActionReply, error)
|
||||
Login(context.Context, *User) (*LoginReply, error)
|
||||
Logout(context.Context, *User) (*ActionReply, error)
|
||||
mustEmbedUnimplementedAuthenticateServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedAuthenticateServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedAuthenticateServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedAuthenticateServiceServer) PreLogin(context.Context, *User) (*ActionReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PreLogin not implemented")
|
||||
}
|
||||
func (UnimplementedAuthenticateServiceServer) Login(context.Context, *User) (*LoginReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
|
||||
}
|
||||
func (UnimplementedAuthenticateServiceServer) Logout(context.Context, *User) (*ActionReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented")
|
||||
}
|
||||
func (UnimplementedAuthenticateServiceServer) mustEmbedUnimplementedAuthenticateServiceServer() {}
|
||||
|
||||
// UnsafeAuthenticateServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AuthenticateServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAuthenticateServiceServer interface {
|
||||
mustEmbedUnimplementedAuthenticateServiceServer()
|
||||
}
|
||||
|
||||
func RegisterAuthenticateServiceServer(s grpc.ServiceRegistrar, srv AuthenticateServiceServer) {
|
||||
s.RegisterService(&AuthenticateService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _AuthenticateService_PreLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(User)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthenticateServiceServer).PreLogin(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthenticateService_PreLogin_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthenticateServiceServer).PreLogin(ctx, req.(*User))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthenticateService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(User)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthenticateServiceServer).Login(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthenticateService_Login_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthenticateServiceServer).Login(ctx, req.(*User))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthenticateService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(User)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthenticateServiceServer).Logout(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthenticateService_Logout_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthenticateServiceServer).Logout(ctx, req.(*User))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AuthenticateService_ServiceDesc is the grpc.ServiceDesc for AuthenticateService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var AuthenticateService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "core.v1.AuthenticateService",
|
||||
HandlerType: (*AuthenticateServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "preLogin",
|
||||
Handler: _AuthenticateService_PreLogin_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "login",
|
||||
Handler: _AuthenticateService_Login_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "logout",
|
||||
Handler: _AuthenticateService_Logout_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "core/v1/auth.proto",
|
||||
}
|
@ -0,0 +1,220 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc (unknown)
|
||||
// source: greet/v1/greet.proto
|
||||
|
||||
package greetv1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type GreetRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GreetRequest) Reset() {
|
||||
*x = GreetRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_greet_v1_greet_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GreetRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GreetRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GreetRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_greet_v1_greet_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GreetRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GreetRequest) Descriptor() ([]byte, []int) {
|
||||
return file_greet_v1_greet_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *GreetRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GreetResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GreetResponse) Reset() {
|
||||
*x = GreetResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_greet_v1_greet_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GreetResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GreetResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GreetResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_greet_v1_greet_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GreetResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GreetResponse) Descriptor() ([]byte, []int) {
|
||||
return file_greet_v1_greet_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GreetResponse) GetGreeting() string {
|
||||
if x != nil {
|
||||
return x.Greeting
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_greet_v1_greet_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_greet_v1_greet_proto_rawDesc = []byte{
|
||||
0x0a, 0x14, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x65, 0x65, 0x74,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2e, 0x76, 0x31,
|
||||
0x22, 0x22, 0x0a, 0x0c, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
||||
0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2b, 0x0a, 0x0d, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x65, 0x65, 0x74, 0x69, 0x6e,
|
||||
0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x65, 0x65, 0x74, 0x69, 0x6e,
|
||||
0x67, 0x32, 0x4a, 0x0a, 0x0c, 0x47, 0x72, 0x65, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x12, 0x3a, 0x0a, 0x05, 0x47, 0x72, 0x65, 0x65, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x72, 0x65,
|
||||
0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72,
|
||||
0x65, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x93, 0x01,
|
||||
0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a,
|
||||
0x47, 0x72, 0x65, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x63, 0x62, 0x6f, 0x73, 0x73,
|
||||
0x2f, 0x70, 0x61, 0x6f, 0x70, 0x61, 0x6f, 0x2d, 0x63, 0x65, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x2f,
|
||||
0x72, 0x70, 0x63, 0x2f, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x72, 0x65,
|
||||
0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x47, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x47, 0x72, 0x65,
|
||||
0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x47, 0x72, 0x65, 0x65, 0x74, 0x5c, 0x56, 0x31,
|
||||
0xe2, 0x02, 0x14, 0x47, 0x72, 0x65, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d,
|
||||
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x47, 0x72, 0x65, 0x65, 0x74, 0x3a,
|
||||
0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_greet_v1_greet_proto_rawDescOnce sync.Once
|
||||
file_greet_v1_greet_proto_rawDescData = file_greet_v1_greet_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_greet_v1_greet_proto_rawDescGZIP() []byte {
|
||||
file_greet_v1_greet_proto_rawDescOnce.Do(func() {
|
||||
file_greet_v1_greet_proto_rawDescData = protoimpl.X.CompressGZIP(file_greet_v1_greet_proto_rawDescData)
|
||||
})
|
||||
return file_greet_v1_greet_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_greet_v1_greet_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_greet_v1_greet_proto_goTypes = []interface{}{
|
||||
(*GreetRequest)(nil), // 0: greet.v1.GreetRequest
|
||||
(*GreetResponse)(nil), // 1: greet.v1.GreetResponse
|
||||
}
|
||||
var file_greet_v1_greet_proto_depIdxs = []int32{
|
||||
0, // 0: greet.v1.GreetService.Greet:input_type -> greet.v1.GreetRequest
|
||||
1, // 1: greet.v1.GreetService.Greet:output_type -> greet.v1.GreetResponse
|
||||
1, // [1:2] is the sub-list for method output_type
|
||||
0, // [0:1] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_greet_v1_greet_proto_init() }
|
||||
func file_greet_v1_greet_proto_init() {
|
||||
if File_greet_v1_greet_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_greet_v1_greet_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GreetRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_greet_v1_greet_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GreetResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_greet_v1_greet_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_greet_v1_greet_proto_goTypes,
|
||||
DependencyIndexes: file_greet_v1_greet_proto_depIdxs,
|
||||
MessageInfos: file_greet_v1_greet_proto_msgTypes,
|
||||
}.Build()
|
||||
File_greet_v1_greet_proto = out.File
|
||||
file_greet_v1_greet_proto_rawDesc = nil
|
||||
file_greet_v1_greet_proto_goTypes = nil
|
||||
file_greet_v1_greet_proto_depIdxs = nil
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: greet/v1/greet.proto
|
||||
|
||||
package greetv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
GreetService_Greet_FullMethodName = "/greet.v1.GreetService/Greet"
|
||||
)
|
||||
|
||||
// GreetServiceClient is the client API for GreetService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type GreetServiceClient interface {
|
||||
Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error)
|
||||
}
|
||||
|
||||
type greetServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewGreetServiceClient(cc grpc.ClientConnInterface) GreetServiceClient {
|
||||
return &greetServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *greetServiceClient) Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error) {
|
||||
out := new(GreetResponse)
|
||||
err := c.cc.Invoke(ctx, GreetService_Greet_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// GreetServiceServer is the server API for GreetService service.
|
||||
// All implementations must embed UnimplementedGreetServiceServer
|
||||
// for forward compatibility
|
||||
type GreetServiceServer interface {
|
||||
Greet(context.Context, *GreetRequest) (*GreetResponse, error)
|
||||
mustEmbedUnimplementedGreetServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedGreetServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedGreetServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedGreetServiceServer) Greet(context.Context, *GreetRequest) (*GreetResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Greet not implemented")
|
||||
}
|
||||
func (UnimplementedGreetServiceServer) mustEmbedUnimplementedGreetServiceServer() {}
|
||||
|
||||
// UnsafeGreetServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to GreetServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeGreetServiceServer interface {
|
||||
mustEmbedUnimplementedGreetServiceServer()
|
||||
}
|
||||
|
||||
func RegisterGreetServiceServer(s grpc.ServiceRegistrar, srv GreetServiceServer) {
|
||||
s.RegisterService(&GreetService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _GreetService_Greet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GreetRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(GreetServiceServer).Greet(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: GreetService_Greet_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(GreetServiceServer).Greet(ctx, req.(*GreetRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// GreetService_ServiceDesc is the grpc.ServiceDesc for GreetService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var GreetService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "greet.v1.GreetService",
|
||||
HandlerType: (*GreetServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Greet",
|
||||
Handler: _GreetService_Greet_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "greet/v1/greet.proto",
|
||||
}
|
@ -1,371 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc (unknown)
|
||||
// source: v1/auth.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type User struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
PhoneNum string `protobuf:"bytes,1,opt,name=phoneNum,proto3" json:"phoneNum,omitempty"`
|
||||
}
|
||||
|
||||
func (x *User) Reset() {
|
||||
*x = User{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_v1_auth_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *User) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*User) ProtoMessage() {}
|
||||
|
||||
func (x *User) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_v1_auth_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use User.ProtoReflect.Descriptor instead.
|
||||
func (*User) Descriptor() ([]byte, []int) {
|
||||
return file_v1_auth_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *User) GetPhoneNum() string {
|
||||
if x != nil {
|
||||
return x.PhoneNum
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type UserVerify struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
PhoneNum string `protobuf:"bytes,1,opt,name=phoneNum,proto3" json:"phoneNum,omitempty"`
|
||||
VerificationCode string `protobuf:"bytes,2,opt,name=VerificationCode,proto3" json:"VerificationCode,omitempty"`
|
||||
}
|
||||
|
||||
func (x *UserVerify) Reset() {
|
||||
*x = UserVerify{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_v1_auth_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *UserVerify) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UserVerify) ProtoMessage() {}
|
||||
|
||||
func (x *UserVerify) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_v1_auth_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UserVerify.ProtoReflect.Descriptor instead.
|
||||
func (*UserVerify) Descriptor() ([]byte, []int) {
|
||||
return file_v1_auth_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *UserVerify) GetPhoneNum() string {
|
||||
if x != nil {
|
||||
return x.PhoneNum
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UserVerify) GetVerificationCode() string {
|
||||
if x != nil {
|
||||
return x.VerificationCode
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type LoginReply struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
StatuCode int32 `protobuf:"varint,1,opt,name=statuCode,proto3" json:"statuCode,omitempty"`
|
||||
Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
|
||||
}
|
||||
|
||||
func (x *LoginReply) Reset() {
|
||||
*x = LoginReply{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_v1_auth_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LoginReply) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LoginReply) ProtoMessage() {}
|
||||
|
||||
func (x *LoginReply) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_v1_auth_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use LoginReply.ProtoReflect.Descriptor instead.
|
||||
func (*LoginReply) Descriptor() ([]byte, []int) {
|
||||
return file_v1_auth_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *LoginReply) GetStatuCode() int32 {
|
||||
if x != nil {
|
||||
return x.StatuCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *LoginReply) GetToken() string {
|
||||
if x != nil {
|
||||
return x.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ActionReply struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
StatusCode int32 `protobuf:"varint,1,opt,name=statusCode,proto3" json:"statusCode,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ActionReply) Reset() {
|
||||
*x = ActionReply{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_v1_auth_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ActionReply) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ActionReply) ProtoMessage() {}
|
||||
|
||||
func (x *ActionReply) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_v1_auth_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ActionReply.ProtoReflect.Descriptor instead.
|
||||
func (*ActionReply) Descriptor() ([]byte, []int) {
|
||||
return file_v1_auth_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ActionReply) GetStatusCode() int32 {
|
||||
if x != nil {
|
||||
return x.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_v1_auth_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_v1_auth_proto_rawDesc = []byte{
|
||||
0x0a, 0x0d, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x04, 0x61, 0x75, 0x74, 0x68, 0x22, 0x22, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a,
|
||||
0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x22, 0x54, 0x0a, 0x0a, 0x55, 0x73, 0x65,
|
||||
0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65,
|
||||
0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65,
|
||||
0x4e, 0x75, 0x6d, 0x12, 0x2a, 0x0a, 0x10, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x56,
|
||||
0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x22,
|
||||
0x40, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c, 0x0a,
|
||||
0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74,
|
||||
0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65,
|
||||
0x6e, 0x22, 0x2d, 0x0a, 0x0b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79,
|
||||
0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65,
|
||||
0x32, 0x89, 0x01, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
|
||||
0x65, 0x12, 0x29, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x0a, 0x2e,
|
||||
0x61, 0x75, 0x74, 0x68, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x11, 0x2e, 0x61, 0x75, 0x74, 0x68,
|
||||
0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x05,
|
||||
0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x0a, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x55, 0x73, 0x65,
|
||||
0x72, 0x1a, 0x10, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65,
|
||||
0x70, 0x6c, 0x79, 0x12, 0x27, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x0a, 0x2e,
|
||||
0x61, 0x75, 0x74, 0x68, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x11, 0x2e, 0x61, 0x75, 0x74, 0x68,
|
||||
0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x6f, 0x0a, 0x08,
|
||||
0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x42, 0x09, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x72, 0x6f, 0x63, 0x62, 0x6f, 0x73, 0x73, 0x2f, 0x70, 0x61, 0x6f, 0x70, 0x61, 0x6f,
|
||||
0x2d, 0x63, 0x65, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0xa2,
|
||||
0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x41, 0x75, 0x74, 0x68, 0xca, 0x02, 0x04, 0x41,
|
||||
0x75, 0x74, 0x68, 0xe2, 0x02, 0x10, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65,
|
||||
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x41, 0x75, 0x74, 0x68, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_v1_auth_proto_rawDescOnce sync.Once
|
||||
file_v1_auth_proto_rawDescData = file_v1_auth_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_v1_auth_proto_rawDescGZIP() []byte {
|
||||
file_v1_auth_proto_rawDescOnce.Do(func() {
|
||||
file_v1_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_auth_proto_rawDescData)
|
||||
})
|
||||
return file_v1_auth_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_v1_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_v1_auth_proto_goTypes = []interface{}{
|
||||
(*User)(nil), // 0: auth.User
|
||||
(*UserVerify)(nil), // 1: auth.UserVerify
|
||||
(*LoginReply)(nil), // 2: auth.LoginReply
|
||||
(*ActionReply)(nil), // 3: auth.ActionReply
|
||||
}
|
||||
var file_v1_auth_proto_depIdxs = []int32{
|
||||
0, // 0: auth.Authenticate.preLogin:input_type -> auth.User
|
||||
0, // 1: auth.Authenticate.login:input_type -> auth.User
|
||||
0, // 2: auth.Authenticate.logout:input_type -> auth.User
|
||||
3, // 3: auth.Authenticate.preLogin:output_type -> auth.ActionReply
|
||||
2, // 4: auth.Authenticate.login:output_type -> auth.LoginReply
|
||||
3, // 5: auth.Authenticate.logout:output_type -> auth.ActionReply
|
||||
3, // [3:6] is the sub-list for method output_type
|
||||
0, // [0:3] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_v1_auth_proto_init() }
|
||||
func file_v1_auth_proto_init() {
|
||||
if File_v1_auth_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_v1_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*User); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_v1_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*UserVerify); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_v1_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*LoginReply); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_v1_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ActionReply); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_v1_auth_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_v1_auth_proto_goTypes,
|
||||
DependencyIndexes: file_v1_auth_proto_depIdxs,
|
||||
MessageInfos: file_v1_auth_proto_msgTypes,
|
||||
}.Build()
|
||||
File_v1_auth_proto = out.File
|
||||
file_v1_auth_proto_rawDesc = nil
|
||||
file_v1_auth_proto_goTypes = nil
|
||||
file_v1_auth_proto_depIdxs = nil
|
||||
}
|
@ -1,177 +0,0 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc (unknown)
|
||||
// source: v1/auth.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// AuthenticateClient is the client API for Authenticate service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type AuthenticateClient interface {
|
||||
PreLogin(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error)
|
||||
Login(ctx context.Context, in *User, opts ...grpc.CallOption) (*LoginReply, error)
|
||||
Logout(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error)
|
||||
}
|
||||
|
||||
type authenticateClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAuthenticateClient(cc grpc.ClientConnInterface) AuthenticateClient {
|
||||
return &authenticateClient{cc}
|
||||
}
|
||||
|
||||
func (c *authenticateClient) PreLogin(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) {
|
||||
out := new(ActionReply)
|
||||
err := c.cc.Invoke(ctx, "/auth.Authenticate/preLogin", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authenticateClient) Login(ctx context.Context, in *User, opts ...grpc.CallOption) (*LoginReply, error) {
|
||||
out := new(LoginReply)
|
||||
err := c.cc.Invoke(ctx, "/auth.Authenticate/login", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authenticateClient) Logout(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) {
|
||||
out := new(ActionReply)
|
||||
err := c.cc.Invoke(ctx, "/auth.Authenticate/logout", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AuthenticateServer is the server API for Authenticate service.
|
||||
// All implementations must embed UnimplementedAuthenticateServer
|
||||
// for forward compatibility
|
||||
type AuthenticateServer interface {
|
||||
PreLogin(context.Context, *User) (*ActionReply, error)
|
||||
Login(context.Context, *User) (*LoginReply, error)
|
||||
Logout(context.Context, *User) (*ActionReply, error)
|
||||
mustEmbedUnimplementedAuthenticateServer()
|
||||
}
|
||||
|
||||
// UnimplementedAuthenticateServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedAuthenticateServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedAuthenticateServer) PreLogin(context.Context, *User) (*ActionReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PreLogin not implemented")
|
||||
}
|
||||
func (UnimplementedAuthenticateServer) Login(context.Context, *User) (*LoginReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
|
||||
}
|
||||
func (UnimplementedAuthenticateServer) Logout(context.Context, *User) (*ActionReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented")
|
||||
}
|
||||
func (UnimplementedAuthenticateServer) mustEmbedUnimplementedAuthenticateServer() {}
|
||||
|
||||
// UnsafeAuthenticateServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AuthenticateServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAuthenticateServer interface {
|
||||
mustEmbedUnimplementedAuthenticateServer()
|
||||
}
|
||||
|
||||
func RegisterAuthenticateServer(s grpc.ServiceRegistrar, srv AuthenticateServer) {
|
||||
s.RegisterService(&Authenticate_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Authenticate_PreLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(User)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthenticateServer).PreLogin(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/auth.Authenticate/preLogin",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthenticateServer).PreLogin(ctx, req.(*User))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Authenticate_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(User)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthenticateServer).Login(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/auth.Authenticate/login",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthenticateServer).Login(ctx, req.(*User))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Authenticate_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(User)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthenticateServer).Logout(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/auth.Authenticate/logout",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthenticateServer).Logout(ctx, req.(*User))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Authenticate_ServiceDesc is the grpc.ServiceDesc for Authenticate service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Authenticate_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "auth.Authenticate",
|
||||
HandlerType: (*AuthenticateServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "preLogin",
|
||||
Handler: _Authenticate_PreLogin_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "login",
|
||||
Handler: _Authenticate_Login_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "logout",
|
||||
Handler: _Authenticate_Logout_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "v1/auth.proto",
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
# eg.1 : sh build-image.sh
|
||||
# eg.2, set image: sh build-image.sh bitbus/paopao-ce
|
||||
|
||||
VERSION=`git describe --tags --always | cut -f1 -f2 -d "-"` # eg.: 0.2.5
|
||||
IMAGE="bitbus/paopao-ce"
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
IMAGE="$1"
|
||||
fi
|
||||
if [ -n "$2" ]; then
|
||||
VERSION="$2"
|
||||
fi
|
||||
|
||||
# build image
|
||||
docker buildx build \
|
||||
--build-arg USE_DIST="yes" \
|
||||
--tag "$IMAGE:${VERSION}" \
|
||||
--tag "$IMAGE:latest" \
|
||||
. -f Dockerfile
|
||||
|
||||
# push to image rep
|
||||
# if [ -n "$1" ]; then
|
||||
# docker push "$IMAGE:${VERSION}"
|
||||
# docker push "$IMAGE:latest"
|
||||
# fi
|
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# eg.1 : sh build-image.sh
|
||||
# eg.2, set tags: sh build-image.sh 'embed go_json'
|
||||
|
||||
TAGS='embed go_json'
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
TAGS="$1"
|
||||
fi
|
||||
|
||||
make release CGO_ENABLED=0 TAGS="$TAGS"
|
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
|
||||
| ----- | ----- | ----- | ----- | ----- | ----- |
|
||||
| 005| 北野 | 2022-11-21 | 2023-01-04 | v1.1 | 提议 |
|
||||
| 22112109 | 北野 | 2022-11-21 | 2023-01-04 | v1.1 | 提议 |
|
||||
|
||||
### 引入go-mir优化后端架构设计
|
||||
引入[github.com/alimy/mir/v3](https://github.com/alimy/mir)优化后端的架构设计,使得后端代码更具扩展型。
|
@ -1,6 +1,6 @@
|
||||
## Draft
|
||||
* [001-关于paopao-ce的设计定位](001-关于paopao-ce的设计定位.md "关于paopao-ce的设计定位")
|
||||
* [002-关于Friendship功能项的设计](002-关于Friendship功能项的设计.md "关于Friendship功能项的设计")
|
||||
* [003-关于Followship功能项的设计](003-关于Followship功能项的设计.md "关于Followship功能项的设计")
|
||||
* [005-引入go-mir优化后端架构设计](005-引入go-mir优化后端架构设计.md "引入go-mir优化后端架构设计")
|
||||
* [006-关于paopao-ce的结构设计](006-关于paopao-ce的结构设计.md "关于paopao-ce的结构设计")
|
||||
* [22110411-关于paopao-ce的设计定位](22110411-关于paopao-ce的设计定位.md "关于paopao-ce的设计定位")
|
||||
* [22110410-关于Friendship功能项的设计](22110410-关于Friendship功能项的设计.md "关于Friendship功能项的设计")
|
||||
* [22110409-关于Followship功能项的设计](22110409-关于Followship功能项的设计.md "关于Followship功能项的设计")
|
||||
* [22112109-引入go-mir优化后端架构设计](22112109-引入go-mir优化后端架构设计.md "引入go-mir优化后端架构设计")
|
||||
* [22112309-关于paopao-ce的结构设计](22112309-关于paopao-ce的结构设计.md "关于paopao-ce的结构设计")
|
||||
|
@ -1,134 +1,143 @@
|
||||
module github.com/rocboss/paopao-ce
|
||||
|
||||
go 1.18
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/Masterminds/semver/v3 v3.1.1
|
||||
github.com/Masterminds/semver/v3 v3.2.1
|
||||
github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868
|
||||
github.com/alimy/cfg v0.3.0
|
||||
github.com/alimy/mir/v3 v3.0.0
|
||||
github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible
|
||||
github.com/allegro/bigcache/v3 v3.0.2
|
||||
github.com/bytedance/sonic v1.5.0
|
||||
github.com/alimy/cfg v0.4.0
|
||||
github.com/alimy/mir/v4 v4.0.0
|
||||
github.com/aliyun/aliyun-oss-go-sdk v2.2.8+incompatible
|
||||
github.com/allegro/bigcache/v3 v3.1.0
|
||||
github.com/bufbuild/connect-go v1.10.0
|
||||
github.com/bytedance/sonic v1.9.2
|
||||
github.com/cockroachdb/errors v1.10.0
|
||||
github.com/disintegration/imaging v1.6.2
|
||||
github.com/ethereum/go-ethereum v1.10.16
|
||||
github.com/fatih/color v1.13.0
|
||||
github.com/fbsobreira/gotron-sdk v0.0.0-20211102183839-58a64f4da5f4
|
||||
github.com/gin-contrib/cors v1.3.1
|
||||
github.com/gin-gonic/gin v1.8.1
|
||||
github.com/go-redis/redis/v8 v8.11.4
|
||||
github.com/fatih/color v1.15.0
|
||||
github.com/getsentry/sentry-go v0.23.0
|
||||
github.com/gin-contrib/cors v1.4.0
|
||||
github.com/gin-gonic/gin v1.9.1
|
||||
github.com/go-resty/resty/v2 v2.7.0
|
||||
github.com/goccy/go-json v0.9.7
|
||||
github.com/gofrs/uuid v4.0.0+incompatible
|
||||
github.com/golang-jwt/jwt/v4 v4.4.2
|
||||
github.com/goccy/go-json v0.10.2
|
||||
github.com/gofrs/uuid/v5 v5.0.0
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0
|
||||
github.com/golang-migrate/migrate/v4 v4.15.2
|
||||
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible
|
||||
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible
|
||||
github.com/json-iterator/go v1.1.12
|
||||
github.com/meilisearch/meilisearch-go v0.21.0
|
||||
github.com/minio/minio-go/v7 v7.0.45
|
||||
github.com/sirupsen/logrus v1.9.0
|
||||
github.com/smartwalle/alipay/v3 v3.1.7
|
||||
github.com/spf13/viper v1.14.0
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.35
|
||||
github.com/meilisearch/meilisearch-go v0.25.0
|
||||
github.com/minio/minio-go/v7 v7.0.61
|
||||
github.com/onsi/ginkgo/v2 v2.11.0
|
||||
github.com/onsi/gomega v1.27.10
|
||||
github.com/pyroscope-io/client v0.7.1
|
||||
github.com/redis/rueidis v1.0.14
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/smartwalle/alipay/v3 v3.2.15
|
||||
github.com/sourcegraph/conc v0.3.0
|
||||
github.com/spf13/viper v1.16.0
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.42
|
||||
github.com/yinheli/mahonia v0.0.0-20131226213531-0eef680515cc
|
||||
google.golang.org/grpc v1.50.1
|
||||
google.golang.org/protobuf v1.28.1
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0
|
||||
go.uber.org/automaxprocs v1.5.3
|
||||
google.golang.org/grpc v1.57.0
|
||||
google.golang.org/protobuf v1.31.0
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1
|
||||
gopkg.in/resty.v1 v1.12.0
|
||||
gorm.io/driver/mysql v1.3.4
|
||||
gorm.io/driver/postgres v1.3.7
|
||||
gorm.io/driver/sqlite v1.3.4
|
||||
gorm.io/gorm v1.23.4
|
||||
gorm.io/plugin/dbresolver v1.1.0
|
||||
gorm.io/plugin/soft_delete v1.1.0
|
||||
modernc.org/sqlite v1.17.3
|
||||
gorm.io/driver/mysql v1.5.1
|
||||
gorm.io/driver/postgres v1.5.2
|
||||
gorm.io/driver/sqlite v1.5.2
|
||||
gorm.io/gorm v1.25.2
|
||||
gorm.io/plugin/dbresolver v1.4.2
|
||||
gorm.io/plugin/soft_delete v1.2.1
|
||||
modernc.org/sqlite v1.25.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/andybalholm/brotli v1.0.4 // indirect
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
|
||||
github.com/btcsuite/btcd v0.22.0-beta // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06 // indirect
|
||||
github.com/andybalholm/brotli v1.0.5 // indirect
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
|
||||
github.com/clbanning/mxj v1.8.4 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
|
||||
github.com/cockroachdb/redact v1.1.5 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
|
||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
||||
github.com/go-playground/locales v0.14.0 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.0 // indirect
|
||||
github.com/go-playground/validator/v10 v10.10.1 // indirect
|
||||
github.com/go-sql-driver/mysql v1.6.0 // indirect
|
||||
github.com/go-logr/logr v1.2.4 // indirect
|
||||
github.com/go-playground/locales v0.14.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/go-playground/validator/v10 v10.14.0 // indirect
|
||||
github.com/go-sql-driver/mysql v1.7.0 // indirect
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/google/go-cmp v0.5.9 // indirect
|
||||
github.com/google/go-querystring v1.1.0 // indirect
|
||||
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
|
||||
github.com/jackc/pgconn v1.12.1 // indirect
|
||||
github.com/jackc/pgio v1.0.0 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgproto3/v2 v2.3.0 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
|
||||
github.com/jackc/pgtype v1.11.0 // indirect
|
||||
github.com/jackc/pgx/v4 v4.16.1 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
|
||||
github.com/jackc/pgx/v5 v5.3.1 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||
github.com/klauspost/compress v1.15.9 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.1.0 // indirect
|
||||
github.com/leodido/go-urn v1.2.1 // indirect
|
||||
github.com/lib/pq v1.10.2 // indirect
|
||||
github.com/magiconair/properties v1.8.6 // indirect
|
||||
github.com/klauspost/compress v1.16.7 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
|
||||
github.com/kr/pretty v0.3.1 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/leodido/go-urn v1.2.4 // indirect
|
||||
github.com/lib/pq v1.10.0 // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.12 // indirect
|
||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.12 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.17 // indirect
|
||||
github.com/minio/md5-simd v1.1.2 // indirect
|
||||
github.com/minio/sha256-simd v1.0.0 // indirect
|
||||
github.com/minio/sha256-simd v1.0.1 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/mozillazg/go-httpheader v0.3.1 // indirect
|
||||
github.com/pelletier/go-toml v1.9.5 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
|
||||
github.com/mozillazg/go-httpheader v0.2.1 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
|
||||
github.com/rs/xid v1.4.0 // indirect
|
||||
github.com/smartwalle/crypto4go v1.0.2 // indirect
|
||||
github.com/spf13/afero v1.9.2 // indirect
|
||||
github.com/spf13/cast v1.5.0 // indirect
|
||||
github.com/pyroscope-io/godeltaprof v0.1.0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/rogpeppe/go-internal v1.9.0 // indirect
|
||||
github.com/rs/xid v1.5.0 // indirect
|
||||
github.com/smartwalle/ncrypto v1.0.2 // indirect
|
||||
github.com/smartwalle/ngx v1.0.6 // indirect
|
||||
github.com/smartwalle/nsign v1.0.8 // indirect
|
||||
github.com/spf13/afero v1.9.5 // indirect
|
||||
github.com/spf13/cast v1.5.1 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/subosito/gotenv v1.4.1 // indirect
|
||||
github.com/subosito/gotenv v1.4.2 // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/ugorji/go/codec v1.2.7 // indirect
|
||||
github.com/ugorji/go/codec v1.2.11 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasthttp v1.37.1-0.20220607072126-8a320890c08d // indirect
|
||||
github.com/valyala/fasthttp v1.40.0 // indirect
|
||||
go.uber.org/atomic v1.9.0 // indirect
|
||||
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
|
||||
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
|
||||
golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 // indirect
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
|
||||
golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956 // indirect
|
||||
golang.org/x/text v0.4.0 // indirect
|
||||
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
|
||||
golang.org/x/tools v0.1.12 // indirect
|
||||
google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e // indirect
|
||||
golang.org/x/arch v0.3.0 // indirect
|
||||
golang.org/x/crypto v0.11.0 // indirect
|
||||
golang.org/x/image v0.0.0-20210216034530-4410531fe030 // indirect
|
||||
golang.org/x/mod v0.10.0 // indirect
|
||||
golang.org/x/net v0.12.0 // indirect
|
||||
golang.org/x/sys v0.10.0 // indirect
|
||||
golang.org/x/text v0.11.0 // indirect
|
||||
golang.org/x/time v0.3.0 // indirect
|
||||
golang.org/x/tools v0.9.3 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
lukechampine.com/uint128 v1.1.1 // indirect
|
||||
modernc.org/cc/v3 v3.36.0 // indirect
|
||||
modernc.org/ccgo/v3 v3.16.6 // indirect
|
||||
modernc.org/libc v1.16.7 // indirect
|
||||
modernc.org/mathutil v1.4.1 // indirect
|
||||
modernc.org/memory v1.1.1 // indirect
|
||||
modernc.org/opt v0.1.1 // indirect
|
||||
modernc.org/strutil v1.1.1 // indirect
|
||||
modernc.org/token v1.0.0 // indirect
|
||||
lukechampine.com/uint128 v1.2.0 // indirect
|
||||
modernc.org/cc/v3 v3.40.0 // indirect
|
||||
modernc.org/ccgo/v3 v3.16.13 // indirect
|
||||
modernc.org/libc v1.24.1 // indirect
|
||||
modernc.org/mathutil v1.5.0 // indirect
|
||||
modernc.org/memory v1.6.0 // indirect
|
||||
modernc.org/opt v0.1.3 // indirect
|
||||
modernc.org/strutil v1.1.3 // indirect
|
||||
modernc.org/token v1.0.1 // indirect
|
||||
)
|
||||
|
@ -0,0 +1,38 @@
|
||||
package conf
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/smartwalle/alipay/v3"
|
||||
)
|
||||
|
||||
var (
|
||||
_alipayClient *alipay.Client
|
||||
_onceAlipay sync.Once
|
||||
)
|
||||
|
||||
func MustAlipayClient() *alipay.Client {
|
||||
_onceAlipay.Do(func() {
|
||||
s := AlipaySetting
|
||||
// 将 key 的验证调整到初始化阶段
|
||||
client, err := alipay.New(s.AppID, s.PrivateKey, s.InProduction)
|
||||
if err != nil {
|
||||
logrus.Fatalf("alipay.New err: %s", err)
|
||||
}
|
||||
// 加载应用公钥证书
|
||||
if err = client.LoadAppPublicCertFromFile(s.AppPublicCertFile); err != nil {
|
||||
logrus.Fatalf("client.LoadAppPublicCertFromFile err: %s\n", err)
|
||||
}
|
||||
// 加载支付宝根证书
|
||||
if err = client.LoadAliPayRootCertFromFile(s.RootCertFile); err != nil {
|
||||
logrus.Fatalf("client.LoadAliPayRootCertFromFile err: %s\n", err)
|
||||
}
|
||||
// 加载支付宝公钥证书
|
||||
if err = client.LoadAliPayPublicCertFromFile(s.PublicCertFile); err != nil {
|
||||
logrus.Fatalf("client.LoadAliPayPublicCertFromFile err: %s\n", err)
|
||||
}
|
||||
_alipayClient = client
|
||||
})
|
||||
return _alipayClient
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
// 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 conf
|
||||
|
||||
import (
|
||||
"log"
|
||||
"sync"
|
||||
|
||||
"github.com/redis/rueidis"
|
||||
)
|
||||
|
||||
var (
|
||||
_redisClient rueidis.Client
|
||||
_onceRedis sync.Once
|
||||
)
|
||||
|
||||
func MustRedisClient() rueidis.Client {
|
||||
_onceRedis.Do(func() {
|
||||
client, err := rueidis.NewClient(rueidis.ClientOption{
|
||||
InitAddress: redisSetting.InitAddress,
|
||||
Username: redisSetting.Username,
|
||||
Password: redisSetting.Password,
|
||||
SelectDB: redisSetting.SelectDB,
|
||||
ConnWriteTimeout: redisSetting.ConnWriteTimeout,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("create a redis client failed: %s", err)
|
||||
}
|
||||
_redisClient = client
|
||||
})
|
||||
return _redisClient
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
// 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 conf
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/alimy/cfg"
|
||||
"github.com/getsentry/sentry-go"
|
||||
"github.com/rocboss/paopao-ce/pkg/version"
|
||||
)
|
||||
|
||||
func initSentry() {
|
||||
cfg.Be("Sentry", func() {
|
||||
opts := sentry.ClientOptions{
|
||||
Dsn: sentrySetting.Dsn,
|
||||
Debug: sentrySetting.Debug,
|
||||
AttachStacktrace: sentrySetting.AttachStacktrace,
|
||||
TracesSampleRate: sentrySetting.TracesSampleRate,
|
||||
}
|
||||
_ = sentry.Init(opts)
|
||||
if sentrySetting.AttachLogrus {
|
||||
setupSentryLogrus(opts)
|
||||
}
|
||||
sentry.WithScope(func(scope *sentry.Scope) {
|
||||
scope.SetExtras(map[string]any{
|
||||
"version": version.VersionInfo(),
|
||||
"time": time.Now().Local(),
|
||||
})
|
||||
sentry.CaptureMessage("paopao-ce sentry works!")
|
||||
})
|
||||
})
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
// 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 cs
|
||||
|
||||
type CommentThumbs struct {
|
||||
UserID int64 `json:"user_id"`
|
||||
TweetID int64 `json:"tweet_id"`
|
||||
CommentID int64 `json:"comment_id"`
|
||||
ReplyID int64 `json:"reply_id"`
|
||||
CommentType int8 `json:"comment_type"`
|
||||
IsThumbsUp int8 `json:"is_thumbs_up"`
|
||||
IsThumbsDown int8 `json:"is_thumbs_down"`
|
||||
}
|
||||
|
||||
type CommentThumbsList []*CommentThumbs
|
||||
|
||||
type CommentThumbsMap map[int64]*CommentThumbs
|
@ -0,0 +1,26 @@
|
||||
// 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 cs
|
||||
|
||||
const (
|
||||
ContactStatusRequesting int8 = iota + 1
|
||||
ContactStatusAgree
|
||||
ContactStatusReject
|
||||
ContactStatusDeleted
|
||||
)
|
||||
|
||||
type Contact struct {
|
||||
ID int64 `db:"id" json:"id"`
|
||||
UserId int64 `db:"user_id" json:"user_id"`
|
||||
FriendId int64 `db:"friend_id" json:"friend_id"`
|
||||
GroupId int64 `json:"group_id"`
|
||||
Remark string `json:"remark"`
|
||||
Status int8 `json:"status"` // 1请求好友, 2已同意好友, 3已拒绝好友, 4已删除好友
|
||||
IsTop int8 `json:"is_top"`
|
||||
IsBlack int8 `json:"is_black"`
|
||||
NoticeEnable int8 `json:"notice_enable"`
|
||||
IsDel int8 `json:"-"`
|
||||
DeletedOn int64 `db:"-" json:"-"`
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
// 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 cs contain core data service interface type
|
||||
// model define
|
||||
|
||||
package cs
|
@ -0,0 +1,13 @@
|
||||
// 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 cs
|
||||
|
||||
import "errors"
|
||||
|
||||
// internal core error variable for data logic implement.
|
||||
var (
|
||||
ErrNotImplemented = errors.New("not implemented")
|
||||
ErrNoPermission = errors.New("no permission")
|
||||
)
|
@ -0,0 +1,38 @@
|
||||
// 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 cs
|
||||
|
||||
const (
|
||||
// 搜索查询类型
|
||||
TsQueryTypeDefault TsQueryType = "search"
|
||||
TsQueryTypeTag TsQueryType = "tag"
|
||||
)
|
||||
|
||||
type (
|
||||
// TsQueryType 搜索查询类型
|
||||
TsQueryType string
|
||||
|
||||
// TsDocList 索引条陈列表
|
||||
TsDocList []TsDocItem
|
||||
)
|
||||
|
||||
// TsQueryReq 搜索查询请求
|
||||
type TsQueryReq struct {
|
||||
Query string
|
||||
Visibility []TweetVisibleType
|
||||
Type TsQueryType
|
||||
}
|
||||
|
||||
// TsQueryResp 搜索查询响应
|
||||
type TsQueryResp struct {
|
||||
Items TweetList
|
||||
Total int64
|
||||
}
|
||||
|
||||
// TsDocItem 索引条陈
|
||||
type TsDocItem struct {
|
||||
Post *TweetInfo
|
||||
Content string
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
// 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 cs
|
||||
|
||||
// TweetBox 推文列表盒子,包含其他一些关于推文列表的信息
|
||||
type TweetBox struct {
|
||||
Tweets TweetList
|
||||
Total int64
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
// 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 cs
|
||||
|
||||
const (
|
||||
// 标签类型
|
||||
TagTypeHot TagType = "hot"
|
||||
TagTypeNew TagType = "new"
|
||||
TagTypeFollow TagType = "follow"
|
||||
TagTypeHotExtral TagType = "hot_extral"
|
||||
)
|
||||
|
||||
type (
|
||||
// TagType 标签类型
|
||||
TagType string
|
||||
|
||||
// TagInfoList 标签信息列表
|
||||
TagInfoList []*TagInfo
|
||||
|
||||
// TagList 标签列表
|
||||
TagList []*TagItem
|
||||
)
|
||||
|
||||
// TagInfo 标签信息
|
||||
type TagInfo struct {
|
||||
ID int64 `json:"id" db:"id"`
|
||||
UserID int64 `json:"user_id" db:"user_id"`
|
||||
Tag string `json:"tag"`
|
||||
QuoteNum int64 `json:"quote_num" db:"quote_num"`
|
||||
}
|
||||
|
||||
// TagItem 标签信息条陈
|
||||
type TagItem struct {
|
||||
ID int64 `json:"id"`
|
||||
UserID int64 `json:"user_id"`
|
||||
User *UserInfo `json:"user" db:"u"`
|
||||
Tag string `json:"tag"`
|
||||
QuoteNum int64 `json:"quote_num"`
|
||||
IsFollowing int8 `json:"is_following"`
|
||||
IsTop int8 `json:"is_top"`
|
||||
}
|
||||
|
||||
func (t *TagInfo) Format() *TagItem {
|
||||
return &TagItem{
|
||||
ID: t.ID,
|
||||
UserID: t.UserID,
|
||||
User: &UserInfo{},
|
||||
Tag: t.Tag,
|
||||
QuoteNum: t.QuoteNum,
|
||||
IsFollowing: 0,
|
||||
IsTop: 0,
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
// 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 cs
|
||||
|
||||
type AttachmentBill struct {
|
||||
ID int64 `json:"id"`
|
||||
PostID int64 `json:"post_id"`
|
||||
UserID int64 `json:"user_id"`
|
||||
PaidAmount int64 `json:"paid_amount"`
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
// 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 cs
|
||||
|
||||
const (
|
||||
RelationUnknow RelationTyp = iota
|
||||
RelationSelf
|
||||
RelationFriend
|
||||
RelationFollower
|
||||
RelationFollowing
|
||||
RelationAdmin
|
||||
RelationGuest
|
||||
)
|
||||
|
||||
type (
|
||||
// UserInfoList 用户信息列表
|
||||
UserInfoList []*UserInfo
|
||||
|
||||
//
|
||||
RelationTyp uint8
|
||||
|
||||
VistUser struct {
|
||||
Username string
|
||||
UserId int64
|
||||
RelTyp RelationTyp
|
||||
}
|
||||
)
|
||||
|
||||
// UserInfo 用户基本信息
|
||||
type UserInfo struct {
|
||||
ID int64 `json:"id"`
|
||||
Nickname string `json:"nickname"`
|
||||
Username string `json:"username"`
|
||||
Status int `json:"status"`
|
||||
Avatar string `json:"avatar"`
|
||||
IsAdmin bool `json:"is_admin"`
|
||||
}
|
||||
|
||||
func (t RelationTyp) String() string {
|
||||
switch t {
|
||||
case RelationSelf:
|
||||
return "self"
|
||||
case RelationFriend:
|
||||
return "friend"
|
||||
case RelationFollower:
|
||||
return "follower"
|
||||
case RelationFollowing:
|
||||
return "following"
|
||||
case RelationAdmin:
|
||||
return "admin"
|
||||
case RelationUnknow:
|
||||
fallthrough
|
||||
default:
|
||||
return "unknow relation"
|
||||
}
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
// 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 ms
|
||||
|
||||
import (
|
||||
"github.com/rocboss/paopao-ce/pkg/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ActRegisterUser act = iota
|
||||
ActCreatePublicTweet
|
||||
ActCreatePublicAttachment
|
||||
ActCreatePublicPicture
|
||||
ActCreatePublicVideo
|
||||
ActCreatePrivateTweet
|
||||
ActCreatePrivateAttachment
|
||||
ActCreatePrivatePicture
|
||||
ActCreatePrivateVideo
|
||||
ActCreateFriendTweet
|
||||
ActCreateFriendAttachment
|
||||
ActCreateFriendPicture
|
||||
ActCreateFriendVideo
|
||||
ActCreatePublicComment
|
||||
ActCreatePublicPicureComment
|
||||
ActCreateFriendComment
|
||||
ActCreateFriendPicureComment
|
||||
ActCreatePrivateComment
|
||||
ActCreatePrivatePicureComment
|
||||
ActStickTweet
|
||||
ActTopTweet
|
||||
ActLockTweet
|
||||
ActVisibleTweet
|
||||
ActDeleteTweet
|
||||
ActCreateActivationCode
|
||||
)
|
||||
|
||||
type (
|
||||
act uint8
|
||||
|
||||
FriendFilter map[int64]types.Empty
|
||||
FriendSet map[string]types.Empty
|
||||
|
||||
Action struct {
|
||||
Act act
|
||||
UserId int64
|
||||
}
|
||||
)
|
||||
|
||||
func (f FriendFilter) IsFriend(userId int64) bool {
|
||||
_, yeah := f[userId]
|
||||
return yeah
|
||||
}
|
||||
|
||||
// IsAllow default true if user is admin
|
||||
func (a act) IsAllow(user *User, userId int64, isFriend bool, isActivation bool) bool {
|
||||
if user.IsAdmin {
|
||||
return true
|
||||
}
|
||||
if user.ID == userId && isActivation {
|
||||
switch a {
|
||||
case ActCreatePublicTweet,
|
||||
ActCreatePublicAttachment,
|
||||
ActCreatePublicPicture,
|
||||
ActCreatePublicVideo,
|
||||
ActCreatePrivateTweet,
|
||||
ActCreatePrivateAttachment,
|
||||
ActCreatePrivatePicture,
|
||||
ActCreatePrivateVideo,
|
||||
ActCreateFriendTweet,
|
||||
ActCreateFriendAttachment,
|
||||
ActCreateFriendPicture,
|
||||
ActCreateFriendVideo,
|
||||
ActCreatePrivateComment,
|
||||
ActCreatePrivatePicureComment,
|
||||
ActStickTweet,
|
||||
ActLockTweet,
|
||||
ActVisibleTweet,
|
||||
ActDeleteTweet:
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
if user.ID == userId && !isActivation {
|
||||
switch a {
|
||||
case ActCreatePrivateTweet,
|
||||
ActCreatePrivateComment,
|
||||
ActStickTweet,
|
||||
ActLockTweet,
|
||||
ActDeleteTweet:
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
if isFriend && isActivation {
|
||||
switch a {
|
||||
case ActCreatePublicComment,
|
||||
ActCreatePublicPicureComment,
|
||||
ActCreateFriendComment,
|
||||
ActCreateFriendPicureComment:
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
if !isFriend && isActivation {
|
||||
switch a {
|
||||
case ActCreatePublicComment,
|
||||
ActCreatePublicPicureComment:
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
// 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 ms
|
||||
|
||||
import (
|
||||
"github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
|
||||
)
|
||||
|
||||
type (
|
||||
Comment = dbr.Comment
|
||||
CommentFormated = dbr.CommentFormated
|
||||
CommentReply = dbr.CommentReply
|
||||
CommentContent = dbr.CommentContent
|
||||
CommentReplyFormated = dbr.CommentReplyFormated
|
||||
)
|
@ -0,0 +1,26 @@
|
||||
// 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 ms
|
||||
|
||||
import (
|
||||
"github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
|
||||
)
|
||||
|
||||
const (
|
||||
MsgTypePost = dbr.MsgTypePost
|
||||
MsgtypeComment = dbr.MsgtypeComment
|
||||
MsgTypeReply = dbr.MsgTypeReply
|
||||
MsgTypeWhisper = dbr.MsgTypeWhisper
|
||||
MsgTypeRequestingFriend = dbr.MsgTypeRequestingFriend
|
||||
MsgTypeSystem = dbr.MsgTypeSystem
|
||||
|
||||
MsgStatusUnread = dbr.MsgStatusUnread
|
||||
MsgStatusReaded = dbr.MsgStatusReaded
|
||||
)
|
||||
|
||||
type (
|
||||
Message = dbr.Message
|
||||
MessageFormated = dbr.MessageFormated
|
||||
)
|
@ -1,8 +1,10 @@
|
||||
// Copyright 2022 ROC. All rights reserved.
|
||||
// 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 core
|
||||
// Package ms contain core data service interface type
|
||||
// model define for gorm adapter
|
||||
package ms
|
||||
|
||||
import (
|
||||
"github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
|
@ -0,0 +1,13 @@
|
||||
// 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 ms
|
||||
|
||||
import (
|
||||
"github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
|
||||
)
|
||||
|
||||
type (
|
||||
Captcha = dbr.Captcha
|
||||
)
|
@ -0,0 +1,10 @@
|
||||
// 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 ms
|
||||
|
||||
type IndexTweetList struct {
|
||||
Tweets []*PostFormated
|
||||
Total int64
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// 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 ms
|
||||
|
||||
type (
|
||||
ContactItem struct {
|
||||
UserId int64 `json:"user_id"`
|
||||
UserName string `db:"username" json:"username"`
|
||||
Nickname string `json:"nickname"`
|
||||
Avatar string `json:"avatar"`
|
||||
Phone string `json:"phone"`
|
||||
}
|
||||
|
||||
ContactList struct {
|
||||
Contacts []ContactItem `json:"contacts"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
)
|
@ -0,0 +1,14 @@
|
||||
// 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 ms
|
||||
|
||||
import (
|
||||
"github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
|
||||
)
|
||||
|
||||
type (
|
||||
WalletStatement = dbr.WalletStatement
|
||||
WalletRecharge = dbr.WalletRecharge
|
||||
)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue