9 changed files with 49 additions and 96 deletions
-
6src/controllers/app_controller.go
-
10src/controllers/send_controller.go
-
8src/controllers/user_controller.go
-
54src/domains/app/app.go
-
12src/domains/send/send.go
-
10src/domains/user/user.go
-
7src/services/app_service.go
-
28src/services/send_service.go
-
10src/services/user_service.go
@ -1,57 +1,11 @@ |
|||||
package app |
package app |
||||
|
|
||||
import ( |
import ( |
||||
"github.com/gofiber/fiber/v2" |
|
||||
"go.mau.fi/whatsmeow/types" |
|
||||
|
"context" |
||||
) |
) |
||||
|
|
||||
type IAppService interface { |
type IAppService interface { |
||||
Login(c *fiber.Ctx) (response LoginResponse, err error) |
|
||||
Logout(c *fiber.Ctx) (err error) |
|
||||
Reconnect(c *fiber.Ctx) (err error) |
|
||||
} |
|
||||
|
|
||||
type UserInfoRequest struct { |
|
||||
Phone string `json:"phone" query:"phone"` |
|
||||
} |
|
||||
|
|
||||
type UserInfoResponseDataDevice struct { |
|
||||
User string |
|
||||
Agent uint8 |
|
||||
Device string |
|
||||
Server string |
|
||||
AD bool |
|
||||
} |
|
||||
|
|
||||
type UserInfoResponseData struct { |
|
||||
VerifiedName string `json:"verified_name"` |
|
||||
Status string `json:"status"` |
|
||||
PictureID string `json:"picture_id"` |
|
||||
Devices []UserInfoResponseDataDevice `json:"devices"` |
|
||||
} |
|
||||
|
|
||||
type UserInfoResponse struct { |
|
||||
Data []UserInfoResponseData `json:"data"` |
|
||||
} |
|
||||
|
|
||||
type UserAvatarRequest struct { |
|
||||
Phone string `json:"phone" query:"phone"` |
|
||||
} |
|
||||
|
|
||||
type UserAvatarResponse struct { |
|
||||
URL string `json:"url"` |
|
||||
ID string `json:"id"` |
|
||||
Type string `json:"type"` |
|
||||
} |
|
||||
|
|
||||
type UserMyPrivacySettingResponse struct { |
|
||||
GroupAdd string `json:"group_add"` |
|
||||
LastSeen string `json:"last_seen"` |
|
||||
Status string `json:"status"` |
|
||||
Profile string `json:"profile"` |
|
||||
ReadReceipts string `json:"read_receipts"` |
|
||||
} |
|
||||
|
|
||||
type UserMyListGroupsResponse struct { |
|
||||
Data []types.GroupInfo `json:"data"` |
|
||||
|
Login(ctx context.Context) (response LoginResponse, err error) |
||||
|
Logout(ctx context.Context) (err error) |
||||
|
Reconnect(ctx context.Context) (err error) |
||||
} |
} |
||||
@ -1,12 +1,12 @@ |
|||||
package user |
package user |
||||
|
|
||||
import ( |
import ( |
||||
"github.com/gofiber/fiber/v2" |
|
||||
|
"context" |
||||
) |
) |
||||
|
|
||||
type IUserService interface { |
type IUserService interface { |
||||
Info(c *fiber.Ctx, request InfoRequest) (response InfoResponse, err error) |
|
||||
Avatar(c *fiber.Ctx, request AvatarRequest) (response AvatarResponse, err error) |
|
||||
MyListGroups(c *fiber.Ctx) (response MyListGroupsResponse, err error) |
|
||||
MyPrivacySetting(c *fiber.Ctx) (response MyPrivacySettingResponse, err error) |
|
||||
|
Info(ctx context.Context, request InfoRequest) (response InfoResponse, err error) |
||||
|
Avatar(ctx context.Context, request AvatarRequest) (response AvatarResponse, err error) |
||||
|
MyListGroups(ctx context.Context) (response MyListGroupsResponse, err error) |
||||
|
MyPrivacySetting(ctx context.Context) (response MyPrivacySettingResponse, err error) |
||||
} |
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue