package com.webchat.controller.client;

import com.webchat.common.bean.APIResponseBean;
import com.webchat.common.bean.APIResponseBeanUtil;
import com.webchat.domain.vo.response.publicaccount.PublicAccountVO;
import com.webchat.service.publicaccount.PublicAccountService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "【客户端】公众号服务接口")
@RestController
@RequestMapping("/api/public-account")
public class PublicAccountController {

    @Autowired
    private PublicAccountService publicAccountService;

    /**
     * 全部公众号列表
     *
     * @return
     */
    @GetMapping("/list")
    public APIResponseBean<List<PublicAccountVO>> list() {

        return APIResponseBeanUtil.success(publicAccountService.getPublicAccountListFromCache());
    }
}
