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
50
51
52
53
54
55
56
package com.sinata.rest.modular.system.controller.common;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sinata.rest.common.ApiUtils;
import com.sinata.rest.modular.system.model.AppSet;
import com.sinata.rest.modular.system.model.SystemSet;
import com.sinata.rest.modular.system.service.IAppSetService;
import com.sinata.rest.modular.system.service.ISystemSetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
 
@Controller
@RequestMapping("/h5")
@Api(tags = "H5页面", description = "H5页面:详情")
public class H5Controller {
 
    @Autowired
    private IAppSetService appSetService;
 
    @Autowired
    private ISystemSetService setService;
 
    @ResponseBody
    @GetMapping(value = "/getIdRemark")
    @ApiOperation(value = "获取ID说明", notes = "获取ID说明", response = ApiUtils.class)
    public Object getId() {
        return appSetService.list(new LambdaQueryWrapper<AppSet>().select(AppSet::getId, AppSet::getRemark));
    }
 
    @RequestMapping(value = "/queryH5", method = RequestMethod.GET)
    @ApiOperation(value = "查看说明详情", notes = "查看说明详情", response = ApiUtils.class)
    @ApiImplicitParam(name = "id", value = "详情ID", dataType = "Int", defaultValue = "1", paramType = "query", required = true)
    public String queryH5(Integer id, Model model) {
        AppSet set = appSetService.getById(id);
        model.addAttribute("content", set == null ? "" : set.getValueStr());
        return "detailH5.html";
    }
 
    @ResponseBody
    @RequestMapping(value = "/querySet", method = RequestMethod.GET)
    @ApiOperation(value = "获取系统设置", notes = "获取系统设置", response = ApiUtils.class)
    @ApiImplicitParam(name = "id", value = "设置ID", dataType = "Int", defaultValue = "1", paramType = "query", required = true)
    public ApiUtils queryH5(Integer id) {
        SystemSet set = setService.getById(id);
        return ApiUtils.returnOK(set.getValueStr());
    }
 
}