完成社会服务业务层代码
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"
|
|
||||||
|
|
||||||
socialService2 "github.com/JACKYMYPERSON/hldrCenter/internal/social_service/handler/socialService"
|
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/svc"
|
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/rest"
|
|
||||||
)
|
|
||||||
|
|
||||||
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
||||||
server.AddRoutes(
|
|
||||||
[]rest.Route{
|
|
||||||
{
|
|
||||||
Method: http.MethodPost,
|
|
||||||
Path: "/",
|
|
||||||
Handler: socialService2.CreateSocialServiceHandler(serverCtx),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Method: http.MethodGet,
|
|
||||||
Path: "/:id",
|
|
||||||
Handler: socialService2.GetSocialServiceHandler(serverCtx),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Method: http.MethodPut,
|
|
||||||
Path: "/:id",
|
|
||||||
Handler: socialService2.UpdateSocialServiceHandler(serverCtx),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Method: http.MethodDelete,
|
|
||||||
Path: "/:id",
|
|
||||||
Handler: socialService2.DeleteSocialServiceHandler(serverCtx),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Method: http.MethodGet,
|
|
||||||
Path: "/list",
|
|
||||||
Handler: socialService2.ListSocialServiceHandler(serverCtx),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rest.WithPrefix("/api/social-service"),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -6,13 +6,13 @@ package socialService
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/logic/socialService"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/logic/socialService"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/svc"
|
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CreateSocialServiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func CreateSocialServiceHandler(cfg *config.Config) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
var req types.CreateSocialServiceReq
|
var req types.CreateSocialServiceReq
|
||||||
if err := httpx.Parse(r, &req); err != nil {
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ package socialService
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/logic/socialService"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/logic/socialService"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/svc"
|
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
)
|
)
|
||||||
|
|
||||||
func DeleteSocialServiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func DeleteSocialServiceHandler(cfg *config.Config) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
var req types.DeleteSocialServiceReq
|
var req types.DeleteSocialServiceReq
|
||||||
if err := httpx.Parse(r, &req); err != nil {
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ package socialService
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/logic/socialService"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/logic/socialService"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/svc"
|
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetSocialServiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func GetSocialServiceHandler(cfg *config.Config) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
var req types.GetSocialServiceReq
|
var req types.GetSocialServiceReq
|
||||||
if err := httpx.Parse(r, &req); err != nil {
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ package socialService
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/logic/socialService"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/logic/socialService"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/svc"
|
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ListSocialServiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func ListSocialServiceHandler(cfg *config.Config) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
var req types.ListSocialServiceReq
|
var req types.ListSocialServiceReq
|
||||||
if err := httpx.Parse(r, &req); err != nil {
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ package socialService
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/logic/socialService"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/logic/socialService"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/svc"
|
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
)
|
)
|
||||||
|
|
||||||
func UpdateSocialServiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func UpdateSocialServiceHandler(cfg *config.Config) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
var req types.UpdateSocialServiceReq
|
var req types.UpdateSocialServiceReq
|
||||||
if err := httpx.Parse(r, &req); err != nil {
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ package socialService
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/svc"
|
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||||
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/model"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
@@ -15,14 +16,16 @@ import (
|
|||||||
type CreateSocialServiceLogic struct {
|
type CreateSocialServiceLogic struct {
|
||||||
logx.Logger
|
logx.Logger
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
svcCtx *svc.ServiceContext
|
cfg *config.Config
|
||||||
|
model model.SocialServiceModel
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCreateSocialServiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateSocialServiceLogic {
|
func NewCreateSocialServiceLogic(ctx context.Context, cfg *config.Config, model model.SocialServiceModel) *CreateSocialServiceLogic {
|
||||||
return &CreateSocialServiceLogic{
|
return &CreateSocialServiceLogic{
|
||||||
Logger: logx.WithContext(ctx),
|
Logger: logx.WithContext(ctx),
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
svcCtx: svcCtx,
|
cfg: cfg,
|
||||||
|
model: model,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ package socialService
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/svc"
|
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||||
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/model"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
@@ -15,14 +16,16 @@ import (
|
|||||||
type DeleteSocialServiceLogic struct {
|
type DeleteSocialServiceLogic struct {
|
||||||
logx.Logger
|
logx.Logger
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
svcCtx *svc.ServiceContext
|
cfg *config.Config
|
||||||
|
model model.SocialServiceModel
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDeleteSocialServiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteSocialServiceLogic {
|
func NewDeleteSocialServiceLogic(ctx context.Context, cfg *config.Config, model model.SocialServiceModel) *DeleteSocialServiceLogic {
|
||||||
return &DeleteSocialServiceLogic{
|
return &DeleteSocialServiceLogic{
|
||||||
Logger: logx.WithContext(ctx),
|
Logger: logx.WithContext(ctx),
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
svcCtx: svcCtx,
|
cfg: cfg,
|
||||||
|
model: model,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ package socialService
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/svc"
|
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||||
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/model"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
@@ -15,14 +16,16 @@ import (
|
|||||||
type GetSocialServiceLogic struct {
|
type GetSocialServiceLogic struct {
|
||||||
logx.Logger
|
logx.Logger
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
svcCtx *svc.ServiceContext
|
cfg *config.Config
|
||||||
|
model model.SocialServiceModel
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGetSocialServiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetSocialServiceLogic {
|
func NewGetSocialServiceLogic(ctx context.Context, cfg *config.Config, model model.SocialServiceModel) *GetSocialServiceLogic {
|
||||||
return &GetSocialServiceLogic{
|
return &GetSocialServiceLogic{
|
||||||
Logger: logx.WithContext(ctx),
|
Logger: logx.WithContext(ctx),
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
svcCtx: svcCtx,
|
cfg: cfg,
|
||||||
|
model: model,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ package socialService
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/svc"
|
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||||
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/model"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
@@ -15,14 +16,16 @@ import (
|
|||||||
type ListSocialServiceLogic struct {
|
type ListSocialServiceLogic struct {
|
||||||
logx.Logger
|
logx.Logger
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
svcCtx *svc.ServiceContext
|
cfg *config.Config
|
||||||
|
model model.SocialServiceModel
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewListSocialServiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListSocialServiceLogic {
|
func NewListSocialServiceLogic(ctx context.Context, cfg *config.Config, model model.SocialServiceModel) *ListSocialServiceLogic {
|
||||||
return &ListSocialServiceLogic{
|
return &ListSocialServiceLogic{
|
||||||
Logger: logx.WithContext(ctx),
|
Logger: logx.WithContext(ctx),
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
svcCtx: svcCtx,
|
cfg: cfg,
|
||||||
|
model: model,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ package socialService
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/svc"
|
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||||
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/model"
|
||||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service/internal/types"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
@@ -15,19 +16,20 @@ import (
|
|||||||
type UpdateSocialServiceLogic struct {
|
type UpdateSocialServiceLogic struct {
|
||||||
logx.Logger
|
logx.Logger
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
svcCtx *svc.ServiceContext
|
cfg *config.Config
|
||||||
|
model model.SocialServiceModel
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewUpdateSocialServiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateSocialServiceLogic {
|
func NewUpdateSocialServiceLogic(ctx context.Context, cfg *config.Config, model model.SocialServiceModel) *UpdateSocialServiceLogic {
|
||||||
return &UpdateSocialServiceLogic{
|
return &UpdateSocialServiceLogic{
|
||||||
Logger: logx.WithContext(ctx),
|
Logger: logx.WithContext(ctx),
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
svcCtx: svcCtx,
|
cfg: cfg,
|
||||||
|
model: model,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *UpdateSocialServiceLogic) UpdateSocialService(req *types.UpdateSocialServiceReq) (resp *types.UpdateSocialServiceResp, err error) {
|
func (l *UpdateSocialServiceLogic) UpdateSocialService(req *types.UpdateSocialServiceReq) (resp *types.UpdateSocialServiceResp, err error) {
|
||||||
// todo: add your logic here and delete this line
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user