admin add edit status password items info
CI / changes (push) Successful in 2s
CI / docker-bff (push) Successful in 2s
CI / docker-product (push) Failing after 1s

This commit is contained in:
2026-08-08 16:06:36 +08:00
parent 29ffc24bbb
commit 38a8a5cafb
30 changed files with 655 additions and 579 deletions
+43 -49
View File
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v3.19.4
// protoc v4.25.8
// source: proto/admin.proto
package admin
@@ -10,7 +10,6 @@ import (
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
anypb "google.golang.org/protobuf/types/known/anypb"
reflect "reflect"
sync "sync"
unsafe "unsafe"
@@ -179,7 +178,7 @@ type Response struct {
state protoimpl.MessageState `protogen:"open.v1"`
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
Data *anypb.Any `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -228,11 +227,11 @@ func (x *Response) GetMsg() string {
return ""
}
func (x *Response) GetData() *anypb.Any {
func (x *Response) GetData() string {
if x != nil {
return x.Data
}
return nil
return ""
}
type PasswordRequest struct {
@@ -461,8 +460,8 @@ func (x *AdminItemsRequest) GetStatus() int32 {
type AdminLoginRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Username int32 `protobuf:"varint,1,opt,name=username,proto3" json:"username,omitempty"`
Password int32 `protobuf:"varint,2,opt,name=password,proto3" json:"password,omitempty"`
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -497,25 +496,25 @@ func (*AdminLoginRequest) Descriptor() ([]byte, []int) {
return file_proto_admin_proto_rawDescGZIP(), []int{7}
}
func (x *AdminLoginRequest) GetUsername() int32 {
func (x *AdminLoginRequest) GetUsername() string {
if x != nil {
return x.Username
}
return 0
return ""
}
func (x *AdminLoginRequest) GetPassword() int32 {
func (x *AdminLoginRequest) GetPassword() string {
if x != nil {
return x.Password
}
return 0
return ""
}
var File_proto_admin_proto protoreflect.FileDescriptor
const file_proto_admin_proto_rawDesc = "" +
"\n" +
"\x11proto/admin.proto\x12\x05admin\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/api/annotations.proto\"\xac\x01\n" +
"\x11proto/admin.proto\x12\x05admin\x1a\x1cgoogle/api/annotations.proto\"\xac\x01\n" +
"\x10AdminEditRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\x12\x1a\n" +
@@ -527,11 +526,11 @@ const file_proto_admin_proto_rawDesc = "" +
"\rStatusRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x16\n" +
"\x06status\x18\x02 \x01(\x05R\x06status\x12\x16\n" +
"\x06reason\x18\x03 \x01(\tR\x06reason\"Z\n" +
"\x06reason\x18\x03 \x01(\tR\x06reason\"D\n" +
"\bResponse\x12\x12\n" +
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x10\n" +
"\x03msg\x18\x02 \x01(\tR\x03msg\x12(\n" +
"\x04data\x18\x03 \x01(\v2\x14.google.protobuf.AnyR\x04data\"=\n" +
"\x03msg\x18\x02 \x01(\tR\x03msg\x12\x12\n" +
"\x04data\x18\x03 \x01(\tR\x04data\"=\n" +
"\x0fPasswordRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" +
"\bpassword\x18\x02 \x01(\tR\bpassword\"0\n" +
@@ -547,19 +546,18 @@ const file_proto_admin_proto_rawDesc = "" +
"\x05email\x18\x06 \x01(\tR\x05email\x12\x16\n" +
"\x06status\x18\a \x01(\x05R\x06status\"K\n" +
"\x11AdminLoginRequest\x12\x1a\n" +
"\busername\x18\x01 \x01(\x05R\busername\x12\x1a\n" +
"\bpassword\x18\x02 \x01(\x05R\bpassword2\xe3\x03\n" +
"\x05Admin\x12T\n" +
"\bAdminAdd\x12\x17.admin.AdminEditRequest\x1a\x0f.admin.Response\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/admin/v3/admin/add\x125\n" +
"\tAdminEdit\x12\x17.admin.AdminEditRequest\x1a\x0f.admin.Response\x124\n" +
"\vAdminStatus\x12\x14.admin.StatusRequest\x1a\x0f.admin.Response\x123\n" +
"\bPassword\x12\x16.admin.PasswordRequest\x1a\x0f.admin.Response\x129\n" +
"\vOwnPassword\x12\x19.admin.OwnPasswordRequest\x1a\x0f.admin.Response\x125\n" +
"\tAdminInfo\x12\x17.admin.AdminInfoRequest\x1a\x0f.admin.Response\x127\n" +
"\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" +
"\bpassword\x18\x02 \x01(\tR\bpassword2\xfe\x04\n" +
"\x05Admin\x12V\n" +
"\tAdminEdit\x12\x17.admin.AdminEditRequest\x1a\x0f.admin.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/admin/v3/admin/edit\x12W\n" +
"\vAdminStatus\x12\x14.admin.StatusRequest\x1a\x0f.admin.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/admin/v3/admin/status\x12X\n" +
"\bPassword\x12\x16.admin.PasswordRequest\x1a\x0f.admin.Response\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/admin/v3/admin/password\x12b\n" +
"\vOwnPassword\x12\x19.admin.OwnPasswordRequest\x1a\x0f.admin.Response\"'\x82\xd3\xe4\x93\x02!:\x01*\"\x1c/admin/v3/admin/own-password\x12V\n" +
"\tAdminInfo\x12\x17.admin.AdminInfoRequest\x1a\x0f.admin.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\x12\x14/admin/v3/admin/info\x12Y\n" +
"\n" +
"AdminItems\x12\x18.admin.AdminItemsRequest\x1a\x0f.admin.Response\x127\n" +
"AdminItems\x12\x18.admin.AdminItemsRequest\x1a\x0f.admin.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\x12\x15/admin/v3/admin/items\x12S\n" +
"\n" +
"AdminLogin\x12\x18.admin.AdminLoginRequest\x1a\x0f.admin.ResponseB\tZ\a./adminb\x06proto3"
"AdminLogin\x12\x18.admin.AdminLoginRequest\x1a\x0f.admin.Response\"\x1a\x82\xd3\xe4\x93\x02\x14:\x01*\"\x0f/admin/v3/loginB\tZ\a./adminb\x06proto3"
var (
file_proto_admin_proto_rawDescOnce sync.Once
@@ -583,31 +581,27 @@ var file_proto_admin_proto_goTypes = []any{
(*AdminInfoRequest)(nil), // 5: admin.AdminInfoRequest
(*AdminItemsRequest)(nil), // 6: admin.AdminItemsRequest
(*AdminLoginRequest)(nil), // 7: admin.AdminLoginRequest
(*anypb.Any)(nil), // 8: google.protobuf.Any
}
var file_proto_admin_proto_depIdxs = []int32{
8, // 0: admin.Response.data:type_name -> google.protobuf.Any
0, // 1: admin.Admin.AdminAdd:input_type -> admin.AdminEditRequest
0, // 2: admin.Admin.AdminEdit:input_type -> admin.AdminEditRequest
1, // 3: admin.Admin.AdminStatus:input_type -> admin.StatusRequest
3, // 4: admin.Admin.Password:input_type -> admin.PasswordRequest
4, // 5: admin.Admin.OwnPassword:input_type -> admin.OwnPasswordRequest
5, // 6: admin.Admin.AdminInfo:input_type -> admin.AdminInfoRequest
6, // 7: admin.Admin.AdminItems:input_type -> admin.AdminItemsRequest
7, // 8: admin.Admin.AdminLogin:input_type -> admin.AdminLoginRequest
2, // 9: admin.Admin.AdminAdd:output_type -> admin.Response
2, // 10: admin.Admin.AdminEdit:output_type -> admin.Response
2, // 11: admin.Admin.AdminStatus:output_type -> admin.Response
2, // 12: admin.Admin.Password:output_type -> admin.Response
2, // 13: admin.Admin.OwnPassword:output_type -> admin.Response
2, // 14: admin.Admin.AdminInfo:output_type -> admin.Response
2, // 15: admin.Admin.AdminItems:output_type -> admin.Response
2, // 16: admin.Admin.AdminLogin:output_type -> admin.Response
9, // [9:17] is the sub-list for method output_type
1, // [1:9] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
0, // 0: admin.Admin.AdminEdit:input_type -> admin.AdminEditRequest
1, // 1: admin.Admin.AdminStatus:input_type -> admin.StatusRequest
3, // 2: admin.Admin.Password:input_type -> admin.PasswordRequest
4, // 3: admin.Admin.OwnPassword:input_type -> admin.OwnPasswordRequest
5, // 4: admin.Admin.AdminInfo:input_type -> admin.AdminInfoRequest
6, // 5: admin.Admin.AdminItems:input_type -> admin.AdminItemsRequest
7, // 6: admin.Admin.AdminLogin:input_type -> admin.AdminLoginRequest
2, // 7: admin.Admin.AdminEdit:output_type -> admin.Response
2, // 8: admin.Admin.AdminStatus:output_type -> admin.Response
2, // 9: admin.Admin.Password:output_type -> admin.Response
2, // 10: admin.Admin.OwnPassword:output_type -> admin.Response
2, // 11: admin.Admin.AdminInfo:output_type -> admin.Response
2, // 12: admin.Admin.AdminItems:output_type -> admin.Response
2, // 13: admin.Admin.AdminLogin:output_type -> admin.Response
7, // [7:14] is the sub-list for method output_type
0, // [0:7] 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_proto_admin_proto_init() }
+1 -39
View File
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v3.19.4
// - protoc v4.25.8
// source: proto/admin.proto
package admin
@@ -19,7 +19,6 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
Admin_AdminAdd_FullMethodName = "/admin.Admin/AdminAdd"
Admin_AdminEdit_FullMethodName = "/admin.Admin/AdminEdit"
Admin_AdminStatus_FullMethodName = "/admin.Admin/AdminStatus"
Admin_Password_FullMethodName = "/admin.Admin/Password"
@@ -33,7 +32,6 @@ const (
//
// 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 AdminClient interface {
AdminAdd(ctx context.Context, in *AdminEditRequest, opts ...grpc.CallOption) (*Response, error)
AdminEdit(ctx context.Context, in *AdminEditRequest, opts ...grpc.CallOption) (*Response, error)
AdminStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error)
Password(ctx context.Context, in *PasswordRequest, opts ...grpc.CallOption) (*Response, error)
@@ -51,16 +49,6 @@ func NewAdminClient(cc grpc.ClientConnInterface) AdminClient {
return &adminClient{cc}
}
func (c *adminClient) AdminAdd(ctx context.Context, in *AdminEditRequest, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
err := c.cc.Invoke(ctx, Admin_AdminAdd_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *adminClient) AdminEdit(ctx context.Context, in *AdminEditRequest, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
@@ -135,7 +123,6 @@ func (c *adminClient) AdminLogin(ctx context.Context, in *AdminLoginRequest, opt
// All implementations must embed UnimplementedAdminServer
// for forward compatibility.
type AdminServer interface {
AdminAdd(context.Context, *AdminEditRequest) (*Response, error)
AdminEdit(context.Context, *AdminEditRequest) (*Response, error)
AdminStatus(context.Context, *StatusRequest) (*Response, error)
Password(context.Context, *PasswordRequest) (*Response, error)
@@ -153,9 +140,6 @@ type AdminServer interface {
// pointer dereference when methods are called.
type UnimplementedAdminServer struct{}
func (UnimplementedAdminServer) AdminAdd(context.Context, *AdminEditRequest) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method AdminAdd not implemented")
}
func (UnimplementedAdminServer) AdminEdit(context.Context, *AdminEditRequest) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method AdminEdit not implemented")
}
@@ -198,24 +182,6 @@ func RegisterAdminServer(s grpc.ServiceRegistrar, srv AdminServer) {
s.RegisterService(&Admin_ServiceDesc, srv)
}
func _Admin_AdminAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AdminEditRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServer).AdminAdd(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Admin_AdminAdd_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AdminServer).AdminAdd(ctx, req.(*AdminEditRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Admin_AdminEdit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AdminEditRequest)
if err := dec(in); err != nil {
@@ -349,10 +315,6 @@ var Admin_ServiceDesc = grpc.ServiceDesc{
ServiceName: "admin.Admin",
HandlerType: (*AdminServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "AdminAdd",
Handler: _Admin_AdminAdd_Handler,
},
{
MethodName: "AdminEdit",
Handler: _Admin_AdminEdit_Handler,