jiangping
2025-02-19 dfafe88917bd344d570277f14b7ea7bf03fa93d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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);
    }
 
}