posts

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Package posts @service posts @title Posts @description posts service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Component

func Component[C services.Component](ctx context.Context, name string) (component C, has bool)

func Service

func Service() (v services.Service)

Types

type Comment

type Comment struct {
	Id       int64     `json:"id"`
	PostId   string    `json:"postId"`
	UserId   string    `json:"userId"`
	CreateAT time.Time `json:"createAT"`
	Content  string    `json:"content"`
}

type ListParam

type ListParam struct {
	UserId string `json:"userId" validate:"required" validate-message:"user_id_required"`
	Offset int    `json:"offset"`
	Length int    `json:"length"`
}

type Post

type Post struct {
	Id       string    `json:"id"`
	UserId   string    `json:"userId"`
	CreateAT time.Time `json:"createAT"`
	Title    string    `json:"title"`
	Content  string    `json:"content"`
	Likes    int64     `json:"likes"`
	Comments []Comment `json:"comments"`
}

type Posts

type Posts []Post

func List

func List(ctx context.Context, param ListParam) (result Posts, err error)

Jump to

Keyboard shortcuts

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