controller

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSetController is controller providers.

Functions

This section is empty.

Types

type AnswerController

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

AnswerController answer controller

func NewAnswerController

func NewAnswerController(answerService *service.AnswerService, rankService *rank.RankService) *AnswerController

NewAnswerController new controller

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 entity.AdminSetAnswerStatusRequest true "AdminSetAnswerStatusRequest" @Router /answer/admin/api/answer/status [put] @Success 200 {object} handler.RespBody

func (*AnswerController) Adopted

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

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

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 data body schema.AnswerList true "AnswerList" @Success 200 {string} string "" @Router /answer/api/v1/answer/list [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) *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 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) *LangController

NewLangController new language controller.

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

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

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

type NotificationController

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

NotificationController notification controller

func NewNotificationController

func NewNotificationController(notificationService *notification.NotificationService) *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) @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 QuestionController

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

QuestionController question controller

func NewQuestionController

func NewQuestionController(questionService *service.QuestionService, rankService *rank.RankService) *QuestionController

NewQuestionController new controller

func (*QuestionController) AddQuestion

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

AddQuestion add question @Summary add question @Description add question @Tags api-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) 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) CloseMsgList

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

CloseMsgList close question msg list @Summary close question msg list @Description close question msg list @Tags api-question @Accept json @Produce json @Security ApiKeyAuth @Success 200 {object} handler.RespBody @Router /answer/api/v1/question/closemsglist [get]

func (*QuestionController) CloseQuestion

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

CloseQuestion Close question @Summary Close question @Description Close question @Tags api-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) CmsSearchAnswerList

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

CmsSearchAnswerList godoc @Summary CmsSearchList @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" @Success 200 {object} handler.RespBody @Router /answer/admin/api/answer/page [get]

func (*QuestionController) CmsSearchList

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

CmsSearchList godoc @Summary CmsSearchList @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) GetQuestion

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

GetQuestion godoc @Summary GetQuestion Question @Description GetQuestion Question @Tags api-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) Index

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

Index godoc @Summary SearchQuestionList @Description SearchQuestionList <br> "order" Enums(newest, active,frequent,score,unanswered) @Tags api-question @Accept json @Produce json @Param data body schema.QuestionSearch true "QuestionSearch" @Success 200 {string} string "" @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 api-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) SearchByTitleLike

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

SearchByTitleLike add question title like @Summary add question title like @Description add question title like @Tags api-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) SearchList

func (qc *QuestionController) SearchList(c *gin.Context)

SearchList godoc @Summary SearchQuestionList @Description SearchQuestionList @Tags api-question @Accept json @Produce json @Param data body schema.QuestionSearch true "QuestionSearch" @Router /answer/api/v1/question/search [post] @Success 200 {string} string ""

func (*QuestionController) SimilarQuestion

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

SimilarQuestion godoc @Summary Search Similar Question @Description Search Similar Question @Tags api-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 api-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) UserAnswerList

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

UserAnswerList godoc @Summary UserAnswerList @Description UserAnswerList @Tags api-answer @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 pagesize query string true "pagesize" default(20) @Success 200 {object} handler.RespBody @Router /answer/api/v1/personal/answer/page [get]

func (*QuestionController) UserCollectionList

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

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

func (*QuestionController) UserList

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

UserList godoc @Summary UserList @Description UserList @Tags api-question @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 pagesize query string true "pagesize" default(20) @Success 200 {object} handler.RespBody @Router /personal/question/page [get]

func (*QuestionController) UserTop

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

UserTop godoc @Summary UserTop @Description UserTop @Tags api-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.GetRankPersonalWithPageResp}} @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) *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]

func (*ReportController) GetReportTypeList

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

GetReportTypeList get report type list @Summary get report type list @Description get report type list @Tags Report @Produce json @Param source query string true "report source" Enums(question, answer, comment, user) @Success 200 {object} handler.RespBody{data=[]schema.GetReportTypeResp} @Router /answer/api/v1/report/type/list [get]

type RevisionController

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

RevisionController revision controller

func NewRevisionController

func NewRevisionController(revisionListService *service.RevisionService) *RevisionController

NewRevisionController new controller

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]

type SearchController

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

SearchController tag controller

func NewSearchController

func NewSearchController(searchService *service.SearchService) *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.SearchListResp} @Router /answer/api/v1/search [get]

type SiteinfoController

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

func NewSiteinfoController

func NewSiteinfoController(siteInfoService *service.SiteInfoService) *SiteinfoController

NewSiteinfoController new siteinfo controller.

func (*SiteinfoController) GetInfo

func (sc *SiteinfoController) GetInfo(ctx *gin.Context)

GetInfo godoc @Summary Get siteinfo @Description Get siteinfo @Tags site @Produce json @Success 200 {object} handler.RespBody{data=schema.SiteGeneralResp} @Router /answer/api/v1/siteinfo [get]

type TagController

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

TagController tag controller

func NewTagController

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

NewTagController new controller

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) 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 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,
	uploaderService *uploader.UploaderService,
) *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.GetUserToSetShowResp} @Router /answer/api/v1/user/info [get]

func (*UserController) GetUserStatus

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

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

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

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

UploadUserAvatar godoc @Summary UserUpdateInfo @Description UserUpdateInfo @Tags User @Accept multipart/form-data @Security ApiKeyAuth @Param file formData file true "file" @Success 200 {object} handler.RespBody{data=string} @Router /answer/api/v1/user/avatar/upload [post]

func (*UserController) UploadUserPostFile

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

UploadUserPostFile godoc @Summary upload user post file @Description upload user post file @Tags User @Accept multipart/form-data @Security ApiKeyAuth @Param file formData file true "file" @Success 200 {object} handler.RespBody{data=string} @Router /answer/api/v1/user/post/file [post]

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.UserEmailLogin true "UserEmailLogin" @Success 200 {object} handler.RespBody{data=schema.GetUserResp} @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.UserModifyPassWordRequest true "UserModifyPassWordRequest" @Success 200 {object} handler.RespBody @Router /answer/api/v1/user/password [put]

func (*UserController) UserNoticeSet

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

UserNoticeSet godoc @Summary UserNoticeSet @Description UserNoticeSet @Tags User @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.UserNoticeSetRequest true "UserNoticeSetRequest" @Success 200 {object} handler.RespBody{data=schema.UserNoticeSetResp} @Router /answer/api/v1/user/notice/set [post]

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.GetUserResp} @Router /answer/api/v1/user/register/email [post]

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) 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.GetUserResp} @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
}

VoteController activity controller

func NewVoteController

func NewVoteController(voteService *service.VoteService) *VoteController

NewVoteController new controller

func (*VoteController) UserVotes

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

UserVotes godoc @Summary user's votes @Description user's vote @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]

Jump to

Keyboard shortcuts

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