| package com.doumee.api.common; | 
|   | 
| import com.alibaba.fastjson.JSONObject; | 
| import com.doumee.api.BaseController; | 
| import com.doumee.biz.system.SystemDictDataBiz; | 
| import com.doumee.core.annotation.trace.Trace; | 
| import com.doumee.core.constants.Constants; | 
| import com.doumee.core.model.ApiResponse; | 
| import com.doumee.core.utils.DateUtil; | 
| import com.doumee.core.utils.aliyun.ALiYunUtil; | 
| import com.doumee.core.wx.WxMiniUtilService; | 
| import com.doumee.dao.business.model.Locks; | 
| import com.doumee.service.business.DeviceService; | 
| import io.swagger.annotations.Api; | 
| import io.swagger.annotations.ApiImplicitParam; | 
| import io.swagger.annotations.ApiImplicitParams; | 
| import io.swagger.annotations.ApiOperation; | 
| import lombok.extern.slf4j.Slf4j; | 
| import org.apache.commons.lang3.StringUtils; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.web.bind.annotation.*; | 
| import org.springframework.web.multipart.MultipartFile; | 
| import org.springframework.web.multipart.MultipartHttpServletRequest; | 
| import org.springframework.web.multipart.commons.CommonsMultipartResolver; | 
|   | 
| import javax.servlet.http.HttpServletRequest; | 
| import javax.servlet.http.HttpServletResponse; | 
| import java.io.File; | 
| import java.io.IOException; | 
| import java.io.PrintWriter; | 
| import java.util.HashMap; | 
| import java.util.Iterator; | 
| import java.util.Map; | 
| import java.util.UUID; | 
|   | 
| /** | 
|  * @author Eva.Caesar Liu | 
|  * @date 2023/02/14 11:14 | 
|  */ | 
| @Api(tags = "测试接口工具") | 
| @Trace(exclude = true) | 
| @RestController | 
| @RequestMapping("/test") | 
| @Slf4j | 
| public class TestController extends BaseController { | 
|   | 
|   | 
|     @Autowired | 
|     private WxMiniUtilService wxMiniUtilService; | 
|     @Autowired | 
|     private DeviceService deviceService; | 
|   | 
|   | 
|     @ApiOperation(value = "测试mqtt发布消息", notes = "上传", httpMethod = "POST", position = 6) | 
|     @ApiImplicitParams({ | 
|         @ApiImplicitParam(name = "topic", value = "主题", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class), | 
|         @ApiImplicitParam(name = "json", value = "内容", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class), | 
|     }) | 
|     @PostMapping(value = "/testPush" ) | 
|     public void testPush(@RequestParam String topic,@RequestParam String json, HttpServletRequest request, HttpServletResponse response) throws Exception { | 
|         deviceService.testPush(topic,json); | 
|     } | 
|   | 
|   | 
|     @ApiOperation(value = "测试生成二维码", notes = "小程序端") | 
|     @GetMapping("/getCode") | 
|     public ApiResponse<Locks> generateWXMiniCode() { | 
|         Locks locks = new Locks(); | 
|         locks.setCode(12); | 
|         locks.setSiteId("1005"); | 
| //        wxMiniUtilService.generateWXMiniCode(locks); | 
|         return  ApiResponse.success("操作成功",locks); | 
|     } | 
|   | 
| } |