Pārlūkot izejas kodu

列表程序提交

WH01243 2 gadi atpakaļ
vecāks
revīzija
da6eb6110d

+ 1 - 1
rpc/datasmt/datasmt.go

@@ -1,4 +1,4 @@
-// Code generated by goctl. DO NOT EDIT!
+// Code generated by goctl. DO NOT EDIT.
 // Source: publicservice.proto
 
 package datasmt

+ 2 - 0
rpc/internal/config/config.go

@@ -6,6 +6,8 @@ import (
 	"github.com/zeromicro/go-zero/zrpc"
 )
 
+var C Config
+
 type Config struct {
 	zrpc.RpcServerConf
 	Logx  logx.LogConf

+ 0 - 2
rpc/internal/logic/detaillogic.go

@@ -2,7 +2,6 @@ package logic
 
 import (
 	"context"
-
 	"jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/rpc/internal/svc"
 	"jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/rpc/pb"
 
@@ -26,6 +25,5 @@ func NewDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DetailLogi
 // 详情
 func (l *DetailLogic) Detail(in *pb.DatasmtReqDetail) (*pb.DatasmtRespDetail, error) {
 	// todo: add your logic here and delete this line
-
 	return &pb.DatasmtRespDetail{}, nil
 }

+ 4 - 2
rpc/internal/logic/listlogic.go

@@ -2,6 +2,7 @@ package logic
 
 import (
 	"context"
+	"jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/rpc/service"
 
 	"jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/rpc/internal/svc"
 	"jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/rpc/pb"
@@ -26,6 +27,7 @@ func NewListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListLogic {
 // 列表
 func (l *ListLogic) List(in *pb.DatasmtReqList) (*pb.DatasmtRespList, error) {
 	// todo: add your logic here and delete this line
-
-	return &pb.DatasmtRespList{}, nil
+	var dataSmtService service.DataSmt
+	data := dataSmtService.List(in.SearchValue, in.DataType, in.PageNum, in.PageSize)
+	return data, nil
 }

+ 1 - 1
rpc/internal/server/datasmtserver.go

@@ -1,4 +1,4 @@
-// Code generated by goctl. DO NOT EDIT!
+// Code generated by goctl. DO NOT EDIT.
 // Source: publicservice.proto
 
 package server

+ 64 - 56
rpc/pb/publicservice.pb.go

@@ -98,10 +98,10 @@ type DatasmtRespList struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	List            []*DatasmtList `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`                                              //检索结果
-	PageCount       string         `protobuf:"bytes,2,opt,name=page_count,json=pageCount,proto3" json:"page_count,omitempty"`                   //总条数
-	HotKeys         []string       `protobuf:"bytes,3,rep,name=hot_keys,json=hotKeys,proto3" json:"hot_keys,omitempty"`                         //热搜词
-	FieldIllustrate string         `protobuf:"bytes,4,opt,name=field_illustrate,json=fieldIllustrate,proto3" json:"field_illustrate,omitempty"` //包含字段说明
+	List            []*DatasmtList    `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`                                                                                                                                      //检索结果
+	PageCount       int64             `protobuf:"varint,2,opt,name=page_count,json=pageCount,proto3" json:"page_count,omitempty"`                                                                                                          //总条数
+	HotKeys         []string          `protobuf:"bytes,3,rep,name=hot_keys,json=hotKeys,proto3" json:"hot_keys,omitempty"`                                                                                                                 //热搜词
+	FieldIllustrate map[string]string `protobuf:"bytes,4,rep,name=field_illustrate,json=fieldIllustrate,proto3" json:"field_illustrate,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //包含字段说明
 }
 
 func (x *DatasmtRespList) Reset() {
@@ -143,11 +143,11 @@ func (x *DatasmtRespList) GetList() []*DatasmtList {
 	return nil
 }
 
-func (x *DatasmtRespList) GetPageCount() string {
+func (x *DatasmtRespList) GetPageCount() int64 {
 	if x != nil {
 		return x.PageCount
 	}
-	return ""
+	return 0
 }
 
 func (x *DatasmtRespList) GetHotKeys() []string {
@@ -157,11 +157,11 @@ func (x *DatasmtRespList) GetHotKeys() []string {
 	return nil
 }
 
-func (x *DatasmtRespList) GetFieldIllustrate() string {
+func (x *DatasmtRespList) GetFieldIllustrate() map[string]string {
 	if x != nil {
 		return x.FieldIllustrate
 	}
-	return ""
+	return nil
 }
 
 type DatasmtList struct {
@@ -390,48 +390,54 @@ var file_publicservice_proto_rawDesc = []byte{
 	0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x70, 0x61, 0x67, 0x65,
 	0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65,
 	0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,
-	0x22, 0x98, 0x01, 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6d, 0x74, 0x52, 0x65, 0x73, 0x70,
+	0x22, 0x83, 0x02, 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6d, 0x74, 0x52, 0x65, 0x73, 0x70,
 	0x4c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03,
 	0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6d, 0x74, 0x4c, 0x69, 0x73, 0x74,
 	0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x63,
-	0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65,
+	0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65,
 	0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x6f, 0x74, 0x5f, 0x6b, 0x65, 0x79,
 	0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x68, 0x6f, 0x74, 0x4b, 0x65, 0x79, 0x73,
-	0x12, 0x29, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x69, 0x6c, 0x6c, 0x75, 0x73, 0x74,
-	0x72, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c,
-	0x64, 0x49, 0x6c, 0x6c, 0x75, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x22, 0x89, 0x01, 0x0a, 0x0b,
-	0x44, 0x61, 0x74, 0x61, 0x73, 0x6d, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69,
-	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e,
-	0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
-	0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06,
-	0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f,
-	0x72, 0x6d, 0x61, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x73, 0x74,
-	0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x65, 0x61,
-	0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x22, 0x0a, 0x10, 0x44, 0x61, 0x74, 0x61, 0x73,
-	0x6d, 0x74, 0x52, 0x65, 0x71, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69,
-	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xcd, 0x01, 0x0a, 0x11,
-	0x44, 0x61, 0x74, 0x61, 0x73, 0x6d, 0x74, 0x52, 0x65, 0x73, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69,
-	0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79,
-	0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79,
-	0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c,
-	0x65, 0x61, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x0b, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, 0x0a,
-	0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x69, 0x6c, 0x6c, 0x75, 0x73, 0x74, 0x72, 0x61, 0x74,
-	0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6c,
-	0x6c, 0x75, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61,
-	0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
-	0x64, 0x61, 0x74, 0x61, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x32, 0x65, 0x0a, 0x07, 0x64,
-	0x61, 0x74, 0x61, 0x73, 0x6d, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0f,
-	0x2e, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6d, 0x74, 0x52, 0x65, 0x71, 0x4c, 0x69, 0x73, 0x74, 0x1a,
-	0x10, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6d, 0x74, 0x52, 0x65, 0x73, 0x70, 0x4c, 0x69, 0x73,
-	0x74, 0x12, 0x2f, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x11, 0x2e, 0x44, 0x61,
-	0x74, 0x61, 0x73, 0x6d, 0x74, 0x52, 0x65, 0x71, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x1a, 0x12,
-	0x2e, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6d, 0x74, 0x52, 0x65, 0x73, 0x70, 0x44, 0x65, 0x74, 0x61,
-	0x69, 0x6c, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
-	0x6f, 0x33,
+	0x12, 0x50, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x69, 0x6c, 0x6c, 0x75, 0x73, 0x74,
+	0x72, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x44, 0x61, 0x74,
+	0x61, 0x73, 0x6d, 0x74, 0x52, 0x65, 0x73, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x65,
+	0x6c, 0x64, 0x49, 0x6c, 0x6c, 0x75, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72,
+	0x79, 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6c, 0x6c, 0x75, 0x73, 0x74, 0x72, 0x61,
+	0x74, 0x65, 0x1a, 0x42, 0x0a, 0x14, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6c, 0x6c, 0x75, 0x73,
+	0x74, 0x72, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
+	0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
+	0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c,
+	0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x89, 0x01, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x73,
+	0x6d, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61,
+	0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64,
+	0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61,
+	0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12,
+	0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
+	0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x74, 0x61, 0x74,
+	0x75, 0x73, 0x22, 0x22, 0x0a, 0x10, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6d, 0x74, 0x52, 0x65, 0x71,
+	0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xcd, 0x01, 0x0a, 0x11, 0x44, 0x61, 0x74, 0x61, 0x73,
+	0x6d, 0x74, 0x52, 0x65, 0x73, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04,
+	0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
+	0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a,
+	0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66,
+	0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x73,
+	0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x65,
+	0x61, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c,
+	0x64, 0x5f, 0x69, 0x6c, 0x6c, 0x75, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6c, 0x6c, 0x75, 0x73, 0x74, 0x72,
+	0x61, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x65, 0x78, 0x61, 0x6d,
+	0x70, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x45,
+	0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x32, 0x65, 0x0a, 0x07, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6d,
+	0x74, 0x12, 0x29, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0f, 0x2e, 0x44, 0x61, 0x74, 0x61,
+	0x73, 0x6d, 0x74, 0x52, 0x65, 0x71, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x44, 0x61, 0x74,
+	0x61, 0x73, 0x6d, 0x74, 0x52, 0x65, 0x73, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x06,
+	0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x11, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x73, 0x6d, 0x74,
+	0x52, 0x65, 0x71, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x1a, 0x12, 0x2e, 0x44, 0x61, 0x74, 0x61,
+	0x73, 0x6d, 0x74, 0x52, 0x65, 0x73, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x42, 0x06, 0x5a,
+	0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -446,25 +452,27 @@ func file_publicservice_proto_rawDescGZIP() []byte {
 	return file_publicservice_proto_rawDescData
 }
 
-var file_publicservice_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
+var file_publicservice_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
 var file_publicservice_proto_goTypes = []interface{}{
 	(*DatasmtReqList)(nil),    // 0: DatasmtReqList
 	(*DatasmtRespList)(nil),   // 1: DatasmtRespList
 	(*DatasmtList)(nil),       // 2: DatasmtList
 	(*DatasmtReqDetail)(nil),  // 3: DatasmtReqDetail
 	(*DatasmtRespDetail)(nil), // 4: DatasmtRespDetail
+	nil,                       // 5: DatasmtRespList.FieldIllustrateEntry
 }
 var file_publicservice_proto_depIdxs = []int32{
 	2, // 0: DatasmtRespList.list:type_name -> DatasmtList
-	0, // 1: datasmt.List:input_type -> DatasmtReqList
-	3, // 2: datasmt.Detail:input_type -> DatasmtReqDetail
-	1, // 3: datasmt.List:output_type -> DatasmtRespList
-	4, // 4: datasmt.Detail:output_type -> DatasmtRespDetail
-	3, // [3:5] is the sub-list for method output_type
-	1, // [1:3] is the sub-list for method input_type
-	1, // [1:1] is the sub-list for extension type_name
-	1, // [1:1] is the sub-list for extension extendee
-	0, // [0:1] is the sub-list for field type_name
+	5, // 1: DatasmtRespList.field_illustrate:type_name -> DatasmtRespList.FieldIllustrateEntry
+	0, // 2: datasmt.List:input_type -> DatasmtReqList
+	3, // 3: datasmt.Detail:input_type -> DatasmtReqDetail
+	1, // 4: datasmt.List:output_type -> DatasmtRespList
+	4, // 5: datasmt.Detail:output_type -> DatasmtRespDetail
+	4, // [4:6] is the sub-list for method output_type
+	2, // [2:4] is the sub-list for method input_type
+	2, // [2:2] is the sub-list for extension type_name
+	2, // [2:2] is the sub-list for extension extendee
+	0, // [0:2] is the sub-list for field type_name
 }
 
 func init() { file_publicservice_proto_init() }
@@ -540,7 +548,7 @@ func file_publicservice_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_publicservice_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   5,
+			NumMessages:   6,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 6 - 6
rpc/publicservice.proto

@@ -1,25 +1,25 @@
 //数据超市
 syntax = "proto3";
 
-option go_package="./pb";
+option go_package = "./pb";
 
 message DatasmtReqList {
   string search_value = 1;  //搜索词
-  string data_type = 2; 	//数据类型
+  string data_type = 2;  //数据类型
   int64 page_num = 3;       //当前页码
   int64 page_size = 4;      //每页大小
 }
 
 message DatasmtRespList {
   repeated DatasmtList list = 1; //检索结果
-  string page_count = 2; 	     //总条数
+  int64 page_count = 2;       //总条数
   repeated string hot_keys = 3;  //热搜词
-  string field_illustrate = 4;  //包含字段说明
+  map<string, string> field_illustrate = 4;  //包含字段说明
 }
 
 message DatasmtList {
   string id = 1;            //加密后的id
-  string name = 2; 	        //名称
+  string name = 2;          //名称
   string data_type = 3;     //数据类型
   string format = 4;        //数据格式
   string clear_status = 5;  //清洗状态
@@ -30,7 +30,7 @@ message DatasmtReqDetail {
 }
 
 message DatasmtRespDetail {
-  string name = 1; 	            //名称
+  string name = 1;              //名称
   string data_type = 2;         //数据类型
   string format = 3;            //数据格式
   string clear_status = 4;      //清洗状态

+ 17 - 7
rpc/service/datasmt.go

@@ -1,9 +1,11 @@
 package service
 
+import "C"
 import (
 	"app.yhyue.com/moapp/jybase/common"
 	"fmt"
 	"jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/rpc/db"
+	"jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/rpc/internal/config"
 	"jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/rpc/pb"
 	"strings"
 )
@@ -16,17 +18,17 @@ type DataSmt struct {
 }
 
 // 列表数据
-func (d *DataSmt) List(searchValue, dataType string, pageNum, pageSize int) *pb.DatasmtRespList {
+func (d *DataSmt) List(searchValue, dataType string, pageNum, pageSize int64) *pb.DatasmtRespList {
 	result := pb.DatasmtRespList{}
 	//数据查询
 	data := &[]map[string]interface{}{}
 	querySql := "select  id,name,data_type,format,clear_status from  %s where %s ORDER BY serial_number  limit %d ,%d "
 	queryStrArr := []string{}
 	if searchValue != "" {
-		queryStrArr = append(queryStrArr, fmt.Sprintf("name  LIKE '%%s%' "), searchValue)
+		queryStrArr = append(queryStrArr, " name  LIKE '%"+searchValue+"%' ")
 	}
 	if dataType != "" {
-		queryStrArr = append(queryStrArr, fmt.Sprintf("data_type  = '%s' "), dataType)
+		queryStrArr = append(queryStrArr, fmt.Sprintf(" data_type  = '%s' ", dataType))
 	}
 	querySql = fmt.Sprintf(querySql, DATA_SUPERMARKET, strings.Join(queryStrArr, " and "), (pageNum-1)*pageSize, pageNum*pageSize)
 	data = db.Mysql_BaseService.SelectBySql(querySql)
@@ -36,7 +38,8 @@ func (d *DataSmt) List(searchValue, dataType string, pageNum, pageSize int) *pb.
 	//总数查询
 	countQuerySql := "select  count(id) from  %s where %s "
 	countQuerySql = fmt.Sprintf(countQuerySql, DATA_SUPERMARKET, strings.Join(queryStrArr, " and "))
-	//count := db.Mysql_BaseService.CountBySql(countQuerySql)
+	count := db.Mysql_BaseService.CountBySql(countQuerySql)
+	result.PageCount = count
 	//热搜词处理
 	hotKeySql := fmt.Sprintf("select GROUP_CONCAT(keyword) as keyword from  %s   ORDER BY serial_number LIMIT 0,8", DATA_SUPERMARKET)
 	hotData := db.Mysql_BaseService.SelectBySql(hotKeySql)
@@ -44,10 +47,17 @@ func (d *DataSmt) List(searchValue, dataType string, pageNum, pageSize int) *pb.
 		result.HotKeys = strings.Split(common.InterfaceToStr((*hotData)[0]["keyword"]), ",")
 	}
 	//包含字段说明
-	//result.FieldIllustrate=c
-
+	fieldIllustrate := map[string]string{
+		"Cgyx":   config.C.DataSmt.FieldIllustrate.Cgyx,
+		"Njxm":   config.C.DataSmt.FieldIllustrate.Njxm,
+		"Zobsj":  config.C.DataSmt.FieldIllustrate.Zobsj,
+		"Zgbsj":  config.C.DataSmt.FieldIllustrate.Zgbsj,
+		"Qygssj": config.C.DataSmt.FieldIllustrate.Qygssj,
+		"Zbdwsj": config.C.DataSmt.FieldIllustrate.Zbdwsj,
+		"Cgdwsj": config.C.DataSmt.FieldIllustrate.Cgdwsj,
+	}
+	result.FieldIllustrate = fieldIllustrate
 	return &result
-
 }
 
 // 详情