package com.zy.bms.controller.pc; import com.zy.bms.common.Constant; import com.zy.bms.common.ServerResponse; import com.zy.bms.common.io.pc.MqttLogsIO; import com.zy.bms.service.MqttLogService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.HashMap; /** * mqtt收发日志 * * @author yang xiao kun * create on 2021/1/21 */ @RestController @RequestMapping("bms/api/pc/logs") public class PcMqttLogController { @Resource private MqttLogService mqttLogService; private static HashMap instruction = new HashMap<>(); /* * 所有指令暂时写死内存中 */ static { instruction.put(Constant.M_CODE_REGISTER, "注册"); instruction.put(Constant.M_CODE_RETURN_CODE, "返回授权码"); instruction.put(Constant.M_CODE_UPLOAD_LOCATION, "上传位置信息"); instruction.put(Constant.M_CODE_GPS_RATE, "设置定位频率"); instruction.put(Constant.M_CODE_SOS, "设置联系人"); instruction.put(Constant.M_CODE_VOLUME, "设置音量"); instruction.put(Constant.M_CODE_AUTO_ANSWER, "设置自动接听"); instruction.put(Constant.M_CODE_NEWS, "设置语音播报"); instruction.put(Constant.M_CODE_UPLOAD_CALL_RECORD, "上传通话记录"); instruction.put(Constant.M_CODE_CONTINUE_GPS, "设置连续定位"); } /** * 分页查询日志 */ @GetMapping("listPage.do") public ServerResponse getListPage(MqttLogsIO io) { return ServerResponse.createBySuccess(mqttLogService.getListPage(io)); } /** * 查询所有的指令 */ @GetMapping("getInstruction.do") public ServerResponse getInstruction() { return ServerResponse.createBySuccess(instruction); } }