controller

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 50 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 added in v1.0.0

func GetStyle() (script, css string)

Types

type ActivityController added in v0.5.0

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

func NewActivityController added in v0.5.0

func NewActivityController(
	activityService *activity.ActivityService) *ActivityController

NewActivityController new activity controller.

func (*ActivityController) GetObjectTimeline added in v0.5.0

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 added in v0.5.0

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,
) *AnswerController

NewAnswerController new controller

func (*AnswerController) Accepted added in v1.0.1

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) AdminSetAnswerStatus

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

AdminSetAnswerStatus godoc @Summary AdminSetAnswerStatus @Description Status:[available,deleted] @Tags admin @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.AdminSetAnswerStatusRequest true "AdminSetAnswerStatusRequest" @Router /answer/admin/api/answer/status [put] @Success 200 {object} handler.RespBody

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) 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,
) *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 added in v1.1.0

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

ConnectorController comment controller

func NewConnectorController added in v1.1.0

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

NewConnectorController new controller

func (*ConnectorController) ConnectorLogin added in v1.1.0

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

func (*ConnectorController) ConnectorLoginDispatcher added in v1.1.0

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 added in v1.1.0

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

func (*ConnectorController) ConnectorRedirectDispatcher added in v1.1.0

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

func (*ConnectorController) ConnectorsInfo added in v1.1.0

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 added in v1.1.0

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 added in v1.1.0

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 added in v1.1.0

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 added in v0.3.0

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

func NewDashboardController added in v0.3.0

func NewDashboardController(
	dashboardService dashboard.DashboardService,
) *DashboardController

NewDashboardController new controller

func (*DashboardController) DashboardInfo added in v0.3.0

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 added in v0.3.0

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 added in v0.3.0

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 added in v1.1.0

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

func NewPermissionController added in v1.1.0

func NewPermissionController(rankService *rank.RankService) *PermissionController

NewPermissionController new language controller.

func (*PermissionController) GetPermission added in v1.1.0

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,
) *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 added in v1.0.8

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 added in v1.1.1

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 added in v1.1.1

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) AdminSetQuestionStatus

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

AdminSetQuestionStatus godoc @Summary AdminSetQuestionStatus @Description Status:[available,closed,deleted] @Tags admin @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.AdminSetQuestionStatusRequest true "AdminSetQuestionStatusRequest" @Router /answer/admin/api/question/status [put] @Success 200 {object} handler.RespBody

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 added in v1.1.0

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 added in v1.1.3

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 added in v1.0.9

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 added in v1.1.0

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 added in v1.1.0

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 added in v1.1.0

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 added in v1.0.2

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) 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 added in v1.0.0

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 added in v1.1.0

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 added in v0.5.0

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 added in v0.5.0

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 added in v0.5.0

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 added in v1.1.2

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 added in v1.1.1

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

func NewSiteInfoController added in v1.1.1

func NewSiteInfoController(siteInfoService siteinfo_common.SiteInfoCommonService) *SiteInfoController

NewSiteInfoController new site info controller.

func (*SiteInfoController) GetManifestJson added in v1.1.1

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

GetManifestJson get manifest.json

func (*SiteInfoController) GetSiteInfo added in v1.1.1

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 added in v1.1.1

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 added in v1.0.7

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 added in v1.0.5

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) 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 added in v1.0.0

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

func NewTemplateController added in v1.0.0

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

NewTemplateController new controller

func (*TemplateController) Index added in v1.0.0

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

Index question list

func (*TemplateController) Page404 added in v1.0.0

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

func (*TemplateController) QuestionInfo added in v1.0.0

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

QuestionInfo question and answers info

func (*TemplateController) QuestionInfoeRdirect added in v1.0.2

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

func (*TemplateController) QuestionList added in v1.0.0

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

func (*TemplateController) SiteInfo added in v1.0.0

func (*TemplateController) Sitemap added in v1.0.0

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

func (*TemplateController) SitemapPage added in v1.0.0

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

func (*TemplateController) TagInfo added in v1.0.0

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

TagInfo taginfo

func (*TemplateController) TagList added in v1.0.0

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

TagList tags list

func (*TemplateController) UserInfo added in v1.0.0

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

UserInfo user info

type UploadController added in v0.4.0

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

UploadController upload controller

func NewUploadController added in v0.4.0

func NewUploadController(uploaderService uploader.UploaderService) *UploadController

NewUploadController new controller

func (*UploadController) PostRender added in v1.0.3

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 added in v0.4.0

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 added in v1.1.0

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

UserCenterController comment controller

func NewUserCenterController added in v1.1.0

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

NewUserCenterController new controller

func (*UserCenterController) UserCenterAdminFunctionAgent added in v1.1.0

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

UserCenterAdminFunctionAgent user center admin function agent

func (*UserCenterController) UserCenterAgent added in v1.1.0

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

UserCenterAgent get user center agent info

func (*UserCenterController) UserCenterLoginCallback added in v1.1.0

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

func (*UserCenterController) UserCenterLoginRedirect added in v1.1.0

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

func (*UserCenterController) UserCenterPersonalBranding added in v1.1.0

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

UserCenterPersonalBranding get user center personal user info

func (*UserCenterController) UserCenterSignUpCallback added in v1.1.0

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

func (*UserCenterController) UserCenterSignUpRedirect added in v1.1.0

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

func (*UserCenterController) UserCenterUserSettings added in v1.1.0

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 added in v1.1.2

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 added in v1.1.0

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 added in v1.1.2

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 added in v1.0.0

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 added in v1.0.0

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 added in v1.1.2

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 added in v0.3.0

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