|
|
@@ -89,7 +89,6 @@ func (s *lampPoleService) List(searchValue, groupId, boxId string, current, size
|
|
|
device := dao.LampPole{}
|
|
|
if searchValue != "" {
|
|
|
device.PoleSN = searchValue
|
|
|
- device.PoleName = searchValue
|
|
|
}
|
|
|
|
|
|
device.GroupId = utils.StringToInt(groupId)
|
|
|
@@ -124,49 +123,16 @@ func (s *lampPoleService) Remove(id int) *utils.Errors {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-func (s *lampPoleService) GetList() ([]dao.LampPole, *utils.Errors) {
|
|
|
+func (s *lampPoleService) GetList() ([]*dao.LampPole, *utils.Errors) {
|
|
|
// todo use redis cache
|
|
|
device := &dao.LampPole{
|
|
|
TenantId: "000000", // todo 使用登录态
|
|
|
IsDeleted: 0,
|
|
|
}
|
|
|
devices, err := device.GetAllDevices()
|
|
|
- if err != nil {
|
|
|
- return nil, utils.FailResponse(err.Error(), nil)
|
|
|
- }
|
|
|
-
|
|
|
- return devices, nil
|
|
|
-}
|
|
|
-
|
|
|
-func (s *lampPoleService) GetFiltration() ([]dao.LampPole, *utils.Errors) {
|
|
|
- // todo use redis cache
|
|
|
- device := &dao.LampPole{
|
|
|
- TenantId: "000000", // todo 使用登录态
|
|
|
- IsDeleted: 0,
|
|
|
- }
|
|
|
-
|
|
|
- //todo
|
|
|
- // get t_dev_light_control _id
|
|
|
- // Ids := lightControl.GetIds()
|
|
|
-
|
|
|
- devices, err := device.GetAllDevices()
|
|
|
- if err != nil {
|
|
|
- return nil, utils.FailResponse(err.Error(), nil)
|
|
|
+ for _, device := range devices {
|
|
|
+ device.PoleName = device.PoleName + "(" + device.PoleSN + ")"
|
|
|
}
|
|
|
-
|
|
|
- return devices, nil
|
|
|
-}
|
|
|
-
|
|
|
-func (s *lampPoleService) GetTree() ([]dao.LampPole, *utils.Errors) {
|
|
|
- // todo use redis cache
|
|
|
- device := &dao.LampPole{
|
|
|
- TenantId: "000000", // todo 使用登录态
|
|
|
- IsDeleted: 0,
|
|
|
- }
|
|
|
-
|
|
|
- //todo lampPole getALlDevice
|
|
|
-
|
|
|
- devices, err := device.GetAllDevices()
|
|
|
if err != nil {
|
|
|
return nil, utils.FailResponse(err.Error(), nil)
|
|
|
}
|