xuzhiheng 4 yıl önce
ebeveyn
işleme
25c5668ab7

+ 2 - 1
rpc/stdlib/stdlib.proto

@@ -107,7 +107,8 @@ message DocActivity {
   int64 docFileSize = 10; //文件大小
   int64 docPageSize = 11; //页码数
   int64 docFileType = 12; //文件类型,1 doc 2 pdf 3 xls 4 ppt 5 txt 6 其他
-  bool isBuy = 13; //是否购买
+  string uploadDate = 13; //上传时间
+  bool isBuy = 14; //是否购买
 }
 
 message DocActivityResp {

+ 13 - 3
rpc/stdlib/stdlib/stdlib.pb.go

@@ -947,7 +947,8 @@ type DocActivity struct {
 	DocFileSize  int64  `protobuf:"varint,10,opt,name=docFileSize,proto3" json:"docFileSize,omitempty"` //文件大小
 	DocPageSize  int64  `protobuf:"varint,11,opt,name=docPageSize,proto3" json:"docPageSize,omitempty"` //页码数
 	DocFileType  int64  `protobuf:"varint,12,opt,name=docFileType,proto3" json:"docFileType,omitempty"` //文件类型,1 doc 2 pdf 3 xls 4 ppt 5 txt 6 其他
-	IsBuy        bool   `protobuf:"varint,13,opt,name=isBuy,proto3" json:"isBuy,omitempty"`             //是否购买
+	UploadDate   string `protobuf:"bytes,13,opt,name=uploadDate,proto3" json:"uploadDate,omitempty"`    //上传时间
+	IsBuy        bool   `protobuf:"varint,14,opt,name=isBuy,proto3" json:"isBuy,omitempty"`             //是否购买
 }
 
 func (x *DocActivity) Reset() {
@@ -1066,6 +1067,13 @@ func (x *DocActivity) GetDocFileType() int64 {
 	return 0
 }
 
+func (x *DocActivity) GetUploadDate() string {
+	if x != nil {
+		return x.UploadDate
+	}
+	return ""
+}
+
 func (x *DocActivity) GetIsBuy() bool {
 	if x != nil {
 		return x.IsBuy
@@ -1258,7 +1266,7 @@ var file_stdlib_proto_rawDesc = []byte{
 	0x70, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04,
 	0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a,
 	0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64, 0x22, 0x89, 0x03, 0x0a,
+	0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64, 0x22, 0xa9, 0x03, 0x0a,
 	0x0b, 0x44, 0x6f, 0x63, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05,
 	0x64, 0x6f, 0x63, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x6f, 0x63,
 	0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64,
@@ -1282,7 +1290,9 @@ var file_stdlib_proto_rawDesc = []byte{
 	0x01, 0x28, 0x03, 0x52, 0x0b, 0x64, 0x6f, 0x63, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,
 	0x12, 0x20, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18,
 	0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x64, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79,
-	0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x42, 0x75, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28,
+	0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61, 0x74, 0x65,
+	0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x44, 0x61,
+	0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x42, 0x75, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28,
 	0x08, 0x52, 0x05, 0x69, 0x73, 0x42, 0x75, 0x79, 0x22, 0x76, 0x0a, 0x0f, 0x44, 0x6f, 0x63, 0x41,
 	0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63,
 	0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12,

+ 7 - 7
rpc/stdlib/stdlibclient/stdlib.go

@@ -14,19 +14,19 @@ import (
 )
 
 type (
-	DocQueryRequest   = stdlib.DocQueryRequest
-	DocQueryResponse  = stdlib.DocQueryResponse
-	DocChangeReq      = stdlib.DocChangeReq
-	DocGetCheckResp   = stdlib.DocGetCheckResp
-	DocInfo           = stdlib.DocInfo
-	DocGetContentResp = stdlib.DocGetContentResp
-	DocActivityReq    = stdlib.DocActivityReq
 	DocActivityResp   = stdlib.DocActivityResp
 	Doc               = stdlib.Doc
+	DocChangeReq      = stdlib.DocChangeReq
 	DocChangeResp     = stdlib.DocChangeResp
 	DocStatisticsReq  = stdlib.DocStatisticsReq
 	DocGetCheckReq    = stdlib.DocGetCheckReq
 	DocActivity       = stdlib.DocActivity
+	DocQueryRequest   = stdlib.DocQueryRequest
+	DocQueryResponse  = stdlib.DocQueryResponse
+	DocGetCheckResp   = stdlib.DocGetCheckResp
+	DocInfo           = stdlib.DocInfo
+	DocGetContentResp = stdlib.DocGetContentResp
+	DocActivityReq    = stdlib.DocActivityReq
 
 	Stdlib interface {
 		DocQuery(ctx context.Context, in *DocQueryRequest) (*DocQueryResponse, error)

+ 13 - 12
services/model/stdlib.go

@@ -64,18 +64,19 @@ func (ud *UserDoc) TableName() string {
 }
 
 type DocActivity struct {
-	Id          int    `json:"id" gorm:"primaryKey"`
-	DocId       string `json:"doc_id" gorm:"column:docId"`
-	ActivityId  int    `json:"activity_id" gorm:"column:activityId"`
-	AppId       string `json:"app_id" gorm:"column:appId"`
-	DocTitle    string `json:"doc_title" gorm:"column:docTitle"`
-	DocSummary  string `json:"doc_summary" gorm:"column:docSummary"`
-	DocImg      string `json:"doc_img" gorm:"column:docImg"`
-	Price       int    `json:"price" gorm:"column:price"`
-	CostPrice   int    `json:"cost_price" gorm:"column:costPrice"`
-	DocFileSize int    `json:"doc_file_size" gorm:"column:docFileSize"`
-	DocPageSize int    `json:"doc_page_size" gorm:"column:docPageSize"`
-	DocFileType int    `json:"docFileType" gorm:"column:docFileType"`
+	Id          int       `json:"id" gorm:"primaryKey"`
+	DocId       string    `json:"doc_id" gorm:"column:docId"`
+	ActivityId  int       `json:"activity_id" gorm:"column:activityId"`
+	AppId       string    `json:"app_id" gorm:"column:appId"`
+	DocTitle    string    `json:"doc_title" gorm:"column:docTitle"`
+	DocSummary  string    `json:"doc_summary" gorm:"column:docSummary"`
+	DocImg      string    `json:"doc_img" gorm:"column:docImg"`
+	Price       int       `json:"price" gorm:"column:price"`
+	CostPrice   int       `json:"cost_price" gorm:"column:costPrice"`
+	DocFileSize int       `json:"doc_file_size" gorm:"column:docFileSize"`
+	DocPageSize int       `json:"doc_page_size" gorm:"column:docPageSize"`
+	DocFileType int       `json:"docFileType" gorm:"column:docFileType"`
+	UploadDate  time.Time `json:"uploadDate" gorm:"column:uploadDate"`
 }
 
 func (ud *DocActivity) TableName() string {

+ 1 - 0
services/stdlib/docActivity.go

@@ -38,6 +38,7 @@ func DocActivityList(pageSize, pageNum, activityId int, appId, userId string) (*
 			DocPageSize: int64(v.DocPageSize),
 			DownTimes:   int64(docStatistics.DownTimes),
 			DocFileType: int64(v.DocFileType),
+			UploadDate:  v.UploadDate.Format("2006-01-02 15:04:05"),
 			IsBuy:       isbuy,
 		})
 	}