handler

package
v0.0.0-...-fbd1cd9 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheFlush

func CacheFlush(app *core.App, router fiber.Router)

@Id FlushCache @Summary Flush Cache @Description Flush all cache on the server @Tags Cache @Security ApiKeyAuth @Success 200 {object} Map{msg=string} @Failure 403 {object} Map{msg=string} @Failure 400 {object} Map{msg=string} @Produce json @Router /cache/flush [post]

func CacheWarmUp

func CacheWarmUp(app *core.App, router fiber.Router)

@Id WarmUpCache @Summary Warm-Up Cache @Description Cache warming helps you to pre-load the cache to improve the performance of the first request @Tags Cache @Security ApiKeyAuth @Produce json @Success 200 {object} Map{msg=string} @Failure 403 {object} Map{msg=string} @Failure 400 {object} Map{msg=string} @Router /cache/warm_up [post]

func Captcha

func Captcha(app *core.App, router fiber.Router)

func CaptchaGet

func CaptchaGet(app *core.App, router fiber.Router)

@Id GetCaptcha @Summary Get Captcha @Description Get a base64 encoded captcha image or a HTML page to verify for user @Tags Captcha @Produce json @Success 200 {object} ResponseCaptchaGet @Failure 500 {object} Map{msg=string} @Router /captcha [get]

func CaptchaStatus

func CaptchaStatus(app *core.App, router fiber.Router)

@Id GetCaptchaStatus @Summary Get Captcha Status @Description Get the status of the user's captcha verification @Tags Captcha @Produce json @Success 200 {object} ResponseCaptchaStatus @Router /captcha/status [get]

func CaptchaVerify

func CaptchaVerify(app *core.App, router fiber.Router)

@Id VerifyCaptcha @Summary Verify Captcha @Description Verify user enters correct captcha code @Tags Captcha @Param data body ParamsCaptchaVerify true "The data to check" @Produce json @Success 200 {object} Map{} @Failure 403 {object} Map{img_data=string} @Router /captcha/verify [post]

func CommentCreate

func CommentCreate(app *core.App, router fiber.Router)

@Id CreateComment @Summary Create Comment @Description Create a new comment @Tags Comment @Param comment body ParamsCommentCreate true "The comment data" @Security ApiKeyAuth @Success 200 {object} ResponseCommentCreate @Failure 400 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Accept json @Produce json @Router /comments [post]

func CommentDelete

func CommentDelete(app *core.App, router fiber.Router)

@Id DeleteComment @Summary Delete Comment @Description Delete a specific comment @Tags Comment @Param id path int true "The comment ID you want to delete" @Security ApiKeyAuth @Produce json @Success 200 {object} Map{} @Failure 403 {object} Map{msg=string} @Failure 404 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /comments/{id} [delete]

func CommentGet

func CommentGet(app *core.App, router fiber.Router)

@Id GetComment @Summary Get a comment @Description Get the detail of a comment by comment id @Tags Comment @Param id path int true "The comment ID you want to get" @Accept json @Produce json @Success 200 {object} ResponseCommentGet @Failure 404 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /comments/{id} [get]

func CommentList

func CommentList(app *core.App, router fiber.Router)

@Id GetComments @Summary Get Comment List @Description Get a list of comments by some conditions @Tags Comment @Security ApiKeyAuth @Param options query ParamsCommentList true "The options" @Accept json @Produce json @Success 200 {object} ResponseCommentList @Failure 500 {object} Map{msg=string} @Router /comments [get]

func CommentUpdate

func CommentUpdate(app *core.App, router fiber.Router)

@Id UpdateComment @Summary Update Comment @Description Update a specific comment @Tags Comment @Param id path int true "The comment ID you want to update" @Param comment body ParamsCommentUpdate true "The comment data" @Security ApiKeyAuth @Accept json @Produce json @Success 200 {object} ResponseCommentUpdate @Failure 400 {object} Map{msg=string} @Failure 403 {object} Map{msg=string} @Failure 404 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /comments/{id} [put]

func Conf

func Conf(app *core.App, router fiber.Router)

@Id Conf @Summary Get System Configs @Description Get System Configs for UI @Tags System @Produce json @Success 200 {object} common.ConfData @Router /conf [get]

func ConfDomain

func ConfDomain(app *core.App, router fiber.Router)

@Id GetDomain @Summary Get Domain Info @Description Get Domain Info @Tags System @Produce json @Param url query string false "Domain URL" @Success 200 {object} ResponseConfDomain @Router /conf/domain [get]

func EmailSend

func EmailSend(app *core.App, router fiber.Router)

@Id SendEmail @Summary Send Email @Description Send an email to test the email sender @Tags System @Security ApiKeyAuth @Param email body ParamsEmailSend true "The email data" @Accept json @Produce json @Success 200 {object} Map{} @Failure 403 {object} Map{msg=string} @Failure 500 {object} Map{} @Router /send_email [post]

func NotifyList

func NotifyList(app *core.App, router fiber.Router)

@Id GetNotifies @Summary Get Notifies @Description Get a list of notifies for user @Tags Notify @Param name query string true "The user name" @Param email query string true "The user email" @Accept json @Produce json @Success 200 {object} ResponseNotifyList @Failure 400 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /notifies [get]

func NotifyRead

func NotifyRead(app *core.App, router fiber.Router)

@Id MarkNotifyRead @Summary Mark Notify as Read @Description Mark specific notification as read for user @Tags Notify @Param comment_id path int true "The comment id of the notify you want to mark as read" @Param notify_key path string true "The key of the notify" @Produce json @Success 200 {object} Map{} @Failure 400 {object} Map{msg=string} @Failure 404 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /notifies/{comment_id}/{notify_key} [post]

func NotifyReadAll

func NotifyReadAll(app *core.App, router fiber.Router)

@Id MarkAllNotifyRead @Summary Mark All Notifies as Read @Description Mark all notifies as read for user @Tags Notify @Param options body ParamsNotifyReadAll true "The options" @Accept json @Produce json @Success 200 {object} Map{} @Failure 400 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /notifies/read [post]

func PageDelete

func PageDelete(app *core.App, router fiber.Router)

@Id DeletePage @Summary Delete Page @Description Delete a specific page @Tags Page @Param id path int true "The page ID you want to delete" @Security ApiKeyAuth @Produce json @Success 200 {object} Map{} @Failure 403 {object} Map{msg=string} @Failure 404 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /pages/{id} [delete]

func PageFetch

func PageFetch(app *core.App, router fiber.Router)

@Id FetchPage @Summary Fetch Page Data @Description Fetch the data of a specific page @Tags Page @Security ApiKeyAuth @Param id path int true "The page ID you want to fetch" @Accept json @Produce json @Success 200 {object} ResponsePageFetch @Failure 404 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /pages/{id}/fetch [post]

func PageFetchAll

func PageFetchAll(app *core.App, router fiber.Router)

@Id FetchAllPages @Summary Fetch All Pages Data @Description Fetch the data of all pages @Tags Page @Security ApiKeyAuth @Param options body ParamsPageFetchAll true "The options" @Accept json @Produce json @Success 200 {object} Map{} @Failure 400 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /pages/fetch [post]

func PageFetchStatus

func PageFetchStatus(app *core.App, router fiber.Router)

@Id GetPageFetchStatus @Summary Get Pages Fetch Status @Description Get the status of the task of fetching all pages @Tags Page @Security ApiKeyAuth @Produce json @Success 200 {object} ResponsePageFetchStatus @Router /pages/fetch/status [get]

func PageList

func PageList(app *core.App, router fiber.Router)

@Id GetPages @Summary Get Page List @Description Get a list of pages by some conditions @Tags Page @Security ApiKeyAuth @Param options query ParamsPageList true "The options" @Accept json @Produce json @Success 200 {object} ResponsePageList @Failure 403 {object} Map{msg=string} @Router /pages [get]

func PagePV

func PagePV(app *core.App, router fiber.Router)

@Id LogPv @Summary Increase Page Views (PV) @Description Increase and get the number of page views @Tags Page @Param page body ParamsPagePV true "The page to record pv" @Accept json @Produce json @Success 200 {object} ResponsePagePV @Router /pages/pv [post]

func PageUpdate

func PageUpdate(app *core.App, router fiber.Router)

@Id UpdatePage @Summary Update Page @Description Update a specific page @Tags Page @Security ApiKeyAuth @Param id path int true "The page ID you want to update" @Param page body ParamsPageUpdate true "The page data" @Accept json @Produce json @Success 200 {object} ResponsePageUpdate @Failure 400 {object} Map{msg=string} @Failure 403 {object} Map{msg=string} @Failure 404 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /pages/{id} [put]

func Paginate

func Paginate(offset int, limit int) func(db *gorm.DB) *gorm.DB

分页

func SettingApply

func SettingApply(app *core.App, router fiber.Router)

@Id ApplySettings @Summary Save and apply Settings @Description Apply settings and restart the server @Tags System @Security ApiKeyAuth @Param settings body ParamsSettingApply true "The settings" @Accept json @Produce json @Success 200 {object} Map{} @Failure 403 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /settings [put]

func SettingGet

func SettingGet(app *core.App, router fiber.Router)

@Id GetSettings @Summary Get Settings @Description Get settings from app config file @Tags System @Security ApiKeyAuth @Produce json @Success 200 {object} ResponseSettingGet @Failure 403 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /settings [get]

func SettingTemplate

func SettingTemplate(app *core.App, router fiber.Router)

@Id GetSettingsTemplate @Summary Get Settings Template @Description Get config templates in different languages for rendering the settings page in the frontend @Tags System @Security ApiKeyAuth @Param locale path string true "The locale of the settings template you want to get" @Produce json @Success 200 {object} ResponseSettingTemplate @Router /settings/template/{locale} [get]

func SiteCreate

func SiteCreate(app *core.App, router fiber.Router)

@Id CreateSite @Summary Create Site @Description Create a new site @Tags Site @Security ApiKeyAuth @Param site body ParamsSiteCreate true "The site data" @Accept json @Produce json @Success 200 {object} ResponseSiteCreate @Failure 400 {object} Map{msg=string} @Failure 403 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /sites [post]

func SiteDelete

func SiteDelete(app *core.App, router fiber.Router)

@Id deleteSite @Summary Site Delete @Description Delete a specific site @Tags Site @Security ApiKeyAuth @Param id path int true "The site ID you want to delete" @Produce json @Success 200 {object} Map{} @Failure 403 {object} Map{msg=string} @Failure 404 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /sites/{id} [delete]

func SiteList

func SiteList(app *core.App, router fiber.Router)

@Id GetSites @Summary Get Site List @Description Get a list of sites by some conditions @Tags Site @Security ApiKeyAuth @Produce json @Success 200 {object} ResponseSiteList @Router /sites [get]

func SiteUpdate

func SiteUpdate(app *core.App, router fiber.Router)

@Id UpdateSite @Summary Update Site @Description Update a specific site @Tags Site @Security ApiKeyAuth @Param id path int true "The site ID you want to update" @Param site body ParamsSiteUpdate true "The site data" @Accept json @Produce json @Success 200 {object} ResponseSiteUpdate @Router /sites/{id} [put]

func Stat

func Stat(app *core.App, router fiber.Router)

@Id GetStats @Summary Statistic @Description Get the statistics of various data analysis @Tags Statistic @Param type path string true "The type of statistics" Enums(latest_comments, latest_pages, pv_most_pages, comment_most_pages, page_pv, site_pv, page_comment, site_comment, rand_comments, rand_pages) @Param options query ParamsStat false "The options" @Accept json @Produce json @Success 200 {object} common.JSONResult @Failure 400 {object} Map{msg=string} @Failure 403 {object} Map{msg=string} @Failure 404 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /stats/{type} [get]

func Transfer

func Transfer(app *core.App, router fiber.Router)

func TransferExport

func TransferExport(app *core.App, router fiber.Router)

@Id ExportArtrans @Summary Export Artrans @Description Export data from Artalk @Tags Transfer @Security ApiKeyAuth @Produce json @Success 200 {object} ResponseTransferExport @Failure 500 {object} Map{msg=string} @Router /transfer/export [get]

func TransferImport

func TransferImport(app *core.App, router fiber.Router)

@Id ImportArtrans @Summary Import Artrans @Description Import data to Artalk @Tags Transfer @Security ApiKeyAuth @Param data body ParamsTransferImport true "The data to import" @Accept json @Produce html @Success 200 {string} string @Router /transfer/import [post]

func TransferUpload

func TransferUpload(app *core.App, router fiber.Router)

@Id UploadArtrans @Summary Upload Artrans @Description Upload a file to prepare to import @Tags Transfer @Security ApiKeyAuth @Param file formData file true "Upload file in preparation for import task" @Accept mpfd @Produce json @Success 200 {object} ResponseTransferUpload{filename=string} @Failure 500 {object} Map{msg=string} @Router /transfer/upload [post]

func Upload

func Upload(app *core.App, router fiber.Router)

@Id Upload @Summary Upload @Description Upload file from this endpoint @Tags Upload @Param file formData file true "Upload file" @Security ApiKeyAuth @Accept mpfd @Produce json @Success 200 {object} ResponseUpload @Failure 400 {object} Map{msg=string} @Failure 403 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /upload [post]

func UserCreate

func UserCreate(app *core.App, router fiber.Router)

@Id CreateUser @Summary Create User @Description Create a new user @Tags User @Param user body ParamsUserCreate true "The user data" @Security ApiKeyAuth @Accept json @Produce json @Success 200 {object} ResponseUserCreate @Failure 400 {object} Map{msg=string} @Failure 403 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /users [post]

func UserDelete

func UserDelete(app *core.App, router fiber.Router)

@Id DeleteUser @Summary Delete User @Description Delete a specific user @Tags User @Param id path int true "The user ID you want to delete" @Security ApiKeyAuth @Produce json @Success 200 {object} Map{} @Failure 403 {object} Map{msg=string} @Failure 404 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /users/{id} [delete]

func UserInfo

func UserInfo(app *core.App, router fiber.Router)

@Id GetUser @Summary Get User Info @Description Get user info to prepare for login or check current user status @Tags Auth @Security ApiKeyAuth @Param user query ParamsUserInfo true "The user to query" @Produce json @Success 200 {object} ResponseUserInfo @Failure 400 {object} Map{msg=string} @Router /user [get]

func UserList

func UserList(app *core.App, router fiber.Router)

@Id GetUsers @Summary Get User List @Description Get a list of users by some conditions @Tags User @Param type path string false "The type of users" Enums(all, admin, in_conf) @Param options query ParamsUserList true "The options" @Security ApiKeyAuth @Accept json @Produce json @Success 200 {object} ResponseAdminUserList @Failure 403 {object} Map{msg=string} @Router /users/{type} [get]

func UserLogin

func UserLogin(app *core.App, router fiber.Router)

@Id Login @Summary Get Access Token @Description Login user by name or email @Tags Auth @Param user body ParamsUserLogin true "The user login data" @Accept json @Produce json @Success 200 {object} ResponseUserLogin @Failure 400 {object} Map{msg=string,data=object{need_name_select=[]string}} "Multiple users with the same email address are matched" @Failure 401 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /user/access_token [post]

func UserStatus

func UserStatus(app *core.App, router fiber.Router)

@Id GetUserStatus @Summary Get Login Status @Description Get user login status by header Authorization @Tags Auth @Security ApiKeyAuth @Param user query ParamsUserStatus true "The user to query" @Produce json @Success 200 {object} ResponseUserStatus @Router /user/status [get]

func UserUpdate

func UserUpdate(app *core.App, router fiber.Router)

@Id UpdateUser @Summary Update User @Description Update a specific user @Tags User @Param id path int true "The user ID you want to update" @Param user body ParamsUserUpdate true "The user data" @Security ApiKeyAuth @Accept json @Produce json @Success 200 {object} ResponseUserUpdate @Failure 400 {object} Map{msg=string} @Failure 403 {object} Map{msg=string} @Failure 404 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /users/{id} [put]

func Version

func Version(app *core.App, router fiber.Router)

@Id GetVersion @Summary Get Version Info @Description Get the version of Artalk @Tags System @Produce json @Success 200 {object} common.ApiVersionData @Router /version [get]

func Vote

func Vote(app *core.App, router fiber.Router)

@Id Vote @Summary Vote @Description Vote for a specific comment or page @Tags Vote @Param type path string true "The type of vote target" Enums(comment_up, comment_down, page_up, page_down) @Param target_id path int true "Target comment or page ID you want to vote for" @Param vote body ParamsVote true "The vote data" @Accept json @Produce json @Success 200 {object} ResponseVote @Failure 403 {object} Map{msg=string} @Failure 404 {object} Map{msg=string} @Failure 500 {object} Map{msg=string} @Router /votes/{type}/{target_id} [post]

func VoteSync

func VoteSync(app *core.App, router fiber.Router)

@Id SyncVotes @Summary Sync Vote Data @Description Sync the number of votes in the `comments` or `pages` data tables to keep them the same as the `votes` table @Tags Vote @Security ApiKeyAuth @Produce json @Success 200 {object} Map{} @Failure 403 {object} Map{msg=string} @Router /votes/sync [post]

Types

type Map

type Map = map[string]interface{}

type ParamsCaptchaVerify

type ParamsCaptchaVerify struct {
	Value string `form:"value" json:"value" validate:"required"` // The captcha value to check
}

type ParamsCommentCreate

type ParamsCommentCreate struct {
	Name    string `json:"name" validate:"required"`    // The comment name
	Email   string `json:"email" validate:"required"`   // The comment email
	Link    string `json:"link" validate:"optional"`    // The comment link
	Content string `json:"content" validate:"required"` // The comment content
	Rid     uint   `json:"rid" validate:"optional"`     // The comment rid
	UA      string `json:"ua" validate:"optional"`      // The comment ua

	PageKey   string `json:"page_key" validate:"required"`   // The comment page_key
	PageTitle string `json:"page_title" validate:"optional"` // The comment page_title

	SiteName string `json:"site_name" validate:"required"` // The site name of your content scope
}

type ParamsCommentList

type ParamsCommentList struct {
	PageKey  string `query:"page_key" json:"page_key" validate:"required"`   // The comment page_key
	SiteName string `query:"site_name" json:"site_name" validate:"optional"` // The site name of your content scope

	Limit  int `query:"limit" json:"limit" validate:"optional"`   // The limit for pagination
	Offset int `query:"offset" json:"offset" validate:"optional"` // The offset for pagination

	FlatMode      bool   `query:"flat_mode" json:"flat_mode" validate:"optional"`                             // Enable flat_mode
	SortBy        string `query:"sort_by" json:"sort_by" enums:"date_asc,date_desc,vote" validate:"optional"` // Sort by condition
	ViewOnlyAdmin bool   `query:"view_only_admin" json:"view_only_admin" validate:"optional"`                 // Only show comments by admin

	Search string `query:"search" json:"search" validate:"optional"` // Search keywords

	Type  string `query:"type" json:"type" enums:"all,mentions,mine,pending" validate:"optional"` // Message center show type
	Scope string `query:"scope" json:"scope" enums:"page,user,site" validate:"optional"`          // The scope of comments
	Name  string `query:"name" json:"name" validate:"optional"`                                   // The username
	Email string `query:"email" json:"email" validate:"optional"`                                 // The user email
}

type ParamsCommentUpdate

type ParamsCommentUpdate struct {
	SiteName string `json:"site_name" validate:"required"` // The site name of your content scope

	Content     string `json:"content" validate:"required"`      // The comment content
	PageKey     string `json:"page_key" validate:"required"`     // The comment page_key
	Nick        string `json:"nick" validate:"optional"`         // The comment nick
	Email       string `json:"email" validate:"optional"`        // The comment email
	Link        string `json:"link" validate:"optional"`         // The comment link
	Rid         uint   `json:"rid" validate:"required"`          // The comment rid
	UA          string `json:"ua" validate:"optional"`           // The comment ua
	IP          string `json:"ip" validate:"optional"`           // The comment ip
	IsCollapsed bool   `json:"is_collapsed" validate:"required"` // The comment is_collapsed
	IsPending   bool   `json:"is_pending" validate:"required"`   // The comment is_pending
	IsPinned    bool   `json:"is_pinned" validate:"required"`    // The comment is_pinned
}

type ParamsEmailSend

type ParamsEmailSend struct {
	Subject string `json:"subject" validate:"required"` // The subject of email
	Body    string `json:"body" validate:"required"`    // The body of email
	ToAddr  string `json:"to_addr" validate:"required"` // The email address of the receiver
}

type ParamsNotifyList

type ParamsNotifyList struct {
	Name  string `query:"name" validate:"optional"`  // The user name
	Email string `query:"email" validate:"optional"` // The user email
}

type ParamsNotifyReadAll

type ParamsNotifyReadAll struct {
	Name  string `json:"name" validate:"required"`  // The username
	Email string `json:"email" validate:"required"` // The user email
}

Mark all notifies as read

type ParamsPageFetchAll

type ParamsPageFetchAll struct {
	SiteName string `json:"site_name" validate:"optional"` // If not empty, only fetch pages of this site
}

type ParamsPageList

type ParamsPageList struct {
	SiteName string `query:"site_name" json:"site_name" validate:"optional"` // The site name of your content scope
	Limit    int    `query:"limit" json:"limit" validate:"optional"`         // The limit for pagination
	Offset   int    `query:"offset" json:"offset" validate:"optional"`       // The offset for pagination
}

type ParamsPagePV

type ParamsPagePV struct {
	PageKey   string `json:"page_key" validate:"required"`   // The page key
	PageTitle string `json:"page_title" validate:"optional"` // The page title
	SiteName  string `json:"site_name" validate:"optional"`  // The site name of your content scope
}

type ParamsPageUpdate

type ParamsPageUpdate struct {
	SiteName string `json:"site_name" validate:"required"` // The site name of your content scope

	Key       string `json:"key" validate:"required"`        // Updated page key
	Title     string `json:"title" validate:"required"`      // Updated page title
	AdminOnly bool   `json:"admin_only" validate:"required"` // Updated page admin_only option
}

type ParamsSettingApply

type ParamsSettingApply struct {
	Yaml string `json:"yaml" validate:"required"` // The content of the config file in YAML format
}

type ParamsSiteCreate

type ParamsSiteCreate struct {
	Name string   `json:"name" validate:"required"` // The site name
	Urls []string `json:"urls" validate:"required"` // The site urls
}

type ParamsSiteUpdate

type ParamsSiteUpdate struct {
	Name string   `json:"name" validate:"required"` // Updated site name
	Urls []string `json:"urls" validate:"required"` // Updated site urls
}

type ParamsStat

type ParamsStat struct {
	SiteName string `query:"site_name" json:"site_name" validate:"optional"` // The site name of your content scope
	PageKeys string `query:"page_keys" json:"page_keys" validate:"optional"` // multiple page keys separated by commas
	Limit    int    `query:"limit" json:"limit" validate:"optional"`         // The limit for pagination
}

type ParamsTransferImport

type ParamsTransferImport struct {
	artransfer.ImportParams
}

type ParamsUpload

type ParamsUpload struct {
}

type ParamsUserCreate

type ParamsUserCreate struct {
	Name         string `json:"name" validate:"required"`          // The user name
	Email        string `json:"email" validate:"required"`         // The user email
	Password     string `json:"password" validate:"optional"`      // The user password
	Link         string `json:"link" validate:"optional"`          // The user link
	IsAdmin      bool   `json:"is_admin" validate:"required"`      // The user is an admin
	ReceiveEmail bool   `json:"receive_email" validate:"required"` // The user receive email
	BadgeName    string `json:"badge_name" validate:"optional"`    // The user badge name
	BadgeColor   string `json:"badge_color" validate:"optional"`   // The user badge color (hex format)
}

type ParamsUserInfo

type ParamsUserInfo struct {
	Name  string `query:"name" json:"name" validate:"optional"`   // The username
	Email string `query:"email" json:"email" validate:"optional"` // The user email
}

type ParamsUserList

type ParamsUserList struct {
	Limit  int `query:"limit" json:"limit" validate:"optional"`   // The limit for pagination
	Offset int `query:"offset" json:"offset" validate:"optional"` // The offset for pagination
}

type ParamsUserLogin

type ParamsUserLogin struct {
	Name     string `json:"name" validate:"optional"`     // The username
	Email    string `json:"email" validate:"required"`    // The user email
	Password string `json:"password" validate:"required"` // The user password
}

type ParamsUserStatus

type ParamsUserStatus struct {
	Name  string `query:"name" json:"name" validate:"optional"`   // The username
	Email string `query:"email" json:"email" validate:"optional"` // The user email
}

type ParamsUserUpdate

type ParamsUserUpdate struct {
	Name         string `json:"name" validate:"required"`          // The user name
	Email        string `json:"email" validate:"required"`         // The user email
	Password     string `json:"password" validate:"optional"`      // The user password
	Link         string `json:"link" validate:"optional"`          // The user link
	IsAdmin      bool   `json:"is_admin" validate:"required"`      // The user is an admin
	ReceiveEmail bool   `json:"receive_email" validate:"required"` // The user receive email
	BadgeName    string `json:"badge_name" validate:"optional"`    // The user badge name
	BadgeColor   string `json:"badge_color" validate:"optional"`   // The user badge color (hex format)
}

type ParamsVote

type ParamsVote struct {
	Name  string `json:"name" validate:"optional"`  // The username
	Email string `json:"email" validate:"optional"` // The user email
}

type ResponseAdminUserList

type ResponseAdminUserList struct {
	Total int64                       `json:"count"`
	Users []entity.CookedUserForAdmin `json:"users"`
}

type ResponseCaptchaGet

type ResponseCaptchaGet struct {
	ImgData string `json:"img_data"`
}

type ResponseCaptchaStatus

type ResponseCaptchaStatus struct {
	IsPass bool `json:"is_pass"`
}

type ResponseCommentCreate

type ResponseCommentCreate struct {
	entity.CookedComment
}

type ResponseCommentGet

type ResponseCommentGet struct {
	Comment      entity.CookedComment  `json:"comment"`       // The comment detail
	ReplyComment *entity.CookedComment `json:"reply_comment"` // The reply comment if exists (like reply)
}

type ResponseCommentList

type ResponseCommentList struct {
	Comments   []entity.CookedComment `json:"comments"`
	Count      int64                  `json:"count"`
	RootsCount int64                  `json:"roots_count"`
	Page       *entity.CookedPage     `json:"page,omitempty"`
}

type ResponseCommentUpdate

type ResponseCommentUpdate struct {
	entity.CookedComment
}

type ResponseConfDomain

type ResponseConfDomain struct {
	Origin    string `json:"origin"`     // The origin of the domain
	IsTrusted bool   `json:"is_trusted"` // Is the domain trusted
}

type ResponseNotifyList

type ResponseNotifyList struct {
	Notifies []entity.CookedNotify `json:"notifies"`
	Count    int                   `json:"count"`
}

type ResponsePageFetch

type ResponsePageFetch struct {
	entity.CookedPage
}

type ResponsePageFetchStatus

type ResponsePageFetchStatus struct {
	Msg        string `json:"msg"`         // The message of the task status
	IsProgress bool   `json:"is_progress"` // If the task is in progress
	Done       int    `json:"done"`        // The number of pages that have been fetched
	Total      int    `json:"total"`       // The total number of pages
}

type ResponsePageList

type ResponsePageList struct {
	Total int64               `json:"count"`
	Pages []entity.CookedPage `json:"pages"`
}

type ResponsePagePV

type ResponsePagePV struct {
	PV int `json:"pv"`
}

type ResponsePageUpdate

type ResponsePageUpdate struct {
	entity.CookedPage
}

type ResponseSettingGet

type ResponseSettingGet struct {
	Yaml string `json:"yaml"`
}

type ResponseSettingTemplate

type ResponseSettingTemplate struct {
	Yaml string `json:"yaml"`
}

type ResponseSiteCreate

type ResponseSiteCreate struct {
	entity.CookedSite
}

type ResponseSiteList

type ResponseSiteList struct {
	Sites []entity.CookedSite `json:"sites"`
	Count int                 `json:"count"`
}

type ResponseSiteUpdate

type ResponseSiteUpdate struct {
	entity.CookedSite
}

type ResponseStat

type ResponseStat struct {
	Data interface{} `json:"data"`
}

type ResponseTransferExport

type ResponseTransferExport struct {
	// The exported data which is a JSON string
	Artrans string `json:"artrans"`
}

type ResponseTransferUpload

type ResponseTransferUpload struct {
	// The uploaded file name which can be used to import
	Filename string `json:"filename"`
}

type ResponseUpload

type ResponseUpload struct {
	FileType  string `json:"file_type" enum:"image"`
	FileName  string `json:"file_name"`
	PublicURL string `json:"public_url"`
}

type ResponseUserCreate

type ResponseUserCreate struct {
	entity.CookedUserForAdmin
}

type ResponseUserInfo

type ResponseUserInfo struct {
	User          *entity.CookedUser    `json:"user"`
	IsLogin       bool                  `json:"is_login"`
	Notifies      []entity.CookedNotify `json:"notifies"`
	NotifiesCount int                   `json:"notifies_count"`
}

type ResponseUserLogin

type ResponseUserLogin struct {
	Token string            `json:"token"`
	User  entity.CookedUser `json:"user"`
}

type ResponseUserStatus

type ResponseUserStatus struct {
	IsAdmin bool `json:"is_admin"`
	IsLogin bool `json:"is_login"`
}

type ResponseUserUpdate

type ResponseUserUpdate struct {
	entity.CookedUserForAdmin
}

type ResponseVote

type ResponseVote struct {
	Up   int `json:"up"`
	Down int `json:"down"`
}

Directories

Path Synopsis
This package's main job is to build the `where` conditions of SQL.
This package's main job is to build the `where` conditions of SQL.

Jump to

Keyboard shortcuts

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