package service import ( "ulink-admin/modules/car/dao" "ulink-admin/modules/car/models/model" "ulink-admin/modules/car/models/req" ) type CategoryService struct { CategoryDao *dao.CategoryDao `inject:""` } // List 查询所有车辆类型业务方法 func (this CategoryService) List(query *req.CategoryQuery, list interface{}) { this.CategoryDao.List(query, list) } // Page 查询车辆类型分页列表 func (this CategoryService) Page(query *req.CategoryQuery, list interface{}) int64 { return this.CategoryDao.Page(query, list) } // Insert 添加车辆类型 func (this CategoryService) Insert(category *model.Category) { this.CategoryDao.Insert(category) } // Get 查询 func (this CategoryService) Get(id int64) *model.Category { return this.CategoryDao.GetById(id, &model.Category{}).(*model.Category) } // Delete 批量删除 func (this CategoryService) Delete(list []int64) { this.CategoryDao.Delete(&model.Category{}, list) } // Edit 修改 func (this CategoryService) Edit(category *model.Category, cols []string) { this.CategoryDao.Update(category, cols...) }