add handle: addComment;addPackage storage:ListPackage;AddComment;AddPackage

This commit is contained in:
2023-08-10 12:38:55 +03:00
parent bbb9174d8a
commit 92153397a0
22 changed files with 889 additions and 672 deletions

View File

@@ -9,7 +9,8 @@ import "validate/validate.proto";
service DashboardService {
rpc ListPackage(ListPackageReq) returns (ListPackageRsp) {};
rpc UpdateInfo(UpdateInfoPackageRsp) returns (UpdateInfoPackageReq) {};
rpc AddComment(CommentRsp) returns (CommentReq) {};
rpc AddComment(AddCommentRsp) returns (AddCommentReq) {};
rpc AddPackage(AddPackageRsp) returns (AddPackageReq) {};
};
message ErrorRsp {
@@ -66,11 +67,18 @@ message UpdateInfoPackageReq {
uint64 id = 1 [(validate.rules).uint64.gt = 0];
}
message CommentRsp {
message AddCommentRsp {
uint64 idPackage = 1 [(validate.rules).uint64.gt = 0];
string text = 2;
}
message CommentReq {
message AddCommentReq {
uint64 id = 1 [(validate.rules).uint64.gt = 0];
}
}
message AddPackageRsp {
string name = 1 [(validate.rules).string.min_len = 1];
string url = 2 [(validate.rules).string.min_len = 1];
repeated uint64 modules = 3;
}
message AddPackageReq{}

View File

@@ -0,0 +1,71 @@
syntax = "proto3";
package proto;
option go_package = "./go_generate;go_generate";
import "validate/validate.proto";
message ErrorRsp {
Error error = 1 [json_name = "error"];
}
message Error {
string code = 1 [json_name = "code"];
string title = 2 [json_name = "title"];
string uuid = 3 [json_name = "uuid"];
string details = 4 [json_name = "details"];
}
message Package {
uint64 id = 1 [(validate.rules).uint64.gt = 0];
string name = 2 [(validate.rules).string.min_len = 1];
string url = 3 [(validate.rules).string.min_len = 1];
repeated Module modules = 4;
repeated Issue issues = 5;
};
message Module {
uint64 id = 1 [(validate.rules).uint64.gt = 0];
string name = 2 [(validate.rules).string.min_len = 1];
string version = 3 [(validate.rules).string.min_len = 1];
uint64 package = 4 [(validate.rules).uint64.gt = 0];
}
message Issue {
uint64 id = 1 [(validate.rules).uint64.gt = 0];
uint64 status = 2 [(validate.rules).uint64.gt = 0];
string desc = 3 [(validate.rules).string.min_len = 1];
uint64 package = 4 [(validate.rules).uint64.gt = 0];
repeated uint64 modules = 5;
}
message Comment {
uint64 id = 1 [(validate.rules).uint64.gt = 0];
uint64 package = 2 [(validate.rules).uint64.gt = 0];
string text = 3;
uint64 created = 4 [(validate.rules).uint64.gt = 0];
uint64 updated = 5 [(validate.rules).uint64.gt = 0];
}
message ListPackageReq {}
message ListPackageRsp{
repeated Package packages = 1;
}
message UpdateInfoPackageRsp {
uint64 id = 1 [(validate.rules).uint64.gt = 0];
}
message UpdateInfoPackageReq {
uint64 id = 1 [(validate.rules).uint64.gt = 0];
}
message CommentRsp {
uint64 idPackage = 1 [(validate.rules).uint64.gt = 0];
string text = 2;
}
message CommentReq {
uint64 id = 1 [(validate.rules).uint64.gt = 0];
}

View File

@@ -0,0 +1,42 @@
syntax = "proto3";
package proto;
option go_package = "./go_generate;go_generate";
import "dashboard.proto";
import "google/api/annotations.proto";
import "protoc-gen-swagger/options/annotations.proto";
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
info: {
title: "service-platform/product-services/mts-money/gateway-proto",
version: "0";
};
consumes: "application/json";
produces: "application/json";
};
service DashboardService {
rpc ListPackage(ListPackageReq) returns (ListPackageRsp) {
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
operation_id: "ListPackage";
responses: {
key: "default";
value: {
description: "Error response";
schema: {
json_schema: {
ref: ".go_generate.ErrorRsp";
}
}
}
}
};
option (google.api.http) = {
get: "/listPackage";
};
};
rpc UpdateInfo(UpdateInfoPackageRsp) returns (UpdateInfoPackageReq) {};
rpc AddComment(CommentRsp) returns (CommentReq) {};
};

