puzhibing
2026-02-14 759c5b1cad51c74c590135ebadbfb410731dcd10
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
package com.xiaopeng.maintenance.controller;
 
import com.xiaopeng.api.model.maintenance.XpCheckLocation;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.enums.DisabledEnum;
import com.xiaopeng.common.security.service.TokenService;
import com.xiaopeng.maintenance.service.IXpCheckLocationService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * @author MiTao
 * @date 2026-02-12 21:17
 *
 */
@Validated
@RestController
@RequiredArgsConstructor(onConstructor_ = @Lazy)
public class XpCheckLocationController {
    private final IXpCheckLocationService xpCheckLocationService;
    private final TokenService tokenService;
 
    @GetMapping("/api/v1/check-location/list")
    @ApiOperation(value = "获取打卡地址列表", tags = {"管理后台-车队管理"})
    public  R<List<XpCheckLocation>> getList(){
        return R.ok(xpCheckLocationService.lambdaQuery().eq(XpCheckLocation::getStatus, DisabledEnum.YES.getCode()).list());
    }
 
    @GetMapping("/inner/check-location/queryById")
    @ApiOperation(value = "根据ID查询打卡地址", tags = {"内部接口"})
    public R<XpCheckLocation> queryById(@RequestParam Long id) {
        return R.ok(xpCheckLocationService.getById(id));
    }
 
    @ApiOperation(value = "根据ID查询打卡地址", tags = {"运维APP-排班与考勤"})
    @GetMapping("/api/v1/check-location/queryByUserId")
    public R<XpCheckLocation> queryByUserId() {
        Long id = tokenService.getLoginOperationUser().getId();
        return R.ok(xpCheckLocationService.queryByUserId(id));
    }
 
}