2 小时以前 6d910029b6c81db0a2b66caa66952781397b153a
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
package cn.iocoder.yudao.module.mes.controller.pub.trace;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.mes.controller.pub.trace.vo.MesProTracePublicRespVO;
import cn.iocoder.yudao.module.mes.service.trace.MesProTracePublicService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.annotation.security.PermitAll;
import jakarta.validation.constraints.NotEmpty;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
/**
 * H5 扫码溯源 - 公开查询
 * <p>
 * 免登录(@PermitAll)面向公众提供全程溯源查询,作为追溯体系的核心产品载体。
 * 后续新增数据源在 {@link MesProTracePublicRespVO} 中追加信息区块即可。
 */
@Tag(name = "H5 扫码溯源 - 公开查询")
@RestController
@RequestMapping("/public/mes/trace")
@Validated
public class MesProTracePublicController {
 
    @Resource
    private MesProTracePublicService service;
 
    @GetMapping("/query")
    @PermitAll
    @Operation(summary = "根据追溯码查询全程溯源信息")
    public CommonResult<MesProTracePublicRespVO> query(@RequestParam("code") @NotEmpty(message = "追溯码不能为空") String code) {
        return success(service.queryTrace(code));
    }
 
}