refactor: reorganize modules and add Linux build tooling
This commit is contained in:
1
module/social/relation/internal/models/base.go
Normal file
1
module/social/relation/internal/models/base.go
Normal file
@@ -0,0 +1 @@
|
||||
package models
|
||||
20
module/social/relation/internal/models/friend_apply.go
Normal file
20
module/social/relation/internal/models/friend_apply.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"git.apinb.com/bsm-sdk/core/types"
|
||||
)
|
||||
|
||||
// FriendApply 好友申请
|
||||
type FriendApply struct {
|
||||
types.Std_IICUDS
|
||||
FromID uint `gorm:"column:from_id;not null;" json:"from_id"` //申请人id
|
||||
FromIdentity string `gorm:"column:from_identity;type:varchar(50);not null;" json:"from_identity"` //申请人identity
|
||||
ToID uint `gorm:"column:to_id;not null;" json:"to_id"` //目的人id
|
||||
ToIdentity string `gorm:"column:to_identity;type:varchar(50);not null;" json:"to_identity"` //目的人identity
|
||||
LastMessageID uint `gorm:"column:last_message_id;not null;" json:"last_message_id"` //最后交流ID
|
||||
}
|
||||
|
||||
// TableName .
|
||||
func (fg *FriendApply) TableName() string {
|
||||
return "relation_friend_apply"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"git.apinb.com/bsm-sdk/core/types"
|
||||
)
|
||||
|
||||
// FriendApply 好友申请交流表
|
||||
type FriendApplyMessage struct {
|
||||
types.Std_IICUDS
|
||||
types.Std_Passport
|
||||
ApplyID uint `gorm:"column:apply_id;not null;" json:"apply_id"` //申请表ID
|
||||
Body string `gorm:"column:body;type:varchar(500);default:''" json:"body"`
|
||||
}
|
||||
|
||||
// TableName .
|
||||
func (fg *FriendApplyMessage) TableName() string {
|
||||
return "relation_friend_apply_message"
|
||||
}
|
||||
18
module/social/relation/internal/models/friend_in_tag.go
Normal file
18
module/social/relation/internal/models/friend_in_tag.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"git.apinb.com/bsm-sdk/core/types"
|
||||
)
|
||||
|
||||
// FriendData 好友存在于那些标签
|
||||
type FriendInTag struct {
|
||||
types.Std_IICUDS
|
||||
types.Std_Passport //标签归属
|
||||
FriendIdentity string `gorm:"column:friend_identity;type:varchar(36);not null;" json:"friend_identity"`
|
||||
TagIdentity string `gorm:"column:tag_identity;type:varchar(36);not null;" json:"tag_identity"` //所属好友标签Identity
|
||||
}
|
||||
|
||||
// TableName .
|
||||
func (fd *FriendInTag) TableName() string {
|
||||
return "relation_friend_in_tag"
|
||||
}
|
||||
17
module/social/relation/internal/models/friend_tag.go
Normal file
17
module/social/relation/internal/models/friend_tag.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"git.apinb.com/bsm-sdk/core/types"
|
||||
)
|
||||
|
||||
// FriendTag 好友标签分组信息
|
||||
type FriendTag struct {
|
||||
types.Std_IICUDS
|
||||
types.Std_Passport //标签归属
|
||||
Name string `gorm:"column:name;type:varchar(255);not null;" json:"name"`
|
||||
}
|
||||
|
||||
// TableName .
|
||||
func (fg *FriendTag) TableName() string {
|
||||
return "relation_friend_tag"
|
||||
}
|
||||
1
module/social/relation/internal/models/query.go
Normal file
1
module/social/relation/internal/models/query.go
Normal file
@@ -0,0 +1 @@
|
||||
package models
|
||||
17
module/social/relation/internal/models/relation_follow.go
Normal file
17
module/social/relation/internal/models/relation_follow.go
Normal file
@@ -0,0 +1,17 @@
|
||||
// Models generated by mesh dev cli,@Author: David Yan(david.yan@qq.com).
|
||||
package models
|
||||
|
||||
import (
|
||||
"git.apinb.com/bsm-sdk/core/types"
|
||||
)
|
||||
|
||||
type RelationFollow struct {
|
||||
types.Std_IICUDS
|
||||
FromIdentity string `gorm:"column:from_identity;type:varchar(36);not null;" json:"from_identity"` // 关注者
|
||||
ToIdentity string `gorm:"column:to_identity;type:varchar(255);not null;" json:"to_identity"` // 关注对象`
|
||||
}
|
||||
|
||||
// TableName .
|
||||
func (table *RelationFollow) TableName() string {
|
||||
return "relation_follow" //对应数据库表名
|
||||
}
|
||||
21
module/social/relation/internal/models/relation_friend.go
Normal file
21
module/social/relation/internal/models/relation_friend.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"git.apinb.com/bsm-sdk/core/types"
|
||||
)
|
||||
|
||||
// FriendData 好友列表
|
||||
type RelationFriend struct {
|
||||
types.Std_IICUDS
|
||||
types.Std_Passport
|
||||
FriendrelationID uint `gorm:"column:friend_relation_id;not null;" json:"friend_relation_id"` //好友的会员唯一ID
|
||||
FriendrelationIdentity string `gorm:"column:friend_relation_identity;not null;" json:"friend_relation_identity"` //好友的会员唯一标识
|
||||
RemarkName string `gorm:"column:remark_name;type:varchar(255);default:'';" json:"remark_name"` //备注
|
||||
Popular int `gorm:"column:popular;type:int2;default:0;" json:"popular"` //是否置顶,默认:否
|
||||
SessionID string `gorm:"column:session_id;not null;" json:"session_id"` //与好友的会话ID
|
||||
}
|
||||
|
||||
// TableName .
|
||||
func (fd *RelationFriend) TableName() string {
|
||||
return "relation_friend"
|
||||
}
|
||||
15
module/social/relation/internal/models/relation_match.go
Normal file
15
module/social/relation/internal/models/relation_match.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package models
|
||||
|
||||
import "git.apinb.com/bsm-sdk/core/types"
|
||||
|
||||
// RelationMatch records a recommended relationship between two identities.
|
||||
type RelationMatch struct {
|
||||
types.Std_IICUDS
|
||||
RelationIdentity string `gorm:"column:relation_identity;type:varchar(36);not null;" json:"relation_identity"`
|
||||
RecommendIdentity string `gorm:"column:recommend_identity;type:varchar(255);not null;" json:"recommend_identity"`
|
||||
}
|
||||
|
||||
// TableName returns the backing relation table.
|
||||
func (*RelationMatch) TableName() string {
|
||||
return "relation_match"
|
||||
}
|
||||
Reference in New Issue
Block a user