car_service.go 956 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package service
  2. import (
  3. "ulink-admin/modules/car/dao"
  4. "ulink-admin/modules/car/models/model"
  5. "ulink-admin/modules/car/models/req"
  6. )
  7. type CarService struct {
  8. CarDao *dao.CarDao `inject:""`
  9. }
  10. // List 查询所有车辆管理业务方法
  11. func (this CarService) List(query *req.CarQuery, list interface{}) {
  12. this.CarDao.List(query, list)
  13. }
  14. // Page 查询车辆管理分页列表
  15. func (this CarService) Page(query *req.CarQuery, list interface{}) int64 {
  16. return this.CarDao.Page(query, list)
  17. }
  18. // Insert 添加车辆管理
  19. func (this CarService) Insert(car *model.Car) {
  20. this.CarDao.Insert(car)
  21. }
  22. // Get 查询
  23. func (this CarService) Get(id int64) *model.Car {
  24. return this.CarDao.GetById(id, &model.Car{}).(*model.Car)
  25. }
  26. // Delete 批量删除
  27. func (this CarService) Delete(list []int64) {
  28. this.CarDao.Delete(&model.Car{}, list)
  29. }
  30. // Edit 修改
  31. func (this CarService) Edit(car *model.Car, cols []string) {
  32. this.CarDao.Update(car, cols...)
  33. }