Merge branch 'develop' of git.ailuowan.com:zzw/lone-services into develop
CI / changes (push) Successful in 37s
CI / ad (push) Successful in 26s
CI / admin (push) Successful in 16s
CI / bff (push) Successful in 14s
CI / chore (push) Successful in 14s
CI / equipment (push) Successful in 14s
CI / express (push) Successful in 13s
CI / product (push) Successful in 20s
CI / record (push) Successful in 15s
CI / sale (push) Successful in 20s
CI / task (push) Successful in 14s
CI / user (push) Successful in 22s
CI / wecom (push) Successful in 16s
CI / changes (push) Successful in 37s
CI / ad (push) Successful in 26s
CI / admin (push) Successful in 16s
CI / bff (push) Successful in 14s
CI / chore (push) Successful in 14s
CI / equipment (push) Successful in 14s
CI / express (push) Successful in 13s
CI / product (push) Successful in 20s
CI / record (push) Successful in 15s
CI / sale (push) Successful in 20s
CI / task (push) Successful in 14s
CI / user (push) Successful in 22s
CI / wecom (push) Successful in 16s
This commit is contained in:
@@ -44,5 +44,5 @@ jobs:
|
||||
docker pull ${{ vars.REGISTRY }}/lone/express:latest
|
||||
docker pull ${{ vars.REGISTRY }}/lone/sale:latest
|
||||
docker pull ${{ vars.REGISTRY }}/lone/equipment:latest
|
||||
docker pull ${{ vars.REGISTRY }}/lone/lonelog:latest
|
||||
docker pull ${{ vars.REGISTRY }}/lone/record:latest
|
||||
docker compose up -d
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
- name: Detect changes
|
||||
id: filter
|
||||
run: |
|
||||
SERVICES="bff product admin user ad chore express sale wecom task equipment log"
|
||||
SERVICES="bff product admin user ad chore express sale wecom task equipment record"
|
||||
|
||||
pattern_for() {
|
||||
case "$1" in
|
||||
@@ -92,7 +92,7 @@ jobs:
|
||||
- wecom
|
||||
- task
|
||||
- equipment
|
||||
- lonelog
|
||||
- record
|
||||
env:
|
||||
BUILD_LIST: ${{ needs.changes.outputs.build_list }}
|
||||
NAME: lone/${{ matrix.name }}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v4.25.8
|
||||
// source: lonelog/lonelog.proto
|
||||
// source: record/record.proto
|
||||
|
||||
package lonelog
|
||||
package record
|
||||
|
||||
import (
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
@@ -29,7 +29,6 @@ type ItemsRequest struct {
|
||||
Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"`
|
||||
Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"`
|
||||
AdminId int64 `protobuf:"varint,5,opt,name=admin_id,json=adminId,proto3" json:"admin_id,omitempty"`
|
||||
ServiceId int64 `protobuf:"varint,6,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
|
||||
Time []string `protobuf:"bytes,7,rep,name=time,proto3" json:"time,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -37,7 +36,7 @@ type ItemsRequest struct {
|
||||
|
||||
func (x *ItemsRequest) Reset() {
|
||||
*x = ItemsRequest{}
|
||||
mi := &file_lonelog_lonelog_proto_msgTypes[0]
|
||||
mi := &file_record_record_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -49,7 +48,7 @@ func (x *ItemsRequest) String() string {
|
||||
func (*ItemsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ItemsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_lonelog_lonelog_proto_msgTypes[0]
|
||||
mi := &file_record_record_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -62,7 +61,7 @@ func (x *ItemsRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ItemsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ItemsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_lonelog_lonelog_proto_rawDescGZIP(), []int{0}
|
||||
return file_record_record_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ItemsRequest) GetPage() int32 {
|
||||
@@ -100,13 +99,6 @@ func (x *ItemsRequest) GetAdminId() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ItemsRequest) GetServiceId() int64 {
|
||||
if x != nil {
|
||||
return x.ServiceId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ItemsRequest) GetTime() []string {
|
||||
if x != nil {
|
||||
return x.Time
|
||||
@@ -125,7 +117,7 @@ type Response struct {
|
||||
|
||||
func (x *Response) Reset() {
|
||||
*x = Response{}
|
||||
mi := &file_lonelog_lonelog_proto_msgTypes[1]
|
||||
mi := &file_record_record_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -137,7 +129,7 @@ func (x *Response) String() string {
|
||||
func (*Response) ProtoMessage() {}
|
||||
|
||||
func (x *Response) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_lonelog_lonelog_proto_msgTypes[1]
|
||||
mi := &file_record_record_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -150,7 +142,7 @@ func (x *Response) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use Response.ProtoReflect.Descriptor instead.
|
||||
func (*Response) Descriptor() ([]byte, []int) {
|
||||
return file_lonelog_lonelog_proto_rawDescGZIP(), []int{1}
|
||||
return file_record_record_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Response) GetCode() int32 {
|
||||
@@ -193,7 +185,7 @@ type ActionLog struct {
|
||||
|
||||
func (x *ActionLog) Reset() {
|
||||
*x = ActionLog{}
|
||||
mi := &file_lonelog_lonelog_proto_msgTypes[2]
|
||||
mi := &file_record_record_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -205,7 +197,7 @@ func (x *ActionLog) String() string {
|
||||
func (*ActionLog) ProtoMessage() {}
|
||||
|
||||
func (x *ActionLog) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_lonelog_lonelog_proto_msgTypes[2]
|
||||
mi := &file_record_record_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -218,7 +210,7 @@ func (x *ActionLog) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ActionLog.ProtoReflect.Descriptor instead.
|
||||
func (*ActionLog) Descriptor() ([]byte, []int) {
|
||||
return file_lonelog_lonelog_proto_rawDescGZIP(), []int{2}
|
||||
return file_record_record_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ActionLog) GetContent() string {
|
||||
@@ -315,7 +307,7 @@ type LoginLog struct {
|
||||
|
||||
func (x *LoginLog) Reset() {
|
||||
*x = LoginLog{}
|
||||
mi := &file_lonelog_lonelog_proto_msgTypes[3]
|
||||
mi := &file_record_record_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -327,7 +319,7 @@ func (x *LoginLog) String() string {
|
||||
func (*LoginLog) ProtoMessage() {}
|
||||
|
||||
func (x *LoginLog) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_lonelog_lonelog_proto_msgTypes[3]
|
||||
mi := &file_record_record_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -340,7 +332,7 @@ func (x *LoginLog) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use LoginLog.ProtoReflect.Descriptor instead.
|
||||
func (*LoginLog) Descriptor() ([]byte, []int) {
|
||||
return file_lonelog_lonelog_proto_rawDescGZIP(), []int{3}
|
||||
return file_record_record_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *LoginLog) GetAdminId() int64 {
|
||||
@@ -419,7 +411,7 @@ type ItemsLoginRequest struct {
|
||||
|
||||
func (x *ItemsLoginRequest) Reset() {
|
||||
*x = ItemsLoginRequest{}
|
||||
mi := &file_lonelog_lonelog_proto_msgTypes[4]
|
||||
mi := &file_record_record_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -431,7 +423,7 @@ func (x *ItemsLoginRequest) String() string {
|
||||
func (*ItemsLoginRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ItemsLoginRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_lonelog_lonelog_proto_msgTypes[4]
|
||||
mi := &file_record_record_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -444,7 +436,7 @@ func (x *ItemsLoginRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ItemsLoginRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ItemsLoginRequest) Descriptor() ([]byte, []int) {
|
||||
return file_lonelog_lonelog_proto_rawDescGZIP(), []int{4}
|
||||
return file_record_record_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ItemsLoginRequest) GetPage() int32 {
|
||||
@@ -482,19 +474,17 @@ func (x *ItemsLoginRequest) GetTime() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_lonelog_lonelog_proto protoreflect.FileDescriptor
|
||||
var File_record_record_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_lonelog_lonelog_proto_rawDesc = "" +
|
||||
const file_record_record_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x15lonelog/lonelog.proto\x12\alonelog\x1a\x1cgoogle/api/annotations.proto\"\xa8\x01\n" +
|
||||
"\x13record/record.proto\x12\x06record\x1a\x1cgoogle/api/annotations.proto\"\x89\x01\n" +
|
||||
"\fItemsRequest\x12\x12\n" +
|
||||
"\x04page\x18\x01 \x01(\x05R\x04page\x12\x12\n" +
|
||||
"\x04size\x18\x02 \x01(\x05R\x04size\x12\x12\n" +
|
||||
"\x04type\x18\x03 \x01(\x05R\x04type\x12\x0e\n" +
|
||||
"\x02ip\x18\x04 \x01(\tR\x02ip\x12\x19\n" +
|
||||
"\badmin_id\x18\x05 \x01(\x03R\aadminId\x12\x1d\n" +
|
||||
"\n" +
|
||||
"service_id\x18\x06 \x01(\x03R\tserviceId\x12\x12\n" +
|
||||
"\badmin_id\x18\x05 \x01(\x03R\aadminId\x12\x12\n" +
|
||||
"\x04time\x18\a \x03(\tR\x04time\"D\n" +
|
||||
"\bResponse\x12\x12\n" +
|
||||
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x10\n" +
|
||||
@@ -532,43 +522,43 @@ const file_lonelog_lonelog_proto_rawDesc = "" +
|
||||
"\x04size\x18\x02 \x01(\x05R\x04size\x12\x0e\n" +
|
||||
"\x02ip\x18\x03 \x01(\tR\x02ip\x12\x19\n" +
|
||||
"\badmin_id\x18\x04 \x01(\x03R\aadminId\x12\x12\n" +
|
||||
"\x04time\x18\x05 \x03(\tR\x04time2\x9b\x02\n" +
|
||||
"\aLonelog\x12R\n" +
|
||||
"\x05Items\x12\x15.lonelog.ItemsRequest\x1a\x11.lonelog.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\x12\x14/admin/v3/log/action\x12V\n" +
|
||||
"\x04time\x18\x05 \x03(\tR\x04time2\x92\x02\n" +
|
||||
"\x06Record\x12P\n" +
|
||||
"\x05Items\x12\x14.record.ItemsRequest\x1a\x10.record.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\x12\x14/admin/v3/log/action\x12T\n" +
|
||||
"\n" +
|
||||
"LoginItems\x12\x15.lonelog.ItemsRequest\x1a\x11.lonelog.Response\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\x12\x13/admin/v3/log/login\x122\n" +
|
||||
"\tActionAdd\x12\x12.lonelog.ActionLog\x1a\x11.lonelog.Response\x120\n" +
|
||||
"\bLoginAdd\x12\x11.lonelog.LoginLog\x1a\x11.lonelog.ResponseB\x1bZ\x19lone-services/rpc/lonelogb\x06proto3"
|
||||
"LoginItems\x12\x14.record.ItemsRequest\x1a\x10.record.Response\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\x12\x13/admin/v3/log/login\x120\n" +
|
||||
"\tActionAdd\x12\x11.record.ActionLog\x1a\x10.record.Response\x12.\n" +
|
||||
"\bLoginAdd\x12\x10.record.LoginLog\x1a\x10.record.ResponseB\x1aZ\x18lone-services/rpc/recordb\x06proto3"
|
||||
|
||||
var (
|
||||
file_lonelog_lonelog_proto_rawDescOnce sync.Once
|
||||
file_lonelog_lonelog_proto_rawDescData []byte
|
||||
file_record_record_proto_rawDescOnce sync.Once
|
||||
file_record_record_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_lonelog_lonelog_proto_rawDescGZIP() []byte {
|
||||
file_lonelog_lonelog_proto_rawDescOnce.Do(func() {
|
||||
file_lonelog_lonelog_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_lonelog_lonelog_proto_rawDesc), len(file_lonelog_lonelog_proto_rawDesc)))
|
||||
func file_record_record_proto_rawDescGZIP() []byte {
|
||||
file_record_record_proto_rawDescOnce.Do(func() {
|
||||
file_record_record_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_record_record_proto_rawDesc), len(file_record_record_proto_rawDesc)))
|
||||
})
|
||||
return file_lonelog_lonelog_proto_rawDescData
|
||||
return file_record_record_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_lonelog_lonelog_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_lonelog_lonelog_proto_goTypes = []any{
|
||||
(*ItemsRequest)(nil), // 0: lonelog.ItemsRequest
|
||||
(*Response)(nil), // 1: lonelog.Response
|
||||
(*ActionLog)(nil), // 2: lonelog.ActionLog
|
||||
(*LoginLog)(nil), // 3: lonelog.LoginLog
|
||||
(*ItemsLoginRequest)(nil), // 4: lonelog.ItemsLoginRequest
|
||||
var file_record_record_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_record_record_proto_goTypes = []any{
|
||||
(*ItemsRequest)(nil), // 0: record.ItemsRequest
|
||||
(*Response)(nil), // 1: record.Response
|
||||
(*ActionLog)(nil), // 2: record.ActionLog
|
||||
(*LoginLog)(nil), // 3: record.LoginLog
|
||||
(*ItemsLoginRequest)(nil), // 4: record.ItemsLoginRequest
|
||||
}
|
||||
var file_lonelog_lonelog_proto_depIdxs = []int32{
|
||||
0, // 0: lonelog.Lonelog.Items:input_type -> lonelog.ItemsRequest
|
||||
0, // 1: lonelog.Lonelog.LoginItems:input_type -> lonelog.ItemsRequest
|
||||
2, // 2: lonelog.Lonelog.ActionAdd:input_type -> lonelog.ActionLog
|
||||
3, // 3: lonelog.Lonelog.LoginAdd:input_type -> lonelog.LoginLog
|
||||
1, // 4: lonelog.Lonelog.Items:output_type -> lonelog.Response
|
||||
1, // 5: lonelog.Lonelog.LoginItems:output_type -> lonelog.Response
|
||||
1, // 6: lonelog.Lonelog.ActionAdd:output_type -> lonelog.Response
|
||||
1, // 7: lonelog.Lonelog.LoginAdd:output_type -> lonelog.Response
|
||||
var file_record_record_proto_depIdxs = []int32{
|
||||
0, // 0: record.Record.Items:input_type -> record.ItemsRequest
|
||||
0, // 1: record.Record.LoginItems:input_type -> record.ItemsRequest
|
||||
2, // 2: record.Record.ActionAdd:input_type -> record.ActionLog
|
||||
3, // 3: record.Record.LoginAdd:input_type -> record.LoginLog
|
||||
1, // 4: record.Record.Items:output_type -> record.Response
|
||||
1, // 5: record.Record.LoginItems:output_type -> record.Response
|
||||
1, // 6: record.Record.ActionAdd:output_type -> record.Response
|
||||
1, // 7: record.Record.LoginAdd:output_type -> record.Response
|
||||
4, // [4:8] is the sub-list for method output_type
|
||||
0, // [0:4] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
@@ -576,26 +566,26 @@ var file_lonelog_lonelog_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_lonelog_lonelog_proto_init() }
|
||||
func file_lonelog_lonelog_proto_init() {
|
||||
if File_lonelog_lonelog_proto != nil {
|
||||
func init() { file_record_record_proto_init() }
|
||||
func file_record_record_proto_init() {
|
||||
if File_record_record_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_lonelog_lonelog_proto_rawDesc), len(file_lonelog_lonelog_proto_rawDesc)),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_record_record_proto_rawDesc), len(file_record_record_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_lonelog_lonelog_proto_goTypes,
|
||||
DependencyIndexes: file_lonelog_lonelog_proto_depIdxs,
|
||||
MessageInfos: file_lonelog_lonelog_proto_msgTypes,
|
||||
GoTypes: file_record_record_proto_goTypes,
|
||||
DependencyIndexes: file_record_record_proto_depIdxs,
|
||||
MessageInfos: file_record_record_proto_msgTypes,
|
||||
}.Build()
|
||||
File_lonelog_lonelog_proto = out.File
|
||||
file_lonelog_lonelog_proto_goTypes = nil
|
||||
file_lonelog_lonelog_proto_depIdxs = nil
|
||||
File_record_record_proto = out.File
|
||||
file_record_record_proto_goTypes = nil
|
||||
file_record_record_proto_depIdxs = nil
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v4.25.8
|
||||
// source: lonelog/lonelog.proto
|
||||
// source: record/record.proto
|
||||
|
||||
package lonelog
|
||||
package record
|
||||
|
||||
import (
|
||||
context "context"
|
||||
@@ -19,217 +19,217 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Lonelog_Items_FullMethodName = "/lonelog.Lonelog/Items"
|
||||
Lonelog_LoginItems_FullMethodName = "/lonelog.Lonelog/LoginItems"
|
||||
Lonelog_ActionAdd_FullMethodName = "/lonelog.Lonelog/ActionAdd"
|
||||
Lonelog_LoginAdd_FullMethodName = "/lonelog.Lonelog/LoginAdd"
|
||||
Record_Items_FullMethodName = "/record.Record/Items"
|
||||
Record_LoginItems_FullMethodName = "/record.Record/LoginItems"
|
||||
Record_ActionAdd_FullMethodName = "/record.Record/ActionAdd"
|
||||
Record_LoginAdd_FullMethodName = "/record.Record/LoginAdd"
|
||||
)
|
||||
|
||||
// LonelogClient is the client API for Lonelog service.
|
||||
// RecordClient is the client API for Record 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 LonelogClient interface {
|
||||
type RecordClient interface {
|
||||
Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
LoginItems(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
ActionAdd(ctx context.Context, in *ActionLog, opts ...grpc.CallOption) (*Response, error)
|
||||
LoginAdd(ctx context.Context, in *LoginLog, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
type lonelogClient struct {
|
||||
type recordClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewLonelogClient(cc grpc.ClientConnInterface) LonelogClient {
|
||||
return &lonelogClient{cc}
|
||||
func NewRecordClient(cc grpc.ClientConnInterface) RecordClient {
|
||||
return &recordClient{cc}
|
||||
}
|
||||
|
||||
func (c *lonelogClient) Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
func (c *recordClient) Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Lonelog_Items_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Record_Items_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *lonelogClient) LoginItems(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
func (c *recordClient) LoginItems(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Lonelog_LoginItems_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Record_LoginItems_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *lonelogClient) ActionAdd(ctx context.Context, in *ActionLog, opts ...grpc.CallOption) (*Response, error) {
|
||||
func (c *recordClient) ActionAdd(ctx context.Context, in *ActionLog, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Lonelog_ActionAdd_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Record_ActionAdd_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *lonelogClient) LoginAdd(ctx context.Context, in *LoginLog, opts ...grpc.CallOption) (*Response, error) {
|
||||
func (c *recordClient) LoginAdd(ctx context.Context, in *LoginLog, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Lonelog_LoginAdd_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Record_LoginAdd_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// LonelogServer is the server API for Lonelog service.
|
||||
// All implementations must embed UnimplementedLonelogServer
|
||||
// RecordServer is the server API for Record service.
|
||||
// All implementations must embed UnimplementedRecordServer
|
||||
// for forward compatibility.
|
||||
type LonelogServer interface {
|
||||
type RecordServer interface {
|
||||
Items(context.Context, *ItemsRequest) (*Response, error)
|
||||
LoginItems(context.Context, *ItemsRequest) (*Response, error)
|
||||
ActionAdd(context.Context, *ActionLog) (*Response, error)
|
||||
LoginAdd(context.Context, *LoginLog) (*Response, error)
|
||||
mustEmbedUnimplementedLonelogServer()
|
||||
mustEmbedUnimplementedRecordServer()
|
||||
}
|
||||
|
||||
// UnimplementedLonelogServer must be embedded to have
|
||||
// UnimplementedRecordServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedLonelogServer struct{}
|
||||
type UnimplementedRecordServer struct{}
|
||||
|
||||
func (UnimplementedLonelogServer) Items(context.Context, *ItemsRequest) (*Response, error) {
|
||||
func (UnimplementedRecordServer) Items(context.Context, *ItemsRequest) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Items not implemented")
|
||||
}
|
||||
func (UnimplementedLonelogServer) LoginItems(context.Context, *ItemsRequest) (*Response, error) {
|
||||
func (UnimplementedRecordServer) LoginItems(context.Context, *ItemsRequest) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method LoginItems not implemented")
|
||||
}
|
||||
func (UnimplementedLonelogServer) ActionAdd(context.Context, *ActionLog) (*Response, error) {
|
||||
func (UnimplementedRecordServer) ActionAdd(context.Context, *ActionLog) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ActionAdd not implemented")
|
||||
}
|
||||
func (UnimplementedLonelogServer) LoginAdd(context.Context, *LoginLog) (*Response, error) {
|
||||
func (UnimplementedRecordServer) LoginAdd(context.Context, *LoginLog) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method LoginAdd not implemented")
|
||||
}
|
||||
func (UnimplementedLonelogServer) mustEmbedUnimplementedLonelogServer() {}
|
||||
func (UnimplementedLonelogServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedRecordServer) mustEmbedUnimplementedRecordServer() {}
|
||||
func (UnimplementedRecordServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeLonelogServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to LonelogServer will
|
||||
// UnsafeRecordServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RecordServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeLonelogServer interface {
|
||||
mustEmbedUnimplementedLonelogServer()
|
||||
type UnsafeRecordServer interface {
|
||||
mustEmbedUnimplementedRecordServer()
|
||||
}
|
||||
|
||||
func RegisterLonelogServer(s grpc.ServiceRegistrar, srv LonelogServer) {
|
||||
// If the following call panics, it indicates UnimplementedLonelogServer was
|
||||
func RegisterRecordServer(s grpc.ServiceRegistrar, srv RecordServer) {
|
||||
// If the following call panics, it indicates UnimplementedRecordServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Lonelog_ServiceDesc, srv)
|
||||
s.RegisterService(&Record_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Lonelog_Items_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _Record_Items_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ItemsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LonelogServer).Items(ctx, in)
|
||||
return srv.(RecordServer).Items(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Lonelog_Items_FullMethodName,
|
||||
FullMethod: Record_Items_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LonelogServer).Items(ctx, req.(*ItemsRequest))
|
||||
return srv.(RecordServer).Items(ctx, req.(*ItemsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Lonelog_LoginItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _Record_LoginItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ItemsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LonelogServer).LoginItems(ctx, in)
|
||||
return srv.(RecordServer).LoginItems(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Lonelog_LoginItems_FullMethodName,
|
||||
FullMethod: Record_LoginItems_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LonelogServer).LoginItems(ctx, req.(*ItemsRequest))
|
||||
return srv.(RecordServer).LoginItems(ctx, req.(*ItemsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Lonelog_ActionAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _Record_ActionAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ActionLog)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LonelogServer).ActionAdd(ctx, in)
|
||||
return srv.(RecordServer).ActionAdd(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Lonelog_ActionAdd_FullMethodName,
|
||||
FullMethod: Record_ActionAdd_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LonelogServer).ActionAdd(ctx, req.(*ActionLog))
|
||||
return srv.(RecordServer).ActionAdd(ctx, req.(*ActionLog))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Lonelog_LoginAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _Record_LoginAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LoginLog)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LonelogServer).LoginAdd(ctx, in)
|
||||
return srv.(RecordServer).LoginAdd(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Lonelog_LoginAdd_FullMethodName,
|
||||
FullMethod: Record_LoginAdd_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LonelogServer).LoginAdd(ctx, req.(*LoginLog))
|
||||
return srv.(RecordServer).LoginAdd(ctx, req.(*LoginLog))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Lonelog_ServiceDesc is the grpc.ServiceDesc for Lonelog service.
|
||||
// Record_ServiceDesc is the grpc.ServiceDesc for Record service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Lonelog_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "lonelog.Lonelog",
|
||||
HandlerType: (*LonelogServer)(nil),
|
||||
var Record_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "record.Record",
|
||||
HandlerType: (*RecordServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Items",
|
||||
Handler: _Lonelog_Items_Handler,
|
||||
Handler: _Record_Items_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoginItems",
|
||||
Handler: _Lonelog_LoginItems_Handler,
|
||||
Handler: _Record_LoginItems_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ActionAdd",
|
||||
Handler: _Lonelog_ActionAdd_Handler,
|
||||
Handler: _Record_ActionAdd_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoginAdd",
|
||||
Handler: _Lonelog_LoginAdd_Handler,
|
||||
Handler: _Record_LoginAdd_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "lonelog/lonelog.proto",
|
||||
Metadata: "record/record.proto",
|
||||
}
|
||||
Binary file not shown.
@@ -2,8 +2,8 @@ syntax = "proto3";
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
package lonelog;
|
||||
option go_package = "lone-services/rpc/lonelog";
|
||||
package record;
|
||||
option go_package = "lone-services/rpc/record";
|
||||
|
||||
|
||||
message ItemsRequest {
|
||||
@@ -55,7 +55,7 @@ message ItemsLoginRequest {
|
||||
repeated string time = 5;
|
||||
}
|
||||
|
||||
service Lonelog {
|
||||
service Record {
|
||||
rpc Items(ItemsRequest) returns(Response){
|
||||
option (google.api.http) = {
|
||||
get: "/admin/v3/log/action"
|
||||
@@ -1,3 +0,0 @@
|
||||
run.toml
|
||||
tmp
|
||||
etc/lonelog.yaml
|
||||
@@ -1,44 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.10.2
|
||||
// Source: lonelog.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/lonelog/pb"
|
||||
"lone-services/services/lonelog/internal/logic"
|
||||
"lone-services/services/lonelog/internal/svc"
|
||||
)
|
||||
|
||||
type LonelogServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
lonelog.UnimplementedLonelogServer
|
||||
}
|
||||
|
||||
func NewLonelogServer(svcCtx *svc.ServiceContext) *LonelogServer {
|
||||
return &LonelogServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *LonelogServer) Items(ctx context.Context, in *lonelog.ItemsRequest) (*lonelog.Response, error) {
|
||||
l := logic.NewItemsLogic(ctx, s.svcCtx)
|
||||
return l.Items(in)
|
||||
}
|
||||
|
||||
func (s *LonelogServer) LoginItems(ctx context.Context, in *lonelog.ItemsRequest) (*lonelog.Response, error) {
|
||||
l := logic.NewLoginItemsLogic(ctx, s.svcCtx)
|
||||
return l.LoginItems(in)
|
||||
}
|
||||
|
||||
func (s *LonelogServer) ActionAdd(ctx context.Context, in *lonelog.ActionLog) (*lonelog.Response, error) {
|
||||
l := logic.NewActionAddLogic(ctx, s.svcCtx)
|
||||
return l.ActionAdd(in)
|
||||
}
|
||||
|
||||
func (s *LonelogServer) LoginAdd(ctx context.Context, in *lonelog.LoginLog) (*lonelog.Response, error) {
|
||||
l := logic.NewLoginAddLogic(ctx, s.svcCtx)
|
||||
return l.LoginAdd(in)
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.10.2
|
||||
// Source: lonelog.proto
|
||||
|
||||
package lonelogClient
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/lonelog/pb"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type (
|
||||
ActionLog = lonelog.ActionLog
|
||||
ItemsLoginRequest = lonelog.ItemsLoginRequest
|
||||
ItemsRequest = lonelog.ItemsRequest
|
||||
LoginLog = lonelog.LoginLog
|
||||
Response = lonelog.Response
|
||||
|
||||
Lonelog interface {
|
||||
Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
LoginItems(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
ActionAdd(ctx context.Context, in *ActionLog, opts ...grpc.CallOption) (*Response, error)
|
||||
LoginAdd(ctx context.Context, in *LoginLog, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
defaultLonelog struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewLonelog(cli zrpc.Client) Lonelog {
|
||||
return &defaultLonelog{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultLonelog) Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := lonelog.NewLonelogClient(m.cli.Conn())
|
||||
return client.Items(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultLonelog) LoginItems(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := lonelog.NewLonelogClient(m.cli.Conn())
|
||||
return client.LoginItems(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultLonelog) ActionAdd(ctx context.Context, in *ActionLog, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := lonelog.NewLonelogClient(m.cli.Conn())
|
||||
return client.ActionAdd(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultLonelog) LoginAdd(ctx context.Context, in *LoginLog, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := lonelog.NewLonelogClient(m.cli.Conn())
|
||||
return client.LoginAdd(ctx, in, opts...)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
run.toml
|
||||
tmp
|
||||
etc/record.yaml
|
||||
@@ -14,9 +14,9 @@ RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
go mod download
|
||||
|
||||
COPY rpc/ ./rpc
|
||||
COPY services/lonelog/ ./services/lonelog/
|
||||
COPY services/record/ ./services/record/
|
||||
|
||||
WORKDIR /src/services/lonelog
|
||||
WORKDIR /src/services/record
|
||||
|
||||
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
--mount=type=cache,target=/root/.cache/go-build \
|
||||
@@ -34,4 +34,4 @@ RUN apk add --no-cache tzdata \
|
||||
|
||||
COPY --from=builder /out/main .
|
||||
|
||||
CMD ["./main", "-f", "etc/lonelog.yaml"]
|
||||
CMD ["./main", "-f", "etc/record.yaml"]
|
||||
+4
-4
@@ -2,8 +2,8 @@ package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
lonelog "lone-services/rpc/lonelog/pb"
|
||||
"lone-services/services/lonelog/internal/svc"
|
||||
record "lone-services/rpc/record/pb"
|
||||
"lone-services/services/record/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
@@ -22,8 +22,8 @@ func NewActionAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ActionA
|
||||
}
|
||||
}
|
||||
|
||||
func (l *ActionAddLogic) ActionAdd(in *lonelog.ActionLog) (*lonelog.Response, error) {
|
||||
func (l *ActionAddLogic) ActionAdd(in *record.ActionLog) (*record.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &lonelog.Response{}, nil
|
||||
return &record.Response{}, nil
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package logic
|
||||
import (
|
||||
"lone-services/pkg/utils"
|
||||
"lone-services/pkg/validate"
|
||||
lonelog "lone-services/rpc/lonelog/pb"
|
||||
"lone-services/rpc/record/pb"
|
||||
"reflect"
|
||||
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
@@ -12,10 +12,10 @@ import (
|
||||
type BaseLogic struct {
|
||||
}
|
||||
|
||||
func (l *BaseLogic) checkParams(in interface{}, v validate.IValidator) *lonelog.Response {
|
||||
func (l *BaseLogic) checkParams(in interface{}, v validate.IValidator) *record.Response {
|
||||
rv := reflect.ValueOf(in)
|
||||
if rv.Kind() != reflect.Ptr || rv.IsNil() {
|
||||
return &lonelog.Response{
|
||||
return &record.Response{
|
||||
Code: utils.ErrorParams.Code,
|
||||
Msg: "request must be non‑nil proto pointer",
|
||||
}
|
||||
@@ -23,7 +23,7 @@ func (l *BaseLogic) checkParams(in interface{}, v validate.IValidator) *lonelog.
|
||||
|
||||
resp := validate.ValidateFromProto(in, v)
|
||||
if resp != utils.StringEmpty {
|
||||
return &lonelog.Response{
|
||||
return &record.Response{
|
||||
Code: utils.ErrorParams.Code,
|
||||
Msg: resp,
|
||||
}
|
||||
@@ -31,14 +31,14 @@ func (l *BaseLogic) checkParams(in interface{}, v validate.IValidator) *lonelog.
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *BaseLogic) fail(status utils.Status) (*lonelog.Response, error) {
|
||||
func (l *BaseLogic) fail(status utils.Status) (*record.Response, error) {
|
||||
return l.out(status, status.Msg)
|
||||
}
|
||||
func (l *BaseLogic) out(status utils.Status, msg string) (*lonelog.Response, error) {
|
||||
return &lonelog.Response{Code: status.Code, Msg: msg}, nil
|
||||
func (l *BaseLogic) out(status utils.Status, msg string) (*record.Response, error) {
|
||||
return &record.Response{Code: status.Code, Msg: msg}, nil
|
||||
}
|
||||
|
||||
func (l *BaseLogic) ok(data any) (*lonelog.Response, error) {
|
||||
func (l *BaseLogic) ok(data any) (*record.Response, error) {
|
||||
buf, _ := jsoniter.Marshal(data)
|
||||
return &lonelog.Response{Code: utils.Ok.Code, Msg: utils.Ok.Msg, Data: string(buf)}, nil
|
||||
return &record.Response{Code: utils.Ok.Code, Msg: utils.Ok.Msg, Data: string(buf)}, nil
|
||||
}
|
||||
+5
-5
@@ -4,10 +4,10 @@ import (
|
||||
"context"
|
||||
"lone-services/pkg/modelbase"
|
||||
"lone-services/pkg/utils"
|
||||
lonelog "lone-services/rpc/lonelog/pb"
|
||||
"lone-services/services/lonelog/internal/dao"
|
||||
"lone-services/services/lonelog/internal/model"
|
||||
"lone-services/services/lonelog/internal/svc"
|
||||
record "lone-services/rpc/record/pb"
|
||||
"lone-services/services/record/internal/dao"
|
||||
"lone-services/services/record/internal/model"
|
||||
"lone-services/services/record/internal/svc"
|
||||
"strconv"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
@@ -29,7 +29,7 @@ func NewItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ItemsLogic
|
||||
}
|
||||
}
|
||||
|
||||
func (l *ItemsLogic) Items(in *lonelog.ItemsRequest) (*lonelog.Response, error) {
|
||||
func (l *ItemsLogic) Items(in *record.ItemsRequest) (*record.Response, error) {
|
||||
modelObj := model.ActionModel{}.Init()
|
||||
w := modelbase.Params{
|
||||
Page: int(in.Page),
|
||||
+5
-5
@@ -4,12 +4,12 @@ import (
|
||||
"context"
|
||||
"lone-services/pkg/modelbase"
|
||||
"lone-services/pkg/utils"
|
||||
"lone-services/services/lonelog/internal/dao"
|
||||
"lone-services/services/lonelog/internal/model"
|
||||
"lone-services/services/record/internal/dao"
|
||||
"lone-services/services/record/internal/model"
|
||||
"strconv"
|
||||
|
||||
"lone-services/rpc/lonelog/pb"
|
||||
"lone-services/services/lonelog/internal/svc"
|
||||
"lone-services/rpc/record/pb"
|
||||
"lone-services/services/record/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
@@ -29,7 +29,7 @@ func NewLoginItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LoginI
|
||||
}
|
||||
}
|
||||
|
||||
func (l *LoginItemsLogic) LoginItems(in *lonelog.ItemsRequest) (*lonelog.Response, error) {
|
||||
func (l *LoginItemsLogic) LoginItems(in *record.ItemsRequest) (*record.Response, error) {
|
||||
modelObj := model.LoginModel{}.Init()
|
||||
w := modelbase.Params{
|
||||
Page: int(in.Page),
|
||||
+4
-4
@@ -2,8 +2,8 @@ package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
lonelog "lone-services/rpc/lonelog/pb"
|
||||
"lone-services/services/lonelog/internal/svc"
|
||||
record "lone-services/rpc/record/pb"
|
||||
"lone-services/services/record/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
@@ -22,8 +22,8 @@ func NewLoginAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LoginAdd
|
||||
}
|
||||
}
|
||||
|
||||
func (l *LoginAddLogic) LoginAdd(in *lonelog.LoginLog) (*lonelog.Response, error) {
|
||||
func (l *LoginAddLogic) LoginAdd(in *record.LoginLog) (*record.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &lonelog.Response{}, nil
|
||||
return &record.Response{}, nil
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@ package model
|
||||
|
||||
import (
|
||||
"lone-services/pkg/modelbase"
|
||||
"lone-services/services/lonelog/internal/dao"
|
||||
"lone-services/services/record/internal/dao"
|
||||
)
|
||||
|
||||
type ActionModel struct {
|
||||
@@ -2,7 +2,7 @@ package model
|
||||
|
||||
import (
|
||||
"lone-services/pkg/modelbase"
|
||||
"lone-services/services/lonelog/internal/dao"
|
||||
"lone-services/services/record/internal/dao"
|
||||
)
|
||||
|
||||
type LoginModel struct {
|
||||
@@ -0,0 +1,44 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.10.2
|
||||
// Source: record.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/record/pb"
|
||||
"lone-services/services/record/internal/logic"
|
||||
"lone-services/services/record/internal/svc"
|
||||
)
|
||||
|
||||
type RecordServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
record.UnimplementedRecordServer
|
||||
}
|
||||
|
||||
func NewRecordServer(svcCtx *svc.ServiceContext) *RecordServer {
|
||||
return &RecordServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *RecordServer) Items(ctx context.Context, in *record.ItemsRequest) (*record.Response, error) {
|
||||
l := logic.NewItemsLogic(ctx, s.svcCtx)
|
||||
return l.Items(in)
|
||||
}
|
||||
|
||||
func (s *RecordServer) LoginItems(ctx context.Context, in *record.ItemsRequest) (*record.Response, error) {
|
||||
l := logic.NewLoginItemsLogic(ctx, s.svcCtx)
|
||||
return l.LoginItems(in)
|
||||
}
|
||||
|
||||
func (s *RecordServer) ActionAdd(ctx context.Context, in *record.ActionLog) (*record.Response, error) {
|
||||
l := logic.NewActionAddLogic(ctx, s.svcCtx)
|
||||
return l.ActionAdd(in)
|
||||
}
|
||||
|
||||
func (s *RecordServer) LoginAdd(ctx context.Context, in *record.LoginLog) (*record.Response, error) {
|
||||
l := logic.NewLoginAddLogic(ctx, s.svcCtx)
|
||||
return l.LoginAdd(in)
|
||||
}
|
||||
+2
-2
@@ -5,8 +5,8 @@ import (
|
||||
"encoding/json"
|
||||
"lone-services/pkg/logRedis"
|
||||
"lone-services/pkg/utils"
|
||||
"lone-services/services/lonelog/internal/dao"
|
||||
"lone-services/services/lonelog/internal/model"
|
||||
"lone-services/services/record/internal/dao"
|
||||
"lone-services/services/record/internal/model"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package svc
|
||||
|
||||
import (
|
||||
"lone-services/pkg/utils"
|
||||
"lone-services/services/lonelog/internal/config"
|
||||
"lone-services/services/record/internal/config"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@@ -8,15 +8,16 @@ import (
|
||||
"lone-services/pkg/mysql"
|
||||
"lone-services/pkg/utils"
|
||||
"lone-services/pkg/validate"
|
||||
lonelog "lone-services/rpc/lonelog/pb"
|
||||
"lone-services/services/lonelog/internal/config"
|
||||
"lone-services/services/lonelog/internal/server"
|
||||
service2 "lone-services/services/lonelog/internal/service"
|
||||
"lone-services/services/lonelog/internal/svc"
|
||||
"lone-services/rpc/record/pb"
|
||||
service2 "lone-services/services/record/internal/service"
|
||||
"net"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"lone-services/services/record/internal/config"
|
||||
"lone-services/services/record/internal/server"
|
||||
"lone-services/services/record/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/conf"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"github.com/zeromicro/go-zero/core/service"
|
||||
@@ -25,7 +26,7 @@ import (
|
||||
"google.golang.org/grpc/reflection"
|
||||
)
|
||||
|
||||
var configFile = flag.String("f", "etc/lonelog.yaml", "the config file")
|
||||
var configFile = flag.String("f", "etc/record.yaml", "the config file")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
@@ -130,7 +131,7 @@ func main() {
|
||||
ctx := svc.NewServiceContext(c, db)
|
||||
|
||||
s := zrpc.MustNewServer(rpcConf, func(grpcServer *grpc.Server) {
|
||||
lonelog.RegisterLonelogServer(grpcServer, server.NewLonelogServer(ctx))
|
||||
record.RegisterRecordServer(grpcServer, server.NewRecordServer(ctx))
|
||||
if mode == service.DevMode || mode == service.TestMode {
|
||||
reflection.Register(grpcServer)
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.10.2
|
||||
// Source: record.proto
|
||||
|
||||
package recordClient
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/rpc/record/pb"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type (
|
||||
ActionLog = record.ActionLog
|
||||
ItemsLoginRequest = record.ItemsLoginRequest
|
||||
ItemsRequest = record.ItemsRequest
|
||||
LoginLog = record.LoginLog
|
||||
Response = record.Response
|
||||
|
||||
Record interface {
|
||||
Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
LoginItems(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
ActionAdd(ctx context.Context, in *ActionLog, opts ...grpc.CallOption) (*Response, error)
|
||||
LoginAdd(ctx context.Context, in *LoginLog, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
defaultRecord struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewRecord(cli zrpc.Client) Record {
|
||||
return &defaultRecord{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultRecord) Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := record.NewRecordClient(m.cli.Conn())
|
||||
return client.Items(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultRecord) LoginItems(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := record.NewRecordClient(m.cli.Conn())
|
||||
return client.LoginItems(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultRecord) ActionAdd(ctx context.Context, in *ActionLog, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := record.NewRecordClient(m.cli.Conn())
|
||||
return client.ActionAdd(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultRecord) LoginAdd(ctx context.Context, in *LoginLog, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := record.NewRecordClient(m.cli.Conn())
|
||||
return client.LoginAdd(ctx, in, opts...)
|
||||
}
|
||||
Reference in New Issue
Block a user