fix
Helius
2022-11-12 8c653240c5174e3182faf899b0ada989d4dcfe5f
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
57
58
59
60
61
62
63
64
package com.xcong.farmer.cms.modules.core.controller;
 
import com.xcong.farmer.cms.common.response.Result;
import com.xcong.farmer.cms.modules.core.service.ICmsCoreService;
import com.xcong.farmer.cms.modules.system.service.IArticleService;
import com.xcong.farmer.cms.modules.system.service.IReleaseService;
import com.xcong.farmer.cms.modules.system.util.LoginUserUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
/**
 * @author wzy
 * @date 2022-07-03
 **/
@Slf4j
@RestController
@RequestMapping(value = "/api")
@Api(value = "CmsCoreController", tags = "CMS核心类")
public class CmsCoreController {
 
    @Autowired
    private IReleaseService releaseService;
 
    @ApiOperation(value = "发布文章", notes = "发布文章")
    @PostMapping(value = "releaseArticle/{id}")
    public Result releaseArticle(@PathVariable("id") Long id) {
        Long companyId = LoginUserUtil.getCompanyId();
//        Long companyId = 24L;
        releaseService.releaseArticle(id, companyId);
        return Result.ok("success");
    }
 
    @ApiOperation(value = "发布栏目", notes = "发布栏目")
    @PostMapping(value = "releaseColumn/{type}/{id}")
    public Result releaseColumn(@PathVariable("id") Long id, @PathVariable("type") Integer type) {
        Long companyId = LoginUserUtil.getCompanyId();
//        Long companyId = 24L;
        releaseService.releaseColumn(id, type, companyId);
        return Result.ok("success");
    }
 
    @ApiOperation(value = "发布首页", notes = "发布首页")
    @PostMapping(value = "/releaseIndex")
    public Result releaseIndex() {
        Long companyId = LoginUserUtil.getCompanyId();
//        Long companyId = 24L;
        releaseService.releaseIndex(companyId, true);
        return Result.ok("success");
    }
 
    @ApiOperation(value = "发布全站", notes = "发布全站")
    @PostMapping(value = "/releaseAll")
    public Result releaseAll() {
        Long companyId = LoginUserUtil.getCompanyId();
//        Long companyId = 24L;
        releaseService.releaseAll(companyId);
        return Result.ok("发布成功");
    }
 
}