更新管理员相关接口

This commit is contained in:
WuYuuuub
2026-04-05 11:57:47 +08:00
parent a630ae733e
commit 8457cf1450
8 changed files with 808 additions and 0 deletions

View File

@@ -4203,6 +4203,326 @@ func (x *Statistics) GetActivePrinters() int32 {
return 0
}
// CreateAdminRequest 创建管理员请求
type CreateAdminRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
Nickname string `protobuf:"bytes,3,opt,name=nickname,proto3" json:"nickname,omitempty"`
Role int32 `protobuf:"varint,4,opt,name=role,proto3" json:"role,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateAdminRequest) Reset() {
*x = CreateAdminRequest{}
mi := &file_cloudprint_proto_msgTypes[69]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CreateAdminRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateAdminRequest) ProtoMessage() {}
func (x *CreateAdminRequest) ProtoReflect() protoreflect.Message {
mi := &file_cloudprint_proto_msgTypes[69]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (*CreateAdminRequest) Descriptor() ([]byte, []int) {
return file_cloudprint_proto_rawDescGZIP(), []int{69}
}
func (x *CreateAdminRequest) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
func (x *CreateAdminRequest) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
func (x *CreateAdminRequest) GetNickname() string {
if x != nil {
return x.Nickname
}
return ""
}
func (x *CreateAdminRequest) GetRole() int32 {
if x != nil {
return x.Role
}
return 0
}
// CreateAdminResponse 创建管理员响应
type CreateAdminResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Admin *Admin `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateAdminResponse) Reset() {
*x = CreateAdminResponse{}
mi := &file_cloudprint_proto_msgTypes[70]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CreateAdminResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateAdminResponse) ProtoMessage() {}
func (x *CreateAdminResponse) ProtoReflect() protoreflect.Message {
mi := &file_cloudprint_proto_msgTypes[70]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (*CreateAdminResponse) Descriptor() ([]byte, []int) {
return file_cloudprint_proto_rawDescGZIP(), []int{70}
}
func (x *CreateAdminResponse) GetAdmin() *Admin {
if x != nil {
return x.Admin
}
return nil
}
// GetAdminListRequest 获取管理员列表请求
type GetAdminListRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetAdminListRequest) Reset() {
*x = GetAdminListRequest{}
mi := &file_cloudprint_proto_msgTypes[71]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetAdminListRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetAdminListRequest) ProtoMessage() {}
func (x *GetAdminListRequest) ProtoReflect() protoreflect.Message {
mi := &file_cloudprint_proto_msgTypes[71]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (*GetAdminListRequest) Descriptor() ([]byte, []int) {
return file_cloudprint_proto_rawDescGZIP(), []int{71}
}
func (x *GetAdminListRequest) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *GetAdminListRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
// AdminListResponse 管理员列表响应
type AdminListResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Admins []*Admin `protobuf:"bytes,1,rep,name=admins,proto3" json:"admins,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AdminListResponse) Reset() {
*x = AdminListResponse{}
mi := &file_cloudprint_proto_msgTypes[72]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AdminListResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AdminListResponse) ProtoMessage() {}
func (x *AdminListResponse) ProtoReflect() protoreflect.Message {
mi := &file_cloudprint_proto_msgTypes[72]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (*AdminListResponse) Descriptor() ([]byte, []int) {
return file_cloudprint_proto_rawDescGZIP(), []int{72}
}
func (x *AdminListResponse) GetAdmins() []*Admin {
if x != nil {
return x.Admins
}
return nil
}
func (x *AdminListResponse) GetTotal() int32 {
if x != nil {
return x.Total
}
return 0
}
// UpdateAdminRequest 更新管理员请求
type UpdateAdminRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"`
Role int32 `protobuf:"varint,3,opt,name=role,proto3" json:"role,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UpdateAdminRequest) Reset() {
*x = UpdateAdminRequest{}
mi := &file_cloudprint_proto_msgTypes[73]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UpdateAdminRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateAdminRequest) ProtoMessage() {}
func (x *UpdateAdminRequest) ProtoReflect() protoreflect.Message {
mi := &file_cloudprint_proto_msgTypes[73]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (*UpdateAdminRequest) Descriptor() ([]byte, []int) {
return file_cloudprint_proto_rawDescGZIP(), []int{73}
}
func (x *UpdateAdminRequest) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *UpdateAdminRequest) GetNickname() string {
if x != nil {
return x.Nickname
}
return ""
}
func (x *UpdateAdminRequest) GetRole() int32 {
if x != nil {
return x.Role
}
return 0
}
// DeleteAdminRequest 删除管理员请求
type DeleteAdminRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteAdminRequest) Reset() {
*x = DeleteAdminRequest{}
mi := &file_cloudprint_proto_msgTypes[74]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteAdminRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteAdminRequest) ProtoMessage() {}
func (x *DeleteAdminRequest) ProtoReflect() protoreflect.Message {
mi := &file_cloudprint_proto_msgTypes[74]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (*DeleteAdminRequest) Descriptor() ([]byte, []int) {
return file_cloudprint_proto_rawDescGZIP(), []int{74}
}
func (x *DeleteAdminRequest) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
var File_cloudprint_proto protoreflect.FileDescriptor
const file_cloudprint_proto_rawDesc = "" +