“mitao”
2026-03-10 eb290fd6e70b6523ea0889936dba4d9f2d5c4b53
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
package com.xiaopeng.operation.controller;
 
import com.xiaopeng.api.model.operation.XpAppVersion;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.page.BasePage;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.operation.service.IXpAppVersionService;
import com.xiaopeng.operation.vo.XpAppVersionVO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
 
/**
 * App版本管理 Controller
 *
 * @author mitao
 * @since 2026-02-14
 */
@Slf4j
@RestController
@RequiredArgsConstructor(onConstructor_ = @Lazy)
public class XpAppVersionController {
 
    private final IXpAppVersionService appVersionService;
 
    /**
     * 获取App最新版本(运维APP接口)
     */
    @GetMapping("/api/v1/app/version/latest")
    @ApiOperation(value = "获取App最新版本", tags = {"运维APP-版本管理"})
    public R<XpAppVersionVO> getLatestVersion() {
        log.info("查询App最新版本");
        XpAppVersionVO vo = appVersionService.getLatestVersion();
        return R.ok(vo);
    }
 
    @ApiOperation(value = "获取版本管理分页列表", tags = "管理后台-APP版本")
    @PostMapping("/api/v1/appVersion/page")
    public R<PageInfo<XpAppVersion>> getPageList(@RequestBody BasePage basePage) {
        return R.ok(appVersionService.getPageList(basePage));
    }
 
    @ApiOperation(value = "发布APP版本", tags = "管理后台-APP版本")
    @PostMapping("/api/v1/appVersion/release")
    public R<?> release(@RequestBody XpAppVersion appVersion) {
        appVersionService.release(appVersion);
        return R.ok();
    }
}