Skip to content

Commit

Permalink
Merge pull request #7 from 0bvim/feat/model-and-interface
Browse files Browse the repository at this point in the history
feat/model and interface
  • Loading branch information
0bvim authored Oct 13, 2024
2 parents 9f4f92c + 5d0b9f7 commit daf4fb7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
29 changes: 23 additions & 6 deletions internal/app/model/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,32 @@ package model

// Main user struct
type MyUser struct {
Followers []User
Folliwng []User
Allowed []User
Denied []User
Login string `json:"login"`
token string
Followers []User
Following []User
Allowed []User
Denied []User
Login string `json:"login"`
TargetUser string
token string
}

// a single user struct
type User struct {
Login string `json:"login"`
}

func (u *MyUser) FetchFollowing() {
//TODO: Implement this function
}

func (u *MyUser) FetchFollowers(count *int) {
//TODO: Implement this function
}

func (u *MyUser) Unfollow() {
//TODO: Implement this function
}

func (u *MyUser) Follow() {
//TODO: Implement this function
}
16 changes: 12 additions & 4 deletions internal/app/usecase/user_actions.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
package usecase

func (u *MyUser) FetchFollowing() {
//TODO: Implement this function
type IUseractions interface {
FetchFollowing()
FetchFollowers(count *int)
Unfollow()
Follow()
}

func (u *MyUser) FetchFollowers() {
//TODO: Implement this function
func GetFollows(u IUseractions, count *int) {
u.FetchFollowers(count)
u.FetchFollowing()
}

func Follow(u IUseractions, username string) {
u.Follow()
}

0 comments on commit daf4fb7

Please sign in to comment.