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("发布成功"); } }