city_service.go 992 B

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