重新实现套餐相关功能

This commit is contained in:
GoEdgeLab
2023-09-06 16:31:14 +08:00
parent 87a5aee982
commit fcf7032324
16 changed files with 1600 additions and 972 deletions

View File

@@ -25,15 +25,17 @@ type UserPlan struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"`
PlanId int64 `protobuf:"varint,3,opt,name=planId,proto3" json:"planId,omitempty"`
IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"`
DayTo string `protobuf:"bytes,5,opt,name=dayTo,proto3" json:"dayTo,omitempty"`
Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"`
User *User `protobuf:"bytes,30,opt,name=user,proto3" json:"user,omitempty"`
Plan *Plan `protobuf:"bytes,31,opt,name=plan,proto3" json:"plan,omitempty"`
Server *Server `protobuf:"bytes,32,opt,name=server,proto3" json:"server,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // 套餐ID
UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` // 用户ID
PlanId int64 `protobuf:"varint,3,opt,name=planId,proto3" json:"planId,omitempty"` // 套餐定义ID
IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"` // 是否启用
DayTo string `protobuf:"bytes,5,opt,name=dayTo,proto3" json:"dayTo,omitempty"` // 到期日期Y-m-d
Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` // 自定义备注名称
User *User `protobuf:"bytes,30,opt,name=user,proto3" json:"user,omitempty"` // 用户信息
Plan *Plan `protobuf:"bytes,31,opt,name=plan,proto3" json:"plan,omitempty"` // 套餐定义信息
Servers []*Server `protobuf:"bytes,33,rep,name=servers,proto3" json:"servers,omitempty"` // 绑定的网站列表
// Deprecated: Marked as deprecated in models/model_user_plan.proto.
Server *Server `protobuf:"bytes,32,opt,name=server,proto3" json:"server,omitempty"` // 绑定的网站,已过期,使用 servers 代替
}
func (x *UserPlan) Reset() {
@@ -124,6 +126,14 @@ func (x *UserPlan) GetPlan() *Plan {
return nil
}
func (x *UserPlan) GetServers() []*Server {
if x != nil {
return x.Servers
}
return nil
}
// Deprecated: Marked as deprecated in models/model_user_plan.proto.
func (x *UserPlan) GetServer() *Server {
if x != nil {
return x.Server
@@ -141,7 +151,7 @@ var file_models_model_user_plan_proto_rawDesc = []byte{
0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64,
0x65, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
0xe8, 0x01, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x0e, 0x0a, 0x02,
0x92, 0x02, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x0e, 0x0a, 0x02,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06,
0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73,
0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x18, 0x03,
@@ -153,10 +163,13 @@ var file_models_model_user_plan_proto_rawDesc = []byte{
0x65, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73,
0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e,
0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x6e,
0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x72, 0x76,
0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x12, 0x24, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
0x73, 0x18, 0x21, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x26, 0x0a, 0x06,
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70,
0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, 0x02, 0x18, 0x01, 0x52, 0x06, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -181,12 +194,13 @@ var file_models_model_user_plan_proto_goTypes = []interface{}{
var file_models_model_user_plan_proto_depIdxs = []int32{
1, // 0: pb.UserPlan.user:type_name -> pb.User
2, // 1: pb.UserPlan.plan:type_name -> pb.Plan
3, // 2: pb.UserPlan.server:type_name -> pb.Server
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
3, // 2: pb.UserPlan.servers:type_name -> pb.Server
3, // 3: pb.UserPlan.server:type_name -> pb.Server
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_models_model_user_plan_proto_init() }