diff --git a/protoc-gen-go-crud/api/v1/users/users.pb.go b/protoc-gen-go-crud/api/v1/users/users.pb.go index f645b7f..2374207 100644 --- a/protoc-gen-go-crud/api/v1/users/users.pb.go +++ b/protoc-gen-go-crud/api/v1/users/users.pb.go @@ -1006,90 +1006,89 @@ var file_v1_users_users_proto_rawDesc = []byte{ 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, - 0x6e, 0x65, 0x32, 0xed, 0x09, 0x0a, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x52, 0x0a, 0x09, - 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x73, 0x56, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x11, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x12, 0x56, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, - 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, - 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x5b, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x6e, 0x65, 0x32, 0xec, 0x09, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x09, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x56, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x11, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, + 0x56, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, 0x76, + 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x5b, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x13, 0x3a, 0x01, 0x2a, 0x1a, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x4e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, + 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, + 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x16, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x58, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x2a, 0x0e, + 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x72, + 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, + 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x75, + 0x73, 0x65, 0x72, 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2d, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x12, 0x6a, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x52, 0x65, + 0x73, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x1a, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x4e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x70, - 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x16, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x58, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x70, + 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, + 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, + 0x2a, 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x2f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x74, + 0x12, 0x61, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x65, 0x74, 0x32, 0x46, 0x41, 0x12, 0x18, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x32, 0x46, 0x41, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x23, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x32, 0x66, 0x61, 0x2f, 0x72, 0x65, + 0x73, 0x65, 0x74, 0x12, 0x62, 0x0a, 0x0a, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, + 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x2f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x44, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x2a, - 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, - 0x72, 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x12, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, - 0x75, 0x73, 0x65, 0x72, 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2d, 0x70, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x12, 0x6a, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x52, - 0x65, 0x73, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x22, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, - 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, - 0x70, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x12, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x10, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x12, 0x6d, 0x0a, + 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, + 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, - 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, - 0x64, 0x7d, 0x2f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x65, - 0x74, 0x12, 0x61, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x65, 0x74, 0x32, 0x46, 0x41, 0x12, 0x18, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x32, 0x46, 0x41, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, - 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, - 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x32, 0x66, 0x61, 0x2f, 0x72, - 0x65, 0x73, 0x65, 0x74, 0x12, 0x62, 0x0a, 0x0a, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, - 0x2a, 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, - 0x7d, 0x2f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x44, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x10, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x12, 0x6d, - 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x12, 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, - 0x3a, 0x01, 0x2a, 0x1a, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x70, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x63, 0x0a, - 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x13, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x3a, 0x01, 0x2a, 0x1a, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, - 0x65, 0x72, 0x42, 0x35, 0x5a, 0x33, 0x62, 0x69, 0x74, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, - 0x6f, 0x72, 0x67, 0x2f, 0x61, 0x6e, 0x74, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x64, 0x65, 0x76, 0x2f, - 0x65, 0x61, 0x72, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, - 0x73, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, + 0x01, 0x2a, 0x1a, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x63, 0x0a, 0x11, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x13, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x0d, 0x3a, 0x01, 0x2a, 0x1a, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, + 0x72, 0x42, 0x35, 0x5a, 0x33, 0x62, 0x69, 0x74, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6f, + 0x72, 0x67, 0x2f, 0x61, 0x6e, 0x74, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x64, 0x65, 0x76, 0x2f, 0x65, + 0x61, 0x72, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x3b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1131,32 +1130,32 @@ var file_v1_users_users_proto_depIdxs = []int32{ 16, // 2: usersV1.ListUsersReply.page_info:type_name -> componentsV1.PageInfo 14, // 3: usersV1.CreateUserRequest.enabled:type_name -> componentsV1.EnableStatus 14, // 4: usersV1.EnableUserRequest.status:type_name -> componentsV1.EnableStatus - 0, // 5: usersV1.Users.ListUsers:input_type -> usersV1.ListUsersRequest - 2, // 6: usersV1.Users.CreateUser:input_type -> usersV1.CreateUserRequest - 3, // 7: usersV1.Users.UpdateUser:input_type -> usersV1.UpdateUserRequest - 4, // 8: usersV1.Users.GetUser:input_type -> usersV1.GetUserRequest - 5, // 9: usersV1.Users.DeleteUser:input_type -> usersV1.DeleteUserRequest - 6, // 10: usersV1.Users.UploadProfile:input_type -> usersV1.UploadProfileRequest - 8, // 11: usersV1.Users.ResetActivate:input_type -> usersV1.ResetActivateRequest - 9, // 12: usersV1.Users.ResetPassword:input_type -> usersV1.ResetPasswordRequest - 11, // 13: usersV1.Users.Reset2FA:input_type -> usersV1.Reset2FARequest - 12, // 14: usersV1.Users.EnableUser:input_type -> usersV1.EnableUserRequest - 17, // 15: usersV1.Users.User:input_type -> google.protobuf.Empty - 10, // 16: usersV1.Users.ChangePassword:input_type -> usersV1.ChangePasswordRequest - 13, // 17: usersV1.Users.UpdateCurrentUser:input_type -> usersV1.UpdateCurrentUserRequest - 1, // 18: usersV1.Users.ListUsers:output_type -> usersV1.ListUsersReply - 17, // 19: usersV1.Users.CreateUser:output_type -> google.protobuf.Empty - 17, // 20: usersV1.Users.UpdateUser:output_type -> google.protobuf.Empty - 15, // 21: usersV1.Users.GetUser:output_type -> componentsV1.User - 17, // 22: usersV1.Users.DeleteUser:output_type -> google.protobuf.Empty - 7, // 23: usersV1.Users.UploadProfile:output_type -> usersV1.UploadProfileResponse - 17, // 24: usersV1.Users.ResetActivate:output_type -> google.protobuf.Empty - 17, // 25: usersV1.Users.ResetPassword:output_type -> google.protobuf.Empty - 17, // 26: usersV1.Users.Reset2FA:output_type -> google.protobuf.Empty - 17, // 27: usersV1.Users.EnableUser:output_type -> google.protobuf.Empty - 15, // 28: usersV1.Users.User:output_type -> componentsV1.User - 17, // 29: usersV1.Users.ChangePassword:output_type -> google.protobuf.Empty - 17, // 30: usersV1.Users.UpdateCurrentUser:output_type -> google.protobuf.Empty + 0, // 5: usersV1.User.ListUsers:input_type -> usersV1.ListUsersRequest + 2, // 6: usersV1.User.CreateUser:input_type -> usersV1.CreateUserRequest + 3, // 7: usersV1.User.UpdateUser:input_type -> usersV1.UpdateUserRequest + 4, // 8: usersV1.User.GetUser:input_type -> usersV1.GetUserRequest + 5, // 9: usersV1.User.DeleteUser:input_type -> usersV1.DeleteUserRequest + 6, // 10: usersV1.User.UploadProfile:input_type -> usersV1.UploadProfileRequest + 8, // 11: usersV1.User.ResetActivate:input_type -> usersV1.ResetActivateRequest + 9, // 12: usersV1.User.ResetPassword:input_type -> usersV1.ResetPasswordRequest + 11, // 13: usersV1.User.Reset2FA:input_type -> usersV1.Reset2FARequest + 12, // 14: usersV1.User.EnableUser:input_type -> usersV1.EnableUserRequest + 17, // 15: usersV1.User.User:input_type -> google.protobuf.Empty + 10, // 16: usersV1.User.ChangePassword:input_type -> usersV1.ChangePasswordRequest + 13, // 17: usersV1.User.UpdateCurrentUser:input_type -> usersV1.UpdateCurrentUserRequest + 1, // 18: usersV1.User.ListUsers:output_type -> usersV1.ListUsersReply + 17, // 19: usersV1.User.CreateUser:output_type -> google.protobuf.Empty + 17, // 20: usersV1.User.UpdateUser:output_type -> google.protobuf.Empty + 15, // 21: usersV1.User.GetUser:output_type -> componentsV1.User + 17, // 22: usersV1.User.DeleteUser:output_type -> google.protobuf.Empty + 7, // 23: usersV1.User.UploadProfile:output_type -> usersV1.UploadProfileResponse + 17, // 24: usersV1.User.ResetActivate:output_type -> google.protobuf.Empty + 17, // 25: usersV1.User.ResetPassword:output_type -> google.protobuf.Empty + 17, // 26: usersV1.User.Reset2FA:output_type -> google.protobuf.Empty + 17, // 27: usersV1.User.EnableUser:output_type -> google.protobuf.Empty + 15, // 28: usersV1.User.User:output_type -> componentsV1.User + 17, // 29: usersV1.User.ChangePassword:output_type -> google.protobuf.Empty + 17, // 30: usersV1.User.UpdateCurrentUser:output_type -> google.protobuf.Empty 18, // [18:31] is the sub-list for method output_type 5, // [5:18] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name diff --git a/protoc-gen-go-crud/deliveries/deliveries.go b/protoc-gen-go-crud/deliveries/deliveries.go index 630df93..b9572b6 100644 --- a/protoc-gen-go-crud/deliveries/deliveries.go +++ b/protoc-gen-go-crud/deliveries/deliveries.go @@ -22,10 +22,11 @@ func GenerateDeliveriesFile(gen *protogen.Plugin, file *protogen.File, omitempty filePrefix := strings.Split(file.GeneratedFilenamePrefix, "/") filename := "../internal/" + filePrefix[1] + "/deliveries/" + filePrefix[2] + ".go" + dirname := "../internal/" + filePrefix[1] // 判断文件是否存在 - if _, err := os.Stat(strings.TrimPrefix(filename, "../")); err == nil { - log.Println("文件已存在,跳过生成:", filename) + if _, err := os.Stat(strings.TrimPrefix(dirname, "../")); err == nil { + log.Println("目录已存在,跳过生成:", dirname) return nil } diff --git a/protoc-gen-go-crud/deliveries/wire.go b/protoc-gen-go-crud/deliveries/wire.go index d3bddc8..fe5fdec 100644 --- a/protoc-gen-go-crud/deliveries/wire.go +++ b/protoc-gen-go-crud/deliveries/wire.go @@ -28,10 +28,11 @@ var ProviderSet = wire.NewSet({{ range $index, $element := .FunctionNames }}{{ i f := strings.Split(path, "V1") filename := fmt.Sprintf("./internal/%s/deliveries/wire.go", strings.ToLower(f[0])) + dirname := fmt.Sprintf("./internal/%s", strings.ToLower(f[0])) // 判断文件是否存在 - if _, err := os.Stat(strings.TrimPrefix(filename, "../")); err == nil { - log.Println("文件已存在,跳过生成:", filename) + if _, err := os.Stat(strings.TrimPrefix(dirname, "../")); err == nil { + log.Println("目录已存在,跳过生成:", dirname) return nil } diff --git a/protoc-gen-go-crud/entities/entities.go b/protoc-gen-go-crud/entities/entities.go index 7996579..eed6dfb 100644 --- a/protoc-gen-go-crud/entities/entities.go +++ b/protoc-gen-go-crud/entities/entities.go @@ -22,10 +22,11 @@ func GenerateEntitiesFile(gen *protogen.Plugin, file *protogen.File, omitempty b filePrefix := strings.Split(file.GeneratedFilenamePrefix, "/") filename := "../internal/" + filePrefix[1] + "/entities/" + filePrefix[2] + ".go" + dirname := "../internal/" + filePrefix[1] // 判断文件是否存在 - if _, err := os.Stat(strings.TrimPrefix(filename, "../")); err == nil { - log.Println("文件已存在,跳过生成:", filename) + if _, err := os.Stat(strings.TrimPrefix(dirname, "../")); err == nil { + log.Println("目录已存在,跳过生成:", dirname) return nil } diff --git a/protoc-gen-go-crud/internal/authorization/deliveries/wire.go b/protoc-gen-go-crud/internal/authorization/deliveries/wire.go deleted file mode 100644 index 3f90fca..0000000 --- a/protoc-gen-go-crud/internal/authorization/deliveries/wire.go +++ /dev/null @@ -1,5 +0,0 @@ -package deliveries - -import "github.com/google/wire" - -var ProviderSet = wire.NewSet(NewRoleService, NewAuthService) \ No newline at end of file diff --git a/protoc-gen-go-crud/internal/authorization/repositories/wire.go b/protoc-gen-go-crud/internal/authorization/repositories/wire.go deleted file mode 100644 index 5b90617..0000000 --- a/protoc-gen-go-crud/internal/authorization/repositories/wire.go +++ /dev/null @@ -1,5 +0,0 @@ -package deliveries - -import "github.com/google/wire" - -var ProviderSet = wire.NewSet(NewRoleRepo, NewAuthRepo) \ No newline at end of file diff --git a/protoc-gen-go-crud/internal/authorization/usecase/authorization.go b/protoc-gen-go-crud/internal/authorization/usecase/authorization.go index d2be418..7b9d935 100644 --- a/protoc-gen-go-crud/internal/authorization/usecase/authorization.go +++ b/protoc-gen-go-crud/internal/authorization/usecase/authorization.go @@ -1,6 +1,6 @@ package usecase -type IAuthUsecase interface { +type IAuthUseCase interface { CreateAuth(ctx context.Context, in *authorizationV1.CreateAuthRequest) error UpdateAuth(ctx context.Context, in *authorizationV1.UpdateAuthRequest) error DeleteAuth(ctx context.Context, in *authorizationV1.DeleteAuthRequest) error @@ -12,7 +12,7 @@ type IAuthUsecase interface { type AuthUseCase struct { } -func NewAuthUseCase() IAuthUsecase { +func NewAuthUseCase() IAuthUseCase { return &AuthUseCase{} } diff --git a/protoc-gen-go-crud/internal/authorization/usecase/role.go b/protoc-gen-go-crud/internal/authorization/usecase/role.go index 3773791..6c973a1 100644 --- a/protoc-gen-go-crud/internal/authorization/usecase/role.go +++ b/protoc-gen-go-crud/internal/authorization/usecase/role.go @@ -1,6 +1,6 @@ package usecase -type IRoleUsecase interface { +type IRoleUseCase interface { CreateRole(ctx context.Context, in *authorizationV1.CreateRoleRequest) error UpdateRole(ctx context.Context, in *authorizationV1.UpdateRoleRequest) error DeleteRole(ctx context.Context, in *authorizationV1.DeleteRoleRequest) error @@ -12,7 +12,7 @@ type IRoleUsecase interface { type RoleUseCase struct { } -func NewRoleUseCase() IRoleUsecase { +func NewRoleUseCase() IRoleUseCase { return &RoleUseCase{} } diff --git a/protoc-gen-go-crud/internal/authorization/usecase/wire.go b/protoc-gen-go-crud/internal/authorization/usecase/wire.go deleted file mode 100644 index a1ed56a..0000000 --- a/protoc-gen-go-crud/internal/authorization/usecase/wire.go +++ /dev/null @@ -1,5 +0,0 @@ -package deliveries - -import "github.com/google/wire" - -var ProviderSet = wire.NewSet(NewRoleUseCase, NewAuthUseCase) \ No newline at end of file diff --git a/protoc-gen-go-crud/internal/users/deliveries/users.go b/protoc-gen-go-crud/internal/users/deliveries/users.go index 3b683c3..7707507 100644 --- a/protoc-gen-go-crud/internal/users/deliveries/users.go +++ b/protoc-gen-go-crud/internal/users/deliveries/users.go @@ -5,61 +5,61 @@ import ( empty "github.com/golang/protobuf/ptypes/empty" ) -type UsersService struct { +type UserService struct { } -func (u UsersService) ChangePassword(c *gin.Context, in *usersV1.ChangePasswordRequest) (*empty.Empty, error) { +func (u UserService) ChangePassword(c *gin.Context, in *usersV1.ChangePasswordRequest) (*empty.Empty, error) { panic("todo") } -func (u UsersService) CreateUser(c *gin.Context, in *usersV1.CreateUserRequest) (*empty.Empty, error) { +func (u UserService) CreateUser(c *gin.Context, in *usersV1.CreateUserRequest) (*empty.Empty, error) { panic("todo") } -func (u UsersService) DeleteUser(c *gin.Context, in *usersV1.DeleteUserRequest) (*empty.Empty, error) { +func (u UserService) DeleteUser(c *gin.Context, in *usersV1.DeleteUserRequest) (*empty.Empty, error) { panic("todo") } -func (u UsersService) EnableUser(c *gin.Context, in *usersV1.EnableUserRequest) (*empty.Empty, error) { +func (u UserService) EnableUser(c *gin.Context, in *usersV1.EnableUserRequest) (*empty.Empty, error) { panic("todo") } -func (u UsersService) GetUser(c *gin.Context, in *usersV1.GetUserRequest) (*components.User, error) { +func (u UserService) GetUser(c *gin.Context, in *usersV1.GetUserRequest) (*components.User, error) { panic("todo") } -func (u UsersService) ListUsers(c *gin.Context, in *usersV1.ListUsersRequest) (*usersV1.ListUsersReply, error) { +func (u UserService) ListUsers(c *gin.Context, in *usersV1.ListUsersRequest) (*usersV1.ListUsersReply, error) { panic("todo") } -func (u UsersService) Reset2FA(c *gin.Context, in *usersV1.Reset2FARequest) (*empty.Empty, error) { +func (u UserService) Reset2FA(c *gin.Context, in *usersV1.Reset2FARequest) (*empty.Empty, error) { panic("todo") } -func (u UsersService) ResetActivate(c *gin.Context, in *usersV1.ResetActivateRequest) (*empty.Empty, error) { +func (u UserService) ResetActivate(c *gin.Context, in *usersV1.ResetActivateRequest) (*empty.Empty, error) { panic("todo") } -func (u UsersService) ResetPassword(c *gin.Context, in *usersV1.ResetPasswordRequest) (*empty.Empty, error) { +func (u UserService) ResetPassword(c *gin.Context, in *usersV1.ResetPasswordRequest) (*empty.Empty, error) { panic("todo") } -func (u UsersService) UpdateCurrentUser(c *gin.Context, in *usersV1.UpdateCurrentUserRequest) (*empty.Empty, error) { +func (u UserService) UpdateCurrentUser(c *gin.Context, in *usersV1.UpdateCurrentUserRequest) (*empty.Empty, error) { panic("todo") } -func (u UsersService) UpdateUser(c *gin.Context, in *usersV1.UpdateUserRequest) (*empty.Empty, error) { +func (u UserService) UpdateUser(c *gin.Context, in *usersV1.UpdateUserRequest) (*empty.Empty, error) { panic("todo") } -func (u UsersService) UploadProfile(c *gin.Context, in *usersV1.UploadProfileRequest) (*usersV1.UploadProfileResponse, error) { +func (u UserService) UploadProfile(c *gin.Context, in *usersV1.UploadProfileRequest) (*usersV1.UploadProfileResponse, error) { panic("todo") } -func (u UsersService) User(c *gin.Context, in *empty.Empty) (*components.User, error) { +func (u UserService) User(c *gin.Context, in *empty.Empty) (*components.User, error) { panic("todo") } -func (u UsersService) Log(c *gin.Context) *zap.SugaredLogger { - return global.Logger(c).Named("UsersRepo") +func (u UserService) Log(c *gin.Context) *zap.SugaredLogger { + return global.Logger(c).Named("UserRepo") } diff --git a/protoc-gen-go-crud/internal/users/deliveries/wire.go b/protoc-gen-go-crud/internal/users/deliveries/wire.go deleted file mode 100644 index 6562a36..0000000 --- a/protoc-gen-go-crud/internal/users/deliveries/wire.go +++ /dev/null @@ -1,5 +0,0 @@ -package deliveries - -import "github.com/google/wire" - -var ProviderSet = wire.NewSet(NewUsersService) \ No newline at end of file diff --git a/protoc-gen-go-crud/internal/users/entities/users.go b/protoc-gen-go-crud/internal/users/entities/users.go index 9816246..381f3d4 100644 --- a/protoc-gen-go-crud/internal/users/entities/users.go +++ b/protoc-gen-go-crud/internal/users/entities/users.go @@ -1,7 +1,7 @@ package entities -type Users struct { +type User struct { entity.BaseEntity } -func (u *Users) TableName() string { return "userss" } +func (u *User) TableName() string { return "users" } diff --git a/protoc-gen-go-crud/internal/users/repositories/users.go b/protoc-gen-go-crud/internal/users/repositories/users.go index 880be2c..4733a40 100644 --- a/protoc-gen-go-crud/internal/users/repositories/users.go +++ b/protoc-gen-go-crud/internal/users/repositories/users.go @@ -1,41 +1,41 @@ package repositories -type IUsersRepo interface { - CreateUsers(ctx context.Context, Users *entities.Users) error - UpdateUsers(ctx context.Context, updateFields []string, Users *entities.Users) error - GetUsers(ctx context.Context, id entity.ID) (*entities.Users, error) - GetUserss(ctx context.Context, filter *database.Filter) (res []*entities.User, count int64, err error) - DeleteUsers(ctx context.Context, id entity.ID) error +type IUserRepo interface { + CreateUser(ctx context.Context, User *entities.User) error + UpdateUser(ctx context.Context, updateFields []string, User *entities.User) error + GetUser(ctx context.Context, id entity.ID) (*entities.User, error) + GetUsers(ctx context.Context, filter *database.Filter) (res []*entities.User, count int64, err error) + DeleteUser(ctx context.Context, id entity.ID) error Log(ctx context.Context) *zap.SugaredLogger } -type UsersRepo struct { +type UserRepo struct { } -func (u *UsersRepo) DB(ctx context.Context) *gorm.DB { - return global.DBFromContext(ctx).Model(&entities.Users{}) +func (u *UserRepo) DB(ctx context.Context) *gorm.DB { + return global.DBFromContext(ctx).Model(&entities.User{}) } -func (u UsersRepo) CreateUsers(ctx context.Context, users *entities.Users) error { +func (u UserRepo) CreateUser(ctx context.Context, user *entities.User) error { panic("todo") } -func (u UsersRepo) UpdateUsers(ctx context.Context, updateFields []string, users *entities.Users) error { +func (u UserRepo) UpdateUser(ctx context.Context, updateFields []string, user *entities.User) error { panic("todo") } -func (u UsersRepo) GetUsers(ctx context.Context, id entity.ID) (*entities.Users, error) { +func (u UserRepo) GetUser(ctx context.Context, id entity.ID) (*entities.User, error) { panic("todo") } -func (u UsersRepo) DeleteUsers(ctx context.Context, id entity.ID) error { +func (u UserRepo) DeleteUser(ctx context.Context, id entity.ID) error { panic("todo") } -func (u UsersRepo) GetUserss(ctx context.Context, filter *database.Filter) (res []*entities.Users, count int64, err error) { +func (u UserRepo) GetUsers(ctx context.Context, filter *database.Filter) (res []*entities.User, count int64, err error) { panic("todo") } -func (u UsersRepo) Log(ctx context.Context) *zap.SugaredLogger { - return global.Logger(ctx).Named("UsersRepo") +func (u UserRepo) Log(ctx context.Context) *zap.SugaredLogger { + return global.Logger(ctx).Named("UserRepo") } diff --git a/protoc-gen-go-crud/internal/users/repositories/wire.go b/protoc-gen-go-crud/internal/users/repositories/wire.go deleted file mode 100644 index 0895672..0000000 --- a/protoc-gen-go-crud/internal/users/repositories/wire.go +++ /dev/null @@ -1,5 +0,0 @@ -package deliveries - -import "github.com/google/wire" - -var ProviderSet = wire.NewSet(NewUsersRepo) \ No newline at end of file diff --git a/protoc-gen-go-crud/internal/users/usecase/users.go b/protoc-gen-go-crud/internal/users/usecase/users.go index bae541b..8e6e11a 100644 --- a/protoc-gen-go-crud/internal/users/usecase/users.go +++ b/protoc-gen-go-crud/internal/users/usecase/users.go @@ -1,41 +1,41 @@ package usecase -type IUsersUsecase interface { - CreateUsers(ctx context.Context, in *usersV1.CreateUsersRequest) error - UpdateUsers(ctx context.Context, in *usersV1.UpdateUsersRequest) error - DeleteUsers(ctx context.Context, in *usersV1.DeleteUsersRequest) error - GetUsers(ctx context.Context, in *usersV1.GetUsersRequest) (*entities.Users, error) - ListUsers(ctx context.Context, in *usersV1.ListUsersRequest) ([]*entities.Users, int64, error) +type IUserUseCase interface { + CreateUser(ctx context.Context, in *usersV1.CreateUserRequest) error + UpdateUser(ctx context.Context, in *usersV1.UpdateUserRequest) error + DeleteUser(ctx context.Context, in *usersV1.DeleteUserRequest) error + GetUser(ctx context.Context, in *usersV1.GetUserRequest) (*entities.User, error) + ListUser(ctx context.Context, in *usersV1.ListUserRequest) ([]*entities.User, int64, error) Log(ctx context.Context) *zap.SugaredLogger } -type UsersUseCase struct { +type UserUseCase struct { } -func NewUsersUseCase() IUsersUsecase { - return &UsersUseCase{} +func NewUserUseCase() IUserUseCase { + return &UserUseCase{} } -func (u *UsersUseCase) CreateUsers(ctx context.Context, in *usersV1.CreateUsersRequest) error { +func (u *UserUseCase) CreateUser(ctx context.Context, in *usersV1.CreateUserRequest) error { panic("todo") } -func (u *UsersUseCase) UpdateUsers(ctx context.Context, in *usersV1.UpdateUsersRequest) error { +func (u *UserUseCase) UpdateUser(ctx context.Context, in *usersV1.UpdateUserRequest) error { panic("todo") } -func (u *UsersUseCase) DeleteUsers(ctx context.Context, in *usersV1.DeleteUsersRequest) error { +func (u *UserUseCase) DeleteUser(ctx context.Context, in *usersV1.DeleteUserRequest) error { panic("todo") } -func (u *UsersUseCase) GetUsers(ctx context.Context, in *usersV1.GetUsersRequest) (*entities.Users, error) { +func (u *UserUseCase) GetUser(ctx context.Context, in *usersV1.GetUserRequest) (*entities.User, error) { panic("todo") } -func (u *UsersUseCase) ListUsers(ctx context.Context, in *usersV1.ListUsersRequest) ([]*entities.Users, int64, error) { +func (u *UserUseCase) ListUser(ctx context.Context, in *usersV1.ListUserRequest) ([]*entities.User, int64, error) { panic("todo") } -func (u UsersUseCase) Log(ctx context.Context) *zap.SugaredLogger { - return global.Logger(ctx).Named("UsersRepo") +func (u UserUseCase) Log(ctx context.Context) *zap.SugaredLogger { + return global.Logger(ctx).Named("UserRepo") } diff --git a/protoc-gen-go-crud/internal/users/usecase/wire.go b/protoc-gen-go-crud/internal/users/usecase/wire.go deleted file mode 100644 index e06b65e..0000000 --- a/protoc-gen-go-crud/internal/users/usecase/wire.go +++ /dev/null @@ -1,5 +0,0 @@ -package deliveries - -import "github.com/google/wire" - -var ProviderSet = wire.NewSet(NewUsersUseCase) \ No newline at end of file diff --git a/protoc-gen-go-crud/protoc-gen-go-crud b/protoc-gen-go-crud/protoc-gen-go-crud index c584331..2dade9c 100755 Binary files a/protoc-gen-go-crud/protoc-gen-go-crud and b/protoc-gen-go-crud/protoc-gen-go-crud differ diff --git a/protoc-gen-go-crud/repositories/repositories.go b/protoc-gen-go-crud/repositories/repositories.go index 20a6867..28a71bd 100644 --- a/protoc-gen-go-crud/repositories/repositories.go +++ b/protoc-gen-go-crud/repositories/repositories.go @@ -22,10 +22,11 @@ func GenerateRespositoriesFile(gen *protogen.Plugin, file *protogen.File, omitem filePrefix := strings.Split(file.GeneratedFilenamePrefix, "/") filename := "../internal/" + filePrefix[1] + "/repositories/" + filePrefix[2] + ".go" + dirname := "../internal/" + filePrefix[1] // 判断文件是否存在 - if _, err := os.Stat(strings.TrimPrefix(filename, "../")); err == nil { - log.Println("文件已存在,跳过生成:", filename) + if _, err := os.Stat(strings.TrimPrefix(dirname, "../")); err == nil { + log.Println("目录已存在,跳过生成:", dirname) return nil } diff --git a/protoc-gen-go-crud/repositories/wire.go b/protoc-gen-go-crud/repositories/wire.go index ae23184..bcbbed4 100644 --- a/protoc-gen-go-crud/repositories/wire.go +++ b/protoc-gen-go-crud/repositories/wire.go @@ -28,10 +28,11 @@ var ProviderSet = wire.NewSet({{ range $index, $element := .FunctionNames }}{{ i f := strings.Split(path, "V1") filename := fmt.Sprintf("./internal/%s/repositories/wire.go", strings.ToLower(f[0])) + dirname := fmt.Sprintf("./internal/%s", strings.ToLower(f[0])) // 判断文件是否存在 - if _, err := os.Stat(strings.TrimPrefix(filename, "../")); err == nil { - log.Println("文件已存在,跳过生成:", filename) + if _, err := os.Stat(strings.TrimPrefix(dirname, "../")); err == nil { + log.Println("目录已存在,跳过生成:", dirname) return nil } functions := []string{} diff --git a/protoc-gen-go-crud/usecase/usecase.go b/protoc-gen-go-crud/usecase/usecase.go index 1726b1e..da6d7a9 100644 --- a/protoc-gen-go-crud/usecase/usecase.go +++ b/protoc-gen-go-crud/usecase/usecase.go @@ -22,10 +22,11 @@ func GenerateUseCasesFile(gen *protogen.Plugin, file *protogen.File, omitempty b filePrefix := strings.Split(file.GeneratedFilenamePrefix, "/") filename := "../internal/" + filePrefix[1] + "/usecase/" + filePrefix[2] + ".go" + dirname := "../internal/" + filePrefix[1] // 判断文件是否存在 - if _, err := os.Stat(strings.TrimPrefix(filename, "../")); err == nil { - log.Println("文件已存在,跳过生成:", filename) + if _, err := os.Stat(strings.TrimPrefix(dirname, "../")); err == nil { + log.Println("目录已存在,跳过生成:", dirname) return nil } diff --git a/protoc-gen-go-crud/usecase/wire.go b/protoc-gen-go-crud/usecase/wire.go index 43b9e2d..222f697 100644 --- a/protoc-gen-go-crud/usecase/wire.go +++ b/protoc-gen-go-crud/usecase/wire.go @@ -28,10 +28,11 @@ var ProviderSet = wire.NewSet({{ range $index, $element := .FunctionNames }}{{ i f := strings.Split(path, "V1") filename := fmt.Sprintf("./internal/%s/usecase/wire.go", strings.ToLower(f[0])) + dirname := fmt.Sprintf("./internal/%s", strings.ToLower(f[0])) // 判断文件是否存在 - if _, err := os.Stat(strings.TrimPrefix(filename, "../")); err == nil { - log.Println("文件已存在,跳过生成:", filename) + if _, err := os.Stat(strings.TrimPrefix(dirname, "../")); err == nil { + log.Println("目录已存在,跳过生成:", dirname) return nil }