despatchConfigServices.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package services
  2. import (
  3. "fwh-toolbox-server/dto"
  4. "fwh-toolbox-server/repositories"
  5. )
  6. // ============ fwh_pro(生产环境)============
  7. // 查询模版列表
  8. func GetTouTemplateProList(pageNum uint, pageSize uint, tempType *int, status *int, search string) (*dto.ResPage[interface{}], error) {
  9. return repositories.QueryTouTemplateInfoList(search, pageSize, pageNum, tempType, status)
  10. }
  11. // 查询模版信息
  12. func GetTouTemplateProDetailInfo(id uint) (*interface{}, error) {
  13. return repositories.QueryTouTemplateDetailInfo(id)
  14. }
  15. // ============ fwh_test(测试环境)============
  16. // FwhTestGetTouTemplateProList 查询模版列表
  17. func FwhTestGetTouTemplateProList(pageNum uint, pageSize uint, tempType *int, status *int, search string) (*dto.ResPage[interface{}], error) {
  18. return repositories.FwhTestQueryTouTemplateInfoList(search, pageSize, pageNum, tempType, status)
  19. }
  20. // FwhTestGetTouTemplateProDetailInfo 查询模版信息
  21. func FwhTestGetTouTemplateProDetailInfo(id uint) (*interface{}, error) {
  22. return repositories.FwhTestQueryTouTemplateDetailInfo(id)
  23. }
  24. // FwhTestSaveTouTemplate 新增/更新 TOU 模版(updateOrSaveIotTouTemplate)
  25. // payload.Template.TemplateId 有值表示更新,为空表示新增。返回模版 ID。
  26. func FwhTestSaveTouTemplate(payload dto.FwhTestUpdateOrSaveTouTemplatePayload) (int64, error) {
  27. return repositories.FwhTestUpdateOrSaveTouTemplate(payload)
  28. }
  29. // FwhTestGetTouTemplateCitesList 查询国家/省/市列表
  30. // countryId 与 cityType 均为 nil:查询国家信息。
  31. // TOU 模板页面查询城市/省时 cityType 必须为 1。
  32. func FwhTestGetTouTemplateCitesList(countryId *int, cityType *int) (*dto.FwhTestCitesListData, error) {
  33. return repositories.FwhTestSelectCitesList(countryId, cityType)
  34. }