View File

@@ -626,7 +626,7 @@ func (x *UpdateInfoPackageReq) GetId() uint64 {
return 0
}
type CommentRsp struct {
type AddCommentRsp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@@ -635,8 +635,8 @@ type CommentRsp struct {
Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
}
func (x *CommentRsp) Reset() {
*x = CommentRsp{}
func (x *AddCommentRsp) Reset() {
*x = AddCommentRsp{}
if protoimpl.UnsafeEnabled {
mi := &file_dashboard_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -644,13 +644,13 @@ func (x *CommentRsp) Reset() {
}
}
func (x *CommentRsp) String() string {
func (x *AddCommentRsp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CommentRsp) ProtoMessage() {}
func (*AddCommentRsp) ProtoMessage() {}
func (x *CommentRsp) ProtoReflect() protoreflect.Message {
func (x *AddCommentRsp) ProtoReflect() protoreflect.Message {
mi := &file_dashboard_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -662,26 +662,26 @@ func (x *CommentRsp) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use CommentRsp.ProtoReflect.Descriptor instead.
func (*CommentRsp) Descriptor() ([]byte, []int) {
// Deprecated: Use AddCommentRsp.ProtoReflect.Descriptor instead.
func (*AddCommentRsp) Descriptor() ([]byte, []int) {
return file_dashboard_proto_rawDescGZIP(), []int{10}
}
func (x *CommentRsp) GetIdPackage() uint64 {
func (x *AddCommentRsp) GetIdPackage() uint64 {
if x != nil {
return x.IdPackage
}
return 0
}
func (x *CommentRsp) GetText() string {
func (x *AddCommentRsp) GetText() string {
if x != nil {
return x.Text
}
return ""
}
type CommentReq struct {
type AddCommentReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@@ -689,8 +689,8 @@ type CommentReq struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *CommentReq) Reset() {
*x = CommentReq{}
func (x *AddCommentReq) Reset() {
*x = AddCommentReq{}
if protoimpl.UnsafeEnabled {
mi := &file_dashboard_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -698,13 +698,13 @@ func (x *CommentReq) Reset() {
}
}
func (x *CommentReq) String() string {
func (x *AddCommentReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CommentReq) ProtoMessage() {}
func (*AddCommentReq) ProtoMessage() {}
func (x *CommentReq) ProtoReflect() protoreflect.Message {
func (x *AddCommentReq) ProtoReflect() protoreflect.Message {
mi := &file_dashboard_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -716,18 +716,119 @@ func (x *CommentReq) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use CommentReq.ProtoReflect.Descriptor instead.
func (*CommentReq) Descriptor() ([]byte, []int) {
// Deprecated: Use AddCommentReq.ProtoReflect.Descriptor instead.
func (*AddCommentReq) Descriptor() ([]byte, []int) {
return file_dashboard_proto_rawDescGZIP(), []int{11}
}
func (x *CommentReq) GetId() uint64 {
func (x *AddCommentReq) GetId() uint64 {
if x != nil {
return x.Id
}
return 0
}
type AddPackageRsp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
Modules []uint64 `protobuf:"varint,3,rep,packed,name=modules,proto3" json:"modules,omitempty"`
}
func (x *AddPackageRsp) Reset() {
*x = AddPackageRsp{}
if protoimpl.UnsafeEnabled {
mi := &file_dashboard_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AddPackageRsp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AddPackageRsp) ProtoMessage() {}
func (x *AddPackageRsp) ProtoReflect() protoreflect.Message {
mi := &file_dashboard_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AddPackageRsp.ProtoReflect.Descriptor instead.
func (*AddPackageRsp) Descriptor() ([]byte, []int) {
return file_dashboard_proto_rawDescGZIP(), []int{12}
}
func (x *AddPackageRsp) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *AddPackageRsp) GetUrl() string {
if x != nil {
return x.Url
}
return ""
}
func (x *AddPackageRsp) GetModules() []uint64 {
if x != nil {
return x.Modules
}
return nil
}
type AddPackageReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *AddPackageReq) Reset() {
*x = AddPackageReq{}
if protoimpl.UnsafeEnabled {
mi := &file_dashboard_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AddPackageReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AddPackageReq) ProtoMessage() {}
func (x *AddPackageReq) ProtoReflect() protoreflect.Message {
mi := &file_dashboard_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AddPackageReq.ProtoReflect.Descriptor instead.
func (*AddPackageReq) Descriptor() ([]byte, []int) {
return file_dashboard_proto_rawDescGZIP(), []int{13}
}
var File_dashboard_proto protoreflect.FileDescriptor
var file_dashboard_proto_rawDesc = []byte{
@@ -793,32 +894,44 @@ var file_dashboard_proto_rawDesc = []byte{
0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2f, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x49, 0x6e, 0x66, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x17,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32,
0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x22, 0x47, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x65,
0x6e, 0x74, 0x52, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x09, 0x69, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61,
0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20,
0x00, 0x52, 0x09, 0x69, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04,
0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74,
0x22, 0x25, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x17,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32,
0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x32, 0xd1, 0x01, 0x0a, 0x10, 0x44, 0x61, 0x73, 0x68,
0x62, 0x6f, 0x61, 0x72, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x0b,
0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52,
0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50,
0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x73, 0x70, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0a, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x61, 0x63, 0x6b,
0x61, 0x67, 0x65, 0x52, 0x73, 0x70, 0x1a, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65,
0x52, 0x65, 0x71, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6d, 0x6d,
0x65, 0x6e, 0x74, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d,
0x65, 0x6e, 0x74, 0x52, 0x73, 0x70, 0x1a, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43,
0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x22, 0x00, 0x42, 0x44, 0x5a, 0x42, 0x67,
0x6f, 0x2e, 0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x75,
0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x64,
0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x5f, 0x67, 0x65, 0x6e,
0x65, 0x72, 0x61, 0x74, 0x65, 0x3b, 0x67, 0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4a, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x43, 0x6f,
0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x09, 0x69, 0x64, 0x50, 0x61,
0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04,
0x32, 0x02, 0x20, 0x00, 0x52, 0x09, 0x69, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12,
0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74,
0x65, 0x78, 0x74, 0x22, 0x28, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e,
0x74, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04,
0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x22, 0x61, 0x0a,
0x0d, 0x41, 0x64, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x73, 0x70, 0x12, 0x1b,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42,
0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x03, 0x75,
0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10,
0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73,
0x22, 0x0f, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65,
0x71, 0x32, 0x93, 0x02, 0x0a, 0x10, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61,
0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69,
0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65,
0x52, 0x73, 0x70, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x73, 0x70,
0x1a, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x22, 0x00, 0x12,
0x3a, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74,
0x52, 0x73, 0x70, 0x1a, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x43,
0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x0a, 0x41,
0x64, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x73, 0x70, 0x1a,
0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61,
0x67, 0x65, 0x52, 0x65, 0x71, 0x22, 0x00, 0x42, 0x44, 0x5a, 0x42, 0x67, 0x6f, 0x2e, 0x75, 0x6e,
0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x75, 0x6e, 0x69, 0x73, 0x74,
0x61, 0x63, 0x6b, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x64, 0x61, 0x73, 0x68, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
0x65, 0x3b, 0x67, 0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -833,7 +946,7 @@ func file_dashboard_proto_rawDescGZIP() []byte {
return file_dashboard_proto_rawDescData
}
var file_dashboard_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_dashboard_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_dashboard_proto_goTypes = []interface{}{
(*ErrorRsp)(nil), // 0: proto.ErrorRsp
(*Error)(nil), // 1: proto.Error
@@ -845,8 +958,10 @@ var file_dashboard_proto_goTypes = []interface{}{
(*ListPackageRsp)(nil), // 7: proto.ListPackageRsp
(*UpdateInfoPackageRsp)(nil), // 8: proto.UpdateInfoPackageRsp
(*UpdateInfoPackageReq)(nil), // 9: proto.UpdateInfoPackageReq
(*CommentRsp)(nil), // 10: proto.CommentRsp
(*CommentReq)(nil), // 11: proto.CommentReq
(*AddCommentRsp)(nil), // 10: proto.AddCommentRsp
(*AddCommentReq)(nil), // 11: proto.AddCommentReq
(*AddPackageRsp)(nil), // 12: proto.AddPackageRsp
(*AddPackageReq)(nil), // 13: proto.AddPackageReq
}
var file_dashboard_proto_depIdxs = []int32{
1, // 0: proto.ErrorRsp.error:type_name -> proto.Error
@@ -855,12 +970,14 @@ var file_dashboard_proto_depIdxs = []int32{
2, // 3: proto.ListPackageRsp.packages:type_name -> proto.Package
6, // 4: proto.DashboardService.ListPackage:input_type -> proto.ListPackageReq
8, // 5: proto.DashboardService.UpdateInfo:input_type -> proto.UpdateInfoPackageRsp
10, // 6: proto.DashboardService.AddComment:input_type -> proto.CommentRsp
7, // 7: proto.DashboardService.ListPackage:output_type -> proto.ListPackageRsp
9, // 8: proto.DashboardService.UpdateInfo:output_type -> proto.UpdateInfoPackageReq
11, // 9: proto.DashboardService.AddComment:output_type -> proto.CommentReq
7, // [7:10] is the sub-list for method output_type
4, // [4:7] is the sub-list for method input_type
10, // 6: proto.DashboardService.AddComment:input_type -> proto.AddCommentRsp
12, // 7: proto.DashboardService.AddPackage:input_type -> proto.AddPackageRsp
7, // 8: proto.DashboardService.ListPackage:output_type -> proto.ListPackageRsp
9, // 9: proto.DashboardService.UpdateInfo:output_type -> proto.UpdateInfoPackageReq
11, // 10: proto.DashboardService.AddComment:output_type -> proto.AddCommentReq
13, // 11: proto.DashboardService.AddPackage:output_type -> proto.AddPackageReq
8, // [8:12] is the sub-list for method output_type
4, // [4:8] 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
@@ -993,7 +1110,7 @@ func file_dashboard_proto_init() {
}
}
file_dashboard_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommentRsp); i {
switch v := v.(*AddCommentRsp); i {
case 0:
return &v.state
case 1:
@@ -1005,7 +1122,31 @@ func file_dashboard_proto_init() {
}
}
file_dashboard_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommentReq); i {
switch v := v.(*AddCommentReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_dashboard_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AddPackageRsp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_dashboard_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AddPackageReq); i {
case 0:
return &v.state
case 1:
@@ -1023,7 +1164,7 @@ func file_dashboard_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_dashboard_proto_rawDesc,
NumEnums: 0,
NumMessages: 12,
NumMessages: 14,
NumExtensions: 0,
NumServices: 1,
},

View File

@@ -1356,22 +1356,22 @@ var _ interface {
ErrorName() string
} = UpdateInfoPackageReqValidationError{}
// Validate checks the field values on CommentRsp with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// Validate checks the field values on AddCommentRsp with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *CommentRsp) Validate() error {
func (m *AddCommentRsp) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CommentRsp with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in CommentRspMultiError, or
// ValidateAll checks the field values on AddCommentRsp with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in AddCommentRspMultiError, or
// nil if none found.
func (m *CommentRsp) ValidateAll() error {
func (m *AddCommentRsp) ValidateAll() error {
return m.validate(true)
}
func (m *CommentRsp) validate(all bool) error {
func (m *AddCommentRsp) validate(all bool) error {
if m == nil {
return nil
}
@@ -1379,7 +1379,7 @@ func (m *CommentRsp) validate(all bool) error {
var errors []error
if m.GetIdPackage() <= 0 {
err := CommentRspValidationError{
err := AddCommentRspValidationError{
field: "IdPackage",
reason: "value must be greater than 0",
}
@@ -1392,18 +1392,19 @@ func (m *CommentRsp) validate(all bool) error {
// no validation rules for Text
if len(errors) > 0 {
return CommentRspMultiError(errors)
return AddCommentRspMultiError(errors)
}
return nil
}
// CommentRspMultiError is an error wrapping multiple validation errors
// returned by CommentRsp.ValidateAll() if the designated constraints aren't met.
type CommentRspMultiError []error
// AddCommentRspMultiError is an error wrapping multiple validation errors
// returned by AddCommentRsp.ValidateAll() if the designated constraints
// aren't met.
type AddCommentRspMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CommentRspMultiError) Error() string {
func (m AddCommentRspMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
@@ -1412,11 +1413,11 @@ func (m CommentRspMultiError) Error() string {
}
// AllErrors returns a list of validation violation errors.
func (m CommentRspMultiError) AllErrors() []error { return m }
func (m AddCommentRspMultiError) AllErrors() []error { return m }
// CommentRspValidationError is the validation error returned by
// CommentRsp.Validate if the designated constraints aren't met.
type CommentRspValidationError struct {
// AddCommentRspValidationError is the validation error returned by
// AddCommentRsp.Validate if the designated constraints aren't met.
type AddCommentRspValidationError struct {
field string
reason string
cause error
@@ -1424,22 +1425,22 @@ type CommentRspValidationError struct {
}
// Field function returns field value.
func (e CommentRspValidationError) Field() string { return e.field }
func (e AddCommentRspValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CommentRspValidationError) Reason() string { return e.reason }
func (e AddCommentRspValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CommentRspValidationError) Cause() error { return e.cause }
func (e AddCommentRspValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CommentRspValidationError) Key() bool { return e.key }
func (e AddCommentRspValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CommentRspValidationError) ErrorName() string { return "CommentRspValidationError" }
func (e AddCommentRspValidationError) ErrorName() string { return "AddCommentRspValidationError" }
// Error satisfies the builtin error interface
func (e CommentRspValidationError) Error() string {
func (e AddCommentRspValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
@@ -1451,14 +1452,14 @@ func (e CommentRspValidationError) Error() string {
}
return fmt.Sprintf(
"invalid %sCommentRsp.%s: %s%s",
"invalid %sAddCommentRsp.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CommentRspValidationError{}
var _ error = AddCommentRspValidationError{}
var _ interface {
Field() string
@@ -1466,24 +1467,24 @@ var _ interface {
Key() bool
Cause() error
ErrorName() string
} = CommentRspValidationError{}
} = AddCommentRspValidationError{}
// Validate checks the field values on CommentReq with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// Validate checks the field values on AddCommentReq with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *CommentReq) Validate() error {
func (m *AddCommentReq) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CommentReq with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in CommentReqMultiError, or
// ValidateAll checks the field values on AddCommentReq with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in AddCommentReqMultiError, or
// nil if none found.
func (m *CommentReq) ValidateAll() error {
func (m *AddCommentReq) ValidateAll() error {
return m.validate(true)
}
func (m *CommentReq) validate(all bool) error {
func (m *AddCommentReq) validate(all bool) error {
if m == nil {
return nil
}
@@ -1491,7 +1492,7 @@ func (m *CommentReq) validate(all bool) error {
var errors []error
if m.GetId() <= 0 {
err := CommentReqValidationError{
err := AddCommentReqValidationError{
field: "Id",
reason: "value must be greater than 0",
}
@@ -1502,18 +1503,19 @@ func (m *CommentReq) validate(all bool) error {
}
if len(errors) > 0 {
return CommentReqMultiError(errors)
return AddCommentReqMultiError(errors)
}
return nil
}
// CommentReqMultiError is an error wrapping multiple validation errors
// returned by CommentReq.ValidateAll() if the designated constraints aren't met.
type CommentReqMultiError []error
// AddCommentReqMultiError is an error wrapping multiple validation errors
// returned by AddCommentReq.ValidateAll() if the designated constraints
// aren't met.
type AddCommentReqMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CommentReqMultiError) Error() string {
func (m AddCommentReqMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
@@ -1522,11 +1524,11 @@ func (m CommentReqMultiError) Error() string {
}
// AllErrors returns a list of validation violation errors.
func (m CommentReqMultiError) AllErrors() []error { return m }
func (m AddCommentReqMultiError) AllErrors() []error { return m }
// CommentReqValidationError is the validation error returned by
// CommentReq.Validate if the designated constraints aren't met.
type CommentReqValidationError struct {
// AddCommentReqValidationError is the validation error returned by
// AddCommentReq.Validate if the designated constraints aren't met.
type AddCommentReqValidationError struct {
field string
reason string
cause error
@@ -1534,22 +1536,22 @@ type CommentReqValidationError struct {
}
// Field function returns field value.
func (e CommentReqValidationError) Field() string { return e.field }
func (e AddCommentReqValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CommentReqValidationError) Reason() string { return e.reason }
func (e AddCommentReqValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CommentReqValidationError) Cause() error { return e.cause }
func (e AddCommentReqValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CommentReqValidationError) Key() bool { return e.key }
func (e AddCommentReqValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CommentReqValidationError) ErrorName() string { return "CommentReqValidationError" }
func (e AddCommentReqValidationError) ErrorName() string { return "AddCommentReqValidationError" }
// Error satisfies the builtin error interface
func (e CommentReqValidationError) Error() string {
func (e AddCommentReqValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
@@ -1561,14 +1563,14 @@ func (e CommentReqValidationError) Error() string {
}
return fmt.Sprintf(
"invalid %sCommentReq.%s: %s%s",
"invalid %sAddCommentReq.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CommentReqValidationError{}
var _ error = AddCommentReqValidationError{}
var _ interface {
Field() string
@@ -1576,4 +1578,226 @@ var _ interface {
Key() bool
Cause() error
ErrorName() string
} = CommentReqValidationError{}
} = AddCommentReqValidationError{}
// Validate checks the field values on AddPackageRsp with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *AddPackageRsp) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on AddPackageRsp with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in AddPackageRspMultiError, or
// nil if none found.
func (m *AddPackageRsp) ValidateAll() error {
return m.validate(true)
}
func (m *AddPackageRsp) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if utf8.RuneCountInString(m.GetName()) < 1 {
err := AddPackageRspValidationError{
field: "Name",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetUrl()) < 1 {
err := AddPackageRspValidationError{
field: "Url",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return AddPackageRspMultiError(errors)
}
return nil
}
// AddPackageRspMultiError is an error wrapping multiple validation errors
// returned by AddPackageRsp.ValidateAll() if the designated constraints
// aren't met.
type AddPackageRspMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AddPackageRspMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AddPackageRspMultiError) AllErrors() []error { return m }
// AddPackageRspValidationError is the validation error returned by
// AddPackageRsp.Validate if the designated constraints aren't met.
type AddPackageRspValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AddPackageRspValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AddPackageRspValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AddPackageRspValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AddPackageRspValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AddPackageRspValidationError) ErrorName() string { return "AddPackageRspValidationError" }
// Error satisfies the builtin error interface
func (e AddPackageRspValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAddPackageRsp.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AddPackageRspValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AddPackageRspValidationError{}
// Validate checks the field values on AddPackageReq with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *AddPackageReq) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on AddPackageReq with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in AddPackageReqMultiError, or
// nil if none found.
func (m *AddPackageReq) ValidateAll() error {
return m.validate(true)
}
func (m *AddPackageReq) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(errors) > 0 {
return AddPackageReqMultiError(errors)
}
return nil
}
// AddPackageReqMultiError is an error wrapping multiple validation errors
// returned by AddPackageReq.ValidateAll() if the designated constraints
// aren't met.
type AddPackageReqMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AddPackageReqMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AddPackageReqMultiError) AllErrors() []error { return m }
// AddPackageReqValidationError is the validation error returned by
// AddPackageReq.Validate if the designated constraints aren't met.
type AddPackageReqValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AddPackageReqValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AddPackageReqValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AddPackageReqValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AddPackageReqValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AddPackageReqValidationError) ErrorName() string { return "AddPackageReqValidationError" }
// Error satisfies the builtin error interface
func (e AddPackageReqValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sAddPackageReq.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AddPackageReqValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AddPackageReqValidationError{}

View File

@@ -23,11 +23,13 @@ var (
type DashboardServiceClient interface {
ListPackage(ctx context.Context, req *go_generate.ListPackageReq, opts ...client.CallOption) (*go_generate.ListPackageRsp, error)
UpdateInfo(ctx context.Context, req *go_generate.UpdateInfoPackageRsp, opts ...client.CallOption) (*go_generate.UpdateInfoPackageReq, error)
AddComment(ctx context.Context, req *go_generate.CommentRsp, opts ...client.CallOption) (*go_generate.CommentReq, error)
AddComment(ctx context.Context, req *go_generate.AddCommentRsp, opts ...client.CallOption) (*go_generate.AddCommentReq, error)
AddPackage(ctx context.Context, req *go_generate.AddPackageRsp, opts ...client.CallOption) (*go_generate.AddPackageReq, error)
}
type DashboardServiceServer interface {
ListPackage(ctx context.Context, req *go_generate.ListPackageReq, rsp *go_generate.ListPackageRsp) error
UpdateInfo(ctx context.Context, req *go_generate.UpdateInfoPackageRsp, rsp *go_generate.UpdateInfoPackageReq) error
AddComment(ctx context.Context, req *go_generate.CommentRsp, rsp *go_generate.CommentReq) error
AddComment(ctx context.Context, req *go_generate.AddCommentRsp, rsp *go_generate.AddCommentReq) error
AddPackage(ctx context.Context, req *go_generate.AddPackageRsp, rsp *go_generate.AddPackageReq) error
}

View File

@@ -40,8 +40,8 @@ func (c *dashboardServiceClient) UpdateInfo(ctx context.Context, req *go_generat
return rsp, nil
}
func (c *dashboardServiceClient) AddComment(ctx context.Context, req *go_generate.CommentRsp, opts ...client.CallOption) (*go_generate.CommentReq, error) {
rsp := &go_generate.CommentReq{}
func (c *dashboardServiceClient) AddComment(ctx context.Context, req *go_generate.AddCommentRsp, opts ...client.CallOption) (*go_generate.AddCommentReq, error) {
rsp := &go_generate.AddCommentReq{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "DashboardService.AddComment", req), rsp, opts...)
if err != nil {
return nil, err
@@ -49,6 +49,15 @@ func (c *dashboardServiceClient) AddComment(ctx context.Context, req *go_generat
return rsp, nil
}
func (c *dashboardServiceClient) AddPackage(ctx context.Context, req *go_generate.AddPackageRsp, opts ...client.CallOption) (*go_generate.AddPackageReq, error) {
rsp := &go_generate.AddPackageReq{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "DashboardService.AddPackage", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
type dashboardServiceServer struct {
DashboardServiceServer
}
@@ -61,15 +70,20 @@ func (h *dashboardServiceServer) UpdateInfo(ctx context.Context, req *go_generat
return h.DashboardServiceServer.UpdateInfo(ctx, req, rsp)
}
func (h *dashboardServiceServer) AddComment(ctx context.Context, req *go_generate.CommentRsp, rsp *go_generate.CommentReq) error {
func (h *dashboardServiceServer) AddComment(ctx context.Context, req *go_generate.AddCommentRsp, rsp *go_generate.AddCommentReq) error {
return h.DashboardServiceServer.AddComment(ctx, req, rsp)
}
func (h *dashboardServiceServer) AddPackage(ctx context.Context, req *go_generate.AddPackageRsp, rsp *go_generate.AddPackageReq) error {
return h.DashboardServiceServer.AddPackage(ctx, req, rsp)
}
func RegisterDashboardServiceServer(s server.Server, sh DashboardServiceServer, opts ...server.HandlerOption) error {
type dashboardService interface {
ListPackage(ctx context.Context, req *go_generate.ListPackageReq, rsp *go_generate.ListPackageRsp) error
UpdateInfo(ctx context.Context, req *go_generate.UpdateInfoPackageRsp, rsp *go_generate.UpdateInfoPackageReq) error
AddComment(ctx context.Context, req *go_generate.CommentRsp, rsp *go_generate.CommentReq) error
AddComment(ctx context.Context, req *go_generate.AddCommentRsp, rsp *go_generate.AddCommentReq) error
AddPackage(ctx context.Context, req *go_generate.AddPackageRsp, rsp *go_generate.AddPackageReq) error
}
type DashboardService struct {
dashboardService