Commit 90466744 by mushishixian

修改文件名和目录

parent 9a24f6fb
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"github.com/micro/go-micro/v2/web" "github.com/micro/go-micro/v2/web"
"search_server/boot" "search_server/boot"
"search_server/framework/gin_" "search_server/framework/gin_"
_ "search_server/lib" _ "search_server/controller"
"log" "log"
) )
......
...@@ -13,4 +13,7 @@ write_password = icDb29mLy2s ...@@ -13,4 +13,7 @@ write_password = icDb29mLy2s
read_password = icDb29mLy2s read_password = icDb29mLy2s
max_idle = 10 max_idle = 10
max_active = 10 max_active = 10
idle_timeout = 20 idle_timeout = 20
\ No newline at end of file
[mongo]
host =
\ No newline at end of file
package lib package controller
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
......
package lib package controller
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
......
package lib package controller
import ( import (
"fmt" "fmt"
......
package mapper package dao
import ( import (
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
......
...@@ -2,7 +2,7 @@ package service ...@@ -2,7 +2,7 @@ package service
import ( import (
"context" "context"
"search_server/mapper" "search_server/dao"
. "search_server/protopb/course" . "search_server/protopb/course"
) )
...@@ -14,7 +14,7 @@ type CourseServiceImpl struct{} ...@@ -14,7 +14,7 @@ type CourseServiceImpl struct{}
func (this *CourseServiceImpl) ListForTop(ctx context.Context, req *ListRequest, rsp *ListResponse) error { func (this *CourseServiceImpl) ListForTop(ctx context.Context, req *ListRequest, rsp *ListResponse) error {
course := make([]*CourseModel, 0) course := make([]*CourseModel, 0)
err := mapper.GetCourseListBySql(req.Size).Find(&course).Error err := dao.GetCourseListBySql(req.Size).Find(&course).Error
if err != nil { if err != nil {
return err return err
} }
...@@ -24,13 +24,13 @@ func (this *CourseServiceImpl) ListForTop(ctx context.Context, req *ListRequest, ...@@ -24,13 +24,13 @@ func (this *CourseServiceImpl) ListForTop(ctx context.Context, req *ListRequest,
func (this *CourseServiceImpl) GetDetail(ctx context.Context, req *DetailRequest, rsp *DetailResponse) error { func (this *CourseServiceImpl) GetDetail(ctx context.Context, req *DetailRequest, rsp *DetailResponse) error {
//只取课程详细 //只取课程详细
if req.FetchType == 0 || req.FetchType == 1 || req.FetchType == 3 { if req.FetchType == 0 || req.FetchType == 1 || req.FetchType == 3 {
if err := mapper.GetCourseDetail(int(req.CourseId)).Find(rsp.Course).Error; err != nil { if err := dao.GetCourseDetail(int(req.CourseId)).Find(rsp.Course).Error; err != nil {
return err return err
} }
} }
//只取计数表详细 //只取计数表详细
if req.FetchType == 2 || req.FetchType == 3 { if req.FetchType == 2 || req.FetchType == 3 {
if err := mapper.GetCourseCounts(int(req.CourseId)).Find(&rsp.Counts).Error; err != nil { if err := dao.GetCourseCounts(int(req.CourseId)).Find(&rsp.Counts).Error; err != nil {
return err return err
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment