Commit aafca9f7 by mushishixian

整理

parent 9021543e
Showing with 1068 additions and 1685 deletions
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.24.0
// protoc v3.12.1
// source: Common.proto
package Course
import (
proto "github.com/golang/protobuf/proto"
timestamp "github.com/golang/protobuf/ptypes/timestamp"
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)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type Timestamp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Timestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
Timestr string `protobuf:"bytes,2,opt,name=timestr,proto3" json:"timestr,omitempty"`
}
func (x *Timestamp) Reset() {
*x = Timestamp{}
if protoimpl.UnsafeEnabled {
mi := &file_Common_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Timestamp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Timestamp) ProtoMessage() {}
func (x *Timestamp) ProtoReflect() protoreflect.Message {
mi := &file_Common_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 Timestamp.ProtoReflect.Descriptor instead.
func (*Timestamp) Descriptor() ([]byte, []int) {
return file_Common_proto_rawDescGZIP(), []int{0}
}
func (x *Timestamp) GetTimestamp() *timestamp.Timestamp {
if x != nil {
return x.Timestamp
}
return nil
}
func (x *Timestamp) GetTimestr() string {
if x != nil {
return x.Timestr
}
return ""
}
var File_Common_proto protoreflect.FileDescriptor
var file_Common_proto_rawDesc = []byte{
0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06,
0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5f, 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x73,
0x74, 0x61, 0x6d, 0x70, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74,
0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x18,
0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_Common_proto_rawDescOnce sync.Once
file_Common_proto_rawDescData = file_Common_proto_rawDesc
)
func file_Common_proto_rawDescGZIP() []byte {
file_Common_proto_rawDescOnce.Do(func() {
file_Common_proto_rawDescData = protoimpl.X.CompressGZIP(file_Common_proto_rawDescData)
})
return file_Common_proto_rawDescData
}
var file_Common_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_Common_proto_goTypes = []interface{}{
(*Timestamp)(nil), // 0: Course.Timestamp
(*timestamp.Timestamp)(nil), // 1: google.protobuf.Timestamp
}
var file_Common_proto_depIdxs = []int32{
1, // 0: Course.Timestamp.timestamp:type_name -> google.protobuf.Timestamp
1, // [1:1] is the sub-list for method output_type
1, // [1:1] 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
}
func init() { file_Common_proto_init() }
func file_Common_proto_init() {
if File_Common_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_Common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Timestamp); 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_Common_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_Common_proto_goTypes,
DependencyIndexes: file_Common_proto_depIdxs,
MessageInfos: file_Common_proto_msgTypes,
}.Build()
File_Common_proto = out.File
file_Common_proto_rawDesc = nil
file_Common_proto_goTypes = nil
file_Common_proto_depIdxs = nil
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.24.0
// protoc v3.12.1
// source: Course.proto
package Course
import (
proto "github.com/golang/protobuf/proto"
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)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type CourseModel struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CourseId int32 `protobuf:"varint,1,opt,name=course_id,json=courseId,proto3" json:"course_id,omitempty"`
CourseName string `protobuf:"bytes,2,opt,name=course_name,json=courseName,proto3" json:"course_name,omitempty"`
CourseDispName string `protobuf:"bytes,3,opt,name=course_disp_name,json=courseDispName,proto3" json:"course_disp_name,omitempty"`
CourseIntr string `protobuf:"bytes,4,opt,name=course_intr,json=courseIntr,proto3" json:"course_intr,omitempty"`
CoursePrice float32 `protobuf:"fixed32,5,opt,name=course_price,json=coursePrice,proto3" json:"course_price,omitempty"`
CoursePrice2 float32 `protobuf:"fixed32,6,opt,name=course_price2,json=coursePrice2,proto3" json:"course_price2,omitempty"`
// @inject_tag: gorm:"type:timestamp"
Addtime *Timestamp `protobuf:"bytes,7,opt,name=addtime,proto3" json:"addtime,omitempty" gorm:"type:timestamp"`
}
func (x *CourseModel) Reset() {
*x = CourseModel{}
if protoimpl.UnsafeEnabled {
mi := &file_Course_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CourseModel) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CourseModel) ProtoMessage() {}
func (x *CourseModel) ProtoReflect() protoreflect.Message {
mi := &file_Course_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 CourseModel.ProtoReflect.Descriptor instead.
func (*CourseModel) Descriptor() ([]byte, []int) {
return file_Course_proto_rawDescGZIP(), []int{0}
}
func (x *CourseModel) GetCourseId() int32 {
if x != nil {
return x.CourseId
}
return 0
}
func (x *CourseModel) GetCourseName() string {
if x != nil {
return x.CourseName
}
return ""
}
func (x *CourseModel) GetCourseDispName() string {
if x != nil {
return x.CourseDispName
}
return ""
}
func (x *CourseModel) GetCourseIntr() string {
if x != nil {
return x.CourseIntr
}
return ""
}
func (x *CourseModel) GetCoursePrice() float32 {
if x != nil {
return x.CoursePrice
}
return 0
}
func (x *CourseModel) GetCoursePrice2() float32 {
if x != nil {
return x.CoursePrice2
}
return 0
}
func (x *CourseModel) GetAddtime() *Timestamp {
if x != nil {
return x.Addtime
}
return nil
}
type ListRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// @inject_tag: form:"size"
Size int32 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty" form:"size"`
}
func (x *ListRequest) Reset() {
*x = ListRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_Course_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListRequest) ProtoMessage() {}
func (x *ListRequest) ProtoReflect() protoreflect.Message {
mi := &file_Course_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 ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) Descriptor() ([]byte, []int) {
return file_Course_proto_rawDescGZIP(), []int{1}
}
func (x *ListRequest) GetSize() int32 {
if x != nil {
return x.Size
}
return 0
}
type DetailRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// @inject_tag: uri:"course_id"
CourseId int32 `protobuf:"varint,1,opt,name=course_id,json=courseId,proto3" json:"course_id,omitempty" uri:"course_id"`
// @inject_tag: header:"fetch_type"
FetchType int32 `protobuf:"varint,2,opt,name=fetch_type,json=fetchType,proto3" json:"fetch_type,omitempty" header:"fetch_type"`
}
func (x *DetailRequest) Reset() {
*x = DetailRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_Course_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DetailRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DetailRequest) ProtoMessage() {}
func (x *DetailRequest) ProtoReflect() protoreflect.Message {
mi := &file_Course_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 DetailRequest.ProtoReflect.Descriptor instead.
func (*DetailRequest) Descriptor() ([]byte, []int) {
return file_Course_proto_rawDescGZIP(), []int{2}
}
func (x *DetailRequest) GetCourseId() int32 {
if x != nil {
return x.CourseId
}
return 0
}
func (x *DetailRequest) GetFetchType() int32 {
if x != nil {
return x.FetchType
}
return 0
}
//计数
type CourseCounts struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// @inject_tag: json:"-"
CountId int32 `protobuf:"varint,1,opt,name=count_id,json=countId,proto3" json:"-"`
// @inject_tag: json:"-"
CourseId int32 `protobuf:"varint,2,opt,name=course_id,json=courseId,proto3" json:"-"`
CountKey string `protobuf:"bytes,3,opt,name=count_key,json=countKey,proto3" json:"count_key,omitempty"`
CountValue int32 `protobuf:"varint,4,opt,name=count_value,json=countValue,proto3" json:"count_value,omitempty"`
}
func (x *CourseCounts) Reset() {
*x = CourseCounts{}
if protoimpl.UnsafeEnabled {
mi := &file_Course_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CourseCounts) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CourseCounts) ProtoMessage() {}
func (x *CourseCounts) ProtoReflect() protoreflect.Message {
mi := &file_Course_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 CourseCounts.ProtoReflect.Descriptor instead.
func (*CourseCounts) Descriptor() ([]byte, []int) {
return file_Course_proto_rawDescGZIP(), []int{3}
}
func (x *CourseCounts) GetCountId() int32 {
if x != nil {
return x.CountId
}
return 0
}
func (x *CourseCounts) GetCourseId() int32 {
if x != nil {
return x.CourseId
}
return 0
}
func (x *CourseCounts) GetCountKey() string {
if x != nil {
return x.CountKey
}
return ""
}
func (x *CourseCounts) GetCountValue() int32 {
if x != nil {
return x.CountValue
}
return 0
}
type ListResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Result []*CourseModel `protobuf:"bytes,1,rep,name=result,proto3" json:"result,omitempty"`
}
func (x *ListResponse) Reset() {
*x = ListResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_Course_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListResponse) ProtoMessage() {}
func (x *ListResponse) ProtoReflect() protoreflect.Message {
mi := &file_Course_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 ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) Descriptor() ([]byte, []int) {
return file_Course_proto_rawDescGZIP(), []int{4}
}
func (x *ListResponse) GetResult() []*CourseModel {
if x != nil {
return x.Result
}
return nil
}
type DetailResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Course *CourseModel `protobuf:"bytes,1,opt,name=course,proto3" json:"course,omitempty"`
Counts []*CourseCounts `protobuf:"bytes,2,rep,name=counts,proto3" json:"counts,omitempty"`
}
func (x *DetailResponse) Reset() {
*x = DetailResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_Course_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DetailResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DetailResponse) ProtoMessage() {}
func (x *DetailResponse) ProtoReflect() protoreflect.Message {
mi := &file_Course_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 DetailResponse.ProtoReflect.Descriptor instead.
func (*DetailResponse) Descriptor() ([]byte, []int) {
return file_Course_proto_rawDescGZIP(), []int{5}
}
func (x *DetailResponse) GetCourse() *CourseModel {
if x != nil {
return x.Course
}
return nil
}
func (x *DetailResponse) GetCounts() []*CourseCounts {
if x != nil {
return x.Counts
}
return nil
}
var File_Course_proto protoreflect.FileDescriptor
var file_Course_proto_rawDesc = []byte{
0x0a, 0x0c, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06,
0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x1a, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8b, 0x02, 0x0a, 0x0b, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x4d,
0x6f, 0x64, 0x65, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x5f, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x49,
0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x4e, 0x61,
0x6d, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x5f, 0x64, 0x69, 0x73,
0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f,
0x75, 0x72, 0x73, 0x65, 0x44, 0x69, 0x73, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b,
0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x49, 0x6e, 0x74, 0x72, 0x12, 0x21, 0x0a,
0x0c, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20,
0x01, 0x28, 0x02, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65,
0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65,
0x32, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x50,
0x72, 0x69, 0x63, 0x65, 0x32, 0x12, 0x2b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x74, 0x69, 0x6d, 0x65,
0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x2e,
0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x61, 0x64, 0x64, 0x74, 0x69,
0x6d, 0x65, 0x22, 0x21, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x4b, 0x0a, 0x0d, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65,
0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x6f, 0x75, 0x72, 0x73,
0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x66, 0x65, 0x74, 0x63, 0x68, 0x54, 0x79,
0x70, 0x65, 0x22, 0x84, 0x01, 0x0a, 0x0c, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x75,
0x6e, 0x74, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1b,
0x0a, 0x09, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x05, 0x52, 0x08, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3b, 0x0a, 0x0c, 0x4c, 0x69, 0x73,
0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x72, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x43, 0x6f, 0x75, 0x72,
0x73, 0x65, 0x2e, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x06,
0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x6b, 0x0a, 0x0e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x72,
0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x43, 0x6f, 0x75, 0x72, 0x73,
0x65, 0x2e, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x06, 0x63,
0x6f, 0x75, 0x72, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18,
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x2e, 0x43,
0x6f, 0x75, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x73, 0x32, 0x84, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72,
0x54, 0x6f, 0x70, 0x12, 0x13, 0x2e, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x2e, 0x4c, 0x69, 0x73,
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x43, 0x6f, 0x75, 0x72, 0x73,
0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a,
0x0a, 0x09, 0x47, 0x65, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x15, 0x2e, 0x43, 0x6f,
0x75, 0x72, 0x73, 0x65, 0x2e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x16, 0x2e, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x2e, 0x44, 0x65, 0x74, 0x61,
0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (
file_Course_proto_rawDescOnce sync.Once
file_Course_proto_rawDescData = file_Course_proto_rawDesc
)
func file_Course_proto_rawDescGZIP() []byte {
file_Course_proto_rawDescOnce.Do(func() {
file_Course_proto_rawDescData = protoimpl.X.CompressGZIP(file_Course_proto_rawDescData)
})
return file_Course_proto_rawDescData
}
var file_Course_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_Course_proto_goTypes = []interface{}{
(*CourseModel)(nil), // 0: Course.CourseModel
(*ListRequest)(nil), // 1: Course.ListRequest
(*DetailRequest)(nil), // 2: Course.DetailRequest
(*CourseCounts)(nil), // 3: Course.CourseCounts
(*ListResponse)(nil), // 4: Course.ListResponse
(*DetailResponse)(nil), // 5: Course.DetailResponse
(*Timestamp)(nil), // 6: Course.Timestamp
}
var file_Course_proto_depIdxs = []int32{
6, // 0: Course.CourseModel.addtime:type_name -> Course.Timestamp
0, // 1: Course.ListResponse.result:type_name -> Course.CourseModel
0, // 2: Course.DetailResponse.course:type_name -> Course.CourseModel
3, // 3: Course.DetailResponse.counts:type_name -> Course.CourseCounts
1, // 4: Course.CourseService.ListForTop:input_type -> Course.ListRequest
2, // 5: Course.CourseService.GetDetail:input_type -> Course.DetailRequest
4, // 6: Course.CourseService.ListForTop:output_type -> Course.ListResponse
5, // 7: Course.CourseService.GetDetail:output_type -> Course.DetailResponse
6, // [6:8] is the sub-list for method output_type
4, // [4:6] 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_Course_proto_init() }
func file_Course_proto_init() {
if File_Course_proto != nil {
return
}
file_Common_proto_init()
if !protoimpl.UnsafeEnabled {
file_Course_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CourseModel); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_Course_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_Course_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DetailRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_Course_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CourseCounts); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_Course_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_Course_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DetailResponse); 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_Course_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_Course_proto_goTypes,
DependencyIndexes: file_Course_proto_depIdxs,
MessageInfos: file_Course_proto_msgTypes,
}.Build()
File_Course_proto = out.File
file_Course_proto_rawDesc = nil
file_Course_proto_goTypes = nil
file_Course_proto_depIdxs = nil
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.24.0
// protoc v3.12.1
// source: CourseTopic.proto
package Course
import (
proto "github.com/golang/protobuf/proto"
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)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type CourseTopic struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
CourseId int32 `protobuf:"varint,2,opt,name=CourseId,proto3" json:"CourseId,omitempty"`
CourseDid int32 `protobuf:"varint,3,opt,name=CourseDid,proto3" json:"CourseDid,omitempty"`
Likes int32 `protobuf:"varint,4,opt,name=Likes,proto3" json:"Likes,omitempty"`
Unlikes int32 `protobuf:"varint,5,opt,name=Unlikes,proto3" json:"Unlikes,omitempty"`
Title string `protobuf:"bytes,6,opt,name=Title,proto3" json:"Title,omitempty"`
Content string `protobuf:"bytes,7,opt,name=Content,proto3" json:"Content,omitempty"`
UserId int32 `protobuf:"varint,8,opt,name=UserId,proto3" json:"UserId,omitempty"`
Addtime *Timestamp `protobuf:"bytes,9,opt,name=Addtime,proto3" json:"Addtime,omitempty"`
Updatetime *Timestamp `protobuf:"bytes,10,opt,name=Updatetime,proto3" json:"Updatetime,omitempty"`
}
func (x *CourseTopic) Reset() {
*x = CourseTopic{}
if protoimpl.UnsafeEnabled {
mi := &file_CourseTopic_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CourseTopic) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CourseTopic) ProtoMessage() {}
func (x *CourseTopic) ProtoReflect() protoreflect.Message {
mi := &file_CourseTopic_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 CourseTopic.ProtoReflect.Descriptor instead.
func (*CourseTopic) Descriptor() ([]byte, []int) {
return file_CourseTopic_proto_rawDescGZIP(), []int{0}
}
func (x *CourseTopic) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *CourseTopic) GetCourseId() int32 {
if x != nil {
return x.CourseId
}
return 0
}
func (x *CourseTopic) GetCourseDid() int32 {
if x != nil {
return x.CourseDid
}
return 0
}
func (x *CourseTopic) GetLikes() int32 {
if x != nil {
return x.Likes
}
return 0
}
func (x *CourseTopic) GetUnlikes() int32 {
if x != nil {
return x.Unlikes
}
return 0
}
func (x *CourseTopic) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *CourseTopic) GetContent() string {
if x != nil {
return x.Content
}
return ""
}
func (x *CourseTopic) GetUserId() int32 {
if x != nil {
return x.UserId
}
return 0
}
func (x *CourseTopic) GetAddtime() *Timestamp {
if x != nil {
return x.Addtime
}
return nil
}
func (x *CourseTopic) GetUpdatetime() *Timestamp {
if x != nil {
return x.Updatetime
}
return nil
}
type CourseTopicReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
TopicId int32 `protobuf:"varint,2,opt,name=TopicId,proto3" json:"TopicId,omitempty"`
Content string `protobuf:"bytes,3,opt,name=Content,proto3" json:"Content,omitempty"`
UserId int32 `protobuf:"varint,4,opt,name=UserId,proto3" json:"UserId,omitempty"`
Likes int32 `protobuf:"varint,5,opt,name=Likes,proto3" json:"Likes,omitempty"`
Unlikes int32 `protobuf:"varint,6,opt,name=Unlikes,proto3" json:"Unlikes,omitempty"`
Addtime *Timestamp `protobuf:"bytes,7,opt,name=Addtime,proto3" json:"Addtime,omitempty"`
}
func (x *CourseTopicReply) Reset() {
*x = CourseTopicReply{}
if protoimpl.UnsafeEnabled {
mi := &file_CourseTopic_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CourseTopicReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CourseTopicReply) ProtoMessage() {}
func (x *CourseTopicReply) ProtoReflect() protoreflect.Message {
mi := &file_CourseTopic_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 CourseTopicReply.ProtoReflect.Descriptor instead.
func (*CourseTopicReply) Descriptor() ([]byte, []int) {
return file_CourseTopic_proto_rawDescGZIP(), []int{1}
}
func (x *CourseTopicReply) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *CourseTopicReply) GetTopicId() int32 {
if x != nil {
return x.TopicId
}
return 0
}
func (x *CourseTopicReply) GetContent() string {
if x != nil {
return x.Content
}
return ""
}
func (x *CourseTopicReply) GetUserId() int32 {
if x != nil {
return x.UserId
}
return 0
}
func (x *CourseTopicReply) GetLikes() int32 {
if x != nil {
return x.Likes
}
return 0
}
func (x *CourseTopicReply) GetUnlikes() int32 {
if x != nil {
return x.Unlikes
}
return 0
}
func (x *CourseTopicReply) GetAddtime() *Timestamp {
if x != nil {
return x.Addtime
}
return nil
}
type TopicRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CourseId int32 `protobuf:"varint,1,opt,name=CourseId,proto3" json:"CourseId,omitempty"`
}
func (x *TopicRequest) Reset() {
*x = TopicRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_CourseTopic_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TopicRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TopicRequest) ProtoMessage() {}
func (x *TopicRequest) ProtoReflect() protoreflect.Message {
mi := &file_CourseTopic_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 TopicRequest.ProtoReflect.Descriptor instead.
func (*TopicRequest) Descriptor() ([]byte, []int) {
return file_CourseTopic_proto_rawDescGZIP(), []int{2}
}
func (x *TopicRequest) GetCourseId() int32 {
if x != nil {
return x.CourseId
}
return 0
}
type TopicResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Result []*CourseTopic `protobuf:"bytes,1,rep,name=result,proto3" json:"result,omitempty"`
}
func (x *TopicResponse) Reset() {
*x = TopicResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_CourseTopic_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TopicResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TopicResponse) ProtoMessage() {}
func (x *TopicResponse) ProtoReflect() protoreflect.Message {
mi := &file_CourseTopic_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 TopicResponse.ProtoReflect.Descriptor instead.
func (*TopicResponse) Descriptor() ([]byte, []int) {
return file_CourseTopic_proto_rawDescGZIP(), []int{3}
}
func (x *TopicResponse) GetResult() []*CourseTopic {
if x != nil {
return x.Result
}
return nil
}
var File_CourseTopic_proto protoreflect.FileDescriptor
var file_CourseTopic_proto_rawDesc = []byte{
0x0a, 0x11, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x06, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x1a, 0x0c, 0x43, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x02, 0x0a, 0x0b, 0x43, 0x6f,
0x75, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6f, 0x75,
0x72, 0x73, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x43, 0x6f, 0x75,
0x72, 0x73, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x44,
0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65,
0x44, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x69, 0x6b, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01,
0x28, 0x05, 0x52, 0x05, 0x4c, 0x69, 0x6b, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x55, 0x6e, 0x6c,
0x69, 0x6b, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x55, 0x6e, 0x6c, 0x69,
0x6b, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x6f, 0x6e,
0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x6f, 0x6e, 0x74,
0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x08, 0x20,
0x01, 0x28, 0x05, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x07, 0x41,
0x64, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x43,
0x6f, 0x75, 0x72, 0x73, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52,
0x07, 0x41, 0x64, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x43,
0x6f, 0x75, 0x72, 0x73, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52,
0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xcb, 0x01, 0x0a, 0x10,
0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x52, 0x65, 0x70, 0x6c, 0x79,
0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64,
0x12, 0x18, 0x0a, 0x07, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x05, 0x52, 0x07, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x6f,
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x6f, 0x6e,
0x74, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04,
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05,
0x4c, 0x69, 0x6b, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x4c, 0x69, 0x6b,
0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x55, 0x6e, 0x6c, 0x69, 0x6b, 0x65, 0x73, 0x18, 0x06, 0x20,
0x01, 0x28, 0x05, 0x52, 0x07, 0x55, 0x6e, 0x6c, 0x69, 0x6b, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x07,
0x41, 0x64, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e,
0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
0x52, 0x07, 0x41, 0x64, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x0c, 0x54, 0x6f, 0x70,
0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6f, 0x75,
0x72, 0x73, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x43, 0x6f, 0x75,
0x72, 0x73, 0x65, 0x49, 0x64, 0x22, 0x3c, 0x0a, 0x0d, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x2e,
0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x52, 0x06, 0x72, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x32, 0x4d, 0x0a, 0x12, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x70,
0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x47, 0x65, 0x74,
0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x14, 0x2e, 0x43, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x2e, 0x54,
0x6f, 0x70, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x43, 0x6f,
0x75, 0x72, 0x73, 0x65, 0x2e, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_CourseTopic_proto_rawDescOnce sync.Once
file_CourseTopic_proto_rawDescData = file_CourseTopic_proto_rawDesc
)
func file_CourseTopic_proto_rawDescGZIP() []byte {
file_CourseTopic_proto_rawDescOnce.Do(func() {
file_CourseTopic_proto_rawDescData = protoimpl.X.CompressGZIP(file_CourseTopic_proto_rawDescData)
})
return file_CourseTopic_proto_rawDescData
}
var file_CourseTopic_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_CourseTopic_proto_goTypes = []interface{}{
(*CourseTopic)(nil), // 0: Course.CourseTopic
(*CourseTopicReply)(nil), // 1: Course.CourseTopicReply
(*TopicRequest)(nil), // 2: Course.TopicRequest
(*TopicResponse)(nil), // 3: Course.TopicResponse
(*Timestamp)(nil), // 4: Course.Timestamp
}
var file_CourseTopic_proto_depIdxs = []int32{
4, // 0: Course.CourseTopic.Addtime:type_name -> Course.Timestamp
4, // 1: Course.CourseTopic.Updatetime:type_name -> Course.Timestamp
4, // 2: Course.CourseTopicReply.Addtime:type_name -> Course.Timestamp
0, // 3: Course.TopicResponse.result:type_name -> Course.CourseTopic
2, // 4: Course.CourseTopicService.GetTopic:input_type -> Course.TopicRequest
3, // 5: Course.CourseTopicService.GetTopic:output_type -> Course.TopicResponse
5, // [5:6] is the sub-list for method output_type
4, // [4:5] 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_CourseTopic_proto_init() }
func file_CourseTopic_proto_init() {
if File_CourseTopic_proto != nil {
return
}
file_Common_proto_init()
if !protoimpl.UnsafeEnabled {
file_CourseTopic_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CourseTopic); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_CourseTopic_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CourseTopicReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_CourseTopic_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TopicRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_CourseTopic_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TopicResponse); 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_CourseTopic_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_CourseTopic_proto_goTypes,
DependencyIndexes: file_CourseTopic_proto_depIdxs,
MessageInfos: file_CourseTopic_proto_msgTypes,
}.Build()
File_CourseTopic_proto = out.File
file_CourseTopic_proto_rawDesc = nil
file_CourseTopic_proto_goTypes = nil
file_CourseTopic_proto_depIdxs = nil
}
package Course
import (
"database/sql/driver"
"fmt"
"github.com/golang/protobuf/ptypes"
"time"
)
//db 数据 =>go类型
func (this *Timestamp) Scan(value interface{}) error {
switch t := value.(type) {
case time.Time:
var err error
this.Timestamp, err = ptypes.TimestampProto(t)
if err != nil {
return err
}
default:
return fmt.Errorf("timestamp error")
}
return nil
}
// insert update 把go数据类型 =>db类型
func (this Timestamp) Value() (driver.Value, error) {
return ptypes.Timestamp(this.Timestamp)
}
......@@ -2,25 +2,25 @@ package Mapper
import (
"github.com/jinzhu/gorm"
"jtthink/boot"
"jtthink/Vars"
"search_server/pkg/vars"
"search_server/pkg/mysql"
)
func GetCourseList() *gorm.DB {
return boot.GetDB().Table(Vars.Table_CourseMain).
return mysql.GetDB().Table(vars.Table_CourseMain).
Order("course_id desc").Limit(3)
}
const course_list="select * from course_main order by course_id desc limit ?"
func GetCourseListBySql(args ...interface{}) *gorm.DB{
return boot.GetDB().Raw(course_list,args...)
const course_list = "select * from course_main order by course_id desc limit ?"
func GetCourseListBySql(args ...interface{}) *gorm.DB {
return mysql.GetDB().Raw(course_list, args...)
}
func GetCourseDetail(course_id int ) *gorm.DB{
return boot.GetDB().Table(Vars.Table_CourseMain).Where("course_id=?",course_id)
func GetCourseDetail(course_id int) *gorm.DB {
return mysql.GetDB().Table(vars.Table_CourseMain).Where("course_id=?", course_id)
}
//取计数表
func GetCourseCounts(course_id int ) *gorm.DB{
return boot.GetDB().Table(Vars.Table_CourseCounts).Where("course_id=?",course_id)
func GetCourseCounts(course_id int) *gorm.DB {
return mysql.GetDB().Table(vars.Table_CourseCounts).Where("course_id=?", course_id)
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.23.0
// protoc v3.10.1
// source: Users.proto
package Users
import (
proto "github.com/golang/protobuf/proto"
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)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type UserRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *UserRequest) Reset() {
*x = UserRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_Users_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserRequest) ProtoMessage() {}
func (x *UserRequest) ProtoReflect() protoreflect.Message {
mi := &file_Users_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 UserRequest.ProtoReflect.Descriptor instead.
func (*UserRequest) Descriptor() ([]byte, []int) {
return file_Users_proto_rawDescGZIP(), []int{0}
}
func (x *UserRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
type UserResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Ret string `protobuf:"bytes,2,opt,name=ret,proto3" json:"ret,omitempty"`
}
func (x *UserResponse) Reset() {
*x = UserResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_Users_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserResponse) ProtoMessage() {}
func (x *UserResponse) ProtoReflect() protoreflect.Message {
mi := &file_Users_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 UserResponse.ProtoReflect.Descriptor instead.
func (*UserResponse) Descriptor() ([]byte, []int) {
return file_Users_proto_rawDescGZIP(), []int{1}
}
func (x *UserResponse) GetRet() string {
if x != nil {
return x.Ret
}
return ""
}
var File_Users_proto protoreflect.FileDescriptor
var file_Users_proto_rawDesc = []byte{
0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x55,
0x73, 0x65, 0x72, 0x73, 0x22, 0x1d, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x02, 0x69, 0x64, 0x22, 0x20, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x72, 0x65, 0x74, 0x32, 0x40, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x12, 0x2e, 0x55,
0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x13, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_Users_proto_rawDescOnce sync.Once
file_Users_proto_rawDescData = file_Users_proto_rawDesc
)
func file_Users_proto_rawDescGZIP() []byte {
file_Users_proto_rawDescOnce.Do(func() {
file_Users_proto_rawDescData = protoimpl.X.CompressGZIP(file_Users_proto_rawDescData)
})
return file_Users_proto_rawDescData
}
var file_Users_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_Users_proto_goTypes = []interface{}{
(*UserRequest)(nil), // 0: Users.UserRequest
(*UserResponse)(nil), // 1: Users.UserResponse
}
var file_Users_proto_depIdxs = []int32{
0, // 0: Users.UserService.Test:input_type -> Users.UserRequest
1, // 1: Users.UserService.Test:output_type -> Users.UserResponse
1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_Users_proto_init() }
func file_Users_proto_init() {
if File_Users_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_Users_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_Users_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserResponse); 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_Users_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_Users_proto_goTypes,
DependencyIndexes: file_Users_proto_depIdxs,
MessageInfos: file_Users_proto_msgTypes,
}.Build()
File_Users_proto = out.File
file_Users_proto_rawDesc = nil
file_Users_proto_goTypes = nil
file_Users_proto_depIdxs = nil
}
set MICRO_REGISTRY=etcd
set MICRO_REGISTRY_ADDRESS=192.168.2.232:2379
go run cmd/course_http_server.go --server_address :9000
\ No newline at end of file
go run ../cmd/course_http_server.go --server_address :9000
\ No newline at end of file
::protoc --proto_path=protos --micro_out=users --go_out=users users.proto
protoc --proto_path=protos --micro_out=course --go_out=course course.proto
protoc-go-inject-tag -input=course/course.pb.go
protoc --proto_path=protos --micro_out=course --go_out=course common.proto
protoc --proto_path=protos --micro_out=course --go_out=course course_topic.proto
protoc-go-inject-tag -input=course/course_topic.pb.go
\ No newline at end of file
package boot
import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
"jtthink/pkg/config"
)
//mysql相关
var mysqlDb *gorm.DB
func InitMysql() error {
var err error
userName := config.Get("database.user_name").String()
password := config.Get("database.password").String()
host := config.Get("database.host").String()
database := config.Get("database.database").String()
mysqlDb, err = gorm.Open("mysql", fmt.Sprintf("%s:%s@tcp(%s:3306)/%s?charset=utf8&parseTime=True&loc=Local",
userName, password, host, database))
if err != nil {
mysqlDb = nil
return NewFatalError(err.Error()) //这里返回致命异常
}
mysqlDb.SingularTable(true)
mysqlDb.DB().SetMaxIdleConns(10)
mysqlDb.DB().SetMaxOpenConns(100)
mysqlDb.LogMode(true)
return nil
}
func GetDB() *gorm.DB {
return mysqlDb
}
package boot
type FatalError struct {
ErrMsg string
}
func (err *FatalError) Error() string {
return err.ErrMsg
}
func NewFatalError( msg string) *FatalError {
return &FatalError{ ErrMsg: msg}
}
func IsFatalError(err error) bool {
if _,ok:=err.(*FatalError);ok{
return true
}
return false
}
\ No newline at end of file
package boot
import (
"jtthink/pkg/config"
"jtthink/pkg/gredis"
"jtthink/pkg/mysql"
"search_server/pkg/config"
"search_server/pkg/gredis"
"search_server/pkg/mysql"
)
func Boot() (err error) {
......
......@@ -3,9 +3,9 @@ package main
import (
"github.com/gin-gonic/gin"
"github.com/micro/go-micro/v2/web"
"jtthink/boot"
"jtthink/framework/gin_"
_ "jtthink/lib"
"search_server/boot"
"search_server/framework/gin_"
_ "search_server/lib"
"log"
)
......
......@@ -4,7 +4,7 @@ import (
"context"
"github.com/micro/go-micro/v2/client/grpc"
"github.com/micro/go-micro/v2/web"
"jtthink/Course"
"search_server/Course"
"log"
"net/http"
)
......
......@@ -2,8 +2,8 @@ package main
import (
"github.com/micro/go-micro/v2"
"jtthink/Course"
"jtthink/service"
"search_server/protopb/course"
"search_server/service"
"log"
)
......@@ -14,7 +14,7 @@ func main() {
micro.Name("go.micro.api.jtthink.course"))
cService.Init()
err:=Course.RegisterCourseServiceHandler(cService.Server(),service.NewCourseServiceImpl())
err:=course.RegisterCourseServiceHandler(cService.Server(),service.NewCourseServiceImpl())
if err!=nil{
log.Fatal(err)
}
......
......@@ -3,10 +3,10 @@ package main
import (
"context"
"github.com/micro/go-micro/v2/client"
"jtthink/Course"
"search_server/Course"
"github.com/micro/go-micro/v2"
"jtthink/Users"
"search_server/Users"
"log"
)
......
module jtthink
module search_server
go 1.14
......@@ -18,7 +18,7 @@ require (
google.golang.org/appengine v1.6.3 // indirect
google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece // indirect
google.golang.org/grpc v1.29.1 // indirect
google.golang.org/protobuf v1.24.0
google.golang.org/protobuf v1.24.0 // indirect
gopkg.in/ini.v1 v1.51.0 // indirect
)
......
......@@ -2,75 +2,78 @@ package lib
import (
"github.com/gin-gonic/gin"
"jtthink/framework/gin_"
"jtthink/Course"
"jtthink/service"
"search_server/framework/gin_"
"search_server/protopb/course"
"search_server/service"
)
func init() {
courseService:=service.NewCourseServiceImpl()
func init() {
courseService := service.NewCourseServiceImpl()
gin_.NewBuilder().WithService(courseService).
WithMiddleware(Check_Middleware()).
WithMiddleware(Check_Middleware()).
WithMiddleware(Cors_Middleware()).
WithEndpoint(Courselist_Endpoint(courseService)).
WithRequest(Courselist_Request()).
WithResponse(Course_Response()).Build("/course","GET")
WithResponse(Course_Response()).Build("/course", "GET")
gin_.NewBuilder().WithService(courseService).
WithMiddleware(Check_Middleware()).
WithEndpoint(Coursedetail_Endpoint(courseService)).
WithRequest(Coursedetail_Request()).
WithResponse(Course_Response()).Build("/detail/:course_id","GET")
WithResponse(Course_Response()).Build("/detail/:course_id", "GET")
}
//详细相关
func Coursedetail_Endpoint(c *service.CourseServiceImpl) gin_.Endpoint {
func Coursedetail_Endpoint(c *service.CourseServiceImpl) gin_.Endpoint {
return func(context *gin.Context, request interface{}) (response interface{}, err error) {
rsp:=&Course.DetailResponse{Course:new(Course.CourseModel),Counts:make([]*Course.CourseCounts,0)}
err=c.GetDetail(context,request.(*Course.DetailRequest),rsp)
return rsp,err
rsp := &course.DetailResponse{Course: new(course.CourseModel), Counts: make([]*course.CourseCounts, 0)}
err = c.GetDetail(context, request.(*course.DetailRequest), rsp)
return rsp, err
}
}
//这个函数的作用是怎么处理请求
func Coursedetail_Request() gin_.EncodeRequestFunc{
func Coursedetail_Request() gin_.EncodeRequestFunc {
return func(context *gin.Context) (i interface{}, e error) {
bReq:=&Course.DetailRequest{}
err:=context.BindUri(bReq)
if err!=nil{
return nil,err
bReq := &course.DetailRequest{}
err := context.BindUri(bReq)
if err != nil {
return nil, err
}
err=context.BindHeader(bReq)
if err!=nil{
return nil,err
err = context.BindHeader(bReq)
if err != nil {
return nil, err
}
return bReq,nil
return bReq, nil
}
}
//获取列表相关
func Courselist_Endpoint(c *service.CourseServiceImpl) gin_.Endpoint {
func Courselist_Endpoint(c *service.CourseServiceImpl) gin_.Endpoint {
return func(context *gin.Context, request interface{}) (response interface{}, err error) {
rsp:=&Course.ListResponse{}
err=c.ListForTop(context,request.(*Course.ListRequest),rsp)
return rsp,err
rsp := &course.ListResponse{}
err = c.ListForTop(context, request.(*course.ListRequest), rsp)
return rsp, err
}
}
//这个函数的作用是怎么处理请求
func Courselist_Request() gin_.EncodeRequestFunc{
func Courselist_Request() gin_.EncodeRequestFunc {
return func(context *gin.Context) (i interface{}, e error) {
bReq:=&Course.ListRequest{}
err:=context.BindQuery(bReq) //使用的是query 参数
if err!=nil{
return nil,err
bReq := &course.ListRequest{}
err := context.BindQuery(bReq) //使用的是query 参数
if err != nil {
return nil, err
}
return bReq,nil
return bReq, nil
}
}
//这个函数作用是:怎么处理响应结果
func Course_Response() gin_.DecodeResponseFunc {
func Course_Response() gin_.DecodeResponseFunc {
return func(context *gin.Context, res interface{}) error {
context.JSON(200,res)
context.JSON(200, res)
return nil
}
}
\ No newline at end of file
}
......@@ -2,9 +2,9 @@ package lib
import (
"github.com/gin-gonic/gin"
"jtthink/framework/gin_"
"jtthink/Course"
"jtthink/service"
"search_server/framework/gin_"
"search_server/protopb/course"
"search_server/service"
)
func init() {
......@@ -14,21 +14,19 @@ func init() {
WithEndpoint(CourseTopicList_Endpoint(courseService)).
WithRequest(CourseTopicList_Request()).
WithResponse(Course_Response()).Build("/topic/:cid","GET")
}
func CourseTopicList_Endpoint(c *service.CourseTopicServiceImpl) gin_.Endpoint {
return func(context *gin.Context, request interface{}) (response interface{}, err error) {
rsp:=&Course.TopicResponse{Result:make([]*Course.CourseTopic,0)}
err=c.GetTopic(context,request.(*Course.TopicRequest),rsp)
rsp:=&course.TopicResponse{Result:make([]*course.CourseTopic,0)}
err=c.GetTopic(context,request.(*course.TopicRequest),rsp)
return rsp,err
}
}
//这个函数的作用是怎么处理请求
func CourseTopicList_Request() gin_.EncodeRequestFunc{
return func(context *gin.Context) (i interface{}, e error) {
bReq:=&Course.TopicRequest{}
bReq:=&course.TopicRequest{}
err:=context.BindUri(bReq) //使用的是query 参数
if err!=nil{
return nil,err
......
......@@ -3,7 +3,7 @@ package lib
import (
"fmt"
"github.com/gin-gonic/gin"
"jtthink/framework/gin_"
"search_server/framework/gin_"
"net/http"
)
......
......@@ -3,7 +3,7 @@ package gredis
import (
"encoding/json"
"github.com/gomodule/redigo/redis"
"jtthink/pkg/config"
"search_server/pkg/config"
"time"
)
......
......@@ -4,8 +4,8 @@ import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
"jtthink/pkg/config"
"jtthink/pkg/e"
"search_server/pkg/config"
"search_server/pkg/e"
)
//mysql相关
......
package Vars
package vars
const (
Table_CourseMain="course_main"
......
::protoc --proto_path=src/protos --micro_out=src/Users --go_out=src/Users Users.proto
protoc --proto_path=src/protos --micro_out=src/Course --go_out=src/Course Course.proto
protoc-go-inject-tag -input=src/Course/Course.pb.go
protoc --proto_path=src/protos --micro_out=src/Course --go_out=src/Course Common.proto
protoc --proto_path=src/protos --micro_out=src/Course --go_out=src/Course CourseTopic.proto
protoc-go-inject-tag -input=src/Course/CourseTopic.pb.go
\ No newline at end of file
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: common.proto
package common
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
timestamp "github.com/golang/protobuf/ptypes/timestamp"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type Timestamp struct {
Timestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
Timestr string `protobuf:"bytes,2,opt,name=timestr,proto3" json:"timestr,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Timestamp) Reset() { *m = Timestamp{} }
func (m *Timestamp) String() string { return proto.CompactTextString(m) }
func (*Timestamp) ProtoMessage() {}
func (*Timestamp) Descriptor() ([]byte, []int) {
return fileDescriptor_555bd8c177793206, []int{0}
}
func (m *Timestamp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Timestamp.Unmarshal(m, b)
}
func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
}
func (m *Timestamp) XXX_Merge(src proto.Message) {
xxx_messageInfo_Timestamp.Merge(m, src)
}
func (m *Timestamp) XXX_Size() int {
return xxx_messageInfo_Timestamp.Size(m)
}
func (m *Timestamp) XXX_DiscardUnknown() {
xxx_messageInfo_Timestamp.DiscardUnknown(m)
}
var xxx_messageInfo_Timestamp proto.InternalMessageInfo
func (m *Timestamp) GetTimestamp() *timestamp.Timestamp {
if m != nil {
return m.Timestamp
}
return nil
}
func (m *Timestamp) GetTimestr() string {
if m != nil {
return m.Timestr
}
return ""
}
func init() {
proto.RegisterType((*Timestamp)(nil), "common.Timestamp")
}
func init() { proto.RegisterFile("common.proto", fileDescriptor_555bd8c177793206) }
var fileDescriptor_555bd8c177793206 = []byte{
// 121 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0xce, 0xcf, 0xcd,
0xcd, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0xf0, 0xa4, 0xe4, 0xd3, 0xf3,
0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0xa2, 0x49, 0xa5, 0x69, 0xfa, 0x25, 0x99, 0xb9, 0xa9, 0xc5,
0x25, 0x89, 0xb9, 0x05, 0x10, 0x85, 0x4a, 0xf1, 0x5c, 0x9c, 0x21, 0x30, 0x21, 0x21, 0x0b, 0x2e,
0x4e, 0xb8, 0xbc, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x94, 0x1e, 0xc4, 0x04, 0x3d, 0x98,
0x09, 0x7a, 0x70, 0xe5, 0x41, 0x08, 0xc5, 0x42, 0x12, 0x5c, 0xec, 0x10, 0x4e, 0x91, 0x04, 0x93,
0x02, 0xa3, 0x06, 0x67, 0x10, 0x8c, 0x9b, 0xc4, 0x06, 0xd6, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff,
0xff, 0x1b, 0x45, 0x2b, 0x0e, 0xa0, 0x00, 0x00, 0x00,
}
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: Common.proto
// source: common.proto
package Course
package common
import (
fmt "fmt"
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: course.proto
package course
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type CourseModel struct {
CourseId int32 `protobuf:"varint,1,opt,name=course_id,json=courseId,proto3" json:"course_id,omitempty"`
CourseName string `protobuf:"bytes,2,opt,name=course_name,json=courseName,proto3" json:"course_name,omitempty"`
CourseDispName string `protobuf:"bytes,3,opt,name=course_disp_name,json=courseDispName,proto3" json:"course_disp_name,omitempty"`
CourseIntr string `protobuf:"bytes,4,opt,name=course_intr,json=courseIntr,proto3" json:"course_intr,omitempty"`
CoursePrice float32 `protobuf:"fixed32,5,opt,name=course_price,json=coursePrice,proto3" json:"course_price,omitempty"`
CoursePrice2 float32 `protobuf:"fixed32,6,opt,name=course_price2,json=coursePrice2,proto3" json:"course_price2,omitempty"`
// @inject_tag: gorm:"type:timestamp"
Addtime *Timestamp `protobuf:"bytes,7,opt,name=addtime,proto3" json:"addtime,omitempty" gorm:"type:timestamp"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CourseModel) Reset() { *m = CourseModel{} }
func (m *CourseModel) String() string { return proto.CompactTextString(m) }
func (*CourseModel) ProtoMessage() {}
func (*CourseModel) Descriptor() ([]byte, []int) {
return fileDescriptor_ad75674299e1bb1e, []int{0}
}
func (m *CourseModel) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CourseModel.Unmarshal(m, b)
}
func (m *CourseModel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CourseModel.Marshal(b, m, deterministic)
}
func (m *CourseModel) XXX_Merge(src proto.Message) {
xxx_messageInfo_CourseModel.Merge(m, src)
}
func (m *CourseModel) XXX_Size() int {
return xxx_messageInfo_CourseModel.Size(m)
}
func (m *CourseModel) XXX_DiscardUnknown() {
xxx_messageInfo_CourseModel.DiscardUnknown(m)
}
var xxx_messageInfo_CourseModel proto.InternalMessageInfo
func (m *CourseModel) GetCourseId() int32 {
if m != nil {
return m.CourseId
}
return 0
}
func (m *CourseModel) GetCourseName() string {
if m != nil {
return m.CourseName
}
return ""
}
func (m *CourseModel) GetCourseDispName() string {
if m != nil {
return m.CourseDispName
}
return ""
}
func (m *CourseModel) GetCourseIntr() string {
if m != nil {
return m.CourseIntr
}
return ""
}
func (m *CourseModel) GetCoursePrice() float32 {
if m != nil {
return m.CoursePrice
}
return 0
}
func (m *CourseModel) GetCoursePrice2() float32 {
if m != nil {
return m.CoursePrice2
}
return 0
}
func (m *CourseModel) GetAddtime() *Timestamp {
if m != nil {
return m.Addtime
}
return nil
}
type ListRequest struct {
// @inject_tag: form:"size"
Size int32 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty" form:"size"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListRequest) Reset() { *m = ListRequest{} }
func (m *ListRequest) String() string { return proto.CompactTextString(m) }
func (*ListRequest) ProtoMessage() {}
func (*ListRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_ad75674299e1bb1e, []int{1}
}
func (m *ListRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListRequest.Unmarshal(m, b)
}
func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListRequest.Marshal(b, m, deterministic)
}
func (m *ListRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListRequest.Merge(m, src)
}
func (m *ListRequest) XXX_Size() int {
return xxx_messageInfo_ListRequest.Size(m)
}
func (m *ListRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ListRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ListRequest proto.InternalMessageInfo
func (m *ListRequest) GetSize() int32 {
if m != nil {
return m.Size
}
return 0
}
type DetailRequest struct {
// @inject_tag: uri:"course_id"
CourseId int32 `protobuf:"varint,1,opt,name=course_id,json=courseId,proto3" json:"course_id,omitempty" uri:"course_id"`
// @inject_tag: header:"fetch_type"
FetchType int32 `protobuf:"varint,2,opt,name=fetch_type,json=fetchType,proto3" json:"fetch_type,omitempty" header:"fetch_type"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DetailRequest) Reset() { *m = DetailRequest{} }
func (m *DetailRequest) String() string { return proto.CompactTextString(m) }
func (*DetailRequest) ProtoMessage() {}
func (*DetailRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_ad75674299e1bb1e, []int{2}
}
func (m *DetailRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DetailRequest.Unmarshal(m, b)
}
func (m *DetailRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DetailRequest.Marshal(b, m, deterministic)
}
func (m *DetailRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DetailRequest.Merge(m, src)
}
func (m *DetailRequest) XXX_Size() int {
return xxx_messageInfo_DetailRequest.Size(m)
}
func (m *DetailRequest) XXX_DiscardUnknown() {
xxx_messageInfo_DetailRequest.DiscardUnknown(m)
}
var xxx_messageInfo_DetailRequest proto.InternalMessageInfo
func (m *DetailRequest) GetCourseId() int32 {
if m != nil {
return m.CourseId
}
return 0
}
func (m *DetailRequest) GetFetchType() int32 {
if m != nil {
return m.FetchType
}
return 0
}
//计数
type CourseCounts struct {
// @inject_tag: json:"-"
CountId int32 `protobuf:"varint,1,opt,name=count_id,json=countId,proto3" json:"-"`
// @inject_tag: json:"-"
CourseId int32 `protobuf:"varint,2,opt,name=course_id,json=courseId,proto3" json:"-"`
CountKey string `protobuf:"bytes,3,opt,name=count_key,json=countKey,proto3" json:"count_key,omitempty"`
CountValue int32 `protobuf:"varint,4,opt,name=count_value,json=countValue,proto3" json:"count_value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CourseCounts) Reset() { *m = CourseCounts{} }
func (m *CourseCounts) String() string { return proto.CompactTextString(m) }
func (*CourseCounts) ProtoMessage() {}
func (*CourseCounts) Descriptor() ([]byte, []int) {
return fileDescriptor_ad75674299e1bb1e, []int{3}
}
func (m *CourseCounts) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CourseCounts.Unmarshal(m, b)
}
func (m *CourseCounts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CourseCounts.Marshal(b, m, deterministic)
}
func (m *CourseCounts) XXX_Merge(src proto.Message) {
xxx_messageInfo_CourseCounts.Merge(m, src)
}
func (m *CourseCounts) XXX_Size() int {
return xxx_messageInfo_CourseCounts.Size(m)
}
func (m *CourseCounts) XXX_DiscardUnknown() {
xxx_messageInfo_CourseCounts.DiscardUnknown(m)
}
var xxx_messageInfo_CourseCounts proto.InternalMessageInfo
func (m *CourseCounts) GetCountId() int32 {
if m != nil {
return m.CountId
}
return 0
}
func (m *CourseCounts) GetCourseId() int32 {
if m != nil {
return m.CourseId
}
return 0
}
func (m *CourseCounts) GetCountKey() string {
if m != nil {
return m.CountKey
}
return ""
}
func (m *CourseCounts) GetCountValue() int32 {
if m != nil {
return m.CountValue
}
return 0
}
type ListResponse struct {
Result []*CourseModel `protobuf:"bytes,1,rep,name=result,proto3" json:"result,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListResponse) Reset() { *m = ListResponse{} }
func (m *ListResponse) String() string { return proto.CompactTextString(m) }
func (*ListResponse) ProtoMessage() {}
func (*ListResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_ad75674299e1bb1e, []int{4}
}
func (m *ListResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListResponse.Unmarshal(m, b)
}
func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListResponse.Marshal(b, m, deterministic)
}
func (m *ListResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListResponse.Merge(m, src)
}
func (m *ListResponse) XXX_Size() int {
return xxx_messageInfo_ListResponse.Size(m)
}
func (m *ListResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ListResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ListResponse proto.InternalMessageInfo
func (m *ListResponse) GetResult() []*CourseModel {
if m != nil {
return m.Result
}
return nil
}
type DetailResponse struct {
Course *CourseModel `protobuf:"bytes,1,opt,name=course,proto3" json:"course,omitempty"`
Counts []*CourseCounts `protobuf:"bytes,2,rep,name=counts,proto3" json:"counts,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DetailResponse) Reset() { *m = DetailResponse{} }
func (m *DetailResponse) String() string { return proto.CompactTextString(m) }
func (*DetailResponse) ProtoMessage() {}
func (*DetailResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_ad75674299e1bb1e, []int{5}
}
func (m *DetailResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DetailResponse.Unmarshal(m, b)
}
func (m *DetailResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DetailResponse.Marshal(b, m, deterministic)
}
func (m *DetailResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_DetailResponse.Merge(m, src)
}
func (m *DetailResponse) XXX_Size() int {
return xxx_messageInfo_DetailResponse.Size(m)
}
func (m *DetailResponse) XXX_DiscardUnknown() {
xxx_messageInfo_DetailResponse.DiscardUnknown(m)
}
var xxx_messageInfo_DetailResponse proto.InternalMessageInfo
func (m *DetailResponse) GetCourse() *CourseModel {
if m != nil {
return m.Course
}
return nil
}
func (m *DetailResponse) GetCounts() []*CourseCounts {
if m != nil {
return m.Counts
}
return nil
}
func init() {
proto.RegisterType((*CourseModel)(nil), "course.CourseModel")
proto.RegisterType((*ListRequest)(nil), "course.ListRequest")
proto.RegisterType((*DetailRequest)(nil), "course.DetailRequest")
proto.RegisterType((*CourseCounts)(nil), "course.CourseCounts")
proto.RegisterType((*ListResponse)(nil), "course.ListResponse")
proto.RegisterType((*DetailResponse)(nil), "course.DetailResponse")
}
func init() { proto.RegisterFile("course.proto", fileDescriptor_ad75674299e1bb1e) }
var fileDescriptor_ad75674299e1bb1e = []byte{
// 449 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0x4f, 0x6f, 0xd3, 0x40,
0x10, 0xc5, 0xe5, 0xb4, 0x49, 0xc8, 0xd8, 0xa9, 0x60, 0x29, 0xc8, 0x04, 0x21, 0x5c, 0x73, 0xb1,
0x54, 0x94, 0x83, 0x39, 0x20, 0xc1, 0xb1, 0x15, 0x28, 0x2a, 0x20, 0x64, 0x22, 0xae, 0x96, 0x89,
0x07, 0xb1, 0x6a, 0xbc, 0x6b, 0xbc, 0xe3, 0x4a, 0xe1, 0xdc, 0x1b, 0x5f, 0x1a, 0x79, 0x67, 0x4d,
0x9c, 0x4a, 0x70, 0xf3, 0xbe, 0xf9, 0xcd, 0x9f, 0x7d, 0x3b, 0x86, 0x60, 0xa3, 0xdb, 0xc6, 0xe0,
0xb2, 0x6e, 0x34, 0x69, 0x31, 0xe1, 0xd3, 0x22, 0xd8, 0xe8, 0xaa, 0xd2, 0x8a, 0xd5, 0xf8, 0xf7,
0x08, 0xfc, 0x0b, 0x1b, 0xf8, 0xa8, 0x4b, 0xdc, 0x8a, 0xa7, 0x30, 0x63, 0x2e, 0x97, 0x65, 0xe8,
0x45, 0x5e, 0x32, 0xce, 0xee, 0xb1, 0xb0, 0x2a, 0xc5, 0x73, 0xf0, 0x5d, 0x50, 0x15, 0x15, 0x86,
0xa3, 0xc8, 0x4b, 0x66, 0x19, 0xb0, 0xf4, 0xa9, 0xa8, 0x50, 0x24, 0x70, 0xdf, 0x01, 0xa5, 0x34,
0x35, 0x53, 0x47, 0x96, 0x3a, 0x61, 0xfd, 0x52, 0x9a, 0xda, 0x92, 0xfb, 0x52, 0x52, 0x51, 0x13,
0x1e, 0x0f, 0x4b, 0xad, 0x14, 0x35, 0xe2, 0xac, 0x1f, 0x3f, 0xaf, 0x1b, 0xb9, 0xc1, 0x70, 0x1c,
0x79, 0xc9, 0x28, 0x73, 0x49, 0x9f, 0x3b, 0x49, 0xbc, 0x80, 0xf9, 0x10, 0x49, 0xc3, 0x89, 0x65,
0x82, 0x01, 0x93, 0x8a, 0x73, 0x98, 0x16, 0x65, 0x49, 0xb2, 0xc2, 0x70, 0x1a, 0x79, 0x89, 0x9f,
0x3e, 0x58, 0x3a, 0x03, 0xd6, 0xb2, 0x42, 0x43, 0x45, 0x55, 0x67, 0x3d, 0x11, 0x9f, 0x81, 0xff,
0x41, 0x1a, 0xca, 0xf0, 0x67, 0x8b, 0x86, 0x84, 0x80, 0x63, 0x23, 0x7f, 0xa1, 0xf3, 0xc1, 0x7e,
0xc7, 0x57, 0x30, 0xbf, 0x44, 0x2a, 0xe4, 0xb6, 0x87, 0xfe, 0xeb, 0xd8, 0x33, 0x80, 0xef, 0x48,
0x9b, 0x1f, 0x39, 0xed, 0x6a, 0x36, 0x6c, 0x9c, 0xcd, 0xac, 0xb2, 0xde, 0xd5, 0x18, 0xdf, 0x7a,
0x10, 0xb0, 0xfb, 0x17, 0xba, 0x55, 0x64, 0xc4, 0x13, 0xe8, 0x72, 0x15, 0xed, 0x6b, 0x4d, 0xed,
0x79, 0x55, 0x1e, 0xf6, 0x19, 0xdd, 0xe9, 0xc3, 0x41, 0x45, 0xf9, 0x35, 0xee, 0x9c, 0xe3, 0x5c,
0xe8, 0x0a, 0x77, 0xce, 0x6b, 0x45, 0xf9, 0x4d, 0xb1, 0x6d, 0xd1, 0x7a, 0x3d, 0xb6, 0x5e, 0x2b,
0xfa, 0xda, 0x29, 0xf1, 0x5b, 0x08, 0xf8, 0xda, 0xa6, 0xd6, 0xca, 0xa0, 0x38, 0x87, 0x49, 0x83,
0xa6, 0xdd, 0x52, 0xe8, 0x45, 0x47, 0x89, 0x9f, 0x3e, 0x5c, 0xba, 0x4d, 0x1a, 0x6c, 0x4a, 0xe6,
0x90, 0xf8, 0x1a, 0x4e, 0x7a, 0x43, 0xf6, 0xe9, 0xcc, 0xdb, 0x2b, 0xfc, 0x2b, 0x9d, 0x35, 0xf1,
0xd2, 0xc2, 0x8a, 0x4c, 0x38, 0xb2, 0xbd, 0x4e, 0x0f, 0x61, 0xf6, 0x25, 0x73, 0x4c, 0x7a, 0xeb,
0xc1, 0x9c, 0x03, 0x5f, 0xb0, 0xb9, 0xe9, 0x96, 0xe0, 0x35, 0x40, 0x37, 0xfb, 0x3b, 0xdd, 0xac,
0x75, 0x2d, 0xfe, 0xb6, 0x1a, 0x3c, 0xe3, 0xe2, 0xf4, 0x50, 0x74, 0x53, 0xbe, 0x81, 0xd9, 0x7b,
0x24, 0x1e, 0x5d, 0x3c, 0xea, 0x91, 0x83, 0xb7, 0x5d, 0x3c, 0xbe, 0x2b, 0x73, 0xee, 0xb7, 0x89,
0xfd, 0x79, 0x5e, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0x3d, 0xb6, 0x49, 0xa7, 0x62, 0x03, 0x00,
0x00,
}
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: Course.proto
// source: course.proto
package Course
package course
import (
fmt "fmt"
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: course_topic.proto
package course
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type CourseTopic struct {
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
CourseId int32 `protobuf:"varint,2,opt,name=CourseId,proto3" json:"CourseId,omitempty"`
CourseDid int32 `protobuf:"varint,3,opt,name=CourseDid,proto3" json:"CourseDid,omitempty"`
Likes int32 `protobuf:"varint,4,opt,name=Likes,proto3" json:"Likes,omitempty"`
Unlikes int32 `protobuf:"varint,5,opt,name=Unlikes,proto3" json:"Unlikes,omitempty"`
Title string `protobuf:"bytes,6,opt,name=Title,proto3" json:"Title,omitempty"`
Content string `protobuf:"bytes,7,opt,name=Content,proto3" json:"Content,omitempty"`
UserId int32 `protobuf:"varint,8,opt,name=UserId,proto3" json:"UserId,omitempty"`
Addtime *Timestamp `protobuf:"bytes,9,opt,name=Addtime,proto3" json:"Addtime,omitempty"`
Updatetime *Timestamp `protobuf:"bytes,10,opt,name=Updatetime,proto3" json:"Updatetime,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CourseTopic) Reset() { *m = CourseTopic{} }
func (m *CourseTopic) String() string { return proto.CompactTextString(m) }
func (*CourseTopic) ProtoMessage() {}
func (*CourseTopic) Descriptor() ([]byte, []int) {
return fileDescriptor_f51a07ace88d3cfc, []int{0}
}
func (m *CourseTopic) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CourseTopic.Unmarshal(m, b)
}
func (m *CourseTopic) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CourseTopic.Marshal(b, m, deterministic)
}
func (m *CourseTopic) XXX_Merge(src proto.Message) {
xxx_messageInfo_CourseTopic.Merge(m, src)
}
func (m *CourseTopic) XXX_Size() int {
return xxx_messageInfo_CourseTopic.Size(m)
}
func (m *CourseTopic) XXX_DiscardUnknown() {
xxx_messageInfo_CourseTopic.DiscardUnknown(m)
}
var xxx_messageInfo_CourseTopic proto.InternalMessageInfo
func (m *CourseTopic) GetId() int32 {
if m != nil {
return m.Id
}
return 0
}
func (m *CourseTopic) GetCourseId() int32 {
if m != nil {
return m.CourseId
}
return 0
}
func (m *CourseTopic) GetCourseDid() int32 {
if m != nil {
return m.CourseDid
}
return 0
}
func (m *CourseTopic) GetLikes() int32 {
if m != nil {
return m.Likes
}
return 0
}
func (m *CourseTopic) GetUnlikes() int32 {
if m != nil {
return m.Unlikes
}
return 0
}
func (m *CourseTopic) GetTitle() string {
if m != nil {
return m.Title
}
return ""
}
func (m *CourseTopic) GetContent() string {
if m != nil {
return m.Content
}
return ""
}
func (m *CourseTopic) GetUserId() int32 {
if m != nil {
return m.UserId
}
return 0
}
func (m *CourseTopic) GetAddtime() *Timestamp {
if m != nil {
return m.Addtime
}
return nil
}
func (m *CourseTopic) GetUpdatetime() *Timestamp {
if m != nil {
return m.Updatetime
}
return nil
}
type CourseTopicReply struct {
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
TopicId int32 `protobuf:"varint,2,opt,name=TopicId,proto3" json:"TopicId,omitempty"`
Content string `protobuf:"bytes,3,opt,name=Content,proto3" json:"Content,omitempty"`
UserId int32 `protobuf:"varint,4,opt,name=UserId,proto3" json:"UserId,omitempty"`
Likes int32 `protobuf:"varint,5,opt,name=Likes,proto3" json:"Likes,omitempty"`
Unlikes int32 `protobuf:"varint,6,opt,name=Unlikes,proto3" json:"Unlikes,omitempty"`
Addtime *Timestamp `protobuf:"bytes,7,opt,name=Addtime,proto3" json:"Addtime,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CourseTopicReply) Reset() { *m = CourseTopicReply{} }
func (m *CourseTopicReply) String() string { return proto.CompactTextString(m) }
func (*CourseTopicReply) ProtoMessage() {}
func (*CourseTopicReply) Descriptor() ([]byte, []int) {
return fileDescriptor_f51a07ace88d3cfc, []int{1}
}
func (m *CourseTopicReply) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CourseTopicReply.Unmarshal(m, b)
}
func (m *CourseTopicReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CourseTopicReply.Marshal(b, m, deterministic)
}
func (m *CourseTopicReply) XXX_Merge(src proto.Message) {
xxx_messageInfo_CourseTopicReply.Merge(m, src)
}
func (m *CourseTopicReply) XXX_Size() int {
return xxx_messageInfo_CourseTopicReply.Size(m)
}
func (m *CourseTopicReply) XXX_DiscardUnknown() {
xxx_messageInfo_CourseTopicReply.DiscardUnknown(m)
}
var xxx_messageInfo_CourseTopicReply proto.InternalMessageInfo
func (m *CourseTopicReply) GetId() int32 {
if m != nil {
return m.Id
}
return 0
}
func (m *CourseTopicReply) GetTopicId() int32 {
if m != nil {
return m.TopicId
}
return 0
}
func (m *CourseTopicReply) GetContent() string {
if m != nil {
return m.Content
}
return ""
}
func (m *CourseTopicReply) GetUserId() int32 {
if m != nil {
return m.UserId
}
return 0
}
func (m *CourseTopicReply) GetLikes() int32 {
if m != nil {
return m.Likes
}
return 0
}
func (m *CourseTopicReply) GetUnlikes() int32 {
if m != nil {
return m.Unlikes
}
return 0
}
func (m *CourseTopicReply) GetAddtime() *Timestamp {
if m != nil {
return m.Addtime
}
return nil
}
type TopicRequest struct {
CourseId int32 `protobuf:"varint,1,opt,name=CourseId,proto3" json:"CourseId,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TopicRequest) Reset() { *m = TopicRequest{} }
func (m *TopicRequest) String() string { return proto.CompactTextString(m) }
func (*TopicRequest) ProtoMessage() {}
func (*TopicRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_f51a07ace88d3cfc, []int{2}
}
func (m *TopicRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TopicRequest.Unmarshal(m, b)
}
func (m *TopicRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TopicRequest.Marshal(b, m, deterministic)
}
func (m *TopicRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_TopicRequest.Merge(m, src)
}
func (m *TopicRequest) XXX_Size() int {
return xxx_messageInfo_TopicRequest.Size(m)
}
func (m *TopicRequest) XXX_DiscardUnknown() {
xxx_messageInfo_TopicRequest.DiscardUnknown(m)
}
var xxx_messageInfo_TopicRequest proto.InternalMessageInfo
func (m *TopicRequest) GetCourseId() int32 {
if m != nil {
return m.CourseId
}
return 0
}
type TopicResponse struct {
Result []*CourseTopic `protobuf:"bytes,1,rep,name=result,proto3" json:"result,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TopicResponse) Reset() { *m = TopicResponse{} }
func (m *TopicResponse) String() string { return proto.CompactTextString(m) }
func (*TopicResponse) ProtoMessage() {}
func (*TopicResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_f51a07ace88d3cfc, []int{3}
}
func (m *TopicResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TopicResponse.Unmarshal(m, b)
}
func (m *TopicResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TopicResponse.Marshal(b, m, deterministic)
}
func (m *TopicResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_TopicResponse.Merge(m, src)
}
func (m *TopicResponse) XXX_Size() int {
return xxx_messageInfo_TopicResponse.Size(m)
}
func (m *TopicResponse) XXX_DiscardUnknown() {
xxx_messageInfo_TopicResponse.DiscardUnknown(m)
}
var xxx_messageInfo_TopicResponse proto.InternalMessageInfo
func (m *TopicResponse) GetResult() []*CourseTopic {
if m != nil {
return m.Result
}
return nil
}
func init() {
proto.RegisterType((*CourseTopic)(nil), "course.CourseTopic")
proto.RegisterType((*CourseTopicReply)(nil), "course.CourseTopicReply")
proto.RegisterType((*TopicRequest)(nil), "course.TopicRequest")
proto.RegisterType((*TopicResponse)(nil), "course.TopicResponse")
}
func init() { proto.RegisterFile("course_topic.proto", fileDescriptor_f51a07ace88d3cfc) }
var fileDescriptor_f51a07ace88d3cfc = []byte{
// 360 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x41, 0x4f, 0x83, 0x40,
0x10, 0x85, 0x03, 0x2d, 0xd0, 0x4e, 0xab, 0xd1, 0xb5, 0x9a, 0x4d, 0xe3, 0x81, 0x70, 0x22, 0x36,
0x21, 0xb1, 0x1e, 0xbc, 0x78, 0x31, 0x35, 0x31, 0x24, 0x7a, 0xc1, 0xf6, 0x6c, 0x2a, 0x3b, 0x07,
0x22, 0xb0, 0xc8, 0x6e, 0x4d, 0xfc, 0x55, 0xfe, 0x10, 0xff, 0x94, 0xe9, 0x2e, 0xd4, 0x45, 0xd3,
0x78, 0xe3, 0xbd, 0x79, 0xc0, 0xbe, 0x6f, 0x07, 0x48, 0xca, 0x37, 0xb5, 0xc0, 0x67, 0xc9, 0xab,
0x2c, 0x8d, 0xaa, 0x9a, 0x4b, 0x4e, 0x5c, 0xed, 0x4d, 0xc7, 0x29, 0x2f, 0x0a, 0x5e, 0x6a, 0x37,
0xf8, 0xb4, 0x61, 0xb4, 0x50, 0x83, 0xe5, 0x36, 0x4b, 0x0e, 0xc1, 0x8e, 0x19, 0xb5, 0x7c, 0x2b,
0x74, 0x12, 0x3b, 0x66, 0x64, 0x0a, 0x03, 0x3d, 0x8e, 0x19, 0xb5, 0x95, 0xbb, 0xd3, 0xe4, 0x1c,
0x86, 0xfa, 0xf9, 0x2e, 0x63, 0xb4, 0xa7, 0x86, 0x3f, 0x06, 0x99, 0x80, 0xf3, 0x90, 0xbd, 0xa2,
0xa0, 0x7d, 0x35, 0xd1, 0x82, 0x50, 0xf0, 0x56, 0x65, 0xae, 0x7c, 0x47, 0xf9, 0xad, 0xdc, 0xe6,
0x97, 0x99, 0xcc, 0x91, 0xba, 0xbe, 0x15, 0x0e, 0x13, 0x2d, 0xb6, 0xf9, 0x05, 0x2f, 0x25, 0x96,
0x92, 0x7a, 0xca, 0x6f, 0x25, 0x39, 0x03, 0x77, 0x25, 0xb0, 0x8e, 0x19, 0x1d, 0xa8, 0x0f, 0x35,
0x8a, 0xcc, 0xc0, 0xbb, 0x65, 0x4c, 0x66, 0x05, 0xd2, 0xa1, 0x6f, 0x85, 0xa3, 0xf9, 0x71, 0xd4,
0x34, 0x5e, 0x66, 0x05, 0x0a, 0xb9, 0x2e, 0xaa, 0xa4, 0x4d, 0x90, 0x4b, 0x80, 0x55, 0xc5, 0xd6,
0x12, 0x55, 0x1e, 0xf6, 0xe5, 0x8d, 0x50, 0xf0, 0x65, 0xc1, 0x91, 0x41, 0x2c, 0xc1, 0x2a, 0xff,
0xf8, 0x83, 0x8d, 0x82, 0xa7, 0xa6, 0x3b, 0x6a, 0xad, 0x34, 0x0b, 0xf5, 0xf6, 0x15, 0xea, 0x77,
0x0a, 0xed, 0x40, 0x3a, 0x7b, 0x40, 0xba, 0x5d, 0x90, 0x06, 0x00, 0xef, 0x3f, 0x00, 0xc1, 0x05,
0x8c, 0x9b, 0x1a, 0x6f, 0x1b, 0x14, 0xb2, 0x73, 0xdf, 0x56, 0xf7, 0xbe, 0x83, 0x1b, 0x38, 0x68,
0xb2, 0xa2, 0xe2, 0xa5, 0x40, 0x32, 0x03, 0xb7, 0x46, 0xb1, 0xc9, 0x25, 0xb5, 0xfc, 0x5e, 0x38,
0x9a, 0x9f, 0x44, 0x7a, 0xc7, 0x22, 0x93, 0x4f, 0x13, 0x99, 0x3f, 0x02, 0x31, 0xec, 0x27, 0xac,
0xdf, 0xb3, 0x14, 0xc9, 0x35, 0x0c, 0xee, 0x51, 0xea, 0xdd, 0x9b, 0xb4, 0xaf, 0x9b, 0x27, 0x9a,
0x9e, 0xfe, 0x72, 0xf5, 0xbf, 0x5f, 0x5c, 0xb5, 0xbf, 0x57, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff,
0x79, 0x8f, 0x11, 0xab, 0xeb, 0x02, 0x00, 0x00,
}
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: CourseTopic.proto
// source: course_topic.proto
package Course
package course
import (
fmt "fmt"
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: users.proto
package users
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type UserRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *UserRequest) Reset() { *m = UserRequest{} }
func (m *UserRequest) String() string { return proto.CompactTextString(m) }
func (*UserRequest) ProtoMessage() {}
func (*UserRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_030765f334c86cea, []int{0}
}
func (m *UserRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UserRequest.Unmarshal(m, b)
}
func (m *UserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UserRequest.Marshal(b, m, deterministic)
}
func (m *UserRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_UserRequest.Merge(m, src)
}
func (m *UserRequest) XXX_Size() int {
return xxx_messageInfo_UserRequest.Size(m)
}
func (m *UserRequest) XXX_DiscardUnknown() {
xxx_messageInfo_UserRequest.DiscardUnknown(m)
}
var xxx_messageInfo_UserRequest proto.InternalMessageInfo
func (m *UserRequest) GetId() string {
if m != nil {
return m.Id
}
return ""
}
type UserResponse struct {
Ret string `protobuf:"bytes,2,opt,name=ret,proto3" json:"ret,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *UserResponse) Reset() { *m = UserResponse{} }
func (m *UserResponse) String() string { return proto.CompactTextString(m) }
func (*UserResponse) ProtoMessage() {}
func (*UserResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_030765f334c86cea, []int{1}
}
func (m *UserResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UserResponse.Unmarshal(m, b)
}
func (m *UserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UserResponse.Marshal(b, m, deterministic)
}
func (m *UserResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_UserResponse.Merge(m, src)
}
func (m *UserResponse) XXX_Size() int {
return xxx_messageInfo_UserResponse.Size(m)
}
func (m *UserResponse) XXX_DiscardUnknown() {
xxx_messageInfo_UserResponse.DiscardUnknown(m)
}
var xxx_messageInfo_UserResponse proto.InternalMessageInfo
func (m *UserResponse) GetRet() string {
if m != nil {
return m.Ret
}
return ""
}
func init() {
proto.RegisterType((*UserRequest)(nil), "users.UserRequest")
proto.RegisterType((*UserResponse)(nil), "users.UserResponse")
}
func init() { proto.RegisterFile("users.proto", fileDescriptor_030765f334c86cea) }
var fileDescriptor_030765f334c86cea = []byte{
// 134 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2e, 0x2d, 0x4e, 0x2d,
0x2a, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x73, 0x94, 0x64, 0xb9, 0xb8, 0x43,
0x8b, 0x53, 0x8b, 0x82, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0xf8, 0xb8, 0x98, 0x32, 0x53,
0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x98, 0x32, 0x53, 0x94, 0x14, 0xb8, 0x78, 0x20, 0xd2,
0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x42, 0x02, 0x5c, 0xcc, 0x45, 0xa9, 0x25, 0x12, 0x4c, 0x60,
0x05, 0x20, 0xa6, 0x91, 0x03, 0xc4, 0x80, 0xe0, 0xd4, 0xa2, 0xb2, 0xcc, 0xe4, 0x54, 0x21, 0x43,
0x2e, 0x96, 0x10, 0x90, 0x41, 0x42, 0x7a, 0x10, 0xcb, 0x90, 0x0c, 0x97, 0x12, 0x46, 0x11, 0x83,
0x98, 0xa8, 0xc4, 0x90, 0xc4, 0x06, 0x76, 0x90, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x35, 0x8a,
0xe3, 0x2d, 0x9f, 0x00, 0x00, 0x00,
}
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: Users.proto
// source: users.proto
package Users
package users
import (
fmt "fmt"
......
syntax = "proto3";
import "google/protobuf/timestamp.proto";
package Course;
package common;
message Timestamp {
google.protobuf.Timestamp timestamp = 1;
string timestr=2;
......
syntax = "proto3";
import "Common.proto";
package Course;
import "common.proto";
package course;
service CourseService {
......@@ -15,7 +15,7 @@ message CourseModel{
float course_price=5;
float course_price2=6;
// @inject_tag: gorm:"type:timestamp"
Timestamp addtime=7;
common.Timestamp addtime=7;
}
message ListRequest {
......
syntax = "proto3";
import "Common.proto";
package Course;
import "common.proto";
package course;
message CourseTopic{
int32 Id=1;
int32 CourseId=2;
......@@ -10,8 +10,8 @@ message CourseTopic{
string Title=6;
string Content=7;
int32 UserId=8;
Timestamp Addtime=9;
Timestamp Updatetime=10;
common.Timestamp Addtime=9;
common.Timestamp Updatetime=10;
}
message CourseTopicReply{
int32 Id=1;
......@@ -20,7 +20,7 @@ message CourseTopicReply{
int32 UserId=4;
int32 Likes=5;
int32 Unlikes=6;
Timestamp Addtime=7;
common.Timestamp Addtime=7;
}
message TopicRequest{
int32 CourseId=1;
......
syntax = "proto3";
package Users;
package users;
service UserService {
rpc Test(UserRequest) returns (UserResponse) {}
......
......@@ -2,32 +2,35 @@ package service
import (
"context"
. "jtthink/Course"
"jtthink/Mapper"
"search_server/Mapper"
. "search_server/protopb/course"
)
func NewCourseModel(id int32,name string) *CourseModel {
return &CourseModel{CourseId:id,CourseName:name}
func NewCourseModel(id int32, name string) *CourseModel {
return &CourseModel{CourseId: id, CourseName: name}
}
type CourseServiceImpl struct{}
func(this *CourseServiceImpl) ListForTop(ctx context.Context, req *ListRequest, rsp *ListResponse) error{
course:=make([]*CourseModel,0)
err:=Mapper.GetCourseListBySql(req.Size).Find(&course).Error
if err!=nil{
func (this *CourseServiceImpl) ListForTop(ctx context.Context, req *ListRequest, rsp *ListResponse) error {
course := make([]*CourseModel, 0)
err := Mapper.GetCourseListBySql(req.Size).Find(&course).Error
if err != nil {
return err
}
rsp.Result=course
rsp.Result = course
return nil
}
func(this *CourseServiceImpl) GetDetail(ctx context.Context,req *DetailRequest, rsp *DetailResponse) error{
func (this *CourseServiceImpl) GetDetail(ctx context.Context, req *DetailRequest, rsp *DetailResponse) error {
//只取课程详细
if req.FetchType==0 || req.FetchType==1 || req.FetchType==3{
if err:=Mapper.GetCourseDetail(int(req.CourseId)).Find(rsp.Course).Error;err!=nil{
if req.FetchType == 0 || req.FetchType == 1 || req.FetchType == 3 {
if err := Mapper.GetCourseDetail(int(req.CourseId)).Find(rsp.Course).Error; err != nil {
return err
}
}
//只取计数表详细
if req.FetchType==2 || req.FetchType==3{
if err:=Mapper.GetCourseCounts(int(req.CourseId)).Find(&rsp.Counts).Error;err!=nil{
if req.FetchType == 2 || req.FetchType == 3 {
if err := Mapper.GetCourseCounts(int(req.CourseId)).Find(&rsp.Counts).Error; err != nil {
return err
}
}
......@@ -36,6 +39,6 @@ func(this *CourseServiceImpl) GetDetail(ctx context.Context,req *DetailRequest,
}
func NewCourseServiceImpl() *CourseServiceImpl {
func NewCourseServiceImpl() *CourseServiceImpl {
return &CourseServiceImpl{}
}
\ No newline at end of file
}
......@@ -2,17 +2,18 @@ package service
import (
"context"
"jtthink/boot"
. "jtthink/Course"
. "search_server/protopb/course"
"search_server/pkg/mysql"
)
type CourseTopicServiceImpl struct {}
func(this *CourseTopicServiceImpl) GetTopic(ctx context.Context, in *TopicRequest, out *TopicResponse) error{
if err:= boot.GetDB().Table("course_topic").Find(&out.Result).Error;err!=nil {
return err
}
return nil
type CourseTopicServiceImpl struct{}
func (this *CourseTopicServiceImpl) GetTopic(ctx context.Context, in *TopicRequest, out *TopicResponse) error {
if err := mysql.GetDB().Table("course_topic").Find(&out.Result).Error; err != nil {
return err
}
return nil
}
func NewCourseTopicServiceImpl() *CourseTopicServiceImpl {
func NewCourseTopicServiceImpl() *CourseTopicServiceImpl {
return &CourseTopicServiceImpl{}
}
\ No newline at end of file
}
......@@ -3,8 +3,8 @@ package main
import (
"fmt"
"github.com/gomodule/redigo/redis"
"jtthink/boot"
"jtthink/pkg/gredis"
"search_server/boot"
"search_server/pkg/gredis"
)
func main() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment