forked from gzzfw/backEnd/gz-dyh

liyj
2024-09-03 0fc5b15d68684c28e1d0a434fcd4a105891b6439
1、小程序端生成id接口
1 files added
68 ■■■■■ changed files
dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/controller/wechat/CaseUtilsWechatController.java 68 ●●●●● patch | view | raw | blame | history
dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/controller/wechat/CaseUtilsWechatController.java
New file
@@ -0,0 +1,68 @@
package cn.huge.module.mediate.controller.wechat;
import cn.huge.base.common.utils.ReturnFailUtils;
import cn.huge.base.common.utils.ReturnSucUtils;
import cn.huge.module.mediate.service.CaseInfoService;
import cn.huge.module.mediate.service.JudicInfoService;
import cn.huge.module.mediate.utils.CaseIdUtils;
import cn.huge.module.mediate.utils.MediateIdUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
 * @title: 提供前端生成id公共api-纠纷相关
 * @description: 提供前端生成id公共api-纠纷相关
 * @company: hugeinfo
 * @author: liyj
 * @time: 2022-04-29 10:12:39
 * @version: 1.0.0
 */
@Slf4j
@RestController
@RequestMapping("/api/wechat/caseUtils")
public class CaseUtilsWechatController {
    @Autowired(required = false)
    private HttpServletRequest request;
    @Autowired
    private CaseInfoService caseInfoService;
    @Autowired
    private JudicInfoService judicInfoService;
    /**
     * 公共id-获取时间Id,后四位常量
     * @url {ctx}/api/wechat/caseUtils/getNewTimeId
     * @return Object
     */
    @GetMapping("/getNewTimeId")
    public Object getNewTimeId() {
        try {
            return ReturnSucUtils.getRepInfo(MediateIdUtils.getNewTimeId());
        } catch (Exception e) {
            return ReturnFailUtils.getRepInfo();
        }
    }
    /**
     * 案件id-获取时间Id,后四位常量
     * @url {ctx}/api/wechat/caseUtils/getNewTimeCaseId
     * @return Object
     */
    @GetMapping("/getNewTimeCaseId")
    public Object getNewTimeCaseId() {
        try {
            return ReturnSucUtils.getRepInfo(CaseIdUtils.getNewTimeId());
        } catch (Exception e) {
            return ReturnFailUtils.getRepInfo();
        }
    }
}