From a8d37af2daafd04608edd1c43686726f4b337fbb Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 31 Dec 2024 18:07:27 +0800 Subject: [PATCH] =?UTF-8?q?im=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd_db_im.bat | 2 +- src/im/model/friend.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/im/model/friend.go diff --git a/cmd_db_im.bat b/cmd_db_im.bat index 2661ea0..1dc9370 100644 --- a/cmd_db_im.bat +++ b/cmd_db_im.bat @@ -16,7 +16,7 @@ set DBNAME="egg-im" set DBHOST="119.23.182.117" set DBPORT="3306" -del "src\model\%Table%.go" +del "src\im\model\%Table%.go" echo start reverse table %Table% diff --git a/src/im/model/friend.go b/src/im/model/friend.go new file mode 100644 index 0000000..7f10364 --- /dev/null +++ b/src/im/model/friend.go @@ -0,0 +1,16 @@ +package model + +import ( + "time" +) + +type Friend struct { + Id int64 `json:"id" xorm:"pk autoincr comment('自增主键') BIGINT(20)"` + UserId int64 `json:"user_id" xorm:"not null comment('用户id') unique(uk_user_id_friend_id) BIGINT(20)"` + FriendId int64 `json:"friend_id" xorm:"not null comment('好友id') unique(uk_user_id_friend_id) BIGINT(20)"` + Remarks string `json:"remarks" xorm:"not null comment('备注') VARCHAR(20)"` + Extra string `json:"extra" xorm:"not null comment('附加属性') VARCHAR(1024)"` + Status int `json:"status" xorm:"not null comment('状态,0:申请,1:同意') TINYINT(4)"` + CreateTime time.Time `json:"create_time" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') DATETIME"` + UpdateTime time.Time `json:"update_time" xorm:"not null default CURRENT_TIMESTAMP comment('更新时间') DATETIME"` +}