refactor: 更新构建输出名称和数据库配置
将构建输出文件名称从miniChat改为MINI 更新数据库配置为本地开发环境,包括地址、用户名和密码 在消息列表响应中添加消息ID字段并调整时间格式
This commit is contained in:
parent
e61a293616
commit
41c0d5e1ad
@ -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
|
||||
```
|
||||
|
||||
@ -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"
|
||||
admin_secret = "X9Rm9ycFr66w9syuYTWCc"
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user