初始化
Build docker and publish / prepare (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.admin image_name:ppanel-admin name:admin]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.api image_name:ppanel-api name:api]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.node image_name:ppanel-node name:node]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.queue image_name:ppanel-queue name:queue]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.scheduler image_name:ppanel-scheduler name:scheduler]) (push) Has been cancelled
Build docker and publish / deploy (push) Has been cancelled
Build docker and publish / notify (push) Has been cancelled
Build docker and publish / prepare (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.admin image_name:ppanel-admin name:admin]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.api image_name:ppanel-api name:api]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.node image_name:ppanel-node name:node]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.queue image_name:ppanel-queue name:queue]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.scheduler image_name:ppanel-scheduler name:scheduler]) (push) Has been cancelled
Build docker and publish / deploy (push) Has been cancelled
Build docker and publish / notify (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "PPanel Admin"
|
||||
desc: "管理后台 BFF 服务"
|
||||
author: "ppanel"
|
||||
version: "1.0"
|
||||
)
|
||||
|
||||
import (
|
||||
"desc/types.api"
|
||||
"desc/common.api"
|
||||
"desc/system.api"
|
||||
"desc/console.api"
|
||||
"desc/user.api"
|
||||
"desc/server.api"
|
||||
"desc/subscribe.api"
|
||||
"desc/order.api"
|
||||
"desc/announcement.api"
|
||||
"desc/ticket.api"
|
||||
)
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "公告管理"
|
||||
)
|
||||
|
||||
type (
|
||||
CreateAnnouncementReq {
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
AdminAnnouncementResp {
|
||||
Id int64 `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
UpdateAnnouncementReq {
|
||||
Id int64 `path:"id"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
DeleteAnnouncementReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: /api/v1/admin/announcement
|
||||
group: announcement
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service ppaneladmin {
|
||||
@handler CreateAnnouncementHandler
|
||||
post /create (CreateAnnouncementReq) returns (AdminAnnouncementResp)
|
||||
|
||||
@handler UpdateAnnouncementHandler
|
||||
put /:id (UpdateAnnouncementReq)
|
||||
|
||||
@handler DeleteAnnouncementHandler
|
||||
delete /:id (DeleteAnnouncementReq)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "管理后台公共接口"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: /api/v1/admin
|
||||
group: common
|
||||
)
|
||||
service ppaneladmin {
|
||||
@handler HealthHandler
|
||||
get /health returns (HealthResp)
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "控制台"
|
||||
)
|
||||
|
||||
type (
|
||||
ConsoleStatsResp {
|
||||
TotalUsers int64 `json:"total_users"`
|
||||
TotalOrders int64 `json:"total_orders"`
|
||||
TotalRevenue int64 `json:"total_revenue"`
|
||||
TodayNewUsers int64 `json:"today_new_users"`
|
||||
TodayOrders int64 `json:"today_orders"`
|
||||
TodayRevenue int64 `json:"today_revenue"`
|
||||
OnlineNodes int64 `json:"online_nodes"`
|
||||
TotalNodes int64 `json:"total_nodes"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: /api/v1/admin/console
|
||||
group: console
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service ppaneladmin {
|
||||
@handler GetConsoleStatsHandler
|
||||
get /stats returns (ConsoleStatsResp)
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "订单管理"
|
||||
)
|
||||
|
||||
type (
|
||||
AdminOrderListReq {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"page_size,default=20"`
|
||||
Status int `form:"status,optional"`
|
||||
}
|
||||
|
||||
AdminOrderResp {
|
||||
Id int64 `json:"id"`
|
||||
OrderNo string `json:"order_no"`
|
||||
UserId int64 `json:"user_id"`
|
||||
Amount int64 `json:"amount"`
|
||||
Status int `json:"status"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
AdminOrderListResp {
|
||||
Total int64 `json:"total"`
|
||||
List []AdminOrderResp `json:"list"`
|
||||
}
|
||||
|
||||
UpdateOrderStatusReq {
|
||||
OrderNo string `path:"order_no"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: /api/v1/admin/order
|
||||
group: order
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service ppaneladmin {
|
||||
@handler GetOrderListHandler
|
||||
get /list (AdminOrderListReq) returns (AdminOrderListResp)
|
||||
|
||||
@handler UpdateOrderStatusHandler
|
||||
put /:order_no/status (UpdateOrderStatusReq)
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "服务器管理"
|
||||
)
|
||||
|
||||
type (
|
||||
ServerListReq {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"page_size,default=20"`
|
||||
}
|
||||
|
||||
ServerResp {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Address string `json:"address"`
|
||||
Port int `json:"port"`
|
||||
Protocol string `json:"protocol"`
|
||||
Enable bool `json:"enable"`
|
||||
}
|
||||
|
||||
ServerListResp {
|
||||
Total int64 `json:"total"`
|
||||
List []ServerResp `json:"list"`
|
||||
}
|
||||
|
||||
CreateServerReq {
|
||||
Name string `json:"name"`
|
||||
Address string `json:"address"`
|
||||
Port int `json:"port"`
|
||||
Protocol string `json:"protocol"`
|
||||
}
|
||||
|
||||
UpdateServerReq {
|
||||
Id int64 `path:"id"`
|
||||
Name string `json:"name"`
|
||||
Address string `json:"address"`
|
||||
Port int `json:"port"`
|
||||
Protocol string `json:"protocol"`
|
||||
}
|
||||
|
||||
DeleteServerReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: /api/v1/admin/server
|
||||
group: server
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service ppaneladmin {
|
||||
@handler GetServerListHandler
|
||||
get /list (ServerListReq) returns (ServerListResp)
|
||||
|
||||
@handler CreateServerHandler
|
||||
post /create (CreateServerReq) returns (ServerResp)
|
||||
|
||||
@handler UpdateServerHandler
|
||||
put /:id (UpdateServerReq)
|
||||
|
||||
@handler DeleteServerHandler
|
||||
delete /:id (DeleteServerReq)
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "订阅管理"
|
||||
)
|
||||
|
||||
type (
|
||||
AdminSubscribeListReq {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"page_size,default=20"`
|
||||
}
|
||||
|
||||
AdminSubscribeResp {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Price int64 `json:"price"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
Enable bool `json:"enable"`
|
||||
}
|
||||
|
||||
AdminSubscribeListResp {
|
||||
Total int64 `json:"total"`
|
||||
List []AdminSubscribeResp `json:"list"`
|
||||
}
|
||||
|
||||
CreateSubscribeReq {
|
||||
Name string `json:"name"`
|
||||
Price int64 `json:"price"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
}
|
||||
|
||||
UpdateSubscribeReq {
|
||||
Id int64 `path:"id"`
|
||||
Name string `json:"name"`
|
||||
Price int64 `json:"price"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
}
|
||||
|
||||
DeleteSubscribeReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: /api/v1/admin/subscribe
|
||||
group: subscribe
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service ppaneladmin {
|
||||
@handler GetSubscribeListHandler
|
||||
get /list (AdminSubscribeListReq) returns (AdminSubscribeListResp)
|
||||
|
||||
@handler CreateSubscribeHandler
|
||||
post /create (CreateSubscribeReq) returns (AdminSubscribeResp)
|
||||
|
||||
@handler UpdateSubscribeHandler
|
||||
put /:id (UpdateSubscribeReq)
|
||||
|
||||
@handler DeleteSubscribeHandler
|
||||
delete /:id (DeleteSubscribeReq)
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "系统配置管理"
|
||||
)
|
||||
|
||||
type (
|
||||
SiteConfigResp {
|
||||
SiteName string `json:"site_name"`
|
||||
SiteDesc string `json:"site_desc"`
|
||||
SiteLogo string `json:"site_logo"`
|
||||
ForceHttps bool `json:"force_https"`
|
||||
}
|
||||
|
||||
UpdateSiteConfigReq {
|
||||
SiteName string `json:"site_name"`
|
||||
SiteDesc string `json:"site_desc"`
|
||||
SiteLogo string `json:"site_logo"`
|
||||
ForceHttps bool `json:"force_https"`
|
||||
}
|
||||
|
||||
RegisterConfigResp {
|
||||
StopRegister bool `json:"stop_register"`
|
||||
EmailVerify bool `json:"email_verify"`
|
||||
EmailWhitelist string `json:"email_whitelist"`
|
||||
InviteForce bool `json:"invite_force"`
|
||||
}
|
||||
|
||||
UpdateRegisterConfigReq {
|
||||
StopRegister bool `json:"stop_register"`
|
||||
EmailVerify bool `json:"email_verify"`
|
||||
EmailWhitelist string `json:"email_whitelist"`
|
||||
InviteForce bool `json:"invite_force"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: /api/v1/admin/system
|
||||
group: system
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service ppaneladmin {
|
||||
@handler GetSiteConfigHandler
|
||||
get /site returns (SiteConfigResp)
|
||||
|
||||
@handler UpdateSiteConfigHandler
|
||||
put /site (UpdateSiteConfigReq)
|
||||
|
||||
@handler GetRegisterConfigHandler
|
||||
get /register returns (RegisterConfigResp)
|
||||
|
||||
@handler UpdateRegisterConfigHandler
|
||||
put /register (UpdateRegisterConfigReq)
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "工单管理"
|
||||
)
|
||||
|
||||
type (
|
||||
AdminTicketListReq {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"page_size,default=20"`
|
||||
Status int `form:"status,optional"`
|
||||
}
|
||||
|
||||
AdminTicketResp {
|
||||
Id int64 `json:"id"`
|
||||
UserId int64 `json:"user_id"`
|
||||
Title string `json:"title"`
|
||||
Status int `json:"status"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
AdminTicketListResp {
|
||||
Total int64 `json:"total"`
|
||||
List []AdminTicketResp `json:"list"`
|
||||
}
|
||||
|
||||
AdminTicketDetailReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
|
||||
AdminUpdateTicketStatusReq {
|
||||
Id int64 `path:"id"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
AdminCreateTicketFollowReq {
|
||||
Id int64 `path:"id"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: /api/v1/admin/ticket
|
||||
group: ticket
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service ppaneladmin {
|
||||
@handler GetTicketListHandler
|
||||
get /list (AdminTicketListReq) returns (AdminTicketListResp)
|
||||
|
||||
@handler GetTicketDetailHandler
|
||||
get /:id (AdminTicketDetailReq) returns (AdminTicketResp)
|
||||
|
||||
@handler UpdateTicketStatusHandler
|
||||
put /:id/status (AdminUpdateTicketStatusReq)
|
||||
|
||||
@handler CreateTicketFollowHandler
|
||||
post /:id/follow (AdminCreateTicketFollowReq)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "管理后台公共类型"
|
||||
)
|
||||
|
||||
type (
|
||||
HealthResp {
|
||||
Status string `json:"status"`
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,51 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "用户管理"
|
||||
)
|
||||
|
||||
type (
|
||||
AdminUserListReq {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"page_size,default=20"`
|
||||
Search string `form:"search,optional"`
|
||||
}
|
||||
|
||||
AdminUserResp {
|
||||
Id int64 `json:"id"`
|
||||
Email string `json:"email"`
|
||||
Balance int64 `json:"balance"`
|
||||
IsAdmin bool `json:"is_admin"`
|
||||
Enable bool `json:"enable"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
AdminUserListResp {
|
||||
Total int64 `json:"total"`
|
||||
List []AdminUserResp `json:"list"`
|
||||
}
|
||||
|
||||
AdminUserDetailReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
|
||||
AdminDeleteUserReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: /api/v1/admin/user
|
||||
group: user
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service ppaneladmin {
|
||||
@handler GetUserListHandler
|
||||
get /list (AdminUserListReq) returns (AdminUserListResp)
|
||||
|
||||
@handler GetUserDetailHandler
|
||||
get /:id (AdminUserDetailReq) returns (AdminUserResp)
|
||||
|
||||
@handler DeleteUserHandler
|
||||
delete /:id (AdminDeleteUserReq)
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
Name: zero-ppanel-admin
|
||||
Host: 0.0.0.0
|
||||
Port: 8081
|
||||
Mode: dev
|
||||
|
||||
Log:
|
||||
Mode: console
|
||||
Encoding: plain
|
||||
Level: debug
|
||||
|
||||
Telemetry:
|
||||
Name: zero-ppanel-admin
|
||||
Endpoint: 127.0.0.1:4318
|
||||
Sampler: 1.0
|
||||
Batcher: otlphttp
|
||||
|
||||
DevServer:
|
||||
Enabled: true
|
||||
Port: 6161
|
||||
EnableMetrics: true
|
||||
EnablePprof: true
|
||||
|
||||
JwtAuth:
|
||||
AccessSecret: "dev-admin-secret-key-change-me"
|
||||
AccessExpire: 28800
|
||||
|
||||
MySQL:
|
||||
DataSource: "root:password@tcp(127.0.0.1:3306)/ppanel?charset=utf8mb4&parseTime=true"
|
||||
|
||||
Redis:
|
||||
Host: 127.0.0.1:6379
|
||||
Type: node
|
||||
@@ -0,0 +1,36 @@
|
||||
Name: zero-ppanel-admin
|
||||
Host: 0.0.0.0
|
||||
Port: 8081
|
||||
Mode: pro
|
||||
|
||||
Log:
|
||||
Mode: file
|
||||
Encoding: json
|
||||
Level: info
|
||||
Path: /var/log/zero-ppanel/admin
|
||||
KeepDays: 15
|
||||
Rotation: daily
|
||||
|
||||
Telemetry:
|
||||
Name: zero-ppanel-admin
|
||||
Endpoint: http://jaeger:4318/v1/traces
|
||||
Sampler: 0.1
|
||||
Batcher: otlphttp
|
||||
|
||||
DevServer:
|
||||
Enabled: true
|
||||
Port: 6161
|
||||
EnableMetrics: true
|
||||
EnablePprof: false
|
||||
|
||||
JwtAuth:
|
||||
AccessSecret: "${JWT_ADMIN_SECRET}"
|
||||
AccessExpire: 28800
|
||||
|
||||
MySQL:
|
||||
DataSource: "${MYSQL_DSN}"
|
||||
|
||||
Redis:
|
||||
Host: "${REDIS_HOST}"
|
||||
Type: node
|
||||
Pass: "${REDIS_PASS}"
|
||||
@@ -0,0 +1,34 @@
|
||||
Name: zero-ppanel-admin
|
||||
Host: 0.0.0.0
|
||||
Port: 8081
|
||||
Mode: test
|
||||
|
||||
Log:
|
||||
Mode: file
|
||||
Encoding: json
|
||||
Level: info
|
||||
Path: logs/admin
|
||||
KeepDays: 7
|
||||
|
||||
Telemetry:
|
||||
Name: zero-ppanel-admin
|
||||
Endpoint: http://jaeger:4318/v1/traces
|
||||
Sampler: 0.5
|
||||
Batcher: otlphttp
|
||||
|
||||
DevServer:
|
||||
Enabled: true
|
||||
Port: 6161
|
||||
EnableMetrics: true
|
||||
EnablePprof: true
|
||||
|
||||
JwtAuth:
|
||||
AccessSecret: "test-admin-secret-key-change-me"
|
||||
AccessExpire: 28800
|
||||
|
||||
MySQL:
|
||||
DataSource: "root:password@tcp(mysql:3306)/ppanel?charset=utf8mb4&parseTime=true"
|
||||
|
||||
Redis:
|
||||
Host: redis:6379
|
||||
Type: node
|
||||
@@ -0,0 +1,3 @@
|
||||
Name: ppaneladmin
|
||||
Host: 0.0.0.0
|
||||
Port: 8888
|
||||
@@ -0,0 +1,14 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package config
|
||||
|
||||
import "github.com/zeromicro/go-zero/rest"
|
||||
|
||||
type Config struct {
|
||||
rest.RestConf
|
||||
JwtAuth struct {
|
||||
AccessSecret string
|
||||
AccessExpire int64
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package announcement
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/announcement"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func CreateAnnouncementHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.CreateAnnouncementReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := announcement.NewCreateAnnouncementLogic(r.Context(), svcCtx)
|
||||
resp, err := l.CreateAnnouncement(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package announcement
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/announcement"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func DeleteAnnouncementHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.DeleteAnnouncementReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := announcement.NewDeleteAnnouncementLogic(r.Context(), svcCtx)
|
||||
err := l.DeleteAnnouncement(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.Ok(w)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package announcement
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/announcement"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func UpdateAnnouncementHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.UpdateAnnouncementReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := announcement.NewUpdateAnnouncementLogic(r.Context(), svcCtx)
|
||||
err := l.UpdateAnnouncement(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.Ok(w)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package common
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/common"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func HealthHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := common.NewHealthLogic(r.Context(), svcCtx)
|
||||
resp, err := l.Health()
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/console"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetConsoleStatsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := console.NewGetConsoleStatsLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetConsoleStats()
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package order
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/order"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetOrderListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminOrderListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := order.NewGetOrderListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetOrderList(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package order
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/order"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func UpdateOrderStatusHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.UpdateOrderStatusReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := order.NewUpdateOrderStatusLogic(r.Context(), svcCtx)
|
||||
err := l.UpdateOrderStatus(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.Ok(w)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,215 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.9.2
|
||||
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
announcement "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/announcement"
|
||||
common "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/common"
|
||||
console "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/console"
|
||||
order "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/order"
|
||||
serverhandler "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/server"
|
||||
subscribe "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/subscribe"
|
||||
system "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/system"
|
||||
ticket "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/ticket"
|
||||
user "github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler/user"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
)
|
||||
|
||||
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodPut,
|
||||
Path: "/:id",
|
||||
Handler: announcement.UpdateAnnouncementHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodDelete,
|
||||
Path: "/:id",
|
||||
Handler: announcement.DeleteAnnouncementHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/create",
|
||||
Handler: announcement.CreateAnnouncementHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
|
||||
rest.WithPrefix("/api/v1/admin/announcement"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/health",
|
||||
Handler: common.HealthHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithPrefix("/api/v1/admin"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/stats",
|
||||
Handler: console.GetConsoleStatsHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
|
||||
rest.WithPrefix("/api/v1/admin/console"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodPut,
|
||||
Path: "/:order_no/status",
|
||||
Handler: order.UpdateOrderStatusHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/list",
|
||||
Handler: order.GetOrderListHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
|
||||
rest.WithPrefix("/api/v1/admin/order"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodPut,
|
||||
Path: "/:id",
|
||||
Handler: serverhandler.UpdateServerHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodDelete,
|
||||
Path: "/:id",
|
||||
Handler: serverhandler.DeleteServerHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/create",
|
||||
Handler: serverhandler.CreateServerHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/list",
|
||||
Handler: serverhandler.GetServerListHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
|
||||
rest.WithPrefix("/api/v1/admin/server"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodPut,
|
||||
Path: "/:id",
|
||||
Handler: subscribe.UpdateSubscribeHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodDelete,
|
||||
Path: "/:id",
|
||||
Handler: subscribe.DeleteSubscribeHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/create",
|
||||
Handler: subscribe.CreateSubscribeHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/list",
|
||||
Handler: subscribe.GetSubscribeListHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
|
||||
rest.WithPrefix("/api/v1/admin/subscribe"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/register",
|
||||
Handler: system.GetRegisterConfigHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPut,
|
||||
Path: "/register",
|
||||
Handler: system.UpdateRegisterConfigHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/site",
|
||||
Handler: system.GetSiteConfigHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPut,
|
||||
Path: "/site",
|
||||
Handler: system.UpdateSiteConfigHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
|
||||
rest.WithPrefix("/api/v1/admin/system"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/:id",
|
||||
Handler: ticket.GetTicketDetailHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/:id/follow",
|
||||
Handler: ticket.CreateTicketFollowHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPut,
|
||||
Path: "/:id/status",
|
||||
Handler: ticket.UpdateTicketStatusHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/list",
|
||||
Handler: ticket.GetTicketListHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
|
||||
rest.WithPrefix("/api/v1/admin/ticket"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/:id",
|
||||
Handler: user.GetUserDetailHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodDelete,
|
||||
Path: "/:id",
|
||||
Handler: user.DeleteUserHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/list",
|
||||
Handler: user.GetUserListHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
|
||||
rest.WithPrefix("/api/v1/admin/user"),
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/server"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func CreateServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.CreateServerReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := server.NewCreateServerLogic(r.Context(), svcCtx)
|
||||
resp, err := l.CreateServer(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/server"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func DeleteServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.DeleteServerReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := server.NewDeleteServerLogic(r.Context(), svcCtx)
|
||||
err := l.DeleteServer(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.Ok(w)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/server"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetServerListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.ServerListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := server.NewGetServerListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetServerList(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/server"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func UpdateServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.UpdateServerReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := server.NewUpdateServerLogic(r.Context(), svcCtx)
|
||||
err := l.UpdateServer(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.Ok(w)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package subscribe
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/subscribe"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func CreateSubscribeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.CreateSubscribeReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := subscribe.NewCreateSubscribeLogic(r.Context(), svcCtx)
|
||||
resp, err := l.CreateSubscribe(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package subscribe
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/subscribe"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func DeleteSubscribeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.DeleteSubscribeReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := subscribe.NewDeleteSubscribeLogic(r.Context(), svcCtx)
|
||||
err := l.DeleteSubscribe(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.Ok(w)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package subscribe
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/subscribe"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetSubscribeListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminSubscribeListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := subscribe.NewGetSubscribeListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetSubscribeList(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package subscribe
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/subscribe"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func UpdateSubscribeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.UpdateSubscribeReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := subscribe.NewUpdateSubscribeLogic(r.Context(), svcCtx)
|
||||
err := l.UpdateSubscribe(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.Ok(w)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/system"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetRegisterConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := system.NewGetRegisterConfigLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetRegisterConfig()
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/system"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetSiteConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := system.NewGetSiteConfigLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetSiteConfig()
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/system"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func UpdateRegisterConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.UpdateRegisterConfigReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := system.NewUpdateRegisterConfigLogic(r.Context(), svcCtx)
|
||||
err := l.UpdateRegisterConfig(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.Ok(w)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/system"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func UpdateSiteConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.UpdateSiteConfigReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := system.NewUpdateSiteConfigLogic(r.Context(), svcCtx)
|
||||
err := l.UpdateSiteConfig(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.Ok(w)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package ticket
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/ticket"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func CreateTicketFollowHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminCreateTicketFollowReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := ticket.NewCreateTicketFollowLogic(r.Context(), svcCtx)
|
||||
err := l.CreateTicketFollow(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.Ok(w)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package ticket
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/ticket"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetTicketDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminTicketDetailReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := ticket.NewGetTicketDetailLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetTicketDetail(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package ticket
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/ticket"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetTicketListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminTicketListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := ticket.NewGetTicketListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetTicketList(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package ticket
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/ticket"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func UpdateTicketStatusHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUpdateTicketStatusReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := ticket.NewUpdateTicketStatusLogic(r.Context(), svcCtx)
|
||||
err := l.UpdateTicketStatus(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.Ok(w)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/user"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func DeleteUserHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminDeleteUserReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := user.NewDeleteUserLogic(r.Context(), svcCtx)
|
||||
err := l.DeleteUser(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.Ok(w)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/user"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetUserDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUserDetailReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := user.NewGetUserDetailLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetUserDetail(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/logic/user"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetUserListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminUserListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := user.NewGetUserListLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetUserList(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package announcement
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CreateAnnouncementLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewCreateAnnouncementLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateAnnouncementLogic {
|
||||
return &CreateAnnouncementLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *CreateAnnouncementLogic) CreateAnnouncement(req *types.CreateAnnouncementReq) (resp *types.AdminAnnouncementResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package announcement
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type DeleteAnnouncementLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewDeleteAnnouncementLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteAnnouncementLogic {
|
||||
return &DeleteAnnouncementLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeleteAnnouncementLogic) DeleteAnnouncement(req *types.DeleteAnnouncementReq) error {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package announcement
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type UpdateAnnouncementLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewUpdateAnnouncementLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateAnnouncementLogic {
|
||||
return &UpdateAnnouncementLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateAnnouncementLogic) UpdateAnnouncement(req *types.UpdateAnnouncementReq) error {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package common
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type HealthLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewHealthLogic(ctx context.Context, svcCtx *svc.ServiceContext) *HealthLogic {
|
||||
return &HealthLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *HealthLogic) Health() (resp *types.HealthResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetConsoleStatsLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetConsoleStatsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetConsoleStatsLogic {
|
||||
return &GetConsoleStatsLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetConsoleStatsLogic) GetConsoleStats() (resp *types.ConsoleStatsResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package order
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetOrderListLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetOrderListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetOrderListLogic {
|
||||
return &GetOrderListLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetOrderListLogic) GetOrderList(req *types.AdminOrderListReq) (resp *types.AdminOrderListResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package order
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type UpdateOrderStatusLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewUpdateOrderStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateOrderStatusLogic {
|
||||
return &UpdateOrderStatusLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateOrderStatusLogic) UpdateOrderStatus(req *types.UpdateOrderStatusReq) error {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CreateServerLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewCreateServerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateServerLogic {
|
||||
return &CreateServerLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *CreateServerLogic) CreateServer(req *types.CreateServerReq) (resp *types.ServerResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type DeleteServerLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewDeleteServerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteServerLogic {
|
||||
return &DeleteServerLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeleteServerLogic) DeleteServer(req *types.DeleteServerReq) error {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetServerListLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetServerListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetServerListLogic {
|
||||
return &GetServerListLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetServerListLogic) GetServerList(req *types.ServerListReq) (resp *types.ServerListResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type UpdateServerLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewUpdateServerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateServerLogic {
|
||||
return &UpdateServerLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateServerLogic) UpdateServer(req *types.UpdateServerReq) error {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package subscribe
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CreateSubscribeLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewCreateSubscribeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateSubscribeLogic {
|
||||
return &CreateSubscribeLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *CreateSubscribeLogic) CreateSubscribe(req *types.CreateSubscribeReq) (resp *types.AdminSubscribeResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package subscribe
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type DeleteSubscribeLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewDeleteSubscribeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteSubscribeLogic {
|
||||
return &DeleteSubscribeLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeleteSubscribeLogic) DeleteSubscribe(req *types.DeleteSubscribeReq) error {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package subscribe
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetSubscribeListLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetSubscribeListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetSubscribeListLogic {
|
||||
return &GetSubscribeListLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetSubscribeListLogic) GetSubscribeList(req *types.AdminSubscribeListReq) (resp *types.AdminSubscribeListResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package subscribe
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type UpdateSubscribeLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewUpdateSubscribeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateSubscribeLogic {
|
||||
return &UpdateSubscribeLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateSubscribeLogic) UpdateSubscribe(req *types.UpdateSubscribeReq) error {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetRegisterConfigLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetRegisterConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetRegisterConfigLogic {
|
||||
return &GetRegisterConfigLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetRegisterConfigLogic) GetRegisterConfig() (resp *types.RegisterConfigResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetSiteConfigLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetSiteConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetSiteConfigLogic {
|
||||
return &GetSiteConfigLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetSiteConfigLogic) GetSiteConfig() (resp *types.SiteConfigResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type UpdateRegisterConfigLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewUpdateRegisterConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateRegisterConfigLogic {
|
||||
return &UpdateRegisterConfigLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateRegisterConfigLogic) UpdateRegisterConfig(req *types.UpdateRegisterConfigReq) error {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type UpdateSiteConfigLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewUpdateSiteConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateSiteConfigLogic {
|
||||
return &UpdateSiteConfigLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateSiteConfigLogic) UpdateSiteConfig(req *types.UpdateSiteConfigReq) error {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package ticket
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CreateTicketFollowLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewCreateTicketFollowLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateTicketFollowLogic {
|
||||
return &CreateTicketFollowLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *CreateTicketFollowLogic) CreateTicketFollow(req *types.AdminCreateTicketFollowReq) error {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package ticket
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetTicketDetailLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetTicketDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetTicketDetailLogic {
|
||||
return &GetTicketDetailLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetTicketDetailLogic) GetTicketDetail(req *types.AdminTicketDetailReq) (resp *types.AdminTicketResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package ticket
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetTicketListLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetTicketListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetTicketListLogic {
|
||||
return &GetTicketListLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetTicketListLogic) GetTicketList(req *types.AdminTicketListReq) (resp *types.AdminTicketListResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package ticket
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type UpdateTicketStatusLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewUpdateTicketStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateTicketStatusLogic {
|
||||
return &UpdateTicketStatusLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateTicketStatusLogic) UpdateTicketStatus(req *types.AdminUpdateTicketStatusReq) error {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type DeleteUserLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewDeleteUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteUserLogic {
|
||||
return &DeleteUserLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeleteUserLogic) DeleteUser(req *types.AdminDeleteUserReq) error {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetUserDetailLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetUserDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserDetailLogic {
|
||||
return &GetUserDetailLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetUserDetailLogic) GetUserDetail(req *types.AdminUserDetailReq) (resp *types.AdminUserResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetUserListLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetUserListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserListLogic {
|
||||
return &GetUserListLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetUserListLogic) GetUserList(req *types.AdminUserListReq) (resp *types.AdminUserListResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package svc
|
||||
|
||||
import (
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/config"
|
||||
)
|
||||
|
||||
type ServiceContext struct {
|
||||
Config config.Config
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
return &ServiceContext{
|
||||
Config: c,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.9.2
|
||||
|
||||
package types
|
||||
|
||||
type AdminAnnouncementResp struct {
|
||||
Id int64 `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
type AdminCreateTicketFollowReq struct {
|
||||
Id int64 `path:"id"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type AdminDeleteUserReq struct {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
|
||||
type AdminOrderListReq struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"page_size,default=20"`
|
||||
Status int `form:"status,optional"`
|
||||
}
|
||||
|
||||
type AdminOrderListResp struct {
|
||||
Total int64 `json:"total"`
|
||||
List []AdminOrderResp `json:"list"`
|
||||
}
|
||||
|
||||
type AdminOrderResp struct {
|
||||
Id int64 `json:"id"`
|
||||
OrderNo string `json:"order_no"`
|
||||
UserId int64 `json:"user_id"`
|
||||
Amount int64 `json:"amount"`
|
||||
Status int `json:"status"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
type AdminSubscribeListReq struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"page_size,default=20"`
|
||||
}
|
||||
|
||||
type AdminSubscribeListResp struct {
|
||||
Total int64 `json:"total"`
|
||||
List []AdminSubscribeResp `json:"list"`
|
||||
}
|
||||
|
||||
type AdminSubscribeResp struct {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Price int64 `json:"price"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
Enable bool `json:"enable"`
|
||||
}
|
||||
|
||||
type AdminTicketDetailReq struct {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
|
||||
type AdminTicketListReq struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"page_size,default=20"`
|
||||
Status int `form:"status,optional"`
|
||||
}
|
||||
|
||||
type AdminTicketListResp struct {
|
||||
Total int64 `json:"total"`
|
||||
List []AdminTicketResp `json:"list"`
|
||||
}
|
||||
|
||||
type AdminTicketResp struct {
|
||||
Id int64 `json:"id"`
|
||||
UserId int64 `json:"user_id"`
|
||||
Title string `json:"title"`
|
||||
Status int `json:"status"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
type AdminUpdateTicketStatusReq struct {
|
||||
Id int64 `path:"id"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
type AdminUserDetailReq struct {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
|
||||
type AdminUserListReq struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"page_size,default=20"`
|
||||
Search string `form:"search,optional"`
|
||||
}
|
||||
|
||||
type AdminUserListResp struct {
|
||||
Total int64 `json:"total"`
|
||||
List []AdminUserResp `json:"list"`
|
||||
}
|
||||
|
||||
type AdminUserResp struct {
|
||||
Id int64 `json:"id"`
|
||||
Email string `json:"email"`
|
||||
Balance int64 `json:"balance"`
|
||||
IsAdmin bool `json:"is_admin"`
|
||||
Enable bool `json:"enable"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
type ConsoleStatsResp struct {
|
||||
TotalUsers int64 `json:"total_users"`
|
||||
TotalOrders int64 `json:"total_orders"`
|
||||
TotalRevenue int64 `json:"total_revenue"`
|
||||
TodayNewUsers int64 `json:"today_new_users"`
|
||||
TodayOrders int64 `json:"today_orders"`
|
||||
TodayRevenue int64 `json:"today_revenue"`
|
||||
OnlineNodes int64 `json:"online_nodes"`
|
||||
TotalNodes int64 `json:"total_nodes"`
|
||||
}
|
||||
|
||||
type CreateAnnouncementReq struct {
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type CreateServerReq struct {
|
||||
Name string `json:"name"`
|
||||
Address string `json:"address"`
|
||||
Port int `json:"port"`
|
||||
Protocol string `json:"protocol"`
|
||||
}
|
||||
|
||||
type CreateSubscribeReq struct {
|
||||
Name string `json:"name"`
|
||||
Price int64 `json:"price"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
}
|
||||
|
||||
type DeleteAnnouncementReq struct {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
|
||||
type DeleteServerReq struct {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
|
||||
type DeleteSubscribeReq struct {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
|
||||
type HealthResp struct {
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type RegisterConfigResp struct {
|
||||
StopRegister bool `json:"stop_register"`
|
||||
EmailVerify bool `json:"email_verify"`
|
||||
EmailWhitelist string `json:"email_whitelist"`
|
||||
InviteForce bool `json:"invite_force"`
|
||||
}
|
||||
|
||||
type ServerListReq struct {
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"page_size,default=20"`
|
||||
}
|
||||
|
||||
type ServerListResp struct {
|
||||
Total int64 `json:"total"`
|
||||
List []ServerResp `json:"list"`
|
||||
}
|
||||
|
||||
type ServerResp struct {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Address string `json:"address"`
|
||||
Port int `json:"port"`
|
||||
Protocol string `json:"protocol"`
|
||||
Enable bool `json:"enable"`
|
||||
}
|
||||
|
||||
type SiteConfigResp struct {
|
||||
SiteName string `json:"site_name"`
|
||||
SiteDesc string `json:"site_desc"`
|
||||
SiteLogo string `json:"site_logo"`
|
||||
ForceHttps bool `json:"force_https"`
|
||||
}
|
||||
|
||||
type UpdateAnnouncementReq struct {
|
||||
Id int64 `path:"id"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type UpdateOrderStatusReq struct {
|
||||
OrderNo string `path:"order_no"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
type UpdateRegisterConfigReq struct {
|
||||
StopRegister bool `json:"stop_register"`
|
||||
EmailVerify bool `json:"email_verify"`
|
||||
EmailWhitelist string `json:"email_whitelist"`
|
||||
InviteForce bool `json:"invite_force"`
|
||||
}
|
||||
|
||||
type UpdateServerReq struct {
|
||||
Id int64 `path:"id"`
|
||||
Name string `json:"name"`
|
||||
Address string `json:"address"`
|
||||
Port int `json:"port"`
|
||||
Protocol string `json:"protocol"`
|
||||
}
|
||||
|
||||
type UpdateSiteConfigReq struct {
|
||||
SiteName string `json:"site_name"`
|
||||
SiteDesc string `json:"site_desc"`
|
||||
SiteLogo string `json:"site_logo"`
|
||||
ForceHttps bool `json:"force_https"`
|
||||
}
|
||||
|
||||
type UpdateSubscribeReq struct {
|
||||
Id int64 `path:"id"`
|
||||
Name string `json:"name"`
|
||||
Price int64 `json:"price"`
|
||||
Traffic int64 `json:"traffic"`
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/config"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/handler"
|
||||
"github.com/zero-ppanel/zero-ppanel/apps/admin/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/conf"
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
)
|
||||
|
||||
var configFile = flag.String("f", "etc/admin-dev.yaml", "the config file")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
var c config.Config
|
||||
conf.MustLoad(*configFile, &c)
|
||||
|
||||
server := rest.MustNewServer(c.RestConf)
|
||||
defer server.Stop()
|
||||
|
||||
ctx := svc.NewServiceContext(c)
|
||||
handler.RegisterHandlers(server, ctx)
|
||||
|
||||
fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port)
|
||||
server.Start()
|
||||
}
|
||||
Reference in New Issue
Block a user