diff --git a/.hz b/.hz index c53c414..f281615 100755 --- a/.hz +++ b/.hz @@ -1,3 +1,3 @@ // Code generated by hz. DO NOT EDIT. -hz version: v0.5.0 \ No newline at end of file +hz version: v0.5.2 diff --git a/biz/model/core/core.go b/biz/model/core/core.go index 8280727..0a04772 100755 --- a/biz/model/core/core.go +++ b/biz/model/core/core.go @@ -1,4 +1,4 @@ -// Code generated by thriftgo (0.2.5). DO NOT EDIT. +// Code generated by thriftgo (0.2.7). DO NOT EDIT. package core diff --git a/biz/model/interaction/interaction.go b/biz/model/interaction/interaction.go index 233fca6..d4ce73f 100755 --- a/biz/model/interaction/interaction.go +++ b/biz/model/interaction/interaction.go @@ -1,907 +1,19 @@ -// Code generated by thriftgo (0.2.5). DO NOT EDIT. +// Code generated by thriftgo (0.2.7). DO NOT EDIT. package interaction import ( "context" "fmt" + "github.com/ClubWeGo/douyin/biz/model/core" "github.com/apache/thrift/lib/go/thrift" ) -type User struct { - ID int64 `thrift:"id,1,required" form:"id,required" json:"id,required" query:"id,required"` - Name string `thrift:"name,2,required" form:"name,required" json:"name,required" query:"name,required"` - FollowCount *int64 `thrift:"follow_count,3,optional" form:"follow_count" json:"follow_count,omitempty" query:"follow_count"` - FollowerCount *int64 `thrift:"follower_count,4,optional" form:"follower_count" json:"follower_count,omitempty" query:"follower_count"` - IsFollow bool `thrift:"is_follow,5,required" form:"is_follow,required" json:"is_follow,required" query:"is_follow,required"` -} - -func NewUser() *User { - return &User{} -} - -func (p *User) GetID() (v int64) { - return p.ID -} - -func (p *User) GetName() (v string) { - return p.Name -} - -var User_FollowCount_DEFAULT int64 - -func (p *User) GetFollowCount() (v int64) { - if !p.IsSetFollowCount() { - return User_FollowCount_DEFAULT - } - return *p.FollowCount -} - -var User_FollowerCount_DEFAULT int64 - -func (p *User) GetFollowerCount() (v int64) { - if !p.IsSetFollowerCount() { - return User_FollowerCount_DEFAULT - } - return *p.FollowerCount -} - -func (p *User) GetIsFollow() (v bool) { - return p.IsFollow -} - -var fieldIDToName_User = map[int16]string{ - 1: "id", - 2: "name", - 3: "follow_count", - 4: "follower_count", - 5: "is_follow", -} - -func (p *User) IsSetFollowCount() bool { - return p.FollowCount != nil -} - -func (p *User) IsSetFollowerCount() bool { - return p.FollowerCount != nil -} - -func (p *User) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetID bool = false - var issetName bool = false - var issetIsFollow bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetID = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetName = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.I64 { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.I64 { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - issetIsFollow = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetID { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetName { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetIsFollow { - fieldId = 5 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_User[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_User[fieldId])) -} - -func (p *User) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - p.ID = v - } - return nil -} - -func (p *User) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return err - } else { - p.Name = v - } - return nil -} - -func (p *User) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - p.FollowCount = &v - } - return nil -} - -func (p *User) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - p.FollowerCount = &v - } - return nil -} - -func (p *User) ReadField5(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - p.IsFollow = v - } - return nil -} - -func (p *User) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("User"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *User) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.ID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *User) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Name); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *User) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetFollowCount() { - if err = oprot.WriteFieldBegin("follow_count", thrift.I64, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.FollowCount); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *User) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetFollowerCount() { - if err = oprot.WriteFieldBegin("follower_count", thrift.I64, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.FollowerCount); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *User) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("is_follow", thrift.BOOL, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(p.IsFollow); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - -func (p *User) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("User(%+v)", *p) -} - -type Video struct { - ID int64 `thrift:"id,1,required" form:"id,required" json:"id,required" query:"id,required"` - Author *User `thrift:"author,2,required" form:"author,required" json:"author,required" query:"author,required"` - PlayURL string `thrift:"play_url,3,required" form:"play_url,required" json:"play_url,required" query:"play_url,required"` - CoverURL string `thrift:"cover_url,4,required" form:"cover_url,required" json:"cover_url,required" query:"cover_url,required"` - FavoriteCount int64 `thrift:"favorite_count,5,required" form:"favorite_count,required" json:"favorite_count,required" query:"favorite_count,required"` - CommentCount int64 `thrift:"comment_count,6,required" form:"comment_count,required" json:"comment_count,required" query:"comment_count,required"` - IsFavorite bool `thrift:"is_favorite,7,required" form:"is_favorite,required" json:"is_favorite,required" query:"is_favorite,required"` - Title string `thrift:"title,8,required" form:"title,required" json:"title,required" query:"title,required"` -} - -func NewVideo() *Video { - return &Video{} -} - -func (p *Video) GetID() (v int64) { - return p.ID -} - -var Video_Author_DEFAULT *User - -func (p *Video) GetAuthor() (v *User) { - if !p.IsSetAuthor() { - return Video_Author_DEFAULT - } - return p.Author -} - -func (p *Video) GetPlayURL() (v string) { - return p.PlayURL -} - -func (p *Video) GetCoverURL() (v string) { - return p.CoverURL -} - -func (p *Video) GetFavoriteCount() (v int64) { - return p.FavoriteCount -} - -func (p *Video) GetCommentCount() (v int64) { - return p.CommentCount -} - -func (p *Video) GetIsFavorite() (v bool) { - return p.IsFavorite -} - -func (p *Video) GetTitle() (v string) { - return p.Title -} - -var fieldIDToName_Video = map[int16]string{ - 1: "id", - 2: "author", - 3: "play_url", - 4: "cover_url", - 5: "favorite_count", - 6: "comment_count", - 7: "is_favorite", - 8: "title", -} - -func (p *Video) IsSetAuthor() bool { - return p.Author != nil -} - -func (p *Video) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetID bool = false - var issetAuthor bool = false - var issetPlayURL bool = false - var issetCoverURL bool = false - var issetFavoriteCount bool = false - var issetCommentCount bool = false - var issetIsFavorite bool = false - var issetTitle bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetID = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetAuthor = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetPlayURL = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - issetCoverURL = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.I64 { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - issetFavoriteCount = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 6: - if fieldTypeId == thrift.I64 { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - issetCommentCount = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 7: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } - issetIsFavorite = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 8: - if fieldTypeId == thrift.STRING { - if err = p.ReadField8(iprot); err != nil { - goto ReadFieldError - } - issetTitle = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetID { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetAuthor { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetPlayURL { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetCoverURL { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetFavoriteCount { - fieldId = 5 - goto RequiredFieldNotSetError - } - - if !issetCommentCount { - fieldId = 6 - goto RequiredFieldNotSetError - } - - if !issetIsFavorite { - fieldId = 7 - goto RequiredFieldNotSetError - } - - if !issetTitle { - fieldId = 8 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Video[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_Video[fieldId])) -} - -func (p *Video) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - p.ID = v - } - return nil -} - -func (p *Video) ReadField2(iprot thrift.TProtocol) error { - p.Author = NewUser() - if err := p.Author.Read(iprot); err != nil { - return err - } - return nil -} - -func (p *Video) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return err - } else { - p.PlayURL = v - } - return nil -} - -func (p *Video) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return err - } else { - p.CoverURL = v - } - return nil -} - -func (p *Video) ReadField5(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - p.FavoriteCount = v - } - return nil -} - -func (p *Video) ReadField6(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - p.CommentCount = v - } - return nil -} - -func (p *Video) ReadField7(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - p.IsFavorite = v - } - return nil -} - -func (p *Video) ReadField8(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return err - } else { - p.Title = v - } - return nil -} - -func (p *Video) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("Video"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } - if err = p.writeField8(oprot); err != nil { - fieldId = 8 - goto WriteFieldError - } - - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *Video) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.ID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *Video) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("author", thrift.STRUCT, 2); err != nil { - goto WriteFieldBeginError - } - if err := p.Author.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *Video) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("play_url", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.PlayURL); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *Video) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("cover_url", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.CoverURL); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *Video) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("favorite_count", thrift.I64, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.FavoriteCount); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - -func (p *Video) writeField6(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("comment_count", thrift.I64, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.CommentCount); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} - -func (p *Video) writeField7(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("is_favorite", thrift.BOOL, 7); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(p.IsFavorite); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) -} - -func (p *Video) writeField8(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("title", thrift.STRING, 8); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Title); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) -} - -func (p *Video) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("Video(%+v)", *p) -} - type Comment struct { - ID int64 `thrift:"id,1,required" form:"id,required" json:"id,required" query:"id,required"` - User *User `thrift:"user,2,required" form:"user,required" json:"user,required" query:"user,required"` - Content string `thrift:"content,3,required" form:"content,required" json:"content,required" query:"content,required"` - CreateDate string `thrift:"create_date,4,required" form:"create_date,required" json:"create_date,required" query:"create_date,required"` + ID int64 `thrift:"id,1,required" form:"id,required" json:"id,required" query:"id,required"` + User *core.User `thrift:"user,2,required" form:"user,required" json:"user,required" query:"user,required"` + Content string `thrift:"content,3,required" form:"content,required" json:"content,required" query:"content,required"` + CreateDate string `thrift:"create_date,4,required" form:"create_date,required" json:"create_date,required" query:"create_date,required"` } func NewComment() *Comment { @@ -912,9 +24,9 @@ func (p *Comment) GetID() (v int64) { return p.ID } -var Comment_User_DEFAULT *User +var Comment_User_DEFAULT *core.User -func (p *Comment) GetUser() (v *User) { +func (p *Comment) GetUser() (v *core.User) { if !p.IsSetUser() { return Comment_User_DEFAULT } @@ -1068,7 +180,7 @@ func (p *Comment) ReadField1(iprot thrift.TProtocol) error { } func (p *Comment) ReadField2(iprot thrift.TProtocol) error { - p.User = NewUser() + p.User = core.NewUser() if err := p.User.Read(iprot); err != nil { return err } @@ -2506,9 +1618,9 @@ func (p *FavoriteListReq) String() string { } type FavoriteListResp struct { - StatusCode int32 `thrift:"status_code,1,required" form:"status_code,required" json:"status_code,required" query:"status_code,required"` - StatusMsg *string `thrift:"status_msg,2,optional" form:"status_msg" json:"status_msg,omitempty" query:"status_msg"` - VideoList []*Video `thrift:"video_list,3,required" form:"video_list,required" json:"video_list,required" query:"video_list,required"` + StatusCode int32 `thrift:"status_code,1,required" form:"status_code,required" json:"status_code,required" query:"status_code,required"` + StatusMsg *string `thrift:"status_msg,2,optional" form:"status_msg" json:"status_msg,omitempty" query:"status_msg"` + VideoList []*core.Video `thrift:"video_list,3,required" form:"video_list,required" json:"video_list,required" query:"video_list,required"` } func NewFavoriteListResp() *FavoriteListResp { @@ -2528,7 +1640,7 @@ func (p *FavoriteListResp) GetStatusMsg() (v string) { return *p.StatusMsg } -func (p *FavoriteListResp) GetVideoList() (v []*Video) { +func (p *FavoriteListResp) GetVideoList() (v []*core.Video) { return p.VideoList } @@ -2659,9 +1771,9 @@ func (p *FavoriteListResp) ReadField3(iprot thrift.TProtocol) error { if err != nil { return err } - p.VideoList = make([]*Video, 0, size) + p.VideoList = make([]*core.Video, 0, size) for i := 0; i < size; i++ { - _elem := NewVideo() + _elem := core.NewVideo() if err := _elem.Read(iprot); err != nil { return err } diff --git a/biz/model/relation/relation.go b/biz/model/relation/relation.go index 384bbdb..dd78ac9 100755 --- a/biz/model/relation/relation.go +++ b/biz/model/relation/relation.go @@ -1,378 +1,14 @@ -// Code generated by thriftgo (0.2.5). DO NOT EDIT. +// Code generated by thriftgo (0.2.7). DO NOT EDIT. package relation import ( "context" "fmt" + "github.com/ClubWeGo/douyin/biz/model/core" "github.com/apache/thrift/lib/go/thrift" ) -type User struct { - ID int64 `thrift:"id,1,required" form:"id,required" json:"id,required" query:"id,required"` - Name string `thrift:"name,2,required" form:"name,required" json:"name,required" query:"name,required"` - FollowCount *int64 `thrift:"follow_count,3,optional" form:"follow_count" json:"follow_count,omitempty" query:"follow_count"` - FollowerCount *int64 `thrift:"follower_count,4,optional" form:"follower_count" json:"follower_count,omitempty" query:"follower_count"` - IsFollow bool `thrift:"is_follow,5,required" form:"is_follow,required" json:"is_follow,required" query:"is_follow,required"` -} - -func NewUser() *User { - return &User{} -} - -func (p *User) GetID() (v int64) { - return p.ID -} - -func (p *User) GetName() (v string) { - return p.Name -} - -var User_FollowCount_DEFAULT int64 - -func (p *User) GetFollowCount() (v int64) { - if !p.IsSetFollowCount() { - return User_FollowCount_DEFAULT - } - return *p.FollowCount -} - -var User_FollowerCount_DEFAULT int64 - -func (p *User) GetFollowerCount() (v int64) { - if !p.IsSetFollowerCount() { - return User_FollowerCount_DEFAULT - } - return *p.FollowerCount -} - -func (p *User) GetIsFollow() (v bool) { - return p.IsFollow -} - -var fieldIDToName_User = map[int16]string{ - 1: "id", - 2: "name", - 3: "follow_count", - 4: "follower_count", - 5: "is_follow", -} - -func (p *User) IsSetFollowCount() bool { - return p.FollowCount != nil -} - -func (p *User) IsSetFollowerCount() bool { - return p.FollowerCount != nil -} - -func (p *User) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetID bool = false - var issetName bool = false - var issetIsFollow bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetID = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetName = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.I64 { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.I64 { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - issetIsFollow = true - } else { - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetID { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetName { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetIsFollow { - fieldId = 5 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_User[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_User[fieldId])) -} - -func (p *User) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - p.ID = v - } - return nil -} - -func (p *User) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return err - } else { - p.Name = v - } - return nil -} - -func (p *User) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - p.FollowCount = &v - } - return nil -} - -func (p *User) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - p.FollowerCount = &v - } - return nil -} - -func (p *User) ReadField5(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - p.IsFollow = v - } - return nil -} - -func (p *User) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("User"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *User) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.ID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *User) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Name); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *User) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetFollowCount() { - if err = oprot.WriteFieldBegin("follow_count", thrift.I64, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.FollowCount); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *User) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetFollowerCount() { - if err = oprot.WriteFieldBegin("follower_count", thrift.I64, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.FollowerCount); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *User) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("is_follow", thrift.BOOL, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(p.IsFollow); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - -func (p *User) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("User(%+v)", *p) -} - // followList type FollowListReq struct { Token string `thrift:"token,1,required" form:"token,required" json:"token,required" query:"token,required"` @@ -573,9 +209,9 @@ func (p *FollowListReq) String() string { } type FollowListResp struct { - StatusCode int32 `thrift:"status_code,1,required" form:"status_code,required" json:"status_code,required" query:"status_code,required"` - StatusMsg *string `thrift:"status_msg,2,optional" form:"status_msg" json:"status_msg,omitempty" query:"status_msg"` - UserList []*User `thrift:"user_list,3" form:"user_list" json:"user_list" query:"user_list"` + StatusCode int32 `thrift:"status_code,1,required" form:"status_code,required" json:"status_code,required" query:"status_code,required"` + StatusMsg *string `thrift:"status_msg,2,optional" form:"status_msg" json:"status_msg,omitempty" query:"status_msg"` + UserList []*core.User `thrift:"user_list,3" form:"user_list" json:"user_list" query:"user_list"` } func NewFollowListResp() *FollowListResp { @@ -595,7 +231,7 @@ func (p *FollowListResp) GetStatusMsg() (v string) { return *p.StatusMsg } -func (p *FollowListResp) GetUserList() (v []*User) { +func (p *FollowListResp) GetUserList() (v []*core.User) { return p.UserList } @@ -719,9 +355,9 @@ func (p *FollowListResp) ReadField3(iprot thrift.TProtocol) error { if err != nil { return err } - p.UserList = make([]*User, 0, size) + p.UserList = make([]*core.User, 0, size) for i := 0; i < size; i++ { - _elem := NewUser() + _elem := core.NewUser() if err := _elem.Read(iprot); err != nil { return err } @@ -1039,9 +675,9 @@ func (p *FollowerListReq) String() string { } type FollowerListResp struct { - StatusCode int32 `thrift:"status_code,1,required" form:"status_code,required" json:"status_code,required" query:"status_code,required"` - StatusMsg *string `thrift:"status_msg,2,optional" form:"status_msg" json:"status_msg,omitempty" query:"status_msg"` - UserList []*User `thrift:"user_list,3" form:"user_list" json:"user_list" query:"user_list"` + StatusCode int32 `thrift:"status_code,1,required" form:"status_code,required" json:"status_code,required" query:"status_code,required"` + StatusMsg *string `thrift:"status_msg,2,optional" form:"status_msg" json:"status_msg,omitempty" query:"status_msg"` + UserList []*core.User `thrift:"user_list,3" form:"user_list" json:"user_list" query:"user_list"` } func NewFollowerListResp() *FollowerListResp { @@ -1061,7 +697,7 @@ func (p *FollowerListResp) GetStatusMsg() (v string) { return *p.StatusMsg } -func (p *FollowerListResp) GetUserList() (v []*User) { +func (p *FollowerListResp) GetUserList() (v []*core.User) { return p.UserList } @@ -1185,9 +821,9 @@ func (p *FollowerListResp) ReadField3(iprot thrift.TProtocol) error { if err != nil { return err } - p.UserList = make([]*User, 0, size) + p.UserList = make([]*core.User, 0, size) for i := 0; i < size; i++ { - _elem := NewUser() + _elem := core.NewUser() if err := _elem.Read(iprot); err != nil { return err } @@ -1505,9 +1141,9 @@ func (p *FriendListReq) String() string { } type FriendListResp struct { - StatusCode int32 `thrift:"status_code,1,required" form:"status_code,required" json:"status_code,required" query:"status_code,required"` - StatusMsg *string `thrift:"status_msg,2,optional" form:"status_msg" json:"status_msg,omitempty" query:"status_msg"` - UserList []*User `thrift:"user_list,3" form:"user_list" json:"user_list" query:"user_list"` + StatusCode int32 `thrift:"status_code,1,required" form:"status_code,required" json:"status_code,required" query:"status_code,required"` + StatusMsg *string `thrift:"status_msg,2,optional" form:"status_msg" json:"status_msg,omitempty" query:"status_msg"` + UserList []*core.User `thrift:"user_list,3" form:"user_list" json:"user_list" query:"user_list"` } func NewFriendListResp() *FriendListResp { @@ -1527,7 +1163,7 @@ func (p *FriendListResp) GetStatusMsg() (v string) { return *p.StatusMsg } -func (p *FriendListResp) GetUserList() (v []*User) { +func (p *FriendListResp) GetUserList() (v []*core.User) { return p.UserList } @@ -1651,9 +1287,9 @@ func (p *FriendListResp) ReadField3(iprot thrift.TProtocol) error { if err != nil { return err } - p.UserList = make([]*User, 0, size) + p.UserList = make([]*core.User, 0, size) for i := 0; i < size; i++ { - _elem := NewUser() + _elem := core.NewUser() if err := _elem.Read(iprot); err != nil { return err } diff --git a/go.mod b/go.mod index 237f21b..76b249e 100755 --- a/go.mod +++ b/go.mod @@ -7,8 +7,8 @@ replace github.com/apache/thrift => github.com/apache/thrift v0.13.0 require ( github.com/ClubWeGo/favoritemicro v0.0.0-20230218084417-fd4c3433fb21 github.com/ClubWeGo/relationmicro v0.0.0-20230216103453-7b53cbe6042e - github.com/ClubWeGo/usermicro v0.0.0-20230214161119-afa68c10bf79 - github.com/ClubWeGo/videomicro v0.0.0-20230214163648-819e4cc45d4d + github.com/ClubWeGo/usermicro v0.0.0-20230218161017-d68d94d1dac8 + github.com/ClubWeGo/videomicro v0.0.0-20230218142838-4e63ecd438ca github.com/apache/thrift v0.13.0 github.com/cloudwego/hertz v0.5.2 github.com/cloudwego/kitex v0.4.4 @@ -17,10 +17,13 @@ require ( github.com/google/uuid v1.3.0 github.com/kitex-contrib/registry-etcd v0.1.0 github.com/minio/minio-go/v7 v7.0.48 + github.com/prometheus/common v0.26.0 github.com/u2takey/ffmpeg-go v0.4.1 ) require ( + github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect + github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect github.com/aws/aws-sdk-go v1.38.20 // indirect github.com/bytedance/go-tagexpr/v2 v2.9.2 // indirect github.com/bytedance/gopkg v0.0.0-20220531084716-665b4f21126f // indirect @@ -75,6 +78,7 @@ require ( google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect google.golang.org/grpc v1.41.0 // indirect google.golang.org/protobuf v1.28.1 // indirect + gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect gopkg.in/ini.v1 v1.66.6 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 5a3b7f8..d0a0f90 100755 --- a/go.sum +++ b/go.sum @@ -17,17 +17,19 @@ github.com/ClubWeGo/favoritemicro v0.0.0-20230218084417-fd4c3433fb21 h1:KJx0Td1U github.com/ClubWeGo/favoritemicro v0.0.0-20230218084417-fd4c3433fb21/go.mod h1:yq3JkyV95cRDwYVrZ3d5WeDvfIzBcAC4eRYCOSH27zM= github.com/ClubWeGo/relationmicro v0.0.0-20230216103453-7b53cbe6042e h1:DK+DBcAdrOyskhh++NHQILVuawprEMjb4NcP+i7E8P0= github.com/ClubWeGo/relationmicro v0.0.0-20230216103453-7b53cbe6042e/go.mod h1:/Tc8EIH6LqyqIC4lbmoDE7RyWJVBF8tbRSGkG76j/6w= -github.com/ClubWeGo/usermicro v0.0.0-20230214161119-afa68c10bf79 h1:UDT/uWXwUF6jhv0hSTCXuavaR5VHxv06obnP5q7b/i0= -github.com/ClubWeGo/usermicro v0.0.0-20230214161119-afa68c10bf79/go.mod h1:t0WQl+w/flpA4yFJoCxdHnCb4cCDLWIStHQgUCSUPt8= -github.com/ClubWeGo/videomicro v0.0.0-20230214163648-819e4cc45d4d h1:1W4eMqe9U/SJxISMEjAluTzgonGx0CwdFDCGotYvahs= -github.com/ClubWeGo/videomicro v0.0.0-20230214163648-819e4cc45d4d/go.mod h1:c1dNt+vAOK1sMH7IDZEfCzHPVDjkOrRiu9+pcekidaU= +github.com/ClubWeGo/usermicro v0.0.0-20230218161017-d68d94d1dac8 h1:khp8++vokeGjSu7DrLOV3OKoZByKNpvQgoAs6uzHsyE= +github.com/ClubWeGo/usermicro v0.0.0-20230218161017-d68d94d1dac8/go.mod h1:t0WQl+w/flpA4yFJoCxdHnCb4cCDLWIStHQgUCSUPt8= +github.com/ClubWeGo/videomicro v0.0.0-20230218142838-4e63ecd438ca h1:sp1kKw7f/45OQPAs5t/ReZP8+8z5+nLYdWF3YYPtmfQ= +github.com/ClubWeGo/videomicro v0.0.0-20230218142838-4e63ecd438ca/go.mod h1:SJiohnvP4Dk+iAO/cili779usv4VDj8eIX9RUEN4Cms= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.13.0 h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI= @@ -719,6 +721,7 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/idl/interaction.thrift b/idl/interaction.thrift index 0be5b4f..fba5fdc 100755 --- a/idl/interaction.thrift +++ b/idl/interaction.thrift @@ -1,27 +1,11 @@ namespace go interaction +include "core.thrift" -struct User { - 1: required i64 id; - 2: required string name; - 3: optional i64 follow_count; - 4: optional i64 follower_count; - 5: required bool is_follow; -} -struct Video { - 1: required i64 id; - 2: required User author; - 3: required string play_url; - 4: required string cover_url; - 5: required i64 favorite_count; - 6: required i64 comment_count; - 7: required bool is_favorite; - 8: required string title; -} struct Comment { 1: required i64 id; - 2: required User user; + 2: required core.User user; 3: required string content; 4: required string create_date; } @@ -73,7 +57,7 @@ struct FavoriteListReq { struct FavoriteListResp { 1: required i32 status_code; 2: optional string status_msg; - 3: required list