陶杰
2024-08-22 ee9032d9baf5f33e376d2d2699136e0a7b26bec7
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
package com.mzl.flower.web.pub;
 
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.constant.Constants;
import com.mzl.flower.dto.response.content.AdvertisementDTO;
import com.mzl.flower.service.content.AdvertisementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.validation.constraints.NotNull;
import java.util.List;
 
@RestController
@RequestMapping("/api/pub/advertisement")
@Api(value = "广告管理-未登录", tags = "广告管理-未登录")
@Validated
@Slf4j
public class PubAdvertisementController extends BaseController {
 
 
    private final AdvertisementService advertisementService;
 
    public PubAdvertisementController(AdvertisementService advertisementService) {
        this.advertisementService = advertisementService;
    }
    @GetMapping("/page/view")
    @ApiOperation(value = "详情", notes = "详情")
    public ResponseEntity<ReturnDataDTO<AdvertisementDTO>> detail(@NotNull(message = "id不能为空") Long id) {
        return returnData(R.SUCCESS.getCode(),advertisementService.detail(id));
    }
 
    @GetMapping("/list")
    @ApiOperation(value = "用户端-查询列表", notes = "用户端-查询列表")
    public ResponseEntity<ReturnDataDTO<List<AdvertisementDTO>>> queryList(String title) {
        return returnData(R.SUCCESS.getCode(), advertisementService.queryList(title,Constants.COMMON_PUBLISH_STATUS.published.name()));
    }
 
 
}