model

package
v0.0.0-...-52f6943 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RoleLabel = map[int64]string{
	10:  "user",
	49:  "trainer",
	50:  "staffRW",
	60:  "staffKel",
	70:  "staffKec",
	80:  "staffKabKota",
	88:  "staffOPD",
	89:  "staffSaberhoax",
	90:  "staffProv",
	91:  "pimpinan",
	99:  "admin",
	100: "service_account",
}
View Source
var StatusLabel = map[int64]map[string]string{
	-1: {"en": "Status Deleted", "id": "Dihapus"},
	0:  {"en": "Inactived", "id": "Tidak Aktif"},
	10: {"en": "Actived", "id": "Aktif"},
}

Functions

This section is empty.

Types

type Actor

type Actor struct {
	ID        int64   `json:"id"`
	Name      string  `json:"name"`
	PhotoURL  string  `json:"photo_url_full"`
	Role      int64   `json:"role"`
	RoleLabel string  `json:"role_label"`
	Regency   *string `json:"kabkota"`
	District  *string `json:"kecamatan"`
	Village   *string `json:"kelurahan"`
	RW        *string `json:"rw"`
}

type ActorFromContext

type ActorFromContext struct {
	Data map[string]interface{}
}

func (*ActorFromContext) Get

func (ac *ActorFromContext) Get(key string) interface{}

type AddOrRemoveLikeOnPostRequest

type AddOrRemoveLikeOnPostRequest struct {
	UserPostID int64
	ActorID    int64
	TypeEntity string
}

type Comment

type Comment struct {
	ID         int64  `json:"id"`
	UserPostID int64  `json:"user_post_id"`
	Text       string `json:"text"`
	User       *Actor `json:"user"`
	CreatedAt  int64  `json:"created_at"`
	UpdatedAt  int64  `json:"updated_at"`
	CreatedBy  int64  `json:"created_by"`
	UpdatedBy  int64  `json:"updated_by"`
}

type CommentResponse

type CommentResponse struct {
	ID         int64         `db:"id"`
	UserPostID sql.NullInt64 `db:"user_post_id"`
	Comment    string        `db:"text"`
	Status     int64         `db:"status"`
	CreatedAt  int64         `db:"created_at"`
	UpdatedAt  int64         `db:"updated_at"`
	CreatedBy  sql.NullInt64 `db:"created_by"`
	UpdatedBy  sql.NullInt64 `db:"updated_by"`
}

type CommentWithMetadata

type CommentWithMetadata struct {
	Data     []*Comment `json:"data"`
	Metadata *Metadata  `json:"metadata"`
}

type CreateCommentRequest

type CreateCommentRequest struct {
	UserPostID int64  `json:"user_post_id"`
	Text       string `json:"comment"`
	Status     int64  `json:"status"`
}

type CreateCommentRequestRepository

type CreateCommentRequestRepository struct {
	UserPostID int64
	Text       string
	ActorID    int64
	Status     int64
}

type CreateNewPostRequest

type CreateNewPostRequest struct {
	Title        string  `json:"title"`
	ImagePathURL string  `json:"image_path_url"`
	Images       string  `json:"images"`
	Tags         *string `json:"tags,omitempty"`
	Status       int64   `json:"status"`
}

CreateNewPostRequest ...

type CreateNewPostRequestRepository

type CreateNewPostRequestRepository struct {
	Title        string
	ImagePathURL string
	Images       string
	Tags         *string
	Status       int64
	ActorID      int64
}

type GetComment

type GetComment struct {
	ID     int64
	Limit  int64
	Offset int64
}

type GetCommentRequest

type GetCommentRequest struct {
	ID   int64
	Page int64
}

GetCommentRequest ...

type GetListRequest

type GetListRequest struct {
	ActivityName *string
	Username     *string
	Category     *string
	Status       *int64
	Page         *int64
	Limit        *int64
	SortBy       string
	OrderBy      string
	Search       *string
	DistrictID   *int64
}

GetListRequest ...

type LikeResponse

type LikeResponse struct {
	ID       int64  `db:"id"`
	Type     string `db:"type"`
	EntityID int64  `db:"entity_id"`
}

type Metadata

type Metadata struct {
	Page  int64 `json:"page"`
	Total int64 `json:"total"`
}

type PostResponse

type PostResponse struct {
	ID                    int64          `db:"id"`
	Title                 string         `db:"text"`
	Tag                   sql.NullString `db:"tags"`
	ImagePath             sql.NullString `db:"image_path"`
	Images                sql.NullString `db:"images"`
	LastUserPostCommentID sql.NullInt64  `db:"last_user_post_comment_id"`
	LikesCount            int64          `db:"likes_count"`
	CommentCounts         int64          `db:"comments_count"`
	Status                int64          `db:"status"`
	CreatedBy             sql.NullInt64  `db:"created_by"`
	UpdatedBy             sql.NullInt64  `db:"updated_by"`
	CreatedAt             int64          `db:"created_at"`
	UpdatedAt             int64          `db:"updated_at"`
}

type UpdatePostRequest

type UpdatePostRequest struct {
	ID            int64   `json:"id"`
	Status        *int64  `json:"status,omitempty"`
	Title         *string `json:"title,omitempty"`
	LastCommentID *int64  `json:"last_comment_id,omitempty"`
}

type UserPostByMeRequest

type UserPostByMeRequest struct {
	ActorID int64
	*UserPostRequest
}

type UserPostRequest

type UserPostRequest struct {
	ActivityName *string
	Username     *string
	Category     *string
	Status       *int64
	Offset       *int64
	Limit        *int64
	SortBy       string
	OrderBy      string
	Search       *string
	DistrictID   *int64
}

type UserPostResponse

type UserPostResponse struct {
	ID                    int64                    `json:"id"`
	Title                 string                   `json:"text"`
	Tag                   string                   `json:"tags"`
	ImagePath             string                   `json:"image_path_full"`
	Images                []map[string]interface{} `json:"images"`
	LastUserPostCommentID *int64                   `json:"last_user_post_comment_id"`
	LastComment           *Comment                 `json:"last_comment"`
	LikesCount            int64                    `json:"likes_count"`
	IsLiked               bool                     `json:"is_liked"`
	CommentCounts         int64                    `json:"comments_count"`
	Status                int64                    `json:"status"`
	StatusLabel           string                   `json:"status_label"`
	CreatedBy             int64                    `json:"created_by"`
	Actor                 *Actor                   `json:"user"`
	CreatedAt             int64                    `json:"created_at"`
	UpdatedAt             int64                    `json:"updated_at"`
}

type UserPostWithMetadata

type UserPostWithMetadata struct {
	Data     []*UserPostResponse `json:"data"`
	Metadata *Metadata           `json:"metadata"`
}

type UserResponse

type UserResponse struct {
	ID       int64          `db:"id"`
	Name     sql.NullString `db:"name"`
	PhotoURL sql.NullString `db:"photo_url"`
	Role     sql.NullInt64  `db:"role"`
	Regency  sql.NullString `db:"regency_name"`
	District sql.NullString `db:"district_name"`
	Village  sql.NullString `db:"village_name"`
	RW       sql.NullString `db:"rw"`
	Status   int64          `db:"status"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL