controller

package
v0.0.0-...-883d24b Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectorLoginRouterPrefix    = "/connector/login/"
	ConnectorRedirectRouterPrefix = "/connector/redirect/"
)
View Source
const (
	UserCenterLoginRouter          = "/user-center/login/redirect"
	UserCenterSignUpRedirectRouter = "/user-center/sign-up/redirect"
)

Variables

ProviderSetController is controller providers.

View Source
var SiteUrl = ""

Functions

func GetStyle

func GetStyle() (script, css string)

Types

type ActivityController

type ActivityController struct {
	// contains filtered or unexported fields
}

func NewActivityController

func NewActivityController(
	activityService *activity.ActivityService) *ActivityController

NewActivityController new activity controller.

func (*ActivityController) GetObjectTimeline

func (ac *ActivityController) GetObjectTimeline(ctx *gin.Context)

GetObjectTimeline get object timeline @Summary get object timeline @Description get object timeline @Tags Comment @Produce json @Param object_id query string false "object id" @Param tag_slug_name query string false "tag slug name" @Param object_type query string false "object type" Enums(question, answer, tag) @Param show_vote query boolean false "is show vote" @Success 200 {object} handler.RespBody{data=schema.GetObjectTimelineResp} @Router /answer/api/v1/activity/timeline [get]

func (*ActivityController) GetObjectTimelineDetail

func (ac *ActivityController) GetObjectTimelineDetail(ctx *gin.Context)

GetObjectTimelineDetail get object timeline detail @Summary get object timeline detail @Description get object timeline detail @Tags Comment @Produce json @Param revision_id query string true "revision id" @Success 200 {object} handler.RespBody{data=schema.GetObjectTimelineResp} @Router /answer/api/v1/activity/timeline/detail [get]

type AnswerController

type AnswerController struct {
	// contains filtered or unexported fields
}

AnswerController answer controller

func NewAnswerController

func NewAnswerController(
	answerService *service.AnswerService,
	rankService *rank.RankService,
	actionService *action.CaptchaService,
	rateLimitMiddleware *middleware.RateLimitMiddleware,
) *AnswerController

NewAnswerController new controller

func (*AnswerController) Accepted

func (ac *AnswerController) Accepted(ctx *gin.Context)

Accepted godoc @Summary Accepted @Description Accepted @Tags api-answer @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.AcceptAnswerReq true "AcceptAnswerReq" @Success 200 {string} string "" @Router /answer/api/v1/answer/acceptance [post]

func (*AnswerController) Add

func (ac *AnswerController) Add(ctx *gin.Context)

Add godoc @Summary Insert Answer @Description Insert Answer @Tags api-answer @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.AnswerAddReq true "AnswerAddReq" @Success 200 {string} string "" @Router /answer/api/v1/answer [post]

func (*AnswerController) AdminUpdateAnswerStatus

func (ac *AnswerController) AdminUpdateAnswerStatus(ctx *gin.Context)

AdminUpdateAnswerStatus update answer status @Summary update answer status @Description update answer status @Tags admin @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.AdminUpdateAnswerStatusReq true "AdminUpdateAnswerStatusReq" @Success 200 {object} handler.RespBody @Router /answer/admin/api/answer/status [put]

func (*AnswerController) AnswerList

func (ac *AnswerController) AnswerList(ctx *gin.Context)

AnswerList godoc @Summary AnswerList @Description AnswerList <br> <b>order</b> (default or updated) @Tags api-answer @Security ApiKeyAuth @Accept json @Produce json @Param question_id query string true "question_id" @Param order query string true "order" @Param page query string true "page" @Param page_size query string true "page_size" @Success 200 {string} string "" @Router /answer/api/v1/answer/page [get]

func (*AnswerController) Get

func (ac *AnswerController) Get(ctx *gin.Context)

Get godoc @Summary Get Answer @Description Get Answer @Tags api-answer @Accept json @Produce json @Param id query string true "Answer TagID" default(1) @Router /answer/api/v1/answer/info [get] @Success 200 {string} string ""

func (*AnswerController) RecoverAnswer

func (ac *AnswerController) RecoverAnswer(ctx *gin.Context)

RecoverAnswer recover answer @Summary recover answer @Description recover deleted answer @Tags Answer @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.RecoverAnswerReq true "answer" @Success 200 {object} handler.RespBody @Router /answer/api/v1/answer/recover [post]

func (*AnswerController) RemoveAnswer

func (ac *AnswerController) RemoveAnswer(ctx *gin.Context)

RemoveAnswer delete answer @Summary delete answer @Description delete answer @Tags api-answer @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.RemoveAnswerReq true "answer" @Success 200 {object} handler.RespBody @Router /answer/api/v1/answer [delete]

func (*AnswerController) Update

func (ac *AnswerController) Update(ctx *gin.Context)

Update godoc @Summary Update Answer @Description Update Answer @Tags api-answer @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.AnswerUpdateReq true "AnswerUpdateReq" @Success 200 {string} string "" @Router /answer/api/v1/answer [put]

type CollectionController

type CollectionController struct {
	// contains filtered or unexported fields
}

CollectionController collection controller

func NewCollectionController

func NewCollectionController(collectionService *service.CollectionService) *CollectionController

NewCollectionController new controller

func (*CollectionController) CollectionSwitch

func (cc *CollectionController) CollectionSwitch(ctx *gin.Context)

CollectionSwitch add collection @Summary add collection @Description add collection @Tags Collection @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.CollectionSwitchReq true "collection" @Success 200 {object} handler.RespBody{data=schema.CollectionSwitchResp} @Router /answer/api/v1/collection/switch [post]

type CommentController

type CommentController struct {
	// contains filtered or unexported fields
}

CommentController comment controller

func NewCommentController

func NewCommentController(
	commentService *comment.CommentService,
	rankService *rank.RankService,
	actionService *action.CaptchaService,
	rateLimitMiddleware *middleware.RateLimitMiddleware,
) *CommentController

NewCommentController new controller

func (*CommentController) AddComment

func (cc *CommentController) AddComment(ctx *gin.Context)

AddComment add comment @Summary add comment @Description add comment @Tags Comment @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.AddCommentReq true "comment" @Success 200 {object} handler.RespBody{data=schema.GetCommentResp} @Router /answer/api/v1/comment [post]

func (*CommentController) GetComment

func (cc *CommentController) GetComment(ctx *gin.Context)

GetComment godoc @Summary get comment by id @Description get comment by id @Tags Comment @Produce json @Param id query string true "id" @Success 200 {object} handler.RespBody{data=pager.PageModel{list=[]schema.GetCommentResp}} @Router /answer/api/v1/comment [get]

func (*CommentController) GetCommentPersonalWithPage

func (cc *CommentController) GetCommentPersonalWithPage(ctx *gin.Context)

GetCommentPersonalWithPage user personal comment list @Summary user personal comment list @Description user personal comment list @Tags Comment @Produce json @Param page query int false "page" @Param page_size query int false "page size" @Param username query string false "username" @Success 200 {object} handler.RespBody{data=pager.PageModel{list=[]schema.GetCommentPersonalWithPageResp}} @Router /answer/api/v1/personal/comment/page [get]

func (*CommentController) GetCommentWithPage

func (cc *CommentController) GetCommentWithPage(ctx *gin.Context)

GetCommentWithPage get comment page @Summary get comment page @Description get comment page @Tags Comment @Produce json @Param page query int false "page" @Param page_size query int false "page size" @Param object_id query string true "object id" @Param query_cond query string false "query condition" Enums(vote) @Success 200 {object} handler.RespBody{data=pager.PageModel{list=[]schema.GetCommentResp}} @Router /answer/api/v1/comment/page [get]

func (*CommentController) RemoveComment

func (cc *CommentController) RemoveComment(ctx *gin.Context)

RemoveComment remove comment @Summary remove comment @Description remove comment @Tags Comment @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.RemoveCommentReq true "comment" @Success 200 {object} handler.RespBody @Router /answer/api/v1/comment [delete]

func (*CommentController) UpdateComment

func (cc *CommentController) UpdateComment(ctx *gin.Context)

UpdateComment update comment @Summary update comment @Description update comment @Tags Comment @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.UpdateCommentReq true "comment" @Success 200 {object} handler.RespBody @Router /answer/api/v1/comment [put]

type ConnectorController

type ConnectorController struct {
	// contains filtered or unexported fields
}

ConnectorController comment controller

func NewConnectorController

func NewConnectorController(
	siteInfoService siteinfo_common.SiteInfoCommonService,
	emailService *export.EmailService,
	userExternalService *user_external_login.UserExternalLoginService,
) *ConnectorController

NewConnectorController new controller

func (*ConnectorController) ConnectorLogin

func (cc *ConnectorController) ConnectorLogin(connector plugin.Connector) (fn func(ctx *gin.Context))

func (*ConnectorController) ConnectorLoginDispatcher

func (cc *ConnectorController) ConnectorLoginDispatcher(ctx *gin.Context)

ConnectorLoginDispatcher dispatch connector login request to specific connector by slug name We can't register specific router for each connector when application start, because the plugin status will be changed by admin. If the plugin is disabled, the router should be unavailable.

func (*ConnectorController) ConnectorRedirect

func (cc *ConnectorController) ConnectorRedirect(connector plugin.Connector) (fn func(ctx *gin.Context))

func (*ConnectorController) ConnectorRedirectDispatcher

func (cc *ConnectorController) ConnectorRedirectDispatcher(ctx *gin.Context)

func (*ConnectorController) ConnectorsInfo

func (cc *ConnectorController) ConnectorsInfo(ctx *gin.Context)

ConnectorsInfo get all enabled connectors @Summary get all enabled connectors @Description get all enabled connectors @Tags PluginConnector @Security ApiKeyAuth @Produce json @Success 200 {object} handler.RespBody{data=[]schema.ConnectorInfoResp} @Router /answer/api/v1/connector/info [get]

func (*ConnectorController) ConnectorsUserInfo

func (cc *ConnectorController) ConnectorsUserInfo(ctx *gin.Context)

ConnectorsUserInfo get all connectors info about user @Summary get all connectors info about user @Description get all connectors info about user @Tags PluginConnector @Security ApiKeyAuth @Produce json @Success 200 {object} handler.RespBody{data=[]schema.ConnectorUserInfoResp} @Router /answer/api/v1/connector/user/info [get]

func (*ConnectorController) ExternalLoginBindingUserSendEmail

func (cc *ConnectorController) ExternalLoginBindingUserSendEmail(ctx *gin.Context)

ExternalLoginBindingUserSendEmail external login binding user send email @Summary external login binding user send email @Description external login binding user send email @Tags PluginConnector @Accept json @Produce json @Param data body schema.ExternalLoginBindingUserSendEmailReq true "external login binding user send email" @Success 200 {object} handler.RespBody{data=schema.ExternalLoginBindingUserSendEmailResp} @Router /answer/api/v1/connector/binding/email [post]

func (*ConnectorController) ExternalLoginUnbinding

func (cc *ConnectorController) ExternalLoginUnbinding(ctx *gin.Context)

ExternalLoginUnbinding unbind external user login @Summary unbind external user login @Description unbind external user login @Tags PluginConnector @Security ApiKeyAuth @Accept json @Produce json @Param data body schema.ExternalLoginUnbindingReq true "ExternalLoginUnbindingReq" @Success 200 {object} handler.RespBody{} @Router /answer/api/v1/connector/user/unbinding [delete]

type DashboardController

type DashboardController struct {
	// contains filtered or unexported fields
}

func NewDashboardController

func NewDashboardController(
	dashboardService dashboard.DashboardService,
) *DashboardController

NewDashboardController new controller

func (*DashboardController) DashboardInfo

func (ac *DashboardController) DashboardInfo(ctx *gin.Context)

DashboardInfo godoc @Summary DashboardInfo @Description DashboardInfo @Tags admin @Accept json @Produce json @Security ApiKeyAuth @Router /answer/admin/api/dashboard [get] @Success 200 {object} handler.RespBody

type FollowController

type FollowController struct {
	// contains filtered or unexported fields
}

FollowController activity controller

func NewFollowController

func NewFollowController(followService *follow.FollowService) *FollowController

NewFollowController new controller

func (*FollowController) Follow

func (fc *FollowController) Follow(ctx *gin.Context)

Follow godoc @Summary follow object or cancel follow operation @Description follow object or cancel follow operation @Tags Activity @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.FollowReq true "follow" @Success 200 {object} handler.RespBody{data=schema.FollowResp} @Router /answer/api/v1/follow [post]

func (*FollowController) UpdateFollowTags

func (fc *FollowController) UpdateFollowTags(ctx *gin.Context)

UpdateFollowTags update user follow tags @Summary update user follow tags @Description update user follow tags @Tags Activity @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.UpdateFollowTagsReq true "follow" @Success 200 {object} handler.RespBody{} @Router /answer/api/v1/follow/tags [put]

type LangController

type LangController struct {
	// contains filtered or unexported fields
}

func NewLangController

func NewLangController(tr i18n.Translator, siteInfoService siteinfo_common.SiteInfoCommonService) *LangController

NewLangController new language controller.

func (*LangController) GetAdminLangOptions

func (u *LangController) GetAdminLangOptions(ctx *gin.Context)

GetAdminLangOptions Get language options @Summary Get language options @Description Get language options @Tags Lang @Produce json @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/language/options [get]

func (*LangController) GetLangMapping

func (u *LangController) GetLangMapping(ctx *gin.Context)

GetLangMapping get language config mapping @Summary get language config mapping @Description get language config mapping @Tags Lang @Param Accept-Language header string true "Accept-Language" @Produce json @Success 200 {object} handler.RespBody{} @Router /answer/api/v1/language/config [get]

func (*LangController) GetUserLangOptions

func (u *LangController) GetUserLangOptions(ctx *gin.Context)

GetUserLangOptions Get language options @Summary Get language options @Description Get language options @Tags Lang @Produce json @Success 200 {object} handler.RespBody{} @Router /answer/api/v1/language/options [get]

type NotificationController

type NotificationController struct {
	// contains filtered or unexported fields
}

NotificationController notification controller

func NewNotificationController

func NewNotificationController(
	notificationService *notification.NotificationService,
	rankService *rank.RankService,
) *NotificationController

NewNotificationController new controller

func (*NotificationController) ClearIDUnRead

func (nc *NotificationController) ClearIDUnRead(ctx *gin.Context)

ClearIDUnRead @Summary ClearUnRead @Description ClearUnRead @Tags Notification @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.NotificationClearIDRequest true "NotificationClearIDRequest" @Success 200 {object} handler.RespBody @Router /answer/api/v1/notification/read/state [put]

func (*NotificationController) ClearRedDot

func (nc *NotificationController) ClearRedDot(ctx *gin.Context)

ClearRedDot @Summary DelRedDot @Description DelRedDot @Tags Notification @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.NotificationClearRequest true "NotificationClearRequest" @Success 200 {object} handler.RespBody @Router /answer/api/v1/notification/status [put]

func (*NotificationController) ClearUnRead

func (nc *NotificationController) ClearUnRead(ctx *gin.Context)

ClearUnRead @Summary ClearUnRead @Description ClearUnRead @Tags Notification @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.NotificationClearRequest true "NotificationClearRequest" @Success 200 {object} handler.RespBody @Router /answer/api/v1/notification/read/state/all [put]

func (*NotificationController) GetList

func (nc *NotificationController) GetList(ctx *gin.Context)

GetList get notification list @Summary get notification list @Description get notification list @Tags Notification @Accept json @Produce json @Security ApiKeyAuth @Param page query int false "page size" @Param page_size query int false "page size" @Param type query string true "type" Enums(inbox,achievement) @Param inbox_type query string true "inbox_type" Enums(all,posts,invites,votes) @Success 200 {object} handler.RespBody @Router /answer/api/v1/notification/page [get]

func (*NotificationController) GetRedDot

func (nc *NotificationController) GetRedDot(ctx *gin.Context)

GetRedDot @Summary GetRedDot @Description GetRedDot @Tags Notification @Accept json @Produce json @Security ApiKeyAuth @Success 200 {object} handler.RespBody @Router /answer/api/v1/notification/status [get]

type PermissionController

type PermissionController struct {
	// contains filtered or unexported fields
}

func NewPermissionController

func NewPermissionController(rankService *rank.RankService) *PermissionController

NewPermissionController new language controller.

func (*PermissionController) GetPermission

func (u *PermissionController) GetPermission(ctx *gin.Context)

GetPermission check user permission @Summary check user permission @Description check user permission @Tags Permission @Security ApiKeyAuth @Param Authorization header string true "access-token" @Produce json @Param action query string true "permission key" Enums(question.add, question.edit, question.edit_without_review, question.delete, question.close, question.reopen, question.vote_up, question.vote_down, question.pin, question.unpin, question.hide, question.show, answer.add, answer.edit, answer.edit_without_review, answer.delete, answer.accept, answer.vote_up, answer.vote_down, answer.invite_someone_to_answer, comment.add, comment.edit, comment.delete, comment.vote_up, comment.vote_down, report.add, tag.add, tag.edit, tag.edit_slug_name, tag.edit_without_review, tag.delete, tag.synonym, link.url_limit, vote.detail, answer.audit, question.audit, tag.audit, tag.use_reserved_tag) @Success 200 {object} handler.RespBody{data=map[string]bool} @Router /answer/api/v1/permission [get]

type QuestionController

type QuestionController struct {
	// contains filtered or unexported fields
}

QuestionController question controller

func NewQuestionController

func NewQuestionController(
	questionService *service.QuestionService,
	answerService *service.AnswerService,
	rankService *rank.RankService,
	siteInfoService siteinfo_common.SiteInfoCommonService,
	actionService *action.CaptchaService,
	rateLimitMiddleware *middleware.RateLimitMiddleware,
) *QuestionController

NewQuestionController new controller

func (*QuestionController) AddQuestion

func (qc *QuestionController) AddQuestion(ctx *gin.Context)

AddQuestion add question @Summary add question @Description add question @Tags Question @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.QuestionAdd true "question" @Success 200 {object} handler.RespBody @Router /answer/api/v1/question [post]

func (*QuestionController) AddQuestionByAnswer

func (qc *QuestionController) AddQuestionByAnswer(ctx *gin.Context)

AddQuestionByAnswer add question @Summary add question and answer @Description add question and answer @Tags Question @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.QuestionAddByAnswer true "question" @Success 200 {object} handler.RespBody @Router /answer/api/v1/question/answer [post]

func (*QuestionController) AdminAnswerPage

func (qc *QuestionController) AdminAnswerPage(ctx *gin.Context)

AdminAnswerPage admin answer page @Summary AdminAnswerPage admin answer page @Description Status:[available,deleted] @Tags admin @Accept json @Produce json @Security ApiKeyAuth @Param page query int false "page size" @Param page_size query int false "page size" @Param status query string false "user status" Enums(available,deleted) @Param query query string false "answer id or question title" @Param question_id query string false "question id" @Success 200 {object} handler.RespBody @Router /answer/admin/api/answer/page [get]

func (*QuestionController) AdminQuestionPage

func (qc *QuestionController) AdminQuestionPage(ctx *gin.Context)

AdminQuestionPage admin question page @Summary AdminQuestionPage admin question page @Description Status:[available,closed,deleted] @Tags admin @Accept json @Produce json @Security ApiKeyAuth @Param page query int false "page size" @Param page_size query int false "page size" @Param status query string false "user status" Enums(available, closed, deleted) @Param query query string false "question id or title" @Success 200 {object} handler.RespBody @Router /answer/admin/api/question/page [get]

func (*QuestionController) AdminUpdateQuestionStatus

func (qc *QuestionController) AdminUpdateQuestionStatus(ctx *gin.Context)

AdminUpdateQuestionStatus update question status @Summary update question status @Description update question status @Tags admin @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.AdminUpdateQuestionStatusReq true "AdminUpdateQuestionStatusReq" @Success 200 {object} handler.RespBody @Router /answer/admin/api/question/status [put]

func (*QuestionController) CloseQuestion

func (qc *QuestionController) CloseQuestion(ctx *gin.Context)

CloseQuestion Close question @Summary Close question @Description Close question @Tags Question @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.CloseQuestionReq true "question" @Success 200 {object} handler.RespBody @Router /answer/api/v1/question/status [put]

func (*QuestionController) GetQuestion

func (qc *QuestionController) GetQuestion(ctx *gin.Context)

GetQuestion get question details @Summary get question details @Description get question details @Tags Question @Security ApiKeyAuth @Accept json @Produce json @Param id query string true "Question TagID" default(1) @Success 200 {string} string "" @Router /answer/api/v1/question/info [get]

func (*QuestionController) GetQuestionInviteUserInfo

func (qc *QuestionController) GetQuestionInviteUserInfo(ctx *gin.Context)

GetQuestionInviteUserInfo get question invite user info @Summary get question invite user info @Description get question invite user info @Tags Question @Security ApiKeyAuth @Accept json @Produce json @Param id query string true "Question ID" default(1) @Success 200 {string} string "" @Router /answer/api/v1/question/invite [get]

func (*QuestionController) GetSimilarQuestions

func (qc *QuestionController) GetSimilarQuestions(ctx *gin.Context)

GetSimilarQuestions fuzzy query similar questions based on title @Summary fuzzy query similar questions based on title @Description fuzzy query similar questions based on title @Tags Question @Accept json @Produce json @Security ApiKeyAuth @Param title query string true "title" default(string) @Success 200 {object} handler.RespBody @Router /answer/api/v1/question/similar [get]

func (*QuestionController) OperationQuestion

func (qc *QuestionController) OperationQuestion(ctx *gin.Context)

OperationQuestion Operation question @Summary Operation question @Description Operation question \n operation [pin unpin hide show] @Tags Question @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.OperationQuestionReq true "question" @Success 200 {object} handler.RespBody @Router /answer/api/v1/question/operation [put]

func (*QuestionController) PersonalAnswerPage

func (qc *QuestionController) PersonalAnswerPage(ctx *gin.Context)

PersonalAnswerPage list personal answers @Summary list personal answers @Description list personal answers @Tags Personal @Accept json @Produce json @Security ApiKeyAuth @Param username query string true "username" default(string) @Param order query string true "order" Enums(newest,score) @Param page query string true "page" default(0) @Param page_size query string true "page_size" default(20) @Success 200 {object} handler.RespBody @Router /answer/api/v1/personal/answer/page [get]

func (*QuestionController) PersonalCollectionPage

func (qc *QuestionController) PersonalCollectionPage(ctx *gin.Context)

PersonalCollectionPage list personal collections @Summary list personal collections @Description list personal collections @Tags Collection @Accept json @Produce json @Security ApiKeyAuth @Param page query string true "page" default(0) @Param page_size query string true "page_size" default(20) @Success 200 {object} handler.RespBody @Router /answer/api/v1/personal/collection/page [get]

func (*QuestionController) PersonalQuestionPage

func (qc *QuestionController) PersonalQuestionPage(ctx *gin.Context)

PersonalQuestionPage list personal questions @Summary list personal questions @Description list personal questions @Tags Personal @Accept json @Produce json @Security ApiKeyAuth @Param username query string true "username" default(string) @Param order query string true "order" Enums(newest,score) @Param page query string true "page" default(0) @Param page_size query string true "page_size" default(20) @Success 200 {object} handler.RespBody @Router /personal/question/page [get]

func (*QuestionController) QuestionPage

func (qc *QuestionController) QuestionPage(ctx *gin.Context)

QuestionPage get questions by page @Summary get questions by page @Description get questions by page @Tags Question @Accept json @Produce json @Param data body schema.QuestionPageReq true "QuestionPageReq" @Success 200 {object} handler.RespBody{data=pager.PageModel{list=[]schema.QuestionPageResp}} @Router /answer/api/v1/question/page [get]

func (*QuestionController) QuestionRecover

func (qc *QuestionController) QuestionRecover(ctx *gin.Context)

QuestionRecover recover deleted question @Summary recover deleted question @Description recover deleted question @Tags Question @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.QuestionRecoverReq true "question" @Success 200 {object} handler.RespBody @Router /answer/api/v1/question/recover [post]

func (*QuestionController) RemoveQuestion

func (qc *QuestionController) RemoveQuestion(ctx *gin.Context)

RemoveQuestion delete question @Summary delete question @Description delete question @Tags Question @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.RemoveQuestionReq true "question" @Success 200 {object} handler.RespBody @Router /answer/api/v1/question [delete]

func (*QuestionController) ReopenQuestion

func (qc *QuestionController) ReopenQuestion(ctx *gin.Context)

ReopenQuestion reopen question @Summary reopen question @Description reopen question @Tags Question @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.ReopenQuestionReq true "question" @Success 200 {object} handler.RespBody @Router /answer/api/v1/question/reopen [put]

func (*QuestionController) SimilarQuestion

func (qc *QuestionController) SimilarQuestion(ctx *gin.Context)

SimilarQuestion godoc @Summary Search Similar Question @Description Search Similar Question @Tags Question @Accept json @Produce json @Param question_id query string true "question_id" default() @Success 200 {string} string "" @Router /answer/api/v1/question/similar/tag [get]

func (*QuestionController) UpdateQuestion

func (qc *QuestionController) UpdateQuestion(ctx *gin.Context)

UpdateQuestion update question @Summary update question @Description update question @Tags Question @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.QuestionUpdate true "question" @Success 200 {object} handler.RespBody @Router /answer/api/v1/question [put]

func (*QuestionController) UpdateQuestionInviteUser

func (qc *QuestionController) UpdateQuestionInviteUser(ctx *gin.Context)

UpdateQuestionInviteUser update question invite user @Summary update question invite user @Description update question invite user @Tags Question @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.QuestionUpdateInviteUser true "question" @Success 200 {object} handler.RespBody @Router /answer/api/v1/question/invite [put]

func (*QuestionController) UserTop

func (qc *QuestionController) UserTop(ctx *gin.Context)

UserTop godoc @Summary UserTop @Description UserTop @Tags Question @Accept json @Produce json @Security ApiKeyAuth @Param username query string true "username" default(string) @Success 200 {object} handler.RespBody @Router /answer/api/v1/personal/qa/top [get]

type RankController

type RankController struct {
	// contains filtered or unexported fields
}

RankController rank controller

func NewRankController

func NewRankController(
	rankService *rank.RankService) *RankController

NewRankController new controller

func (*RankController) GetRankPersonalWithPage

func (cc *RankController) GetRankPersonalWithPage(ctx *gin.Context)

GetRankPersonalWithPage user personal rank list @Summary user personal rank list @Description user personal rank list @Tags Rank @Produce json @Param page query int false "page" @Param page_size query int false "page size" @Param username query string false "username" @Success 200 {object} handler.RespBody{data=pager.PageModel{list=[]schema.GetRankPersonalPageResp}} @Router /answer/api/v1/personal/rank/page [get]

type ReasonController

type ReasonController struct {
	// contains filtered or unexported fields
}

ReasonController answer controller

func NewReasonController

func NewReasonController(answerService *reason.ReasonService) *ReasonController

NewReasonController new controller

func (*ReasonController) Reasons

func (rc *ReasonController) Reasons(ctx *gin.Context)

Reasons godoc @Summary get reasons by object type and action @Description get reasons by object type and action @Tags reason @Accept json @Produce json @Security ApiKeyAuth @Param object_type query string true "object_type" Enums(question, answer, comment, user) @Param action query string true "action" Enums(status, close, flag, review) @Success 200 {object} handler.RespBody @Router /answer/api/v1/reasons [get] @Router /answer/admin/api/reasons [get]

type ReportController

type ReportController struct {
	// contains filtered or unexported fields
}

ReportController report controller

func NewReportController

func NewReportController(
	reportService *report.ReportService,
	rankService *rank.RankService,
	actionService *action.CaptchaService,
) *ReportController

NewReportController new controller

func (*ReportController) AddReport

func (rc *ReportController) AddReport(ctx *gin.Context)

AddReport add report @Summary add report @Description add report <br> source (question, answer, comment, user) @Security ApiKeyAuth @Tags Report @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.AddReportReq true "report" @Success 200 {object} handler.RespBody @Router /answer/api/v1/report [post]

type RevisionController

type RevisionController struct {
	// contains filtered or unexported fields
}

RevisionController revision controller

func NewRevisionController

func NewRevisionController(
	revisionListService *service.RevisionService,
	rankService *rank.RankService,
) *RevisionController

NewRevisionController new controller

func (*RevisionController) CheckCanUpdateRevision

func (rc *RevisionController) CheckCanUpdateRevision(ctx *gin.Context)

CheckCanUpdateRevision check can update revision @Summary check can update revision @Description check can update revision @Tags Revision @Accept json @Produce json @Security ApiKeyAuth @Param id query string true "id" default(string) @Success 200 {object} handler.RespBody @Router /answer/api/v1/revisions/edit/check [get]

func (*RevisionController) GetRevisionList

func (rc *RevisionController) GetRevisionList(ctx *gin.Context)

GetRevisionList godoc @Summary get revision list @Description get revision list @Tags Revision @Produce json @Param object_id query string true "object id" @Success 200 {object} handler.RespBody{data=[]schema.GetRevisionResp} @Router /answer/api/v1/revisions [get]

func (*RevisionController) GetUnreviewedRevisionList

func (rc *RevisionController) GetUnreviewedRevisionList(ctx *gin.Context)

GetUnreviewedRevisionList godoc @Summary get unreviewed revision list @Description get unreviewed revision list @Tags Revision @Produce json @Security ApiKeyAuth @Param page query string true "page id" @Success 200 {object} handler.RespBody{data=pager.PageModel{list=[]schema.GetUnreviewedRevisionResp}} @Router /answer/api/v1/revisions/unreviewed [get]

func (*RevisionController) RevisionAudit

func (rc *RevisionController) RevisionAudit(ctx *gin.Context)

RevisionAudit godoc @Summary revision audit @Description revision audit operation:approve or reject @Tags Revision @Produce json @Security ApiKeyAuth @Param data body schema.RevisionAuditReq true "audit" @Success 200 {object} handler.RespBody{} @Router /answer/api/v1/revisions/audit [put]

type SearchController

type SearchController struct {
	// contains filtered or unexported fields
}

SearchController tag controller

func NewSearchController

func NewSearchController(
	searchService *service.SearchService,
	actionService *action.CaptchaService,
) *SearchController

NewSearchController new controller

func (*SearchController) Search

func (sc *SearchController) Search(ctx *gin.Context)

Search godoc @Summary search object @Description search object @Tags Search @Produce json @Security ApiKeyAuth @Param q query string true "query string" @Param order query string true "order" Enums(newest,active,score,relevance) @Success 200 {object} handler.RespBody{data=schema.SearchResp} @Router /answer/api/v1/search [get]

func (*SearchController) SearchDesc

func (sc *SearchController) SearchDesc(ctx *gin.Context)

SearchDesc get search description @Summary get search description @Description get search description @Tags Search @Produce json @Success 200 {object} handler.RespBody{data=schema.SearchResp} @Router /answer/api/v1/search/desc [get]

type SiteInfoController

type SiteInfoController struct {
	// contains filtered or unexported fields
}

func NewSiteInfoController

func NewSiteInfoController(siteInfoService siteinfo_common.SiteInfoCommonService) *SiteInfoController

NewSiteInfoController new site info controller.

func (*SiteInfoController) GetManifestJson

func (sc *SiteInfoController) GetManifestJson(ctx *gin.Context)

GetManifestJson get manifest.json

func (*SiteInfoController) GetSiteInfo

func (sc *SiteInfoController) GetSiteInfo(ctx *gin.Context)

GetSiteInfo get site info @Summary get site info @Description get site info @Tags site @Produce json @Success 200 {object} handler.RespBody{data=schema.SiteInfoResp} @Router /answer/api/v1/siteinfo [get]

func (*SiteInfoController) GetSiteLegalInfo

func (sc *SiteInfoController) GetSiteLegalInfo(ctx *gin.Context)

GetSiteLegalInfo get site legal info @Summary get site legal info @Description get site legal info @Tags site @Param info_type query string true "legal information type" Enums(tos, privacy) @Produce json @Success 200 {object} handler.RespBody{data=schema.GetSiteLegalInfoResp} @Router /answer/api/v1/siteinfo/legal [get]

type TagController

type TagController struct {
	// contains filtered or unexported fields
}

TagController tag controller

func NewTagController

func NewTagController(
	tagService *tag.TagService,
	tagCommonService *tag_common.TagCommonService,
	rankService *rank.RankService,
) *TagController

NewTagController new controller

func (*TagController) AddTag

func (tc *TagController) AddTag(ctx *gin.Context)

AddTag add tag @Summary add tag @Description add tag @Tags Tag @Accept json @Produce json @Param data body schema.AddTagReq true "tag" @Success 200 {object} handler.RespBody @Router /answer/api/v1/tag [post]

func (*TagController) GetFollowingTags

func (tc *TagController) GetFollowingTags(ctx *gin.Context)

GetFollowingTags get following tag list @Summary get following tag list @Description get following tag list @Security ApiKeyAuth @Tags Tag @Produce json @Success 200 {object} handler.RespBody{data=[]schema.GetFollowingTagsResp} @Router /answer/api/v1/tags/following [get]

func (*TagController) GetTagInfo

func (tc *TagController) GetTagInfo(ctx *gin.Context)

GetTagInfo get tag one @Summary get tag one @Description get tag one @Tags Tag @Accept json @Produce json @Param tag_id query string true "tag id" @Param tag_name query string true "tag name" @Success 200 {object} handler.RespBody{data=schema.GetTagResp} @Router /answer/api/v1/tag [get]

func (*TagController) GetTagSynonyms

func (tc *TagController) GetTagSynonyms(ctx *gin.Context)

GetTagSynonyms get tag synonyms @Summary get tag synonyms @Description get tag synonyms @Tags Tag @Produce json @Param tag_id query int true "tag id" @Success 200 {object} handler.RespBody{data=schema.GetTagSynonymsResp} @Router /answer/api/v1/tag/synonyms [get]

func (*TagController) GetTagWithPage

func (tc *TagController) GetTagWithPage(ctx *gin.Context)

GetTagWithPage get tag page @Summary get tag page @Description get tag page @Tags Tag @Produce json @Param page query int false "page size" @Param page_size query int false "page size" @Param slug_name query string false "slug_name" @Param query_cond query string false "query condition" Enums(popular, name, newest) @Success 200 {object} handler.RespBody{data=pager.PageModel{list=[]schema.GetTagPageResp}} @Router /answer/api/v1/tags/page [get]

func (*TagController) GetTagsBySlugName

func (tc *TagController) GetTagsBySlugName(ctx *gin.Context)

GetTagsBySlugName @Summary get tags list @Description get tags list @Tags Tag @Produce json @Param tags query []string false "string collection" collectionFormat(csv) @Success 200 {object} handler.RespBody{} @Router /answer/api/v1/tags [get]

func (*TagController) RecoverTag

func (tc *TagController) RecoverTag(ctx *gin.Context)

RecoverTag recover delete tag @Summary recover delete tag @Description recover delete tag @Tags Tag @Accept json @Produce json @Param data body schema.RecoverTagReq true "tag" @Success 200 {object} handler.RespBody @Router /answer/api/v1/tag/recover [post]

func (*TagController) RemoveTag

func (tc *TagController) RemoveTag(ctx *gin.Context)

RemoveTag delete tag @Summary delete tag @Description delete tag @Tags Tag @Accept json @Produce json @Param data body schema.RemoveTagReq true "tag" @Success 200 {object} handler.RespBody @Router /answer/api/v1/tag [delete]

func (*TagController) SearchTagLike

func (tc *TagController) SearchTagLike(ctx *gin.Context)

SearchTagLike get tag list @Summary get tag list @Description get tag list @Tags Tag @Produce json @Security ApiKeyAuth @Param tag query string false "tag" @Success 200 {object} handler.RespBody{data=[]schema.GetTagResp} @Router /answer/api/v1/question/tags [get]

func (*TagController) UpdateTag

func (tc *TagController) UpdateTag(ctx *gin.Context)

UpdateTag update tag @Summary update tag @Description update tag @Tags Tag @Accept json @Produce json @Param data body schema.UpdateTagReq true "tag" @Success 200 {object} handler.RespBody @Router /answer/api/v1/tag [put]

func (*TagController) UpdateTagSynonym

func (tc *TagController) UpdateTagSynonym(ctx *gin.Context)

UpdateTagSynonym update tag @Summary update tag @Description update tag @Tags Tag @Accept json @Produce json @Param data body schema.UpdateTagSynonymReq true "tag" @Success 200 {object} handler.RespBody @Router /answer/api/v1/tag/synonym [put]

type TemplateController

type TemplateController struct {
	// contains filtered or unexported fields
}

func NewTemplateController

func NewTemplateController(
	templateRenderController *templaterender.TemplateRenderController,
	siteInfoService siteinfo_common.SiteInfoCommonService,
) *TemplateController

NewTemplateController new controller

func (*TemplateController) Index

func (tc *TemplateController) Index(ctx *gin.Context)

Index question list

func (*TemplateController) Page404

func (tc *TemplateController) Page404(ctx *gin.Context)

func (*TemplateController) QuestionInfo

func (tc *TemplateController) QuestionInfo(ctx *gin.Context)

QuestionInfo question and answers info

func (*TemplateController) QuestionInfoeRdirect

func (tc *TemplateController) QuestionInfoeRdirect(ctx *gin.Context, siteInfo *schema.TemplateSiteInfoResp, correctTitle bool) (jump bool, url string)

func (*TemplateController) QuestionList

func (tc *TemplateController) QuestionList(ctx *gin.Context)

func (*TemplateController) SiteInfo

func (*TemplateController) Sitemap

func (tc *TemplateController) Sitemap(ctx *gin.Context)

func (*TemplateController) SitemapPage

func (tc *TemplateController) SitemapPage(ctx *gin.Context)

func (*TemplateController) TagInfo

func (tc *TemplateController) TagInfo(ctx *gin.Context)

TagInfo taginfo

func (*TemplateController) TagList

func (tc *TemplateController) TagList(ctx *gin.Context)

TagList tags list

func (*TemplateController) UserInfo

func (tc *TemplateController) UserInfo(ctx *gin.Context)

UserInfo user info

type UploadController

type UploadController struct {
	// contains filtered or unexported fields
}

UploadController upload controller

func NewUploadController

func NewUploadController(uploaderService uploader.UploaderService) *UploadController

NewUploadController new controller

func (*UploadController) PostRender

func (uc *UploadController) PostRender(ctx *gin.Context)

PostRender render post content @Summary render post content @Description render post content @Tags Upload @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.PostRenderReq true "PostRenderReq" @Success 200 {object} handler.RespBody @Router /answer/api/v1/post/render [post]

func (*UploadController) UploadFile

func (uc *UploadController) UploadFile(ctx *gin.Context)

UploadFile upload file @Summary upload file @Description upload file @Tags Upload @Accept multipart/form-data @Security ApiKeyAuth @Param source formData string true "identify the source of the file upload" Enums(post, avatar, branding) @Param file formData file true "file" @Success 200 {object} handler.RespBody{data=string} @Router /answer/api/v1/file [post]

type UserCenterController

type UserCenterController struct {
	// contains filtered or unexported fields
}

UserCenterController comment controller

func NewUserCenterController

func NewUserCenterController(
	userCenterLoginService *user_external_login.UserCenterLoginService,
	siteInfoService siteinfo_common.SiteInfoCommonService,
) *UserCenterController

NewUserCenterController new controller

func (*UserCenterController) UserCenterAdminFunctionAgent

func (uc *UserCenterController) UserCenterAdminFunctionAgent(ctx *gin.Context)

UserCenterAdminFunctionAgent user center admin function agent

func (*UserCenterController) UserCenterAgent

func (uc *UserCenterController) UserCenterAgent(ctx *gin.Context)

UserCenterAgent get user center agent info

func (*UserCenterController) UserCenterLoginCallback

func (uc *UserCenterController) UserCenterLoginCallback(ctx *gin.Context)

func (*UserCenterController) UserCenterLoginRedirect

func (uc *UserCenterController) UserCenterLoginRedirect(ctx *gin.Context)

func (*UserCenterController) UserCenterPersonalBranding

func (uc *UserCenterController) UserCenterPersonalBranding(ctx *gin.Context)

UserCenterPersonalBranding get user center personal user info

func (*UserCenterController) UserCenterSignUpCallback

func (uc *UserCenterController) UserCenterSignUpCallback(ctx *gin.Context)

func (*UserCenterController) UserCenterSignUpRedirect

func (uc *UserCenterController) UserCenterSignUpRedirect(ctx *gin.Context)

func (*UserCenterController) UserCenterUserSettings

func (uc *UserCenterController) UserCenterUserSettings(ctx *gin.Context)

UserCenterUserSettings user center user settings

type UserController

type UserController struct {
	// contains filtered or unexported fields
}

UserController user controller

func NewUserController

func NewUserController(
	authService *auth.AuthService,
	userService *service.UserService,
	actionService *action.CaptchaService,
	emailService *export.EmailService,
	siteInfoCommonService siteinfo_common.SiteInfoCommonService,
	userNotificationConfigService *user_notification_config.UserNotificationConfigService,
) *UserController

NewUserController new controller

func (*UserController) ActionRecord

func (uc *UserController) ActionRecord(ctx *gin.Context)

ActionRecord godoc @Summary ActionRecord @Description ActionRecord @Tags User @Param action query string true "action" Enums(login, e_mail, find_pass) @Security ApiKeyAuth @Success 200 {object} handler.RespBody{data=schema.ActionRecordResp} @Router /answer/api/v1/user/action/record [get]

func (*UserController) GetOtherUserInfoByUsername

func (uc *UserController) GetOtherUserInfoByUsername(ctx *gin.Context)

GetOtherUserInfoByUsername godoc @Summary GetOtherUserInfoByUsername @Description GetOtherUserInfoByUsername @Tags User @Accept json @Produce json @Security ApiKeyAuth @Param username query string true "username" @Success 200 {object} handler.RespBody{data=schema.GetOtherUserInfoResp} @Router /answer/api/v1/personal/user/info [get]

func (*UserController) GetUserInfoByUserID

func (uc *UserController) GetUserInfoByUserID(ctx *gin.Context)

GetUserInfoByUserID get user info, if user no login response http code is 200, but user info is null @Summary GetUserInfoByUserID @Description get user info, if user no login response http code is 200, but user info is null @Tags User @Accept json @Produce json @Security ApiKeyAuth @Success 200 {object} handler.RespBody{data=schema.GetCurrentLoginUserInfoResp} @Router /answer/api/v1/user/info [get]

func (*UserController) GetUserNotificationConfig

func (uc *UserController) GetUserNotificationConfig(ctx *gin.Context)

GetUserNotificationConfig get user's notification config @Summary get user's notification config @Description get user's notification config @Tags User @Accept json @Produce json @Security ApiKeyAuth @Success 200 {object} handler.RespBody{data=schema.GetUserNotificationConfigResp} @Router /answer/api/v1/user/notification/config [post]

func (*UserController) RetrievePassWord

func (uc *UserController) RetrievePassWord(ctx *gin.Context)

RetrievePassWord godoc @Summary RetrievePassWord @Description RetrievePassWord @Tags User @Accept json @Produce json @Param data body schema.UserRetrievePassWordRequest true "UserRetrievePassWordRequest" @Success 200 {string} string "" @Router /answer/api/v1/user/password/reset [post]

func (*UserController) SearchUserListByName

func (uc *UserController) SearchUserListByName(ctx *gin.Context)

SearchUserListByName godoc @Summary SearchUserListByName @Description SearchUserListByName @Tags User @Accept json @Produce json @Security ApiKeyAuth @Param username query string true "username" @Success 200 {object} handler.RespBody{data=schema.GetOtherUserInfoResp} @Router /answer/api/v1/user/info/search [get]

func (*UserController) UpdateUserNotificationConfig

func (uc *UserController) UpdateUserNotificationConfig(ctx *gin.Context)

UpdateUserNotificationConfig update user's notification config @Summary update user's notification config @Description update user's notification config @Tags User @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.UpdateUserNotificationConfigReq true "UpdateUserNotificationConfigReq" @Success 200 {object} handler.RespBody{} @Router /answer/api/v1/user/notification/config [put]

func (*UserController) UseRePassWord

func (uc *UserController) UseRePassWord(ctx *gin.Context)

UseRePassWord godoc @Summary UseRePassWord @Description UseRePassWord @Tags User @Accept json @Produce json @Param data body schema.UserRePassWordRequest true "UserRePassWordRequest" @Success 200 {string} string "" @Router /answer/api/v1/user/password/replacement [post]

func (*UserController) UserChangeEmailSendCode

func (uc *UserController) UserChangeEmailSendCode(ctx *gin.Context)

UserChangeEmailSendCode send email to the user email then change their email @Summary send email to the user email then change their email @Description send email to the user email then change their email @Tags User @Accept json @Produce json @Param data body schema.UserChangeEmailSendCodeReq true "UserChangeEmailSendCodeReq" @Success 200 {object} handler.RespBody{} @Router /answer/api/v1/user/email/change/code [post]

func (*UserController) UserChangeEmailVerify

func (uc *UserController) UserChangeEmailVerify(ctx *gin.Context)

UserChangeEmailVerify user change email verification @Summary user change email verification @Description user change email verification @Tags User @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.UserChangeEmailVerifyReq true "UserChangeEmailVerifyReq" @Success 200 {object} handler.RespBody{} @Router /answer/api/v1/user/email [put]

func (*UserController) UserEmailLogin

func (uc *UserController) UserEmailLogin(ctx *gin.Context)

UserEmailLogin godoc @Summary UserEmailLogin @Description UserEmailLogin @Tags User @Accept json @Produce json @Param data body schema.UserEmailLoginReq true "UserEmailLogin" @Success 200 {object} handler.RespBody{data=schema.UserLoginResp} @Router /answer/api/v1/user/login/email [post]

func (*UserController) UserLogout

func (uc *UserController) UserLogout(ctx *gin.Context)

UserLogout user logout @Summary user logout @Description user logout @Tags User @Accept json @Produce json @Success 200 {object} handler.RespBody @Router /answer/api/v1/user/logout [get]

func (*UserController) UserModifyPassWord

func (uc *UserController) UserModifyPassWord(ctx *gin.Context)

UserModifyPassWord godoc @Summary UserModifyPassWord @Description UserModifyPassWord @Tags User @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.UserModifyPasswordReq true "UserModifyPasswordReq" @Success 200 {object} handler.RespBody @Router /answer/api/v1/user/password [put]

func (*UserController) UserRanking

func (uc *UserController) UserRanking(ctx *gin.Context)

UserRanking get user ranking @Summary get user ranking @Description get user ranking @Tags User @Accept json @Produce json @Security ApiKeyAuth @Success 200 {object} handler.RespBody{data=schema.UserRankingResp} @Router /answer/api/v1/user/ranking [get]

func (*UserController) UserRegisterByEmail

func (uc *UserController) UserRegisterByEmail(ctx *gin.Context)

UserRegisterByEmail godoc @Summary UserRegisterByEmail @Description UserRegisterByEmail @Tags User @Accept json @Produce json @Param data body schema.UserRegisterReq true "UserRegisterReq" @Success 200 {object} handler.RespBody{data=schema.UserLoginResp} @Router /answer/api/v1/user/register/email [post]

func (*UserController) UserRegisterCaptcha

func (uc *UserController) UserRegisterCaptcha(ctx *gin.Context)

UserRegisterCaptcha godoc @Summary UserRegisterCaptcha @Description UserRegisterCaptcha @Tags User @Accept json @Produce json @Success 200 {object} handler.RespBody{data=schema.UserLoginResp} @Router /answer/api/v1/user/register/captcha [get]

func (*UserController) UserUnsubscribeNotification

func (uc *UserController) UserUnsubscribeNotification(ctx *gin.Context)

UserUnsubscribeNotification unsubscribe notification @Summary unsubscribe notification @Description unsubscribe notification @Tags User @Accept json @Produce json @Param data body schema.UserUnsubscribeNotificationReq true "UserUnsubscribeNotificationReq" @Success 200 {object} handler.RespBody{} @Router /answer/api/v1/user/notification/unsubscribe [put]

func (*UserController) UserUpdateInfo

func (uc *UserController) UserUpdateInfo(ctx *gin.Context)

UserUpdateInfo update user info @Summary UserUpdateInfo update user info @Description UserUpdateInfo update user info @Tags User @Accept json @Produce json @Security ApiKeyAuth @Param Authorization header string true "access-token" @Param data body schema.UpdateInfoRequest true "UpdateInfoRequest" @Success 200 {object} handler.RespBody @Router /answer/api/v1/user/info [put]

func (*UserController) UserUpdateInterface

func (uc *UserController) UserUpdateInterface(ctx *gin.Context)

UserUpdateInterface update user interface config @Summary UserUpdateInterface update user interface config @Description UserUpdateInterface update user interface config @Tags User @Accept json @Produce json @Security ApiKeyAuth @Param Authorization header string true "access-token" @Param data body schema.UpdateUserInterfaceRequest true "UpdateInfoRequest" @Success 200 {object} handler.RespBody @Router /answer/api/v1/user/interface [put]

func (*UserController) UserVerifyEmail

func (uc *UserController) UserVerifyEmail(ctx *gin.Context)

UserVerifyEmail godoc @Summary UserVerifyEmail @Description UserVerifyEmail @Tags User @Accept json @Produce json @Param code query string true "code" default() @Success 200 {object} handler.RespBody{data=schema.UserLoginResp} @Router /answer/api/v1/user/email/verification [post]

func (*UserController) UserVerifyEmailSend

func (uc *UserController) UserVerifyEmailSend(ctx *gin.Context)

UserVerifyEmailSend godoc @Summary UserVerifyEmailSend @Description UserVerifyEmailSend @Tags User @Accept json @Produce json @Security ApiKeyAuth @Param captcha_id query string false "captcha_id" default() @Param captcha_code query string false "captcha_code" default() @Success 200 {string} string "" @Router /answer/api/v1/user/email/verification/send [post]

type VoteController

type VoteController struct {
	VoteService *service.VoteService
	// contains filtered or unexported fields
}

VoteController activity controller

func NewVoteController

func NewVoteController(
	voteService *service.VoteService,
	rankService *rank.RankService,
	actionService *action.CaptchaService,
) *VoteController

NewVoteController new controller

func (*VoteController) UserVotes

func (vc *VoteController) UserVotes(ctx *gin.Context)

UserVotes user votes @Summary get user personal votes @Description get user personal votes @Tags Activity @Accept json @Produce json @Security ApiKeyAuth @Param page query int false "page size" @Param page_size query int false "page size" @Success 200 {object} handler.RespBody{data=pager.PageModel{list=[]schema.GetVoteWithPageResp}} @Router /answer/api/v1/personal/vote/page [get]

func (*VoteController) VoteDown

func (vc *VoteController) VoteDown(ctx *gin.Context)

VoteDown godoc @Summary vote down @Description add vote @Tags Activity @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.VoteReq true "vote" @Success 200 {object} handler.RespBody{data=schema.VoteResp} @Router /answer/api/v1/vote/down [post]

func (*VoteController) VoteUp

func (vc *VoteController) VoteUp(ctx *gin.Context)

VoteUp godoc @Summary vote up @Description add vote @Tags Activity @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.VoteReq true "vote" @Success 200 {object} handler.RespBody{data=schema.VoteResp} @Router /answer/api/v1/vote/up [post]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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