fix
Helius
2022-07-11 a56380c00de70b79f7fd4f986139e1c342821bac
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
package com.xcong.farmer.cms.modules.system.controller;
 
import com.xcong.farmer.cms.common.response.Result;
import com.xcong.farmer.cms.modules.system.dto.SetWebSettingDto;
import com.xcong.farmer.cms.modules.system.service.IReleaseService;
import com.xcong.farmer.cms.modules.system.service.IWebSettingService;
import com.xcong.farmer.cms.modules.system.util.LoginUserUtil;
import com.xcong.farmer.cms.modules.system.vo.AdminSeeWebSetInfoVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import javax.validation.Valid;
 
@RestController
@RequestMapping(value = "/api/webset")
@Slf4j
@Api(value = "网页设置", tags = "网页设置")
public class AdminWebSetController {
 
    @Resource
    private IWebSettingService iWebSetService;
 
    @Resource
    private IReleaseService releaseService;
 
    @ApiOperation(value = "查看网页设置", notes = "查看网页设置")
    @ApiResponses({
            @ApiResponse(code = 200, message = "success", response = AdminSeeWebSetInfoVo.class)
    })
    @GetMapping(value = "/seeWebSetInfo")
    public Result seeWebSetInfo() {
        return iWebSetService.getWebSetting();
    }
 
    @ApiOperation(value = "更新网页设置", notes = "更新网页设置")
    @PostMapping(value = "/updateWebSet")
    public Result updateWebSet(@RequestBody @Valid SetWebSettingDto setWebSettingDto) {
        return iWebSetService.setWebSetting(setWebSettingDto);
    }
 
    @ApiOperation(value = "发布全站", notes = "发布全站")
    @PostMapping(value = "/releaseAll")
    public Result releaseAll() {
        Long companyId = LoginUserUtil.getCompanyId();
        releaseService.releaseAll(companyId);
        return Result.ok("发布成功");
    }
}