mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 10:17:17 +08:00
feat: 全局移除swagger
This commit is contained in:
@@ -16,16 +16,6 @@ func NewService() *Service {
|
||||
return &Service{}
|
||||
}
|
||||
|
||||
// GetConfig
|
||||
//
|
||||
// @Summary 获取配置
|
||||
// @Description 获取 Frp 配置
|
||||
// @Tags 应用-Frp
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param service query string false "服务"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/frp/config [get]
|
||||
func (s *Service) GetConfig(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := service.Bind[Name](r)
|
||||
if err != nil {
|
||||
@@ -42,16 +32,6 @@ func (s *Service) GetConfig(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, config)
|
||||
}
|
||||
|
||||
// UpdateConfig
|
||||
//
|
||||
// @Summary 更新配置
|
||||
// @Description 更新 Frp 配置
|
||||
// @Tags 应用-Frp
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param data body requests.UpdateConfig true "request"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/frp/config [post]
|
||||
func (s *Service) UpdateConfig(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := service.Bind[UpdateConfig](r)
|
||||
if err != nil {
|
||||
|
||||
@@ -16,14 +16,6 @@ func NewService() *Service {
|
||||
return &Service{}
|
||||
}
|
||||
|
||||
// GetConfig
|
||||
//
|
||||
// @Summary 获取配置
|
||||
// @Tags 应用-Gitea
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/gitea/config [get]
|
||||
func (s *Service) GetConfig(w http.ResponseWriter, r *http.Request) {
|
||||
config, err := io.Read(fmt.Sprintf("%s/server/gitea/app.ini", panel.Root))
|
||||
if err != nil {
|
||||
@@ -34,15 +26,6 @@ func (s *Service) GetConfig(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, config)
|
||||
}
|
||||
|
||||
// UpdateConfig
|
||||
//
|
||||
// @Summary 更新配置
|
||||
// @Tags 应用-Gitea
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param data body requests.UpdateConfig true "request"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/gitea/config [post]
|
||||
func (s *Service) UpdateConfig(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := service.Bind[UpdateConfig](r)
|
||||
if err != nil {
|
||||
|
||||
@@ -26,14 +26,6 @@ func NewService() *Service {
|
||||
return &Service{}
|
||||
}
|
||||
|
||||
// GetConfig
|
||||
//
|
||||
// @Summary 获取配置
|
||||
// @Tags 应用-OpenResty
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Success 200 {object} h.SuccessResponse
|
||||
// @Router /plugins/openresty/config [get]
|
||||
func (s *Service) GetConfig(w http.ResponseWriter, r *http.Request) {
|
||||
config, err := io.Read(fmt.Sprintf("%s/server/openresty/conf/nginx.conf", panel.Root))
|
||||
if err != nil {
|
||||
@@ -44,15 +36,6 @@ func (s *Service) GetConfig(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, config)
|
||||
}
|
||||
|
||||
// SaveConfig
|
||||
//
|
||||
// @Summary 保存配置
|
||||
// @Tags 应用-OpenResty
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param config body string true "配置"
|
||||
// @Success 200 {object} h.SuccessResponse
|
||||
// @Router /plugins/openresty/config [post]
|
||||
func (s *Service) SaveConfig(w http.ResponseWriter, r *http.Request) {
|
||||
config := r.FormValue("config")
|
||||
if len(config) == 0 {
|
||||
@@ -71,14 +54,6 @@ func (s *Service) SaveConfig(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, nil)
|
||||
}
|
||||
|
||||
// ErrorLog
|
||||
//
|
||||
// @Summary 获取错误日志
|
||||
// @Tags 应用-OpenResty
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Success 200 {object} h.SuccessResponse
|
||||
// @Router /plugins/openresty/errorLog [get]
|
||||
func (s *Service) ErrorLog(w http.ResponseWriter, r *http.Request) {
|
||||
if !io.Exists(fmt.Sprintf("%s/wwwlogs/nginx_error.log", panel.Root)) {
|
||||
service.Success(w, "")
|
||||
@@ -92,14 +67,6 @@ func (s *Service) ErrorLog(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, out)
|
||||
}
|
||||
|
||||
// ClearErrorLog
|
||||
//
|
||||
// @Summary 清空错误日志
|
||||
// @Tags 应用-OpenResty
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Success 200 {object} h.SuccessResponse
|
||||
// @Router /plugins/openresty/clearErrorLog [post]
|
||||
func (s *Service) ClearErrorLog(w http.ResponseWriter, r *http.Request) {
|
||||
if _, err := shell.Execf("echo '' > %s/%s", panel.Root, "/wwwlogs/openresty_error.log"); err != nil {
|
||||
service.Error(w, http.StatusInternalServerError, err.Error())
|
||||
@@ -108,14 +75,6 @@ func (s *Service) ClearErrorLog(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, nil)
|
||||
}
|
||||
|
||||
// Load
|
||||
//
|
||||
// @Summary 获取负载状态
|
||||
// @Tags 应用-OpenResty
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Success 200 {object} h.SuccessResponse
|
||||
// @Router /plugins/openresty/load [get]
|
||||
func (s *Service) Load(w http.ResponseWriter, r *http.Request) {
|
||||
client := resty.New().SetTimeout(10 * time.Second)
|
||||
resp, err := client.R().Get("http://127.0.0.1/nginx_status")
|
||||
|
||||
@@ -32,15 +32,6 @@ func NewService(version uint) *Service {
|
||||
}
|
||||
}
|
||||
|
||||
// GetConfig
|
||||
//
|
||||
// @Summary 获取配置
|
||||
// @Tags 应用-PHP
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param version path int true "PHP 版本"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/php/{version}/config [get]
|
||||
func (s *Service) GetConfig(w http.ResponseWriter, r *http.Request) {
|
||||
config, err := io.Read(fmt.Sprintf("%s/server/php/%d/etc/php.ini", panel.Root, s.version))
|
||||
if err != nil {
|
||||
@@ -51,16 +42,6 @@ func (s *Service) GetConfig(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, config)
|
||||
}
|
||||
|
||||
// UpdateConfig
|
||||
//
|
||||
// @Summary 保存配置
|
||||
// @Tags 应用-PHP
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param version path int true "PHP 版本"
|
||||
// @Param config body string true "配置"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/php/{version}/config [post]
|
||||
func (s *Service) UpdateConfig(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := service.Bind[UpdateConfig](r)
|
||||
if err != nil {
|
||||
@@ -76,15 +57,6 @@ func (s *Service) UpdateConfig(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, nil)
|
||||
}
|
||||
|
||||
// GetFPMConfig
|
||||
//
|
||||
// @Summary 获取 FPM 配置
|
||||
// @Tags 应用-PHP
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param version path int true "PHP 版本"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/php/{version}/fpmConfig [get]
|
||||
func (s *Service) GetFPMConfig(w http.ResponseWriter, r *http.Request) {
|
||||
config, err := io.Read(fmt.Sprintf("%s/server/php/%d/etc/php-fpm.conf", panel.Root, s.version))
|
||||
if err != nil {
|
||||
@@ -95,16 +67,6 @@ func (s *Service) GetFPMConfig(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, config)
|
||||
}
|
||||
|
||||
// UpdateFPMConfig
|
||||
//
|
||||
// @Summary 保存 FPM 配置
|
||||
// @Tags 应用-PHP
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param version path int true "PHP 版本"
|
||||
// @Param config body string true "配置"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/php/{version}/fpmConfig [post]
|
||||
func (s *Service) UpdateFPMConfig(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := service.Bind[UpdateConfig](r)
|
||||
if err != nil {
|
||||
@@ -120,15 +82,6 @@ func (s *Service) UpdateFPMConfig(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, nil)
|
||||
}
|
||||
|
||||
// Load
|
||||
//
|
||||
// @Summary 获取负载状态
|
||||
// @Tags 应用-PHP
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param version path int true "PHP 版本"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/php/{version}/load [get]
|
||||
func (s *Service) Load(w http.ResponseWriter, r *http.Request) {
|
||||
client := resty.New().SetTimeout(10 * time.Second)
|
||||
resp, err := client.R().Get(fmt.Sprintf("http://127.0.0.1/phpfpm_status/%d", s.version))
|
||||
@@ -156,43 +109,16 @@ func (s *Service) Load(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, data)
|
||||
}
|
||||
|
||||
// ErrorLog
|
||||
//
|
||||
// @Summary 获取错误日志
|
||||
// @Tags 应用-PHP
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param version path int true "PHP 版本"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/php/{version}/errorLog [get]
|
||||
func (s *Service) ErrorLog(w http.ResponseWriter, r *http.Request) {
|
||||
log, _ := shell.Execf("tail -n 500 %s/server/php/%d/var/log/php-fpm.log", panel.Root, s.version)
|
||||
service.Success(w, log)
|
||||
}
|
||||
|
||||
// SlowLog
|
||||
//
|
||||
// @Summary 获取慢日志
|
||||
// @Tags 应用-PHP
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param version path int true "PHP 版本"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/php/{version}/slowLog [get]
|
||||
func (s *Service) SlowLog(w http.ResponseWriter, r *http.Request) {
|
||||
log, _ := shell.Execf("tail -n 500 %s/server/php/%d/var/log/slow.log", panel.Root, s.version)
|
||||
service.Success(w, log)
|
||||
}
|
||||
|
||||
// ClearErrorLog
|
||||
//
|
||||
// @Summary 清空错误日志
|
||||
// @Tags 应用-PHP
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param version path int true "PHP 版本"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/php/{version}/clearErrorLog [post]
|
||||
func (s *Service) ClearErrorLog(w http.ResponseWriter, r *http.Request) {
|
||||
if _, err := shell.Execf("echo '' > %s/server/php/%d/var/log/php-fpm.log", panel.Root, s.version); err != nil {
|
||||
service.Error(w, http.StatusInternalServerError, err.Error())
|
||||
@@ -202,15 +128,6 @@ func (s *Service) ClearErrorLog(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, nil)
|
||||
}
|
||||
|
||||
// ClearSlowLog
|
||||
//
|
||||
// @Summary 清空慢日志
|
||||
// @Tags 应用-PHP
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param version path int true "PHP 版本"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/php/{version}/clearSlowLog [post]
|
||||
func (s *Service) ClearSlowLog(w http.ResponseWriter, r *http.Request) {
|
||||
if _, err := shell.Execf("echo '' > %s/server/php/%d/var/log/slow.log", panel.Root, s.version); err != nil {
|
||||
service.Error(w, http.StatusInternalServerError, err.Error())
|
||||
@@ -220,15 +137,6 @@ func (s *Service) ClearSlowLog(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, nil)
|
||||
}
|
||||
|
||||
// ExtensionList
|
||||
//
|
||||
// @Summary 获取扩展列表
|
||||
// @Tags 应用-PHP
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param version path int true "PHP 版本"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/php/{version}/extensions [get]
|
||||
func (s *Service) ExtensionList(w http.ResponseWriter, r *http.Request) {
|
||||
extensions := s.getExtensions()
|
||||
|
||||
@@ -263,16 +171,6 @@ func (s *Service) ExtensionList(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, extensions)
|
||||
}
|
||||
|
||||
// InstallExtension
|
||||
//
|
||||
// @Summary 安装扩展
|
||||
// @Tags 应用-PHP
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param version path int true "PHP 版本"
|
||||
// @Param slug query string true "slug"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/php/{version}/extensions [post]
|
||||
func (s *Service) InstallExtension(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := service.Bind[ExtensionSlug](r)
|
||||
if err != nil {
|
||||
@@ -304,16 +202,6 @@ func (s *Service) InstallExtension(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, nil)
|
||||
}
|
||||
|
||||
// UninstallExtension
|
||||
//
|
||||
// @Summary 卸载扩展
|
||||
// @Tags 应用-PHP
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param version path int true "PHP 版本"
|
||||
// @Param slug query string true "slug"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/php/{version}/extensions [delete]
|
||||
func (s *Service) UninstallExtension(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := service.Bind[ExtensionSlug](r)
|
||||
if err != nil {
|
||||
|
||||
@@ -21,16 +21,6 @@ func NewService() *Service {
|
||||
return &Service{}
|
||||
}
|
||||
|
||||
// List
|
||||
//
|
||||
// @Summary 列出模块
|
||||
// @Description 列出所有 Rsync 模块
|
||||
// @Tags 应用-Rsync
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param data query commonrequests.Paginate true "request"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/rsync/modules [get]
|
||||
func (s *Service) List(w http.ResponseWriter, r *http.Request) {
|
||||
config, err := io.Read("/etc/rsyncd.conf")
|
||||
if err != nil {
|
||||
@@ -96,16 +86,6 @@ func (s *Service) List(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// Create
|
||||
//
|
||||
// @Summary 添加模块
|
||||
// @Description 添加 Rsync 模块
|
||||
// @Tags 应用-Rsync
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param data body requests.Create true "request"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/rsync/modules [post]
|
||||
func (s *Service) Create(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := service.Bind[Create](r)
|
||||
if err != nil {
|
||||
@@ -151,16 +131,6 @@ secrets file = /etc/rsyncd.secrets
|
||||
service.Success(w, nil)
|
||||
}
|
||||
|
||||
// Delete
|
||||
//
|
||||
// @Summary 删除模块
|
||||
// @Description 删除 Rsync 模块
|
||||
// @Tags 应用-Rsync
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param name path string true "模块名称"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/rsync/modules/{name} [delete]
|
||||
func (s *Service) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := service.Bind[Delete](r)
|
||||
if err != nil {
|
||||
@@ -203,17 +173,6 @@ func (s *Service) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, nil)
|
||||
}
|
||||
|
||||
// Update
|
||||
//
|
||||
// @Summary 更新模块
|
||||
// @Description 更新 Rsync 模块
|
||||
// @Tags 应用-Rsync
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param name path string true "模块名称"
|
||||
// @Param data body requests.Update true "request"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/rsync/modules/{name} [post]
|
||||
func (s *Service) Update(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := service.Bind[Update](r)
|
||||
if err != nil {
|
||||
@@ -270,15 +229,6 @@ secrets file = /etc/rsyncd.secrets
|
||||
service.Success(w, nil)
|
||||
}
|
||||
|
||||
// GetConfig
|
||||
//
|
||||
// @Summary 获取配置
|
||||
// @Description 获取 Rsync 配置
|
||||
// @Tags 应用-Rsync
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/rsync/config [get]
|
||||
func (s *Service) GetConfig(w http.ResponseWriter, r *http.Request) {
|
||||
config, err := io.Read("/etc/rsyncd.conf")
|
||||
if err != nil {
|
||||
@@ -289,16 +239,6 @@ func (s *Service) GetConfig(w http.ResponseWriter, r *http.Request) {
|
||||
service.Success(w, config)
|
||||
}
|
||||
|
||||
// UpdateConfig
|
||||
//
|
||||
// @Summary 更新配置
|
||||
// @Description 更新 Rsync 配置
|
||||
// @Tags 应用-Rsync
|
||||
// @Produce json
|
||||
// @Security BearerToken
|
||||
// @Param data body requests.UpdateConfig true "request"
|
||||
// @Success 200 {object} controllers.SuccessResponse
|
||||
// @Router /plugins/rsync/config [post]
|
||||
func (s *Service) UpdateConfig(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := service.Bind[UpdateConfig](r)
|
||||
if err != nil {
|
||||
|
||||
@@ -6,13 +6,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
httpSwagger "github.com/swaggo/http-swagger/v2"
|
||||
|
||||
_ "github.com/TheTNB/panel/docs"
|
||||
"github.com/TheTNB/panel/internal/embed"
|
||||
"github.com/TheTNB/panel/internal/http/middleware"
|
||||
"github.com/TheTNB/panel/internal/service"
|
||||
"github.com/go-chi/chi/v5"
|
||||
)
|
||||
|
||||
func Http(r chi.Router) {
|
||||
@@ -267,7 +264,6 @@ func Http(r chi.Router) {
|
||||
})
|
||||
})
|
||||
|
||||
r.With(middleware.MustLogin).Mount("/swagger", httpSwagger.Handler())
|
||||
r.NotFound(func(writer http.ResponseWriter, request *http.Request) {
|
||||
// /api 开头的返回 404
|
||||
if strings.HasPrefix(request.URL.Path, "/api") {
|
||||
|
||||
@@ -21,13 +21,6 @@ func NewCertService() *CertService {
|
||||
}
|
||||
}
|
||||
|
||||
// CAProviders
|
||||
//
|
||||
// @Summary 获取 CA 提供商
|
||||
// @Tags 证书服务
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /cert/caProviders [get]
|
||||
func (s *CertService) CAProviders(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, []map[string]string{
|
||||
{
|
||||
@@ -54,13 +47,6 @@ func (s *CertService) CAProviders(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
}
|
||||
|
||||
// DNSProviders
|
||||
//
|
||||
// @Summary 获取 DNS 提供商
|
||||
// @Tags 证书服务
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /cert/dnsProviders [get]
|
||||
func (s *CertService) DNSProviders(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, []map[string]any{
|
||||
{
|
||||
@@ -83,13 +69,6 @@ func (s *CertService) DNSProviders(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
}
|
||||
|
||||
// Algorithms
|
||||
//
|
||||
// @Summary 获取算法列表
|
||||
// @Tags 证书服务
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /cert/algorithms [get]
|
||||
func (s *CertService) Algorithms(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, []map[string]any{
|
||||
{
|
||||
@@ -112,13 +91,6 @@ func (s *CertService) Algorithms(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
}
|
||||
|
||||
// List
|
||||
//
|
||||
// @Summary 证书列表
|
||||
// @Tags 证书服务
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /cert/cert [get]
|
||||
func (s *CertService) List(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.Paginate](r)
|
||||
if err != nil {
|
||||
@@ -138,13 +110,6 @@ func (s *CertService) List(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// Create
|
||||
//
|
||||
// @Summary 创建证书
|
||||
// @Tags 证书服务
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /cert/cert [post]
|
||||
func (s *CertService) Create(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.CertCreate](r)
|
||||
if err != nil {
|
||||
@@ -161,14 +126,6 @@ func (s *CertService) Create(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, cert)
|
||||
}
|
||||
|
||||
// Update
|
||||
//
|
||||
// @Summary 更新证书
|
||||
// @Tags 证书服务
|
||||
// @Produce json
|
||||
// @Param id path int true "证书 ID"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /cert/cert/{id} [post]
|
||||
func (s *CertService) Update(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.CertUpdate](r)
|
||||
if err != nil {
|
||||
@@ -184,14 +141,6 @@ func (s *CertService) Update(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// Get
|
||||
//
|
||||
// @Summary 获取证书
|
||||
// @Tags 证书服务
|
||||
// @Produce json
|
||||
// @Param id path int true "证书 ID"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /cert/cert/{id} [get]
|
||||
func (s *CertService) Get(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.ID](r)
|
||||
if err != nil {
|
||||
@@ -208,14 +157,6 @@ func (s *CertService) Get(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, cert)
|
||||
}
|
||||
|
||||
// Delete
|
||||
//
|
||||
// @Summary 删除证书
|
||||
// @Tags 证书服务
|
||||
// @Produce json
|
||||
// @Param id path int true "证书 ID"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /cert/cert/{id} [delete]
|
||||
func (s *CertService) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.ID](r)
|
||||
if err != nil {
|
||||
@@ -232,14 +173,6 @@ func (s *CertService) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// Obtain
|
||||
//
|
||||
// @Summary 签发证书
|
||||
// @Tags 证书服务
|
||||
// @Produce json
|
||||
// @Param id path int true "证书 ID"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /cert/{id}/obtain [post]
|
||||
func (s *CertService) Obtain(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.ID](r)
|
||||
if err != nil {
|
||||
@@ -267,14 +200,6 @@ func (s *CertService) Obtain(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// Renew
|
||||
//
|
||||
// @Summary 续签证书
|
||||
// @Tags 证书服务
|
||||
// @Produce json
|
||||
// @Param id path int true "证书 ID"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /cert/{id}/renew [post]
|
||||
func (s *CertService) Renew(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.ID](r)
|
||||
if err != nil {
|
||||
@@ -291,14 +216,6 @@ func (s *CertService) Renew(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// ManualDNS
|
||||
//
|
||||
// @Summary 手动 DNS
|
||||
// @Tags 证书服务
|
||||
// @Produce json
|
||||
// @Param id path int true "证书 ID"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /cert/{id}/manualDNS [post]
|
||||
func (s *CertService) ManualDNS(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.ID](r)
|
||||
if err != nil {
|
||||
@@ -315,15 +232,6 @@ func (s *CertService) ManualDNS(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, dns)
|
||||
}
|
||||
|
||||
// Deploy
|
||||
//
|
||||
// @Summary 部署证书
|
||||
// @Tags 证书服务
|
||||
// @Produce json
|
||||
// @Param id path int true "证书 ID"
|
||||
// @Param websiteID query int true "网站 ID"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /cert/{id}/deploy [post]
|
||||
func (s *CertService) Deploy(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.CertDeploy](r)
|
||||
if err != nil {
|
||||
|
||||
@@ -36,14 +36,6 @@ func NewInfoService() *InfoService {
|
||||
}
|
||||
}
|
||||
|
||||
// Panel
|
||||
//
|
||||
// @Summary 面板信息
|
||||
// @Tags 信息服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /info/panel [get]
|
||||
func (s *InfoService) Panel(w http.ResponseWriter, r *http.Request) {
|
||||
name, _ := s.settingRepo.Get(biz.SettingKeyName)
|
||||
if name == "" {
|
||||
@@ -56,14 +48,6 @@ func (s *InfoService) Panel(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// HomeApps
|
||||
//
|
||||
// @Summary 首页应用
|
||||
// @Tags 信息服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /info/homeApps [get]
|
||||
func (s *InfoService) HomeApps(w http.ResponseWriter, r *http.Request) {
|
||||
apps, err := s.appRepo.GetHomeShow()
|
||||
if err != nil {
|
||||
@@ -74,26 +58,10 @@ func (s *InfoService) HomeApps(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, apps)
|
||||
}
|
||||
|
||||
// Realtime
|
||||
//
|
||||
// @Summary 实时监控
|
||||
// @Tags 信息服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /info/realtime [get]
|
||||
func (s *InfoService) Realtime(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, tools.GetMonitoringInfo())
|
||||
}
|
||||
|
||||
// SystemInfo
|
||||
//
|
||||
// @Summary 系统信息
|
||||
// @Tags 信息服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /info/systemInfo [get]
|
||||
func (s *InfoService) SystemInfo(w http.ResponseWriter, r *http.Request) {
|
||||
monitorInfo := tools.GetMonitoringInfo()
|
||||
|
||||
@@ -104,14 +72,6 @@ func (s *InfoService) SystemInfo(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// CountInfo
|
||||
//
|
||||
// @Summary 统计信息
|
||||
// @Tags 信息服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /info/countInfo [get]
|
||||
func (s *InfoService) CountInfo(w http.ResponseWriter, r *http.Request) {
|
||||
websiteCount, err := s.websiteRepo.Count()
|
||||
if err != nil {
|
||||
@@ -208,14 +168,6 @@ func (s *InfoService) CountInfo(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// InstalledDbAndPhp
|
||||
//
|
||||
// @Summary 已安装的数据库和PHP
|
||||
// @Tags 信息服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /info/installedDbAndPhp [get]
|
||||
func (s *InfoService) InstalledDbAndPhp(w http.ResponseWriter, r *http.Request) {
|
||||
mysqlInstalled, _ := s.appRepo.IsInstalled("slug like ?", "mysql%")
|
||||
postgresqlInstalled, _ := s.appRepo.IsInstalled("slug like ?", "postgresql%")
|
||||
@@ -249,14 +201,6 @@ func (s *InfoService) InstalledDbAndPhp(w http.ResponseWriter, r *http.Request)
|
||||
})
|
||||
}
|
||||
|
||||
// CheckUpdate
|
||||
//
|
||||
// @Summary 检查更新
|
||||
// @Tags 信息服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /info/checkUpdate [get]
|
||||
func (s *InfoService) CheckUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
current := panel.Conf.MustString("app.version")
|
||||
latest, err := tools.GetLatestPanelVersion()
|
||||
@@ -287,14 +231,6 @@ func (s *InfoService) CheckUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateInfo
|
||||
//
|
||||
// @Summary 版本更新信息
|
||||
// @Tags 信息服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /info/updateInfo [get]
|
||||
func (s *InfoService) UpdateInfo(w http.ResponseWriter, r *http.Request) {
|
||||
current := panel.Conf.MustString("app.version")
|
||||
latest, err := tools.GetLatestPanelVersion()
|
||||
@@ -337,14 +273,6 @@ func (s *InfoService) UpdateInfo(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, versionInfo)
|
||||
}
|
||||
|
||||
// Update
|
||||
//
|
||||
// @Summary 更新面板
|
||||
// @Tags 信息服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /info/update [post]
|
||||
func (s *InfoService) Update(w http.ResponseWriter, r *http.Request) {
|
||||
if s.taskRepo.HasRunningTask() {
|
||||
Error(w, http.StatusInternalServerError, "当前有任务正在执行,禁止更新")
|
||||
@@ -374,14 +302,6 @@ func (s *InfoService) Update(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// Restart
|
||||
//
|
||||
// @Summary 重启面板
|
||||
// @Tags 信息服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /info/restart [post]
|
||||
func (s *InfoService) Restart(w http.ResponseWriter, r *http.Request) {
|
||||
if s.taskRepo.HasRunningTask() {
|
||||
Error(w, http.StatusInternalServerError, "当前有任务正在执行,禁止重启")
|
||||
|
||||
@@ -21,28 +21,12 @@ func NewTaskService() *TaskService {
|
||||
}
|
||||
}
|
||||
|
||||
// Status
|
||||
//
|
||||
// @Summary 是否有任务正在运行
|
||||
// @Tags 任务服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /tasks/status [get]
|
||||
func (s *TaskService) Status(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, chix.M{
|
||||
"task": s.taskRepo.HasRunningTask(),
|
||||
})
|
||||
}
|
||||
|
||||
// List
|
||||
//
|
||||
// @Summary 任务列表
|
||||
// @Tags 任务服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /tasks [get]
|
||||
func (s *TaskService) List(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.Paginate](r)
|
||||
if err != nil {
|
||||
@@ -62,14 +46,6 @@ func (s *TaskService) List(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// Get
|
||||
//
|
||||
// @Summary 任务详情
|
||||
// @Tags 任务服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /task/log [get]
|
||||
func (s *TaskService) Get(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.ID](r)
|
||||
if err != nil {
|
||||
@@ -91,14 +67,6 @@ func (s *TaskService) Get(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, task)
|
||||
}
|
||||
|
||||
// Delete
|
||||
//
|
||||
// @Summary 删除任务
|
||||
// @Tags 任务服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /task/delete [post]
|
||||
func (s *TaskService) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.ID](r)
|
||||
if err != nil {
|
||||
|
||||
@@ -22,15 +22,6 @@ func NewUserService() *UserService {
|
||||
}
|
||||
}
|
||||
|
||||
// Login
|
||||
//
|
||||
// @Summary 登录
|
||||
// @Tags 用户服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param data body request.UserLogin true "request"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /user/login [post]
|
||||
func (s *UserService) Login(w http.ResponseWriter, r *http.Request) {
|
||||
sess, err := panel.Session.GetSession(r)
|
||||
if err != nil {
|
||||
@@ -54,14 +45,6 @@ func (s *UserService) Login(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// Logout
|
||||
//
|
||||
// @Summary 登出
|
||||
// @Tags 用户服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /user/logout [post]
|
||||
func (s *UserService) Logout(w http.ResponseWriter, r *http.Request) {
|
||||
sess, err := panel.Session.GetSession(r)
|
||||
if err == nil {
|
||||
@@ -70,14 +53,6 @@ func (s *UserService) Logout(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// IsLogin
|
||||
//
|
||||
// @Summary 是否登录
|
||||
// @Tags 用户服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /user/isLogin [get]
|
||||
func (s *UserService) IsLogin(w http.ResponseWriter, r *http.Request) {
|
||||
sess, err := panel.Session.GetSession(r)
|
||||
if err != nil {
|
||||
@@ -87,14 +62,6 @@ func (s *UserService) IsLogin(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, sess.Has("user_id"))
|
||||
}
|
||||
|
||||
// Info
|
||||
//
|
||||
// @Summary 用户信息
|
||||
// @Tags 用户服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /user/info/{id} [get]
|
||||
func (s *UserService) Info(w http.ResponseWriter, r *http.Request) {
|
||||
userID := cast.ToUint(r.Context().Value("user_id"))
|
||||
if userID == 0 {
|
||||
|
||||
@@ -25,13 +25,6 @@ func NewWebsiteService() *WebsiteService {
|
||||
}
|
||||
}
|
||||
|
||||
// GetDefaultConfig
|
||||
//
|
||||
// @Summary 获取默认配置
|
||||
// @Tags 网站服务
|
||||
// @Produce json
|
||||
// @Success 200 {object} SuccessResponse{data=map[string]string}
|
||||
// @Router /panel/website/defaultConfig [get]
|
||||
func (s *WebsiteService) GetDefaultConfig(w http.ResponseWriter, r *http.Request) {
|
||||
index, err := io.Read(filepath.Join(panel.Root, "server/openresty/html/index.html"))
|
||||
if err != nil {
|
||||
@@ -50,15 +43,6 @@ func (s *WebsiteService) GetDefaultConfig(w http.ResponseWriter, r *http.Request
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateDefaultConfig
|
||||
//
|
||||
// @Summary 更新默认配置
|
||||
// @Tags 网站服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param data body map[string]string true "request"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /panel/website/defaultConfig [post]
|
||||
func (s *WebsiteService) UpdateDefaultConfig(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.WebsiteDefaultConfig](r)
|
||||
if err != nil {
|
||||
@@ -74,14 +58,6 @@ func (s *WebsiteService) UpdateDefaultConfig(w http.ResponseWriter, r *http.Requ
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// List
|
||||
//
|
||||
// @Summary 网站列表
|
||||
// @Tags 网站服务
|
||||
// @Produce json
|
||||
// @Param data query commonrequests.Paginate true "request"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /panel/websites [get]
|
||||
func (s *WebsiteService) List(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.Paginate](r)
|
||||
if err != nil {
|
||||
@@ -101,15 +77,6 @@ func (s *WebsiteService) List(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// Create
|
||||
//
|
||||
// @Summary 创建网站
|
||||
// @Tags 网站服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param data body requests.Add true "request"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /panel/websites [post]
|
||||
func (s *WebsiteService) Create(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.WebsiteCreate](r)
|
||||
if err != nil {
|
||||
@@ -130,15 +97,6 @@ func (s *WebsiteService) Create(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// Get
|
||||
//
|
||||
// @Summary 获取网站
|
||||
// @Tags 网站服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param id path int true "网站 ID"
|
||||
// @Success 200 {object} SuccessResponse{data=types.WebsiteAdd}
|
||||
// @Router /panel/websites/{id}/config [get]
|
||||
func (s *WebsiteService) Get(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.ID](r)
|
||||
if err != nil {
|
||||
@@ -155,16 +113,6 @@ func (s *WebsiteService) Get(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, config)
|
||||
}
|
||||
|
||||
// Update
|
||||
//
|
||||
// @Summary 更新网站
|
||||
// @Tags 网站服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param id path int true "网站 ID"
|
||||
// @Param data body requests.SaveConfig true "request"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /panel/websites/{id}/config [post]
|
||||
func (s *WebsiteService) Update(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.WebsiteUpdate](r)
|
||||
if err != nil {
|
||||
@@ -180,15 +128,6 @@ func (s *WebsiteService) Update(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// Delete
|
||||
//
|
||||
// @Summary 删除网站
|
||||
// @Tags 网站服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param data body requests.Delete true "request"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /panel/websites/delete [post]
|
||||
func (s *WebsiteService) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.WebsiteDelete](r)
|
||||
if err != nil {
|
||||
@@ -204,15 +143,6 @@ func (s *WebsiteService) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// ClearLog
|
||||
//
|
||||
// @Summary 清空网站日志
|
||||
// @Tags 网站服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param id path int true "网站 ID"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /panel/websites/{id}/log [delete]
|
||||
func (s *WebsiteService) ClearLog(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.ID](r)
|
||||
if err != nil {
|
||||
@@ -228,15 +158,6 @@ func (s *WebsiteService) ClearLog(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// UpdateRemark
|
||||
//
|
||||
// @Summary 更新网站备注
|
||||
// @Tags 网站服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param id path int true "网站 ID"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /panel/websites/{id}/updateRemark [post]
|
||||
func (s *WebsiteService) UpdateRemark(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.WebsiteUpdateRemark](r)
|
||||
if err != nil {
|
||||
@@ -252,15 +173,6 @@ func (s *WebsiteService) UpdateRemark(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// ResetConfig
|
||||
//
|
||||
// @Summary 重置网站配置
|
||||
// @Tags 网站服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param id path int true "网站 ID"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /panel/websites/{id}/resetConfig [post]
|
||||
func (s *WebsiteService) ResetConfig(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.ID](r)
|
||||
if err != nil {
|
||||
@@ -276,15 +188,6 @@ func (s *WebsiteService) ResetConfig(w http.ResponseWriter, r *http.Request) {
|
||||
Success(w, nil)
|
||||
}
|
||||
|
||||
// UpdateStatus
|
||||
//
|
||||
// @Summary 更新网站状态
|
||||
// @Tags 网站服务
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param id path int true "网站 ID"
|
||||
// @Success 200 {object} SuccessResponse
|
||||
// @Router /panel/websites/{id}/status [post]
|
||||
func (s *WebsiteService) UpdateStatus(w http.ResponseWriter, r *http.Request) {
|
||||
req, err := Bind[request.WebsiteUpdateStatus](r)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user