1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package service
- import (
- "ulink-admin/modules/car/dao"
- "ulink-admin/modules/car/models/model"
- "ulink-admin/modules/car/models/req"
- )
- type CarService struct {
- CarDao *dao.CarDao `inject:""`
- }
- func (this CarService) List(query *req.CarQuery, list interface{}) {
- this.CarDao.List(query, list)
- }
- func (this CarService) Page(query *req.CarQuery, list interface{}) int64 {
- return this.CarDao.Page(query, list)
- }
- func (this CarService) Insert(car *model.Car) {
- this.CarDao.Insert(car)
- }
- func (this CarService) Get(id int64) *model.Car {
- return this.CarDao.GetById(id, &model.Car{}).(*model.Car)
- }
- func (this CarService) Delete(list []int64) {
- this.CarDao.Delete(&model.Car{}, list)
- }
- func (this CarService) Edit(car *model.Car, cols []string) {
- this.CarDao.Update(car, cols...)
- }
|