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));
|
}
|
|
}
|