run_service.go 958 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 RunService struct {
  8. RunDao *dao.RunDao `inject:""`
  9. }
  10. // List 查询所有营运记录业务方法
  11. func (this RunService) List(query *req.RunQuery, list interface{}) {
  12. this.RunDao.List(query, list)
  13. }
  14. // Page 查询营运记录分页列表
  15. func (this RunService) Page(query *req.RunQuery) (*[]model.Run, int64) {
  16. return this.RunDao.Page(query)
  17. }
  18. // Insert 添加营运记录
  19. func (this RunService) Insert(run *model.Run) {
  20. this.RunDao.Insert(run)
  21. }
  22. // Get 查询
  23. func (this RunService) Get(id int64) *model.Run {
  24. model := &model.Run{}
  25. this.RunDao.GetById(id, model)
  26. return model
  27. }
  28. // Delete 批量删除
  29. func (this RunService) Delete(list []int64) {
  30. this.RunDao.Delete(&model.Run{}, list)
  31. }
  32. // Edit 修改
  33. func (this RunService) Edit(run *model.Run, cols []string) {
  34. this.RunDao.Update(run, cols...)
  35. }