| | |
| | | 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.common.log.annotation.AdminOperationLog; |
| | | import com.xiaopeng.common.log.enums.AdminBusinessType; |
| | | import com.xiaopeng.common.log.enums.AdminOperationType; |
| | | import com.xiaopeng.operation.service.IXpAppVersionService; |
| | | import com.xiaopeng.operation.vo.XpAppVersionVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.xiaopeng.common.log.annotation.AdminOperationLog; |
| | | import com.xiaopeng.common.log.enums.AdminBusinessType; |
| | | import com.xiaopeng.common.log.enums.AdminOperationType; |
| | | |
| | | /** |
| | | * App版本管理 Controller |
| | |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("") |
| | | @Api(tags = "App版本管理") |
| | | @RequiredArgsConstructor(onConstructor_ = @Lazy) |
| | | public class XpAppVersionController { |
| | | |
| | | private final IXpAppVersionService appVersionService; |
| | | |
| | | public XpAppVersionController(IXpAppVersionService appVersionService) { |
| | | this.appVersionService = appVersionService; |
| | | } |
| | | |
| | | /** |
| | | * 获取App最新版本(运维APP接口) |
| | | */ |
| | | @GetMapping("/api/v1/app/version/latest") |
| | | @GetMapping("/maintenance-app/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") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.APP_VERSION, |
| | | operationType = AdminOperationType.RELEASE, |
| | | content = "发布APP版本", |
| | | appendRequestData = true |
| | | ) |
| | | public R<?> release(@RequestBody XpAppVersion appVersion) { |
| | | appVersionService.release(appVersion); |
| | | return R.ok(); |
| | | } |
| | | } |