diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..2ac1d25 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,33 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Package", + "type": "go", + "request": "launch", + "mode": "auto", + "env": { + "GOPATH":"C:\\Users\\lenovo\\go", + "GOOS":"windows" + }, + "program": "${workspaceFolder}\\cmd", + "args":[] + }, + { + "name": "Run app.go", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/cmd/app.go", + "cwd": "${workspaceFolder}/cmd", + "env": { + "DEBUG": "true", + "DUBBO_GO_CONFIG_PATH": "${workspaceFolder}/conf/dubbogo.yaml" + }, + "dlvFlags": ["--check-go-version=false"] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4fe3b60 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,22 @@ +{ + "workbench.colorCustomizations": { + "activityBar.activeBackground": "#fa1b49", + "activityBar.background": "#fa1b49", + "activityBar.foreground": "#e7e7e7", + "activityBar.inactiveForeground": "#e7e7e799", + "activityBarBadge.background": "#155e02", + "activityBarBadge.foreground": "#e7e7e7", + "commandCenter.border": "#e7e7e799", + "sash.hoverBorder": "#fa1b49", + "statusBar.background": "#dd0531", + "statusBar.foreground": "#e7e7e7", + "statusBarItem.hoverBackground": "#fa1b49", + "statusBarItem.remoteBackground": "#dd0531", + "statusBarItem.remoteForeground": "#e7e7e7", + "titleBar.activeBackground": "#dd0531", + "titleBar.activeForeground": "#e7e7e7", + "titleBar.inactiveBackground": "#dd053199", + "titleBar.inactiveForeground": "#e7e7e799" + }, + "peacock.color": "#dd0531" +} \ No newline at end of file diff --git a/api/reports/reports.pb.go b/api/reports/reports.pb.go new file mode 100644 index 0000000..9091ef7 --- /dev/null +++ b/api/reports/reports.pb.go @@ -0,0 +1,1320 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v5.26.0 +// source: api/reports/reports.proto + +package reports + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Filtrate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FileName string `protobuf:"bytes,3,opt,name=fileName,proto3" json:"fileName"` //文件名称 + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status"` //状态(1:上架,2:下架) +} + +func (x *Filtrate) Reset() { + *x = Filtrate{} + if protoimpl.UnsafeEnabled { + mi := &file_api_reports_reports_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Filtrate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Filtrate) ProtoMessage() {} + +func (x *Filtrate) ProtoReflect() protoreflect.Message { + mi := &file_api_reports_reports_proto_msgTypes[0] + 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 Filtrate.ProtoReflect.Descriptor instead. +func (*Filtrate) Descriptor() ([]byte, []int) { + return file_api_reports_reports_proto_rawDescGZIP(), []int{0} +} + +func (x *Filtrate) GetFileName() string { + if x != nil { + return x.FileName + } + return "" +} + +func (x *Filtrate) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +// ==================================年度报告====================================== +type GetAnnualReportListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize"` + Filtrate *Filtrate `protobuf:"bytes,3,opt,name=filtrate,proto3" json:"filtrate"` +} + +func (x *GetAnnualReportListReq) Reset() { + *x = GetAnnualReportListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_api_reports_reports_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAnnualReportListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAnnualReportListReq) ProtoMessage() {} + +func (x *GetAnnualReportListReq) ProtoReflect() protoreflect.Message { + mi := &file_api_reports_reports_proto_msgTypes[1] + 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 GetAnnualReportListReq.ProtoReflect.Descriptor instead. +func (*GetAnnualReportListReq) Descriptor() ([]byte, []int) { + return file_api_reports_reports_proto_rawDescGZIP(), []int{1} +} + +func (x *GetAnnualReportListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetAnnualReportListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *GetAnnualReportListReq) GetFiltrate() *Filtrate { + if x != nil { + return x.Filtrate + } + return nil +} + +type GetAnnualReportListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg"` + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page"` + PageSize int32 `protobuf:"varint,3,opt,name=pageSize,proto3" json:"pageSize"` + Total int32 `protobuf:"varint,4,opt,name=total,proto3" json:"total"` + Data []*AnnualReport `protobuf:"bytes,5,rep,name=data,proto3" json:"data"` +} + +func (x *GetAnnualReportListResp) Reset() { + *x = GetAnnualReportListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_api_reports_reports_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAnnualReportListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAnnualReportListResp) ProtoMessage() {} + +func (x *GetAnnualReportListResp) ProtoReflect() protoreflect.Message { + mi := &file_api_reports_reports_proto_msgTypes[2] + 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 GetAnnualReportListResp.ProtoReflect.Descriptor instead. +func (*GetAnnualReportListResp) Descriptor() ([]byte, []int) { + return file_api_reports_reports_proto_rawDescGZIP(), []int{2} +} + +func (x *GetAnnualReportListResp) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +func (x *GetAnnualReportListResp) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetAnnualReportListResp) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *GetAnnualReportListResp) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *GetAnnualReportListResp) GetData() []*AnnualReport { + if x != nil { + return x.Data + } + return nil +} + +type AnnualReport struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` //id + FileName string `protobuf:"bytes,2,opt,name=fileName,proto3" json:"fileName"` //文件名称 + Date string `protobuf:"bytes,3,opt,name=date,proto3" json:"date"` //日期 + FileUrl string `protobuf:"bytes,4,opt,name=fileUrl,proto3" json:"fileUrl"` //访问地址 + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status"` //状态(1:上架,2:下架) + Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort"` //排序 + UpdateTime string `protobuf:"bytes,7,opt,name=updateTime,proto3" json:"updateTime"` //最近更新时间 + Operator string `protobuf:"bytes,8,opt,name=operator,proto3" json:"operator"` //操作人 + OperatorId int32 `protobuf:"varint,9,opt,name=operatorId,proto3" json:"operatorId"` //操作人Id +} + +func (x *AnnualReport) Reset() { + *x = AnnualReport{} + if protoimpl.UnsafeEnabled { + mi := &file_api_reports_reports_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnnualReport) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnnualReport) ProtoMessage() {} + +func (x *AnnualReport) ProtoReflect() protoreflect.Message { + mi := &file_api_reports_reports_proto_msgTypes[3] + 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 AnnualReport.ProtoReflect.Descriptor instead. +func (*AnnualReport) Descriptor() ([]byte, []int) { + return file_api_reports_reports_proto_rawDescGZIP(), []int{3} +} + +func (x *AnnualReport) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AnnualReport) GetFileName() string { + if x != nil { + return x.FileName + } + return "" +} + +func (x *AnnualReport) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +func (x *AnnualReport) GetFileUrl() string { + if x != nil { + return x.FileUrl + } + return "" +} + +func (x *AnnualReport) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *AnnualReport) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *AnnualReport) GetUpdateTime() string { + if x != nil { + return x.UpdateTime + } + return "" +} + +func (x *AnnualReport) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *AnnualReport) GetOperatorId() int32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +type AddAnnualReportReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FileName string `protobuf:"bytes,1,opt,name=fileName,proto3" json:"fileName"` //文件名称 + Date string `protobuf:"bytes,2,opt,name=date,proto3" json:"date"` //日期 + FileUrl string `protobuf:"bytes,3,opt,name=fileUrl,proto3" json:"fileUrl"` //访问地址 + Operator string `protobuf:"bytes,4,opt,name=operator,proto3" json:"operator"` //操作人 + OperatorId int32 `protobuf:"varint,5,opt,name=operatorId,proto3" json:"operatorId"` //操作人Id +} + +func (x *AddAnnualReportReq) Reset() { + *x = AddAnnualReportReq{} + if protoimpl.UnsafeEnabled { + mi := &file_api_reports_reports_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddAnnualReportReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddAnnualReportReq) ProtoMessage() {} + +func (x *AddAnnualReportReq) ProtoReflect() protoreflect.Message { + mi := &file_api_reports_reports_proto_msgTypes[4] + 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 AddAnnualReportReq.ProtoReflect.Descriptor instead. +func (*AddAnnualReportReq) Descriptor() ([]byte, []int) { + return file_api_reports_reports_proto_rawDescGZIP(), []int{4} +} + +func (x *AddAnnualReportReq) GetFileName() string { + if x != nil { + return x.FileName + } + return "" +} + +func (x *AddAnnualReportReq) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +func (x *AddAnnualReportReq) GetFileUrl() string { + if x != nil { + return x.FileUrl + } + return "" +} + +func (x *AddAnnualReportReq) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *AddAnnualReportReq) GetOperatorId() int32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +type AddAnnualReportResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg"` +} + +func (x *AddAnnualReportResp) Reset() { + *x = AddAnnualReportResp{} + if protoimpl.UnsafeEnabled { + mi := &file_api_reports_reports_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddAnnualReportResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddAnnualReportResp) ProtoMessage() {} + +func (x *AddAnnualReportResp) ProtoReflect() protoreflect.Message { + mi := &file_api_reports_reports_proto_msgTypes[5] + 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 AddAnnualReportResp.ProtoReflect.Descriptor instead. +func (*AddAnnualReportResp) Descriptor() ([]byte, []int) { + return file_api_reports_reports_proto_rawDescGZIP(), []int{5} +} + +func (x *AddAnnualReportResp) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +type EditAnnualReportReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` //id + FileName string `protobuf:"bytes,2,opt,name=fileName,proto3" json:"fileName"` //文件名称 + Date string `protobuf:"bytes,3,opt,name=date,proto3" json:"date"` //日期 + FileUrl string `protobuf:"bytes,4,opt,name=fileUrl,proto3" json:"fileUrl"` //访问地址 + Sort int32 `protobuf:"varint,5,opt,name=sort,proto3" json:"sort"` //排序 + Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status"` //状态(1:上架,2:下架) + Operator string `protobuf:"bytes,7,opt,name=operator,proto3" json:"operator"` //操作人 + OperatorId int32 `protobuf:"varint,8,opt,name=operatorId,proto3" json:"operatorId"` //操作人Id +} + +func (x *EditAnnualReportReq) Reset() { + *x = EditAnnualReportReq{} + if protoimpl.UnsafeEnabled { + mi := &file_api_reports_reports_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EditAnnualReportReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EditAnnualReportReq) ProtoMessage() {} + +func (x *EditAnnualReportReq) ProtoReflect() protoreflect.Message { + mi := &file_api_reports_reports_proto_msgTypes[6] + 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 EditAnnualReportReq.ProtoReflect.Descriptor instead. +func (*EditAnnualReportReq) Descriptor() ([]byte, []int) { + return file_api_reports_reports_proto_rawDescGZIP(), []int{6} +} + +func (x *EditAnnualReportReq) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *EditAnnualReportReq) GetFileName() string { + if x != nil { + return x.FileName + } + return "" +} + +func (x *EditAnnualReportReq) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +func (x *EditAnnualReportReq) GetFileUrl() string { + if x != nil { + return x.FileUrl + } + return "" +} + +func (x *EditAnnualReportReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *EditAnnualReportReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *EditAnnualReportReq) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *EditAnnualReportReq) GetOperatorId() int32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +type EditAnnualReportResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg"` +} + +func (x *EditAnnualReportResp) Reset() { + *x = EditAnnualReportResp{} + if protoimpl.UnsafeEnabled { + mi := &file_api_reports_reports_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EditAnnualReportResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EditAnnualReportResp) ProtoMessage() {} + +func (x *EditAnnualReportResp) ProtoReflect() protoreflect.Message { + mi := &file_api_reports_reports_proto_msgTypes[7] + 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 EditAnnualReportResp.ProtoReflect.Descriptor instead. +func (*EditAnnualReportResp) Descriptor() ([]byte, []int) { + return file_api_reports_reports_proto_rawDescGZIP(), []int{7} +} + +func (x *EditAnnualReportResp) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +type DeleteAnnualReportReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` +} + +func (x *DeleteAnnualReportReq) Reset() { + *x = DeleteAnnualReportReq{} + if protoimpl.UnsafeEnabled { + mi := &file_api_reports_reports_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteAnnualReportReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAnnualReportReq) ProtoMessage() {} + +func (x *DeleteAnnualReportReq) ProtoReflect() protoreflect.Message { + mi := &file_api_reports_reports_proto_msgTypes[8] + 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 DeleteAnnualReportReq.ProtoReflect.Descriptor instead. +func (*DeleteAnnualReportReq) Descriptor() ([]byte, []int) { + return file_api_reports_reports_proto_rawDescGZIP(), []int{8} +} + +func (x *DeleteAnnualReportReq) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +type DeleteAnnualReportResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg"` +} + +func (x *DeleteAnnualReportResp) Reset() { + *x = DeleteAnnualReportResp{} + if protoimpl.UnsafeEnabled { + mi := &file_api_reports_reports_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteAnnualReportResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAnnualReportResp) ProtoMessage() {} + +func (x *DeleteAnnualReportResp) ProtoReflect() protoreflect.Message { + mi := &file_api_reports_reports_proto_msgTypes[9] + 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 DeleteAnnualReportResp.ProtoReflect.Descriptor instead. +func (*DeleteAnnualReportResp) Descriptor() ([]byte, []int) { + return file_api_reports_reports_proto_rawDescGZIP(), []int{9} +} + +func (x *DeleteAnnualReportResp) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +// ==================================季度报告====================================== +type GetQuarterlyReportListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize"` + Filtrate *Filtrate `protobuf:"bytes,3,opt,name=filtrate,proto3" json:"filtrate"` +} + +func (x *GetQuarterlyReportListReq) Reset() { + *x = GetQuarterlyReportListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_api_reports_reports_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetQuarterlyReportListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetQuarterlyReportListReq) ProtoMessage() {} + +func (x *GetQuarterlyReportListReq) ProtoReflect() protoreflect.Message { + mi := &file_api_reports_reports_proto_msgTypes[10] + 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 GetQuarterlyReportListReq.ProtoReflect.Descriptor instead. +func (*GetQuarterlyReportListReq) Descriptor() ([]byte, []int) { + return file_api_reports_reports_proto_rawDescGZIP(), []int{10} +} + +func (x *GetQuarterlyReportListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetQuarterlyReportListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *GetQuarterlyReportListReq) GetFiltrate() *Filtrate { + if x != nil { + return x.Filtrate + } + return nil +} + +type GetQuarterlyReportListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg"` + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page"` + PageSize int32 `protobuf:"varint,3,opt,name=pageSize,proto3" json:"pageSize"` + Total int32 `protobuf:"varint,4,opt,name=total,proto3" json:"total"` + Data []*QuarterlyReport `protobuf:"bytes,5,rep,name=data,proto3" json:"data"` +} + +func (x *GetQuarterlyReportListResp) Reset() { + *x = GetQuarterlyReportListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_api_reports_reports_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetQuarterlyReportListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetQuarterlyReportListResp) ProtoMessage() {} + +func (x *GetQuarterlyReportListResp) ProtoReflect() protoreflect.Message { + mi := &file_api_reports_reports_proto_msgTypes[11] + 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 GetQuarterlyReportListResp.ProtoReflect.Descriptor instead. +func (*GetQuarterlyReportListResp) Descriptor() ([]byte, []int) { + return file_api_reports_reports_proto_rawDescGZIP(), []int{11} +} + +func (x *GetQuarterlyReportListResp) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +func (x *GetQuarterlyReportListResp) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetQuarterlyReportListResp) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *GetQuarterlyReportListResp) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *GetQuarterlyReportListResp) GetData() []*QuarterlyReport { + if x != nil { + return x.Data + } + return nil +} + +type QuarterlyReport struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` //id + FileName string `protobuf:"bytes,2,opt,name=fileName,proto3" json:"fileName"` //文件名称 + FileIntroduce string `protobuf:"bytes,3,opt,name=fileIntroduce,proto3" json:"fileIntroduce"` //文件介绍 + Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort"` //排序 + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status"` //状态(1:上架,2:下架) + UpdateTime string `protobuf:"bytes,6,opt,name=updateTime,proto3" json:"updateTime"` //最近更新时间 + Operator string `protobuf:"bytes,7,opt,name=operator,proto3" json:"operator"` //操作人 + OperatorId int32 `protobuf:"varint,8,opt,name=operatorId,proto3" json:"operatorId"` //操作人Id +} + +func (x *QuarterlyReport) Reset() { + *x = QuarterlyReport{} + if protoimpl.UnsafeEnabled { + mi := &file_api_reports_reports_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuarterlyReport) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuarterlyReport) ProtoMessage() {} + +func (x *QuarterlyReport) ProtoReflect() protoreflect.Message { + mi := &file_api_reports_reports_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 QuarterlyReport.ProtoReflect.Descriptor instead. +func (*QuarterlyReport) Descriptor() ([]byte, []int) { + return file_api_reports_reports_proto_rawDescGZIP(), []int{12} +} + +func (x *QuarterlyReport) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *QuarterlyReport) GetFileName() string { + if x != nil { + return x.FileName + } + return "" +} + +func (x *QuarterlyReport) GetFileIntroduce() string { + if x != nil { + return x.FileIntroduce + } + return "" +} + +func (x *QuarterlyReport) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *QuarterlyReport) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *QuarterlyReport) GetUpdateTime() string { + if x != nil { + return x.UpdateTime + } + return "" +} + +func (x *QuarterlyReport) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *QuarterlyReport) GetOperatorId() int32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +var File_api_reports_reports_proto protoreflect.FileDescriptor + +var file_api_reports_reports_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x72, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x72, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x73, 0x22, 0x3e, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x74, 0x72, 0x61, 0x74, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x22, 0x77, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x6e, 0x75, 0x61, + 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, + 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, + 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x2d, + 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x74, 0x72, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x72, + 0x61, 0x74, 0x65, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x74, 0x72, 0x61, 0x74, 0x65, 0x22, 0x9c, 0x01, + 0x0a, 0x17, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x12, 0x29, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xf0, 0x01, 0x0a, + 0x0c, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x66, 0x69, 0x6c, 0x65, 0x55, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x66, 0x69, 0x6c, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, + 0x6f, 0x72, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, + 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, + 0x9a, 0x01, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x55, 0x72, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x55, 0x72, 0x6c, + 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x27, 0x0a, 0x13, + 0x41, 0x64, 0x64, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0xd7, 0x01, 0x0a, 0x13, 0x45, 0x64, 0x69, 0x74, 0x41, 0x6e, + 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x66, 0x69, 0x6c, 0x65, 0x55, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x66, 0x69, 0x6c, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, + 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, + 0x28, 0x0a, 0x14, 0x45, 0x64, 0x69, 0x74, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x27, 0x0a, 0x15, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, + 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x2a, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x75, + 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, + 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x7a, + 0x0a, 0x19, 0x47, 0x65, 0x74, 0x51, 0x75, 0x61, 0x72, 0x74, 0x65, 0x72, 0x6c, 0x79, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x2d, 0x0a, 0x08, 0x66, + 0x69, 0x6c, 0x74, 0x72, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x72, 0x61, 0x74, 0x65, + 0x52, 0x08, 0x66, 0x69, 0x6c, 0x74, 0x72, 0x61, 0x74, 0x65, 0x22, 0xa2, 0x01, 0x0a, 0x1a, 0x47, + 0x65, 0x74, 0x51, 0x75, 0x61, 0x72, 0x74, 0x65, 0x72, 0x6c, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x12, 0x2c, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e, 0x51, 0x75, 0x61, 0x72, 0x74, 0x65, + 0x72, 0x6c, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, + 0xeb, 0x01, 0x0a, 0x0f, 0x51, 0x75, 0x61, 0x72, 0x74, 0x65, 0x72, 0x6c, 0x79, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x24, 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x6e, 0x74, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, + 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x32, 0xbc, 0x03, + 0x0a, 0x07, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x58, 0x0a, 0x13, 0x47, 0x65, 0x74, + 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x1f, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6e, + 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x71, 0x1a, 0x20, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, + 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x4c, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x4f, 0x0a, 0x10, 0x45, 0x64, 0x69, 0x74, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e, + 0x45, 0x64, 0x69, 0x74, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e, 0x45, 0x64, + 0x69, 0x74, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x55, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x75, + 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1e, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x61, 0x0a, 0x16, 0x47, 0x65, 0x74, + 0x51, 0x75, 0x61, 0x72, 0x74, 0x65, 0x72, 0x6c, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x22, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e, 0x47, 0x65, + 0x74, 0x51, 0x75, 0x61, 0x72, 0x74, 0x65, 0x72, 0x6c, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x73, 0x2e, 0x47, 0x65, 0x74, 0x51, 0x75, 0x61, 0x72, 0x74, 0x65, 0x72, 0x6c, 0x79, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0c, 0x5a, 0x0a, + 0x2e, 0x2f, 0x3b, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_api_reports_reports_proto_rawDescOnce sync.Once + file_api_reports_reports_proto_rawDescData = file_api_reports_reports_proto_rawDesc +) + +func file_api_reports_reports_proto_rawDescGZIP() []byte { + file_api_reports_reports_proto_rawDescOnce.Do(func() { + file_api_reports_reports_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_reports_reports_proto_rawDescData) + }) + return file_api_reports_reports_proto_rawDescData +} + +var file_api_reports_reports_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_api_reports_reports_proto_goTypes = []interface{}{ + (*Filtrate)(nil), // 0: reports.Filtrate + (*GetAnnualReportListReq)(nil), // 1: reports.GetAnnualReportListReq + (*GetAnnualReportListResp)(nil), // 2: reports.GetAnnualReportListResp + (*AnnualReport)(nil), // 3: reports.AnnualReport + (*AddAnnualReportReq)(nil), // 4: reports.AddAnnualReportReq + (*AddAnnualReportResp)(nil), // 5: reports.AddAnnualReportResp + (*EditAnnualReportReq)(nil), // 6: reports.EditAnnualReportReq + (*EditAnnualReportResp)(nil), // 7: reports.EditAnnualReportResp + (*DeleteAnnualReportReq)(nil), // 8: reports.DeleteAnnualReportReq + (*DeleteAnnualReportResp)(nil), // 9: reports.DeleteAnnualReportResp + (*GetQuarterlyReportListReq)(nil), // 10: reports.GetQuarterlyReportListReq + (*GetQuarterlyReportListResp)(nil), // 11: reports.GetQuarterlyReportListResp + (*QuarterlyReport)(nil), // 12: reports.QuarterlyReport +} +var file_api_reports_reports_proto_depIdxs = []int32{ + 0, // 0: reports.GetAnnualReportListReq.filtrate:type_name -> reports.Filtrate + 3, // 1: reports.GetAnnualReportListResp.data:type_name -> reports.AnnualReport + 0, // 2: reports.GetQuarterlyReportListReq.filtrate:type_name -> reports.Filtrate + 12, // 3: reports.GetQuarterlyReportListResp.data:type_name -> reports.QuarterlyReport + 1, // 4: reports.Reports.GetAnnualReportList:input_type -> reports.GetAnnualReportListReq + 4, // 5: reports.Reports.AddAnnualReport:input_type -> reports.AddAnnualReportReq + 6, // 6: reports.Reports.EditAnnualReport:input_type -> reports.EditAnnualReportReq + 8, // 7: reports.Reports.DeleteAnnualReport:input_type -> reports.DeleteAnnualReportReq + 10, // 8: reports.Reports.GetQuarterlyReportList:input_type -> reports.GetQuarterlyReportListReq + 2, // 9: reports.Reports.GetAnnualReportList:output_type -> reports.GetAnnualReportListResp + 5, // 10: reports.Reports.AddAnnualReport:output_type -> reports.AddAnnualReportResp + 7, // 11: reports.Reports.EditAnnualReport:output_type -> reports.EditAnnualReportResp + 9, // 12: reports.Reports.DeleteAnnualReport:output_type -> reports.DeleteAnnualReportResp + 11, // 13: reports.Reports.GetQuarterlyReportList:output_type -> reports.GetQuarterlyReportListResp + 9, // [9:14] is the sub-list for method output_type + 4, // [4:9] 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_api_reports_reports_proto_init() } +func file_api_reports_reports_proto_init() { + if File_api_reports_reports_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_api_reports_reports_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Filtrate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_reports_reports_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAnnualReportListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_reports_reports_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAnnualReportListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_reports_reports_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnnualReport); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_reports_reports_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddAnnualReportReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_reports_reports_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddAnnualReportResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_reports_reports_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EditAnnualReportReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_reports_reports_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EditAnnualReportResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_reports_reports_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAnnualReportReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_reports_reports_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAnnualReportResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_reports_reports_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetQuarterlyReportListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_reports_reports_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetQuarterlyReportListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_reports_reports_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuarterlyReport); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_reports_reports_proto_rawDesc, + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_reports_reports_proto_goTypes, + DependencyIndexes: file_api_reports_reports_proto_depIdxs, + MessageInfos: file_api_reports_reports_proto_msgTypes, + }.Build() + File_api_reports_reports_proto = out.File + file_api_reports_reports_proto_rawDesc = nil + file_api_reports_reports_proto_goTypes = nil + file_api_reports_reports_proto_depIdxs = nil +} diff --git a/api/reports/reports.proto b/api/reports/reports.proto new file mode 100644 index 0000000..a8e3391 --- /dev/null +++ b/api/reports/reports.proto @@ -0,0 +1,109 @@ +syntax = "proto3"; +package reports; +//import "descriptor.proto"; +//import "validator.proto"; + +option go_package = "./;reports"; + +service Reports{ + //==================================年度报告====================================== + rpc GetAnnualReportList(GetAnnualReportListReq) returns (GetAnnualReportListResp); + rpc AddAnnualReport(AddAnnualReportReq) returns (AddAnnualReportResp); + rpc EditAnnualReport(EditAnnualReportReq) returns (EditAnnualReportResp); + rpc DeleteAnnualReport(DeleteAnnualReportReq) returns (DeleteAnnualReportResp); + //==================================季度报告====================================== + rpc GetQuarterlyReportList(GetQuarterlyReportListReq) returns (GetQuarterlyReportListResp); +} + +message Filtrate{ + string fileName = 3;//文件名称 + int32 status = 4;//状态(1:上架,2:下架) +} +//==================================年度报告====================================== +message GetAnnualReportListReq{ + int32 page = 1; + int32 pageSize = 2; + Filtrate filtrate = 3; +} + +message GetAnnualReportListResp{ + string msg = 1; + int32 page=2; + int32 pageSize =3; + int32 total = 4; + repeated AnnualReport data = 5; +} + +message AnnualReport{ + int32 id = 1; //id + string fileName = 2; //文件名称 + string date = 3; //日期 + string fileUrl = 4; //访问地址 + int32 status = 5; //状态(1:上架,2:下架) + int32 sort = 6; //排序 + string updateTime = 7; //最近更新时间 + string operator = 8; //操作人 + int32 operatorId = 9; //操作人Id +} + +message AddAnnualReportReq{ + string fileName = 1; //文件名称 + string date = 2; //日期 + string fileUrl = 3; //访问地址 + string operator = 4; //操作人 + int32 operatorId = 5; //操作人Id +} + +message AddAnnualReportResp{ + string msg = 1; +} + +message EditAnnualReportReq{ + int32 id = 1; //id + string fileName = 2; //文件名称 + string date = 3; //日期 + string fileUrl = 4; //访问地址 + int32 sort = 5; //排序 + int32 status = 6; //状态(1:上架,2:下架) + string operator = 7; //操作人 + int32 operatorId = 8; //操作人Id +} + +message EditAnnualReportResp{ + string msg = 1; +} + +message DeleteAnnualReportReq{ + int32 id = 1; +} + +message DeleteAnnualReportResp{ + string msg = 1; +} + +//==================================季度报告====================================== +message GetQuarterlyReportListReq{ + int32 page = 1; + int32 pageSize = 2; + Filtrate filtrate = 3; +} + +message GetQuarterlyReportListResp{ + string msg = 1; + int32 page=2; + int32 pageSize =3; + int32 total = 4; + repeated QuarterlyReport data = 5; +} + +message QuarterlyReport{ + int32 id = 1; //id + string fileName = 2; //文件名称 + string fileIntroduce = 3; //文件介绍 + int32 sort = 4; //排序 + int32 status = 5; //状态(1:上架,2:下架) + string updateTime = 6; //最近更新时间 + string operator = 7; //操作人 + int32 operatorId = 8; //操作人Id +} + diff --git a/api/reports/reports.validator.pb.go b/api/reports/reports.validator.pb.go new file mode 100644 index 0000000..f0d3e82 --- /dev/null +++ b/api/reports/reports.validator.pb.go @@ -0,0 +1,80 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api/reports/reports.proto + +package reports + +import ( + fmt "fmt" + math "math" + proto "github.com/golang/protobuf/proto" + github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +func (this *Filtrate) Validate() error { + return nil +} +func (this *GetAnnualReportListReq) Validate() error { + if this.Filtrate != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Filtrate); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Filtrate", err) + } + } + return nil +} +func (this *GetAnnualReportListResp) Validate() error { + for _, item := range this.Data { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Data", err) + } + } + } + return nil +} +func (this *AnnualReport) Validate() error { + return nil +} +func (this *AddAnnualReportReq) Validate() error { + return nil +} +func (this *AddAnnualReportResp) Validate() error { + return nil +} +func (this *EditAnnualReportReq) Validate() error { + return nil +} +func (this *EditAnnualReportResp) Validate() error { + return nil +} +func (this *DeleteAnnualReportReq) Validate() error { + return nil +} +func (this *DeleteAnnualReportResp) Validate() error { + return nil +} +func (this *GetQuarterlyReportListReq) Validate() error { + if this.Filtrate != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Filtrate); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Filtrate", err) + } + } + return nil +} +func (this *GetQuarterlyReportListResp) Validate() error { + for _, item := range this.Data { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Data", err) + } + } + } + return nil +} +func (this *QuarterlyReport) Validate() error { + return nil +} diff --git a/api/reports/reports_triple.pb.go b/api/reports/reports_triple.pb.go new file mode 100644 index 0000000..f4466f9 --- /dev/null +++ b/api/reports/reports_triple.pb.go @@ -0,0 +1,331 @@ +// Code generated by protoc-gen-go-triple. DO NOT EDIT. +// versions: +// - protoc-gen-go-triple v1.0.5 +// - protoc v5.26.0 +// source: api/reports/reports.proto + +package reports + +import ( + context "context" + protocol "dubbo.apache.org/dubbo-go/v3/protocol" + dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3" + invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation" + grpc_go "github.com/dubbogo/grpc-go" + codes "github.com/dubbogo/grpc-go/codes" + metadata "github.com/dubbogo/grpc-go/metadata" + status "github.com/dubbogo/grpc-go/status" + common "github.com/dubbogo/triple/pkg/common" + constant "github.com/dubbogo/triple/pkg/common/constant" + triple "github.com/dubbogo/triple/pkg/triple" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc_go.SupportPackageIsVersion7 + +// ReportsClient is the client API for Reports service. +// +// 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 ReportsClient interface { + // ==================================年度报告====================================== + GetAnnualReportList(ctx context.Context, in *GetAnnualReportListReq, opts ...grpc_go.CallOption) (*GetAnnualReportListResp, common.ErrorWithAttachment) + AddAnnualReport(ctx context.Context, in *AddAnnualReportReq, opts ...grpc_go.CallOption) (*AddAnnualReportResp, common.ErrorWithAttachment) + EditAnnualReport(ctx context.Context, in *EditAnnualReportReq, opts ...grpc_go.CallOption) (*EditAnnualReportResp, common.ErrorWithAttachment) + DeleteAnnualReport(ctx context.Context, in *DeleteAnnualReportReq, opts ...grpc_go.CallOption) (*DeleteAnnualReportResp, common.ErrorWithAttachment) + // ==================================季度报告====================================== + GetQuarterlyReportList(ctx context.Context, in *GetQuarterlyReportListReq, opts ...grpc_go.CallOption) (*GetQuarterlyReportListResp, common.ErrorWithAttachment) +} + +type reportsClient struct { + cc *triple.TripleConn +} + +type ReportsClientImpl struct { + GetAnnualReportList func(ctx context.Context, in *GetAnnualReportListReq) (*GetAnnualReportListResp, error) + AddAnnualReport func(ctx context.Context, in *AddAnnualReportReq) (*AddAnnualReportResp, error) + EditAnnualReport func(ctx context.Context, in *EditAnnualReportReq) (*EditAnnualReportResp, error) + DeleteAnnualReport func(ctx context.Context, in *DeleteAnnualReportReq) (*DeleteAnnualReportResp, error) + GetQuarterlyReportList func(ctx context.Context, in *GetQuarterlyReportListReq) (*GetQuarterlyReportListResp, error) +} + +func (c *ReportsClientImpl) GetDubboStub(cc *triple.TripleConn) ReportsClient { + return NewReportsClient(cc) +} + +func (c *ReportsClientImpl) XXX_InterfaceName() string { + return "reports.Reports" +} + +func NewReportsClient(cc *triple.TripleConn) ReportsClient { + return &reportsClient{cc} +} + +func (c *reportsClient) GetAnnualReportList(ctx context.Context, in *GetAnnualReportListReq, opts ...grpc_go.CallOption) (*GetAnnualReportListResp, common.ErrorWithAttachment) { + out := new(GetAnnualReportListResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetAnnualReportList", in, out) +} + +func (c *reportsClient) AddAnnualReport(ctx context.Context, in *AddAnnualReportReq, opts ...grpc_go.CallOption) (*AddAnnualReportResp, common.ErrorWithAttachment) { + out := new(AddAnnualReportResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AddAnnualReport", in, out) +} + +func (c *reportsClient) EditAnnualReport(ctx context.Context, in *EditAnnualReportReq, opts ...grpc_go.CallOption) (*EditAnnualReportResp, common.ErrorWithAttachment) { + out := new(EditAnnualReportResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/EditAnnualReport", in, out) +} + +func (c *reportsClient) DeleteAnnualReport(ctx context.Context, in *DeleteAnnualReportReq, opts ...grpc_go.CallOption) (*DeleteAnnualReportResp, common.ErrorWithAttachment) { + out := new(DeleteAnnualReportResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteAnnualReport", in, out) +} + +func (c *reportsClient) GetQuarterlyReportList(ctx context.Context, in *GetQuarterlyReportListReq, opts ...grpc_go.CallOption) (*GetQuarterlyReportListResp, common.ErrorWithAttachment) { + out := new(GetQuarterlyReportListResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetQuarterlyReportList", in, out) +} + +// ReportsServer is the server API for Reports service. +// All implementations must embed UnimplementedReportsServer +// for forward compatibility +type ReportsServer interface { + // ==================================年度报告====================================== + GetAnnualReportList(context.Context, *GetAnnualReportListReq) (*GetAnnualReportListResp, error) + AddAnnualReport(context.Context, *AddAnnualReportReq) (*AddAnnualReportResp, error) + EditAnnualReport(context.Context, *EditAnnualReportReq) (*EditAnnualReportResp, error) + DeleteAnnualReport(context.Context, *DeleteAnnualReportReq) (*DeleteAnnualReportResp, error) + // ==================================季度报告====================================== + GetQuarterlyReportList(context.Context, *GetQuarterlyReportListReq) (*GetQuarterlyReportListResp, error) + mustEmbedUnimplementedReportsServer() +} + +// UnimplementedReportsServer must be embedded to have forward compatible implementations. +type UnimplementedReportsServer struct { + proxyImpl protocol.Invoker +} + +func (UnimplementedReportsServer) GetAnnualReportList(context.Context, *GetAnnualReportListReq) (*GetAnnualReportListResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAnnualReportList not implemented") +} +func (UnimplementedReportsServer) AddAnnualReport(context.Context, *AddAnnualReportReq) (*AddAnnualReportResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddAnnualReport not implemented") +} +func (UnimplementedReportsServer) EditAnnualReport(context.Context, *EditAnnualReportReq) (*EditAnnualReportResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method EditAnnualReport not implemented") +} +func (UnimplementedReportsServer) DeleteAnnualReport(context.Context, *DeleteAnnualReportReq) (*DeleteAnnualReportResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteAnnualReport not implemented") +} +func (UnimplementedReportsServer) GetQuarterlyReportList(context.Context, *GetQuarterlyReportListReq) (*GetQuarterlyReportListResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetQuarterlyReportList not implemented") +} +func (s *UnimplementedReportsServer) XXX_SetProxyImpl(impl protocol.Invoker) { + s.proxyImpl = impl +} + +func (s *UnimplementedReportsServer) XXX_GetProxyImpl() protocol.Invoker { + return s.proxyImpl +} + +func (s *UnimplementedReportsServer) XXX_ServiceDesc() *grpc_go.ServiceDesc { + return &Reports_ServiceDesc +} +func (s *UnimplementedReportsServer) XXX_InterfaceName() string { + return "reports.Reports" +} + +func (UnimplementedReportsServer) mustEmbedUnimplementedReportsServer() {} + +// UnsafeReportsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ReportsServer will +// result in compilation errors. +type UnsafeReportsServer interface { + mustEmbedUnimplementedReportsServer() +} + +func RegisterReportsServer(s grpc_go.ServiceRegistrar, srv ReportsServer) { + s.RegisterService(&Reports_ServiceDesc, srv) +} + +func _Reports_GetAnnualReportList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAnnualReportListReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("GetAnnualReportList", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Reports_AddAnnualReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(AddAnnualReportReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("AddAnnualReport", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Reports_EditAnnualReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(EditAnnualReportReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("EditAnnualReport", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Reports_DeleteAnnualReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAnnualReportReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("DeleteAnnualReport", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Reports_GetQuarterlyReportList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(GetQuarterlyReportListReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("GetQuarterlyReportList", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +// Reports_ServiceDesc is the grpc_go.ServiceDesc for Reports service. +// It's only intended for direct use with grpc_go.RegisterService, +// and not to be introspected or modified (even as a copy) +var Reports_ServiceDesc = grpc_go.ServiceDesc{ + ServiceName: "reports.Reports", + HandlerType: (*ReportsServer)(nil), + Methods: []grpc_go.MethodDesc{ + { + MethodName: "GetAnnualReportList", + Handler: _Reports_GetAnnualReportList_Handler, + }, + { + MethodName: "AddAnnualReport", + Handler: _Reports_AddAnnualReport_Handler, + }, + { + MethodName: "EditAnnualReport", + Handler: _Reports_EditAnnualReport_Handler, + }, + { + MethodName: "DeleteAnnualReport", + Handler: _Reports_DeleteAnnualReport_Handler, + }, + { + MethodName: "GetQuarterlyReportList", + Handler: _Reports_GetQuarterlyReportList_Handler, + }, + }, + Streams: []grpc_go.StreamDesc{}, + Metadata: "api/reports/reports.proto", +} diff --git a/clear.sh b/clear.sh new file mode 100644 index 0000000..8e483b1 --- /dev/null +++ b/clear.sh @@ -0,0 +1,2 @@ +ls api/reports/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}'; + diff --git a/cmd/app.go b/cmd/app.go index 1bb0184..9c60aa2 100644 --- a/cmd/app.go +++ b/cmd/app.go @@ -21,6 +21,7 @@ func main() { config.SetProviderService(&controller.GovernanceProvider{}) config.SetProviderService(&controller.PressReleasesProvider{}) config.SetProviderService(&controller.SecFilingsProvider{}) + config.SetProviderService(&controller.AnnualReportProvider{}) if err := config.Load(); err != nil { panic(err) diff --git a/internel/controller/annualReports.go b/internel/controller/annualReports.go new file mode 100644 index 0000000..9e08560 --- /dev/null +++ b/internel/controller/annualReports.go @@ -0,0 +1,31 @@ +package controller + +import ( + "context" + "micro-document/api/reports" + "micro-document/internel/logic" +) + +type AnnualReportProvider struct { + reports.UnimplementedReportsServer +} + +// 获取年度报告列表 +func (AnnualReportProvider) List(_ context.Context, req *reports.GetAnnualReportListReq) (resp *reports.GetAnnualReportListResp, err error) { + return logic.AnnualReportsLogic.List(req) +} + +// 新增年度报告 +func (AnnualReportProvider) Add(_ context.Context, req *reports.AddAnnualReportReq) (resp *reports.AddAnnualReportResp, err error) { + return logic.AnnualReportsLogic.Add(req) +} + +// 编辑年度报告 +func (AnnualReportProvider) Edit(_ context.Context, req *reports.EditAnnualReportReq) (resp *reports.EditAnnualReportResp, err error) { + return logic.AnnualReportsLogic.Edit(req) +} + +// 删除年度报告 +func (AnnualReportProvider) Delete(_ context.Context, req *reports.DeleteAnnualReportReq) (resp *reports.DeleteAnnualReportResp, err error) { + return logic.AnnualReportsLogic.Delete(req) +} diff --git a/internel/dao/annualReports.go b/internel/dao/annualReports.go new file mode 100644 index 0000000..2d3b0fb --- /dev/null +++ b/internel/dao/annualReports.go @@ -0,0 +1,71 @@ +package dao + +import ( + "errors" + "micro-document/api/reports" + "micro-document/internel/model" + "micro-document/pkg/db" + "time" +) + +type annualReportsDao struct{} + +var AnnualReportsDao = new(annualReportsDao) + +func (annualReportsDao) List(req *reports.GetAnnualReportListReq) (data []model.AnnualReport, total int64, err error) { + dbQuery := db.DocDB.Model(&model.AnnualReport{}) + if req.Filtrate != nil { + if req.Filtrate.FileName != "" { + dbQuery = dbQuery.Where("file_name LIKE ?", "%"+req.Filtrate.FileName+"%") + } + if req.Filtrate.Status != 0 { + dbQuery = dbQuery.Where("status = ?", req.Filtrate.Status) + } + } + //数据查询 + dbQuery.Count(&total) + err = dbQuery.Scopes(db.Pagination(req.Page, req.PageSize)).Find(&data).Error + if err != nil { + return + } + return +} + +func (annualReportsDao) Add(req *reports.AddAnnualReportReq) (err error) { + err = db.DocDB.Model(&model.AnnualReport{}).Create(&model.AnnualReport{ + FileName: req.FileName, + Date: req.Date, + FileUrl: req.FileUrl, + Operator: req.Operator, + OperatorID: req.OperatorId, + }).Error + if err != nil { + return errors.New("新增年度报告失败") + } + return +} + +func (annualReportsDao) Edit(req *reports.EditAnnualReportReq) (err error) { + err = db.DocDB.Model(&model.AnnualReport{}).Where("id = ?", req.Id).UpdateColumns(&model.AnnualReport{ + FileName: req.FileName, + Date: req.Date, + FileUrl: req.FileUrl, + Status: req.Status, + Sort: req.Sort, + Operator: req.Operator, + OperatorID: req.OperatorId, + UpdatedAt: time.Now(), + }).Error + if err != nil { + return errors.New("编辑年度报告失败") + } + return +} + +func (annualReportsDao) Delete(req *reports.DeleteAnnualReportReq) (err error) { + err = db.DocDB.Model(&model.AnnualReport{}).Where("id = ?", req.Id).Delete(&model.AnnualReport{}).Error + if err != nil { + return errors.New("删除年度报告失败") + } + return +} diff --git a/internel/logic/annualReports.go b/internel/logic/annualReports.go new file mode 100644 index 0000000..1764473 --- /dev/null +++ b/internel/logic/annualReports.go @@ -0,0 +1,60 @@ +package logic + +import ( + "errors" + "micro-document/api/reports" + "micro-document/internel/dao" + util "micro-document/pkg/utils" + + "github.com/jinzhu/copier" +) + +type annualReportsLogic struct{} + +var AnnualReportsLogic = new(annualReportsLogic) + +func (annualReportsLogic) List(req *reports.GetAnnualReportListReq) (result *reports.GetAnnualReportListResp, err error) { + result = &reports.GetAnnualReportListResp{ + Page: req.Page, + PageSize: req.PageSize, + } + data, total, err := dao.AnnualReportsDao.List(req) + if err != nil { + return nil, errors.New("查询年度报告失败") + } + result.Total = int32(total) + if err = copier.CopyWithOption(&result.Data, &data, util.CopierProtoOptions); err != nil { + return nil, errors.New("复制年度报告失败") + } + return result, nil +} + +func (annualReportsLogic) Add(req *reports.AddAnnualReportReq) (result *reports.AddAnnualReportResp, err error) { + result = &reports.AddAnnualReportResp{} + err = dao.AnnualReportsDao.Add(req) + if err != nil { + return nil, errors.New("新增年度报告失败") + } + result.Msg = "新增年度报告成功" + return result, nil +} + +func (annualReportsLogic) Edit(req *reports.EditAnnualReportReq) (result *reports.EditAnnualReportResp, err error) { + result = &reports.EditAnnualReportResp{} + err = dao.AnnualReportsDao.Edit(req) + if err != nil { + return nil, errors.New("编辑年度报告失败") + } + result.Msg = "编辑年度报告成功" + return result, nil +} + +func (annualReportsLogic) Delete(req *reports.DeleteAnnualReportReq) (result *reports.DeleteAnnualReportResp, err error) { + result = &reports.DeleteAnnualReportResp{} + err = dao.AnnualReportsDao.Delete(req) + if err != nil { + return nil, errors.New("删除年度报告失败") + } + result.Msg = "删除年度报告成功" + return result, nil +} diff --git a/internel/model/reports.go b/internel/model/reports.go new file mode 100644 index 0000000..bb34e8a --- /dev/null +++ b/internel/model/reports.go @@ -0,0 +1,25 @@ +package model + +import ( + "time" + + "gorm.io/plugin/soft_delete" +) + +type AnnualReport struct { + ID uint `gorm:"primarykey"` + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt soft_delete.DeletedAt + FileName string `gorm:"column:file_name;type:varchar(100);not null;default:'';comment:文件名称"` + Date string `gorm:"column:date;type:varchar(100);not null;default:'';comment:日期"` + FileUrl string `gorm:"column:file_url;type:varchar(100);not null;default:'';comment:访问地址"` + Status int32 `gorm:"column:status;type:int;not null;default:2;comment:状态:1上架 2 下架"` + Sort int32 `gorm:"column:sort;type:int;not null;default:1;comment:排序"` + Operator string `gorm:"column:operator;type:varchar(100);not null;default:'';comment:操作人"` + OperatorID int32 `gorm:"column:operator_id;comment:操作人Id"` +} + +func (*AnnualReport) TableName() string { + return "annual_report" +} diff --git a/pkg/db/db.go b/pkg/db/db.go index ecdf36d..68144db 100644 --- a/pkg/db/db.go +++ b/pkg/db/db.go @@ -35,6 +35,11 @@ func DbInit() { } DocDB = dbq.Debug() DocDB.Set("gorm:table_options", "ENGINE=InnoDB default charset=utf8") - DocDB.AutoMigrate(&model.Governance{}, &model.PressReleases{}, &model.SecFilings{}, &model.FormType{}) + DocDB.AutoMigrate( + &model.Governance{}, + &model.PressReleases{}, + &model.SecFilings{}, + &model.FormType{}, + &model.AnnualReport{}) } } diff --git a/pkg/db/dto.go b/pkg/db/dto.go new file mode 100644 index 0000000..ed11f20 --- /dev/null +++ b/pkg/db/dto.go @@ -0,0 +1,13 @@ +package db + +import "gorm.io/gorm" + +func Pagination[T int | int32 | int64](page T, pageSize T) func(db *gorm.DB) *gorm.DB { + if page == 0 || pageSize == 0 { + page = 1 + pageSize = 15 + } + return func(db *gorm.DB) *gorm.DB { + return db.Limit(int(pageSize)).Offset(int((page - 1) * pageSize)) + } +} diff --git a/pkg/utils/copierOptions.go b/pkg/utils/copierOptions.go new file mode 100644 index 0000000..d496f79 --- /dev/null +++ b/pkg/utils/copierOptions.go @@ -0,0 +1,40 @@ +package util + +import ( + "errors" + "time" + + "micro-document/pkg/utils/stime" + + "github.com/jinzhu/copier" +) + +var CopierProtoOptions = copier.Option{ + IgnoreEmpty: true, + DeepCopy: true, + Converters: []copier.TypeConverter{ + { + SrcType: time.Time{}, + DstType: copier.String, + Fn: func(src interface{}) (interface{}, error) { + s, ok := src.(time.Time) + if !ok { + return nil, errors.New("src type :time.Time not matching") + } + return s.Format(stime.Format_Normal_YMDhms), nil + }, + }, + { + SrcType: copier.String, + DstType: time.Time{}, + Fn: func(src interface{}) (interface{}, error) { + s, ok := src.(string) + if !ok { + return nil, errors.New("src type :time.Time not matching") + } + tt, err := stime.StringToTimeWithFormat(s, stime.Format_Normal_YMDhms) + return *tt, err + }, + }, + }, +} diff --git a/pkg/utils/stime/common.go b/pkg/utils/stime/common.go new file mode 100644 index 0000000..698236e --- /dev/null +++ b/pkg/utils/stime/common.go @@ -0,0 +1,84 @@ +package stime + +import ( + "time" +) + +var Loc loc + +type loc time.Location + +func (l loc) Shanghai() *time.Location { + var shanghai, err = time.LoadLocation("Asia/Shanghai") + if err != nil { + shanghai = time.FixedZone("CST", 8*3600) + } + return shanghai +} + +const ( + //常规时间格式(日期带横杠) + Format_Normal_YMDhms = "2006-01-02 15:04:05" + Format_Normal_YMD = "2006-01-02" + Format_Normal_hms = "15:04:05" + Format_Normal_hm = "15:04" + Format_Normal_YM = "2006-01" + //带斜杠的时间格式 + Format_Slash_YMDhms = "2006/01/02 15:04:05" + Format_Slash_YMD = "2006/01/02" + //无间隔符 + Format_NoSpacer_YMDhms = "20060102150405" + Format_NoSpacer_YMD = "20060102" + Format_ChinaChar_YMD = "2006年01月02日" + Format_ChinaChar_YMDhm = "2006年01月02日 15时04分" + Format_DB_YMDhms = "2006-01-02T15:04:05+08:00" +) + +var MonthStrMap = map[string]string{ + "January": "01", + "February": "02", + "March": "03", + "April": "04", + "May": "05", + "June": "06", + "July": "07", + "August": "08", + "September": "09", + "October": "10", + "November": "11", + "December": "12", +} +var MonthIntMap = map[string]int{ + "January": 1, + "February": 2, + "March": 3, + "April": 4, + "May": 5, + "June": 6, + "July": 7, + "August": 8, + "September": 9, + "October": 10, + "November": 11, + "December": 12, +} + +var WeekIntMap = map[string]int{ + "Monday": 1, + "Tuesday": 2, + "Wednesday": 3, + "Thursday": 4, + "Friday": 5, + "Saturday": 6, + "Sunday": 7, +} + +var WeekStrMap = map[string]string{ + "Monday": "一", + "Tuesday": "二", + "Wednesday": "三", + "Thursday": "四", + "Friday": "五", + "Saturday": "六", + "Sunday": "日", +} diff --git a/pkg/utils/stime/getTime.go b/pkg/utils/stime/getTime.go new file mode 100644 index 0000000..8430a26 --- /dev/null +++ b/pkg/utils/stime/getTime.go @@ -0,0 +1,150 @@ +package stime + +import ( + "fmt" + "time" +) + +func StrNowDate() string { + return TimeToString(time.Now(), Format_Normal_YMD) +} + +func StrNowYearMonth() string { + return TimeToString(time.Now(), Format_Normal_YM) +} + +// ThisMorming 今天凌晨 +func ThisMorming(format string) (strTime string) { + thisTime := time.Now() + year := thisTime.Year() + month := MonthStrMap[thisTime.Month().String()] + day := fmt.Sprintf("%02d", thisTime.Day()) + strTime = fmt.Sprintf("%v-%v-%v 00:00:00", year, month, day) + if format != Format_Normal_YMDhms { + t1, _ := time.ParseInLocation(Format_Normal_YMDhms, strTime, Loc.Shanghai()) + strTime = t1.Format(format) + } + return strTime +} + +// ThisMorningUnix 获取当日凌晨的时间戳 +func ThisMorningToUnix() int64 { + thist := time.Now() + zero_tm := time.Date(thist.Year(), thist.Month(), thist.Day(), 0, 0, 0, 0, thist.Location()).Unix() + return zero_tm +} + +// TomorrowMorning 第二天凌晨 +func TomorrowMorning(baseTime time.Time) *time.Time { + year := baseTime.Year() + month := MonthStrMap[baseTime.Month().String()] + day := fmt.Sprintf("%02d", baseTime.Day()+1) + strTime := fmt.Sprintf("%v-%v-%v 00:00:00", year, month, day) + res, _ := StringToTime(strTime) + return res +} + +// ThisTimeUnix 获取当前时间的时间戳 +func CurrentimeToUnix() int64 { + return time.Now().Unix() +} + +// Currentime 获取当前时间 +func Currentime(format string) (strTime string) { + strTime = time.Now().Format(format) + return +} + +// HoursAgo 若干小时之前的时间 +func HoursAgo(hours time.Duration, format string) (lastTimeStr string) { + lastStamp := time.Now().Unix() - int64((time.Hour * hours).Seconds()) + lastTime := time.Unix(lastStamp, 0).In(Loc.Shanghai()) + lastTimeStr = lastTime.Format(format) + return +} + +// TimeToString 时间转字符串 +func TimeToString(t time.Time, format string) string { + return t.Format(format) +} + +// 计算指定月份的天数 +func YearMonthToDayNumber(year int, month int) int { + // 有31天的月份 + day31 := map[int]bool{ + 1: true, + 3: true, + 5: true, + 7: true, + 8: true, + 10: true, + 12: true, + } + if day31[month] == true { + return 31 + } + // 有30天的月份 + day30 := map[int]bool{ + 4: true, + 6: true, + 9: true, + 11: true, + } + if day30[month] == true { + return 30 + } + // 计算是平年还是闰年 + if (year%4 == 0 && year%100 != 0) || year%400 == 0 { + // 得出2月的天数 + return 29 + } + // 得出2月的天数 + return 28 +} + +// 求时间差(返回一个数字,该数字单位由传过来的unit决定。若unit为60,则单位是分钟。) +func GetDiffTime(start_time string, end_time string, unit int64) int64 { + // 转成时间戳 + if len(start_time) == 10 { + start_time = fmt.Sprintf("%v 00:00:00", start_time) + } + if len(end_time) == 10 { + end_time = fmt.Sprintf("%v 00:00:00", end_time) + } + startUnix, _ := time.ParseInLocation("2006-01-02 15:04:05", start_time, Loc.Shanghai()) + endUnix, _ := time.ParseInLocation("2006-01-02 15:04:05", end_time, Loc.Shanghai()) + startTime := startUnix.Unix() + endTime := endUnix.Unix() + // 求相差天数 + date := (endTime - startTime) / unit + return date +} + +func TimeSince(pastTime string, format string) string { + + t, err := time.Parse(format, pastTime) + if err != nil { + return "" + } + + diff := time.Since(t) + if diff.Minutes() < 15 { + return "刚刚" + } else if diff.Minutes() >= 15 && diff.Minutes() < 30 { + return "15分钟前" + } else if diff.Minutes() >= 30 && diff.Minutes() < 60 { + return "半小时前" + } else if diff.Hours() >= 1 && diff.Hours() < 24 { + return fmt.Sprintf("%d小时前", int(diff.Hours())) + } else if diff.Hours() >= 24 && diff.Hours() < 24*15 { + return fmt.Sprintf("%d天前", int(diff.Hours()/24)) + } else if diff.Hours() < 24*30 { + return "半月前" + } else if diff.Hours() < 24*30*6 { //小于半年 + return fmt.Sprintf("%d月前", int(diff.Hours()/24/30)) + } else if diff.Hours() < 24*365 { //小于1年 + return "半年前" + } else { + return t.Format("2006-01-02 15:04:05") + } +} diff --git a/pkg/utils/stime/getTimeExt.go b/pkg/utils/stime/getTimeExt.go new file mode 100644 index 0000000..166b173 --- /dev/null +++ b/pkg/utils/stime/getTimeExt.go @@ -0,0 +1,101 @@ +package stime + +import ( + "fmt" + "strconv" + "time" +) + +// 根据指定时间获取后面的若干天工作日列表 +// param baseOn 指定基准时间 +// param daysNum 获取工作日的数量 +func GetWorkDayList(baseOn *time.Time, daysNum int) []time.Time { + var timeList []time.Time + var basCount = 1 + var workDay time.Time + for { + if len(timeList) == daysNum { + break + } + workDay = baseOn.AddDate(0, 0, basCount) + switch workDay.Weekday() { + case time.Saturday: + basCount += 2 + continue + case time.Sunday: + basCount++ + continue + default: + timeList = append(timeList, workDay) + basCount++ + } + } + return timeList +} + +// 根据指定时间获取后面的若干天工作日列表 +// param baseOn 指定基准时间 +// param daysNum 获取工作日的数量 +func GetWorkDayStrList(baseOn *time.Time, daysNum int) []string { + var timeList []string + var basCount = 1 + var workDay time.Time + for { + if len(timeList) == daysNum { + break + } + workDay = baseOn.AddDate(0, 0, basCount) + switch workDay.Weekday() { + case time.Saturday: + basCount += 2 + continue + case time.Sunday: + basCount++ + continue + default: + timeList = append(timeList, TimeToString(workDay, Format_Normal_YMD)) + basCount++ + } + } + return timeList +} + +// 获取时间差文字描述 +func GetTimeDifferenceDesc(now *time.Time, before *time.Time) string { + if before == nil { + return "" + } + if now.After(*before) { + subTimestamp := now.Unix() - before.Unix() + day := subTimestamp / (3600 * 24) + hour := (subTimestamp - day*3600*24) / 3600 + minute := (subTimestamp - day*3600*24 - hour*3600) / 60 + second := subTimestamp - day*3600*24 - hour*3600 - minute*60 + + switch { + case day > 0: + if hour > 0 { + return fmt.Sprintf("%d天%d小时", day, hour) + } else { + return fmt.Sprintf("%d天", day) + } + case hour > 0: + if minute < 10 { + return fmt.Sprintf("%d小时", hour) + } else { + return fmt.Sprintf("%d小时%d", hour, minute) + } + case hour == 0 && minute > 0: + return fmt.Sprintf("%d分钟", minute) + case hour == 0 && minute == 0: + return fmt.Sprintf("%d秒", second) + } + } + return "" +} + +// TimeStampToBytes 时间戳转字节 +func TimeStampToBytes(stamp int64) []byte { + timeStr := strconv.FormatInt(stamp, 2) + return []byte(timeStr) +} diff --git a/pkg/utils/stime/getTimeExt_test.go b/pkg/utils/stime/getTimeExt_test.go new file mode 100644 index 0000000..52d4d41 --- /dev/null +++ b/pkg/utils/stime/getTimeExt_test.go @@ -0,0 +1,12 @@ +package stime + +import ( + "testing" + "time" +) + +func TestGetWorkDayStrList(t *testing.T) { + now := time.Now() + result := GetWorkDayStrList(&now, 5) + t.Log(result) +} diff --git a/pkg/utils/stime/timeTranslate.go b/pkg/utils/stime/timeTranslate.go new file mode 100644 index 0000000..4135c30 --- /dev/null +++ b/pkg/utils/stime/timeTranslate.go @@ -0,0 +1,64 @@ +package stime + +import ( + "fmt" + "time" +) + +func GetTimestampMillisecond() int64 { + now := time.Now() + return now.UnixNano() / 1e6 +} + +func StringToTime(strTime string) (*time.Time, error) { + const TIME_LAYOUT = "2006-01-02 15:04:05" //此时间不可更改 + timeobj, err := time.ParseInLocation(TIME_LAYOUT, strTime, Loc.Shanghai()) + return &timeobj, err +} + +func StringToTimeWithFormat(strTime string, timeFormat string) (*time.Time, error) { + timeobj, err := time.ParseInLocation(timeFormat, strTime, Loc.Shanghai()) + return &timeobj, err +} + +// 去除精确时间后面的小数点 +func NowTimeToTime(layout string) *time.Time { + otime := time.Now().Format(layout) //"2006-01-02 15:04:05" and so on + tt, _ := StringToTime(otime) + return tt +} + +// 时间之间的转换 +func TimeStampToString(value interface{}, after_type string) { + switch value.(type) { + case string: + fmt.Println(value.(string)) + case int64: + fmt.Println(value.(int64)) + case int32: + fmt.Println(value.(int32)) + } +} + +func GetAge(birthday time.Time) int { + if birthday.IsZero() { + return 0 + } + now := time.Now() + year, month, day := now.Date() + if year == 0 || month == 0 || day == 0 { + return 0 + } + age := year - birthday.Year() - 1 + //判断年龄 + if birthday.Month() < month || birthday.Month() == month && birthday.Day() <= day { + age++ + } + return age +} +func ParseTimeStamp(unix int64) (result time.Time) { + if unix == 0 { + return + } + return time.Unix(unix, 0) +} diff --git a/pkg/utils/stime/timeTranslate_test.go b/pkg/utils/stime/timeTranslate_test.go new file mode 100644 index 0000000..d78abba --- /dev/null +++ b/pkg/utils/stime/timeTranslate_test.go @@ -0,0 +1,19 @@ +package stime + +import ( + "fmt" + "testing" + "time" +) + +func TestTime(t *testing.T) { + result := NowTimeToTime(Format_Normal_YMDhms) + fmt.Println(result) +} +func TestGetAge(t *testing.T) { + age := GetAge(time.Date(1991, 3, 6, 0, 0, 0, 0, Loc.Shanghai())) + fmt.Println(age) + if age != 31 { + t.Errorf("want 31 but get %v", age) + } +} diff --git a/pkg/utils/stime/week.go b/pkg/utils/stime/week.go new file mode 100644 index 0000000..9952036 --- /dev/null +++ b/pkg/utils/stime/week.go @@ -0,0 +1,47 @@ +package stime + +import "time" + +func NowWeekDay() string { + var weekday = [7]string{"七", "一", "二", "三", "四", "五", "六"} + week := int(time.Now().Weekday()) + return weekday[week] +} + +// 获取按年算的周数 +func GetYearWeek(t *time.Time) int { + yearDay := t.YearDay() + yearFirstDay := t.AddDate(0, 0, -yearDay+1) + firstDayInWeek := int(yearFirstDay.Weekday()) + + //今年第一周有几天 + firstWeekDays := 1 + if firstDayInWeek != 0 { + firstWeekDays = 7 - firstDayInWeek + 1 + } + var week int + if yearDay <= firstWeekDays { + week = 1 + } else { + week = (yearDay-firstWeekDays)/7 + 2 + } + return week +} + +// GetWeekDate 获取基准时间范围最最近的某个星期时间 +// +// param baseOn: 基准时间 +// param weekNum: 中国星期数 1~7 +// return *time.Time +func GetWeekDate(baseOn time.Time, weekNum int) *time.Time { + if baseOn.IsZero() || (weekNum <= 0 || weekNum > 7) { + return nil + } + baseDate := time.Date(baseOn.Year(), baseOn.Month(), baseOn.Day(), 0, 0, 0, 0, Loc.Shanghai()) + var ( + w = int(baseOn.Weekday()) + weekDate time.Time + ) + weekDate = baseDate.AddDate(0, 0, weekNum-w) + return &weekDate +} diff --git a/pkg/utils/stime/week_test.go b/pkg/utils/stime/week_test.go new file mode 100644 index 0000000..c1fdaac --- /dev/null +++ b/pkg/utils/stime/week_test.go @@ -0,0 +1,14 @@ +package stime + +import ( + "testing" + "time" +) + +func TestGetYearWeek(t *testing.T) { + now := time.Now() + t.Log(GetYearWeek(&now)) + var w = int(now.Weekday()) + t.Log(now.AddDate(0, 0, -w+1).Weekday()) + t.Log(now.AddDate(0, 0, 7-w).Weekday()) +} diff --git a/protocReports.bat b/protocReports.bat new file mode 100644 index 0000000..6ee14c5 --- /dev/null +++ b/protocReports.bat @@ -0,0 +1,3 @@ +@echo off +protoc -I . -I ./api/reports --proto_path=./api/reports --go_out=./api/reports --go-triple_out=./api/reports --govalidators_out=./api/reports ./api/reports/reports.proto +.\clear.sh \ No newline at end of file