|
@@ -19,11 +19,7 @@ import com.szwl.service.TEquipmentService;
|
|
|
import com.szwl.service.TLogoService;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.jws.Oneway;
|
|
|
import java.io.IOException;
|
|
@@ -55,30 +51,17 @@ public class TLogoController {
|
|
|
@Autowired
|
|
|
TLogoService tLogoService;
|
|
|
|
|
|
-// @ApiOperation(value = "定制logo")
|
|
|
-// @PostMapping("/customLogo")
|
|
|
-// public ResponseModel<?> customLogo(@RequestBody TEquipment equipment) {
|
|
|
-//
|
|
|
-// // 根据id找到当前设备
|
|
|
-// TEquipment tEquipment = tEquipmentService.getById(equipment.getId());
|
|
|
-// if (tEquipment == null) {
|
|
|
-// return R.fail("设备为空");
|
|
|
-// }
|
|
|
-// // 当前设备的用户id
|
|
|
-// Long adminId = tEquipment.getAdminId();
|
|
|
-// // 根据用户id查看用户类型
|
|
|
-// Integer userType = tAdminService.getById(adminId).getType();
|
|
|
-// // 仅管理员可修改logo
|
|
|
-// if (userType != null && (userType == 0 || userType == 1)) {
|
|
|
-// // 获取当前logo信息
|
|
|
-// TLogo tLogo = tLogoService.getById(adminId);
|
|
|
-// System.out.println(tLogo);
|
|
|
-// // 修改logo
|
|
|
-// tLogoService.updateById(tLogo);
|
|
|
-// return R.ok(null,"logo已修改");
|
|
|
-// }
|
|
|
-// return R.fail(P0001,"仅管理员可修改logo");
|
|
|
-// }
|
|
|
+ @ApiOperation(value = "定制logo")
|
|
|
+ @GetMapping("/newCustomLogo")
|
|
|
+ public ResponseModel<?> customLogo(Long id, String logoNumber) {
|
|
|
+ // 根据id找到当前设备
|
|
|
+ TEquipment equipment = tEquipmentService.getById(id);
|
|
|
+ if (equipment == null) {
|
|
|
+ return R.fail("设备为空");
|
|
|
+ }
|
|
|
+ tEquipmentService.sentMessage(equipment.getClientId(), PushUtils.buildJson("customLogo", logoNumber).toString());
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation(value = "定制logo")
|
|
|
@PostMapping("/customLogo")
|