完成教学案例的实现逻辑
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.9.2
|
||||
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
video_case2 "github.com/JACKYMYPERSON/hldrCenter/internal/video_case/handler/video_case"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
)
|
||||
|
||||
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/api/video-cases",
|
||||
Handler: video_case2.CreateVideoCaseHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodPut,
|
||||
Path: "/api/video-cases",
|
||||
Handler: video_case2.UpdateVideoCaseHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/api/video-cases",
|
||||
Handler: video_case2.ListVideoCaseHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/api/video-cases/:id",
|
||||
Handler: video_case2.GetVideoCaseHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodDelete,
|
||||
Path: "/api/video-cases/:id",
|
||||
Handler: video_case2.DeleteVideoCaseHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithPrefix("/api/video-case"),
|
||||
)
|
||||
}
|
||||
@@ -6,13 +6,13 @@ package video_case
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/logic/video_case"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func CreateVideoCaseHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
func CreateVideoCaseHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.CreateVideoCaseReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
|
||||
@@ -6,13 +6,13 @@ package video_case
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/logic/video_case"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func DeleteVideoCaseHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
func DeleteVideoCaseHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.DeleteVideoCaseReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
|
||||
@@ -6,13 +6,13 @@ package video_case
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/logic/video_case"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetVideoCaseHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
func GetVideoCaseHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.GetVideoCaseReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
|
||||
@@ -6,13 +6,13 @@ package video_case
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/logic/video_case"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func ListVideoCaseHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
func ListVideoCaseHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.ListVideoCaseReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
|
||||
@@ -6,13 +6,13 @@ package video_case
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/logic/video_case"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func UpdateVideoCaseHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
func UpdateVideoCaseHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.UpdateVideoCaseReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user