完成课程文件应用层
This commit is contained in:
@@ -6,13 +6,13 @@ package course_file
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/logic/course_file"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func CreateCourseFileHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
func CreateCourseFileHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.CreateCourseFileReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
|
||||
@@ -6,13 +6,13 @@ package course_file
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/logic/course_file"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func DeleteCourseFileHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
func DeleteCourseFileHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.DeleteCourseFileReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
|
||||
@@ -6,13 +6,13 @@ package course_file
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/logic/course_file"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetCourseFileHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
func GetCourseFileHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.GetCourseFileReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
|
||||
@@ -6,13 +6,13 @@ package course_file
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/logic/course_file"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func UpdateCourseFileHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
func UpdateCourseFileHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.UpdateCourseFileReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
|
||||
@@ -6,7 +6,8 @@ package course_file
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/model"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
@@ -14,15 +15,17 @@ import (
|
||||
|
||||
type CreateCourseFileLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
ctx context.Context
|
||||
cfg *config.Config
|
||||
model model.CourseFileModel
|
||||
}
|
||||
|
||||
func NewCreateCourseFileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateCourseFileLogic {
|
||||
func NewCreateCourseFileLogic(ctx context.Context, cfg *config.Config, model model.CourseFileModel) *CreateCourseFileLogic {
|
||||
return &CreateCourseFileLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
cfg: cfg,
|
||||
model: model,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ package course_file
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/model"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
@@ -14,15 +15,17 @@ import (
|
||||
|
||||
type DeleteCourseFileLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
ctx context.Context
|
||||
cfg *config.Config
|
||||
model model.CourseFileModel
|
||||
}
|
||||
|
||||
func NewDeleteCourseFileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteCourseFileLogic {
|
||||
func NewDeleteCourseFileLogic(ctx context.Context, cfg *config.Config, model model.CourseFileModel) *DeleteCourseFileLogic {
|
||||
return &DeleteCourseFileLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
cfg: cfg,
|
||||
model: model,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ package course_file
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/model"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
@@ -14,15 +15,17 @@ import (
|
||||
|
||||
type GetCourseFileLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
ctx context.Context
|
||||
cfg *config.Config
|
||||
model model.CourseFileModel
|
||||
}
|
||||
|
||||
func NewGetCourseFileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetCourseFileLogic {
|
||||
func NewGetCourseFileLogic(ctx context.Context, cfg *config.Config, model model.CourseFileModel) *GetCourseFileLogic {
|
||||
return &GetCourseFileLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
cfg: cfg,
|
||||
model: model,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ package course_file
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/model"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/course_file/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
@@ -14,15 +15,17 @@ import (
|
||||
|
||||
type UpdateCourseFileLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
ctx context.Context
|
||||
cfg *config.Config
|
||||
model model.CourseFileModel
|
||||
}
|
||||
|
||||
func NewUpdateCourseFileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateCourseFileLogic {
|
||||
func NewUpdateCourseFileLogic(ctx context.Context, cfg *config.Config, model model.CourseFileModel) *UpdateCourseFileLogic {
|
||||
return &UpdateCourseFileLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
cfg: cfg,
|
||||
model: model,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user