Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
search_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c6c884f9
authored
Jul 22, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
去除多于文件
parent
0116ced2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
122 deletions
controller/course_controller.go
controller/course_topic_controller.go
dao/course_dao.go
controller/course_controller.go
deleted
100644 → 0
View file @
0116ced2
package
controller
//func init() {
// courseService := service.NewCourseServiceImpl()
// gin_.NewBuilder().WithService(courseService).
// WithMiddleware(Check_Middleware()).
// WithMiddleware(Cors_Middleware()).
// WithEndpoint(Courselist_Endpoint(courseService)).
// WithRequest(Courselist_Request()).
// WithResponse(Course_Response()).Build("/course", "GET")
//
// gin_.NewBuilder().WithService(courseService).
// WithMiddleware(Check_Middleware()).
// WithEndpoint(Coursedetail_Endpoint(courseService)).
// WithRequest(Coursedetail_Request()).
// WithResponse(Course_Response()).Build("/detail/:course_id", "GET")
//
//}
//
////详细相关
//func Coursedetail_Endpoint(c *service.CourseServiceImpl) gin_.Endpoint {
// return func(context *gin.Context, request interface{}) (response interface{}, err error) {
// rsp := &course.DetailResponse{Course: new(course.CourseModel), Counts: make([]*course.CourseCounts, 0)}
// err = c.GetDetail(context, request.(*course.DetailRequest), rsp)
// return rsp, err
// }
//}
//
////这个函数的作用是怎么处理请求
//func Coursedetail_Request() gin_.EncodeRequestFunc {
// return func(context *gin.Context) (i interface{}, e error) {
// bReq := &course.DetailRequest{}
// err := context.BindUri(bReq)
// if err != nil {
// return nil, err
// }
// err = context.BindHeader(bReq)
// if err != nil {
// return nil, err
// }
// return bReq, nil
// }
//}
//
////获取列表相关
//func Courselist_Endpoint(c *service.CourseServiceImpl) gin_.Endpoint {
// return func(context *gin.Context, request interface{}) (response interface{}, err error) {
// rsp := &course.ListResponse{}
// err = c.ListForTop(context, request.(*course.ListRequest), rsp)
// return rsp, err
// }
//}
//
////这个函数的作用是怎么处理请求
//func Courselist_Request() gin_.EncodeRequestFunc {
// return func(context *gin.Context) (i interface{}, e error) {
// bReq := &course.ListRequest{}
// err := context.BindQuery(bReq) //使用的是query 参数
// if err != nil {
// return nil, err
// }
// return bReq, nil
// }
//}
//
////这个函数作用是:怎么处理响应结果
//func Course_Response() gin_.DecodeResponseFunc {
// return func(context *gin.Context, res interface{}) error {
// context.JSON(200, res)
// return nil
// }
//}
controller/course_topic_controller.go
deleted
100644 → 0
View file @
0116ced2
package
controller
//func init() {
// courseService:=service.NewCourseTopicServiceImpl()
// gin_.NewBuilder().WithService(courseService).
// WithMiddleware(Check_Middleware()).
// WithEndpoint(CourseTopicList_Endpoint(courseService)).
// WithRequest(CourseTopicList_Request()).
// WithResponse(Course_Response()).Build("/topic/:cid","GET")
//}
//
//func CourseTopicList_Endpoint(c *service.CourseTopicServiceImpl) gin_.Endpoint {
// return func(context *gin.Context, request interface{}) (response interface{}, err error) {
// rsp:=&course.TopicResponse{Result:make([]*course.CourseTopic,0)}
// err=c.GetTopic(context,request.(*course.TopicRequest),rsp)
// return rsp,err
// }
//}
////这个函数的作用是怎么处理请求
//func CourseTopicList_Request() gin_.EncodeRequestFunc{
// return func(context *gin.Context) (i interface{}, e error) {
// bReq:=&course.TopicRequest{}
// err:=context.BindUri(bReq) //使用的是query 参数
// if err!=nil{
// return nil,err
// }
// return bReq,nil
// }
//}
\ No newline at end of file
dao/course_dao.go
deleted
100644 → 0
View file @
0116ced2
package
dao
//func GetCourseList() *gorm.DB {
// return mysql.GetDB().Table(vars.Table_CourseMain).
// Order("course_id desc").Limit(3)
//}
//
//const course_list = "select * from course_main order by course_id desc limit ?"
//
//func GetCourseListBySql(args ...interface{}) *gorm.DB {
// return mysql.GetDB().Raw(course_list, args...)
//}
//func GetCourseDetail(course_id int) *gorm.DB {
// return mysql.GetDB().Table(vars.Table_CourseMain).Where("course_id=?", course_id)
//}
//
////取计数表
//func GetCourseCounts(course_id int) *gorm.DB {
// return mysql.GetDB().Table(vars.Table_CourseCounts).Where("course_id=?", course_id)
//}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment