puzhibing
2023-10-08 22199bbdda579861736420fe26c2873ab0f5d21c
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.sinata.rest.modular.mall.controller;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sinata.common.enums.EnumIsDelete;
import com.sinata.rest.common.ApiUtils;
import com.sinata.rest.modular.mall.model.MallAppVersion;
import com.sinata.rest.modular.mall.service.IMallAppVersionService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
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;
 
/**
 * <p>
 * APP版本 前端控制器
 * </p>
 *
 * @author goku
 * @since 2023-03-23
 */
@RestController
@RequestMapping("/mall/appVersion")
//@Api(tags = "商城-用户中心", description = "用户中心")
public class MallAppVersionController {
 
    @Autowired
    IMallAppVersionService appVersionService;
 
    @GetMapping(value = "/appVersion")
    @ApiOperation(value = "APP版本管理", notes = "APP版本管理")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "type", value = "APP类型:0安卓,1苹果", dataType = "Int", paramType = "query", required = true),
    })
    public ApiUtils<MallAppVersion> appVersion(Integer type) {
        LambdaQueryWrapper<MallAppVersion> wrapper = new LambdaQueryWrapper<>();
        if (type != null) {
            wrapper.eq(MallAppVersion::getVersionType, type);
        }
        wrapper.eq(MallAppVersion::getIsDelete, EnumIsDelete.EXISTED.index);
        wrapper.orderByDesc(MallAppVersion::getId);
 
        MallAppVersion appVersion = appVersionService.getOne(wrapper);
        return ApiUtils.returnOK(appVersion);
    }
 
}