Commit 90466744 by mushishixian

修改文件名和目录

parent 9a24f6fb
......@@ -5,7 +5,7 @@ import (
"github.com/micro/go-micro/v2/web"
"search_server/boot"
"search_server/framework/gin_"
_ "search_server/lib"
_ "search_server/controller"
"log"
)
......
......@@ -13,4 +13,7 @@ write_password = icDb29mLy2s
read_password = icDb29mLy2s
max_idle = 10
max_active = 10
idle_timeout = 20
\ No newline at end of file
idle_timeout = 20
[mongo]
host =
\ No newline at end of file
package lib
package controller
import (
"github.com/gin-gonic/gin"
......
package lib
package controller
import (
"github.com/gin-gonic/gin"
......
package mapper
package dao
import (
"github.com/jinzhu/gorm"
......
......@@ -2,7 +2,7 @@ package service
import (
"context"
"search_server/mapper"
"search_server/dao"
. "search_server/protopb/course"
)
......@@ -14,7 +14,7 @@ type CourseServiceImpl struct{}
func (this *CourseServiceImpl) ListForTop(ctx context.Context, req *ListRequest, rsp *ListResponse) error {
course := make([]*CourseModel, 0)
err := mapper.GetCourseListBySql(req.Size).Find(&course).Error
err := dao.GetCourseListBySql(req.Size).Find(&course).Error
if err != nil {
return err
}
......@@ -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 {
//只取课程详细
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
}
}
//只取计数表详细
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
}
}
......
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