diff --git a/MINI b/MINI new file mode 100755 index 0000000..b7da64a Binary files /dev/null and b/MINI differ diff --git a/README.md b/README.md index f2f6674..5b66a39 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,5 @@ ### MAC ``` -$ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-w -s' -trimpath -o miniChat +$ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-w -s' -trimpath -o MINI ``` diff --git a/configs/fat_configs.toml b/configs/fat_configs.toml index a05363f..72732e8 100644 --- a/configs/fat_configs.toml +++ b/configs/fat_configs.toml @@ -2,16 +2,16 @@ local = 'zh-cn' [mysql.read] -addr = 'sh-cynosdbmysql-grp-88th45wy.sql.tencentcdb.com:28555' +addr = '127.0.0.1:3306' name = 'mini_chat' -pass = 'api2api..' -user = 'root' +pass = 'zRXiHTHzRHTdShFZ' +user = 'mini_chat' [mysql.write] -addr = 'sh-cynosdbmysql-grp-88th45wy.sql.tencentcdb.com:28555' +addr = '127.0.0.1:3306' name = 'mini_chat' -pass = 'api2api..' -user = 'root' +pass = 'zRXiHTHzRHTdShFZ' +user = 'mini_chat' [jwt] -admin_secret = "m9ycX9RTPyuYTWw9FrCc" \ No newline at end of file +admin_secret = "X9Rm9ycFr66w9syuYTWCc" \ No newline at end of file diff --git a/internal/api/app/app_message_list.go b/internal/api/app/app_message_list.go index 26a2669..776238c 100644 --- a/internal/api/app/app_message_list.go +++ b/internal/api/app/app_message_list.go @@ -6,7 +6,6 @@ import ( "mini-chat/internal/code" "mini-chat/internal/pkg/core" - "mini-chat/internal/pkg/timeutil" "mini-chat/internal/pkg/validation" "gorm.io/gorm" @@ -20,6 +19,7 @@ type appMessagePageListRequest struct { } type listMessageData struct { + ID string `json:"id"` // 消息ID SendTime string `json:"send_time"` // 发送时间 SenderID string `json:"sender_id"` // 发送人ID SenderName string `json:"sender_name"` // 发送人昵称 @@ -117,7 +117,8 @@ func (h *handler) AppMessagePageList() core.HandlerFunc { for k, v := range resultData { res.List[k] = listMessageData{ - SendTime: timeutil.FriendlyTime(v.SendTime), + ID: fmt.Sprint(v.ID), + SendTime: v.SendTime.Format("2006-01-02 15:04:05"), SenderID: v.SenderID, SenderName: v.SenderName, ReceiverID: v.ReceiverID,