修改研究实习项目和乡村政府项目业务层
This commit is contained in:
@@ -4,11 +4,14 @@
|
||||
package socialServiceInternship
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/logic/socialServiceInternship"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/model"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/types"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
@@ -20,7 +23,23 @@ func CreateSocialServiceInternshipHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
l := socialServiceInternship.NewCreateSocialServiceInternshipLogic(r.Context(), svcCtx)
|
||||
mysqlCfg := cfg.MySQL
|
||||
dsn := fmt.Sprintf(
|
||||
"%s:%s@tcp(%s:%d)/%s?charset=%s&parseTime=true&loc=Local",
|
||||
mysqlCfg.Username,
|
||||
mysqlCfg.Password,
|
||||
mysqlCfg.Host,
|
||||
mysqlCfg.Port,
|
||||
mysqlCfg.Database,
|
||||
mysqlCfg.Charset,
|
||||
)
|
||||
fmt.Println("接收到articlePost请求")
|
||||
|
||||
conn := sqlx.NewSqlConn("mysql", dsn)
|
||||
|
||||
socialInternshipModel := model.NewSocialServiceInternshipModel(conn)
|
||||
|
||||
l := socialServiceInternship.NewCreateSocialServiceInternshipLogic(r.Context(), cfg, socialInternshipModel)
|
||||
resp, err := l.CreateSocialServiceInternship(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
|
||||
@@ -4,11 +4,14 @@
|
||||
package socialServiceInternship
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/logic/socialServiceInternship"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/model"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/types"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
@@ -20,7 +23,23 @@ func DeleteSocialServiceInternshipHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
l := socialServiceInternship.NewDeleteSocialServiceInternshipLogic(r.Context(), svcCtx)
|
||||
mysqlCfg := cfg.MySQL
|
||||
dsn := fmt.Sprintf(
|
||||
"%s:%s@tcp(%s:%d)/%s?charset=%s&parseTime=true&loc=Local",
|
||||
mysqlCfg.Username,
|
||||
mysqlCfg.Password,
|
||||
mysqlCfg.Host,
|
||||
mysqlCfg.Port,
|
||||
mysqlCfg.Database,
|
||||
mysqlCfg.Charset,
|
||||
)
|
||||
fmt.Println("接收到articlePost请求")
|
||||
|
||||
conn := sqlx.NewSqlConn("mysql", dsn)
|
||||
|
||||
socialInternshipModel := model.NewSocialServiceInternshipModel(conn)
|
||||
|
||||
l := socialServiceInternship.NewDeleteSocialServiceInternshipLogic(r.Context(), cfg, socialInternshipModel)
|
||||
resp, err := l.DeleteSocialServiceInternship(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
|
||||
@@ -4,11 +4,14 @@
|
||||
package socialServiceInternship
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/logic/socialServiceInternship"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/model"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/types"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
@@ -20,7 +23,23 @@ func GetSocialServiceInternshipHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
l := socialServiceInternship.NewGetSocialServiceInternshipLogic(r.Context(), svcCtx)
|
||||
mysqlCfg := cfg.MySQL
|
||||
dsn := fmt.Sprintf(
|
||||
"%s:%s@tcp(%s:%d)/%s?charset=%s&parseTime=true&loc=Local",
|
||||
mysqlCfg.Username,
|
||||
mysqlCfg.Password,
|
||||
mysqlCfg.Host,
|
||||
mysqlCfg.Port,
|
||||
mysqlCfg.Database,
|
||||
mysqlCfg.Charset,
|
||||
)
|
||||
fmt.Println("接收到articlePost请求")
|
||||
|
||||
conn := sqlx.NewSqlConn("mysql", dsn)
|
||||
|
||||
socialInternshipModel := model.NewSocialServiceInternshipModel(conn)
|
||||
|
||||
l := socialServiceInternship.NewGetSocialServiceInternshipLogic(r.Context(), cfg, socialInternshipModel)
|
||||
resp, err := l.GetSocialServiceInternship(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
|
||||
@@ -4,11 +4,14 @@
|
||||
package socialServiceInternship
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/logic/socialServiceInternship"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/model"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/types"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
@@ -20,7 +23,23 @@ func ListSocialServiceInternshipHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
l := socialServiceInternship.NewListSocialServiceInternshipLogic(r.Context(), svcCtx)
|
||||
mysqlCfg := cfg.MySQL
|
||||
dsn := fmt.Sprintf(
|
||||
"%s:%s@tcp(%s:%d)/%s?charset=%s&parseTime=true&loc=Local",
|
||||
mysqlCfg.Username,
|
||||
mysqlCfg.Password,
|
||||
mysqlCfg.Host,
|
||||
mysqlCfg.Port,
|
||||
mysqlCfg.Database,
|
||||
mysqlCfg.Charset,
|
||||
)
|
||||
fmt.Println("接收到articlePost请求")
|
||||
|
||||
conn := sqlx.NewSqlConn("mysql", dsn)
|
||||
|
||||
socialInternshipModel := model.NewSocialServiceInternshipModel(conn)
|
||||
|
||||
l := socialServiceInternship.NewListSocialServiceInternshipLogic(r.Context(), cfg, socialInternshipModel)
|
||||
resp, err := l.ListSocialServiceInternship(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
|
||||
@@ -4,11 +4,14 @@
|
||||
package socialServiceInternship
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/config"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/logic/socialServiceInternship"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/model"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/types"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
@@ -20,7 +23,23 @@ func UpdateSocialServiceInternshipHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
l := socialServiceInternship.NewUpdateSocialServiceInternshipLogic(r.Context(), svcCtx)
|
||||
mysqlCfg := cfg.MySQL
|
||||
dsn := fmt.Sprintf(
|
||||
"%s:%s@tcp(%s:%d)/%s?charset=%s&parseTime=true&loc=Local",
|
||||
mysqlCfg.Username,
|
||||
mysqlCfg.Password,
|
||||
mysqlCfg.Host,
|
||||
mysqlCfg.Port,
|
||||
mysqlCfg.Database,
|
||||
mysqlCfg.Charset,
|
||||
)
|
||||
fmt.Println("接收到articlePost请求")
|
||||
|
||||
conn := sqlx.NewSqlConn("mysql", dsn)
|
||||
|
||||
socialInternshipModel := model.NewSocialServiceInternshipModel(conn)
|
||||
|
||||
l := socialServiceInternship.NewUpdateSocialServiceInternshipLogic(r.Context(), cfg, socialInternshipModel)
|
||||
resp, err := l.UpdateSocialServiceInternship(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
|
||||
Reference in New Issue
Block a user