Documentation ¶
Index ¶
- Variables
- type PluginController
- func (pc *PluginController) GetAllPluginStatus(ctx *gin.Context)
- func (pc *PluginController) GetPluginConfig(ctx *gin.Context)
- func (pc *PluginController) GetPluginList(ctx *gin.Context)
- func (pc *PluginController) UpdatePluginConfig(ctx *gin.Context)
- func (pc *PluginController) UpdatePluginStatus(ctx *gin.Context)
- type ReportController
- type RoleController
- type SiteInfoController
- func (sc *SiteInfoController) GetCss(ctx *gin.Context)
- func (sc *SiteInfoController) GetGeneral(ctx *gin.Context)
- func (sc *SiteInfoController) GetInterface(ctx *gin.Context)
- func (sc *SiteInfoController) GetPrivilegesConfig(ctx *gin.Context)
- func (sc *SiteInfoController) GetRobots(ctx *gin.Context)
- func (sc *SiteInfoController) GetSMTPConfig(ctx *gin.Context)
- func (sc *SiteInfoController) GetSeo(ctx *gin.Context)
- func (sc *SiteInfoController) GetSiteBranding(ctx *gin.Context)
- func (sc *SiteInfoController) GetSiteCustomCssHTML(ctx *gin.Context)
- func (sc *SiteInfoController) GetSiteLegal(ctx *gin.Context)
- func (sc *SiteInfoController) GetSiteLogin(ctx *gin.Context)
- func (sc *SiteInfoController) GetSiteTheme(ctx *gin.Context)
- func (sc *SiteInfoController) GetSiteUsers(ctx *gin.Context)
- func (sc *SiteInfoController) GetSiteWrite(ctx *gin.Context)
- func (sc *SiteInfoController) SaveSiteTheme(ctx *gin.Context)
- func (sc *SiteInfoController) UpdateBranding(ctx *gin.Context)
- func (sc *SiteInfoController) UpdateGeneral(ctx *gin.Context)
- func (sc *SiteInfoController) UpdateInterface(ctx *gin.Context)
- func (sc *SiteInfoController) UpdatePrivilegesConfig(ctx *gin.Context)
- func (sc *SiteInfoController) UpdateSMTPConfig(ctx *gin.Context)
- func (sc *SiteInfoController) UpdateSeo(ctx *gin.Context)
- func (sc *SiteInfoController) UpdateSiteCustomCssHTML(ctx *gin.Context)
- func (sc *SiteInfoController) UpdateSiteLegal(ctx *gin.Context)
- func (sc *SiteInfoController) UpdateSiteLogin(ctx *gin.Context)
- func (sc *SiteInfoController) UpdateSiteUsers(ctx *gin.Context)
- func (sc *SiteInfoController) UpdateSiteWrite(ctx *gin.Context)
- type ThemeController
- type UserAdminController
- func (uc *UserAdminController) AddUser(ctx *gin.Context)
- func (uc *UserAdminController) AddUsers(ctx *gin.Context)
- func (uc *UserAdminController) GetUserActivation(ctx *gin.Context)
- func (uc *UserAdminController) GetUserPage(ctx *gin.Context)
- func (uc *UserAdminController) SendUserActivation(ctx *gin.Context)
- func (uc *UserAdminController) UpdateUserPassword(ctx *gin.Context)
- func (uc *UserAdminController) UpdateUserRole(ctx *gin.Context)
- func (uc *UserAdminController) UpdateUserStatus(ctx *gin.Context)
Constants ¶
This section is empty.
Variables ¶
var ProviderSetController = wire.NewSet( NewReportController, NewUserAdminController, NewThemeController, NewSiteInfoController, NewRoleController, NewPluginController, )
ProviderSetController is controller providers.
Functions ¶
This section is empty.
Types ¶
type PluginController ¶
type PluginController struct {
PluginCommonService *plugin_common.PluginCommonService
}
PluginController role controller
func NewPluginController ¶
func NewPluginController(PluginCommonService *plugin_common.PluginCommonService) *PluginController
NewPluginController new controller
func (*PluginController) GetAllPluginStatus ¶
func (pc *PluginController) GetAllPluginStatus(ctx *gin.Context)
GetAllPluginStatus get all plugins status @Summary get all plugins status @Description get all plugins status @Tags Plugin @Security ApiKeyAuth @Accept json @Produce json @Success 200 {object} handler.RespBody{data=[]schema.GetPluginListResp} @Router /answer/api/v1/plugin/status [get]
func (*PluginController) GetPluginConfig ¶
func (pc *PluginController) GetPluginConfig(ctx *gin.Context)
GetPluginConfig get plugin config @Summary get plugin config @Description get plugin config @Tags AdminPlugin @Security ApiKeyAuth @Produce json @Param plugin_slug_name query string true "plugin_slug_name" @Success 200 {object} handler.RespBody{data=schema.GetPluginConfigResp} @Router /answer/admin/api/plugin/config [get]
func (*PluginController) GetPluginList ¶
func (pc *PluginController) GetPluginList(ctx *gin.Context)
GetPluginList get plugin list @Summary get plugin list @Description get plugin list @Tags AdminPlugin @Security ApiKeyAuth @Accept json @Produce json @Param status query string false "status: active/inactive" @Param have_config query boolean false "have config" @Success 200 {object} handler.RespBody{data=[]schema.GetPluginListResp} @Router /answer/admin/api/plugins [get]
func (*PluginController) UpdatePluginConfig ¶
func (pc *PluginController) UpdatePluginConfig(ctx *gin.Context)
UpdatePluginConfig update plugin config @Summary update plugin config @Description update plugin config @Tags AdminPlugin @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.UpdatePluginConfigReq true "UpdatePluginConfigReq" @Success 200 {object} handler.RespBody @Router /answer/admin/api/plugin/config [put]
func (*PluginController) UpdatePluginStatus ¶
func (pc *PluginController) UpdatePluginStatus(ctx *gin.Context)
UpdatePluginStatus update plugin status @Summary update plugin status @Description update plugin status @Tags AdminPlugin @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.UpdatePluginStatusReq true "UpdatePluginStatusReq" @Success 200 {object} handler.RespBody @Router /answer/admin/api/plugin/status [put]
type ReportController ¶
type ReportController struct {
// contains filtered or unexported fields
}
ReportController report controller
func NewReportController ¶
func NewReportController(reportService *report_admin.ReportAdminService) *ReportController
NewReportController new controller
func (*ReportController) Handle ¶
func (rc *ReportController) Handle(ctx *gin.Context)
Handle godoc @Summary handle flag @Description handle flag @Security ApiKeyAuth @Tags admin @Accept json @Produce json @Security ApiKeyAuth @Param data body schema.ReportHandleReq true "flag" @Success 200 {object} handler.RespBody @Router /answer/admin/api/report/ [put]
func (*ReportController) ListReportPage ¶
func (rc *ReportController) ListReportPage(ctx *gin.Context)
ListReportPage godoc @Summary list report page @Description list report records @Security ApiKeyAuth @Tags admin @Accept json @Produce json @Security ApiKeyAuth @Param status query string true "status" Enums(pending, completed) @Param object_type query string true "object_type" Enums(all, question,answer,comment) @Param page query int false "page size" @Param page_size query int false "page size" @Success 200 {object} handler.RespBody @Router /answer/admin/api/reports/page [get]
type RoleController ¶
type RoleController struct {
// contains filtered or unexported fields
}
RoleController role controller
func NewRoleController ¶
func NewRoleController(roleService *service.RoleService) *RoleController
NewRoleController new controller
func (*RoleController) GetRoleList ¶
func (rc *RoleController) GetRoleList(ctx *gin.Context)
GetRoleList get role list @Summary get role list @Description get role list @Tags admin @Produce json @Success 200 {object} handler.RespBody{data=[]schema.GetRoleResp} @Router /answer/admin/api/roles [get]
type SiteInfoController ¶
type SiteInfoController struct {
// contains filtered or unexported fields
}
SiteInfoController site info controller
func NewSiteInfoController ¶
func NewSiteInfoController(siteInfoService *siteinfo.SiteInfoService) *SiteInfoController
NewSiteInfoController new site info controller
func (*SiteInfoController) GetCss ¶
func (sc *SiteInfoController) GetCss(ctx *gin.Context)
GetRobots get site robots information @Summary get site robots information @Description get site robots information @Tags site @Produce json @Success 200 {string} txt "" @Router /custom.css [get]
func (*SiteInfoController) GetGeneral ¶
func (sc *SiteInfoController) GetGeneral(ctx *gin.Context)
GetGeneral get site general information @Summary get site general information @Description get site general information @Security ApiKeyAuth @Tags admin @Produce json @Success 200 {object} handler.RespBody{data=schema.SiteGeneralResp} @Router /answer/admin/api/siteinfo/general [get]
func (*SiteInfoController) GetInterface ¶
func (sc *SiteInfoController) GetInterface(ctx *gin.Context)
GetInterface get site interface @Summary get site interface @Description get site interface @Security ApiKeyAuth @Tags admin @Produce json @Success 200 {object} handler.RespBody{data=schema.SiteInterfaceResp} @Router /answer/admin/api/siteinfo/interface [get]
func (*SiteInfoController) GetPrivilegesConfig ¶
func (sc *SiteInfoController) GetPrivilegesConfig(ctx *gin.Context)
GetPrivilegesConfig get privileges config @Summary GetPrivilegesConfig get privileges config @Description GetPrivilegesConfig get privileges config @Security ApiKeyAuth @Tags admin @Produce json @Success 200 {object} handler.RespBody{data=schema.GetPrivilegesConfigResp} @Router /answer/admin/api/setting/privileges [get]
func (*SiteInfoController) GetRobots ¶
func (sc *SiteInfoController) GetRobots(ctx *gin.Context)
GetRobots get site robots information @Summary get site robots information @Description get site robots information @Tags site @Produce json @Success 200 {string} txt "" @Router /robots.txt [get]
func (*SiteInfoController) GetSMTPConfig ¶
func (sc *SiteInfoController) GetSMTPConfig(ctx *gin.Context)
GetSMTPConfig get smtp config @Summary GetSMTPConfig get smtp config @Description GetSMTPConfig get smtp config @Security ApiKeyAuth @Tags admin @Produce json @Success 200 {object} handler.RespBody{data=schema.GetSMTPConfigResp} @Router /answer/admin/api/setting/smtp [get]
func (*SiteInfoController) GetSeo ¶
func (sc *SiteInfoController) GetSeo(ctx *gin.Context)
GetSeo get site seo information @Summary get site seo information @Description get site seo information @Security ApiKeyAuth @Tags admin @Produce json @Success 200 {object} handler.RespBody{data=schema.SiteSeoResp} @Router /answer/admin/api/siteinfo/seo [get]
func (*SiteInfoController) GetSiteBranding ¶
func (sc *SiteInfoController) GetSiteBranding(ctx *gin.Context)
GetSiteBranding get site interface @Summary get site interface @Description get site interface @Security ApiKeyAuth @Tags admin @Produce json @Success 200 {object} handler.RespBody{data=schema.SiteBrandingResp} @Router /answer/admin/api/siteinfo/branding [get]
func (*SiteInfoController) GetSiteCustomCssHTML ¶
func (sc *SiteInfoController) GetSiteCustomCssHTML(ctx *gin.Context)
GetSiteCustomCssHTML get site info custom html css config @Summary get site info custom html css config @Description get site info custom html css config @Security ApiKeyAuth @Tags admin @Produce json @Success 200 {object} handler.RespBody{data=schema.SiteCustomCssHTMLResp} @Router /answer/admin/api/siteinfo/custom-css-html [get]
func (*SiteInfoController) GetSiteLegal ¶
func (sc *SiteInfoController) GetSiteLegal(ctx *gin.Context)
GetSiteLegal Set the legal information for the site @Summary Set the legal information for the site @Description Set the legal information for the site @Security ApiKeyAuth @Tags admin @Produce json @Success 200 {object} handler.RespBody{data=schema.SiteLegalResp} @Router /answer/admin/api/siteinfo/legal [get]
func (*SiteInfoController) GetSiteLogin ¶
func (sc *SiteInfoController) GetSiteLogin(ctx *gin.Context)
GetSiteLogin get site info login config @Summary get site info login config @Description get site info login config @Security ApiKeyAuth @Tags admin @Produce json @Success 200 {object} handler.RespBody{data=schema.SiteLoginResp} @Router /answer/admin/api/siteinfo/login [get]
func (*SiteInfoController) GetSiteTheme ¶
func (sc *SiteInfoController) GetSiteTheme(ctx *gin.Context)
GetSiteTheme get site info theme config @Summary get site info theme config @Description get site info theme config @Security ApiKeyAuth @Tags admin @Produce json @Success 200 {object} handler.RespBody{data=schema.SiteThemeResp} @Router /answer/admin/api/siteinfo/theme [get]
func (*SiteInfoController) GetSiteUsers ¶
func (sc *SiteInfoController) GetSiteUsers(ctx *gin.Context)
GetSiteUsers get site user config @Summary get site user config @Description get site user config @Security ApiKeyAuth @Tags admin @Produce json @Success 200 {object} handler.RespBody{data=schema.SiteUsersResp} @Router /answer/admin/api/siteinfo/users [get]
func (*SiteInfoController) GetSiteWrite ¶
func (sc *SiteInfoController) GetSiteWrite(ctx *gin.Context)
GetSiteWrite get site interface @Summary get site interface @Description get site interface @Security ApiKeyAuth @Tags admin @Produce json @Success 200 {object} handler.RespBody{data=schema.SiteWriteResp} @Router /answer/admin/api/siteinfo/write [get]
func (*SiteInfoController) SaveSiteTheme ¶
func (sc *SiteInfoController) SaveSiteTheme(ctx *gin.Context)
SaveSiteTheme update site custom css html config @Summary update site custom css html config @Description update site custom css html config @Security ApiKeyAuth @Tags admin @Produce json @Param data body schema.SiteThemeReq true "login info" @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/siteinfo/theme [put]
func (*SiteInfoController) UpdateBranding ¶
func (sc *SiteInfoController) UpdateBranding(ctx *gin.Context)
UpdateBranding update site branding @Summary update site info branding @Description update site info branding @Security ApiKeyAuth @Tags admin @Produce json @Param data body schema.SiteBrandingReq true "branding info" @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/siteinfo/branding [put]
func (*SiteInfoController) UpdateGeneral ¶
func (sc *SiteInfoController) UpdateGeneral(ctx *gin.Context)
UpdateGeneral update site general information @Summary update site general information @Description update site general information @Security ApiKeyAuth @Tags admin @Produce json @Param data body schema.SiteGeneralReq true "general" @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/siteinfo/general [put]
func (*SiteInfoController) UpdateInterface ¶
func (sc *SiteInfoController) UpdateInterface(ctx *gin.Context)
UpdateInterface update site interface @Summary update site info interface @Description update site info interface @Security ApiKeyAuth @Tags admin @Produce json @Param data body schema.SiteInterfaceReq true "general" @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/siteinfo/interface [put]
func (*SiteInfoController) UpdatePrivilegesConfig ¶
func (sc *SiteInfoController) UpdatePrivilegesConfig(ctx *gin.Context)
UpdatePrivilegesConfig update privileges config @Summary update privileges config @Description update privileges config @Security ApiKeyAuth @Tags admin @Produce json @Param data body schema.UpdatePrivilegesConfigReq true "config" @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/setting/privileges [put]
func (*SiteInfoController) UpdateSMTPConfig ¶
func (sc *SiteInfoController) UpdateSMTPConfig(ctx *gin.Context)
UpdateSMTPConfig update smtp config @Summary update smtp config @Description update smtp config @Security ApiKeyAuth @Tags admin @Produce json @Param data body schema.UpdateSMTPConfigReq true "smtp config" @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/setting/smtp [put]
func (*SiteInfoController) UpdateSeo ¶
func (sc *SiteInfoController) UpdateSeo(ctx *gin.Context)
UpdateSeo update site seo information @Summary update site seo information @Description update site seo information @Security ApiKeyAuth @Tags admin @Produce json @Param data body schema.SiteSeoReq true "seo" @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/siteinfo/seo [put]
func (*SiteInfoController) UpdateSiteCustomCssHTML ¶
func (sc *SiteInfoController) UpdateSiteCustomCssHTML(ctx *gin.Context)
UpdateSiteCustomCssHTML update site custom css html config @Summary update site custom css html config @Description update site custom css html config @Security ApiKeyAuth @Tags admin @Produce json @Param data body schema.SiteCustomCssHTMLReq true "login info" @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/siteinfo/custom-css-html [put]
func (*SiteInfoController) UpdateSiteLegal ¶
func (sc *SiteInfoController) UpdateSiteLegal(ctx *gin.Context)
UpdateSiteLegal update site legal info @Summary update site legal info @Description update site legal info @Security ApiKeyAuth @Tags admin @Produce json @Param data body schema.SiteLegalReq true "write info" @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/siteinfo/legal [put]
func (*SiteInfoController) UpdateSiteLogin ¶
func (sc *SiteInfoController) UpdateSiteLogin(ctx *gin.Context)
UpdateSiteLogin update site login @Summary update site login @Description update site login @Security ApiKeyAuth @Tags admin @Produce json @Param data body schema.SiteLoginReq true "login info" @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/siteinfo/login [put]
func (*SiteInfoController) UpdateSiteUsers ¶
func (sc *SiteInfoController) UpdateSiteUsers(ctx *gin.Context)
UpdateSiteUsers update site config about users @Summary update site info config about users @Description update site info config about users @Security ApiKeyAuth @Tags admin @Produce json @Param data body schema.SiteUsersReq true "users info" @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/siteinfo/users [put]
func (*SiteInfoController) UpdateSiteWrite ¶
func (sc *SiteInfoController) UpdateSiteWrite(ctx *gin.Context)
UpdateSiteWrite update site write info @Summary update site write info @Description update site write info @Security ApiKeyAuth @Tags admin @Produce json @Param data body schema.SiteWriteReq true "write info" @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/siteinfo/write [put]
type ThemeController ¶
type ThemeController struct{}
func NewThemeController ¶
func NewThemeController() *ThemeController
NewThemeController new theme controller.
func (*ThemeController) GetThemeOptions ¶
func (t *ThemeController) GetThemeOptions(ctx *gin.Context)
GetThemeOptions godoc @Summary Get theme options @Description Get theme options @Security ApiKeyAuth @Tags admin @Produce json @Success 200 {object} handler.RespBody{} @Router /answer/admin/api/theme/options [get]
type UserAdminController ¶
type UserAdminController struct {
// contains filtered or unexported fields
}
UserAdminController user controller
func NewUserAdminController ¶
func NewUserAdminController(userService *user_admin.UserAdminService) *UserAdminController
NewUserAdminController new controller
func (*UserAdminController) AddUser ¶
func (uc *UserAdminController) AddUser(ctx *gin.Context)
AddUser add user @Summary add user @Description add user @Security ApiKeyAuth @Tags admin @Accept json @Produce json @Param data body schema.AddUserReq true "user" @Success 200 {object} handler.RespBody @Router /answer/admin/api/user [post]
func (*UserAdminController) AddUsers ¶
func (uc *UserAdminController) AddUsers(ctx *gin.Context)
AddUsers add users @Summary add users @Description add users @Security ApiKeyAuth @Tags admin @Accept json @Produce json @Param data body schema.AddUsersReq true "user" @Success 200 {object} handler.RespBody @Router /answer/admin/api/users [post]
func (*UserAdminController) GetUserActivation ¶
func (uc *UserAdminController) GetUserActivation(ctx *gin.Context)
GetUserActivation get user activation @Summary get user activation @Description get user activation @Security ApiKeyAuth @Tags admin @Produce json @Param user_id query string true "user id" @Success 200 {object} handler.RespBody{data=schema.GetUserActivationResp} @Router /answer/admin/api/user/activation [get]
func (*UserAdminController) GetUserPage ¶
func (uc *UserAdminController) GetUserPage(ctx *gin.Context)
GetUserPage get user page @Summary get user page @Description get user page @Security ApiKeyAuth @Tags admin @Produce json @Param page query int false "page size" @Param page_size query int false "page size" @Param query query string false "search query: email, username or id:[id]" @Param staff query bool false "staff user" @Param status query string false "user status" Enums(suspended, deleted, inactive) @Success 200 {object} handler.RespBody{data=pager.PageModel{records=[]schema.GetUserPageResp}} @Router /answer/admin/api/users/page [get]
func (*UserAdminController) SendUserActivation ¶
func (uc *UserAdminController) SendUserActivation(ctx *gin.Context)
SendUserActivation send user activation @Summary send user activation @Description send user activation @Security ApiKeyAuth @Tags admin @Produce json @Param data body schema.SendUserActivationReq true "SendUserActivationReq" @Success 200 {object} handler.RespBody @Router /answer/admin/api/users/activation [post]
func (*UserAdminController) UpdateUserPassword ¶
func (uc *UserAdminController) UpdateUserPassword(ctx *gin.Context)
UpdateUserPassword update user password @Summary update user password @Description update user password @Security ApiKeyAuth @Tags admin @Accept json @Produce json @Param data body schema.UpdateUserPasswordReq true "user" @Success 200 {object} handler.RespBody @Router /answer/admin/api/user/password [put]
func (*UserAdminController) UpdateUserRole ¶
func (uc *UserAdminController) UpdateUserRole(ctx *gin.Context)
UpdateUserRole update user role @Summary update user role @Description update user role @Security ApiKeyAuth @Tags admin @Accept json @Produce json @Param data body schema.UpdateUserRoleReq true "user" @Success 200 {object} handler.RespBody @Router /answer/admin/api/user/role [put]
func (*UserAdminController) UpdateUserStatus ¶
func (uc *UserAdminController) UpdateUserStatus(ctx *gin.Context)
UpdateUserStatus update user @Summary update user @Description update user @Security ApiKeyAuth @Tags admin @Accept json @Produce json @Param data body schema.UpdateUserStatusReq true "user" @Success 200 {object} handler.RespBody @Router /answer/admin/api/user/status [put]