🔥 改为前后端分离形式

This commit is contained in:
李寻欢
2024-07-04 14:10:46 +08:00
parent f39f46bfbf
commit b806ade655
49 changed files with 387 additions and 62 deletions

33
app/contact.go Normal file
View File

@@ -0,0 +1,33 @@
package app
import (
"github.com/gin-gonic/gin"
"go-wechat/common/response"
"go-wechat/service"
)
// GetFriends
// @description: 获取好友列表
// @param ctx
func GetFriends(ctx *gin.Context) {
// 取出所有好友列表
friends, _, err := service.GetAllFriend()
if err != nil {
response.New(ctx).SetMsg("系统错误").SetError(err).Fail()
}
response.New(ctx).SetData(friends).Success()
}
// GetGroups
// @description: 获取群列表
// @param ctx
func GetGroups(ctx *gin.Context) {
// 取出所有好友列表
_, groups, err := service.GetAllFriend()
if err != nil {
response.New(ctx).SetMsg("系统错误").SetError(err).Fail()
}
response.New(ctx).SetData(groups).Success()
}