mbmo

package
v0.9.53 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangePublic

func ChangePublic(momentID string, public bool) error

func CommentMoment

func CommentMoment(wechatAppID string, appSecret string, openID string, momentID string,
	commentatorID string, respondentID string, content string) error

func CreateAd

func CreateAd(params CreateAdParams) error

func CreateMoment

func CreateMoment(params *CreateMomentParams) (string, error)

func CreatePlatform

func CreatePlatform(params CreatePlatformParams) error

func DeleteMoment

func DeleteMoment(momentID string, userID string) error

func DeleteMomentComment

func DeleteMomentComment(commentID string, commentatorID string) error

func Destroy

func Destroy()

func Init

func Init(baseUrl string, timeoutSec time.Duration)

func LikeDislike

func LikeDislike(momentID string, likesID string, likesName string) error

func OriginalPic

func OriginalPic(objNames string) ([]string, error)

func UpdateAdConfig

func UpdateAdConfig(id string, retreat bool) error

func UpdateMoment

func UpdateMoment(momentID string, content string, senderName string, regionName string, longitude float64,
	latitude float64, pics []string) error

Types

type AdInfo

type AdInfo struct {
	ID         string    `json:"id"`
	Content    string    `json:"content"`
	RegionName string    `json:"regionName"`
	Longitude  float64   `json:"longitude"`
	Latitude   float64   `json:"latitude"`
	Avatar     string    `json:"avatar"`
	Urls       []PicInfo `json:"urls"`
	PushTime   string    `json:"pushTime"`
	SenderName string    `json:"senderName"`
}

func GetAd

func GetAd(pageNo int, pageSize int) ([]AdInfo, int64, error)

type ChangePublicRequest

type ChangePublicRequest struct {
	ID     string `json:"id"`
	Public bool   `json:"public"`
}

type CommentInfo

type CommentInfo struct {
	ID            string `json:"id"`
	CommentatorID string `json:"commentatorId"`
	Content       string `json:"content"`
	RespondentID  string `json:"respondentId"`
	CommentTime   string `json:"commentTime"`
}

type CommentMomentRequest

type CommentMomentRequest struct {
	AppID         string `json:"appId" binding:"required"`
	AppSecret     string `json:"appSecret" binding:"required"`
	OpenID        string `json:"openId" binding:"required"`
	MomentID      string `json:"momentId"`
	CommentatorID string `json:"commentatorId"`
	RespondentID  string `json:"respondentId"`
	Content       string `json:"content"`
}

type CreateAdParams

type CreateAdParams struct {
	Content    string   `json:"content"`
	RegionName string   `json:"regionName"`
	Longitude  float64  `json:"longitude"`
	Latitude   float64  `json:"latitude"`
	SenderName string   `json:"senderName"`
	Avatar     string   `json:"avatar"`
	Urls       []string `json:"urls"`
}

type CreateAdRequest

type CreateAdRequest struct {
	Content    string   `json:"content"`
	RegionName string   `json:"regionName"`
	Longitude  float64  `json:"longitude"`
	Latitude   float64  `json:"latitude"`
	SenderName string   `json:"senderName"`
	Avatar     string   `json:"avatar"`
	Urls       []string `json:"urls"`
}

type CreateMomentParams

type CreateMomentParams struct {
	AppID      string `json:"appId" binding:"required"`
	AppSecret  string `json:"appSecret" binding:"required"`
	OpenID     string `json:"openId" binding:"required"`
	Content    string
	SenderID   string
	SenderName string
	IsPublic   bool
	RegionName string
	Longitude  float64
	Latitude   float64
	Urls       []string
}

type CreateMomentRequest

type CreateMomentRequest struct {
	AppID      string   `json:"appId" binding:"required"`
	AppSecret  string   `json:"appSecret" binding:"required"`
	OpenID     string   `json:"openId" binding:"required"`
	Content    string   `json:"content" binding:"required"`
	SenderID   string   `json:"senderId" binding:"required"`
	SenderName string   `json:"senderName" binding:"required"`
	IsPublic   bool     `json:"isPublic" binding:"required"`
	RegionName string   `json:"regionName"`
	Longitude  float64  `json:"longitude"`
	Latitude   float64  `json:"latitude"`
	Urls       []string `json:"urls"`
}

type CreateMomentResponse added in v0.8.7

type CreateMomentResponse struct {
	ID string `json:"id"`
	// contains filtered or unexported fields
}

type CreatePlatformParams

type CreatePlatformParams struct {
	Content    string   `json:"content"`
	SenderName string   `json:"senderName"`
	Avatar     string   `json:"avatar"`
	Urls       []string `json:"urls"`
}

type CreatePlatformRequest

type CreatePlatformRequest struct {
	Content    string   `json:"content"`
	SenderName string   `json:"senderName"`
	Avatar     string   `json:"avatar"`
	Urls       []string `json:"urls"`
}

type GetAdResponse

type GetAdResponse struct {
	Infos      []AdInfo `json:"infos"`
	TotalCount int64    `json:"totalCount"`
	PageNo     int      `json:"pageNo"`
	// contains filtered or unexported fields
}

type GetMomentByIDResponse

type GetMomentByIDResponse struct {
	Info *MomentInfo `json:"infos"`
	// contains filtered or unexported fields
}

type GetMomentParams

type GetMomentParams struct {
	AuthorID        string   `form:"authorId"`
	SenderIDs       []string `form:"senderIds"`
	IncludeAd       bool     `form:"includeAd"`
	LastAdID        string   `form:"lastAdId"`
	PageNo          int      `form:"pageNo"`
	PageSize        int      `form:"pageSize"`
	AdInterval      int      `form:"adInterval"`
	LastCommonCount int      `form:"lastCommonCount"`
}

type GetMomentResponse

type GetMomentResponse struct {
	Infos           []MomentInfo `json:"infos"`
	TotalCount      int64        `json:"totalCount"`
	PageNo          int          `json:"pageNo"`
	LastCommonCount int          `json:"lastCommonCount"`
	LastAdID        string       `json:"lastAdId"`
	// contains filtered or unexported fields
}

type GetOriginalPicResponse

type GetOriginalPicResponse struct {
	Urls []string `json:"urls"`
	// contains filtered or unexported fields
}

type GetPlatformMomentsResponse

type GetPlatformMomentsResponse struct {
	Infos []MomentInfo `json:"infos"`
	// contains filtered or unexported fields
}

type LikeDislikeMomentRequest

type LikeDislikeMomentRequest struct {
	MomentID  string `json:"momentId"`
	LikesID   string `json:"likesId"`
	LikesName string `json:"likesName"`
}

type LikeInfo

type LikeInfo struct {
	SenderID   string `json:"senderId"`
	SenderName string `json:"senderName"`
}

type MomentInfo

type MomentInfo struct {
	ID         string        `json:"id"`
	Content    string        `json:"content"`
	RegionName string        `json:"regionName"`
	Longitude  float64       `json:"longitude"`
	Latitude   float64       `json:"latitude"`
	Type       string        `json:"type"`
	SenderID   string        `json:"senderId"`
	SenderName string        `json:"senderName"`
	IsPublic   bool          `json:"isPublic"`
	Avatar     string        `json:"avatar"`
	Urls       []PicInfo     `json:"urls"`
	PushTime   *time.Time    `json:"pushTime"`
	Like       []LikeInfo    `json:"like"`
	Comment    []CommentInfo `json:"comment"`
}

func GetMoment

func GetMoment(params *GetMomentParams) ([]MomentInfo, int64, int, string, error)

func GetPlatformMoment

func GetPlatformMoment(pageNo int, pageSize int) ([]MomentInfo, error)

func ID

func ID(id string) (*MomentInfo, error)

type PicInfo

type PicInfo struct {
	Url     string `json:"url"`
	ObjName string `json:"objName"`
}

func UploadMomentPic

func UploadMomentPic(pics []*multipart.FileHeader) ([]PicInfo, error)

type UpdateAdConfigRequest

type UpdateAdConfigRequest struct {
	ID      string `json:"id"`
	Retreat bool   `json:"retreat"`
}

type UpdateMomentRequest

type UpdateMomentRequest struct {
	ID         string   `json:"id" binding:"required"`
	Content    string   `json:"content"`
	RegionName string   `json:"regionName"`
	Longitude  float64  `json:"longitude"`
	Latitude   float64  `json:"latitude"`
	SenderName string   `json:"senderName"`
	Urls       []string `json:"urls"`
}

type UploadMomentPicResponse

type UploadMomentPicResponse struct {
	Infos []PicInfo `json:"infos"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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